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)
Change History (4)
by , 6 years ago
Attachment: | jet_constits.C added |
---|
comment:1 by , 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 , 6 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Code containing confusion