7 from ROOT
import Belle2
8 from tracking
import add_cr_tracking_reconstruction
13 d = datetime.datetime.today()
14 print(d.strftime(
'This Calculution is done at : %d-%m-%y %H:%M:%S\n'))
18 triggerSize = [50, 200]
21 triggerPos = [0., 0., 0.]
24 normTriggerPlanDirection = [0, 1, 0]
36 probcut = float(probcut)
49 with open(
'location')
as file:
50 lines = file.readlines()
52 if re.match(
r'dir_root', line):
53 rootdir = line.split(
'"')[1]
54 if re.match(
r'prefix', line):
55 prefix = line.split(
'"')[1]
56 if re.match(
r'dir_data', line):
57 datadir = line.split(
'"')[1]
58 if re.match(
r'dir_params', line):
59 param_dir = line.split(
'"')[1]
60 if re.match(
r't0_file', line):
61 t0_file = line.split(
'"')[1]
62 if re.match(
r'tw_file', line):
63 tw_file = line.split(
'"')[1]
64 if re.match(
r'xt_file', line):
65 xt_file = line.split(
'"')[1]
66 if re.match(
r'sigma_file', line):
67 sigma_file = line.split(
'"')[1]
69 names = name.split(
".")
71 inputfilename = datadir +
"r{0:05}/sub00/".format(int(names[2])) + name
72 outputfilename = rootdir +
'/output_' + name
73 outputfilename2 = rootdir +
'/twotracks_' + name
74 logfilename = rootdir +
'/run_' + name
78 print(
"input : ", inputfilename)
79 print(
"output: ", outputfilename)
80 print(
"log : ", logfilename)
84 main_path = basf2.create_path()
85 logging.log_level = LogLevel.ERROR
88 main_path.add_module(
'RootInput',
89 inputFileNames=inputfilename)
91 main_path.add_module(
'CDCUnpacker',
93 enableStoreCDCRawHit=
True,
95 xmlMapFileName=
"data/cdc/ch_map_201702.dat",
101 subtractTrigTiming=
False
105 main_path.add_module(
'Gearbox')
106 main_path.add_module(
'CDCJobCntlParModifier',
110 T0File=param_dir + t0_file,
112 XtFile=param_dir + xt_file,
113 SigmaInputType=
False,
114 SigmaFile=param_dir + sigma_file,
115 TimeWalkInputType=
False,
116 TimeWalkFile=param_dir + tw_file,
117 ChannelMapInputType=
False,
118 ChannelMapFile=
"ch_map_201702.dat",
119 AlignmentInputType=
False,
120 AlignmentFile=param_dir +
"align_201702.dat"
122 main_path.add_module(
'Geometry', excludedComponents=[
'SVD',
'PXD',
'ARICH',
'BeamPipe',
'HeavyMetalShield'])
124 main_path.add_module(
'Progress')
125 main_path.add_module(
'SetupGenfitExtrapolation')
126 add_cr_tracking_reconstruction(path=main_path, prune_tracks=
False,
127 skip_geometry_adding=
False,
128 event_time_extraction=
True,
129 data_taking_period=
"gcr2017",
130 top_in_counter=
False,
132 use_second_cdc_hits=
False)
134 #for analysis, if you want to check performance please enable this part
135 main_path.add_module('CDCCosmicAnalysis',
136 Output = outputfilename2,
137 EventT0Extraction = True,
141 main_path.add_module(
'CDCCRTest', logLevel=LogLevel.ERROR,
142 RecoTracksColName=
'RecoTracks',
143 histogramDirectoryName=
'trackfit',
146 EventT0Extraction=
True,
148 calExpectedDriftTime=
True,
149 TriggerPos=triggerPos,
150 NormTriggerPlaneDirection=normTriggerPlanDirection,
151 TriggerSize=triggerSize,
152 EstimateResultForUnFittedLayer=
False,
153 StoreHitDistribution=
False,
154 StoreTrackParams=
False,
158 main_path.add_module(
'HistoManager', histoFileName=outputfilename)
162 basf2.print_path(main_path)
165 d = datetime.datetime.today()
167 print(d.strftime(
'Finish at : %y-%m-%d %H:%M:%S\n'))