17from ROOT
import Belle2
22from ROOT
import gSystem
23gSystem.Load(
'libtracking')
24gSystem.Load(
'libtracking_trackFindingCDC')
28 return logging.getLogger(__name__)
32 """Prepare and execute a basf2 job to read generated events or generate new events then validate the CDC cluster filter"""
34 cluster_preparation_module = basf2.register_module("TFCDC_ClusterPreparer")
39 output_file_name =
"ClusterFilterValidation.root"
42 """Configure the basf2 job script using the translated command-line arguments"""
44 return argument_parser
46 def create_path(self):
48 Sets up a path that plays back pregenerated events or generates events
49 based on the properties
in the base
class.
51 main_path = super().create_path()
54 main_path.add_module(cluster_preparation_module)
59 main_path.add_module(metamodules.PyProfilingModule(validation_module))
61 main_path.add_module(validation_module)
68 """Module to collect information about the facet creation cuts and compose validation plots on terminate."""
72 super().__init__(foreach="CDCWireHitClusterVector",
73 output_file_name=output_file_name)
80 """Receive signal at the start of event processing"""
85 """Receive signal at the end of event processing"""
90 """Fill the MC hit table"""
94 """Always pick, never reject"""
98 """Extract and store CDC hit and cluster information"""
104 cluster_crops = dict(cluster_crops)
108 for wireHit
in list(cluster.items()):
109 cdcHit = wireHit.getHit()
110 if mc_hit_lookup.isBackground(cdcHit):
114 n_background_truth=n_background,
115 background_fraction_truth=1.0 * n_background / cluster.size()
118 cluster_crops.update(truth_dict)
123 save_tree = refiners.save_tree(
129 save_histograms = refiners.save_histograms(
133 folder_name=
"histograms"
140 run.configure_and_execute_from_commandline()
143if __name__ ==
"__main__":
144 logging.basicConfig(stream=sys.stdout, level=logging.INFO, format=
'%(levelname)s:%(message)s')
static const CDCMCHitLookUp & getInstance()
Getter for the singletone instance.
mc_hit_lookup
reference to the CDCMCHitlookUp singleton
cluster_varset
reference to the CDCWireHitClusterVarSet
def __init__(self, output_file_name)
def create_argument_parser(self, **kwds)
basf2 cluster_preparation_module
basf2 module for CDC cluster preparation
bool py_profile
create a python profile
str output_file_name
output ROOT file
None output_file_name
There is no default for the name of the output TFile.