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

References miniAOD_customizeCommon(), and miniAOD_customizeData().

162 def miniAOD_customizeAllData(process):
163  miniAOD_customizeCommon(process)
164  miniAOD_customizeData(process)
165  return process
def miniAOD_customizeCommon
Definition: miniAOD_tools.py:3
def miniAOD_customizeAllData
def miniAOD_customizeData
def miniAOD_tools.miniAOD_customizeAllMC (   process)

Definition at line 166 of file miniAOD_tools.py.

References miniAOD_customizeCommon(), and miniAOD_customizeMC().

167 def miniAOD_customizeAllMC(process):
168  miniAOD_customizeCommon(process)
169  miniAOD_customizeMC(process)
170  return process
def miniAOD_customizeAllMC
def miniAOD_customizeCommon
Definition: miniAOD_tools.py:3
def miniAOD_tools.miniAOD_customizeCommon (   process)

Definition at line 3 of file miniAOD_tools.py.

References trigTools.switchOnTriggerStandAlone.

Referenced by miniAOD_customizeAllData(), and miniAOD_customizeAllMC().

3 
4 def miniAOD_customizeCommon(process):
5  process.patMuons.isoDeposits = cms.PSet()
6  process.patElectrons.isoDeposits = cms.PSet()
7  process.patTaus.isoDeposits = cms.PSet()
8  process.patPhotons.isoDeposits = cms.PSet()
9  #
10  process.patMuons.embedTrack = True # used for IDs
11  process.patMuons.embedCombinedMuon = True # used for IDs
12  process.patMuons.embedMuonBestTrack = True # used for IDs
13  process.patMuons.embedStandAloneMuon = True # maybe?
14  process.patMuons.embedPickyMuon = False # no, use best track
15  process.patMuons.embedTpfmsMuon = False # no, use best track
16  process.patMuons.embedDytMuon = False # no, use best track
17  #
18  # disable embedding of electron and photon associated objects already stored by the ReducedEGProducer
19  process.patElectrons.embedGsfElectronCore = False ## process.patElectrons.embed in AOD externally stored gsf electron core
20  process.patElectrons.embedSuperCluster = False ## process.patElectrons.embed in AOD externally stored supercluster
21  process.patElectrons.embedPflowSuperCluster = False ## process.patElectrons.embed in AOD externally stored supercluster
22  process.patElectrons.embedSeedCluster = False ## process.patElectrons.embed in AOD externally stored the electron's seedcluster
23  process.patElectrons.embedBasicClusters = False ## process.patElectrons.embed in AOD externally stored the electron's basic clusters
24  process.patElectrons.embedPreshowerClusters = False ## process.patElectrons.embed in AOD externally stored the electron's preshower clusters
25  process.patElectrons.embedPflowBasicClusters = False ## process.patElectrons.embed in AOD externally stored the electron's pflow basic clusters
26  process.patElectrons.embedPflowPreshowerClusters = False ## process.patElectrons.embed in AOD externally stored the electron's pflow preshower clusters
27  process.patElectrons.embedRecHits = False ## process.patElectrons.embed in AOD externally stored the RecHits - can be called from the PATElectronProducer
28  process.patElectrons.electronSource = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
29  process.patElectrons.electronIDSources = cms.PSet(
30  # configure many IDs as InputTag <someName> = <someTag> you
31  # can comment out those you don't want to save some disk space
32  eidRobustLoose = cms.InputTag("reducedEgamma","eidRobustLoose"),
33  eidRobustTight = cms.InputTag("reducedEgamma","eidRobustTight"),
34  eidLoose = cms.InputTag("reducedEgamma","eidLoose"),
35  eidTight = cms.InputTag("reducedEgamma","eidTight"),
36  eidRobustHighEnergy = cms.InputTag("reducedEgamma","eidRobustHighEnergy"),
37  )
38  process.elPFIsoDepositCharged.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
39  process.elPFIsoDepositChargedAll.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
40  process.elPFIsoDepositNeutral.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
41  process.elPFIsoDepositGamma.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
42  process.elPFIsoDepositPU.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
43  #
44  process.patPhotons.embedSuperCluster = False ## whether to process.patPhotons.embed in AOD externally stored supercluster
45  process.patPhotons.embedSeedCluster = False ## process.patPhotons.embed in AOD externally stored the photon's seedcluster
46  process.patPhotons.embedBasicClusters = False ## process.patPhotons.embed in AOD externally stored the photon's basic clusters
47  process.patPhotons.embedPreshowerClusters = False ## process.patPhotons.embed in AOD externally stored the photon's preshower clusters
48  process.patPhotons.embedRecHits = False ## process.patPhotons.embed in AOD externally stored the RecHits - can be called from the PATPhotonProducer
49  process.patPhotons.photonSource = cms.InputTag("reducedEgamma","reducedGedPhotons")
50  process.patPhotons.photonIDSources = cms.PSet(
51  PhotonCutBasedIDLoose = cms.InputTag('reducedEgamma',
52  'PhotonCutBasedIDLoose'),
53  PhotonCutBasedIDTight = cms.InputTag('reducedEgamma',
54  'PhotonCutBasedIDTight')
55  )
56 
57  process.phPFIsoDepositCharged.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
58  process.phPFIsoDepositChargedAll.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
59  process.phPFIsoDepositNeutral.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
60  process.phPFIsoDepositGamma.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
61  process.phPFIsoDepositPU.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
62  #
63  process.selectedPatJets.cut = cms.string("pt > 10")
64  process.selectedPatMuons.cut = cms.string("pt > 5 || isPFMuon || (pt > 3 && (isGlobalMuon || isStandAloneMuon || numberOfMatches > 0 || muonID('RPCMuLoose')))")
65  process.selectedPatElectrons.cut = cms.string("")
66  process.selectedPatTaus.cut = cms.string("pt > 18. && tauID('decayModeFinding')> 0.5")
67  process.selectedPatPhotons.cut = cms.string("")
68  #
69  from PhysicsTools.PatAlgos.tools.jetTools import switchJetCollection
70  #switch to AK4 (though it should soon be unnecessary as ak4 should become the 71X default)
71  #FIXME: still using AK5PFchs for jet energy corrections, while waiting for a new globalTag
72  switchJetCollection(process, jetSource = cms.InputTag('ak4PFJetsCHS'),
73  jetCorrections = ('AK4PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), ''),
74  btagDiscriminators = ['jetBProbabilityBJetTags', 'jetProbabilityBJetTags', 'trackCountingHighPurBJetTags', 'trackCountingHighEffBJetTags', 'simpleSecondaryVertexHighEffBJetTags',
75  'simpleSecondaryVertexHighPurBJetTags', 'combinedSecondaryVertexBJetTags' , 'combinedInclusiveSecondaryVertexBJetTags' ],
76  )
77  #add CA8
78  from PhysicsTools.PatAlgos.tools.jetTools import addJetCollection
79  addJetCollection(process, labelName = 'AK8', jetSource = cms.InputTag('ak8PFJetsCHS'),algo= 'AK', rParam = 0.8, jetCorrections = ('AK7PFchs', cms.vstring(['L1FastJet', 'L2Relative', 'L3Absolute']), 'None') )
80  process.patJetsAK8.userData.userFloats.src = [] # start with empty list of user floats
81  process.selectedPatJetsAK8.cut = cms.string("pt > 100")
82  process.patJetGenJetMatchAK8.matched = 'slimmedGenJets'
83  ## AK8 groomed masses
84  from RecoJets.Configuration.RecoPFJets_cff import ak8PFJetsCHSPruned, ak8PFJetsCHSFiltered, ak8PFJetsCHSTrimmed
85  process.ak8PFJetsCHSPruned = ak8PFJetsCHSPruned.clone()
86  process.ak8PFJetsCHSTrimmed = ak8PFJetsCHSTrimmed.clone()
87  process.ak8PFJetsCHSFiltered = ak8PFJetsCHSFiltered.clone()
88  process.load("RecoJets.JetProducers.ak8PFJetsCHS_groomingValueMaps_cfi")
89  process.patJetsAK8.userData.userFloats.src += ['ak8PFJetsCHSPrunedLinks','ak8PFJetsCHSTrimmedLinks','ak8PFJetsCHSFilteredLinks']
90  ### 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"
91  # from RecoJets.Configuration.RecoPFJets_cff import ca8PFJetsCHSFiltered, ca8PFJetsCHSTrimmed # ca8PFJetsCHSPruned is already in AOD
92  # process.ca8PFJetsCHSTrimmed = ca8PFJetsCHSTrimmed.clone()
93  # process.ca8PFJetsCHSFiltered = ca8PFJetsCHSFiltered.clone()
94  # process.load("RecoJets.JetProducers.ca8PFJetsCHS_groomingValueMaps_cfi")
95  # process.ca8PFJetsCHSPrunedLinks.src = cms.InputTag("ak8PFJetsCHS")
96  # process.ca8PFJetsCHSTrimmedLinks.src = cms.InputTag("ak8PFJetsCHS")
97  # process.ca8PFJetsCHSFilteredLinks.src = cms.InputTag("ak8PFJetsCHS")
98  # process.patJetsAK8.userData.userFloats.src += ['ca8PFJetsCHSPrunedLinks','ca8PFJetsCHSTrimmedLinks','ca8PFJetsCHSFilteredLinks']
99  ## cmsTopTagger (note: it is already run in RECO, we just add the value)
100  process.cmsTopTagPFJetsCHSLinksAK8 = process.ak8PFJetsCHSPrunedLinks.clone()
101  process.cmsTopTagPFJetsCHSLinksAK8.src = cms.InputTag("ak8PFJetsCHS")
102  process.cmsTopTagPFJetsCHSLinksAK8.matched = cms.InputTag("cmsTopTagPFJetsCHS")
103  process.patJetsAK8.userData.userFloats.src += ['cmsTopTagPFJetsCHSLinksAK8']
104 
105  #
106  ## PU JetID
107  process.load("PhysicsTools.PatAlgos.slimming.pileupJetId_cfi")
108  process.patJets.userData.userFloats.src = [ cms.InputTag("pileupJetId:fullDiscriminant"), ]
109  #
110  from PhysicsTools.PatAlgos.tools.trigTools import switchOnTriggerStandAlone
111  switchOnTriggerStandAlone( process, outputModule = '' )
112  process.patTrigger.packTriggerPathNames = cms.bool(True)
113  #
114  # apply type I/type I + II PFMEt corrections to pat::MET object
115  # and estimate systematic uncertainties on MET
116  # FIXME: this and the typeI MET should become AK4 once we have the proper JEC?
117  from PhysicsTools.PatUtils.tools.metUncertaintyTools import runMEtUncertainties
118  addJetCollection(process, postfix = "ForMetUnc", labelName = 'AK5PF', jetSource = cms.InputTag('ak5PFJets'), jetCorrections = ('AK5PF', ['L1FastJet', 'L2Relative', 'L3Absolute'], ''))
119  runMEtUncertainties(process,jetCollection="selectedPatJetsAK5PFForMetUnc", outputModule=None)
120 
121  #keep this after all addJetCollections otherwise it will attempt computing them also for stuf with no taginfos
122  #Some useful BTAG vars
123  process.patJets.userData.userFunctions = cms.vstring(
124  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().secondaryVertex(0).p4.M):(0)',
125  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().secondaryVertex(0).nTracks):(0)',
126  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().flightDistance(0).value):(0)',
127  '?(tagInfoSecondaryVertex().nVertices()>0)?(tagInfoSecondaryVertex().flightDistance(0).significance):(0)',
128  )
129  process.patJets.userData.userFunctionLabels = cms.vstring('vtxMass','vtxNtracks','vtx3DVal','vtx3DSig')
130  process.patJets.tagInfoSources = cms.VInputTag(cms.InputTag("secondaryVertexTagInfos"))
131  process.patJets.addTagInfos = cms.bool(True)
132 
def miniAOD_customizeCommon
Definition: miniAOD_tools.py:3
tuple switchOnTriggerStandAlone
Definition: trigTools.py:276
def miniAOD_tools.miniAOD_customizeData (   process)

Definition at line 157 of file miniAOD_tools.py.

Referenced by miniAOD_customizeAllData().

158 def miniAOD_customizeData(process):
159  from PhysicsTools.PatAlgos.tools.coreTools import runOnData
160  runOnData( process, outputModules = [] )
def miniAOD_customizeData
def miniAOD_tools.miniAOD_customizeMC (   process)

Definition at line 133 of file miniAOD_tools.py.

Referenced by miniAOD_customizeAllMC().

134 def miniAOD_customizeMC(process):
135  process.muonMatch.matched = "prunedGenParticles"
136  process.electronMatch.matched = "prunedGenParticles"
137  process.electronMatch.src = cms.InputTag("reducedEgamma","reducedGedGsfElectrons")
138  process.photonMatch.matched = "prunedGenParticles"
139  process.photonMatch.src = cms.InputTag("reducedEgamma","reducedGedPhotons")
140  process.tauMatch.matched = "prunedGenParticles"
141  process.patJetPartonMatch.matched = "prunedGenParticles"
142  process.patJetPartonMatch.mcStatus = [ 3, 23 ]
143  process.patJetGenJetMatch.matched = "slimmedGenJets"
144  process.patMuons.embedGenMatch = False
145  process.patElectrons.embedGenMatch = False
146  process.patPhotons.embedGenMatch = False
147  process.patTaus.embedGenMatch = False
148  process.patJets.embedGenPartonMatch = False
149  #also jet flavour must be switched to ak4
150  process.patJetFlavourAssociation.rParam = 0.4
def miniAOD_tools.miniAOD_customizeOutput (   out)

Definition at line 151 of file miniAOD_tools.py.

152 def miniAOD_customizeOutput(out):
153  out.dropMetaData = cms.untracked.string('ALL')
154  out.fastCloning= cms.untracked.bool(False)
155  out.overrideInputFileSplitLevels = cms.untracked.bool(True)
156  out.compressionAlgorithm = cms.untracked.string('LZMA')
def miniAOD_customizeOutput