Belle II Software  release-08-01-10
AsicBackgroundLibraryGenerator.py
1 
8 
9 import basf2
10 import sys
11 import rawdata
12 import tracking
13 
14 
15 def main():
16  """
17  Sample script to generte ASIC cross-talk library. Usage:
18 
19  basf2 AsicBackgroundLibraryGenerator.py <cosmic_raw_data_file> <output_asicbg_root_file>
20  """
21  global_tag = "data_reprocessing_prompt_rel4_patchb"
22  basf2.conditions.override_globaltags()
23  basf2.conditions.expert_settings(usable_globaltag_states={"TESTING", "VALIDATED",
24  "PUBLISHED", "RUNNING", "OPEN"})
25  basf2.conditions.append_globaltag(global_tag)
26  path = basf2.create_path()
27  path.add_module("Progress")
28 
29  # Input raw data file
30  inputFilename = sys.argv[1]
31  # Output file
32  file_name = sys.argv[2]
33 
34  branches = ['EventMetaData', 'RawCDCs']
35  path.add_module("RootInput", inputFileNames=inputFilename, branchNames=branches)
36  path.add_module("Gearbox")
37  path.add_module("Geometry", useDB=True)
38 
39  unpackers = ['CDC']
40  rawdata.add_unpackers(path, components=unpackers)
41 
42  tracking.add_track_finding(path, components=['CDC'])
43 
44  path.add_module("AsicBackgroundLibraryCreator",
45  inputTracks="CDCTrackVector",
46  inputWireHits="CDCWireHitVector",
47  AsicLibraryFileName=file_name,
48  # maximalDistanceSignal=100.2,
49  # minimalDistanceBackground=0.0,
50  # useAxialHitsOnly=False,
51  # minimalHitsOnTrack=0,
52  writeExtraVars=True
53  )
54 
55  basf2.print_path(path)
56 
57  # Run the execution path
58  basf2.process(path)
59 
60  print(basf2.statistics)
61 
62 
63 if __name__ == "__main__":
64  main()
Definition: main.py:1
def add_unpackers(path, components=None, writeKLMDigitRaws=False, addTOPRelations=False)
Definition: rawdata.py:67
int main(int argc, char **argv)
Run all tests.
Definition: test_main.cc:91
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)
Definition: __init__.py:385