Fork me on GitHub

Opened 6 years ago

Closed 6 years ago

#1366 closed How to (fixed)

Why does calling treeReader->UseBranch(... change outcome even if the pointer isn't used?

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

Description

Example3.C in Delphes/examples directory looks like a great way to get information on the components of the jets. Attached is a reduced version (plotting removed, just puts values in csv files).

When I run it on the root file (also supplied) the output changes if lines 30, 32 and 34 are commented or not.


  ////~~~~~ Uncommenting this give tracks
    TClonesArray *branchEFlowTrack = treeReader->UseBranch("EFlowTrack");
    ////~~~~~ Uncommenting this give towers
    TClonesArray *branchEFlowPhoton = treeReader->UseBranch("EFlowPhoton");
    ////~~~~~ Uncommenting this give towers
    TClonesArray *branchEFlowNeutralHadron = treeReader->UseBranch("EFlowNeutralHadron");
    //// ~~~~~ Why are the existance of unused pointers changing the output?

This is confusing because I thought that 30, 32 and 34 were just lines to fetch pointers, and those pointers are not used anywhere else. Every other point they were needed in Example3.C has been commented out in my reduced version.

Why does removing/adding lines 30, 32 and 34 change the constituents of the jets from GenParticles to Towers and Tracks?

All attachments can also be found at this link; https://mega.nz/#F!3PwQEAyR!fd_F-Rys68aFGEokEPRz-Q

Attachments (2)

jet_constits.C (5.0 KB ) - added by flyingMoggy 6 years ago.
Code containing confusion
tag_1_delphes_events.root (931.3 KB ) - added by flyingMoggy 6 years ago.
Little root file that I am using.

Download all attachments as: .zip

Change History (4)

by flyingMoggy, 6 years ago

Attachment: jet_constits.C added

Code containing confusion

by flyingMoggy, 6 years ago

Attachment: tag_1_delphes_events.root added

Little root file that I am using.

comment:1 by Pavel Demin, 6 years ago

The name of the UseBranch() method states clearly enough its effect. It should be called for all branches that are required for a given analysis algorithm.

For example, in the Example3.C script, the UseBranch() method is called for all the branches required for the analysis algorithm implemented in this script.

comment:2 by Pavel Demin, 6 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.