1 |
zhangjin |
1.1 |
|
2 |
|
|
# Configuration file for CSCTriggerPrimitive study.
|
3 |
|
|
# Chaouki Boulahouache June-2010.
|
4 |
|
|
# Jinzhong Zhang June-2012.
|
5 |
|
|
#
|
6 |
|
|
# Import the right stuff
|
7 |
|
|
#
|
8 |
zhangjin |
1.3 |
datatype = "RAW"
|
9 |
zhangjin |
1.1 |
#Candidates are data: "RAW" "RAW-RECO" "FEVT"
|
10 |
|
|
#mc: in order of suggestions: "GEN-RAWDEBUG"(mc) "GEN-SIM-RAW"(mc) "GEN-RAW"(mc) "GEN-SIM".....
|
11 |
|
|
# if no RAW exists, you need to choose a mixing module manually
|
12 |
|
|
# pileup tracks cannot be identified in "GEN-RAW" sample
|
13 |
|
|
|
14 |
|
|
HLTProcessName='HLT'
|
15 |
|
|
|
16 |
|
|
import sys,os
|
17 |
|
|
|
18 |
|
|
if "GEN" in datatype or "SIM" in datatype:
|
19 |
|
|
runOnMC = True
|
20 |
|
|
else:
|
21 |
|
|
runOnMC = False
|
22 |
|
|
|
23 |
|
|
CMSSW_Version_=os.getenv("CMSSW_VERSION")
|
24 |
|
|
Version_Number_=CMSSW_Version_.split('_')
|
25 |
|
|
|
26 |
|
|
if ( int(Version_Number_[1])<5 ) or ( int(Version_Number_[1])==5 and int(Version_Number_[2])<2 ):
|
27 |
|
|
After520=False
|
28 |
|
|
else:
|
29 |
|
|
After520=True
|
30 |
|
|
|
31 |
|
|
if ( int(Version_Number_[1])<4 ) or ( int(Version_Number_[1])==4 and int(Version_Number_[2])<3 ):
|
32 |
|
|
After430=False
|
33 |
|
|
else:
|
34 |
|
|
After430=True
|
35 |
|
|
|
36 |
|
|
if After430:
|
37 |
|
|
from Configuration.AlCa.autoCond import autoCond # for >=CMSSW_4_3_0
|
38 |
|
|
else:
|
39 |
|
|
from Configuration.PyReleaseValidation.autoCond import autoCond
|
40 |
|
|
|
41 |
|
|
import FWCore.ParameterSet.Config as cms
|
42 |
|
|
import FWCore.ParameterSet.VarParsing as VarParsing
|
43 |
|
|
#
|
44 |
|
|
##################################################################################################
|
45 |
|
|
process = cms.Process("ANALYSISNTUPLE")
|
46 |
|
|
###################################################################################################
|
47 |
|
|
|
48 |
|
|
# import of standard configurations
|
49 |
|
|
process.load("FWCore/MessageService/MessageLogger_cfi")
|
50 |
|
|
process.load('Configuration/StandardSequences/FrontierConditions_GlobalTag_cff')
|
51 |
|
|
#process.load("Configuration.StandardSequences.MagneticField_cff")
|
52 |
|
|
process.load('Configuration/StandardSequences/MagneticField_AutoFromDBCurrent_cff')
|
53 |
|
|
# CSC TF
|
54 |
|
|
process.load("EventFilter.CSCTFRawToDigi.csctfunpacker_cfi")
|
55 |
|
|
process.csctfunpacker.producer = cms.InputTag("rawDataCollector")
|
56 |
|
|
|
57 |
|
|
process.schedule=cms.Schedule()
|
58 |
|
|
|
59 |
|
|
if runOnMC:
|
60 |
|
|
process.load("Configuration.StandardSequences.RawToDigi_cff")
|
61 |
|
|
process.load("Configuration.StandardSequences.Reconstruction_cff")
|
62 |
|
|
process.GlobalTag.globaltag = autoCond['startup']
|
63 |
|
|
print "The global tag is ", process.GlobalTag.globaltag
|
64 |
|
|
##------------------ IMPORT MODULES FOR PRECISE MC MATCHING ------------
|
65 |
|
|
if "DEBUG" not in datatype:
|
66 |
|
|
process.load('Configuration/StandardSequences/Services_cff')
|
67 |
|
|
process.load("SimGeneral.MixingModule.mixNoPU_cfi")
|
68 |
|
|
process.load("SimGeneral.TrackingAnalysis.trackingParticles_cfi")
|
69 |
|
|
process.load("Configuration.StandardSequences.Digi_cff")
|
70 |
|
|
#process.load("SimTracker.TrackAssociation.TrackAssociatorByChi2_cfi")
|
71 |
|
|
#process.TrackAssociatorByChi2ESProducer.chi2cut = cms.double(1e9)
|
72 |
|
|
if "SIM" not in datatype and "FEVT" not in datatype:
|
73 |
|
|
process.load('SimG4Core/Application/g4SimHits_cfi')
|
74 |
|
|
process.trackingTruth = cms.Path(process.g4SimHits*cms.SequencePlaceholder("mix")*process.trDigi*process.trackingParticles)
|
75 |
|
|
else:
|
76 |
|
|
process.trackingTruth = cms.Path(cms.SequencePlaceholder("mix")*process.trDigi*process.trackingParticles)
|
77 |
|
|
|
78 |
|
|
if "RAW" not in datatype and "FEVT" not in datatype:
|
79 |
|
|
if After520:
|
80 |
|
|
process.load("SimGeneral.MixingModule.mix_2012_Startup_50ns_PoissonOOTPU_cfi")
|
81 |
|
|
else:
|
82 |
|
|
process.load("SimGeneral.MixingModule.mix_E7TeV_Summer_2011_50ns_PoissonOOT")
|
83 |
|
|
process.load('Configuration.StandardSequences.Digi_cff')
|
84 |
|
|
process.load('Configuration.StandardSequences.SimL1Emulator_cff')
|
85 |
|
|
process.load('Configuration.StandardSequences.DigiToRaw_cff')
|
86 |
|
|
process.load('HLTrigger.Configuration.HLT_GRun_cff')
|
87 |
|
|
HLTProcessName=process._Process__name
|
88 |
|
|
process.CSCHaloData.HLTResultLabel = cms.InputTag("TriggerResults","",HLTProcessName)
|
89 |
|
|
process.simtoraw=cms.Path(process.pdigi*process.SimL1Emulator*process.DigiToRaw)
|
90 |
|
|
process.schedule.extend( [process.simtoraw] )
|
91 |
|
|
process.schedule.extend( process.HLTSchedule )
|
92 |
|
|
else:
|
93 |
|
|
if "DEBUG" not in datatype:# Playback
|
94 |
|
|
del process.RandomNumberGeneratorService.generator
|
95 |
|
|
process.RandomNumberGeneratorService.restoreStateLabel = cms.untracked.string('randomEngineStateProducer')
|
96 |
|
|
process.mix.playback = cms.untracked.bool(True)
|
97 |
|
|
|
98 |
|
|
process.schedule.extend( [process.trackingTruth] )
|
99 |
|
|
|
100 |
|
|
process.load("SimTracker.TrackAssociation.TrackAssociatorByHits_cfi")
|
101 |
|
|
process.TrackAssociatorByHits.Cut_RecoToSim = cms.double(0.5)
|
102 |
|
|
else:
|
103 |
|
|
process.load("Configuration.StandardSequences.RawToDigi_Data_cff")
|
104 |
|
|
if After520:
|
105 |
|
|
process.load("Configuration.StandardSequences.Reconstruction_Data_cff")
|
106 |
|
|
else:
|
107 |
|
|
process.load("Configuration.StandardSequences.Reconstruction_cff")
|
108 |
|
|
process.GlobalTag.globaltag = autoCond['com10']
|
109 |
|
|
#Load bad chambers according to the run numbers
|
110 |
|
|
process.load("CalibMuon.Configuration.getCSCConditions_frontier_cff")
|
111 |
|
|
process.cscConditions.connect='frontier://FrontierProd/CMS_COND_31X_CSC'
|
112 |
|
|
process.cscConditions.toGet = cms.VPSet(cms.PSet(
|
113 |
|
|
record = cms.string('CSCBadChambersRcd'),
|
114 |
|
|
tag = cms.string('CSCBadChambers_RunDependent_offline')
|
115 |
|
|
))
|
116 |
|
|
process.cscConditions.loadAll = cms.bool(True)
|
117 |
|
|
process.cscConditions.timetype = cms.string('runnumber')
|
118 |
|
|
process.cscConditions.DBParameters = cms.PSet(
|
119 |
|
|
authenticationPath = cms.untracked.string('/nfshome0/popcondev/conddb/'),
|
120 |
|
|
authenticationMethod = cms.untracked.uint32(1)
|
121 |
|
|
)
|
122 |
|
|
process.es_prefer_cscConditions = cms.ESPrefer("PoolDBESSource","cscConditions")
|
123 |
|
|
#end of loading bad chambers according to the run numbers
|
124 |
|
|
|
125 |
|
|
if "RECO" in datatype or "FEVT" in datatype:
|
126 |
|
|
process.raw2digiandreconstruction = cms.Path(process.RawToDigi)
|
127 |
|
|
else:
|
128 |
|
|
process.raw2digiandreconstruction = cms.Path(process.RawToDigi*process.reconstruction)
|
129 |
|
|
|
130 |
|
|
process.schedule.extend( [process.raw2digiandreconstruction] )
|
131 |
|
|
|
132 |
|
|
# ecal mapping
|
133 |
|
|
process.load("Geometry.EcalMapping.EcalMapping_cfi")
|
134 |
|
|
|
135 |
|
|
##------------------ IMPORT MODULES NEEDED FOR JPT ------------
|
136 |
|
|
if After520:
|
137 |
|
|
process.load("Configuration.Geometry.GeometryIdeal_cff")
|
138 |
|
|
else:
|
139 |
|
|
process.load("Configuration.StandardSequences.Geometry_cff")
|
140 |
|
|
|
141 |
|
|
from Configuration.StandardSequences.MagneticField_cff import *
|
142 |
|
|
|
143 |
|
|
process.source = cms.Source("PoolSource",
|
144 |
|
|
# fileNames = cms.untracked.vstring("dcap:://pnfs/cms/WAX/11/store/mc/Fall11/DYJetsToEE-MuMu_PtZ-100To300_TuneZ2_7TeV-calchep-pythia/GEN-RAW/PU_S6_START42_V14B-v1/0000/2E0052CC-62B8-E111-ACBE-00261894388F.root")
|
145 |
|
|
# fileNames = cms.untracked.vstring("file:/uscms/home/zhangjin/nobackup/Test_DYToMuMu_M-20_CT10_GEN-SIM-RAW-HLTDEBUG-RECO.root")
|
146 |
|
|
# fileNames = cms.untracked.vstring("file:/uscms/home/zhangjin/nobackup/Test_DYMuMu200_42_RAW.root")
|
147 |
|
|
# fileNames = cms.untracked.vstring("dcap:://pnfs/cms/WAX/11/store/mc/Summer12/QCD_Pt-15to3000_TuneZ2star_Flat_8TeV_pythia6/GEN-SIM-RAW/PU_S7_START52_V9-v5/0000/A6A3E090-B498-E111-A4AB-003048C68AA6.root")
|
148 |
|
|
#fileNames = cms.untracked.vstring("dcap:://pnfs/cms/WAX/11/store/mc/Summer12_DR53X/MinBias_TuneZ2star_8TeV-pythia6/GEN-SIM-RECODEBUG/DEBUG_PU_S10_START53_V7A-v1/0000/A8B78296-D6E0-E111-AD1F-003048678B1A.root")
|
149 |
|
|
#fileNames = cms.untracked.vstring("dcap:://pnfs/cms/WAX/11/store/mc/Summer12/DYToMuMu_M_20_TuneZ2star_8TeV_pythia6/GEN-SIM/START50_V13-v1/0000/001E08EA-EC56-E111-A0C6-002618943915.root")#/DYToMuMu_M-20_CT10_TuneZ2star_8TeV-powheg-pythia6/Summer12-START50_V13-v1/GEN-SIM
|
150 |
|
|
#fileNames = cms.untracked.vstring("dcap:://pnfs/cms/WAX/11/store/mc/Summer12/WJetsToLNu_TuneZ2Star_8TeV-madgraph-tarball/GEN-SIM/START52_V9-v3/0008/FEF6E3F9-FCD3-E111-8322-0025901D0C52.root")#/WJetsToLNu_TuneZ2Star_8TeV-madgraph-tarball/Summer12-START52_V9-v3/GEN-SIM
|
151 |
|
|
#fileNames = cms.untracked.vstring("dcap:://pnfs/cms/WAX/11/store/mc/Summer12/JPsiToMuMu_2MuPtEtaFilter_tuneD6T_8TeV-pythia6-evtgen/GEN-SIM/START52_V9-v3/0001/FEDFAB36-3BF8-E111-9DF6-68B599B94F60.root")#/JPsiToMuMu_2MuPtEtaFilter_tuneD6T_8TeV-pythia6-evtgen/Summer12-START52_V9-v3/GEN-SIM
|
152 |
zhangjin |
1.3 |
fileNames = cms.untracked.vstring("dcap://cmsdca.fnal.gov:24137/pnfs/fnal.gov/usr/cms/WAX/11/store/data/Run2012C/SingleMu/RAW/v1/000/202/016/98D875A0-10F3-E111-B2F2-001D09F2AD84.root")#/SingleMu/Run2012C-v1/RAW
|
153 |
zhangjin |
1.1 |
,skipEvents=cms.untracked.uint32(0)
|
154 |
|
|
)
|
155 |
|
|
#
|
156 |
|
|
# Number of events to be processed...
|
157 |
|
|
#
|
158 |
|
|
process.maxEvents = cms.untracked.PSet(
|
159 |
|
|
input = cms.untracked.int32(-1)
|
160 |
|
|
)
|
161 |
|
|
|
162 |
|
|
process.options = cms.untracked.PSet(
|
163 |
|
|
SkipEvent = cms.untracked.vstring( "Error: uninitialized ProxyBase used" ),
|
164 |
|
|
IgnoreCompletely = cms.untracked.vstring( "ProductNotFound" )
|
165 |
|
|
)
|
166 |
|
|
|
167 |
|
|
from RecoMuon.TrackingTools.MuonSegmentMatcher_cff import *
|
168 |
|
|
process.load("TrackingTools.TrackAssociator.DetIdAssociatorESProducer_cff")
|
169 |
|
|
from TrackingTools.TrackAssociator.default_cfi import *
|
170 |
zhangjin |
1.3 |
from RecoMuon.MuonIsolationProducers.trackExtractorBlocks_cff import MIsoTrackExtractorBlock
|
171 |
zhangjin |
1.1 |
|
172 |
|
|
process.aodDump = cms.EDAnalyzer('TPTrackMuonSys',
|
173 |
|
|
TrackAssociatorParameterBlock,
|
174 |
|
|
MuonSegmentMatcher,
|
175 |
zhangjin |
1.3 |
TrackExtractor=cms.PSet(MIsoTrackExtractorBlock),
|
176 |
zhangjin |
1.1 |
rootFileName = cms.untracked.string('CSCPFG_Ineff_DATA.root'),
|
177 |
|
|
CSCUseTimingCorrections = cms.bool( True ),
|
178 |
|
|
CSCUseGasGainCorrections = cms.bool( True ),
|
179 |
|
|
isMC = cms.untracked.bool(runOnMC),
|
180 |
|
|
mcTag = cms.untracked.InputTag('genParticles'),
|
181 |
|
|
vertexCollection = cms.InputTag('offlinePrimaryVertices'),
|
182 |
|
|
gTracksTag = cms.untracked.InputTag('generalTracks'),
|
183 |
|
|
trackProducer = cms.InputTag('csctfunpacker:'),
|
184 |
|
|
readBadChannels = cms.bool(True),
|
185 |
|
|
readBadChambers = cms.bool(True),
|
186 |
|
|
hltTag = cms.untracked.InputTag("TriggerResults","",HLTProcessName),
|
187 |
|
|
hltEvTag = cms.untracked.InputTag("hltTriggerSummaryAOD","",HLTProcessName),
|
188 |
|
|
HLTMuTrgNames = cms.vstring("HLT_Mu?_v*","HLT_Mu??_v*","HLT_Mu???_v*","HLT_IsoMu?_v*","HLT_IsoMu??_v*","HLT_IsoMu???_v*","HLT_L2Mu?_v*","HLT_L2Mu??_v*","HLT_L2Mu???_v*","HLT_SingleMu*","HLT_L1SingleMu*"),
|
189 |
|
|
HLTDiMuTrgName = cms.string("HLT_DoubleMu?_v*"),
|
190 |
|
|
# hltEvTag = cms.untracked.InputTag("hltTriggerSummaryAOD","","REDIGI36X"),
|
191 |
|
|
L1extraTag = cms.untracked.InputTag("l1extraParticles"),
|
192 |
|
|
dedxTag = cms.untracked.InputTag('dedxHarmonic2')
|
193 |
|
|
)
|
194 |
|
|
|
195 |
|
|
########################################
|
196 |
|
|
process.primaryVertexFilter = cms.EDFilter("VertexSelector",
|
197 |
|
|
src = cms.InputTag("offlinePrimaryVertices"),
|
198 |
|
|
cut = cms.string("!isFake && ndof > 4 && abs(z) <= 24 && position.Rho <= 2"), # tracksSize() > 3 for the older cut
|
199 |
|
|
filter = cms.bool(True), # otherwise it won't filter the events, just produce an empty vertex collection.
|
200 |
|
|
)
|
201 |
|
|
|
202 |
|
|
process.noscraping = cms.EDFilter("FilterOutScraping",
|
203 |
|
|
applyfilter = cms.untracked.bool(True),
|
204 |
|
|
debugOn = cms.untracked.bool(False),
|
205 |
|
|
numtrack = cms.untracked.uint32(10),
|
206 |
|
|
thresh = cms.untracked.double(0.25)
|
207 |
|
|
)
|
208 |
|
|
|
209 |
|
|
process.CSCTFunpacker=cms.Path(process.csctfunpacker)
|
210 |
|
|
process.filtersteps=cms.Path(process.primaryVertexFilter*process.noscraping)
|
211 |
|
|
process.outputstep = cms.EndPath(process.aodDump)
|
212 |
|
|
|
213 |
|
|
process.schedule.extend( [process.CSCTFunpacker,process.filtersteps,process.outputstep] )
|
214 |
|
|
|
215 |
|
|
process.load("FWCore.MessageLogger.MessageLogger_cfi")
|
216 |
|
|
process.MessageLogger.cerr.FwkReport.reportEvery = 1 #quench the message logger (optional)
|
217 |
|
|
process.MessageLogger.cerr_stats.threshold = cms.untracked.string('WARNING')
|
218 |
|
|
"""
|
219 |
|
|
#For DEBUG:
|
220 |
|
|
process.load('Configuration.EventContent.EventContent_cff')
|
221 |
|
|
process.out = cms.OutputModule("PoolOutputModule",
|
222 |
|
|
splitLevel = cms.untracked.int32(0),
|
223 |
|
|
outputCommands = cms.untracked.vstring(
|
224 |
|
|
'drop *_*_*_*',
|
225 |
|
|
'keep *_mix_*_*',
|
226 |
|
|
'keep *_generator_*_*',
|
227 |
|
|
'keep *_randomEngineStateProducer_*_*',
|
228 |
|
|
'keep *_mergedtruth__*',
|
229 |
|
|
'keep *_mergedtruth_*_*',
|
230 |
|
|
'keep *_muons_*_*'
|
231 |
|
|
),
|
232 |
|
|
fileName = cms.untracked.string('MYDEBUG.root'),
|
233 |
|
|
)
|
234 |
|
|
#process.outputstep=cms.EndPath(process.out)
|
235 |
|
|
#process.SimpleMemoryCheck = cms.Service("SimpleMemoryCheck",moduleMemorySummary = cms.untracked.bool(True))
|
236 |
|
|
if After520:
|
237 |
|
|
process.highlevelreco=cms.Sequence(process.egammaHighLevelRecoPrePF*
|
238 |
|
|
process.particleFlowReco*
|
239 |
|
|
process.egammaHighLevelRecoPostPF*
|
240 |
|
|
process.regionalCosmicTracksSeq*
|
241 |
|
|
process.muoncosmichighlevelreco*
|
242 |
|
|
process.muonshighlevelreco*
|
243 |
|
|
process.particleFlowLinks)
|
244 |
|
|
else:
|
245 |
|
|
process.highlevelreco=cms.Sequence(process.egammaHighLevelRecoPrePF*
|
246 |
|
|
process.particleFlowReco*
|
247 |
|
|
process.egammaHighLevelRecoPostPF)
|
248 |
|
|
process.reconstruction = cms.Sequence(process.localreco*process.globalreco*process.highlevelreco)
|
249 |
|
|
"""
|