Belle II Software release-09-00-00
StateRecordingTask Class Reference
Inheritance diagram for StateRecordingTask:
Collaboration 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 for training.
 
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 CDCToSVDSpacePointCKF.

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

Definition at line 345 of file combined_cdc_to_svd_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 463 of file combined_cdc_to_svd_ckf_mva_training.py.

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

◆ 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 SVD state filters, CDC tracks are required, and these must
be truth matched before. The data have to recorded for each layer of the SVD, i.e. layers 3 to 6, but also an artificial
layer 7.

: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 382 of file combined_cdc_to_svd_ckf_mva_training.py.

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

◆ 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 363 of file combined_cdc_to_svd_ckf_mva_training.py.

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

◆ requires()

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

Definition at line 371 of file combined_cdc_to_svd_ckf_mva_training.py.

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

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 353 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ layer

b2luigi layer = b2luigi.IntParameter()
static

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

Definition at line 361 of file combined_cdc_to_svd_ckf_mva_training.py.

◆ n_events

b2luigi n_events = b2luigi.IntParameter()
static

Number of events to generate for training.

Definition at line 358 of file combined_cdc_to_svd_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 356 of file combined_cdc_to_svd_ckf_mva_training.py.


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