12from ROOT
import Belle2
13from alignment
import MillepedeCalibration
17tracks = [
'CosmicRecoTracks']
18particles = [
'mu+:bbmu']
20primary_vertices = [
'Z0:mumu']
22geometry_components = []
23do_reconstruction =
False
24do_cosmics_reconstruction =
False
33 geometryComponents=None,
34 doReconstruction=None,
37 doCosmicsReconstruction=None):
38 if gearboxFile
is None:
39 gearboxFile = gearbox_file
40 if geometryComponents
is None:
41 geometryComponents = geometry_components
42 if doReconstruction
is None:
43 doReconstruction = do_reconstruction
44 if doAnalysis
is None:
45 doAnalysis = do_analysis
47 magnetOff = magnet_off
48 if do_cosmics_reconstruction
is None:
49 doCosmicsReconstruction = do_cosmics_reconstruction
51 import modularAnalysis
as ana
52 import reconstruction
as reco
54 path = b2.create_path()
55 path.add_module(
'Progress')
57 path.add_module(
'Gearbox', fileName=gearboxFile)
if gearboxFile
else path.add_module(
'Gearbox')
59 if geometryComponents:
60 path.add_module(
'Geometry', components=geometryComponents, excludedComponents=[
'MagneticField']
if magnetOff
else [])
62 path.add_module(
'Geometry', excludedComponents=[
'MagneticField']
if magnetOff
else [])
65 if geometryComponents:
66 reco.add_reconstruction(path, pruneTracks=
False, components=geometryComponents)
68 reco.add_reconstruction(path, pruneTracks=
False)
70 if doCosmicsReconstruction:
74 if not geometryComponents
or 'PXD' in geometryComponents:
76 if not geometryComponents
or 'SVD' in geometryComponents:
79 if geometryComponents:
80 reco.add_cosmics_reconstruction(
83 components=geometryComponents,
86 reco.add_cosmics_reconstruction(
91 if 'SetupGenfitExtrapolation' not in path:
92 path.add_module(
'SetupGenfitExtrapolation', noiseBetheBloch=
False, noiseCoulomb=
False, noiseBrems=
False)
95 ana.fillParticleList(
'mu+:bbmu',
'muonID > 0.1 and useLabFrame(p) > 0.5',
True, path)
96 ana.fillParticleList(
'mu+:qed',
'muonID > 0.1 and useLabFrame(p) > 2.',
True, path)
97 ana.reconstructDecay(
'Z0:mumu -> mu-:qed mu+:qed',
'', writeOut=
True, path=path)
98 ana.vertexRaveDaughtersUpdate(
'Z0:mumu', 0.0, path=path, constraint=
'ipprofile')
104 millepede = MillepedeCalibration()
109 millepede = MillepedeCalibration(components,
113 primary_vertices=primary_vertices,
117 millepede.set_command(
'chiscut',
None)
118 millepede.set_command(
'outlierdownweighting',
None)
119 millepede.set_command(
'dwfractioncut',
None)
121 millepede.algo.invertSign()
127 millepede = setup_default()
128 millepede.set_command(
'Fortranfiles')
129 millepede.set_command(
'constraints.txt')
133def setup_BeamVertex():
134 millepede = setup_default()
135 millepede.set_components([
'BeamSpot'])
139def setup_VXDHalfShells():
140 millepede = setup_default()
141 millepede.set_components([
'VXDAlignment'])
142 millepede.fixSVDPat()
143 for layer
in range(1, 7):
144 for ladder
in range(1, 17):
146 millepede.fixVXDid(layer, ladder, 0)
147 for sensor
in range(1, 6):
149 millepede.fixVXDid(layer, ladder, sensor)
153def setup_VXDFullHierarchy():
154 millepede = setup_default()
155 millepede.set_components([
'VXDAlignment'])
156 millepede.set_command(
'Fortranfiles')
157 millepede.set_command(
'constraints.txt')
161def setup_VXDSensors():
162 millepede = setup_default()
163 millepede.set_components([
'VXDAlignment'])
164 millepede.fixSVDPat()
165 millepede.fixSVDMat()
166 millepede.fixPXDYing()
167 millepede.fixPXDYang()
168 for layer
in range(1, 7):
169 for ladder
in range(1, 17):
171 millepede.fixVXDid(layer, ladder, 0)
172 for sensor
in range(1, 6):
176 millepede.fixVXDid(1, 1, 1)
180def setup_CDCLayers():
181 millepede = setup_default()
182 millepede.set_components([
'CDCAlignment',
'CDCLayerAlignment'])
183 millepede.fixCDCLayerX(49)
184 millepede.fixCDCLayerY(49)
185 millepede.fixCDCLayerRot(49)
186 millepede.fixCDCLayerX(55)
187 millepede.fixCDCLayerY(55)
188 millepede.fixCDCLayerRot(55)
192def setup_CDCTimeWalks():
193 millepede = setup_default()
194 millepede.set_components([
'CDCTimeWalks'])
195 millepede.fixCDCTimeWalk(1)
199def setup_BKLMAlignment():
200 millepede = setup_default()
201 millepede.set_components([
'BKLMAlignment'])
205 for sector
in range(1, 9):
206 for layer
in range(1, 16):
207 for forward
in [0, 1]:
208 millepede.fixBKLMModule(forward, sector, layer, [1, 2, 3, 4, 5, 6])
212def setup_EKLMAlignment():
213 millepede = setup_default()
214 millepede.set_components([
'EKLMAlignment'])
215 millepede.fixEKLMModule(1, 12, 2, 1, 1, [1, 2, 6])
219def setup_CDCLayers_GCR_Karim():
220 geometry =
'/alignment/examples/GCR_Summer2017.xml'
221 recotracks = [
'RecoTracks']
222 global do_cosmics_reconstruction
223 do_cosmics_reconstruction =
True
226 millepede = setup_CDCLayers()
227 millepede.algo.invertSign(
False)
229 millepede.set_param(recotracks,
'tracks')
230 millepede.set_param(geometry,
'fileName',
'Gearbox')
231 millepede.set_param(1.e-20,
'minPValue')
static unsigned short getGlobalUniqueID()
Get global unique identifier.
def add_pxd_reconstruction(path, clusterName=None, digitsName=None, usePXDClusterShapes=False, spacePointsName='PXDSpacePoints')
def add_svd_reconstruction(path, isROIsimulation=False, createRecoDigits=False, applyMasking=False)