-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpatTuple_PF2PAT_cfg.py
139 lines (115 loc) · 6.94 KB
/
patTuple_PF2PAT_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
136
137
138
139
## import skeleton process
from PhysicsTools.PatAlgos.patTemplate_cfg import *
# the source is already defined in patTemplate_cfg.
# overriding source and various other things
#process.load("CommonTools.ParticleFlow.Sources.source_ZtoEles_DBS_312_cfi")
process.source = cms.Source("PoolSource",
fileNames = cms.untracked.vstring(
'dcache:/pnfs/cms/WAX/11/store/mc/Summer11/G_Pt-50to80_TuneZ2_7TeV_pythia6/AODSIM/PU_S3_START42_V11-v2/0000/FC51BE21-437F-E011-82C2-D8D385FF0B6A.root',
'dcache:/pnfs/cms/WAX/11/store/mc/Summer11/G_Pt-50to80_TuneZ2_7TeV_pythia6/AODSIM/PU_S3_START42_V11-v2/0000/FC76E112-417F-E011-BAD8-0022649F01AA.root',
'dcache:/pnfs/cms/WAX/11/store/mc/Summer11/G_Pt-50to80_TuneZ2_7TeV_pythia6/AODSIM/PU_S3_START42_V11-v2/0000/FCB55B55-4F7F-E011-9724-1CC1DE1D0600.root',
'dcache:/pnfs/cms/WAX/11/store/mc/Summer11/G_Pt-50to80_TuneZ2_7TeV_pythia6/AODSIM/PU_S3_START42_V11-v2/0000/FC666D0A-147F-E011-A358-0017A4770C30.root'
)
)
# set up GLobalTag
process.load('Configuration.StandardSequences.Services_cff')
process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff')
process.GlobalTag.globaltag = cms.string('START43_V4::All')
# Fix the fastjet "rho" variable not found (kt6PFJets) problem
# follow the HN thread https://hypernews.cern.ch/HyperNews/CMS/get/physTools/2473/2.html
##-------------------- Import the JEC services -----------------------
process.load('JetMETCorrections.Configuration.DefaultJEC_cff')
##-------------------- Import the Jet RECO modules -----------------------
process.load('RecoJets.Configuration.RecoPFJets_cff')
##-------------------- Turn-on the FastJet density calculation -----------------------
process.kt6PFJets.doRhoFastjet = True
##-------------------- Turn-on the FastJet jet area calculation for your favorite algorithm -----------------------
process.ak5PFJets.doAreaFastjet = True
JetCorrectionService = cms.string('ak5PFL1FastL2L3')
### 1. skimming process
#user can select exoticaDiPhoHLTQualitySeq or exoticaDiPhoRecoQualitySeq
process.load('SUSYBSMAnalysis.Skimming.EXODiPho_cff')
process.exoticaDiPhoHLT.HLTPaths =['HLT_DoublePhoton33_v2']
process.exoticaDiPhoHLT.TriggerResultsTag = cms.InputTag("TriggerResults","","HLT")
process.exoticaHLTDiPhoFilter.summary = cms.InputTag("hltTriggerSummaryAOD","","HLT")
process.exoticaHLTDiPhoFilter.member = cms.InputTag("hltL1NonIsoRecoEcalCandidate","","HLT")
# process.load("CommonTools.ParticleFlow.Sources.source_ZtoMus_DBS_cfi")
process.options = cms.untracked.PSet(
wantSummary = cms.untracked.bool(True),
SkipEvent = cms.untracked.vstring('ProductNotFound')
)
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(20000) )
process.out.fileName = cms.untracked.string('testPF2PAT.root')
# load the PAT config
process.load("PhysicsTools.PatAlgos.patSequences_cff")
# Configure PAT to use PF2PAT instead of AOD sources
# this function will modify the PAT sequences. It is currently
# not possible to run PF2PAT+PAT and standart PAT at the same time
from PhysicsTools.PatAlgos.tools.pfTools import *
postfix = "PFlow"
jetAlgo="AK5"
usePF2PAT(process,runPF2PAT=True, jetAlgo=jetAlgo, runOnMC=True, postfix=postfix)
# to run second PF2PAT+PAT with differnt postfix uncomment the following lines
# and add it to path
#postfix2 = "PFlow2"
#jetAlgo2="AK7"
#usePF2PAT(process,runPF2PAT=True, jetAlgo=jetAlgo2, runOnMC=True, postfix=postfix2)
# to use tau-cleaned jet collection uncomment the following:
#getattr(process,"pfNoTau"+postfix).enable = True
# to switch default tau to HPS tau uncomment the following:
#adaptPFTaus(process,"hpsPFTau",postfix=postfix)
# Let it run
process.p = cms.Path(
# process.patDefaultSequence +
process.exoticaDiPhoHLTQualitySeq *
process.kt6PFJets * process.ak5PFJets *
getattr(process,"patPF2PATSequence"+postfix)
# second PF2PAT
# + getattr(process,"patPF2PATSequence"+postfix2)
)
# Add PF2PAT output to the created file
from PhysicsTools.PatAlgos.patEventContent_cff import patEventContentNoCleaning
#process.load("CommonTools.ParticleFlow.PF2PAT_EventContent_cff")
#process.out.outputCommands = cms.untracked.vstring('drop *')
process.out.outputCommands = cms.untracked.vstring('drop *',
'keep *_exoticaHLTDiPhoFilter_*_*',
'keep *_exoticaRecoDiPhoFilter_*_*',
'keep *_photons_*_*',
'keep *_reducedEcalRecHitsEB_*_*',
'keep *_reducedEcalRecHitsEE_*_*',
'keep *_hybridSuperClusters_hybridBarrelBasicClusters_*',
'keep *_multi5x5BasicClusters_multi5x5EndcapBasicClusters_*',
'keep *_correctedHybridSuperClusters_*_*',
'keep *_correctedMulti5x5SuperClustersWithPreshower_*_*',
'keep recoMuons_muons_*_*',
'keep *_offlinePrimaryVertices_*_*',
'keep *_gtDigis_*_*',
'keep recoPFCandidates_particleFlow_*_*',
*patEventContentNoCleaning )
# top projections in PF2PAT:
getattr(process,"pfNoPileUp"+postfix).enable = True
getattr(process,"pfNoMuon"+postfix).enable = True
getattr(process,"pfNoElectron"+postfix).enable = True
getattr(process,"pfNoTau"+postfix).enable = False
getattr(process,"pfNoJet"+postfix).enable = True
# verbose flags for the PF2PAT modules
getattr(process,"pfNoMuon"+postfix).verbose = False
## ------------------------------------------------------
# In addition you usually want to change the following
# parameters:
## ------------------------------------------------------
#
# process.GlobalTag.globaltag = ... ## (according to https://twiki.cern.ch/twiki/bin/view/CMS/SWGuideFrontierConditions)
# ##
# process.source.fileNames = [ ##
# '/store/relval/CMSSW_3_5_0_pre1/RelValTTbar/GEN-SIM-RECO/STARTUP3X_V14-v1/0006/14920B0A-0DE8-DE11-B138-002618943926.root'
# ] ## (e.g. 'file:AOD.root')
# ##
# process.maxEvents.input = ... ## (e.g. -1 to run on all events)
# ##
# process.out.outputCommands = [ ... ] ## (e.g. taken from PhysicsTools/PatAlgos/python/patEventContent_cff.py)
# ##
# process.out.fileName = ... ## (e.g. 'myTuple.root')
# ##
# process.options.wantSummary = True ## (to suppress the long output at the end of the job)
process.MessageLogger.cerr.FwkReport.reportEvery = 10