12An example script to reconstruct osmics events with standalone CDC.
14basf2 runReconstruction.py <input> <output>
15input: Input root file (Raw data)
16 GCR1 (RAW) /hsm/belle2/bdata/Data/Raw/e0001/
17 GCR2 (RAW) /hsm/belle2/bdata/Data/Raw/e0002/
19output : Output root file, which contains helix parameters.
20 N.B. this is not the basf2 root file!
21 To see the helix parameters.
22 Please use compare2Tracks.C
for example.
33b2.use_database_chain()
34b2.use_central_database("332_COPY-OF_GT_gen_prod_004.11_Master-20171213-230000", b2.LogLevel.INFO)
35b2.use_central_database("MagneticFieldPhase2QCSoff")
36# use_local_database("/home/belle/muchida/basf2/work/caf/gcr2/test6/localDB/database.txt")
39def rec(input, output, topInCounter=False, magneticField=True,
40 unpacking=True, fieldMapper=
False):
41 main_path = b2.create_path()
42 b2.logging.log_level = b2.LogLevel.INFO
55 if os.path.exists(
'output')
is False:
59 main_path.add_module(
'RootInput',
63 main_path.add_module(
'CDCUnpacker')
65 if data_period ==
'gcr2017':
66 gearbox = b2.register_module(
'Gearbox',
67 fileName=
"/geometry/GCR_Summer2017.xml",
68 override=[(
"/Global/length",
"8.",
"m"),
69 (
"/Global/width",
"8.",
"m"),
70 (
"/Global/height",
"8.",
"m"),
72 main_path.add_module(gearbox)
74 main_path.add_module(
'Gearbox')
76 if fieldMapper
is True:
77 main_path.add_module(
'CDCJobCntlParModifier',
79 MapperPhiAngle=mapperAngle)
81 if magneticField
is True:
82 main_path.add_module(
'Geometry', useDB=
True)
84 main_path.add_module(
'Geometry',
85 components=[
'CDC',
'ECL'])
87 main_path.add_module(
'Progress')
97 output =
"/".join([
'output', output])
98 main_path.add_module(
'CDCCosmicAnalysis',
99 noBFit=
not magneticField,
103 b2.print_path(main_path)
104 b2.process(main_path)
108if __name__ ==
"__main__":
110 parser = argparse.ArgumentParser()
111 parser.add_argument(
'input', help=
'Input file to be processed (unpacked CDC data).')
112 parser.add_argument(
'output', help=
'Output file you want to store the results.')
113 args = parser.parse_args()
114 rec(args.input, args.output, topInCounter=
False, magneticField=
True,
115 unpacking=
True, fieldMapper=
False)
def set_cdc_cr_parameters(period)
def getDataPeriod(exp=0, run=0)
def add_cdc_cr_reconstruction(path, eventTimingExtraction=True, topInCounter=False, pval2ndTrial=0.001)
def getMapperAngle(exp=1, run=3118)
def getExpRunNumber(fname)