12 process.load(
"Validation.RecoTrack.trackingNtuple_cff")
13 process.TFileService = cms.Service(
"TFileService",
14 fileName = cms.string(
'trackingNtuple.root')
17 if process.trackingNtuple.includeSeeds.value():
19 if not hasattr(process,
"reconstruction_step"):
20 raise Exception(
"TrackingNtuple includeSeeds=True needs reconstruction which is missing")
22 if not hasattr(process,
"HLTIterativeTrackingIter02"):
23 raise Exception(
"TrackingNtuple includeSeeds=True needs HLTIterativeTrackingIter02 which is missing")
26 if not hasattr(process,
"validation_step"):
27 raise Exception(
"TrackingNtuple customise assumes process.validation_step exists")
31 usePileupSimHits = hasattr(process,
"mix")
and hasattr(process.mix,
"input")
and len(process.mix.input.fileNames) > 0
35 if not hasattr(process,
"hltMultiTrackValidation"):
36 process.load(
"Validation.RecoTrack.HLTmultiTrackValidator_cff")
37 process.trackingNtupleSequence = process.hltMultiTrackValidation.copy()
39 process.hltSiStripRecHits = SiStripRecHitConverter_cfi.siStripMatchedRecHits.clone(
40 ClusterProducer =
"hltSiStripRawToClustersFacility",
41 StripCPE =
"hltESPStripCPEfromTrackAngle:hltESPStripCPEfromTrackAngle"
43 process.trackingNtupleSequence.insert(0,process.trackingParticlesIntime+process.simHitTPAssocProducer)
44 process.trackingNtupleSequence.remove(process.hltTrackValidator)
45 process.trackingNtupleSequence += process.hltSiStripRecHits + process.trackingNtuple
48 if mergeIters
and isRECO:
49 process.mergedStepTracks = cms.EDProducer(
"TrackSimpleMerger",
50 src = cms.VInputTag(m.replace(
"Seeds",
"Tracks").
replace(
"seedTracks",
"")
for m
in process.trackingNtuple.seedTracks)
52 process.trackingNtupleSequence.insert(0,process.mergedStepTracks)
53 process.trackingNtuple.tracks =
"mergedStepTracks"
55 ntuplePath = cms.Path(process.trackingNtupleSequence)
57 if process.trackingNtuple.includeAllHits
and process.trackingNtuple.includeTrackingParticles
and usePileupSimHits:
58 ntuplePath.insert(0, cms.SequencePlaceholder(
"mix"))
60 process.load(
"Validation.RecoTrack.crossingFramePSimHitToPSimHits_cfi")
61 instanceLabels = [
_label(tag)
for tag
in process.simHitTPAssocProducer.simHitSrc]
62 process.crossingFramePSimHitToPSimHits.src = [
"mix:"+l
for l
in instanceLabels]
63 process.simHitTPAssocProducer.simHitSrc = [
"crossingFramePSimHitToPSimHits:"+l
for l
in instanceLabels]
64 process.trackingNtupleSequence.insert(0, process.crossingFramePSimHitToPSimHits)
67 modifier = cms.Modifier()
69 modifier.toReplaceWith(process.prevalidation_step, ntuplePath)
70 modifier.toReplaceWith(process.validation_step, cms.EndPath())
73 for p
in [process.paths_(), process.endpaths_()]:
74 for pathName, path
in p.items():
75 if "prevalidation_step" in pathName:
76 if len(pathName.replace(
"prevalidation_step",
"")) > 0:
77 modifier.toReplaceWith(path, cms.Path())
78 elif "validation_step" in pathName:
79 if len(pathName.replace(
"validation_step",
"")) > 0:
80 modifier.toReplaceWith(path, cms.EndPath())
83 for outputModule
in process.outputModules_().
values():
84 for path
in process.paths_().
values():
85 path.remove(outputModule)
86 for path
in process.endpaths_().
values():
87 path.remove(outputModule)