100 likes | 140 Views
ARA Tutorial. Analysis Tutorial WIS Sep-Oct 2008. What is ARA. AthenaROOTAccess (ARA) allows accessing Athena POOL data directly from ROOT, without using the Athena framework. There are some things that cannot be done in ARA, e.g., there is no detector description.
E N D
ARA Tutorial Analysis Tutorial WIS Sep-Oct 2008
What is ARA • AthenaROOTAccess (ARA) allows accessing Athena POOL data directly from ROOT, without using the Athena framework. • There are some things that cannot be done in ARA, e.g., there is no detector description. • The code that is written for ARA analysis will look different than what you write for AOD analysis, so if you analyze both forms, then you will have to maintain two pieces of code. • The CINT option.
3, 2, 1, Go!!! • Load the file: /agrp/raza/athena/testarea/AtlasOffline-14.2.10/run/load.py python -i load.py • Start working tt.Print() tt.GetEntry(0) jets = tt.Cone4H1TopoJets dir(jets) len(jets) jets.size() aJet = jets[0] dir(aJet) for jet in jets: print jet.pt()
Using EventView evc = tt.myEVCont len(evc) ev1 = evc[0] dir(ev1) # inserters results ev1.finalStateSize(‘Jet’) evJets = ev1.finalStateObjects(‘Jet’) len(evJets) # compare with len(tt.Cone4H1TopoJets) for jet in evJets: print jet.pt() # Accessing UserData print ev1.doubleUserData(‘Meff’)
Using Draw tt.Draw(‘Cone4H1TopoJets.pt()’, ‘@Cone4H1TopoJets.size() > 3’) • Without @, the pt function of each jet in the container is called (for each event). • With @, the size function of the container itself is called (for each event). • To draw the i’th element inside the container, e.g. the pt of the first jet: tt.Draw(‘Cone4H1TopoJets[0].pt()’, ‘@Cone4H1TopoJets.size() > 0’)
Exercise 1 • Draw a histogram of the Meff calculated in EventView (for the 2 hardest jets).
Exercise 2 • Draw an ‘on the fly’ calculation of Meff (for the 2 hardest jets) versus the Meff calculated in EventView.
Exercise 3 • Draw a histogram of the Meff calculated in EventView (for the 2 hardest jets), this time by filling your own histogram.
Solutions… tt.Draw('myEVCont[0].doubleUserData("Meff")') • What would be drawn without the “[0]”? tt.Draw('Cone4H1TopoJets[0].pt() + Cone4H1TopoJets[1].pt() + myEVCont[0].doubleUserData("MEF_RefFinal_et") : myEVCont[0].doubleUserData("Meff")') hist = ROOT.TH1F("myhist", "Meff", 100, 0, 2200000) nEntries = tt.GetEntries() for i in range(nEntries): hist.Fill(tt.myEVCont[0].doubleUserData('Meff')) hist.Draw()
PyAthena athena -i tutorial1.py theApp.initialize() theApp.nextEvent() sg = PyAthena.py_svc('StoreGateSvc') sg.dump() evc = sg.retrieve('EventViewContainer', 'myEVCont') ... theApp.exit() • Home work: • Use PyAthena to fill a Meff histogram. • Write an Athena algorithm (similar to the HelloWorld algorithm) to calculate Meff.