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

Public Member Functions

def __init__ (self, output_file_name, tracks_store_vector_name="CDCTrackVector")
 
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 reconstructed positions 

Definition at line 17 of file harvester.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  output_file_name,
  tracks_store_vector_name = "CDCTrackVector" 
)
 Initiialize with the output file name of the root file and the store obj with the
CDCTrack vector to use. MC track cands are needed. 

Reimplemented from HarvestingModule.

Definition at line 21 of file harvester.py.

21 def __init__(self, output_file_name, tracks_store_vector_name="CDCTrackVector"):
22 """ Initiialize with the output file name of the root file and the store obj with the
23 CDCTrack vector to use. MC track cands are needed. """
24 super().__init__(
25 foreach=tracks_store_vector_name,
26 output_file_name=output_file_name)
27
28
29 self.mc_hit_lookup = Belle2.TrackFindingCDC.CDCMCHitLookUp()
30
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 31 of file harvester.py.

31 def peel(self, track_cand):
32 """ Extract the information """
33 mc_hit_lookup = self.mc_hit_lookup
34 mc_hit_lookup.fill()
35
36 sum_of_difference_norms_stereo = 0
37 num_norms_stereo = 0
38 sum_of_difference_norms_axial = 0
39 num_norms_axial = 0
40
41 number_of_wrong_rl_infos = 0
42
43 for reco_hit3D in list(track_cand.items()):
44 underlaying_cdc_hit = reco_hit3D.getWireHit().getHit()
45 hit_difference = mc_hit_lookup.getRecoPos3D(underlaying_cdc_hit) - reco_hit3D.getRecoPos3D()
46 sum_of_difference_norms_axial += hit_difference.xy().norm()
47 num_norms_axial += 1
48
49 if reco_hit3D.getStereoType() != 0: # AXIAL
50 sum_of_difference_norms_stereo += abs(hit_difference.z())
51 num_norms_stereo += 1
52
53 correct_rl_info = mc_hit_lookup.getRLInfo(underlaying_cdc_hit)
54
55 if correct_rl_info != reco_hit3D.getRLInfo():
56 number_of_wrong_rl_infos += 1
57
58 return dict(sum_of_difference_norms_axial=sum_of_difference_norms_axial,
59 num_norms_axial=num_norms_axial,
60 mean_of_difference_norms_axial=np.true_divide(sum_of_difference_norms_axial, num_norms_axial),
61 sum_of_difference_norms_stereo=sum_of_difference_norms_stereo,
62 num_norms_stereo=num_norms_stereo,
63 mean_of_difference_norms_stereo=np.true_divide(sum_of_difference_norms_stereo, num_norms_stereo),
64 number_of_wrong_rl_infos=number_of_wrong_rl_infos,
65 mean_wrong_rl_infos=np.true_divide(number_of_wrong_rl_infos, num_norms_stereo))
66

Member Data Documentation

◆ mc_hit_lookup

mc_hit_lookup

function to look up CDC MC hits

Definition at line 29 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 69 of file harvester.py.


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