File indexing completed on 2024-04-06 12:24:15
0001 import FWCore.ParameterSet.Config as cms
0002
0003 process = cms.Process("TagProbe")
0004
0005
0006
0007
0008
0009
0010
0011 process.load('FWCore.MessageService.MessageLogger_cfi')
0012 process.options = cms.untracked.PSet( wantSummary = cms.untracked.bool(True) )
0013 process.MessageLogger.cerr.FwkReport.reportEvery = 100
0014
0015 process.source = cms.Source("PoolSource",
0016 fileNames = cms.untracked.vstring(
0017 'file:/afs/cern.ch/user/g/gpetrucc/scratch0/huntForRedOctober/CMSSW_3_1_3/src/JPsiMuMu_Skim.root'
0018 )
0019 )
0020 process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
0021
0022 process.load("SimGeneral.HepPDTESSource.pythiapdt_cfi")
0023 process.load("Configuration.StandardSequences.MagneticField_cff")
0024 process.load("Configuration.StandardSequences.GeometryDB_cff")
0025 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
0026 process.load("Geometry.CommonTopologies.globalTrackingGeometry_cfi")
0027 process.load("TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAny_cfi")
0028 process.load("TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorAlong_cfi")
0029 process.load("TrackPropagation.SteppingHelixPropagator.SteppingHelixPropagatorOpposite_cfi")
0030 process.GlobalTag.globaltag = cms.string( autoCond[ 'phase1_2022_realistic' ] )
0031
0032
0033
0034
0035
0036
0037
0038
0039 TRACK_CUTS="track.numberOfValidHits >= 10 && track.normalizedChi2 < 5 && abs(track.d0) < 2 && abs(track.dz) < 30"
0040 process.betterTracks = cms.EDFilter("TrackSelector",
0041 src = cms.InputTag("goodTracks"),
0042 cut = cms.string(TRACK_CUTS.replace("track.","")),
0043 )
0044 process.tkTracks = cms.EDProducer("ConcreteChargedCandidateProducer",
0045 src = cms.InputTag("betterTracks"),
0046 particleType = cms.string("mu+"),
0047 )
0048 process.tkProbes = cms.EDProducer("CandViewRefSelector",
0049 src = cms.InputTag("tkTracks"),
0050 cut = cms.string("pt > 3 && abs(eta) < 2.4"),
0051 )
0052
0053
0054
0055
0056
0057
0058
0059
0060 process.staTracks = cms.EDProducer("ConcreteChargedCandidateProducer",
0061 src = cms.InputTag("standAloneMuons","UpdatedAtVtx"),
0062 particleType = cms.string("mu+"),
0063 )
0064 process.staProbes = cms.EDProducer("CandViewRefSelector",
0065 src = cms.InputTag("staTracks"),
0066 cut = cms.string("pt > 3 && abs(eta) < 2.4"),
0067 )
0068
0069
0070
0071
0072
0073
0074
0075
0076 PASS_HLT = "!triggerObjectMatchesByPath('%s').empty()" % ("HLT_Mu3",);
0077 process.tagMuons = cms.EDFilter("PATMuonRefSelector",
0078 src = cms.InputTag("patMuons"),
0079 cut = cms.string("isGlobalMuon && pt > 3 && abs(eta) < 2.4 && " + TRACK_CUTS + " && " +PASS_HLT ),
0080 )
0081 process.glbMuons = cms.EDFilter("PATMuonRefSelector",
0082 src = cms.InputTag("patMuons"),
0083 cut = cms.string("isGlobalMuon && "+TRACK_CUTS),
0084 )
0085 process.glbProbes = cms.EDFilter("PATMuonRefSelector",
0086 src = cms.InputTag("patMuons"),
0087 cut = cms.string("isGlobalMuon && pt > 3 && abs(eta) < 2.1 && " + TRACK_CUTS),
0088 )
0089
0090
0091 process.allTagsAndProbes = cms.Sequence(
0092 process.tagMuons +
0093 process.betterTracks * process.tkTracks * process.tkProbes +
0094 process.staTracks * process.staProbes +
0095 process.glbMuons * process.glbProbes
0096 )
0097
0098
0099
0100
0101
0102
0103
0104
0105 process.tkToGlbMatch = cms.EDProducer("MatcherUsingTracks",
0106 src = cms.InputTag("tkTracks"),
0107 matched = cms.InputTag("glbMuons"),
0108 algorithm = cms.string("byDirectComparison"),
0109 srcTrack = cms.string("tracker"),
0110 srcState = cms.string("atVertex"),
0111 matchedTrack = cms.string("tracker"),
0112 matchedState = cms.string("atVertex"),
0113 maxDeltaR = cms.double(0.01),
0114 maxDeltaLocalPos = cms.double(0.01),
0115 maxDeltaPtRel = cms.double(0.01),
0116 sortBy = cms.string("deltaR"),
0117 )
0118 process.tkPassingGlb = cms.EDProducer("MatchedCandidateSelector",
0119 src = cms.InputTag("tkProbes"),
0120 match = cms.InputTag("tkToGlbMatch"),
0121 )
0122
0123
0124
0125
0126
0127
0128
0129 process.staToTkMatch = cms.EDProducer("MatcherUsingTracks",
0130 src = cms.InputTag("staTracks"),
0131 matched = cms.InputTag("tkTracks"),
0132 algorithm = cms.string("byDirectComparison"),
0133 srcTrack = cms.string("tracker"),
0134 srcState = cms.string("atVertex"),
0135 matchedTrack = cms.string("tracker"),
0136 matchedState = cms.string("atVertex"),
0137 maxDeltaR = cms.double(1.),
0138 maxDeltaEta = cms.double(0.2),
0139 maxDeltaLocalPos = cms.double(100),
0140 maxDeltaPtRel = cms.double(3),
0141 sortBy = cms.string("deltaR"),
0142 )
0143 process.staPassingTk = cms.EDProducer("MatchedCandidateSelector",
0144 src = cms.InputTag("staProbes"),
0145 match = cms.InputTag("staToTkMatch"),
0146 )
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156 process.glbPassingHltMu3 = cms.EDFilter("PATMuonRefSelector",
0157 src = cms.InputTag("patMuons"),
0158 cut = cms.string(process.glbProbes.cut.value() + " && " + PASS_HLT),
0159 )
0160
0161
0162
0163 process.allPassingProbes = cms.Sequence(
0164 process.tkToGlbMatch * process.tkPassingGlb +
0165 process.staToTkMatch * process.staPassingTk +
0166 process.glbPassingHltMu3
0167 )
0168
0169
0170
0171
0172
0173
0174
0175
0176
0177 process.tpGlbTk = cms.EDProducer("CandViewShallowCloneCombiner",
0178 decay = cms.string("tagMuons@+ tkProbes@-"),
0179 cut = cms.string("2.5 < mass < 3.8"),
0180 )
0181 process.tpGlbSta = cms.EDProducer("CandViewShallowCloneCombiner",
0182 decay = cms.string("tagMuons@+ staProbes@-"),
0183 cut = cms.string("2 < mass < 5"),
0184 )
0185 process.tpGlbGlb = cms.EDProducer("CandViewShallowCloneCombiner",
0186 decay = cms.string("tagMuons@+ glbProbes@-"),
0187 cut = cms.string("2.5 < mass < 3.8"),
0188 )
0189 process.allTPPairs = cms.Sequence(process.tpGlbTk + process.tpGlbSta + process.tpGlbGlb)
0190
0191
0192
0193
0194
0195
0196
0197 process.muMcMatch = cms.EDFilter("MCTruthDeltaRMatcherNew",
0198 pdgId = cms.vint32(13),
0199 src = cms.InputTag("patMuons"),
0200 distMin = cms.double(0.3),
0201 matched = cms.InputTag("genMuons")
0202 )
0203 process.tkMcMatch = process.muMcMatch.clone(src = "tkTracks")
0204 process.staMcMatch = process.muMcMatch.clone(src = "staTracks", distMin = 0.6)
0205
0206 process.allMcMatches = cms.Sequence(process.muMcMatch + process.tkMcMatch + process.staMcMatch)
0207
0208
0209
0210
0211
0212
0213
0214
0215
0216 recoCommonStuff = cms.PSet(
0217 variables = cms.PSet(
0218 eta = cms.string("eta()"),
0219 pt = cms.string("pt()"),
0220 phi = cms.string("phi()"),
0221 hits = cms.string("track.numberOfValidHits"),
0222 )
0223 )
0224 mcTruthCommonStuff = cms.PSet(
0225 isMC = cms.bool(True),
0226 makeMCUnbiasTree = cms.bool(True),
0227 checkMotherInUnbiasEff = cms.bool(True),
0228 tagMatches = cms.InputTag("muMcMatch"),
0229 motherPdgId = cms.int32(443),
0230 )
0231
0232
0233
0234 process.fitGlbFromTk = cms.EDAnalyzer("TagProbeFitTreeProducer",
0235
0236 recoCommonStuff, mcTruthCommonStuff,
0237
0238 tagProbePairs = cms.InputTag("tpGlbTk"),
0239 arbitration = cms.string("OneProbe"),
0240
0241 flags = cms.PSet(
0242 passing = cms.InputTag("tkPassingGlb"),
0243 ),
0244
0245 probeMatches = cms.InputTag("tkMcMatch"),
0246 allProbes = cms.InputTag("tkProbes"),
0247 )
0248
0249
0250
0251 process.fitTkFromSta = cms.EDAnalyzer("TagProbeFitTreeProducer",
0252
0253 recoCommonStuff, mcTruthCommonStuff,
0254
0255 tagProbePairs = cms.InputTag("tpGlbSta"),
0256 arbitration = cms.string("OneProbe"),
0257
0258 flags = cms.PSet(
0259 passing = cms.InputTag("staPassingTk"),
0260 ),
0261
0262 probeMatches = cms.InputTag("staMcMatch"),
0263 allProbes = cms.InputTag("staProbes"),
0264 )
0265
0266
0267
0268
0269 process.fitHltFromGlb = cms.EDAnalyzer("TagProbeFitTreeProducer",
0270
0271 recoCommonStuff, mcTruthCommonStuff,
0272
0273 tagProbePairs = cms.InputTag("tpGlbGlb"),
0274 arbitration = cms.string("OneProbe"),
0275
0276 flags = cms.PSet(
0277
0278 passing = cms.string("!triggerObjectMatchesByPath('HLT_Mu3').empty()"),
0279 ),
0280
0281 probeMatches = cms.InputTag("muMcMatch"),
0282 allProbes = cms.InputTag("glbProbes"),
0283 )
0284
0285
0286 process.allTPHistos = cms.Sequence(
0287 process.allTPPairs +
0288 process.fitGlbFromTk +
0289 process.fitTkFromSta +
0290 process.fitHltFromGlb
0291 )
0292
0293
0294
0295
0296
0297
0298
0299 process.tagAndProbe = cms.Path(
0300 process.allTagsAndProbes *
0301 process.allPassingProbes *
0302 process.allMcMatches *
0303 process.allTPHistos
0304 )
0305
0306 process.TFileService = cms.Service("TFileService", fileName = cms.string("testTagProbeFitTreeProducer_JPsi.root"))
0307
0308
0309
0310