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

Public Member Functions

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

Public Attributes

 job_name = self.task_id
 set the job name (inherited variable)
 

Static Public Attributes

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

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 390 of file combined_to_pxd_ckf_mva_training.py.

Member Function Documentation

◆ create_path()

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

Definition at line 510 of file combined_to_pxd_ckf_mva_training.py.

510 def create_path(self):
511 """
512 Create basf2 path to process with event generation and simulation.
513 """
514 return self.create_state_recording_path(
515 layer=self.layer,
516 records1_fname=self.get_output_file_name("records1.root"),
517 records2_fname=self.get_output_file_name("records2.root"),
518 records3_fname=self.get_output_file_name("records3.root"),
519 )
520

◆ create_state_recording_path()

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 427 of file combined_to_pxd_ckf_mva_training.py.

427 def create_state_recording_path(self, layer, records1_fname, records2_fname, records3_fname):
428 """
429 Create a path for the recording. To record the data for the PXD state filters, CDC+SVD tracks are required, and these
430 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
431 artificial layer 3.
432
433 :param layer: The layer for which the data are recorded.
434 :param records1_fname: Name of the records1 file.
435 :param records2_fname: Name of the records2 file.
436 :param records3_fname: Name of the records3 file.
437 """
438 path = basf2.create_path()
439
440 # get all the file names from the list of input files that are meant for training
441 file_list = [fname for fname in self.get_all_input_file_names()
442 if "generated_mc_N" in fname and "training" in fname and fname.endswith(".root")]
443 path.add_module("RootInput", inputFileNames=file_list)
444
445 path.add_module("Gearbox")
446 path.add_module("Geometry")
447 path.add_module("SetupGenfitExtrapolation")
448
449 add_hit_preparation_modules(path, components=["SVD", "PXD"])
450
451 add_track_finding(path, reco_tracks="CDCSVDRecoTracks", components=["CDC", "SVD"], prune_temporary_tracks=False)
452
453 path.add_module('TrackFinderMCTruthRecoTracks',
454 RecoTracksStoreArrayName="MCRecoTracks",
455 WhichParticles=[],
456 UsePXDHits=True,
457 UseSVDHits=True,
458 UseCDCHits=True)
459
460 path.add_module("MCRecoTracksMatcher", UsePXDHits=False, UseSVDHits=True, UseCDCHits=True,
461 mcRecoTracksStoreArrayName="MCRecoTracks",
462 prRecoTracksStoreArrayName="CDCSVDRecoTracks")
463 path.add_module("DAFRecoFitter", recoTracksStoreArrayName="CDCSVDRecoTracks")
464
465 path.add_module("ToPXDCKF",
466 inputRecoTrackStoreArrayName="CDCSVDRecoTracks",
467 outputRecoTrackStoreArrayName="RecoTracks",
468 outputRelationRecoTrackStoreArrayName="CDCSVDRecoTracks",
469 hitFilter="angulardistance",
470 seedFilter="angulardistance",
471 preSeedFilter='all',
472 preHitFilter='all',
473
474 relationCheckForDirection="backward",
475 reverseSeed=False,
476 writeOutDirection="backward",
477
478 firstHighFilter="truth",
479 firstEqualFilter="recording",
480 firstEqualFilterParameters={"treeName": "records1", "rootFileName": records1_fname, "returnWeight": 1.0},
481 firstLowFilter="none",
482 firstHighUseNStates=0,
483 firstToggleOnLayer=layer,
484
485 advanceHighFilter="advance",
486
487 secondHighFilter="truth",
488 secondEqualFilter="recording",
489 secondEqualFilterParameters={"treeName": "records2", "rootFileName": records2_fname, "returnWeight": 1.0},
490 secondLowFilter="none",
491 secondHighUseNStates=0,
492 secondToggleOnLayer=layer,
493
494 updateHighFilter="fit",
495
496 thirdHighFilter="truth",
497 thirdEqualFilter="recording",
498 thirdEqualFilterParameters={"treeName": "records3", "rootFileName": records3_fname},
499 thirdLowFilter="none",
500 thirdHighUseNStates=0,
501 thirdToggleOnLayer=layer,
502
503 filter="none",
504 exportTracks=False,
505
506 enableOverlapResolving=False)
507
508 return path
509

◆ output()

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 408 of file combined_to_pxd_ckf_mva_training.py.

408 def output(self):
409 """
410 Generate list of output files that the task should produce.
411 The task is considered finished if and only if the outputs all exist.
412 """
413 for record_fname in ["records1.root", "records2.root", "records3.root"]:
414 yield self.add_to_output(record_fname)
415

◆ remove_output()

remove_output ( self)
Default function from base b2luigi.Task class.

Definition at line 521 of file combined_to_pxd_ckf_mva_training.py.

521 def remove_output(self):
522 """
523 Default function from base b2luigi.Task class.
524 """
525 self._remove_output()
526
527

◆ requires()

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

Definition at line 416 of file combined_to_pxd_ckf_mva_training.py.

416 def requires(self):
417 """
418 This task only requires that the input files have been created.
419 """
420 yield SplitNMergeSimTask(
421 bkgfiles_dir=SummaryTask.bkgfiles_by_exp[self.experiment_number],
422 experiment_number=self.experiment_number,
423 n_events=self.n_events,
424 random_seed=self.random_seed,
425 )
426

Member Data Documentation

◆ batch_system

str batch_system = 'lsf'
staticinherited

batch system

Definition at line 189 of file combined_to_pxd_ckf_mva_training.py.

◆ experiment_number

experiment_number = b2luigi.IntParameter()
static

Experiment number of the conditions database, e.g.

defines simulation geometry

Definition at line 398 of file combined_to_pxd_ckf_mva_training.py.

◆ job_name

job_name = self.task_id
inherited

set the job name (inherited variable)

Definition at line 197 of file combined_to_pxd_ckf_mva_training.py.

◆ layer

layer = b2luigi.IntParameter()
static

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

Definition at line 406 of file combined_to_pxd_ckf_mva_training.py.

◆ n_events

n_events = b2luigi.IntParameter()
static

Number of events to generate.

Definition at line 403 of file combined_to_pxd_ckf_mva_training.py.

◆ queue

str queue = 's'
staticinherited

queue

Definition at line 191 of file combined_to_pxd_ckf_mva_training.py.

◆ random_seed

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 401 of file combined_to_pxd_ckf_mva_training.py.


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