CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
customiseForPremixingInput Namespace Reference

Functions

def customiseForPreMixingInput
 

Function Documentation

def customiseForPremixingInput.customiseForPreMixingInput (   process)

Definition at line 3 of file customiseForPremixingInput.py.

References relativeConstraints.keys, and helpers.massSearchReplaceAnyInputTag().

3 
4 def customiseForPreMixingInput(process):
5  from PhysicsTools.PatAlgos.tools.helpers import massSearchReplaceAnyInputTag
6 
7  # Replace TrackingParticles and TrackingVertices globally
8  for s in process.paths_().keys():
9  massSearchReplaceAnyInputTag(getattr(process, s), cms.InputTag("mix", "MergedTrackTruth"), cms.InputTag("mixData", "MergedTrackTruth"), skipLabelTest=True)
10 
11  for s in process.endpaths_().keys():
12  massSearchReplaceAnyInputTag(getattr(process, s), cms.InputTag("mix", "MergedTrackTruth"), cms.InputTag("mixData", "MergedTrackTruth"), skipLabelTest=True)
13 
14 
15 
16 
17  # Replace Pixel/StripDigiSimLinks only for the known modules
18  def replaceInputTag(tag, old, new):
19  if tag.value() == old:
20  tag.setValue(new)
21 
22  def replacePixelDigiSimLink(tag):
23  replaceInputTag(tag, "simSiPixelDigis", "mixData:PixelDigiSimLink")
24  def replaceStripDigiSimLink(tag):
25  replaceInputTag(tag, "simSiStripDigis", "mixData:StripDigiSimLink")
26 
27  for label, producer in process.producers_().iteritems():
28  if producer.type_() == "ClusterTPAssociationProducer":
29  replacePixelDigiSimLink(producer.pixelSimLinkSrc)
30  replaceStripDigiSimLink(producer.stripSimLinkSrc)
31  if producer.type_() == "QuickTrackAssociatorByHitsProducer":
32  replacePixelDigiSimLink(producer.pixelSimLinkSrc)
33  replaceStripDigiSimLink(producer.stripSimLinkSrc)
34  if producer.type_() == "TrackAssociatorByHitsProducer":
35  replacePixelDigiSimLink(producer.pixelSimLinkSrc)
36  replaceStripDigiSimLink(producer.stripSimLinkSrc)
37  if producer.type_() == "MuonAssociatorEDProducer":
38  producer.DTdigisimlinkTag = cms.InputTag("mixData","simMuonDTDigis")
39  producer.CSClinksTag = cms.InputTag("mixData","MuonCSCStripDigiSimLinks")
40  producer.CSCwireLinksTag = cms.InputTag("mixData","MuonCSCWireDigiSimLinks")
41  producer.RPCdigisimlinkTag = cms.InputTag("mixData","RPCDigiSimLink")
42  replacePixelDigiSimLink(producer.pixelSimLinkSrc)
43  replaceStripDigiSimLink(producer.stripSimLinkSrc)
44  if producer.type_() == "MuonToTrackingParticleAssociatorEDProducer":
45  producer.DTdigisimlinkTag = cms.InputTag("mixData","simMuonDTDigis")
46  producer.CSClinksTag = cms.InputTag("mixData","MuonCSCStripDigiSimLinks")
47  producer.CSCwireLinksTag = cms.InputTag("mixData","MuonCSCWireDigiSimLinks")
48  producer.RPCdigisimlinkTag = cms.InputTag("mixData","RPCDigiSimLink")
49  replacePixelDigiSimLink(producer.pixelSimLinkSrc)
50  replaceStripDigiSimLink(producer.stripSimLinkSrc)
51 
52  for label, analyzer in process.analyzers_().iteritems():
53  if analyzer.type_() == "GlobalRecHitsAnalyzer":
54  replacePixelDigiSimLink(analyzer.pixelSimLinkSrc)
55  replaceStripDigiSimLink(analyzer.stripSimLinkSrc)
56  if analyzer.type_() == "SiPixelTrackingRecHitsValid":
57  replacePixelDigiSimLink(analyzer.pixelSimLinkSrc)
58  replaceStripDigiSimLink(analyzer.stripSimLinkSrc)
59  if analyzer.type_() == "SiStripTrackingRecHitsValid":
60  replacePixelDigiSimLink(analyzer.pixelSimLinkSrc)
61  replaceStripDigiSimLink(analyzer.stripSimLinkSrc)
62  if analyzer.type_() == "SiPixelRecHitsValid":
63  replacePixelDigiSimLink(analyzer.pixelSimLinkSrc)
64  replaceStripDigiSimLink(analyzer.stripSimLinkSrc)
65  if analyzer.type_() == "SiStripRecHitsValid":
66  replacePixelDigiSimLink(analyzer.pixelSimLinkSrc)
67  replaceStripDigiSimLink(analyzer.stripSimLinkSrc)
68 
69 
70 
71 
72  return process
def massSearchReplaceAnyInputTag
Definition: helpers.py:262