-
Notifications
You must be signed in to change notification settings - Fork 0
/
electron_mc_pat2ntuple_cfg.py
135 lines (101 loc) · 4.82 KB
/
electron_mc_pat2ntuple_cfg.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
import FWCore.ParameterSet.Config as cms
process = cms.Process("CALIB")
from PhysicsTools.PatAlgos.patTemplate_cfg import *
from PhysicsTools.PatAlgos.tools.pfTools import *
usePFIso( process )
from PhysicsTools.PatAlgos.tools.metTools import *
from PhysicsTools.PatAlgos.tools.coreTools import *
mytrigs = ['*']
# initialize MessageLogger and output report
process.load("FWCore.MessageLogger.MessageLogger_cfi")
process.MessageLogger.cerr.threshold = 'INFO'
process.MessageLogger.categories.append('PATSummaryTables')
inputJetCorrLabel = ('AK5PF', ['L1FastJet', 'L2Relative', 'L3Absolute'])
inputJetCorrLabell = ('AK5Calo',['L2Relative', 'L3Absolute'])
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
'root://eoscms.cern.ch//eos/cms//store/user/bbilin/ntuples/mc/copy/MyOutputFile_1_1_aS5.root'
#'root://eoscms.cern.ch//eos/cms//store/user/bbilin/QBH/fastsim/522/522_fast_100_1_zEl.root'
)
)
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(100) )
#process.load("Configuration.StandardSequences.GeometryIdeal_cff")
process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
process.GlobalTag.globaltag = cms.string( 'START53_V11::All')
process.load("Configuration.StandardSequences.MagneticField_cff")
#addJetID(process,cms.InputTag('ak5CaloJets'),'ak5')
#removeSpecificPATObjects( process, ['Taus'] )
#process.patDefaultSequence.remove( process.patTaus )
addPfMET(process, 'PF')
from PhysicsTools.PatAlgos.tools.jetTools import *
addJetCollection(process,cms.InputTag('ak5CaloJets'),
'AK5','Calo',
doJTA = False,
doBTagging = False,
jetCorrLabel = inputJetCorrLabell,
doType1MET = True,
genJetCollection=cms.InputTag("ak5GenJets"),
doJetID = True
)
switchJetCollection(process,cms.InputTag('ak5PFJets'),
doJTA = True,
doBTagging = True,
jetCorrLabel = inputJetCorrLabel,
doType1MET = True,
genJetCollection=cms.InputTag("ak5GenJets"),
doJetID = True
)
process.patJets.addTagInfos = True
process.patJets.tagInfoSources = cms.VInputTag(
cms.InputTag("secondaryVertexTagInfosAOD"),
)
process.load('CommonTools/RecoAlgos/HBHENoiseFilter_cfi')
process.TFileService=cms.Service("TFileService",
fileName=cms.string("elec_ntuple.root")
)
from HLTrigger.HLTfilters.hltHighLevel_cfi import *
if mytrigs is not None :
process.hltSelection = hltHighLevel.clone(TriggerResultsTag = 'TriggerResults::HLT', HLTPaths = mytrigs)
process.hltSelection.throw = False
#process.elec_HLT = cms.EDFilter("HLTHighLevel",
# TriggerResultsTag = cms.InputTag("TriggerResults","","HLT"),
# HLTPaths = cms.vstring('HLT_Photon10_L1R','HLT_Photon15_Cleaned_L1R','HLT_Ele15_SW_CaloEleId_L1R','HLT_Ele17_SW_CaloEleId_L1R','HLT_Ele17_SW_TightEleId_L1R','HLT_Ele17_SW_TighterEleIdIsol_L1R'), ## provide list of HLT paths (or patterns) you want
# eventSetupPathsKey = cms.string(''), # not empty => use read paths from AlCaRecoTriggerBitsRcd via this key
# andOr = cms.bool(True), # how to deal with multiple triggers: True (OR) accept if ANY is true, False (AND) accept if ALL are true
# throw = cms.bool(False) # throw exception on unknown path names
# )
process.patElectrons.electronIDSources = cms.PSet(
#MVA
mvaTrigV0 = cms.InputTag("mvaTrigV0"),
mvaNonTrigV0 = cms.InputTag("mvaNonTrigV0"),
)
process.load('EGamma.EGammaAnalysisTools.electronIdMVAProducer_cfi')
process.mvaID = cms.Sequence( process.mvaTrigV0 + process.mvaNonTrigV0 )
#add pat conversions
process.patConversions = cms.EDProducer("PATConversionProducer",
# input collection
#electronSource = cms.InputTag("gsfElectrons"),
electronSource = cms.InputTag("selectedPatElectrons")
# this should be your last selected electron collection name since currently index is used to match with electron later. We can fix this using reference pointer. ,
)
#from RecoJets.JetProducers.kt4PFJets_cfi import *
#process.kt6PFJetsForIsolation = kt4PFJets.clone( rParam = 0.6, doRhoFastjet = True )
#process.kt6PFJetsForIsolation.Rho_EtaMax = cms.double(2.5)
#load the PU JetID sequence
process.load("CMGTools.External.pujetidsequence_cff")
process.demo = cms.EDAnalyzer("ntupleGenerator",
PfJetAlg = cms.string("selectedPatJets"),
CaloJetAlg =cms.string("selectedPatJetsAK5Calo"),
elecTag = cms.InputTag("selectedPatElectrons")
)
process.p = cms.Path(
#*process.elec_HLT
#*process.hltSelection
process.mvaID
* process.patDefaultSequence
* process.patConversions
#* process.kt6PFJetsForIsolation
* process.puJetIdSqeuence
* process.demo
)
process.out.outputCommands = cms.untracked.vstring('drop *')