CMS 3D CMS Logo

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

Functions

def miniAOD_customizeAllData
 
def miniAOD_customizeAllMC
 
def miniAOD_customizeCommon
 
def miniAOD_customizeData
 
def miniAOD_customizeMC
 
def miniAOD_customizeOutput
 

Function Documentation

def miniAOD_tools.miniAOD_customizeAllData (   process)

Definition at line 207 of file miniAOD_tools.py.

References miniAOD_customizeCommon(), and miniAOD_customizeData().

208 def miniAOD_customizeAllData(process):
209  miniAOD_customizeCommon(process)
210  miniAOD_customizeData(process)
211  return process
def miniAOD_customizeCommon
Definition: miniAOD_tools.py:5
def miniAOD_customizeAllData
def miniAOD_customizeData
def miniAOD_tools.miniAOD_customizeAllMC (   process)

Definition at line 212 of file miniAOD_tools.py.

References miniAOD_customizeCommon(), and miniAOD_customizeMC().

213 def miniAOD_customizeAllMC(process):
214  miniAOD_customizeCommon(process)
215  miniAOD_customizeMC(process)
216  return process
def miniAOD_customizeAllMC
def miniAOD_customizeCommon
Definition: miniAOD_tools.py:5
def miniAOD_tools.miniAOD_customizeCommon (   process)

Definition at line 5 of file miniAOD_tools.py.

References vid_id_tools.setupAllVIDIdsInModule(), trigTools.switchOnTriggerStandAlone, and vid_id_tools.switchOnVIDElectronIdProducer().

Referenced by miniAOD_customizeAllData(), and miniAOD_customizeAllMC().

5 
6 def miniAOD_customizeCommon(process):
7  process.patMuons.isoDeposits = cms.PSet()
8  process.patElectrons.isoDeposits = cms.PSet()
9  process.patTaus.isoDeposits = cms.PSet()
10  process.patPhotons.isoDeposits = cms.PSet()
11  #
12  process.patMuons.embedTrack = True # used for IDs
13  process.patMuons.embedCombinedMuon = True # used for IDs
14  process.patMuons.embedMuonBestTrack = True # used for IDs
15  process.patMuons.embedStandAloneMuon = True # maybe?
16  process.patMuons.embedPickyMuon = False # no, use best track
17  process.patMuons.embedTpfmsMuon = False # no, use best track
18  process.patMuons.embedDytMuon = False # no, use best track
19  #
20  # disable embedding of electron and photon associated objects already stored by the ReducedEGProducer
21  process.patElectrons.embedGsfElectronCore = False ## process.patElectrons.embed in AOD externally stored gsf electron core
22  process.patElectrons.embedSuperCluster = False ## process.patElectrons.embed in AOD externally stored supercluster
23  process.patElectrons.embedPflowSuperCluster = False ## process.patElectrons.embed in AOD externally stored supercluster
24  process.patElectrons.embedSeedCluster = False ## process.patElectrons.embed in AOD externally stored the electron's seedcluster
25  process.patElectrons.embedBasicClusters = False ## process.patElectrons.embed in AOD externally stored the electron's basic clusters
26  process.patElectrons.embedPreshowerClusters = False ## process.patElectrons.embed in AOD externally stored the electron's preshower clusters
27  process.patElectrons.embedPflowBasicClusters = False ## process.patElectrons.embed in AOD externally stored the electron's pflow basic clusters
28  process.patElectrons.embedPflowPreshowerClusters = False ## process.patElectrons.embed in AOD externally stored the electron's pflow preshower clusters
29  process.patElectrons.embedRecHits = False ## process.patElectrons.embed in AOD externally stored the RecHits - can be called from the PATElectronProducer
30  process.patElectrons.electronSource = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
31  process.patElectrons.electronIDSources = cms.PSet(
32  # configure many IDs as InputTag <someName> = <someTag> you
33  # can comment out those you don't want to save some disk space
34  eidRobustLoose = cms.InputTag("reducedEgamma","eidRobustLoose"),
35  eidRobustTight = cms.InputTag("reducedEgamma","eidRobustTight"),
36  eidLoose = cms.InputTag("reducedEgamma","eidLoose"),
37  eidTight = cms.InputTag("reducedEgamma","eidTight"),
38  eidRobustHighEnergy = cms.InputTag("reducedEgamma","eidRobustHighEnergy"),
39  )
40  process.elPFIsoDepositCharged.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
41  process.elPFIsoDepositChargedAll.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
42  process.elPFIsoDepositNeutral.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
43  process.elPFIsoDepositGamma.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
44  process.elPFIsoDepositPU.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
45  #
46  process.patPhotons.embedSuperCluster = False ## whether to process.patPhotons.embed in AOD externally stored supercluster
47  process.patPhotons.embedSeedCluster = False ## process.patPhotons.embed in AOD externally stored the photon's seedcluster
48  process.patPhotons.embedBasicClusters = False ## process.patPhotons.embed in AOD externally stored the photon's basic clusters
49  process.patPhotons.embedPreshowerClusters = False ## process.patPhotons.embed in AOD externally stored the photon's preshower clusters
50  process.patPhotons.embedRecHits = False ## process.patPhotons.embed in AOD externally stored the RecHits - can be called from the PATPhotonProducer
51  process.patPhotons.photonSource = cms.InputTag("reducedEgamma","reducedGedPhotons")
52  process.patPhotons.photonIDSources = cms.PSet(
53  PhotonCutBasedIDLoose = cms.InputTag('reducedEgamma',
54  'PhotonCutBasedIDLoose'),
55  PhotonCutBasedIDTight = cms.InputTag('reducedEgamma',
56  'PhotonCutBasedIDTight')
57  )
58 
59  process.phPFIsoDepositCharged.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
60  process.phPFIsoDepositChargedAll.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
61  process.phPFIsoDepositNeutral.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
62  process.phPFIsoDepositGamma.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
63  process.phPFIsoDepositPU.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
64  #
65  process.selectedPatJets.cut = cms.string("pt > 10")
66  process.selectedPatMuons.cut = cms.string("pt > 5 || isPFMuon || (pt > 3 && (isGlobalMuon || isStandAloneMuon || numberOfMatches > 0 || muonID('RPCMuLoose')))")
67  process.selectedPatElectrons.cut = cms.string("")
68  process.selectedPatTaus.cut = cms.string("pt > 18. && tauID('decayModeFinding')> 0.5")
69  process.selectedPatPhotons.cut = cms.string("")
70 
71  # add CMS top tagger
72  from RecoJets.JetProducers.caTopTaggers_cff import caTopTagInfos as toptag
73  process.cmsttRaw = toptag.clone()
74  process.caTopTagInfos = cms.EDProducer("RecoJetDeltaRTagInfoValueMapProducer",
75  src = cms.InputTag("ak8PFJetsCHS"),
76  matched = cms.InputTag("cmsTopTagPFJetsCHS"),
77  matchedTagInfos = cms.InputTag("cmsttRaw"),
78  distMax = cms.double(0.8)
79  )
80 
81  #add AK8
82  from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection
83  addJetCollection(process, labelName = 'AK8',
84  jetSource = cms.InputTag('ak8PFJetsCHS'),
85  algo= 'AK', rParam = 0.8,
86  jetCorrections = ('AK8PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'None'),
87  btagInfos = ['caTopTagInfos']
88  )
89  process.patJetsAK8.userData.userFloats.src = [] # start with empty list of user floats
90  process.selectedPatJetsAK8.cut = cms.string("pt > 100")
91  process.patJetGenJetMatchAK8.matched = 'slimmedGenJets'
92  ## AK8 groomed masses
93  from RecoJets.Configuration.RecoPFJets_cff import ak8PFJetsCHSPruned, ak8PFJetsCHSFiltered, ak8PFJetsCHSTrimmed
94  process.ak8PFJetsCHSPruned = ak8PFJetsCHSPruned.clone()
95  process.ak8PFJetsCHSTrimmed = ak8PFJetsCHSTrimmed.clone()
96  process.ak8PFJetsCHSFiltered = ak8PFJetsCHSFiltered.clone()
97  process.load("RecoJets.JetProducers.ak8PFJetsCHS_groomingValueMaps_cfi")
98  process.patJetsAK8.userData.userFloats.src += ['ak8PFJetsCHSPrunedLinks','ak8PFJetsCHSTrimmedLinks','ak8PFJetsCHSFilteredLinks']
99 
100  # Add AK8 top tagging variables
101  process.patJetsAK8.tagInfoSources = cms.VInputTag(cms.InputTag("caTopTagInfos"))
102  process.patJetsAK8.addTagInfos = cms.bool(True)
103 
104 
105 
106  # add Njetiness
107  process.load('RecoJets.JetProducers.nJettinessAdder_cfi')
108  process.NjettinessAK8 = process.Njettiness.clone()
109  process.NjettinessAK8.src = cms.InputTag("ak8PFJetsCHS")
110  process.NjettinessAK8.cone = cms.double(0.8)
111  process.patJetsAK8.userData.userFloats.src += ['NjettinessAK8:tau1','NjettinessAK8:tau2','NjettinessAK8:tau3']
112 
113 
114 
115  #
116  from PhysicsTools.PatAlgos.tools.trigTools import switchOnTriggerStandAlone
117  switchOnTriggerStandAlone( process, outputModule = '' )
118  process.patTrigger.packTriggerPathNames = cms.bool(True)
119  #
120  # apply type I/type I + II PFMEt corrections to pat::MET object
121  # and estimate systematic uncertainties on MET
122  # FIXME: this and the typeI MET should become AK4 once we have the proper JEC?
123  from PhysicsTools.PatUtils.tools.runType1PFMEtUncertainties import runType1PFMEtUncertainties
124  addJetCollection(process, postfix = "ForMetUnc", labelName = 'AK4PF', jetSource = cms.InputTag('ak4PFJets'), jetCorrections = ('AK4PF', ['L1FastJet', 'L2Relative', 'L3Absolute'], ''))
125  process.patJetsAK4PFForMetUnc.getJetMCFlavour = False
127  addToPatDefaultSequence=False,
128  jetCollection="selectedPatJetsAK4PFForMetUnc",
129  electronCollection="selectedPatElectrons",
130  muonCollection="selectedPatMuons",
131  tauCollection="selectedPatTaus",
132  makeType1p2corrPFMEt=True,
133  outputModule=None)
134 
135 
136  #keep this after all addJetCollections otherwise it will attempt computing them also for stuf with no taginfos
137  #Some useful BTAG vars
138  process.patJets.userData.userFunctions = cms.vstring(
139  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().secondaryVertex(0).p4.M):(0)',
140  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().secondaryVertex(0).nTracks):(0)',
141  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().flightDistance(0).value):(0)',
142  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().flightDistance(0).significance):(0)',
143  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().secondaryVertex(0).p4.x):(0)',
144  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().secondaryVertex(0).p4.y):(0)',
145  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().secondaryVertex(0).p4.z):(0)',
146  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().secondaryVertex(0).position.x):(0)',
147  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().secondaryVertex(0).position.y):(0)',
148  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().secondaryVertex(0).position.z):(0)',
149  )
150  process.patJets.userData.userFunctionLabels = cms.vstring('vtxMass','vtxNtracks','vtx3DVal','vtx3DSig','vtxPx','vtxPy','vtxPz','vtxPosX','vtxPosY','vtxPosZ')
151  process.patJets.tagInfoSources = cms.VInputTag(cms.InputTag("secondaryVertexTagInfos"))
152  process.patJets.addTagInfos = cms.bool(True)
153  #
154  ## PU JetID
155  process.load("PhysicsTools.PatAlgos.slimming.pileupJetId_cfi")
156  process.patJets.userData.userFloats.src = [ cms.InputTag("pileupJetId:fullDiscriminant"), ]
157 
158  #VID Electron IDs
159  electron_ids = ['RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_CSA14_50ns_V1_cff',
160  'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_CSA14_PU20bx25_V0_cff',
161  'RecoEgamma.ElectronIdentification.Identification.heepElectronID_HEEPV50_CSA14_25ns_cff',
162  'RecoEgamma.ElectronIdentification.Identification.heepElectronID_HEEPV50_CSA14_startup_cff']
164  process.egmGsfElectronIDs.physicsObjectSrc = \
165  cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
166  process.electronIDValueMapProducer.src = \
167  cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
168  process.electronIDValueMapProducer.ebReducedRecHitCollection = \
169  cms.InputTag("reducedEgamma","reducedEBRecHits")
170  process.electronIDValueMapProducer.eeReducedRecHitCollection = \
171  cms.InputTag("reducedEgamma","reducedEERecHits")
172  process.electronIDValueMapProducer.esReducedRecHitCollection = \
173  cms.InputTag("reducedEgamma","reducedESRecHits")
174  for idmod in electron_ids:
175  setupAllVIDIdsInModule(process,idmod,setupVIDElectronSelection)
176 
177 
def setupAllVIDIdsInModule
Definition: vid_id_tools.py:31
def switchOnVIDElectronIdProducer
Electrons.
Definition: vid_id_tools.py:45
def miniAOD_customizeCommon
Definition: miniAOD_tools.py:5
tuple switchOnTriggerStandAlone
Definition: trigTools.py:276
def miniAOD_tools.miniAOD_customizeData (   process)

Definition at line 203 of file miniAOD_tools.py.

Referenced by miniAOD_customizeAllData().

204 def miniAOD_customizeData(process):
205  from PhysicsTools.PatAlgos.tools.coreTools import runOnData
206  runOnData( process, outputModules = [] )
def miniAOD_customizeData
def miniAOD_tools.miniAOD_customizeMC (   process)

Definition at line 178 of file miniAOD_tools.py.

Referenced by miniAOD_customizeAllMC().

179 def miniAOD_customizeMC(process):
180  process.muonMatch.matched = "prunedGenParticles"
181  process.electronMatch.matched = "prunedGenParticles"
182  process.electronMatch.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
183  process.photonMatch.matched = "prunedGenParticles"
184  process.photonMatch.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
185  process.tauMatch.matched = "prunedGenParticles"
186  process.tauGenJets.GenParticles = "prunedGenParticles"
187  process.patJetPartonMatch.matched = "prunedGenParticles"
188  process.patJetPartonMatch.mcStatus = [ 3, 23 ]
189  process.patJetGenJetMatch.matched = "slimmedGenJets"
190  process.patMuons.embedGenMatch = False
191  process.patElectrons.embedGenMatch = False
192  process.patPhotons.embedGenMatch = False
193  process.patTaus.embedGenMatch = False
194  process.patJets.embedGenPartonMatch = False
195  #also jet flavour must be switched to ak4
196  process.patJetFlavourAssociation.rParam = 0.4
def miniAOD_tools.miniAOD_customizeOutput (   out)

Definition at line 197 of file miniAOD_tools.py.

198 def miniAOD_customizeOutput(out):
199  out.dropMetaData = cms.untracked.string('ALL')
200  out.fastCloning= cms.untracked.bool(False)
201  out.overrideInputFileSplitLevels = cms.untracked.bool(True)
202  out.compressionAlgorithm = cms.untracked.string('LZMA')
def miniAOD_customizeOutput