/ElectroWeakAnalysis/Utilities/test/distPFMuMET.py

https://github.com/aivanov-cern/cmssw · Python · 166 lines · 95 code · 51 blank · 20 comment · 0 complexity · f5babf64263a97928137d6f8ab01466f MD5 · raw file

  1. import FWCore.ParameterSet.Config as cms
  2. process = cms.Process("REPROD")
  3. # mm
  4. # mm
  5. # mm
  6. # GEN-REC muon matching
  7. process.genMatchMap = cms.EDFilter("MCTruthDeltaRMatcherNew",
  8. src = cms.InputTag("muons"),
  9. matched = cms.InputTag("genParticles"),
  10. distMin = cms.double(0.15),
  11. matchPDGId = cms.vint32(13)
  12. )
  13. # Create a new "distorted" PFCandidate collection
  14. process.distortedPFCand = cms.EDFilter("DistortedPFCandProducer",
  15. MuonTag = cms.untracked.InputTag("muons"),
  16. PFTag = cms.untracked.InputTag("particleFlow"),
  17. GenMatchTag = cms.untracked.InputTag("genMatchMap"),
  18. EtaBinEdges = cms.untracked.vdouble(-3.,3.), # one more entry than next vectors
  19. ShiftOnOneOverPt = cms.untracked.vdouble(1.e-3), #in [1/GeV] units
  20. RelativeShiftOnPt = cms.untracked.vdouble(0.), # relative
  21. UncertaintyOnOneOverPt = cms.untracked.vdouble(3.e-3), #in [1/GeV] units
  22. RelativeUncertaintyOnPt = cms.untracked.vdouble(3.e-3), # relative
  23. EfficiencyRatioOverMC = cms.untracked.vdouble(1.)
  24. )
  25. # Create the old distortedMuon collection
  26. process.distortedMuons = cms.EDFilter("DistortedMuonProducer",
  27. MuonTag = cms.untracked.InputTag("muons"),
  28. GenMatchTag = cms.untracked.InputTag("genMatchMap"),
  29. EtaBinEdges = cms.untracked.vdouble(-3.,3.), # one more entry than next vectors
  30. ShiftOnOneOverPt = cms.untracked.vdouble(1.e-3), #in [1/GeV] units
  31. RelativeShiftOnPt = cms.untracked.vdouble(0.), # relative
  32. UncertaintyOnOneOverPt = cms.untracked.vdouble(3.e-3), #in [1/GeV] units
  33. RelativeUncertaintyOnPt = cms.untracked.vdouble(3.e-3), # relative
  34. EfficiencyRatioOverMC = cms.untracked.vdouble(1.)
  35. )
  36. # mm
  37. # mm
  38. # mm
  39. process.load("Configuration.StandardSequences.Reconstruction_cff")
  40. process.load("Configuration.StandardSequences.MagneticField_cff")
  41. process.load("Configuration.StandardSequences.Geometry_cff")
  42. process.load('Configuration/StandardSequences/FrontierConditions_GlobalTag_cff')
  43. process.GlobalTag.globaltag = 'START3X_V26A::All'
  44. #process.load("Configuration.StandardSequences.FakeConditions_cff")
  45. # process.Timing =cms.Service("Timing")
  46. process.maxEvents = cms.untracked.PSet(
  47. input = cms.untracked.int32(-1)
  48. )
  49. process.source = cms.Source(
  50. "PoolSource",
  51. fileNames = cms.untracked.vstring(
  52. # 'file:/data4/Wmunu_Summer09-MC_31X_V3-v1_GEN-SIM-RECO/0009/76E35258-507F-DE11-9A21-0022192311C5.root'
  53. '/store/mc/Spring10/MinBias/GEN-SIM-RECO/START3X_V26A_356ReReco-v1/0009/FEFC70B6-F53D-DF11-B57E-003048679150.root'
  54. ),
  55. secondaryFileNames = cms.untracked.vstring(),
  56. noEventSort = cms.untracked.bool(True),
  57. duplicateCheckMode = cms.untracked.string('noDuplicateCheck')
  58. )
  59. #process.MessageLogger = cms.Service("MessageLogger",
  60. # rectoblk = cms.untracked.PSet(
  61. # threshold = cms.untracked.string('INFO')
  62. # ),
  63. # destinations = cms.untracked.vstring('rectoblk')
  64. #)
  65. process.dump = cms.EDAnalyzer("EventContentAnalyzer")
  66. process.load("ElectroWeakAnalysis.Utilities.distPFMET_cfi")
  67. process.p1 = cms.Path(process.genMatchMap+process.distortedMuons
  68. +process.distortedPFCand+process.distpfMet)
  69. # And the output.
  70. process.out = cms.OutputModule("PoolOutputModule",
  71. fileName = cms.untracked.string('PFMuMETevents.root')
  72. )
  73. process.out.outputCommands = cms.untracked.vstring( 'drop *' )
  74. process.out.outputCommands.extend(cms.untracked.vstring('keep *_genParticles_*_*'))
  75. process.out.outputCommands.extend(cms.untracked.vstring('keep *_offlineBeamSpot_*_*'))
  76. process.out.outputCommands.extend(cms.untracked.vstring('keep *_TriggerResults_*_HLT'))
  77. process.out.outputCommands.extend(cms.untracked.vstring('keep *_hltTriggerSummaryAOD_*_HLT'))
  78. process.out.outputCommands.extend(cms.untracked.vstring('keep *_muons_*_*'))
  79. process.out.outputCommands.extend(cms.untracked.vstring('keep *_particleFlow_*_*'))
  80. process.out.outputCommands.extend(cms.untracked.vstring('keep *_distortedMuons_*_*'))
  81. process.out.outputCommands.extend(cms.untracked.vstring('keep *_distortedPFCand_*_*'))
  82. process.out.outputCommands.extend(cms.untracked.vstring('keep recoTracks_globalMuons_*_*'))
  83. process.out.outputCommands.extend(cms.untracked.vstring('keep recoTracks_standAloneMuons_*_*'))
  84. process.out.outputCommands.extend(cms.untracked.vstring('keep *_met_*_*'))
  85. process.out.outputCommands.extend(cms.untracked.vstring('keep *_corMetGlobalMuons_*_*'))
  86. process.out.outputCommands.extend(cms.untracked.vstring('keep *_tcMet_*_*'))
  87. process.out.outputCommands.extend(cms.untracked.vstring('keep *_pfMet_*_*'))
  88. process.out.outputCommands.extend(cms.untracked.vstring('keep *_distpfMet_*_*'))
  89. process.out.outputCommands.extend(cms.untracked.vstring('keep *_ak5CaloJets_*_*'))
  90. process.outpath = cms.EndPath(process.out)
  91. # And the logger
  92. process.load("FWCore.MessageLogger.MessageLogger_cfi")
  93. process.options = cms.untracked.PSet(
  94. makeTriggerResults = cms.untracked.bool(True),
  95. wantSummary = cms.untracked.bool(True),
  96. Rethrow = cms.untracked.vstring('Unknown',
  97. 'ProductNotFound',
  98. 'DictionaryNotFound',
  99. 'InsertFailure',
  100. 'Configuration',
  101. 'LogicError',
  102. 'UnimplementedFeature',
  103. 'InvalidReference',
  104. 'NullPointerError',
  105. 'NoProductSpecified',
  106. 'EventTimeout',
  107. 'EventCorruption',
  108. 'ModuleFailure',
  109. 'ScheduleExecutionFailure',
  110. 'EventProcessorFailure',
  111. 'FileInPathError',
  112. 'FatalRootError',
  113. 'NotFound')
  114. )
  115. process.MessageLogger.cerr.FwkReport.reportEvery = 1