Hi Sima,
I figured out how to print these Particle.Px
values. Not with TTree::SetBranchAddress()
functionality though, but with TTreeReader
one. Hope that’s okay:
TFile* myfile = TFile::Open("ttbar.root");
TTreeReader myReader("LHEF", myfile);
TTreeReaderArray<Double_t> particlePx(myReader, "Particle.Px");
while (myReader.Next())
{
if (myReader.GetCurrentEntry() % 10000 == 0)
{
printf("\tProcessing entry #%05lli out of %05lli: %lu particle(s)...\n", myReader.GetCurrentEntry(), myReader.GetEntries(false), particlePx.GetSize());
for (unsigned short pxIt = 0; pxIt < particlePx.GetSize(); ++pxIt)
printf("\t\tParticle #%02u: Px = %f\n", pxIt, particlePx[pxIt]);
}
}
myfile->Close();