Skip to content

Commit 87ed2cf

Browse files
In ntuplehelper differentiate between MC info that is related to a trk and general MC information
1 parent d010f49 commit 87ed2cf

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

helper/ntuplehelper.py

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ class nthelper:
1010
trk_branches = ['trk', 'trkmc', 'trkcalohit', 'trkcalohitmc', 'trkqual', 'trkpid']
1111
trksegs_branches = ['trksegs', 'trksegpars_lh', 'trksegpars_ch', 'trksegpars_kl', 'trksegsmc']
1212
straw_branches = ['trkhits', 'trkmats', 'trkhitsmc', 'trkhitcalibs']
13-
mc_branches = ['trkmcsim', 'mcsteps']
13+
trk_mc_branches = [ 'trkmcsim' ]
14+
general_mc_branches = [ 'mcsteps' ]
1415
calo_branches = ['caloclusters', 'calohits', 'calorecodigis', 'calodigis']
1516
crv_branches = ['crvsummary','crvsummarymc','crvcoincs','crvcoincsmc','crvcoincsmcplane']
1617
deprecated_branches = ['trkmcsci','trkmcssi']
@@ -171,16 +172,34 @@ def list_all_branches(self, export_to_md=False):
171172
print("| " + tokens[0] + " | " + tokens[1] + " | " + tokens[2] + "| [see " + struct_file + "](../inc/"+struct_file+")")
172173

173174
if not export_to_md:
174-
print("\nMonte Carlo Branches")
175+
print("\nTrk Monte Carlo Branches")
175176
print("================")
176177
else:
177-
print("## Monte Carlo Branches\n")
178+
print("## Trk Monte Carlo Branches\n")
178179
print("These branches contain 4 elements per event corresponding to different Kalman fit hypotheses (see Track branches).\n")
179180
print("Within each Kalman fit element, there is a vector containing Monte Carlo truth information about the particle making the track and its parent particles.\n")
180181
print("The vector is sorted in reverse chronological order, such that the last element is the initial particle simulated in GEANT4, and each element before correspond to one of its daughter particles.\n")
181182
print("| branch | structure | explanation | leaf information |")
182183
print("|--------|-----------|-------------|------------------|")
183-
for branch in self.mc_branches:
184+
for branch in self.trk_mc_branches:
185+
explanation = self.get_branch_explanation(branch)
186+
struct = self.branch_struct_dict[branch]
187+
struct_file = struct + ".hh";
188+
if not export_to_md:
189+
print(explanation)
190+
else:
191+
tokens=explanation.split(":")
192+
print("| " + tokens[0] + " | " + tokens[1] + " | " + tokens[2] + "| [see " + struct_file + "](../inc/"+struct_file+")")
193+
194+
if not export_to_md:
195+
print("\nGeneral Monte Carlo Branches")
196+
print("================")
197+
else:
198+
print("## General Monte Carlo Branches\n")
199+
print("These branches contain MC information in the event and are not required to be related to tracks")
200+
print("| branch | structure | explanation | leaf information |")
201+
print("|--------|-----------|-------------|------------------|")
202+
for branch in self.general_mc_branches:
184203
explanation = self.get_branch_explanation(branch)
185204
struct = self.branch_struct_dict[branch]
186205
struct_file = struct + ".hh";

0 commit comments

Comments
 (0)