8 process.load(
"Validation.RecoTrack.trackingNtuple_cff")
9 process.TFileService = cms.Service(
"TFileService",
10 fileName = cms.string(
'trackingNtuple.root')
13 if process.trackingNtuple.includeSeeds.value()
and not hasattr(process,
"reconstruction_step"):
14 raise Exception(
"TrackingNtuple includeSeeds=True needs reconstruction which is missing")
17 if not hasattr(process,
"validation_step"):
18 raise Exception(
"TrackingNtuple customise assumes process.validation_step exists")
22 usePileupSimHits = hasattr(process,
"mix")
and hasattr(process.mix,
"input")
and len(process.mix.input.fileNames) > 0
25 ntuplePath = cms.EndPath(process.trackingNtupleSequence)
26 if process.trackingNtuple.includeAllHits
and usePileupSimHits:
27 ntuplePath.insert(0, cms.SequencePlaceholder(
"mix"))
29 process.load(
"Validation.RecoTrack.crossingFramePSimHitToPSimHits_cfi")
30 instanceLabels = [
_label(tag)
for tag
in process.simHitTPAssocProducer.simHitSrc]
31 process.crossingFramePSimHitToPSimHits.src = [
"mix:"+l
for l
in instanceLabels]
32 process.simHitTPAssocProducer.simHitSrc = [
"crossingFramePSimHitToPSimHits:"+l
for l
in instanceLabels]
33 process.trackingNtupleSequence.insert(0, process.crossingFramePSimHitToPSimHits)
36 modifier = cms.Modifier()
38 modifier.toReplaceWith(process.validation_step, ntuplePath)
40 if hasattr(process,
"prevalidation_step"):
41 modifier.toReplaceWith(process.prevalidation_step, cms.Path())
44 for p
in [process.paths_(), process.endpaths_()]:
45 for pathName, path
in p.iteritems():
46 if "prevalidation_step" in pathName:
47 if len(pathName.replace(
"prevalidation_step",
"")) > 0:
48 modifier.toReplaceWith(path, cms.Path())
49 elif "validation_step" in pathName:
50 if len(pathName.replace(
"validation_step",
"")) > 0:
51 modifier.toReplaceWith(path, cms.EndPath())
54 for outputModule
in process.outputModules_().itervalues():
55 for path
in process.paths_().itervalues():
56 path.remove(outputModule)
57 for path
in process.endpaths_().itervalues():
58 path.remove(outputModule)
62
def customiseTrackingNtuple(process)