Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:33:23

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 process = cms.Process("TagProbe")
0004 
0005 process.load('FWCore.MessageService.MessageLogger_cfi')
0006 process.options   = cms.untracked.PSet(
0007     wantSummary = cms.untracked.bool(True),
0008 )
0009 process.MessageLogger.cerr.FwkReport.reportEvery = 100
0010 
0011 process.source = cms.Source("PoolSource", 
0012     fileNames = cms.untracked.vstring('file:ZMM_7TeV_cfi_py_GEN.root'),
0013 )
0014 process.maxEvents = cms.untracked.PSet(
0015     input = cms.untracked.int32(-1),
0016 )    
0017 
0018 # Convert genParticles to PATobjects
0019 process.load("PhysicsTools.PatAlgos.producersLayer1.genericParticleProducer_cfi")
0020 process.patGenericParticles.src = cms.InputTag("genParticles")
0021 
0022 # Tag collection
0023 process.tags = cms.EDProducer("PATGenericParticleRefSelector",
0024     src = cms.InputTag("patGenericParticles"),
0025     cut = cms.string("abs(pdgId) = 13 & status = 1 & phi>0")
0026 )
0027 
0028 # Probe collection
0029 process.probes = cms.EDProducer("PATGenericParticleRefSelector",
0030     src = cms.InputTag("patGenericParticles"),
0031     cut = cms.string("status = 1"), # make some background
0032 )
0033 
0034 # Tag and Probe pairs
0035 process.tagProbePairs = cms.EDProducer("CandViewShallowCloneCombiner",
0036     decay = cms.string("tags@+ probes@-"), # charge coniugate states are implied
0037     cut   = cms.string("40 < mass"),
0038 )
0039 
0040 # Make the fit tree and save it in the "MuonID" directory
0041 process.MuonID = cms.EDAnalyzer("TagProbeFitTreeProducer",
0042     tagProbePairs = cms.InputTag("tagProbePairs"),
0043     arbitration   = cms.string("None"),
0044     variables = cms.PSet(
0045         pt  = cms.string("pt"),
0046         eta = cms.string("eta"),
0047     ),
0048     flags = cms.PSet(
0049         muon = cms.string("((abs(pdgId) = 13) & phi>0) | (abs(pdgId) != 13 & phi>2)"),
0050     ),
0051     isMC = cms.bool(False),
0052     tagMatches = cms.InputTag("muMcMatch"),
0053     probeMatches  = cms.InputTag("muMcMatch"),
0054     motherPdgId = cms.int32(443),
0055     makeMCUnbiasTree = cms.bool(False),
0056     #checkMotherInUnbiasEff = cms.bool(True),
0057     #allProbes     = cms.InputTag("trkProbes"),
0058     addRunLumiInfo = cms.bool(True),
0059 )
0060 
0061 process.tagAndProbe = cms.Path( 
0062     process.patGenericParticles * 
0063     process.tags *
0064     process.probes *
0065     process.tagProbePairs * 
0066     process.MuonID
0067 )
0068 
0069 process.TFileService = cms.Service("TFileService", fileName = cms.string("testTagProbeFitTreeProducer_GEN.root"))