PageRenderTime 37ms CodeModel.GetById 13ms app.highlight 18ms RepoModel.GetById 1ms app.codeStats 0ms

/ElectroWeakAnalysis/Utilities/test/distortedMuons.py

https://github.com/aivanov-cern/cmssw
Python | 79 lines | 51 code | 13 blank | 15 comment | 0 complexity | 3a18dd17cc3679add539dbc2c1bc86de MD5 | raw file
 1import FWCore.ParameterSet.Config as cms
 2
 3# Process, how many events, inout files, ...
 4process = cms.Process("distortMuons")
 5
 6process.maxEvents = cms.untracked.PSet(
 7      input = cms.untracked.int32(-1)
 8      #input = cms.untracked.int32(100)
 9)
10process.source = cms.Source("PoolSource",
11      #fileNames = cms.untracked.vstring("file:/data4/Wmunu_Summer09-MC_31X_V3-v1_GEN-SIM-RECO/0009/76E35258-507F-DE11-9A21-0022192311C5.root")
12      fileNames = cms.untracked.vstring("file:/data4/Wmunu_Summer09-MC_31X_V3_AODSIM-v1/0009/F82D4260-507F-DE11-B5D6-00093D128828.root")
13)
14
15# Debug/info printouts
16process.MessageLogger = cms.Service("MessageLogger",
17      debugModules = cms.untracked.vstring('distortedMuons'),
18      cout = cms.untracked.PSet(
19            default = cms.untracked.PSet( limit = cms.untracked.int32(1000) ),
20            #threshold = cms.untracked.string('INFO')
21            threshold = cms.untracked.string('DEBUG')
22      ),
23      destinations = cms.untracked.vstring('cout')
24)
25
26# GEN-REC muon matching
27process.genMatchMap = cms.EDFilter("MCTruthDeltaRMatcherNew",
28    src = cms.InputTag("muons"),
29    matched = cms.InputTag("genParticles"),
30    distMin = cms.double(0.15),
31    matchPDGId = cms.vint32(13)
32)
33
34# Create a new "distorted" Muon collection
35process.distortedMuons = cms.EDFilter("DistortedMuonProducer",
36      MuonTag = cms.untracked.InputTag("muons"),
37      GenMatchTag = cms.untracked.InputTag("genMatchMap"),
38
39      EtaBinEdges = cms.untracked.vdouble(-2.1,2.1), # one more entry than next vectors
40
41      ShiftOnOneOverPt = cms.untracked.vdouble(1.e-3), #in [1/GeV] units
42      RelativeShiftOnPt = cms.untracked.vdouble(0.), # relative
43      UncertaintyOnOneOverPt = cms.untracked.vdouble(2.e-3), #in [1/GeV] units
44      RelativeUncertaintyOnPt = cms.untracked.vdouble(5.e-3), # relative
45
46      EfficiencyRatioOverMC = cms.untracked.vdouble(0.90)
47)
48
49### NOTE: the following WMN selectors require the presence of
50### the libraries and plugins fron the ElectroWeakAnalysis/WMuNu package
51### So you need to process the ElectroWeakAnalysis/WMuNu package with
52### some old CMSSW versions (at least <=3_1_2, <=3_3_0_pre4)
53#
54
55# WMN fast selector (use W candidates in this example)
56process.load("ElectroWeakAnalysis.WMuNu.WMuNuSelection_cff")
57process.corMetWMuNus.MuonTag = cms.untracked.InputTag("distortedMuons")
58process.selcorMet.MuonTag = cms.untracked.InputTag("distortedMuons")
59
60# Output
61process.load("Configuration.EventContent.EventContent_cff")
62process.AODSIMEventContent.outputCommands.append('keep *_distortedMuons_*_*')
63process.myEventContent = process.AODSIMEventContent
64process.wmnOutput = cms.OutputModule("PoolOutputModule",
65      process.myEventContent,
66      SelectEvents = cms.untracked.PSet(
67            SelectEvents = cms.vstring('distortMuons')
68      ),
69      fileName = cms.untracked.string('selectedEvents.root')
70)
71
72# Steering the process
73process.distortMuons = cms.Path(
74       process.genMatchMap
75      *process.distortedMuons
76      *process.selectCaloMetWMuNus
77)
78
79process.end = cms.EndPath(process.wmnOutput)