Belle II Software development
WireHitPreparerRunMixin Class Reference
Inheritance diagram for WireHitPreparerRunMixin:
RunMixin EmptyRun

Public Member Functions

 create_argument_parser (self, **kwds)
 
 create_path (self)
 
 name (self)
 
 configure_and_execute_from_commandline (self)
 
 execute (self)
 
 run (self, path)
 
 configure_from_commandline (self)
 
 configure (self, arguments)
 
 adjust_path (self, path)
 

Static Public Attributes

str flight_time_estimation = ""
 Used option for the initial flight time estimation.
 
 n_loops = float("nan")
 Loop limit above which on wire hits are prepared for the track finder - Uses MC information.
 
str description = "Empty execution of basf2"
 Description of the run setup to be displayed on command line.
 

Detailed Description

Mixin part the 

Definition at line 14 of file wirehit_preparation.py.

Member Function Documentation

◆ adjust_path()

adjust_path ( self,
path )
inherited
Hook that gives the opportunity to check the path for consistency before processing it

Reimplemented in VXDTF2TrackingValidation, and VXDTF2TrackingValidationBkg.

Definition at line 94 of file minimal.py.

94 def adjust_path(self, path):
95 """Hook that gives the opportunity to check the path for consistency before processing it"""
96
97# Minimal run stub defining some general parameters
98
99

◆ configure()

configure ( self,
arguments )
inherited
Save the command-line arguments as key-value pairs

Reimplemented in ReadOrGenerateEventsRun.

Definition at line 73 of file minimal.py.

73 def configure(self, arguments):
74 """Save the command-line arguments as key-value pairs"""
75 # Simply translate the arguments that have
76 # the same name as valid instance arguments
77 for (key, value) in list(vars(arguments).items()):
78 if value is None:
79 continue
80 if hasattr(self, key):
81 get_logger().info("Setting %s to %s", key, value)
82 setattr(self, key, value)
83

◆ configure_and_execute_from_commandline()

configure_and_execute_from_commandline ( self)
inherited
Configure basf2 job script from command-line arguments then run it

Definition at line 45 of file minimal.py.

45 def configure_and_execute_from_commandline(self):
46 """Configure basf2 job script from command-line arguments then run it"""
47 self.configure_from_commandline()
48 self.execute()
49

◆ configure_from_commandline()

configure_from_commandline ( self)
inherited
Convert the command-line arguments to a basf2 job script

Definition at line 67 of file minimal.py.

67 def configure_from_commandline(self):
68 """Convert the command-line arguments to a basf2 job script"""
69 argument_parser = self.create_argument_parser()
70 arguments = argument_parser.parse_args()
71 self.configure(arguments)
72

◆ create_argument_parser()

create_argument_parser ( self,
** kwds )
Configure the basf2 job script using the translated command-line arguments

Reimplemented from EmptyRun.

Definition at line 23 of file wirehit_preparation.py.

23 def create_argument_parser(self, **kwds):
24 """Configure the basf2 job script using the translated command-line arguments"""
25
26 argument_parser = super().create_argument_parser(**kwds)
27
28 argument_parser.add_argument(
29 "-ft",
30 "--flight-time-estimation",
31 choices=["none", "outwards", "downwards"],
32 default=argparse.SUPPRESS,
33 dest="flight_time_estimation",
34 help=("Choose which estimation method for the time of flight should be use. \n"
35 "* 'none' no time of flight corrections\n"
36 "* 'outwards' means the minimal time needed to travel to the wire from the interaction point \n"
37 "* 'downwards' means the minimal time needed to travel to the wire from the y = 0 plane downwards \n")
38 )
39
40 argument_parser.add_argument(
41 "-l",
42 "--mc-loop-limit",
43 type=float,
44 dest="n_loops",
45 help=("Choose to block all wire hits but the ones located on the {mc_loops} first loops")
46 )
47
48 return argument_parser
49

◆ create_path()

create_path ( self)
Sets up a path that plays back pregenerated events or generates events
based on the properties in the base class.

Reimplemented from EmptyRun.

Definition at line 50 of file wirehit_preparation.py.

50 def create_path(self):
51 """
52 Sets up a path that plays back pregenerated events or generates events
53 based on the properties in the base class.
54 """
55 path = super().create_path()
56
57 wire_hit_preparer = path.add_module("TFCDC_WireHitPreparer",
58 UseNLoops=self.n_loops)
59 if self.flight_time_estimation:
60 wire_hit_preparer.param(dict(flightTimeEstimation=self.flight_time_estimation))
61
62 return path

◆ execute()

execute ( self)
inherited
Create the basf2 path then run the job

Reimplemented in ReadOrGenerateEventsRun.

Definition at line 50 of file minimal.py.

50 def execute(self):
51 """Create the basf2 path then run the job"""
52 # Create path and run #
53
54 path = self.create_path()
55 self.adjust_path(path)
56 self.run(path)
57

◆ name()

name ( self)
inherited
provide name of this object

Definition at line 41 of file minimal.py.

41 def name(self):
42 """provide name of this object"""
43 return self.__class__.__name__
44

◆ run()

run ( self,
path )
inherited
Process the basf2 path

Reimplemented in PostProcessingRunMixin.

Definition at line 58 of file minimal.py.

58 def run(self, path):
59 """Process the basf2 path"""
60 # Run basf2 module path #
61
62 get_logger().info('Start processing')
63 basf2.print_path(path)
64 basf2.process(path)
65 get_logger().info("\n%s", str(basf2.statistics))
66

Member Data Documentation

◆ description

str description = "Empty execution of basf2"
staticinherited

Description of the run setup to be displayed on command line.

Definition at line 33 of file minimal.py.

◆ flight_time_estimation

str flight_time_estimation = ""
static

Used option for the initial flight time estimation.

Definition at line 18 of file wirehit_preparation.py.

◆ n_loops

n_loops = float("nan")
static

Loop limit above which on wire hits are prepared for the track finder - Uses MC information.

Definition at line 21 of file wirehit_preparation.py.


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