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

Public Member Functions

def output (self)
 
def requires (self)
 
def create_state_recording_path (self, layer, records1_fname, records2_fname, records3_fname)
 
def create_path (self)
 

Static Public Attributes

b2luigi experiment_number = b2luigi.IntParameter()
 Experiment number of the conditions database, e.g.
 
b2luigi random_seed = b2luigi.Parameter()
 Random basf2 seed.
 
b2luigi n_events = b2luigi.IntParameter()
 Number of events to generate.
 
b2luigi layer = b2luigi.IntParameter()
 Layer on which to toggle for recording the information for training.
 

Detailed Description

Record the data for the three state filters for the ToPXDCKF.

This task requires that the events used for training have been simulated before, which is done using the
``SplitMergeSimTask``.

Definition at line 346 of file combined_to_pxd_ckf_mva_training.py.

Member Function Documentation

◆ create_path()

def create_path (   self)
Create basf2 path to process with event generation and simulation.

Definition at line 466 of file combined_to_pxd_ckf_mva_training.py.

466 def create_path(self):
467 """
468 Create basf2 path to process with event generation and simulation.
469 """
470 return self.create_state_recording_path(
471 layer=self.layer,
472 records1_fname=self.get_output_file_name("records1.root"),
473 records2_fname=self.get_output_file_name("records2.root"),
474 records3_fname=self.get_output_file_name("records3.root"),
475 )
476
477

◆ create_state_recording_path()

def create_state_recording_path (   self,
  layer,
  records1_fname,
  records2_fname,
  records3_fname 
)
Create a path for the recording. To record the data for the PXD state filters, CDC+SVD tracks are required, and these
must be truth matched before. The data have to recorded for each layer of the PXD, i.e. layers 1 and 2, but also an
artificial layer 3.

:param layer: The layer for which the data are recorded.
:param records1_fname: Name of the records1 file.
:param records2_fname: Name of the records2 file.
:param records3_fname: Name of the records3 file.

Definition at line 383 of file combined_to_pxd_ckf_mva_training.py.

383 def create_state_recording_path(self, layer, records1_fname, records2_fname, records3_fname):
384 """
385 Create a path for the recording. To record the data for the PXD state filters, CDC+SVD tracks are required, and these
386 must be truth matched before. The data have to recorded for each layer of the PXD, i.e. layers 1 and 2, but also an
387 artificial layer 3.
388
389 :param layer: The layer for which the data are recorded.
390 :param records1_fname: Name of the records1 file.
391 :param records2_fname: Name of the records2 file.
392 :param records3_fname: Name of the records3 file.
393 """
394 path = basf2.create_path()
395
396 # get all the file names from the list of input files that are meant for training
397 file_list = [fname for sublist in self.get_input_file_names().values()
398 for fname in sublist if "generated_mc_N" in fname and "training" in fname and fname.endswith(".root")]
399 path.add_module("RootInput", inputFileNames=file_list)
400
401 path.add_module("Gearbox")
402 path.add_module("Geometry")
403 path.add_module("SetupGenfitExtrapolation")
404
405 add_hit_preparation_modules(path, components=["SVD", "PXD"])
406
407 add_track_finding(path, reco_tracks="CDCSVDRecoTracks", components=["CDC", "SVD"], prune_temporary_tracks=False)
408
409 path.add_module('TrackFinderMCTruthRecoTracks',
410 RecoTracksStoreArrayName="MCRecoTracks",
411 WhichParticles=[],
412 UsePXDHits=True,
413 UseSVDHits=True,
414 UseCDCHits=True)
415
416 path.add_module("MCRecoTracksMatcher", UsePXDHits=False, UseSVDHits=True, UseCDCHits=True,
417 mcRecoTracksStoreArrayName="MCRecoTracks",
418 prRecoTracksStoreArrayName="CDCSVDRecoTracks")
419 path.add_module("DAFRecoFitter", recoTracksStoreArrayName="CDCSVDRecoTracks")
420
421 path.add_module("ToPXDCKF",
422 inputRecoTrackStoreArrayName="CDCSVDRecoTracks",
423 outputRecoTrackStoreArrayName="RecoTracks",
424 outputRelationRecoTrackStoreArrayName="CDCSVDRecoTracks",
425 hitFilter="angulardistance",
426 seedFilter="angulardistance",
427 preSeedFilter='all',
428 preHitFilter='all',
429
430 relationCheckForDirection="backward",
431 reverseSeed=False,
432 writeOutDirection="backward",
433
434 firstHighFilter="truth",
435 firstEqualFilter="recording",
436 firstEqualFilterParameters={"treeName": "records1", "rootFileName": records1_fname, "returnWeight": 1.0},
437 firstLowFilter="none",
438 firstHighUseNStates=0,
439 firstToggleOnLayer=layer,
440
441 advanceHighFilter="advance",
442
443 secondHighFilter="truth",
444 secondEqualFilter="recording",
445 secondEqualFilterParameters={"treeName": "records2", "rootFileName": records2_fname, "returnWeight": 1.0},
446 secondLowFilter="none",
447 secondHighUseNStates=0,
448 secondToggleOnLayer=layer,
449
450 updateHighFilter="fit",
451
452 thirdHighFilter="truth",
453 thirdEqualFilter="recording",
454 thirdEqualFilterParameters={"treeName": "records3", "rootFileName": records3_fname},
455 thirdLowFilter="none",
456 thirdHighUseNStates=0,
457 thirdToggleOnLayer=layer,
458
459 filter="none",
460 exportTracks=False,
461
462 enableOverlapResolving=False)
463
464 return path
465

◆ output()

def output (   self)
Generate list of output files that the task should produce.
The task is considered finished if and only if the outputs all exist.

Definition at line 364 of file combined_to_pxd_ckf_mva_training.py.

364 def output(self):
365 """
366 Generate list of output files that the task should produce.
367 The task is considered finished if and only if the outputs all exist.
368 """
369 for record_fname in ["records1.root", "records2.root", "records3.root"]:
370 yield self.add_to_output(record_fname)
371

◆ requires()

def requires (   self)
This task only requires that the input files have been created.

Definition at line 372 of file combined_to_pxd_ckf_mva_training.py.

372 def requires(self):
373 """
374 This task only requires that the input files have been created.
375 """
376 yield SplitNMergeSimTask(
377 bkgfiles_dir=MainTask.bkgfiles_by_exp[self.experiment_number],
378 experiment_number=self.experiment_number,
379 n_events=self.n_events,
380 random_seed=self.random_seed,
381 )
382

Member Data Documentation

◆ experiment_number

b2luigi experiment_number = b2luigi.IntParameter()
static

Experiment number of the conditions database, e.g.

defines simulation geometry

Definition at line 354 of file combined_to_pxd_ckf_mva_training.py.

◆ layer

b2luigi layer = b2luigi.IntParameter()
static

Layer on which to toggle for recording the information for training.

Definition at line 362 of file combined_to_pxd_ckf_mva_training.py.

◆ n_events

b2luigi n_events = b2luigi.IntParameter()
static

Number of events to generate.

Definition at line 359 of file combined_to_pxd_ckf_mva_training.py.

◆ random_seed

b2luigi random_seed = b2luigi.Parameter()
static

Random basf2 seed.

It is further used to read of the production process to preserve clearness in the b2luigi output.

Definition at line 357 of file combined_to_pxd_ckf_mva_training.py.


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