Belle II Software development
MinimalRun Class Reference
Inheritance diagram for MinimalRun:
EmptyRun ReadOrGenerateEventsRun StandardEventGenerationRun ReadOrGenerateTrackedEventsRun BackgroundClusterFilterTrainingRun FeasibleAxialSegmentPairFilterTrainingRun FeasibleSegmentPairFilterTrainingRun FeasibleSegmentRelationFilterTrainingRun FeasibleTrackRelationFilterTrainingRun RealisticAxialSegmentPairFilterTrainingRun RealisticSegmentPairFilterTrainingRun RealisticSegmentPairRelationFilterTrainingRun RealisticSegmentRelationFilterTrainingRun RealisticTrackRelationFilterTrainingRun SegmentTrackFilterTrainingRun TrackFilterTrainingRun

Public Member Functions

def create_argument_parser (self, **kwds)
 
def create_path (self)
 

Static Public Attributes

str description = "Minimally populated execution of basf2"
 Description of this object.
 
bool allow_input = True
 By default, this basf2 job can read events from an input ROOT TFile.
 
int n_events = 10000
 By default, process 10000 events.
 
None root_input_file = None
 By default, there is no input ROOT TFile.
 
None random_seed = None
 By default, the random-number seed is unassigned.
 
int n_processes = 0
 By default, no parallel processing.
 
int n_events_to_skip = 0
 By default, do not skip any events at the start of the input ROOT TFile.
 

Detailed Description

Configure for a minimal basf2 job

Definition at line 100 of file minimal.py.

Member Function Documentation

◆ create_argument_parser()

def create_argument_parser (   self,
**  kwds 
)
Convert command-line arguments to basf2 argument list

Reimplemented from EmptyRun.

Reimplemented in ReadOrGenerateEventsRun, ReadOrGenerateTrackedEventsRun, TrackingValidationRun, CDCDisplayRun, ClusterFilterValidationRun, ElossHarvestingRun, LegendreBinningValidationRun, SegmentFitValidationRun, SegmentPairCreationValidationRun, SegmentPairFitValidationRun, and FacetFilterTrainingRun.

Definition at line 121 of file minimal.py.

121 def create_argument_parser(self, **kwds):
122 """Convert command-line arguments to basf2 argument list"""
123 argument_parser = super().create_argument_parser(**kwds)
124 master_argument_group = argument_parser.add_argument_group("Master arguments")
125
126 if self.allow_input:
127 master_argument_group.add_argument(
128 '-i',
129 '--input',
130 default=argparse.SUPPRESS,
131 dest='root_input_file',
132 help='File path to the ROOT file from which the simulated events shall be loaded.'
133 )
134
135 master_argument_group.add_argument(
136 '-n',
137 '--events',
138 dest='n_events',
139 default=self.n_events,
140 type=int,
141 help='Number of events to be generated',
142 )
143
144 master_argument_group.add_argument(
145 '-r',
146 '--random-seed',
147 dest='random_seed',
148 default=argparse.SUPPRESS,
149 type=str,
150 help='The random number generator seed to be set before the processing starts.',
151 )
152
153 master_argument_group.add_argument(
154 '-p',
155 '--processes',
156 dest='n_processes',
157 default=argparse.SUPPRESS,
158 type=int,
159 help='The number of parallel processes to be used for processing.',
160 )
161
162 master_argument_group.add_argument(
163 '--n-events-to-skip',
164 dest='n_events_to_skip',
165 default=argparse.SUPPRESS,
166 type=int,
167 help='The number of events to skip',
168 )
169
170 return argument_parser
171

◆ create_path()

def create_path (   self)
Create and configure the basf2 path

Reimplemented from EmptyRun.

Reimplemented in ReadOrGenerateEventsRun, ReadOrGenerateTrackedEventsRun, TrackingValidationRun, SegmentQuadTreeRun, CDCDisplayRun, ClusterFilterValidationRun, ElossHarvestingRun, LegendreBinningValidationRun, FitValidation, SegmentFitValidationRun, SegmentPairCreationValidationRun, SegmentPairFitValidationRun, BackgroundClusterFilterTrainingRun, FacetFilterTrainingRun, FacetRelationFilterTrainingRun, FeasibleAxialSegmentPairFilterTrainingRun, FeasibleSegmentPairFilterTrainingRun, FeasibleSegmentRelationFilterTrainingRun, FeasibleTrackRelationFilterTrainingRun, RealisticAxialSegmentPairFilterTrainingRun, RealisticSegmentPairFilterTrainingRun, RealisticSegmentPairRelationFilterTrainingRun, RealisticSegmentRelationFilterTrainingRun, RealisticTrackRelationFilterTrainingRun, SegmentTrackFilterTrainingRun, and TrackFilterTrainingRun.

Definition at line 172 of file minimal.py.

172 def create_path(self):
173 """Create and configure the basf2 path"""
174 path = super().create_path()
175
176 if self.random_seed is not None:
177 basf2.set_random_seed(self.random_seed)
178
179 environment = Belle2.Environment.Instance()
180 environment.setNumberEventsOverride(self.n_events)
181
182 # If there is no input file is the EventInfoSetter as master module
183 if not self.root_input_file:
184 # Master module: EventInfoSetter
185 path.add_module('EventInfoSetter',
186 evtNumList=[self.n_events],
187 runList=[1],
188 expList=[0],
189 skipNEvents=self.n_events_to_skip
190 )
191
192 else:
193 # Master module: RootInput
194 path.add_module('RootInput',
195 inputFileName=self.root_input_file,
196 skipNEvents=self.n_events_to_skip)
197
198 # Progress module
199 path.add_module('Progress')
200
201 if self.n_processes:
202 environment = Belle2.Environment.Instance()
203 environment.setNumberProcessesOverride(self.n_processes)
204
205 return path
static Environment & Instance()
Static method to get a reference to the Environment instance.
Definition: Environment.cc:28

Member Data Documentation

◆ allow_input

bool allow_input = True
static

By default, this basf2 job can read events from an input ROOT TFile.

Definition at line 109 of file minimal.py.

◆ description

str description = "Minimally populated execution of basf2"
static

Description of this object.

Definition at line 104 of file minimal.py.

◆ n_events

int n_events = 10000
static

By default, process 10000 events.

Definition at line 111 of file minimal.py.

◆ n_events_to_skip

int n_events_to_skip = 0
static

By default, do not skip any events at the start of the input ROOT TFile.

Definition at line 119 of file minimal.py.

◆ n_processes

int n_processes = 0
static

By default, no parallel processing.

Definition at line 117 of file minimal.py.

◆ random_seed

None random_seed = None
static

By default, the random-number seed is unassigned.

Definition at line 115 of file minimal.py.

◆ root_input_file

None root_input_file = None
static

By default, there is no input ROOT TFile.

Definition at line 113 of file minimal.py.


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