get some data!
import os
from zipfile import ZipFile
ZipFile('KASCADE_SmallDataSample_wA_runs_0877-7417_ROOT.zip').extractall()
os.listdir()
['.ipynb_checkpoints', 'KCDC_analyze_example.C', 'slides.ipynb', 'KASCADE_SmallDataSample_wA_runs_0877-7417_ROOT.zip', 'info.txt', 'events.root', 'EULA.pdf']
switch kernels and run some c++
.L KCDC_analyze_example.C
run()
Input file:events.root KCDC-Entries read from files: 1080295 KCDCM-Entries: 1080295 Array Entries: 986577 Calor Entries: 250981 Grande Entries: 88259 General Entries: 1080295 KCDCN-Entries to be evaluated: 1080295 processing event No: 0 of 1080295 processing event No: 100000 of 1080295 processing event No: 200000 of 1080295 processing event No: 300000 of 1080295 processing event No: 400000 of 1080295 processing event No: 500000 of 1080295 processing event No: 600000 of 1080295 processing event No: 700000 of 1080295 processing event No: 800000 of 1080295 processing event No: 900000 of 1080295 processing event No: 1000000 of 1080295 Entries survived:: 1080295 out of 1080295 general_id >0 :: 1080295 array_id >0 :: 986577 calorimter_id >0:: 250981 grande_id >0 :: 88259 (int) 0
switch back to Python and look at the result
import ROOT
f = ROOT.TFile('KCDC_Test.root')
keys = [_.GetName() for _ in f.GetListOfKeys()]
c = ROOT.TCanvas("foo", "bar", 1920, 1080*len(keys)//4)
c.Divide(2,len(keys)//2)
c.SetLogy()
pad = 0
logspectra = ['h6202', 'h6302', 'h7202']
for key in keys:
pad+=1
c.cd(pad)
if key in logspectra:
ROOT.gPad.SetLogy()
f.Get(key).Draw()
Welcome to JupyROOT 6.20/04
c.Draw()