Belle II Software release-09-00-01
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.
 
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 344 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 464 of file combined_to_pxd_ckf_mva_training.py.

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

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

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

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

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

◆ requires()

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

Definition at line 370 of file combined_to_pxd_ckf_mva_training.py.

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

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 352 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 360 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 357 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 355 of file combined_to_pxd_ckf_mva_training.py.


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