12from tracking
import add_cr_tracking_reconstruction
17d = datetime.datetime.today()
18print(d.strftime(
'This Calculution is done at : %d-%m-%y %H:%M:%S\n'))
22triggerSize = [50, 200]
25triggerPos = [0., 0., 0.]
28normTriggerPlanDirection = [0, 1, 0]
40probcut = float(probcut)
52with open(
'location')
as file:
53 lines = file.readlines()
55 if re.match(
r'dir_root', line):
56 rootdir = line.split(
'"')[1]
57 if re.match(
r'prefix', line):
58 prefix = line.split(
'"')[1]
59 if re.match(
r'dir_data', line):
60 datadir = line.split(
'"')[1]
61 if re.match(
r'dir_params', line):
62 param_dir = line.split(
'"')[1]
63 if re.match(
r't0_file', line):
64 t0_file = line.split(
'"')[1]
65 if re.match(
r'tw_file', line):
66 tw_file = line.split(
'"')[1]
67 if re.match(
r'xt_file', line):
68 xt_file = line.split(
'"')[1]
69 if re.match(
r'sigma_file', line):
70 sigma_file = line.split(
'"')[1]
72names = name.split(
".")
74inputfilename = datadir + f
"r{int(names[2]):05}/sub00/" + name
75outputfilename = rootdir +
'/output_' + name
76outputfilename2 = rootdir +
'/twotracks_' + name
77logfilename = rootdir +
'/run_' + name
81print(
"input : ", inputfilename)
82print(
"output: ", outputfilename)
83print(
"log : ", logfilename)
87main_path = b2.create_path()
88b2.logging.log_level = b2.LogLevel.ERROR
91main_path.add_module(
'RootInput',
92 inputFileNames=inputfilename)
94 main_path.add_module(
'CDCUnpacker',
96 enableStoreCDCRawHit=
True,
98 xmlMapFileName=
"data/cdc/ch_map_201702.dat",
100 enablePrintOut=
False,
104 subtractTrigTiming=
False
108main_path.add_module(
'Gearbox')
109main_path.add_module(
'CDCJobCntlParModifier',
113 T0File=param_dir + t0_file,
115 XtFile=param_dir + xt_file,
116 SigmaInputType=
False,
117 SigmaFile=param_dir + sigma_file,
118 TimeWalkInputType=
False,
119 TimeWalkFile=param_dir + tw_file,
120 ChannelMapInputType=
False,
121 ChannelMapFile=
"ch_map_201702.dat",
122 AlignmentInputType=
False,
123 AlignmentFile=param_dir +
"align_201702.dat"
125main_path.add_module(
'Geometry', excludedComponents=[
'SVD',
'PXD',
'ARICH',
'BeamPipe',
'HeavyMetalShield'])
127main_path.add_module(
'Progress')
128main_path.add_module(
'SetupGenfitExtrapolation')
129add_cr_tracking_reconstruction(path=main_path, prune_tracks=
False,
130 skip_geometry_adding=
False,
131 event_time_extraction=
True,
132 data_taking_period=
"gcr2017",
133 top_in_counter=
False,
135 use_second_cdc_hits=
False)
137#for analysis, if you want to check performance please enable this part
138main_path.add_module('CDCCosmicAnalysis',
139 Output = outputfilename2,
140 EventT0Extraction = True,
144main_path.add_module('CDCCRTest', logLevel=b2.LogLevel.ERROR,
145 RecoTracksColName='RecoTracks',
146 histogramDirectoryName=
'trackfit',
149 EventT0Extraction=
True,
151 calExpectedDriftTime=
True,
152 TriggerPos=triggerPos,
153 NormTriggerPlaneDirection=normTriggerPlanDirection,
154 TriggerSize=triggerSize,
155 EstimateResultForUnFittedLayer=
False,
156 StoreHitDistribution=
False,
157 StoreTrackParams=
False,
161main_path.add_module(
'HistoManager', histoFileName=outputfilename)
165b2.print_path(main_path)
168d = datetime.datetime.today()
170print(d.strftime(
'Finish at : %y-%m-%d %H:%M:%S\n'))