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

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

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

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

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

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

◆ requires()

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

Definition at line 373 of file combined_cdc_to_svd_ckf_mva_training.py.

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

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 355 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 363 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 360 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 358 of file combined_cdc_to_svd_ckf_mva_training.py.


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