Belle II Software development
WrongRLInfoCounter Class Reference
Inheritance diagram for WrongRLInfoCounter:
HarvestingModule

Public Member Functions

def __init__ (self, output_file_name, tracks_store_vector_name="TrackCands")
 
def peel (self, track_cand)
 

Public Attributes

 mc_hit_lookup
 function to look up CDC MC hits
 

Static Public Attributes

refiners save_tree
 Refiners to be executed at the end of the harvesting / termination of the module Save a tree of all collected variables in a sub folder.
 

Detailed Description

Harvester module to check for the correct reconstructed orientation.

Definition at line 76 of file harvester.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  output_file_name,
  tracks_store_vector_name = "TrackCands" 
)
Initialize with the root output file name and the store array name of the track cands to use.

Reimplemented from HarvestingModule.

Definition at line 82 of file harvester.py.

82 def __init__(self, output_file_name, tracks_store_vector_name="TrackCands"):
83 """
84 Initialize with the root output file name and the store array name of the track cands to use.
85 """
86 HarvestingModule.__init__(self,
87 foreach=tracks_store_vector_name,
88 output_file_name=output_file_name)
89
90
91 self.mc_hit_lookup = Belle2.TrackFindingCDC.CDCMCHitLookUp()
92
Interface class to the Monte Carlo information for individual hits.

Member Function Documentation

◆ peel()

def peel (   self,
  track_cand 
)
 Extract the information. 

Reimplemented from HarvestingModule.

Definition at line 93 of file harvester.py.

93 def peel(self, track_cand):
94 """ Extract the information. """
95 cdc_hits = Belle2.PyStoreArray("CDCHits")
96
97 mc_hit_lookup = self.mc_hit_lookup
98 mc_hit_lookup.fill()
99
100 number_of_wrong_rl_infos = 0
101 number_of_wrong_rl_infos_stereo_only = 0
102
103 number_of_hits = 0
104 number_of_stereo = 0
105
106 for hitID in range(track_cand.getNHits()):
107 hit = track_cand.getHit(hitID)
108 if not hit.__class__.__name__ == "genfit::WireTrackCandHit":
109 continue
110
111 underlaying_cdc_hit = cdc_hits[hit.getHitId()]
112
113 correct_rl_info = mc_hit_lookup.getRLInfo(underlaying_cdc_hit)
114
115 number_of_hits += 1
116
117 if underlaying_cdc_hit.getISuperLayer() % 2 != 0:
118 number_of_stereo += 1
119
120 if correct_rl_info != hit.getLeftRightResolution():
121 if underlaying_cdc_hit.getISuperLayer() % 2 != 0:
122 number_of_wrong_rl_infos_stereo_only += 1
123 number_of_wrong_rl_infos += 1
124
125 return dict(number_of_wrong_rl_infos=number_of_wrong_rl_infos,
126 number_of_wrong_rl_infos_stereo_only=number_of_wrong_rl_infos_stereo_only,
127 number_of_hits=number_of_hits,
128 number_of_stereo=number_of_stereo,
129 mean_wrong_rl=np.true_divide(number_of_wrong_rl_infos, number_of_hits),
130 mean_wrong_rl_stereo=np.true_divide(number_of_wrong_rl_infos_stereo_only, number_of_stereo))
131
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72

Member Data Documentation

◆ mc_hit_lookup

mc_hit_lookup

function to look up CDC MC hits

Definition at line 91 of file harvester.py.

◆ save_tree

refiners save_tree
static
Initial value:
= refiners.save_tree(
)

Refiners to be executed at the end of the harvesting / termination of the module Save a tree of all collected variables in a sub folder.

Definition at line 134 of file harvester.py.


The documentation for this class was generated from the following file: