13 An example script to reconstruct osmics events with standalone CDC.
15 basf2 runReconstruction.py <input> <output>
16 input: Input root file (Raw data)
17 GCR1 (RAW) /hsm/belle2/bdata/Data/Raw/e0001/
18 GCR2 (RAW) /hsm/belle2/bdata/Data/Raw/e0002/
20 output : Output root file, which contains helix parameters.
21 N.B. this is not the basf2 root file!
22 To see the helix parameters.
23 Please use compare2Tracks.C for example.
34 b2.use_database_chain()
35 b2.use_central_database(
"332_COPY-OF_GT_gen_prod_004.11_Master-20171213-230000", b2.LogLevel.INFO)
36 b2.use_central_database(
"MagneticFieldPhase2QCSoff")
40 def rec(input, output, topInCounter=False, magneticField=True,
41 unpacking=True, fieldMapper=False):
42 main_path = b2.create_path()
43 b2.logging.log_level = b2.LogLevel.INFO
56 if os.path.exists(
'output')
is False:
60 main_path.add_module(
'RootInput',
64 main_path.add_module(
'CDCUnpacker')
66 if data_period ==
'gcr2017':
67 gearbox = b2.register_module(
'Gearbox',
68 fileName=
"/geometry/GCR_Summer2017.xml",
69 override=[(
"/Global/length",
"8.",
"m"),
70 (
"/Global/width",
"8.",
"m"),
71 (
"/Global/height",
"8.",
"m"),
73 main_path.add_module(gearbox)
75 main_path.add_module(
'Gearbox')
77 if fieldMapper
is True:
78 main_path.add_module(
'CDCJobCntlParModifier',
80 MapperPhiAngle=mapperAngle)
82 if magneticField
is True:
83 main_path.add_module(
'Geometry', useDB=
True)
85 main_path.add_module(
'Geometry',
86 components=[
'CDC',
'ECL'])
88 main_path.add_module(
'Progress')
98 output =
"/".join([
'output', output])
99 main_path.add_module(
'CDCCosmicAnalysis',
100 noBFit=
not magneticField,
104 b2.print_path(main_path)
105 b2.process(main_path)
109 if __name__ ==
"__main__":
111 parser = argparse.ArgumentParser()
112 parser.add_argument(
'input', help=
'Input file to be processed (unpacked CDC data).')
113 parser.add_argument(
'output', help=
'Output file you want to store the results.')
114 args = parser.parse_args()
115 rec(args.input, args.output, topInCounter=
False, magneticField=
True,
116 unpacking=
True, fieldMapper=
False)
def getExpRunNumber(fname)
def set_cdc_cr_parameters(period)
def getMapperAngle(exp=1, run=3118)
def add_cdc_cr_reconstruction(path, eventTimingExtraction=True, topInCounter=False, pval2ndTrial=0.001)
def getDataPeriod(exp=0, run=0)