Belle II Software  release-05-02-19
MCSideTrackingValidationModule Class Reference
Inheritance diagram for MCSideTrackingValidationModule:
Collaboration diagram for MCSideTrackingValidationModule:

Public Member Functions

def __init__ (self, name, contact, output_file_name=None, reco_tracks_name='RecoTracks', mc_reco_tracks_name='MCRecoTracks', expert_level=None)
 
def initialize (self)
 
def prepare (self)
 
def pick (self, mc_reco_track)
 
def peel (self, mc_reco_track)
 
def peel_mc_to_pr_match_info (self, mc_reco_track)
 
def peel_hit_efficiencies_in_all_pr_tracks (self, mc_reco_track)
 

Public Attributes

 reco_tracks_name
 Name of the StoreArray of the tracks from pattern recognition.
 
 mc_reco_tracks_name
 Name of the StoreArray of the ideal mc tracks.
 
 track_match_look_up
 Reference to the track match lookup object reading the relation information constructed by the MCMatcherTracksModule.
 
 found_det_hit_ids
 Set of all detector and hits ids contained in any pr track. More...
 
 matched_det_hit_ids
 Set of all detector and hits ids contained in matched pr tracks. More...
 
 clone_det_hit_ids
 Set of all detector and hits ids contained in clone pr tracks. More...
 
 fake_det_hit_ids
 Set of all detector and hits ids contained in background and ghost pr tracks. More...
 

Static Public Attributes

int default_expert_level = 10
 the threshold value for the expert level
 
 save_tree = refiners.save_tree(name="mc_tree", folder_name="mc_tree", above_expert_level=default_expert_level)
 Save a tree of all collected variables in a sub folder.
 
 save_tree_basic
 Save a basic tree. More...
 
 save_overview_figures_of_merit
 Generate the average finding efficiencies and hit efficiencies. More...
 
 save_hit_efficiency_histogram
 Save a histogram of the hit efficiency. More...
 
dictionary renaming_select_for_finding_efficiency_profiles
 Rename the efficiency-profile quantities so that they display nicely in ROOT TLatex. More...
 
 save_finding_efficiency_profiles
 Make profile of finding efficiency. More...
 
 save_finding_efficiency_by_tan_lamba_profiles
 Make profile of finding efficiency versus tan(lambda) More...
 
 save_finding_efficiency_by_tan_lamba_in_pt_groups_profiles
 Make profiles of finding efficiency versus tan(lambda) grouped by transverse momentum. More...
 
dictionary renaming_select_for_hit_efficiency_profiles
 Rename the hit-profile quantities so that they display nicely in ROOT TLatex. More...
 
 save_hit_efficiency_profiles
 Make profile of hit efficiency. More...
 
 save_hit_efficiency_by_tan_lambda_profiles
 Make profile of finding efficiency versus tan(lambda) More...
 
 save_hit_efficiency_in_all_found_hist
 This creates a histogram for all MC track displaying the ratio of hits contained in any PR track Hence this is distinctly larger than the hit efficiency to the matched PR track Usefulness under discussion. More...
 
 save_missing_mc_tracks_hit_efficiency_in_all_found_hist
 This creates a histogram for each missing MC track displaying the ratio of hits contained in any PR tracks High values in this hit efficiencies means that the MC track is consumed by other PR tracks but no proper match could be established. More...
 

Detailed Description

Module to collect matching information about the found particles and to generate
   validation plots and figures of merit on the performance of track finding.
Expert level behavior:
    expert_level = default_expert_level: all figures and plots from this module except tree entries
    expert_level > default_expert_level: everything including tree entries
    expert_level <= default_expert_level//2: only basic figures
    default_expert_level//2 < expert_level < default_expert_level: basic figures and basic tree entries

Definition at line 16 of file mc_side_module.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  name,
  contact,
  output_file_name = None,
  reco_tracks_name = 'RecoTracks',
  mc_reco_tracks_name = 'MCRecoTracks',
  expert_level = None 
)
Constructor

Definition at line 29 of file mc_side_module.py.

29  def __init__(
30  self,
31  name,
32  contact,
33  output_file_name=None,
34  reco_tracks_name='RecoTracks',
35  mc_reco_tracks_name='MCRecoTracks',
36  expert_level=None):
37  """Constructor"""
38 
39  output_file_name = output_file_name or name + 'TrackingValidation.root'
40 
41  super().__init__(foreach=mc_reco_tracks_name,
42  name=name,
43  output_file_name=output_file_name,
44  contact=contact,
45  expert_level=expert_level)
46 
47 
48  self.reco_tracks_name = reco_tracks_name
49 
50 
51  self.mc_reco_tracks_name = mc_reco_tracks_name
52 
53 
54  self.track_match_look_up = None
55 
56  if self.expert_level >= self.default_expert_level:
57 
58  self.found_det_hit_ids = set()
59 
60 
61  self.matched_det_hit_ids = set()
62 
63 
64  self.clone_det_hit_ids = set()
65 
66 
67  self.fake_det_hit_ids = set()
68 

Member Function Documentation

◆ initialize()

def initialize (   self)
Initialization signal at the start of the event processing

Definition at line 69 of file mc_side_module.py.

◆ peel()

def peel (   self,
  mc_reco_track 
)
Looks at the individual Monte Carlo tracks and store information about them

Definition at line 113 of file mc_side_module.py.

◆ peel_hit_efficiencies_in_all_pr_tracks()

def peel_hit_efficiencies_in_all_pr_tracks (   self,
  mc_reco_track 
)
Extracts hit efficiencies

Definition at line 185 of file mc_side_module.py.

◆ peel_mc_to_pr_match_info()

def peel_mc_to_pr_match_info (   self,
  mc_reco_track 
)
Extracts track-match information from the MCMatcherTracksModule results

Definition at line 175 of file mc_side_module.py.

◆ pick()

def pick (   self,
  mc_reco_track 
)
Pick every MCRecoTrack

Definition at line 109 of file mc_side_module.py.

◆ prepare()

def prepare (   self)
Collect some statistics about the pattern recognition tracks used for comparision to the MC tracks

Executed once at the start of each event.

Definition at line 74 of file mc_side_module.py.

Member Data Documentation

◆ clone_det_hit_ids

clone_det_hit_ids

Set of all detector and hits ids contained in clone pr tracks.

Updated each event.

Definition at line 57 of file mc_side_module.py.

◆ fake_det_hit_ids

fake_det_hit_ids

Set of all detector and hits ids contained in background and ghost pr tracks.

Updated each event.

Definition at line 60 of file mc_side_module.py.

◆ found_det_hit_ids

found_det_hit_ids

Set of all detector and hits ids contained in any pr track.

Updated each event.

Definition at line 51 of file mc_side_module.py.

◆ matched_det_hit_ids

matched_det_hit_ids

Set of all detector and hits ids contained in matched pr tracks.

Updated each event.

Definition at line 54 of file mc_side_module.py.

◆ renaming_select_for_finding_efficiency_profiles

dictionary renaming_select_for_finding_efficiency_profiles
static
Initial value:
= {
'is_matched': 'finding efficiency',
'd0_truth': 'd_{0}',
'pt_truth': 'p_{t}',
'multiplicity': 'multiplicity',
'phi0_truth': '#phi',
}

Rename the efficiency-profile quantities so that they display nicely in ROOT TLatex.

Definition at line 244 of file mc_side_module.py.

◆ renaming_select_for_hit_efficiency_profiles

dictionary renaming_select_for_hit_efficiency_profiles
static
Initial value:
= {
'hit_efficiency': 'hit efficiency',
'd0_truth': 'd_{0}',
'pt_truth': 'p_{t}',
'multiplicity': 'multiplicity',
'phi0_truth': '#phi',
}

Rename the hit-profile quantities so that they display nicely in ROOT TLatex.

Definition at line 296 of file mc_side_module.py.

◆ save_finding_efficiency_by_tan_lamba_in_pt_groups_profiles

save_finding_efficiency_by_tan_lamba_in_pt_groups_profiles
static
Initial value:
= refiners.save_profiles(
above_expert_level=default_expert_level - 1,
select={
'is_matched': 'finding efficiency',
'tan_lambda_truth': 'tan #lambda'
},
y='finding efficiency',
y_binary=True,
filter_on="is_primary",
groupby=[("pt_truth", [0.070, 0.250, 0.600])],
outlier_z_score=5.0,
lower_bound=-1.73,
upper_bound=3.27,
)

Make profiles of finding efficiency versus tan(lambda) grouped by transverse momentum.

Definition at line 279 of file mc_side_module.py.

◆ save_finding_efficiency_by_tan_lamba_profiles

save_finding_efficiency_by_tan_lamba_profiles
static
Initial value:
= refiners.save_profiles(
above_expert_level=default_expert_level - 1,
select={
'is_matched': 'finding efficiency',
'tan_lambda_truth': 'tan #lambda'
},
y='finding efficiency',
y_binary=True,
filter_on="is_primary",
outlier_z_score=5.0,
lower_bound=-1.73,
upper_bound=3.27,
)

Make profile of finding efficiency versus tan(lambda)

Definition at line 264 of file mc_side_module.py.

◆ save_finding_efficiency_profiles

save_finding_efficiency_profiles
static
Initial value:
= refiners.save_profiles(
above_expert_level=default_expert_level - 1,
select=renaming_select_for_finding_efficiency_profiles,
y='finding efficiency',
y_binary=True,
filter_on="is_primary",
outlier_z_score=5.0,
allow_discrete=True,
)

Make profile of finding efficiency.

Definition at line 253 of file mc_side_module.py.

◆ save_hit_efficiency_by_tan_lambda_profiles

save_hit_efficiency_by_tan_lambda_profiles
static
Initial value:
= refiners.save_profiles(
above_expert_level=default_expert_level - 1,
select={
'hit_efficiency': 'hit efficiency',
'tan_lambda_truth': 'tan #lambda',
},
y='hit efficiency',
y_binary=True,
filter_on="is_primary",
outlier_z_score=5.0,
lower_bound=-1.73,
upper_bound=3.27,
)

Make profile of finding efficiency versus tan(lambda)

Definition at line 316 of file mc_side_module.py.

◆ save_hit_efficiency_histogram

save_hit_efficiency_histogram
static
Initial value:
= refiners.save_histograms(
above_expert_level=default_expert_level - 1,
select={"hit_efficiency": "hit efficiency"},
filter_on="is_primary",
description="Not a serious plot yet.",
)

Save a histogram of the hit efficiency.

Definition at line 236 of file mc_side_module.py.

◆ save_hit_efficiency_in_all_found_hist

save_hit_efficiency_in_all_found_hist
static
Initial value:
= refiners.save_histograms(
above_expert_level=default_expert_level - 1,
# renaming quantity to name that is more suitable for display
select=dict(hit_efficiency_in_all_found="total hit efficiency vs. all reconstructed tracks")
)

This creates a histogram for all MC track displaying the ratio of hits contained in any PR track Hence this is distinctly larger than the hit efficiency to the matched PR track Usefulness under discussion.

Definition at line 333 of file mc_side_module.py.

◆ save_hit_efficiency_profiles

save_hit_efficiency_profiles
static
Initial value:
= refiners.save_profiles(
above_expert_level=default_expert_level - 1,
select=renaming_select_for_hit_efficiency_profiles,
y='hit efficiency',
y_binary=True,
filter_on="is_primary",
outlier_z_score=5.0,
allow_discrete=True,
)

Make profile of hit efficiency.

Definition at line 305 of file mc_side_module.py.

◆ save_missing_mc_tracks_hit_efficiency_in_all_found_hist

save_missing_mc_tracks_hit_efficiency_in_all_found_hist
static
Initial value:
= refiners.save_histograms(
above_expert_level=default_expert_level - 1,
filter_on="is_missing", # show only the efficiencies of missing mc tracks
# renaming quantity to name that is more suitable for display
select=dict(hit_efficiency_in_all_found="total hit efficiency in all reconstructed tracks for missing mc tracks")
)

This creates a histogram for each missing MC track displaying the ratio of hits contained in any PR tracks High values in this hit efficiencies means that the MC track is consumed by other PR tracks but no proper match could be established.

Definition at line 342 of file mc_side_module.py.

◆ save_overview_figures_of_merit

save_overview_figures_of_merit
static
Initial value:
= refiners.save_fom(
name="{module.id}_overview_figures_of_merit",
title="Overview figures in {module.title}",
aggregation=np.nanmean,
key="{part_name}",
select={"is_matched": "finding efficiency", "hit_efficiency": "hit efficiency", },
filter_on="is_primary",
description=
)

Generate the average finding efficiencies and hit efficiencies.

Definition at line 219 of file mc_side_module.py.

◆ save_tree_basic

save_tree_basic
static
Initial value:
= refiners.save_tree(name="mc_tree", folder_name="mc_tree",
above_expert_level=default_expert_level // 2, below_expert_level=default_expert_level)

Save a basic tree.

Definition at line 215 of file mc_side_module.py.


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