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 239 of file record.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  output_file_name 
)
Constructor

Definition at line 244 of file record.py.

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

Member Function Documentation

◆ initialize()

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

Definition at line 254 of file record.py.

254 def initialize(self):
255 """Receive signal at the start of event processing"""
257 super().initialize()
258
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 274 of file record.py.

274 def peel(self, segment_pair):
275 """Aggregate the track and MC information for track-segment analysis"""
276 mc_segment_lookup = self.mc_segment_lookup
277
278 # from_segment = segment_pair.getFromSegment()
279 to_segment = segment_pair.getToSegment()
280
281 # mc_particle = mc_segment_lookup.getMCParticle(from_segment)
282
283 # Take the fit best at the middle of the segment pair
284 fit3d_truth = mc_segment_lookup.getTrajectory3D(to_segment)
285
286 fb_info = 1 if segment_pair.getAutomatonCell().getCellWeight() > 0 else -1
287 truth_crops = dict(
288 curvature_truth=fb_info * fit3d_truth.getCurvatureXY(),
289 tan_lambda_truth=fb_info * fit3d_truth.getTanLambda(),
290 )
291
292 segment_pair_crops = cdc_peelers.peel_segment_pair(segment_pair)
293 segment_pair_crops.update(truth_crops)
294 return segment_pair_crops
295
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 263 of file record.py.

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

◆ prepare()

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

Definition at line 259 of file record.py.

259 def prepare(self):
260 """Initialize the MC-hit lookup method"""
262
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 252 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 321 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 313 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 303 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 348 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 337 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 298 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 329 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 300 of file record.py.


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