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 183 of file miniAOD_tools.py.

References miniAOD_customizeCommon(), and miniAOD_customizeData().

184 def miniAOD_customizeAllData(process):
185  miniAOD_customizeCommon(process)
186  miniAOD_customizeData(process)
187  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 188 of file miniAOD_tools.py.

References miniAOD_customizeCommon(), and miniAOD_customizeMC().

189 def miniAOD_customizeAllMC(process):
190  miniAOD_customizeCommon(process)
191  miniAOD_customizeMC(process)
192  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  from PhysicsTools.PatAlgos.tools.jetTools import switchJetCollection
72  #switch to AK4 (though it should soon be unnecessary as ak4 should become the 71X default)
73  #FIXME: still using AK5PFchs for jet energy corrections, while waiting for a new globalTag
74  switchJetCollection(process, jetSource = cms.InputTag('ak4PFJetsCHS'),
75  jetCorrections = ('AK4PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), ''),
76  btagDiscriminators = ['jetBProbabilityBJetTags', 'jetProbabilityBJetTags', 'trackCountingHighPurBJetTags', 'trackCountingHighEffBJetTags', 'simpleSecondaryVertexHighEffBJetTags',
77  'simpleSecondaryVertexHighPurBJetTags', 'combinedSecondaryVertexBJetTags' , 'combinedInclusiveSecondaryVertexBJetTags' ],
78  )
79  #add CA8
80  from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection
81  addJetCollection(process, labelName = 'AK8', jetSource = cms.InputTag('ak8PFJetsCHS'),algo= 'AK', rParam = 0.8, jetCorrections = ('AK7PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'None') )
82  process.patJetsAK8.userData.userFloats.src = [] # start with empty list of user floats
83  process.selectedPatJetsAK8.cut = cms.string("pt > 100")
84  process.patJetGenJetMatchAK8.matched = 'slimmedGenJets'
85  ## AK8 groomed masses
86  from RecoJets.Configuration.RecoPFJets_cff import ak8PFJetsCHSPruned, ak8PFJetsCHSFiltered, ak8PFJetsCHSTrimmed
87  process.ak8PFJetsCHSPruned = ak8PFJetsCHSPruned.clone()
88  process.ak8PFJetsCHSTrimmed = ak8PFJetsCHSTrimmed.clone()
89  process.ak8PFJetsCHSFiltered = ak8PFJetsCHSFiltered.clone()
90  process.load("RecoJets.JetProducers.ak8PFJetsCHS_groomingValueMaps_cfi")
91  process.patJetsAK8.userData.userFloats.src += ['ak8PFJetsCHSPrunedLinks','ak8PFJetsCHSTrimmedLinks','ak8PFJetsCHSFilteredLinks']
92  ### CA8 groomed masses (for the matched jet): doesn't seem to work, it produces tons of warnings "Matched jets separated by dR greater than distMax=0.8"
93  # from RecoJets.Configuration.RecoPFJets_cff import ca8PFJetsCHSFiltered, ca8PFJetsCHSTrimmed # ca8PFJetsCHSPruned is already in AOD
94  # process.ca8PFJetsCHSTrimmed = ca8PFJetsCHSTrimmed.clone()
95  # process.ca8PFJetsCHSFiltered = ca8PFJetsCHSFiltered.clone()
96  # process.load("RecoJets.JetProducers.ca8PFJetsCHS_groomingValueMaps_cfi")
97  # process.ca8PFJetsCHSPrunedLinks.src = cms.InputTag("ak8PFJetsCHS")
98  # process.ca8PFJetsCHSTrimmedLinks.src = cms.InputTag("ak8PFJetsCHS")
99  # process.ca8PFJetsCHSFilteredLinks.src = cms.InputTag("ak8PFJetsCHS")
100  # process.patJetsAK8.userData.userFloats.src += ['ca8PFJetsCHSPrunedLinks','ca8PFJetsCHSTrimmedLinks','ca8PFJetsCHSFilteredLinks']
101  ## cmsTopTagger (note: it is already run in RECO, we just add the value)
102  process.cmsTopTagPFJetsCHSLinksAK8 = process.ak8PFJetsCHSPrunedLinks.clone()
103  process.cmsTopTagPFJetsCHSLinksAK8.src = cms.InputTag("ak8PFJetsCHS")
104  process.cmsTopTagPFJetsCHSLinksAK8.matched = cms.InputTag("cmsTopTagPFJetsCHS")
105  process.patJetsAK8.userData.userFloats.src += ['cmsTopTagPFJetsCHSLinksAK8']
106 
107  #
108  ## PU JetID
109  process.load("PhysicsTools.PatAlgos.slimming.pileupJetId_cfi")
110  process.patJets.userData.userFloats.src = [ cms.InputTag("pileupJetId:fullDiscriminant"), ]
111  #
112  from PhysicsTools.PatAlgos.tools.trigTools import switchOnTriggerStandAlone
113  switchOnTriggerStandAlone( process, outputModule = '' )
114  process.patTrigger.packTriggerPathNames = cms.bool(True)
115  #
116  # apply type I/type I + II PFMEt corrections to pat::MET object
117  # and estimate systematic uncertainties on MET
118  # FIXME: this and the typeI MET should become AK4 once we have the proper JEC?
119  from PhysicsTools.PatUtils.tools.metUncertaintyTools import runMEtUncertainties
120  addJetCollection(process, postfix = "ForMetUnc", labelName = 'AK5PF', jetSource = cms.InputTag('ak5PFJets'), jetCorrections = ('AK5PF', ['L1FastJet', 'L2Relative', 'L3Absolute'], ''))
121  runMEtUncertainties(process,jetCollection="selectedPatJetsAK5PFForMetUnc", outputModule=None)
122 
123  #keep this after all addJetCollections otherwise it will attempt computing them also for stuf with no taginfos
124  #Some useful BTAG vars
125  process.patJets.userData.userFunctions = cms.vstring(
126  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().secondaryVertex(0).p4.M):(0)',
127  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().secondaryVertex(0).nTracks):(0)',
128  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().flightDistance(0).value):(0)',
129  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().flightDistance(0).significance):(0)',
130  )
131  process.patJets.userData.userFunctionLabels = cms.vstring('vtxMass','vtxNtracks','vtx3DVal','vtx3DSig')
132  process.patJets.tagInfoSources = cms.VInputTag(cms.InputTag("secondaryVertexTagInfos"))
133  process.patJets.addTagInfos = cms.bool(True)
134 
135  #VID Electron IDs
136  electron_ids = ['RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_CSA14_50ns_V1_cff',
137  'RecoEgamma.ElectronIdentification.Identification.cutBasedElectronID_CSA14_PU20bx25_V0_cff',
138  'RecoEgamma.ElectronIdentification.Identification.heepElectronID_HEEPV50_CSA14_25ns_cff',
139  'RecoEgamma.ElectronIdentification.Identification.heepElectronID_HEEPV50_CSA14_startup_cff']
141  process.egmGsfElectronIDs.physicsObjectSrc = \
142  cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
143  process.electronIDValueMapProducer.src = \
144  cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
145  process.electronIDValueMapProducer.ebReducedRecHitCollection = \
146  cms.InputTag("reducedEgamma","reducedEBRecHits")
147  process.electronIDValueMapProducer.eeReducedRecHitCollection = \
148  cms.InputTag("reducedEgamma","reducedEERecHits")
149  process.electronIDValueMapProducer.esReducedRecHitCollection = \
150  cms.InputTag("reducedEgamma","reducedESRecHits")
151  for idmod in electron_ids:
152  setupAllVIDIdsInModule(process,idmod,setupVIDElectronSelection)
153 
154 
def setupAllVIDIdsInModule
Definition: vid_id_tools.py:30
def switchOnVIDElectronIdProducer
Electrons.
Definition: vid_id_tools.py:43
def miniAOD_customizeCommon
Definition: miniAOD_tools.py:5
tuple switchOnTriggerStandAlone
Definition: trigTools.py:276
def miniAOD_tools.miniAOD_customizeData (   process)

Definition at line 179 of file miniAOD_tools.py.

Referenced by miniAOD_customizeAllData().

180 def miniAOD_customizeData(process):
181  from PhysicsTools.PatAlgos.tools.coreTools import runOnData
182  runOnData( process, outputModules = [] )
def miniAOD_customizeData
def miniAOD_tools.miniAOD_customizeMC (   process)

Definition at line 155 of file miniAOD_tools.py.

Referenced by miniAOD_customizeAllMC().

156 def miniAOD_customizeMC(process):
157  process.muonMatch.matched = "prunedGenParticles"
158  process.electronMatch.matched = "prunedGenParticles"
159  process.electronMatch.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
160  process.photonMatch.matched = "prunedGenParticles"
161  process.photonMatch.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
162  process.tauMatch.matched = "prunedGenParticles"
163  process.patJetPartonMatch.matched = "prunedGenParticles"
164  process.patJetPartonMatch.mcStatus = [ 3, 23 ]
165  process.patJetGenJetMatch.matched = "slimmedGenJets"
166  process.patMuons.embedGenMatch = False
167  process.patElectrons.embedGenMatch = False
168  process.patPhotons.embedGenMatch = False
169  process.patTaus.embedGenMatch = False
170  process.patJets.embedGenPartonMatch = False
171  #also jet flavour must be switched to ak4
172  process.patJetFlavourAssociation.rParam = 0.4
def miniAOD_tools.miniAOD_customizeOutput (   out)

Definition at line 173 of file miniAOD_tools.py.

174 def miniAOD_customizeOutput(out):
175  out.dropMetaData = cms.untracked.string('ALL')
176  out.fastCloning= cms.untracked.bool(False)
177  out.overrideInputFileSplitLevels = cms.untracked.bool(True)
178  out.compressionAlgorithm = cms.untracked.string('LZMA')
def miniAOD_customizeOutput