Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions tutorials/hist/hist007_TH1_liveupdate.C
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,9 @@ void hist007_TH1_liveupdate()
}
if (slider)
slider->SetRange(0., 1. * i / 10000.);
c1->Modified();
c1->Update();
c1->ModifiedUpdate();
}
}
slider->SetRange(0., 1.);
c1->Modified();
c1->ModifiedUpdate();
}
7 changes: 3 additions & 4 deletions tutorials/hist/hist007_TH1_liveupdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
##
## \author Wim Lavrijsen

from ROOT import TCanvas, TH1F, TSlider
from ROOT import gROOT, gBenchmark, gRandom

Check failure on line 12 in tutorials/hist/hist007_TH1_liveupdate.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (F401)

tutorials/hist/hist007_TH1_liveupdate.py:12:18: F401 `ROOT.gROOT` imported but unused

Check failure on line 12 in tutorials/hist/hist007_TH1_liveupdate.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (I001)

tutorials/hist/hist007_TH1_liveupdate.py:11:1: I001 Import block is un-sorted or un-formatted

# Create a new canvas, and customize it.
c1 = TCanvas( 'c1', 'The HSUM example', 200, 10, 600, 400 )
c1.SetGrid();

Check failure on line 16 in tutorials/hist/hist007_TH1_liveupdate.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (E703)

tutorials/hist/hist007_TH1_liveupdate.py:16:13: E703 Statement ends with an unnecessary semicolon

gBenchmark.Start( 'hsum' )

Expand Down Expand Up @@ -47,14 +47,14 @@
xmain = gauss( -1, 1.5 )
xs1 = gauss( -0.5, 0.5 )
xs2 = landau( 1, 0.15 )
mainFill( xmain )

Check failure on line 50 in tutorials/hist/hist007_TH1_liveupdate.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (F821)

tutorials/hist/hist007_TH1_liveupdate.py:50:4: F821 Undefined name `mainFill`

# Fill histograms.
s1Fill( xs1, 0.3 )

Check failure on line 53 in tutorials/hist/hist007_TH1_liveupdate.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (F821)

tutorials/hist/hist007_TH1_liveupdate.py:53:4: F821 Undefined name `s1Fill`
s2Fill( xs2, 0.2 )

Check failure on line 54 in tutorials/hist/hist007_TH1_liveupdate.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (F821)

tutorials/hist/hist007_TH1_liveupdate.py:54:4: F821 Undefined name `s2Fill`
totalFill( xmain )

Check failure on line 55 in tutorials/hist/hist007_TH1_liveupdate.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (F821)

tutorials/hist/hist007_TH1_liveupdate.py:55:4: F821 Undefined name `totalFill`
totalFill( xs1, 0.3 )

Check failure on line 56 in tutorials/hist/hist007_TH1_liveupdate.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (F821)

tutorials/hist/hist007_TH1_liveupdate.py:56:4: F821 Undefined name `totalFill`
totalFill( xs2, 0.2 )

Check failure on line 57 in tutorials/hist/hist007_TH1_liveupdate.py

View workflow job for this annotation

GitHub Actions / ruff

ruff (F821)

tutorials/hist/hist007_TH1_liveupdate.py:57:4: F821 Undefined name `totalFill`

# Update display every kUPDATE events.
if i and (i%kUPDATE) == 0 :
Expand All @@ -70,8 +70,7 @@
if slider:
slider.SetRange( 0, float(i) / 10000. )

c1.Modified()
c1.Update()
c1.ModifiedUpdate()

# Destroy member functions cache.
for name in histos:
Expand All @@ -81,7 +80,7 @@
# Done, finalized and trigger an update.
slider.SetRange( 0, 1 )
total.Draw( 'sameaxis' ) # to redraw axis hidden by the fill area
c1.Modified()
c1.Update()
c1.ModifiedUpdate()

gBenchmark.Show( 'hsum' )
c1.Draw(block=True)
Loading