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:
49 process.mergedStepTracks = _mod.TrackCollectionMerger.clone(
50 trackProducers = cms.VInputTag(m.replace(
"Seeds",
"Tracks").
replace(
"seedTracks",
"")
for m
in process.trackingNtuple.seedTracks),
51 inputClassifiers = cms.vstring(m.replace(
"StepSeeds",
"Step").
replace(
"seedTracks",
"").
replace(
"dSeeds",
"dTracks")
52 .
replace(
"InOut",
"InOutClassifier").
replace(
"tIn",
"tInClassifier")
53 for m
in process.trackingNtuple.seedTracks),
57 process.trackingNtupleSequence.insert(0,process.mergedStepTracks)
58 process.trackingNtuple.tracks =
"mergedStepTracks" 59 process.trackingNtuple.includeMVA =
True 60 process.trackingNtuple.trackMVAs = [
"mergedStepTracks"]
62 ntuplePath = cms.Path(process.trackingNtupleSequence)
64 if process.trackingNtuple.includeAllHits
and process.trackingNtuple.includeTrackingParticles
and usePileupSimHits:
65 ntuplePath.insert(0, cms.SequencePlaceholder(
"mix"))
67 process.load(
"Validation.RecoTrack.crossingFramePSimHitToPSimHits_cfi")
68 instanceLabels = [
_label(tag)
for tag
in process.simHitTPAssocProducer.simHitSrc]
69 process.crossingFramePSimHitToPSimHits.src = [
"mix:"+l
for l
in instanceLabels]
70 process.simHitTPAssocProducer.simHitSrc = [
"crossingFramePSimHitToPSimHits:"+l
for l
in instanceLabels]
71 process.trackingNtupleSequence.insert(0, process.crossingFramePSimHitToPSimHits)
74 modifier = cms.Modifier()
76 modifier.toReplaceWith(process.prevalidation_step, ntuplePath)
77 modifier.toReplaceWith(process.validation_step, cms.EndPath())
80 for p
in [process.paths_(), process.endpaths_()]:
81 for pathName, path
in p.items():
82 if "prevalidation_step" in pathName:
83 if len(pathName.replace(
"prevalidation_step",
"")) > 0:
84 modifier.toReplaceWith(path, cms.Path())
85 elif "validation_step" in pathName:
86 if len(pathName.replace(
"validation_step",
"")) > 0:
87 modifier.toReplaceWith(path, cms.EndPath())
90 for outputModule
in process.outputModules_().
values():
91 for path
in process.paths_().
values():
92 path.remove(outputModule)
93 for path
in process.endpaths_().
values():
94 path.remove(outputModule)
110 "hltIter0PFLowPixelSeedsFromPixelTracks",
111 "hltIter1PFLowPixelSeedsFromPixelTracks",
112 "hltIter2PFlowPixelSeeds",
113 "hltDoubletRecoveryPFlowPixelSeeds" 115 _candidatesProducers = [
116 "hltIter0PFlowCkfTrackCandidates",
117 "hltIter1PFlowCkfTrackCandidates",
118 "hltIter2PFlowCkfTrackCandidates",
119 "hltDoubletRecoveryPFlowCkfTrackCandidates" 121 (_seedSelectors, _tmpTask) = _TrackValidation_cff._addSeedToTrackProducers(_seedProducers, globals())
122 _seedSelectorsTask = cms.Task()
123 for modName
in _seedSelectors:
124 if not hasattr(process, modName):
125 setattr(process,modName, globals()[modName].
clone(beamSpot =
"hltOnlineBeamSpot"))
126 _seedSelectorsTask.add(getattr(process, modName))
130 process.trackingNtupleSequence.insert(0,cms.Sequence(_seedSelectorsTask))
131 if process.hltSiStripRawToClustersFacility.onDemand.value():
133 process.trackingNtupleSequence.insert(0,process.hltMergedTracks)
135 process.trackingNtuple.tracks =
"hltMergedTracks" 136 process.trackingNtuple.seedTracks = _seedSelectors
137 process.trackingNtuple.trackCandidates = _candidatesProducers
138 process.trackingNtuple.clusterTPMap =
"hltTPClusterProducer" 139 process.trackingNtuple.trackAssociator =
"hltTrackAssociatorByHits" 140 process.trackingNtuple.beamSpot =
"hltOnlineBeamSpot" 141 process.trackingNtuple.pixelRecHits =
"hltSiPixelRecHits" 142 process.trackingNtuple.stripRphiRecHits =
"hltSiStripRecHits:rphiRecHit" 143 process.trackingNtuple.stripStereoRecHits =
"hltSiStripRecHits:stereoRecHit" 144 process.trackingNtuple.stripMatchedRecHits =
"hltSiStripRecHits:matchedRecHit" 145 process.trackingNtuple.vertices =
"hltPixelVertices" 146 process.trackingNtuple.TTRHBuilder =
"hltESPTTRHBWithTrackAngle" 147 process.trackingNtuple.parametersDefiner =
"hltLhcParametersDefinerForTP" 148 process.trackingNtuple.includeMVA =
False 153 process.trackingParticlesIntime.intimeOnly =
False 154 process.trackingNtuple.includeOOT =
True 155 process.trackingNtuple.keepEleSimHits =
True 157 process.trackingNtuple.saveSimHitsP3 =
True 158 process.trackingNtuple.addSeedCurvCov =
True 160 process.trackingNtuple.includeOnTrackHitData =
True 161 process.trackingNtuple.includeTrackCandidates =
True def customiseTrackingNtupleHLT(process)
def replace(string, replacements)
def extendedContent(process)
def customiseTrackingNtuple(process)
def customiseTrackingNtupleMergeIters(process)
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
def customiseTrackingNtupleTool(process, isRECO=True, mergeIters=False)