Belle II Software development
SegmentPairFitValidationModule Class Reference
Inheritance diagram for SegmentPairFitValidationModule:

Public Member Functions

def __init__ (self, output_file_name)
 
def initialize (self)
 
def prepare (self)
 
def pick (self, segment_pair)
 
def peel (self, segment_pair)
 

Public Attributes

 mc_segment_lookup
 by default, there is no method to find matching MC track segments
 

Static Public Attributes

refiners save_histograms = refiners.save_histograms(outlier_z_score=5.0, allow_discrete=True)
 Save histograms in a sub folder.
 
refiners save_tree = refiners.save_tree()
 Save a tree of all collected variables in a sub folder.
 
refiners save_curvature_pull_aux
 Save curvature-pull auxiliary information in a sub folder.
 
refiners save_curvature_pull
 Save curvature-pull information in a sub folder.
 
refiners save_absolute_curvature_pull
 Save absolute curvature-pull information in a sub folder.
 
refiners save_tan_lambda_pull
 Save tan(lambda)-fit pull information in a sub folder.
 
refiners save_fit_quality_histograms
 Save fit-quality histograms in a sub folder.
 
refiners save_fit_quality_by_tan_lambda_profiles
 Save tan(lambda)-fit-quality profile histograms in a sub folder.
 

Detailed Description

Module to collect information about the generated segment pairs and
compose validation plots on terminate.

Definition at line 242 of file record.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  output_file_name 
)
Constructor

Definition at line 247 of file record.py.

247 def __init__(self, output_file_name):
248 """Constructor"""
249 super().__init__(
250 output_file_name=output_file_name,
251 foreach="CDCSegmentPairVector"
252 )
253
254
255 self.mc_segment_lookup = None
256

Member Function Documentation

◆ initialize()

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

Definition at line 257 of file record.py.

257 def initialize(self):
258 """Receive signal at the start of event processing"""
260 super().initialize()
261
static const CDCMCSegment2DLookUp & getInstance()
Getter for the singletone instance.

◆ peel()

def peel (   self,
  segment_pair 
)
Aggregate the track and MC information for track-segment analysis

Definition at line 277 of file record.py.

277 def peel(self, segment_pair):
278 """Aggregate the track and MC information for track-segment analysis"""
279 mc_segment_lookup = self.mc_segment_lookup
280
281 # from_segment = segment_pair.getFromSegment()
282 to_segment = segment_pair.getToSegment()
283
284 # mc_particle = mc_segment_lookup.getMCParticle(from_segment)
285
286 # Take the fit best at the middle of the segment pair
287 fit3d_truth = mc_segment_lookup.getTrajectory3D(to_segment)
288
289 fb_info = 1 if segment_pair.getAutomatonCell().getCellWeight() > 0 else -1
290 truth_crops = dict(
291 curvature_truth=fb_info * fit3d_truth.getCurvatureXY(),
292 tan_lambda_truth=fb_info * fit3d_truth.getTanLambda(),
293 )
294
295 segment_pair_crops = cdc_peelers.peel_segment_pair(segment_pair)
296 segment_pair_crops.update(truth_crops)
297 return segment_pair_crops
298
def peel_segment_pair(segment_pair, key="{part_name}")
Definition: cdc_peelers.py:79

◆ pick()

def pick (   self,
  segment_pair 
)
Select segment pairs with 4 or more hits per segment and a matching primary MC particle

Definition at line 266 of file record.py.

266 def pick(self, segment_pair):
267 """Select segment pairs with 4 or more hits per segment and a matching primary MC particle"""
268 mc_segment_lookup = self.mc_segment_lookup
269 from_segment = segment_pair.getFromSegment()
270 to_segment = segment_pair.getToSegment()
271 mc_particle = mc_segment_lookup.getMCParticle(from_segment)
272 return (mc_particle and
273 is_primary(mc_particle) and
274 from_segment.size() > 3 and
275 to_segment.size() > 3)
276

◆ prepare()

def prepare (   self)
Initialize the MC-hit lookup method

Definition at line 262 of file record.py.

262 def prepare(self):
263 """Initialize the MC-hit lookup method"""
265
static const CDCMCHitLookUp & getInstance()
Getter for the singletone instance.

Member Data Documentation

◆ mc_segment_lookup

mc_segment_lookup

by default, there is no method to find matching MC track segments

Definition at line 255 of file record.py.

◆ save_absolute_curvature_pull

refiners save_absolute_curvature_pull
static
Initial value:
= refiners.save_pull_analysis(
part_name="curvature",
unit="1/cm",
absolute=True,
groupby=[None, "superlayer_id_pair"],
outlier_z_score=3.0)

Save absolute curvature-pull information in a sub folder.

Definition at line 324 of file record.py.

◆ save_curvature_pull

refiners save_curvature_pull
static
Initial value:
= refiners.save_pull_analysis(
part_name="curvature",
unit="1/cm",
absolute=False,
groupby=[None, "superlayer_id_pair"],
outlier_z_score=3.0)

Save curvature-pull information in a sub folder.

Definition at line 316 of file record.py.

◆ save_curvature_pull_aux

refiners save_curvature_pull_aux
static
Initial value:
= refiners.save_pull_analysis(
part_name="curvature",
folder_name="aux",
unit="1/cm",
absolute=False,
aux_names=["superlayer_id_pair", "tan_lambda_truth"],
which_plots=["aux"],
outlier_z_score=3.0)

Save curvature-pull auxiliary information in a sub folder.

Definition at line 306 of file record.py.

◆ save_fit_quality_by_tan_lambda_profiles

refiners save_fit_quality_by_tan_lambda_profiles
static
Initial value:
= refiners.save_profiles(
select={
"p_value": "fit p-value",
"tan_lambda_truth": "true tan #lambda",
},
groupby=[None, "superlayer_id_pair"],
x="true tan #lambda",
y="fit p-value",
check=("The {y_part_name} should be essentially the same over"
"the whole range of the tan lambda spectrum"),
description=("Investigating the reconstruction quality for different "
"tan lambda regions of the CDC. Most notably is the superlayer dependency."
"For stereo superlayers the curve is not flat but has distinct slope."),
fit='line',
)

Save tan(lambda)-fit-quality profile histograms in a sub folder.

Definition at line 351 of file record.py.

◆ save_fit_quality_histograms

refiners save_fit_quality_histograms
static
Initial value:
= refiners.save_histograms(
outlier_z_score=5.0,
select={"ndf": "ndf",
"chi2": "#chi2",
"p_value": "p-value",
},
groupby=[None, "superlayer_id_pair"],
description="Distribution of {part_name} in the segment fits",
)

Save fit-quality histograms in a sub folder.

Definition at line 340 of file record.py.

◆ save_histograms

refiners save_histograms = refiners.save_histograms(outlier_z_score=5.0, allow_discrete=True)
static

Save histograms in a sub folder.

Definition at line 301 of file record.py.

◆ save_tan_lambda_pull

refiners save_tan_lambda_pull
static
Initial value:
= refiners.save_pull_analysis(
part_name="tan_lambda",
quantity_name="tan #lambda",
absolute=False,
groupby=[None, "superlayer_id_pair"],
outlier_z_score=3.0)

Save tan(lambda)-fit pull information in a sub folder.

Definition at line 332 of file record.py.

◆ save_tree

refiners save_tree = refiners.save_tree()
static

Save a tree of all collected variables in a sub folder.

Definition at line 303 of file record.py.


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