Fork me on GitHub

Opened 10 years ago

Closed 10 years ago

#325 closed How to (fixed)

Access Jet Particles

Reported by: Jan Hajer Owned by:
Priority: minor Milestone:
Component: Delphes code Version: Delphes 3
Keywords: Cc: jan.hajer@…

Description

Hello,

I would like to access the truth level PID of Delphes objects.
For electrons it works fine like this:

Electron* ElectronClone = (Electron*) ElectronClonesArray->At(ElectronNumber)
GenParticle *ParticleClone = (GenParticle *) Particle->Particle.GetObject();
cout << Clone->PID << endl;

But i have problems figuring out how to do it with Jets.
The following code crashes at cout.

Jet *JetClone = (Jet *)JetClonesArray->At(JetNumber);
TRefArray RefArray = JetClone->Particles;
int RefSum = RefArray.GetEntriesFast();
for (int RefNumber = 0; RefNumber < RefSum; ++RefNumber) {
  GenParticle *Clone = (GenParticle*) RefArray.At(RefNumber);
  cout << Clone->PID << endl;
}

So far I was not able to figure out how to handle TRefArray in a similar manner as TRef.

Some advice would be greatly appreciated.
Best
Jan Hajer

Change History (1)

comment:1 by Jan Hajer, 10 years ago

Resolution: fixed
Status: newclosed

Hello,

I have found your example 3.

Sorry for the noise.
Best,
Jan

Note: See TracTickets for help on using tickets.