CMS 3D CMS Logo

heavyIonTools.py
Go to the documentation of this file.
3 
4 
6 
7  """ Configure all defaults for heavy ions
8  """
9  _label='configureHeavyIons'
10  _defaultParameters=dicttypes.SortedKeysDict()
11 
12  def __init__(self):
13  ConfigToolBase.__init__(self)
14  self._parameters=copy.deepcopy(self._defaultParameters)
15  self._comment = ""
16 
18  return self._defaultParameters
19 
20  def __call__(self,process):
21 
22  self.apply(process)
23 
24  def toolCode(self, process):
25  productionDefaults(process)
26  selectionDefaults(process)
27 
28 configureHeavyIons=ConfigureHeavyIons()
29 
30 
32 
33  """ Configure all relevant layer1 candidates for heavy ions
34  """
35  _label='productionDefaults'
36  _defaultParameters=dicttypes.SortedKeysDict()
37 
38  def __init__(self):
39  ConfigToolBase.__init__(self)
40  self._parameters=copy.deepcopy(self._defaultParameters)
41  self._comment = ""
42 
44  return self._defaultParameters
45 
46  def __call__(self,process):
47 
48  self.apply(process)
49 
50  def toolCode(self, process):
51  ## adapt jet defaults
52  patJets = getattr(process, jetCollectionString())
53  patJets.jetSource = cms.InputTag("iterativeConePu5CaloJets")
54 
55  jetCors = getattr(process, 'patJetCorrFactors')
56  jetCors.jetSource = cms.InputTag("iterativeConePu5CaloJets")
57  jetCors.corrLevels = cms.PSet(L2Relative = cms.string("L2Relative_IC5Calo"),
58  L3Absolute = cms.string("L3Absolute_IC5Calo"),
59  L1Offset = cms.string('none'),
60  L4EMF = cms.string('none'),
61  L5Flavor = cms.string('none'),
62  L6UE = cms.string('none'),
63  L7Parton = cms.string('none')
64  )
65 
66  partonMatch = getattr(process, 'patJetPartonMatch')
67  partonMatch.src = cms.InputTag("iterativeConePu5CaloJets")
68  partonMatch.matched = cms.InputTag("hiPartons")
69 
70  jetMatch = getattr(process, 'patJetGenJetMatch')
71  jetMatch.src = cms.InputTag("iterativeConePu5CaloJets")
72  jetMatch.matched = cms.InputTag("heavyIonCleanedGenJets")
73 
74  patJets.addBTagInfo = False
75  patJets.addTagInfos = False
76  patJets.addDiscriminators = False
77  patJets.addAssociatedTracks = False
78  patJets.addJetCharge = False
79  patJets.addJetID = False
80  patJets.getJetMCFlavour = False
81  patJets.addGenPartonMatch = True
82  patJets.addGenJetMatch = True
83  patJets.embedGenJetMatch = True
84  patJets.embedGenPartonMatch = True
85 
86  ## adapt muon defaults
87  muonMatch = getattr(process, 'muonMatch')
88  muonMatch.matched = cms.InputTag("hiGenParticles")
89  patMuons = getattr(process, 'patMuons')
90  patMuons.embedGenMatch = cms.bool(True)
91  process.patMuons.embedCaloMETMuonCorrs = cms.bool(False)
92  process.patMuons.embedTcMETMuonCorrs = cms.bool(False)
93  process.patMuons.embedPFCandidate = cms.bool(False)
94  process.patMuons.useParticleFlow = cms.bool(False)
95  process.patMuons.addEfficiencies = cms.bool(False)
96  process.patMuons.addResolutions = cms.bool(False)
97  process.patMuons.pvSrc = cms.InputTag("hiSelectedVertex")
98 
99  ## adapt photon defaults
100  photonMatch = getattr(process, 'photonMatch')
101  photonMatch.matched = cms.InputTag("hiGenParticles")
102  patPhotons = getattr(process, 'patPhotons')
103  patPhotons.addPhotonID = cms.bool(True)
104  patPhotons.addGenMatch = cms.bool(True)
105  patPhotons.embedGenMatch = cms.bool(True)
106  patPhotons.userData.userFloats.src = cms.VInputTag(
107  cms.InputTag( "isoCC1"),cms.InputTag( "isoCC2"),cms.InputTag( "isoCC3"),cms.InputTag( "isoCC4"),cms.InputTag("isoCC5"),
108  cms.InputTag( "isoCR1"),cms.InputTag( "isoCR2"),cms.InputTag( "isoCR3"),cms.InputTag( "isoCR4"),cms.InputTag("isoCR5"),
109  cms.InputTag( "isoT11"),cms.InputTag( "isoT12"),cms.InputTag( "isoT13"),cms.InputTag( "isoT14"),
110  cms.InputTag( "isoT21"),cms.InputTag( "isoT22"),cms.InputTag( "isoT23"),cms.InputTag( "isoT24"),
111  cms.InputTag( "isoT31"),cms.InputTag( "isoT32"),cms.InputTag( "isoT33"),cms.InputTag( "isoT34"),
112  cms.InputTag( "isoT41"),cms.InputTag( "isoT42"),cms.InputTag( "isoT43"),cms.InputTag( "isoT44"),
113  cms.InputTag("isoDR11"),cms.InputTag("isoDR12"),cms.InputTag("isoDR13"),cms.InputTag("isoDR14"),
114  cms.InputTag("isoDR21"),cms.InputTag("isoDR22"),cms.InputTag("isoDR23"),cms.InputTag("isoDR24"),
115  cms.InputTag("isoDR31"),cms.InputTag("isoDR32"),cms.InputTag("isoDR33"),cms.InputTag("isoDR34"),
116  cms.InputTag("isoDR41"),cms.InputTag("isoDR42"),cms.InputTag("isoDR43"),cms.InputTag("isoDR44")
117  )
118  patPhotons.photonIDSource = cms.InputTag("PhotonIDProd","PhotonCutBasedIDLoose")
119  del patPhotons.photonIDSources
120 
121 productionDefaults=ProductionDefaults()
122 
123 
125 
126  """ Configure all relevant selected layer1 candidates for heavy ions
127  """
128  _label='selectionDefaults'
129  _defaultParameters=dicttypes.SortedKeysDict()
130 
131  def __init__(self):
132  ConfigToolBase.__init__(self)
133  self._parameters=copy.deepcopy(self._defaultParameters)
134  self._comment = ""
135 
137  return self._defaultParameters
138 
139  def __call__(self,process):
140 
141  self.apply(process)
142 
143  def toolCode(self, process):
144  selectedJets = getattr(process, jetCollectionString('selected'))
145  selectedJets.cut = cms.string('pt > 20.')
146  selectedMuons = getattr(process, 'selectedPatMuons')
147  selectedMuons.cut = cms.string('pt > 0. & abs(eta) < 12.')
148  selectedPhotons = getattr(process, 'selectedPatPhotons')
149  selectedPhotons.cut = cms.string('pt > 0. & abs(eta) < 12.')
150 
151 selectionDefaults=SelectionDefaults()
152 
153 
155 
156  """ Cut off all MC dependencies
157  """
158  _label='disableMonteCarloDeps'
159  _defaultParameters=dicttypes.SortedKeysDict()
160 
161  def __init__(self):
162  ConfigToolBase.__init__(self)
163  self._parameters=copy.deepcopy(self._defaultParameters)
164  self._comment = ""
165 
167  return self._defaultParameters
168 
169  def __call__(self,process):
170 
171  self.apply(process)
172 
173  def toolCode(self, process):
174  ## switch MC to false in heavyIon Producer
175  process.heavyIon.doMC = False
176 
177  ## remove MC matching from heavyIonJets
178  process.makeHeavyIonJets.remove(process.genPartons)
179  process.makeHeavyIonJets.remove(process.heavyIonCleanedGenJets)
180  process.makeHeavyIonJets.remove(process.hiPartons)
181  process.makeHeavyIonJets.remove(process.patJetGenJetMatch)
182  process.makeHeavyIonJets.remove(process.patJetPartonMatch)
183 
184  process.patJets.addGenPartonMatch = False
185  process.patJets.embedGenPartonMatch = False
186  process.patJets.genPartonMatch = ''
187  process.patJets.addGenJetMatch = False
188  process.patJets.genJetMatch = ''
189  process.patJets.getJetMCFlavour = False
190  process.patJets.JetPartonMapSource = ''
191 
192  ## remove MC matching from heavyIonMuons
193  process.makeHeavyIonMuons.remove(process.muonMatch)
194 
195  process.patMuons.addGenMatch = False
196  process.patMuons.embedGenMatch = False
197 
198 disableMonteCarloDeps=DisbaleMonteCarloDeps()
def jetCollectionString(prefix='', algo='', type='')
Definition: helpers.py:215