CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
customiseForRunI.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
3 def customiseForRunI(process):
4 
5  # apply only in reco step
6  if not hasattr(process,'reconstruction'):
7  return process
8 
9  # Put back 2012 default tracking. This piece of code is ugly.
10 
11  # first remove the current/default version of trackingGlocalReco
12  # and delete all its descendent sequences that are going to be
13  # redefined later on by the new process.load()
14 
15  # apply only in reco step
16  if not hasattr(process,'reconstruction'):
17  return process
18 
19  tgrIndex = process.globalreco_tracking.index(process.trackingGlobalReco)
20  tgrIndexFromReco = process.reconstruction_fromRECO.index(process.InitialStep)
21  process.globalreco_tracking.remove(process.trackingGlobalReco)
22  process.reconstruction_fromRECO.remove(process.InitialStep)
23  process.reconstruction_fromRECO.remove(process.DetachedTripletStep)
24  process.reconstruction_fromRECO.remove(process.LowPtTripletStep)
25  process.reconstruction_fromRECO.remove(process.PixelPairStep)
26  process.reconstruction_fromRECO.remove(process.MixedTripletStep)
27  process.reconstruction_fromRECO.remove(process.PixelLessStep)
28  process.reconstruction_fromRECO.remove(process.TobTecStep)
29  process.reconstruction_fromRECO.remove(process.JetCoreRegionalStep)
30  process.reconstruction_fromRECO.remove(process.earlyGeneralTracks)
31  process.reconstruction_fromRECO.remove(process.muonSeededStep)
32  process.reconstruction_fromRECO.remove(process.preDuplicateMergingGeneralTracks)
33  process.reconstruction_fromRECO.remove(process.generalTracksSequence)
34  process.reconstruction_fromRECO.remove(process.ConvStep)
35  process.reconstruction_fromRECO.remove(process.conversionStepTracks)
36  del process.trackingGlobalReco
37  del process.ckftracks
38  del process.ckftracks_wodEdX
39  del process.ckftracks_plus_pixelless
40  del process.ckftracks_woBH
41  del process.iterTracking
42  del process.InitialStep
43  del process.LowPtTripletStep
44  del process.PixelPairStep
45  del process.DetachedTripletStep
46  del process.MixedTripletStep
47  del process.PixelLessStep
48  del process.TobTecStep
49  del process.JetCoreRegionalStep
50 
51  # Load the new Iterative Tracking configuration
52  process.load("RecoTracker.Configuration.RecoTrackerRunI_cff")
53 
54  process.globalreco_tracking.insert(tgrIndex, process.trackingGlobalReco)
55  process.globalreco_tracking.insert(tgrIndex, process.recopixelvertexing)
56  process.reconstruction_fromRECO.insert(tgrIndexFromReco, process.iterTracking)
57 
58  # Now get rid of spurious reference to JetCore step
59  process.earlyGeneralTracks.trackProducers = ['initialStepTracks',
60  'lowPtTripletStepTracks',
61  'pixelPairStepTracks',
62  'detachedTripletStepTracks',
63  'mixedTripletStepTracks',
64  'pixelLessStepTracks',
65  'tobTecStepTracks'
66  ]
67 
68  process.earlyGeneralTracks.inputClassifiers =["initialStepSelector",
69  "lowPtTripletStepSelector",
70  "pixelPairStepSelector",
71  "detachedTripletStep",
72  "mixedTripletStep",
73  "pixelLessStepSelector",
74  "tobTecStep"
75  ]
76 
77  # Now get rid of any pre-splitting business
78  process.siPixelClusters = process.siPixelClustersPreSplitting.clone()
79  process.pixeltrackerlocalreco.replace(process.siPixelClustersPreSplitting, process.siPixelClusters)
80  process.pixeltrackerlocalreco.replace(process.siPixelRecHitsPreSplitting, process.siPixelRecHits)
81  process.clusterSummaryProducer.pixelClusters = 'siPixelClusters'
82  process.globalreco_tracking.replace(process.MeasurementTrackerEventPreSplitting, process.MeasurementTrackerEvent)
83  process.globalreco_tracking.replace(process.siPixelClusterShapeCachePreSplitting, process.siPixelClusterShapeCache)
84 
85  # Now restore pixelVertices wherever was not possible with an ad-hoc RunI cfg
86  process.muonSeededTracksInOutClassifier.vertices = 'pixelVertices'
87  process.muonSeededTracksOutInClassifier.vertices = 'pixelVertices'
88  process.muonSeededTracksOutInDisplacedClassifier.vertices = 'pixelVertices'
89  process.duplicateTrackClassifier.vertices = 'pixelVertices'
90  process.duplicateDisplacedTrackClassifier.vertices = 'pixelVertices'
91  process.convStepSelector.vertices = 'pixelVertices'
92  process.pixelPairElectronSeeds.RegionFactoryPSet.RegionPSet.VertexCollection = 'pixelVertices'
93  process.ak4CaloJetsForTrk.srcPVs = 'pixelVertices'
94  process.photonConvTrajSeedFromSingleLeg.primaryVerticesTag = 'pixelVertices'
95 
96  # ... and finally turn off all possible references to CCC: this is
97  # done by switching off the Tight and Loose reftoPSet, rather than
98  # following all the places in which they are effectively used in
99  # release. The RunI-like tracking already uses CCCNone: this will
100  # be useful mainly for conversions.
101  process.SiStripClusterChargeCutTight.value = -1.
102  process.SiStripClusterChargeCutLoose.value = -1.
103 
104 
105  if hasattr(process, 'TrackingDQMSourceTier0Common') and 'TrackSeedMonjetCoreRegionalStep' in process.TrackingDQMSourceTier0Common.moduleNames():
106  process.TrackingDQMSourceTier0Common.remove(process.TrackSeedMonjetCoreRegionalStep)
107 
108  if hasattr(process, 'TrackingDQMSourceTier0') and 'TrackSeedMonjetCoreRegionalStep' in process.TrackingDQMSourceTier0.moduleNames():
109  process.TrackingDQMSourceTier0.remove(process.TrackSeedMonjetCoreRegionalStep)
110 
111  if hasattr(process, 'TrackingDQMSourceTier0MinBias') and 'TrackSeedMonjetCoreRegionalStep' in process.TrackingDQMSourceTier0MinBias.moduleNames():
112  process.TrackingDQMSourceTier0MinBias.remove(process.TrackSeedMonjetCoreRegionalStep)
113 
114 
115 
116  return process