15 Sample script to generate ASIC cross-talk library. Usage:
17 basf2 AsicBackgroundLibraryGenerator.py <cosmic_raw_data_file> <output_asicbg_root_file> <data_type>
19 cosmic_raw_data_file : input raw data files
21 output_asicbg_root_file: output root files
23 data_type: 'mc' or 'data'
29 GT = ['patch_main_release-07'][0]
30 basf2.B2WARNING(f
'Current global tag is {GT}, please update the proper global tag to match the data')
31 basf2.conditions.prepend_globaltag(GT)
32 path = basf2.create_path()
33 path.add_module(
"Progress")
35 if len(sys.argv) != 4:
36 sys.exit(
"Three arguments are required: input_root, output_root, and data_type")
38 inputFilename = sys.argv[1]
40 file_name = sys.argv[2]
42 sample_name = sys.argv[3]
43 print(inputFilename,
'\n', file_name,
'\n', sample_name)
45 cdc_type = {
'data':
'RawCDCs',
'mc':
'CDCHits'}
46 branches = [
'EventMetaData', cdc_type[f
'{sample_name}']]
47 path.add_module(
"RootInput", inputFileNames=inputFilename, branchNames=branches)
48 path.add_module(
"Gearbox")
49 path.add_module(
"Geometry", useDB=
True)
51 if sample_name ==
'data':
56 path.add_module(
"AsicBackgroundLibraryCreator",
57 inputTracks=
"CDCTrackVector",
58 inputWireHits=
"CDCWireHitVector",
59 AsicLibraryFileName=file_name,
67 basf2.print_path(path)
72 print(basf2.statistics)
75if __name__ ==
"__main__":
def add_unpackers(path, components=None, writeKLMDigitRaws=False, addTOPRelations=False)
def add_track_finding(path, components=None, reco_tracks="RecoTracks", prune_temporary_tracks=True, use_second_cdc_hits=False, use_mc_truth=False, svd_ckf_mode="SVD_after", add_both_directions=True, svd_standalone_mode="VXDTF2", use_svd_to_cdc_ckf=True, use_ecl_to_cdc_ckf=False, add_cdcTrack_QI=True, add_vxdTrack_QI=False, pxd_filtering_offline=False, use_HLT_ROIs=False, create_intercepts_for_pxd_ckf=False)