1 import FWCore.ParameterSet.Config
as cms
4 if hasattr(tag,
"getModuleLabel"):
8 return t.getModuleLabel()+t.getProductInstanceLabel()
11 process.load(
"Validation.RecoTrack.trackingNtuple_cff")
12 process.TFileService = cms.Service(
"TFileService",
13 fileName = cms.string(
'trackingNtuple.root')
16 if process.trackingNtuple.includeSeeds.value():
18 if not hasattr(process,
"reconstruction_step"):
19 raise Exception(
"TrackingNtuple includeSeeds=True needs reconstruction which is missing")
21 if not hasattr(process,
"HLTIterativeTrackingIter02"):
22 raise Exception(
"TrackingNtuple includeSeeds=True needs HLTIterativeTrackingIter02 which is missing")
25 if not hasattr(process,
"validation_step"):
26 raise Exception(
"TrackingNtuple customise assumes process.validation_step exists")
30 usePileupSimHits = hasattr(process,
"mix")
and hasattr(process.mix,
"input")
and len(process.mix.input.fileNames) > 0
34 if not hasattr(process,
"hltMultiTrackValidation"):
35 process.load(
"Validation.RecoTrack.HLTmultiTrackValidator_cff")
36 process.trackingNtupleSequence = process.hltMultiTrackValidation.copy()
38 process.hltSiStripRecHits = SiStripRecHitConverter_cfi.siStripMatchedRecHits.clone(
39 ClusterProducer =
"hltSiStripRawToClustersFacility",
40 StripCPE =
"hltESPStripCPEfromTrackAngle:hltESPStripCPEfromTrackAngle"
42 process.trackingNtupleSequence.insert(0,process.trackingParticlesIntime+process.simHitTPAssocProducer)
43 process.trackingNtupleSequence.remove(process.hltTrackValidator)
44 process.trackingNtupleSequence += process.hltSiStripRecHits + process.trackingNtuple
47 if mergeIters
and isRECO:
48 process.mergedStepTracks = cms.EDProducer(
"TrackSimpleMerger",
49 src = cms.VInputTag(m.replace(
"Seeds",
"Tracks").
replace(
"seedTracks",
"")
for m
in process.trackingNtuple.seedTracks)
51 process.trackingNtupleSequence.insert(0,process.mergedStepTracks)
52 process.trackingNtuple.tracks =
"mergedStepTracks"
54 ntuplePath = cms.Path(process.trackingNtupleSequence)
56 if process.trackingNtuple.includeAllHits
and process.trackingNtuple.includeTrackingParticles
and usePileupSimHits:
57 ntuplePath.insert(0, cms.SequencePlaceholder(
"mix"))
59 process.load(
"Validation.RecoTrack.crossingFramePSimHitToPSimHits_cfi")
60 instanceLabels = [
_label(tag)
for tag
in process.simHitTPAssocProducer.simHitSrc]
61 process.crossingFramePSimHitToPSimHits.src = [
"mix:"+l
for l
in instanceLabels]
62 process.simHitTPAssocProducer.simHitSrc = [
"crossingFramePSimHitToPSimHits:"+l
for l
in instanceLabels]
63 process.trackingNtupleSequence.insert(0, process.crossingFramePSimHitToPSimHits)
66 modifier = cms.Modifier()
68 modifier.toReplaceWith(process.prevalidation_step, ntuplePath)
69 modifier.toReplaceWith(process.validation_step, cms.EndPath())
72 for p
in [process.paths_(), process.endpaths_()]:
73 for pathName, path
in p.items():
74 if "prevalidation_step" in pathName:
75 if len(pathName.replace(
"prevalidation_step",
"")) > 0:
76 modifier.toReplaceWith(path, cms.Path())
77 elif "validation_step" in pathName:
78 if len(pathName.replace(
"validation_step",
"")) > 0:
79 modifier.toReplaceWith(path, cms.EndPath())
82 for outputModule
in process.outputModules_().
values():
83 for path
in process.paths_().
values():
84 path.remove(outputModule)
85 for path
in process.endpaths_().
values():
86 path.remove(outputModule)
102 "hltIter0PFLowPixelSeedsFromPixelTracks",
103 "hltIter1PFLowPixelSeedsFromPixelTracks",
104 "hltIter2PFlowPixelSeeds",
105 "hltDoubletRecoveryPFlowPixelSeeds"
107 _candidatesProducers = [
108 "hltIter0PFlowCkfTrackCandidates",
109 "hltIter1PFlowCkfTrackCandidates",
110 "hltIter2PFlowCkfTrackCandidates",
111 "hltDoubletRecoveryPFlowCkfTrackCandidates"
113 (_seedSelectors, _tmpTask) = _TrackValidation_cff._addSeedToTrackProducers(_seedProducers, globals())
114 _seedSelectorsTask = cms.Task()
115 for modName
in _seedSelectors:
116 if not hasattr(process, modName):
117 setattr(process,modName, globals()[modName].
clone(beamSpot =
"hltOnlineBeamSpot"))
118 _seedSelectorsTask.add(getattr(process, modName))
122 process.trackingNtupleSequence.insert(0,cms.Sequence(_seedSelectorsTask))
123 if process.hltSiStripRawToClustersFacility.onDemand.value():
125 process.trackingNtupleSequence.insert(0,process.hltMergedTracks)
127 process.trackingNtuple.tracks =
"hltMergedTracks"
128 process.trackingNtuple.seedTracks = _seedSelectors
129 process.trackingNtuple.trackCandidates = _candidatesProducers
130 process.trackingNtuple.clusterTPMap =
"hltTPClusterProducer"
131 process.trackingNtuple.trackAssociator =
"hltTrackAssociatorByHits"
132 process.trackingNtuple.beamSpot =
"hltOnlineBeamSpot"
133 process.trackingNtuple.pixelRecHits =
"hltSiPixelRecHits"
134 process.trackingNtuple.stripRphiRecHits =
"hltSiStripRecHits:rphiRecHit"
135 process.trackingNtuple.stripStereoRecHits =
"hltSiStripRecHits:stereoRecHit"
136 process.trackingNtuple.stripMatchedRecHits =
"hltSiStripRecHits:matchedRecHit"
137 process.trackingNtuple.vertices =
"hltPixelVertices"
138 process.trackingNtuple.TTRHBuilder =
"hltESPTTRHBWithTrackAngle"
139 process.trackingNtuple.parametersDefiner =
"hltLhcParametersDefinerForTP"
140 process.trackingNtuple.includeMVA =
False
145 process.trackingParticlesIntime.intimeOnly =
False
146 process.trackingNtuple.includeOOT =
True
147 process.trackingNtuple.keepEleSimHits =
True
149 process.trackingNtuple.saveSimHitsP3 =
True
150 process.trackingNtuple.addSeedCurvCov =
True