CMS 3D CMS Logo

Functions
customiseForPremixingInput Namespace Reference

Functions

def customiseForPreMixingInput (process)
 

Function Documentation

def customiseForPremixingInput.customiseForPreMixingInput (   process)

Definition at line 3 of file customiseForPremixingInput.py.

References spr.find(), relativeConstraints.keys, and MassReplace.massSearchReplaceAnyInputTag().

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