Opened 8 years ago
Closed 8 years ago
#997 closed How to (fixed)
cannot access subjets in code
Reported by: | Nikolay Kolev | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Delphes code | Version: | Delphes 3 |
Keywords: | subjets | Cc: |
Description
I am using Delphes 3.3.2 and need subjet information, e.g.
Jet_TrimmedP4[5][kMaxJet]. If I open the root file in TBrowser,
I get the graph with 5 times as many entries as the number of
jets. In code, I get all zeroes, e.g.:
for (int i = 0; i < Jet_; i++)
{
}
or:
cout << (Jet_TrimmedP4[0][i]).Pt() << endl;
Wht am I doing wrong?
Attachments (3)
Change History (8)
by , 8 years ago
Attachment: | delphes_card_CMS.tcl added |
---|
by , 8 years ago
Attachment: | mononew_zero_jet_left_subjet_1.h added |
---|
by , 8 years ago
Attachment: | mononew_zero_jet_left_subjet_1.C added |
---|
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Thank you for the quick reply. So I need access to the jets branch. I tried several things and can't get it right, e.g.:
TBranch *jet = fChain->GetBranch("Jet");
for (int i = 0; i < jet->GetEntriesFast(); i++)
{ ........
Error: Can't call TBranch::GetEntriesFast () in current scope.
So I guess my question is: what is branchJet in the context of the class that MakeClass makes?
comment:4 by , 8 years ago
Thanks.
I was trying to keep using MakeClass; so I rewrote the analysis code as the delphes examples suggest and everything is working now; I have access to the subjets. As a side effect since it is now a regular c++ program using root and delphes libraries and doesn't run under root, it is going orders of magnitude faster.
I guess it is always worth doing things properly.
Thank you for the help.
Nikolay
comment:5 by , 8 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Do the following: