Fork me on GitHub

Opened 3 years ago

Last modified 3 years ago

#1497 new How to

Constituents inside the jet

Reported by: Shilpi Jain Owned by:
Priority: minor Milestone:
Component: Delphes code Version: Delphes 3
Keywords: Cc:

Description

Dear Experts,

We are using Delphes for our studies and trying to loop
over the jet constituents.
If I check the Jet.Constituents, it is always 0.

I am using the default card for CMS which seems to have everything
switched ON.

Is it some settings in the tcl card that I have to update to be able to see
the jet constituents?

I am using the master version of Delphes: git clone https://github.com/delphes/delphes.git

Thanks in advance,
Shilpi

Change History (8)

comment:1 by Michele Selvaggi, 3 years ago

Hi

did you explicitely instantiate the objects that make up the jet constituents?
As done here:

https://github.com/delphes/delphes/blob/master/examples/Example3.C#L92-L94

comment:2 by Shilpi Jain, 3 years ago

Hi Michele,

Thanks for your reply. Yes I do that. Essentially using a MakeClass of root so that is done.
Irrespective of that even if I just browse the rootfile and scan Jet.Constituents, it is always 0 [1]

I am essentially using the code here: https://www.dropbox.com/s/ao8vk5kkamylz84/Screen%20Shot%202021-04-14%20at%2010.08.36%20AM.png?dl=0 to loop over tracks inside a jet.

Thanks
Shilpi

[1]
root [3] Delphes->Scan("Jet.Constituents")
*

  • Row * Instance * Jet.Const *

*

  • 0 * 0 * 0 *
  • 0 * 1 * 0 *
  • 1 * 0 * 0 *
  • 1 * 1 * 0 *
  • 2 * 0 * 0 *
  • 2 * 1 * 0 *
  • 3 * 0 * 0 *
  • 3 * 1 * 0 *
  • 4 * 0 * 0 *
  • 4 * 1 * 0 *
  • 5 * 0 * 0 *
  • 5 * 1 * 0 *
  • 6 * 0 * 0 *

comment:3 by Michele Selvaggi, 3 years ago

Your link points to a png file, not to an actual code

comment:4 by Shilpi Jain, 3 years ago

Sorry I missed your reply and somehow it is pointing to a screenshot. I will paste my code here now explicitly which is taken from here:

https://github.com/delphes/delphes/blob/master/examples/Example3.C#L167-L200

 // Loop over all jets in event
    for(i = 0; i < branchJet->GetEntriesFast(); ++i)
    {
      jet = (Jet*) branchJet->At(i);

      momentum.SetPxPyPzE(0.0, 0.0, 0.0, 0.0);


      // Loop over all jet's constituents
      for(j = 0; j < jet->Constituents.GetEntriesFast(); ++j)
      {
        object = jet->Constituents.At(j);

        // Check if the constituent is accessible
        if(object == 0) continue;

        if(object->IsA() == Track::Class())
        {
          track = (Track*) object;
          // cout << "    Track pt: " << track->PT << ", eta: " << track->Eta << ", phi: " << track->Phi << endl;
          momentum += track->P4();
        }
     
      }
      plots->fJetDeltaPT->Fill((jet->PT - momentum.Pt())/jet->PT);
    }
  }
}

The contents are 0 in the rootfiles itself. Probably it indicates that I am missing something in the .tcl file (which is there in the master version of Delphes): https://github.com/delphes/delphes/blob/master/cards/delphes_card_CMS.tcl, no?

comment:5 by Shilpi Jain, 3 years ago

Hi Michele,

I was wondering if you have any suggestions?

thanks
Shilpi

comment:6 by Michele Selvaggi, 3 years ago

Can you attach your full macro?

comment:7 by Shilpi Jain, 3 years ago

Hi Michele,

Please find my code here:
https://github.com/jainshilpi/VBFgjet/blob/master/Analyse.C#L145-L161

and if you would like to test on a rootfile, I have put in lxplus:
~shilpi/public/test.root

to check:

Delphes->Scan("Jet.Constituents")

you can see that the jet constituents are 0

Thank you,
Shilpi

comment:8 by Michele Selvaggi, 3 years ago

This is a ROOT question. Most likely you have to instantiate the Delphes branches (EFlowTrack, EFlowPhoton etc ... ) with the treeReader methods as done in the example provided.

When you run Example3 do you see the constituents?

Note: See TracTickets for help on using tickets.