17from ROOT
import Belle2
22from ROOT
import gSystem
23gSystem.Load(
'libtracking')
24gSystem.Load(
'libtracking_trackFindingCDC')
28 return logging.getLogger(__name__)
31CONTACT =
"oliver.frost@desy.de"
35 """Prepare and execute a basf2 job to read generated events or generate new events then validate the CDC cluster filter"""
37 cluster_preparation_module = basf2.register_module("TFCDC_ClusterPreparer")
42 output_file_name =
"ClusterFilterValidation.root"
45 """Configure the basf2 job script using the translated command-line arguments"""
47 return argument_parser
49 def create_path(self):
51 Sets up a path that plays back pregenerated events or generates events
52 based on the properties
in the base
class.
54 main_path = super().create_path()
57 main_path.add_module(cluster_preparation_module)
62 main_path.add_module(metamodules.PyProfilingModule(validation_module))
64 main_path.add_module(validation_module)
71 """Module to collect information about the facet creation cuts and compose validation plots on terminate."""
75 super().__init__(foreach="CDCWireHitClusterVector",
76 output_file_name=output_file_name)
83 """Receive signal at the start of event processing"""
88 """Receive signal at the end of event processing"""
93 """Fill the MC hit table"""
97 """Always pick, never reject"""
101 """Extract and store CDC hit and cluster information"""
107 cluster_crops = dict(cluster_crops)
111 for wireHit
in list(cluster.items()):
112 cdcHit = wireHit.getHit()
113 if mc_hit_lookup.isBackground(cdcHit):
117 n_background_truth=n_background,
118 background_fraction_truth=1.0 * n_background / cluster.size()
121 cluster_crops.update(truth_dict)
126 save_tree = refiners.save_tree(
132 save_histograms = refiners.save_histograms(
136 folder_name=
"histograms"
143 run.configure_and_execute_from_commandline()
146if __name__ ==
"__main__":
147 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.