Dear ROOT community,
I am trying to analyse DAODs and have a code line which seems standard, ROOT.gROOT.Macro('$ROOTCOREDIR/scripts/load_packages.C') (inherited from a previous script). Upon trying to execute this, I get:
Error in <TROOT::Macro>: macro $ROOTCOREDIR/scripts/load_packages.C not found in path
Trying this in lxplus e.g. a line which reads root -b -q $ROOTCOREDIR/scripts/load_packages.C a similar error is manifested: Warning in <TApplication::GetOptions>: macro /scripts/load_packages.C not found.
Also, cd $ROOTCOREDIR leads to nowhere.
Can you please help? Could you please indicate how to use this macro both in lxplus and on a local machine?
_ROOT Version: 6.22.06
_Platform: Linux
_Compiler: g++
Hi, I am indeed. Actually I’m merely trying to access an ATLAS xAOD. I’ve learnt that in order to load the load_packages.C macro one needs first to rcSetup -u; rcSetup Base,2.0.12. May I ask a general question about accessing an x/DAOD?
This is a very old way to access xAOD information. Not sure it is still maintained, but you definitely get access to the load_packages.C if you just do the following from a clean shell on lxplus:
Thank you!
Brief question (which originally led me to this).
In my DAOD I have a TTree named CollectionTree which contains physics I’m interested in. I wish to extract information from it. Let’s take an example with a variable named TruthMuonsAuxDyn.e which is one of its leaves (clearly visible in TBrowser). When I try to run e.g.
for i in range(0, tree.GetEntries()):
print (tree.TruthMuonsAuxDyn.e)
I get an error: AttributeError: 'TTree' object has no attribute 'TruthMuonsAuxDyn'. However when I do leaf = tree.GetLeaf("TruthMuonsAuxDyn.e") there is clearly no error. What am I missing? What would be the best way of extracting TruthMuonsAuxDyn.e of each event (and similarly, other variables)?
In short, you have to write C++ code on top of the example given in that tutorial, probably something like the following:
// this happens for each event, as the event loop happens outside of user control:
const xAOD::TruthMuonContainer* truthMuons = nullptr;
ANA_CHECK(evtStore()->retrieve(truthMuons, "TruthMuons"));
for (auto truth_muon : *truthMuons)
ANA_MSG_INFO("e of the current truthMuon is " << truth_muon->e());
Thanks. But just simply treating the DAOD as any TFile with TTress, TBranches etc., how can I extract that information, such as for the example I gave? For now ignoring all the ATLAS xAOD stuff.