12 from tracking
import add_cr_tracking_reconstruction
17 d = datetime.datetime.today()
18 print(d.strftime(
'This Calculution is done at : %d-%m-%y %H:%M:%S\n'))
22 triggerSize = [50, 200]
25 triggerPos = [0., 0., 0.]
28 normTriggerPlanDirection = [0, 1, 0]
40 probcut = float(probcut)
52 with 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]
72 names = name.split(
".")
74 inputfilename = datadir +
"r{0:05}/sub00/".format(int(names[2])) + name
75 outputfilename = rootdir +
'/output_' + name
76 outputfilename2 = rootdir +
'/twotracks_' + name
77 logfilename = rootdir +
'/run_' + name
81 print(
"input : ", inputfilename)
82 print(
"output: ", outputfilename)
83 print(
"log : ", logfilename)
87 main_path = b2.create_path()
88 b2.logging.log_level = b2.LogLevel.ERROR
91 main_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
108 main_path.add_module(
'Gearbox')
109 main_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"
125 main_path.add_module(
'Geometry', excludedComponents=[
'SVD',
'PXD',
'ARICH',
'BeamPipe',
'HeavyMetalShield'])
127 main_path.add_module(
'Progress')
128 main_path.add_module(
'SetupGenfitExtrapolation')
129 add_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
138 main_path.add_module('CDCCosmicAnalysis',
139 Output = outputfilename2,
140 EventT0Extraction = True,
144 main_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,
161 main_path.add_module(
'HistoManager', histoFileName=outputfilename)
165 b2.print_path(main_path)
166 b2.process(main_path)
168 d = datetime.datetime.today()
170 print(d.strftime(
'Finish at : %y-%m-%d %H:%M:%S\n'))