How to quickly check output D3PDs ?
...more detailed info coming soon...
With CINT :
root -l SUSY.root
root [0]
Attaching file SUSY.root as _file0...
root [1] ROOT::Cintex::Enable()
root [2] gSystem->Load("libATLASWatchManDict")
(int)1
root [3] SUSYTree
(class TTree*)0x921ab60
root [4] SUSYTree->Draw("@jet4mom.size()")
you get the number of the jets distribution
root [5] SUSYTree->Draw("@jet4mom.size()","channels.data()==\"l\"")
distribution of the number of jets only for those events passing the set of cuts of the analysis/channel "l".
root [6] SUSYTree->Draw("@jet4mom.size()","channels.data()==\"999\"")
As for that example we switched off the skimming, we keep all the events, even those not passing at least one analysis/channel. They are flagged by default as "channels=='999'".
With pyroot :
import ROOT
import ATLASWatchMan.Bindings
f = ROOT.TFile("SUSY.root")
t = f.Get("SUSYTree")
#loop over the events
for ev in range(t.GetEntries()):
t.GetEntry(ev)
for i,el in enumerate(t.electron4mom):
print "el.Pt(): ", el.Pt()
for chan in t.electronChannels[i]:
print "el chan: ", chan
print
if "1lep" in t.electronChannels[i]:
print "I'm using the right electron for the '1lep' channel: Ok!"
if "DEFAULT" in t.electronChannels[i]:
print "I'm using the right electron for the 'DEFAULT' channel: Ok!"
#Now I want to use jets as well.In the same way you can ask jets belonging only to a particular channel
for j,jet in enumerate(t.jet4mom):
if "1lep" in t.electronChannels[i] and "1lep" in t.jetChannels[j]:
print "I'm using the right electron and the right jet for the '1lep' channel: Ok!"
print "An example: if for this '1lep' channel I applied overlap removal with dR<0.2,"
print "when I select '1lep' as here, I can be sure I will not find here any jet and electron closer than dR<0.2."
To see e.g. if an event passed a cut you can also run:
import ROOT
import ATLASWatchMan.Bindings
f=ROOT.TFile("OutputD3PD.root")
treeName='D3PDTree'
t=f.Get(treeName)
nevts=t.GetEntries()
for ievt in range(nevts):
t.GetEntry(ievt)
print "evt ",ievt
for ichan in range( t.channels.size()):
print t.channels.at(ichan)
-- Main.RenaudBruneliere - 10 Feb 2009
-- Main.JanetDietrich - 20 Mar 2009