ROOT Version: 6.24/06
Platform: CentOS7
Compiler: gcc probably, it’s from /cvmfs/atlas.cern.ch/repo/sw/software/23.0/sw/lcg/releases/LCG_101_ATLAS_26/ROOT/6.24.06a/x86_64-centos7-gcc11-opt/bin/root
Hello experts,
I’m currently working with some DAOD
files in xAOD
from Athena 23.0.9.
The salient detail is that I (interactively) load a TTree
, grab some particles from a branch, get their momentum as a TLorentzVector
using the p4()
method, and then try to use the TLorentzVector
methods:
root output/DAOD_TRUTH3.600_600.output.pool.root
#include "xAODRootAccess/Init.h"
#include "xAODRootAccess/MakeTransientTree.h"
xAOD::Init();
TTree *t0 = xAOD::MakeTransientTree(_file0);
TCut cut_C1 = "TruthBSMWithDecayParticles.absPdgId()==1000024 && TruthBSMWithDecayParticles.child(0).absPdgId()!=1000024";
If I run the following line and use the Phi()
method, it works just fine and draws a histogram of the particle \phi:
t0->Draw("TruthBSMWithDecayParticles.child(0).p4().Phi()", cut_C1);
But if I run this line using the DeltaPhi()
method instead, I get an error:
t0->Draw("TruthBSMWithDecayParticles.child(0).p4().DeltaPhi(TruthBSMWithDecayParticles.child(1).p4())", cut_C1);
TTreeFormula::DefinedV... ERROR Unknown method:child(0).p4().DeltaPhi(TruthBSMWithDecayParticles.child(1).p4()) in TLorentzVector
TTreeFormula::Compile ERROR Bad numerical expression : "TruthBSMWithDecayParticles.child(0).p4().DeltaPhi(TruthBSMWithDecayParticles.child(1).p4())"
TSelectorDraw::AbortPr... INFO Variable compilation failed: {TruthBSMWithDecayParticles.child(0).p4().DeltaPhi(TruthBSMWithDecayParticles.child(1).p4()),TruthBSMWithDecayParticles.absPdgId()==1000024 && TruthBSMWithDecayParticles.child(0).absPdgId()!=1000024}
Clearly TTree::Draw
recognizes some TLorentzVector
method, but I don’t understand the Unknown method
error message here (why does it rewind all the way to child
?).
I have another option, which is to try using ROOT::Math::LorentzVector
methods instead, since I can get a ROOT::Math::LorentzVector<ROOT::Math::PxPyPzEVector>
from the genvecP4()
method, but I can’t seem to get TTree::Draw
to recognize the DeltaR
method either:
t0->Draw("ROOT::Math::VectorUtil::DeltaR(TruthBSMWithDecayParticles.child(0).p4().genvecP4(),TruthBSMWithDecayParticles.child(1).genvecP4())", cu
TTreeFormula::Compile ERROR Bad numerical expression : "ROOT::Math::VectorUtil::DeltaR(TruthBSMWithDecayParticles.child(0).p4().genvecP4(),TruthBSMWithDecayParticles.child(1).genvecP4())"
TSelectorDraw::AbortPr... INFO Variable compilation failed: {ROOT::Math::VectorUtil::DeltaR(TruthBSMWithDecayParticles.child(0).p4().genvecP4(),TruthBSMWithDecayParticles.child(1).genvecP4()),TruthBSMWithDecayParticles.absPdgId()==1000024 && TruthBSMWithDecayParticles.child(0).absPdgId()!=1000024}