InDetRecPostProcessing.py 28.8 KB
Newer Older
1
from InDetRecExample import TrackingCommon
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# ------------------------------------------------------------
#
# ----------- now we do post-processing
#
# ------------------------------------------------------------

if InDetFlags.doTRTPhaseCalculation() and jobproperties.Beam.beamType()=="collisions":
  #
  # --- now run the phase calculation
  #
  include ("InDetRecExample/ConfiguredInDetTRTPhase.py")
  InDetRecTRTPhase = ConfiguredInDetTRTPhase ([InDetKeys.UnslimmedTracks()],
                                              InDetKeys.TRT_Segments())

# ------------------------------------------------------------
#
# --- do primary vertexing and particle creation for default tracking
#
# ------------------------------------------------------------

22
# fix
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
if not InDetFlags.doTruth():
  InputTrackCollectionTruth = None

include ("InDetRecExample/ConfiguredPriVtxAndPartCreation.py")
InDetPriVtxPartCreation = ConfiguredPriVtxAndPartCreation (extension                 = "",
                                                           #InputTrackCollection      = InputTrackCollection,
                                                           InputTrackCollection      = InDetKeys.xAODTrackParticleContainer(),
                                                           InputTrackCollectionTruth = InputTrackCollectionTruth,
                                                           VxCandidates              = InDetKeys.xAODVertexContainer(),
                                                           TrackParticles            = InDetKeys.TrackParticles(),
                                                           TrackParticlesTruth       = InDetKeys.TrackParticlesTruth())

# ------------------------------------------------------------
#
# --- do particle creation for default forward tracking
#
# ------------------------------------------------------------

if InDetFlags.doForwardTracks():
  include ("InDetRecExample/ConfiguredPriVtxAndPartCreation.py")
  InDetPriVtxPartCreation = ConfiguredPriVtxAndPartCreation (extension                 = "ForwardTracks",
                                                             InputTrackCollection      = InDetKeys.ResolvedForwardTracks(),
                                                             InputTrackCollectionTruth = InDetKeys.ResolvedForwardTracksTruth(),
                                                             VxCandidates              = InDetKeys.xAODVertexContainer(),
                                                             TrackParticles            = InDetKeys.ResolvedForwardTrackParticles(),
                                                             TrackParticlesTruth       = InDetKeys.ResolvedForwardTrackParticlesTruth())


# ------------------------------------------------------------
#
#  --- now load primary vertex setup with no beamconstraint and in split mode for enhanced monitoring
#      this should be done after trackparticle creation because it always runs on trackparticles (as opposed to the default primary vertexing)
# ------------------------------------------------------------

if InDetFlags.doVertexFindingForMonitoring():

  # also load finder tools here (easier for container naming)
  #
  # PV with NO beam constraint
  #
  from InDetPriVxFinderTool.InDetPriVxFinderToolConf import InDet__InDetIterativePriVxFinderTool
  InDetPriVxFinderToolNoBeamConstraint = InDet__InDetIterativePriVxFinderTool(name                     = "InDetPriVxFinderToolNoBeamConstraint",
                                                                              VertexFitterTool         = InDetVxFitterTool,
                                                                              TrackSelector            = InDetTrackSelectorTool,
                                                                              SeedFinder               = InDetVtxSeedFinder,
                                                                              ImpactPoint3dEstimator   = InDetImpactPoint3dEstimator,
                                                                              LinearizedTrackFactory   = InDetLinFactory,
                                                                              useBeamConstraint        = False,
                                                                              significanceCutSeeding   = 12,
                                                                              maximumChi2cutForSeeding = 49,
                                                                              maxVertices              = 200,
                                                                              createSplitVertices      = False,
75
76
                                                                              doMaxTracksCut           = InDetPrimaryVertexingCuts.doMaxTracksCut(),
                                                                              MaxTracks                = InDetPrimaryVertexingCuts.MaxTracks()  )
77
78
  ToolSvc += InDetPriVxFinderToolNoBeamConstraint
  if (InDetFlags.doPrintConfigurables()):
scott snyder's avatar
scott snyder committed
79
    printfunc (InDetPriVxFinderToolNoBeamConstraint)
80
81
82
83
84
85
86

  from InDetPriVxFinder.InDetPriVxFinderConf import InDet__InDetPriVxFinder
  InDetPriVxFinderNoBeamConstraint = InDet__InDetPriVxFinder(name                        = "InDetPriVxFinderNoBeamConstraint",
                                                             VertexFinderTool            = InDetPriVxFinderToolNoBeamConstraint,
                                                             TracksName                  = InDetKeys.xAODTrackParticleContainer(),
                                                             VxCandidatesOutputName      = InDetKeys.PrimaryVerticesWithoutBeamConstraint(),
                                                             VertexCollectionSortingTool = VertexCollectionSortingTool,
87
88
                                                             doVertexSorting             = True)

89
90
  topSequence += InDetPriVxFinderNoBeamConstraint
  if InDetFlags.doPrintConfigurables():
scott snyder's avatar
scott snyder committed
91
    printfunc (InDetPriVxFinderNoBeamConstraint)
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108

if InDetFlags.doSplitVertexFindingForMonitoring():
  #
  # Split primary vertexing
  #
  from InDetPriVxFinderTool.InDetPriVxFinderToolConf import InDet__InDetIterativePriVxFinderTool
  InDetPriVxFinderToolSplit = InDet__InDetIterativePriVxFinderTool( name                     = "InDetIterativePriVxFinderToolSplit",
                                                                    VertexFitterTool         = InDetVxFitterTool,
                                                                    TrackSelector            = InDetTrackSelectorTool,
                                                                    SeedFinder               = InDetVtxSeedFinder,
                                                                    ImpactPoint3dEstimator   = InDetImpactPoint3dEstimator,
                                                                    LinearizedTrackFactory   = InDetLinFactory,
                                                                    useBeamConstraint        = False,
                                                                    significanceCutSeeding   = 12,
                                                                    maximumChi2cutForSeeding = 49,
                                                                    maxVertices              = 25,
                                                                    createSplitVertices      = True,
109
110
                                                                    doMaxTracksCut           = InDetPrimaryVertexingCuts.doMaxTracksCut(),
                                                                    MaxTracks                = InDetPrimaryVertexingCuts.MaxTracks())
111
112
  ToolSvc += InDetPriVxFinderToolSplit
  if (InDetFlags.doPrintConfigurables()):
scott snyder's avatar
scott snyder committed
113
    printfunc (InDetPriVxFinderToolSplit)
114
115
116
117
118
119
120

  from InDetPriVxFinder.InDetPriVxFinderConf import InDet__InDetPriVxFinder
  InDetPriVxFinderSplit= InDet__InDetPriVxFinder(name                        = "InDetPriVxFinderSplit",
                                                 VertexFinderTool            = InDetPriVxFinderToolSplit,
                                                 TracksName                  = InDetKeys.xAODTrackParticleContainer(),
                                                 VxCandidatesOutputName      = InDetKeys.PrimaryVerticesSplitStream(),
                                                 VertexCollectionSortingTool = VertexCollectionSortingTool,
121
                                                 doVertexSorting             = False)
122
123
  topSequence += InDetPriVxFinderSplit
  if InDetFlags.doPrintConfigurables():
scott snyder's avatar
scott snyder committed
124
    printfunc (InDetPriVxFinderSplit)
125
126


127
128
129
130
131
132
133
# -------------------------------------------------------------------------
#
# ----------- Apply TTVA decorations
#
# -------------------------------------------------------------------------

if InDetFlags.doTTVADecos():
134
135
136
137

  # Get a dummy (*unused*) TTVA tool - automatically handles addition of used-in-fit decoration
  from TrackVertexAssociationTool.getTTVAToolForReco import getTTVAToolForReco
  getTTVAToolForReco('dummy', TrackContName = InDetKeys.xAODTrackParticleContainer(), VertexContName = InDetKeys.xAODVertexContainer())
138

139
140
141
142
143
144
# -------------------------------------------------------------------------
#
# ----------- V0 Finder Algorithm
#
# -------------------------------------------------------------------------

145
if InDetFlags.doV0Finder():
146
147
148
  from TrkExTools.AtlasExtrapolator import AtlasExtrapolator
  v0_InDetExtrapolator = AtlasExtrapolator()

149
150
151
152
153
  if InDetFlags.useV0Fitter():
    from TrkV0Fitter.TrkV0FitterConf import Trk__TrkV0VertexFitter
    InDetV0Fitter = Trk__TrkV0VertexFitter(name              = 'InDetV0Fitter',
                                           MaxIterations     = 10,
                                           Use_deltaR        = False,
154
                                           Extrapolator      = v0_InDetExtrapolator)
155
156
157
    ToolSvc += InDetV0Fitter
    #InDetV0Fitter.OutputLevel = DEBUG
    if (InDetFlags.doPrintConfigurables()):
scott snyder's avatar
scott snyder committed
158
      printfunc (     InDetV0Fitter)
159
160
161
162
163
164
165
    #
    InDetVKVertexFitter  = None
    InDetKshortFitter    = None
    InDetLambdaFitter    = None
    InDetLambdabarFitter = None
  else:
    InDetV0Fitter   = None
166
    #
167
168
    from TrkVKalVrtFitter.TrkVKalVrtFitterConf import Trk__TrkVKalVrtFitter
    InDetVKVertexFitter = Trk__TrkVKalVrtFitter(name                = "InDetVKVFitter",
169
                                                Extrapolator        = v0_InDetExtrapolator,
170
                                                IterationNumber     = 30,
171
                                                MakeExtendedVertex  = True,
172
                                                FirstMeasuredPoint  = True)
173
    ToolSvc += InDetVKVertexFitter
174
    #InDetVKVertexFitter.OutputLevel = DEBUG
175
    if (InDetFlags.doPrintConfigurables()):
scott snyder's avatar
scott snyder committed
176
      printfunc (InDetVKVertexFitter)
177
178
179
      #
    from TrkVKalVrtFitter.TrkVKalVrtFitterConf import Trk__TrkVKalVrtFitter
    InDetKshortFitter = Trk__TrkVKalVrtFitter(name                = "InDetVKKVFitter",
180
                                              Extrapolator        = v0_InDetExtrapolator,
181
                                              IterationNumber     = 30,
182
                                              MakeExtendedVertex  = True,
183
184
185
186
187
                                              FirstMeasuredPoint  = True,
                                              InputParticleMasses = [139.57,139.57],
                                              MassForConstraint   = 497.672)
    ToolSvc += InDetKshortFitter
    if (InDetFlags.doPrintConfigurables()):
scott snyder's avatar
scott snyder committed
188
      printfunc (InDetKshortFitter)
189
190
191
    #
    from TrkVKalVrtFitter.TrkVKalVrtFitterConf import Trk__TrkVKalVrtFitter
    InDetLambdaFitter = Trk__TrkVKalVrtFitter(name                = "InDetVKLFitter",
192
                                              Extrapolator        = v0_InDetExtrapolator,
193
                                              IterationNumber     = 30,
194
                                              MakeExtendedVertex  = True,
195
196
197
198
199
                                              FirstMeasuredPoint  = True,
                                              InputParticleMasses = [938.272,139.57],
                                              MassForConstraint   = 1115.68)
    ToolSvc += InDetLambdaFitter
    if (InDetFlags.doPrintConfigurables()):
scott snyder's avatar
scott snyder committed
200
      printfunc (InDetLambdaFitter)
201
202
203
    #
    from TrkVKalVrtFitter.TrkVKalVrtFitterConf import Trk__TrkVKalVrtFitter
    InDetLambdabarFitter = Trk__TrkVKalVrtFitter(name                = "InDetVKLbFitter",
204
                                                 Extrapolator        = v0_InDetExtrapolator,
205
                                                 IterationNumber     = 30,
206
                                                 MakeExtendedVertex  = True,
207
208
209
210
211
                                                 FirstMeasuredPoint  = True,
                                                 InputParticleMasses = [139.57,938.272],
                                                 MassForConstraint   = 1115.68)
    ToolSvc += InDetLambdabarFitter
    if (InDetFlags.doPrintConfigurables()):
scott snyder's avatar
scott snyder committed
212
      printfunc (InDetLambdabarFitter)
213
214
215
216
217
  #
  # --- we always need the gamma tool
  #
  from TrkVKalVrtFitter.TrkVKalVrtFitterConf import Trk__TrkVKalVrtFitter
  InDetGammaFitter = Trk__TrkVKalVrtFitter(name                = "InDetVKGFitter",
218
                                           Extrapolator        = v0_InDetExtrapolator,
219
220
                                           IterationNumber     = 30,
                                           Robustness          = 6,
221
                                           MakeExtendedVertex  = True,
222
223
224
225
226
227
                                           FirstMeasuredPoint  = True,
                                           usePhiCnst          = True,
                                           useThetaCnst        = True,
                                           InputParticleMasses = [0.511,0.511])
  ToolSvc += InDetGammaFitter
  if (InDetFlags.doPrintConfigurables()):
scott snyder's avatar
scott snyder committed
228
    printfunc (InDetGammaFitter)
229
230
231

  # Track selector tool
  #
232
233
  if InDetFlags.doV0Finder() :
    if InDetFlags.doSimpleV0Finder() :
234
235
      from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetConversionTrackSelectorTool
      InDetV0VxTrackSelector = InDet__InDetConversionTrackSelectorTool(name                = "InDetV0VxTrackSelector",
236
                                                                       Extrapolator        = v0_InDetExtrapolator,
237
238
                                                                       maxTrtD0            = 50.,
                                                                       maxSiZ0             = 250.,
239
                                                                       significanceD0_Si   = 1.,
240
241
242
243
244
245
246
                                                                       significanceD0_Trt  = 1.,
                                                                       significanceZ0_Trt  = 3.,
                                                                       minPt               = 50.0,
                                                                       IsConversion        = False)
    else:
      from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetConversionTrackSelectorTool
      InDetV0VxTrackSelector = InDet__InDetConversionTrackSelectorTool(name                = "InDetV0VxTrackSelector",
247
                                                                       Extrapolator        = v0_InDetExtrapolator,
248
249
250
251
252
253
254
                                                                       maxTrtD0            = 50.,
                                                                       maxSiZ0             = 250.,
                                                                       significanceD0_Si   = 1.,
                                                                       significanceD0_Trt  = 1.,
                                                                       significanceZ0_Trt  = 3.,
                                                                       minPt               = 400.0,
                                                                       IsConversion        = False)
255
256
    ToolSvc += InDetV0VxTrackSelector
    if (InDetFlags.doPrintConfigurables()):
scott snyder's avatar
scott snyder committed
257
      printfunc (InDetV0VxTrackSelector)
258
259
      pass
    pass
260

261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
  #
  # Vertex point estimator
  #
  from InDetConversionFinderTools.InDetConversionFinderToolsConf import InDet__VertexPointEstimator
  InDetV0VtxPointEstimator = InDet__VertexPointEstimator(name                   = "InDetV0VtxPointEstimator",
                                                         MaxTrkXYDiffAtVtx      = [20.,20.,20.],
                                                         MaxTrkZDiffAtVtx       = [100.,100.,100.],
                                                         MaxTrkXYValue          = [400.,400.,400.],
                                                         MinArcLength           = [-800.,-800.,-800.],
                                                         MaxArcLength           = [800.,800.,800.],
                                                         MinDeltaR              = [-10000.,-10000.,-10000.],
                                                         MaxDeltaR              = [10000.,10000.,10000.],
                                                         MaxPhi                 = [10000., 10000., 10000.],
                                                         MaxChi2OfVtxEstimation = 2000.)
  ToolSvc += InDetV0VtxPointEstimator
  if (InDetFlags.doPrintConfigurables()):
scott snyder's avatar
scott snyder committed
277
    printfunc (InDetV0VtxPointEstimator)
278

279
  v0_tools = TrackingCommon.getV0Tools()
280

281
282
283
  #
  # InDetV0FinderTool
  #
284
  if InDetFlags.doSimpleV0Finder() :
285

286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
    from InDetV0Finder.InDetV0FinderConf import InDet__InDetV0FinderTool
    V0FinderTool = InDet__InDetV0FinderTool(name                    = 'InDetV0FinderTool',
                                            TrackParticleCollection = InDetKeys.xAODTrackParticleContainer(),
                                            useV0Fitter             = InDetFlags.useV0Fitter(),
                                            VertexFitterTool        = InDetV0Fitter,
                                            VKVertexFitterTool      = InDetVKVertexFitter,
                                            KshortFitterTool        = InDetKshortFitter,
                                            LambdaFitterTool        = InDetLambdaFitter,
                                            LambdabarFitterTool     = InDetLambdabarFitter,
                                            GammaFitterTool         = InDetGammaFitter,
                                            TrackSelectorTool       = InDetV0VxTrackSelector,
                                            VertexPointEstimator    = InDetV0VtxPointEstimator,
                                            doSimpleV0              = True,
                                            #useorigin               = False,
                                            #useTRTplusTRT           = True,
                                            #useTRTplusSi            = True,
                                            uksmin                  = 0.,
                                            uksmax                  = 2000.,
                                            ulamin                  = 0.,
                                            ulamax                  = 2000.,
306
307
                                            ksmin                   = 350,
                                            ksmax                   = 650,
308
309
                                            lamin                   = 900,
                                            lamax                   = 1300,
310
                                            d0_cut                  = 0.,
311
                                            UseBeamSpotCond         = False,
312
313
314
                                            V0Tools                 = v0_tools,
                                            TrackToVertexTool       = TrackingCommon.getInDetTrackToVertexTool(),
                                            Extrapolator            = v0_InDetExtrapolator)
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
  else:
    from InDetV0Finder.InDetV0FinderConf import InDet__InDetV0FinderTool
    V0FinderTool = InDet__InDetV0FinderTool(name                    = 'InDetV0FinderTool',
                                            TrackParticleCollection = InDetKeys.xAODTrackParticleContainer(),
                                            useV0Fitter             = InDetFlags.useV0Fitter(),
                                            VertexFitterTool        = InDetV0Fitter,
                                            VKVertexFitterTool      = InDetVKVertexFitter,
                                            KshortFitterTool        = InDetKshortFitter,
                                            LambdaFitterTool        = InDetLambdaFitter,
                                            LambdabarFitterTool     = InDetLambdabarFitter,
                                            GammaFitterTool         = InDetGammaFitter,
                                            TrackSelectorTool       = InDetV0VxTrackSelector,
                                            VertexPointEstimator    = InDetV0VtxPointEstimator,
                                            doSimpleV0              = False,
                                            #useorigin               = False,
                                            #useTRTplusTRT           = True,
                                            #useTRTplusSi            = True,
                                            useVertexCollection     = True,
                                            #trkSelPV                = True,
334
                                            UseBeamSpotCond         = False,
335
336
337
                                            V0Tools                 = v0_tools,
                                            TrackToVertexTool       = TrackingCommon.getInDetTrackToVertexTool(),
                                            Extrapolator            = v0_InDetExtrapolator)
338
339
  ToolSvc += V0FinderTool
  if (InDetFlags.doPrintConfigurables()):
scott snyder's avatar
scott snyder committed
340
    printfunc (V0FinderTool)
341

342
  #
343
344
345
  # --- now configure the algorithm
  #
  if InDetFlags.doV0Finder() :
346
347
348
349
350
351
352
    from InDetV0Finder.InDetV0FinderConf import InDet__V0MainDecorator
    V0Decorator = InDet__V0MainDecorator(name = "V0Decorator",
                                     V0Tools = v0_tools,
                                     V0ContainerName         = InDetKeys.xAODV0VertexContainer(),
                                     KshortContainerName     = InDetKeys.xAODKshortVertexContainer(),
                                     LambdaContainerName     = InDetKeys.xAODLambdaVertexContainer(),
                                     LambdabarContainerName  = InDetKeys.xAODLambdabarVertexContainer())
353
354
    from InDetV0Finder.InDetV0FinderConf import InDet__InDetV0Finder
    InDetV0Finder = InDet__InDetV0Finder(name                    = 'InDetV0Finder',
355
                                         #decorateV0              = False,
356
                                         InDetV0FinderToolName   = V0FinderTool,
357
                                         Decorator              = V0Decorator,
358
359
360
361
                                         V0ContainerName         = InDetKeys.xAODV0VertexContainer(),
                                         KshortContainerName     = InDetKeys.xAODKshortVertexContainer(),
                                         LambdaContainerName     = InDetKeys.xAODLambdaVertexContainer(),
                                         LambdabarContainerName  = InDetKeys.xAODLambdabarVertexContainer())
362

363
364
    topSequence += InDetV0Finder
    if (InDetFlags.doPrintConfigurables()):
scott snyder's avatar
scott snyder committed
365
      printfunc (InDetV0Finder)
366
367
      pass
    pass
368

369
  pass # end if (doV0Finder)
370
371
372
373
374
375
376
377

# ----------------------------------------------------------------------
#
# ----------- Use Conversion Finder to find V0s ?
#
# ----------------------------------------------------------------------
if InDetFlags.doSecVertexFinder():
  #
378
  # --- setup of cut values for  Secondary vertexing
379
380
  #
  if (not 'InDetSecondaryVertexCuts' in dir()):
scott snyder's avatar
scott snyder committed
381
    printfunc ("InDetRecPostProcessing: InDetSecondaryVertexCuts not set before - import them now")
382
383
384
385
    from InDetRecExample.ConfiguredSecondaryVertexCuts import ConfiguredSecondaryVertexCuts
    InDetSecondaryVertexCuts      = ConfiguredSecondaryVertexCuts(InDetFlags.secondaryVertexCutSetup(),
                                                                  InDetNewTrackingCuts.minSecondaryPt())
    if (InDetFlags.doPrintConfigurables()):
scott snyder's avatar
scott snyder committed
386
      printfunc (InDetSecondaryVertexCuts.printInfo()         )
387
388
389
390
391
392
393
394
395
396
    pass
  pass
  #
  # --- configure the secondary vertex finder
  #
  from InDetRecExample.ConfiguredSecVertexFinding import ConfiguredSecVertexFinding
  InDetSecVertexFinding = ConfiguredSecVertexFinding (prefix           = "InDetSecVx",
                                                      VertexCuts       = InDetSecondaryVertexCuts,
                                                      TrackParticles   = InDetKeys.TrackParticles(),
                                                      SecVertices      = InDetKeys.SecVertices(),
397
                                                      Extrapolator     = TrackingCommon.getInDetExtrapolator(), # @TODO use AtlasExtrapolator ?
398
399
400
401
402
403
404
405
406
407
408
409
                                                      printConfig      = InDetFlags.doPrintConfigurables())
  # --- we need the driving algorithm
  InDetSecVertexFinding.addAlgorithm()

# -------------------------------------------------------------------------
#
# ----------- Conversion Finder
#
# -------------------------------------------------------------------------

if InDetFlags.doConversions():
  #
410
  # --- setup of cut values for  Conversion vertexing
411
412
  #
  if (not 'InDetConversionVertexCuts' in dir()):
scott snyder's avatar
scott snyder committed
413
    printfunc ("InDetRecPostProcessing: InDetConversionVertexCuts not set before - import them now")
414
415
    from InDetRecExample.ConfiguredSecondaryVertexCuts import ConfiguredSecondaryVertexCuts
    InDetConversionVertexCuts      = ConfiguredSecondaryVertexCuts(InDetFlags.conversionVertexCutSetup(),
416
                                                                   InDetNewTrackingCuts.minPT())
417
418
419
420
421
422
423
424
425

    from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as geoFlags
    if geoFlags.Run() == "RUN3":
	    InDetConversionVertexCuts._ConfiguredSecondaryVertexCuts__SingleTrk_MinRatioOfHLhits = 0.40
	    InDetConversionVertexCuts._ConfiguredSecondaryVertexCuts__TrkSel_TRTTrksBinnedRatioTRT = [0.51, 0.80, 0.90, 0.80, 0.51, 0.51, 0.51, 0.51, 0.51, 0.51]
    else:
	    InDetConversionVertexCuts._ConfiguredSecondaryVertexCuts__SingleTrk_MinRatioOfHLhits = 0.51
	    InDetConversionVertexCuts._ConfiguredSecondaryVertexCuts__TrkSel_TRTTrksBinnedRatioTRT = [0.60, 0.80, 0.90, 0.80, 0.51, 0.51, 0.51, 0.51, 0.51, 0.51]

426
    if (InDetFlags.doPrintConfigurables()):
scott snyder's avatar
scott snyder committed
427
      printfunc (InDetConversionVertexCuts.printInfo())
428
429
430
431
432
    pass
  pass
  #
  # --- configure the conversion finder
  #
433
434
435
436
437
438

  # Utility for conversion tool
  from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__NeutralParticleParameterCalculator
  convUtils = Trk__NeutralParticleParameterCalculator(
      name                   = "convUtils",
      LinearizedTrackFactory = None)
439
  ToolSvc+= convUtils
440

441
442
443
  from InDetRecExample.ConfiguredSecVertexFinding import ConfiguredSecVertexFinding
  InDetConversionFinding = ConfiguredSecVertexFinding (prefix           = "InDetConversion",
                                                       VertexCuts       = InDetConversionVertexCuts,
444
                                                       TrackParticles   = InDetKeys.xAODTrackParticleContainer(),
445
                                                       SecVertices      = InDetKeys.Conversions(),
446
                                                       Extrapolator     = TrackingCommon.getInDetExtrapolator(), # @TODO use AtlasExtrapolator ?
447
448
449
450
                                                       printConfig      = InDetFlags.doPrintConfigurables())
  # --- we need the driving algorithm
  InDetConversionFinding.addAlgorithm()

451
452
  from egammaTrackTools.egammaTrackToolsFactories import EMExtrapolationTools
  topSequence.InDetConversionFinder.ExtrapolationTool  =  EMExtrapolationTools.copyPublic('egammaExtrapolationTool')()
453
454
  topSequence.InDetConversionFinder.doExtrapolation = True

455

456
457
# [XXX JDC: problems with the association tool (Tracks already in SG)
# @TODO needs to be fixed.
458
if InDetFlags.doParticleCreation() and not InDetFlags.useExistingTracksAsInput():
459
460
 trackToVertexTool = None
 if InDetFlags.perigeeExpression() == 'Vertex' :
461
     trackToVertexTool = TrackingCommon.getInDetTrackToVertexTool()
462

463
464
if rec.doPhysicsValidationAugmentation() :
  try:
465
466
    import InDetPhysValMonitoring.InDetPhysValDecoration
    InDetPhysValMonitoring.InDetPhysValDecoration.addDecoratorIfNeeded()
467
  except ImportError:
468
469
470
471
472
    from AthenaCommon.Logging import logging
    log = logging.getLogger('InDetRecExample/InDetRecPostProcessing.py' )
    log.info('Package InDetPhysValMonitoring.InDetPhysValDecoration is missing.'\
               ' So, will not run the decoration. Module should become available in future'\
               ' versions of InDetPhysValMonitoring')
473
474
    import traceback
    log.info (traceback.format_exc())
475
    import sys
476
477
    sys.exit(1)
    pass
478