20 from ROOT
import Belle2
23 b2.set_log_level(b2.LogLevel.INFO)
26 b2.use_database_chain()
32 if input_files.empty():
33 print(
'Please specify input file(s). Example usage:',
34 'basf2 perfect_match.py -i input.sroot')
36 if input_files.front().endswith(
".sroot"):
37 root_input = b2.register_module(
'SeqRootInput')
39 root_input = b2.register_module(
'RootInput')
41 unpacker = b2.register_module(
'CDCUnpacker')
42 unpacker.param(
'enableStoreCDCRawHit',
True)
44 output = b2.register_module(
'RootOutput')
45 output.param(
'outputFileName',
'UnpackerOutput.root')
46 output.param(
'branchNames', [
'CDCHits',
'CDCRawHits'])
56 set CDCHits and EventMetaData
65 Print TRG time of an event
67 b2.B2INFO(
'Event {}:'.format(self.
event_infoevent_info.getEvent()))
69 cdc_raw_hit = hit.getRelatedTo(
'CDCRawHits')
70 b2.B2INFO(
'Trigger time: {}'.format(cdc_raw_hit.getTriggerTime()))
74 main = b2.create_path()
77 main.add_module(root_input)
78 main.add_module(unpacker)
static Environment & Instance()
Static method to get a reference to the Environment instance.
static std::string findFile(const std::string &path, bool silent=false)
Search for given file or directory in local or central release directory, and return absolute path if...
A (simplified) python wrapper for StoreArray.
a (simplified) python wrapper for StoreObjPtr.