CMS 3D CMS Logo

trackingNtuple_cff.py
Go to the documentation of this file.
1 import FWCore.ParameterSet.Config as cms
2 
11 
15 import Validation.RecoTrack.TrackValidation_cff as _TrackValidation_cff
16 
17 _includeHits = True
18 #_includeHits = False
19 
20 _includeSeeds = True
21 #_includeSeeds = False
22 
23 from CommonTools.RecoAlgos.trackingParticleRefSelector_cfi import trackingParticleRefSelector as _trackingParticleRefSelector
24 trackingParticlesIntime = _trackingParticleRefSelector.clone(
25  signalOnly = False,
26  intimeOnly = True,
27  chargedOnly = False,
28  tip = 1e5,
29  lip = 1e5,
30  minRapidity = -10,
31  maxRapidity = 10,
32  ptMin = 0,
33 )
34 trackingNtuple.trackingParticles = "trackingParticlesIntime"
35 trackingNtuple.trackingParticlesRef = True
36 trackingNtuple.includeAllHits = _includeHits
37 trackingNtuple.includeSeeds = _includeSeeds
38 
40  ret = []
41  for item in lst:
42  if "PreSplitting" in item:
43  continue
44  if "SeedsA" in item and item.replace("SeedsA", "SeedsB") in lst:
45  ret.append(item.replace("SeedsA", "Seeds"))
46  continue
47  if "SeedsB" in item:
48  continue
49  if "SeedsPair" in item and item.replace("SeedsPair", "SeedsTripl") in lst:
50  ret.append(item.replace("SeedsPair", "Seeds"))
51  continue
52  if "SeedsTripl" in item:
53  continue
54  ret.append(item)
55  return ret
56 _seedProducers = _filterForNtuple(_TrackValidation_cff._seedProducers)
57 _seedProducers_trackingPhase1 = _filterForNtuple(_TrackValidation_cff._seedProducers_trackingPhase1)
58 _seedProducers_trackingPhase1QuadProp = _filterForNtuple(_TrackValidation_cff._seedProducers_trackingPhase1QuadProp)
59 _seedProducers_trackingPhase2PU140 = _filterForNtuple(_TrackValidation_cff._seedProducers_trackingPhase2PU140)
60 
61 (_seedSelectors, trackingNtupleSeedSelectors) = _TrackValidation_cff._addSeedToTrackProducers(_seedProducers, globals())
62 (_seedSelectors_trackingPhase1, _trackingNtupleSeedSelectors_trackingPhase1) = _TrackValidation_cff._addSeedToTrackProducers(_seedProducers_trackingPhase1, globals())
63 (_seedSelectors_trackingPhase1QuadProp, _trackingNtupleSeedSelectors_trackingPhase1QuadProp) = _TrackValidation_cff._addSeedToTrackProducers(_seedProducers_trackingPhase1QuadProp, globals())
64 (_seedSelectors_trackingPhase2PU140, _trackingNtupleSeedSelectors_trackingPhase2PU140) = _TrackValidation_cff._addSeedToTrackProducers(_seedProducers_trackingPhase2PU140, globals())
65 from Configuration.Eras.Modifier_trackingPhase1_cff import trackingPhase1
66 from Configuration.Eras.Modifier_trackingPhase1QuadProp_cff import trackingPhase1QuadProp
67 from Configuration.Eras.Modifier_trackingPhase2PU140_cff import trackingPhase2PU140
68 trackingPhase1.toReplaceWith(trackingNtupleSeedSelectors, _trackingNtupleSeedSelectors_trackingPhase1)
69 trackingPhase1QuadProp.toReplaceWith(trackingNtupleSeedSelectors, _trackingNtupleSeedSelectors_trackingPhase1QuadProp)
70 trackingPhase2PU140.toReplaceWith(trackingNtupleSeedSelectors, _trackingNtupleSeedSelectors_trackingPhase2PU140)
71 
72 trackingNtuple.seedTracks = _seedSelectors
73 trackingPhase1.toModify(trackingNtuple, seedTracks = _seedSelectors_trackingPhase1)
74 trackingPhase1QuadProp.toModify(trackingNtuple, seedTracks = _seedSelectors_trackingPhase1)
75 trackingPhase2PU140.toModify(trackingNtuple, seedTracks = _seedSelectors_trackingPhase2PU140)
76 
78  return name.replace("seedTracks", "").replace("Seeds", "TrackCandidates")
79 trackingNtuple.trackCandidates = map(_seedProdToTrackCands, _seedProducers)
80 trackingPhase1.toModify(trackingNtuple, trackCandidates=map(_seedProdToTrackCands, _seedProducers_trackingPhase1))
81 trackingPhase1QuadProp.toModify(trackingNtuple, trackCandidates=map(_seedProdToTrackCands, _seedProducers_trackingPhase1QuadProp))
82 trackingPhase2PU140.toModify(trackingNtuple, trackCandidates=map(_seedProdToTrackCands, _seedProducers_trackingPhase2PU140))
83 
84 trackingNtupleSequence = cms.Sequence()
85 # reproduce hits because they're not stored in RECO
86 if _includeHits:
87  trackingNtupleSequence += (
88  siPixelRecHits +
89  siStripMatchedRecHits
90  )
91  _phase2_trackingNtupleSequence = trackingNtupleSequence.copy()
92  _phase2_trackingNtupleSequence.remove(siStripMatchedRecHits)
93  _phase2_trackingNtupleSequence += (siPhase2RecHits)
94  trackingPhase2PU140.toReplaceWith(trackingNtupleSequence, _phase2_trackingNtupleSequence)
95 
96 if _includeSeeds:
97  trackingNtupleSequence += trackingNtupleSeedSelectors
98 
99 trackingNtupleSequence += (
100  # sim information
101  trackingParticlesIntime +
102  simHitTPAssocProducer +
103  tpClusterProducer +
104  quickTrackAssociatorByHits +
105  trackingParticleNumberOfLayersProducer +
106  # ntuplizer
107  trackingNtuple
108 )
109 
110 trackingPhase2PU140.toModify(trackingNtuple, # FIXME
111  pixelDigiSimLink = cms.untracked.InputTag('simSiPixelDigis', "Pixel"),
112  stripDigiSimLink = cms.untracked.InputTag(''),
113  phase2OTSimLink = cms.untracked.InputTag('simSiPixelDigis', "Tracker")
114 )
def _seedProdToTrackCands(name)
def replace(string, replacements)
Expects test.root in current directory.