Fork me on GitHub

Opened 6 years ago

Closed 6 years ago

#1312 closed How to (fixed)

Question regarding jet constituent storage

Reported by: Wojtek Fedorko Owned by:
Priority: minor Milestone:
Component: Delphes code Version: Delphes 3
Keywords: Cc:

Description

Hello,

My colleagues and I are working on some research pertaining to the jet substructure and top quark 'tagging' and would like to modify the jet constituent array that gets stored to include also pseudojets.

We see that in the TreeWriter method ProcessJets a loop that adds Candidate objects's 'constituents' obtained by a call to

candidate->GetCandidates()

Then the iterator is looped over and the newly created jet objects has constituents array extended:

while((constituent = static_cast<Candidate*>(itConstituents.Next())))
    {
      entry->Constituents.Add(constituent);
      ecalEnergy += constituent->Eem;
      hcalEnergy += constituent->Ehad;
    }

However when we read the file the objects stored in the constituents array are Towers and Tracks.

The question is - how and where in the code are the Candidate objects stored in the constituents array 'converted' to Tracks and Towers.

Thank you!

P.S.we are using the CMS card

Change History (4)

comment:1 by Michele Selvaggi, 6 years ago

Internally Delphes uses a common class called Candidate as you noted. These are converted into specific objects in the TreeWriter module by the processXXX methods.

comment:2 by Wojtek Fedorko, 6 years ago

Hello,

Thank you for the prompt answer, but unfortunately I am still confused.

I do understand that TreeWriter converts Candidate objects into Jet, Tower, Track objects in ProcessJets etc methods. I do not understand one detail of this procedure pertaining to the Jet Constituents.

The question is specifically about ProcessJets method where the 'Candidate' objects are added to the new Jet object Constituents array on line
https://cp3.irmp.ucl.ac.be/projects/delphes/browser/git/modules/TreeWriter.cc#L664
On this line a Candidate object pointer is pushed on to 'Constituents' (type TRefArray
https://cp3.irmp.ucl.ac.be/projects/delphes/browser/git/classes/DelphesClasses.h#L411) of the new Jet.

I don't understand how the 'Candidate' object pointers stored in the TRefArray Constituents are 'converted' into Towers and Tracks.

comment:3 by Pavel Demin, 6 years ago

I don't understand how the 'Candidate' object pointers stored in the TRefArray Constituents are 'converted' into Towers and Tracks.

According to the TRefArray documentation (https://root.cern.ch/doc/master/classTRefArray.html), when a TRefArray is streamed, only the pointer unique id is written, not the referenced object.

In the TreeWriter module, the unique id of the particles, tracks and towers is set to the unique id of the candidates:

https://cp3.irmp.ucl.ac.be/projects/delphes/browser/git/modules/TreeWriter.cc#L190

https://cp3.irmp.ucl.ac.be/projects/delphes/browser/git/modules/TreeWriter.cc#L336

https://cp3.irmp.ucl.ac.be/projects/delphes/browser/git/modules/TreeWriter.cc#L425

comment:4 by Wojtek Fedorko, 6 years ago

Resolution: fixed
Status: newclosed

Thank you!

This hint was essential to solving the problem.
Also calling this:

entry->SetBit(kIsReferenced);

seems to be needed.

Note: See TracTickets for help on using tickets.