test
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 spr.find(), 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  # only apply on validation and dqm: we don't want to apply this in the mixing and digitization sequences
9  for s in process.paths_().keys() + process.endpaths_().keys():
10  if s.lower().find("validation")>= 0 or s.lower().find("dqm") >= 0:
11  massSearchReplaceAnyInputTag(getattr(process, s), cms.InputTag("mix", "MergedTrackTruth"), cms.InputTag("mixData", "MergedTrackTruth"), skipLabelTest=True)
12 
13  # Replace Pixel/StripDigiSimLinks only for the known modules
14  def replaceInputTag(tag, old, new):
15  if tag.value() == old:
16  tag.setValue(new)
17 
18  def replacePixelDigiSimLink(tag):
19  replaceInputTag(tag, "simSiPixelDigis", "mixData:PixelDigiSimLink")
20  def replaceStripDigiSimLink(tag):
21  replaceInputTag(tag, "simSiStripDigis", "mixData:StripDigiSimLink")
22 
23  for label, producer in process.producers_().iteritems():
24  if producer.type_() == "ClusterTPAssociationProducer":
25  replacePixelDigiSimLink(producer.pixelSimLinkSrc)
26  replaceStripDigiSimLink(producer.stripSimLinkSrc)
27  if producer.type_() == "QuickTrackAssociatorByHitsProducer":
28  replacePixelDigiSimLink(producer.pixelSimLinkSrc)
29  replaceStripDigiSimLink(producer.stripSimLinkSrc)
30  if producer.type_() == "TrackAssociatorByHitsProducer":
31  replacePixelDigiSimLink(producer.pixelSimLinkSrc)
32  replaceStripDigiSimLink(producer.stripSimLinkSrc)
33  if producer.type_() == "MuonAssociatorEDProducer":
34  producer.DTdigisimlinkTag = cms.InputTag("mixData","simMuonDTDigis")
35  producer.CSClinksTag = cms.InputTag("mixData","MuonCSCStripDigiSimLinks")
36  producer.CSCwireLinksTag = cms.InputTag("mixData","MuonCSCWireDigiSimLinks")
37  producer.RPCdigisimlinkTag = cms.InputTag("mixData","RPCDigiSimLink")
38  replacePixelDigiSimLink(producer.pixelSimLinkSrc)
39  replaceStripDigiSimLink(producer.stripSimLinkSrc)
40  if producer.type_() == "MuonToTrackingParticleAssociatorEDProducer":
41  producer.DTdigisimlinkTag = cms.InputTag("mixData","simMuonDTDigis")
42  producer.CSClinksTag = cms.InputTag("mixData","MuonCSCStripDigiSimLinks")
43  producer.CSCwireLinksTag = cms.InputTag("mixData","MuonCSCWireDigiSimLinks")
44  producer.RPCdigisimlinkTag = cms.InputTag("mixData","RPCDigiSimLink")
45  replacePixelDigiSimLink(producer.pixelSimLinkSrc)
46  replaceStripDigiSimLink(producer.stripSimLinkSrc)
47 
48  for label, analyzer in process.analyzers_().iteritems():
49  if analyzer.type_() == "GlobalRecHitsAnalyzer":
50  replacePixelDigiSimLink(analyzer.pixelSimLinkSrc)
51  replaceStripDigiSimLink(analyzer.stripSimLinkSrc)
52  if analyzer.type_() == "SiPixelTrackingRecHitsValid":
53  replacePixelDigiSimLink(analyzer.pixelSimLinkSrc)
54  replaceStripDigiSimLink(analyzer.stripSimLinkSrc)
55  if analyzer.type_() == "SiStripTrackingRecHitsValid":
56  replacePixelDigiSimLink(analyzer.pixelSimLinkSrc)
57  replaceStripDigiSimLink(analyzer.stripSimLinkSrc)
58  if analyzer.type_() == "SiPixelRecHitsValid":
59  replacePixelDigiSimLink(analyzer.pixelSimLinkSrc)
60  replaceStripDigiSimLink(analyzer.stripSimLinkSrc)
61  if analyzer.type_() == "SiStripRecHitsValid":
62  replacePixelDigiSimLink(analyzer.pixelSimLinkSrc)
63  replaceStripDigiSimLink(analyzer.stripSimLinkSrc)
64 
65 
66 
67  return process
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
def massSearchReplaceAnyInputTag
Definition: helpers.py:265