CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/DPGAnalysis/Skims/python/ZmmgSkim_cff.py

Go to the documentation of this file.
00001 '''
00002 Defines the selection sequence ZmmgSkimSeq for the Zmmg skim for the 
00003 RAW-RECO event content. It also defines several other modules and sequences
00004 used: 
00005     ZmmgHLTFilter
00006     ZmmgTrailingMuons
00007     ZmmgLeadingMuons
00008     ZmmgDimuons
00009     ZmmgDimuonFilter
00010     ZmmgDimuonSequence
00011     ZmmgMergedSuperClusters
00012     ZmmgPhotonCandidates
00013     ZmmgPhotons
00014     ZmmgPhotonSequence
00015     ZmmgCandidates
00016     ZmmgFilter
00017     ZmmgSequence
00018 
00019 Jan Veverka, Caltech, 5 May 2012
00020 '''
00021 
00022 import copy
00023 import FWCore.ParameterSet.Config as cms
00024 
00025 
00026 ###____________________________________________________________________________
00027 ###
00028 ###  HLT Filter
00029 ###____________________________________________________________________________
00030 
00031 import copy
00032 from HLTrigger.HLTfilters.hltHighLevel_cfi import *
00033 ZmmgHLTFilter = copy.deepcopy(hltHighLevel)
00034 ZmmgHLTFilter.throw = cms.bool(False)
00035 ZmmgHLTFilter.HLTPaths = ['HLT_Mu*','HLT_IsoMu*','HLT_DoubleMu*']
00036 
00037 
00038 ###____________________________________________________________________________
00039 ###
00040 ###  Build the Dimuon Sequence
00041 ###____________________________________________________________________________
00042 
00043 ### Get muons of needed quality for Z -> mumugamma 
00044 ZmmgTrailingMuons = cms.EDFilter('MuonSelector',
00045     src = cms.InputTag('muons'),
00046     cut = cms.string('''pt > 10 && 
00047                         abs(eta) < 2.4 && 
00048                         isGlobalMuon = 1 && 
00049                         isTrackerMuon = 1 && 
00050                         abs(innerTrack().dxy)<2.0'''),
00051     filter = cms.bool(True)                                
00052     )
00053 
00054 ### Require a harder pt cut on the leading leg
00055 ZmmgLeadingMuons = cms.EDFilter('MuonSelector',
00056     src = cms.InputTag('ZmmgTrailingMuons'),
00057     cut = cms.string('pt > 20'),
00058     filter = cms.bool(True)                                
00059     )
00060 
00061 ### Build dimuon candidates
00062 ZmmgDimuons = cms.EDProducer('CandViewShallowCloneCombiner',
00063     decay = cms.string('ZmmgLeadingMuons@+ ZmmgTrailingMuons@-'),
00064     checkCharge = cms.bool(True),
00065     cut = cms.string('mass > 30'),
00066     )
00067 
00068 ### Require at least one dimuon candidate
00069 ZmmgDimuonFilter = cms.EDFilter('CandViewCountFilter',
00070     src = cms.InputTag('ZmmgDimuons'),
00071     minNumber = cms.uint32(1)
00072     )
00073 
00074 ### Put together the dimuon sequence
00075 ZmmgDimuonSequence = cms.Sequence(
00076     ZmmgTrailingMuons *
00077     ZmmgLeadingMuons *
00078     ZmmgDimuons *
00079     ZmmgDimuonFilter
00080     )
00081     
00082     
00083 ###____________________________________________________________________________
00084 ###
00085 ###  Build the Supercluster/Photon Sequence
00086 ###____________________________________________________________________________
00087 
00088 ### Merge the barrel and endcap superclusters
00089 ZmmgMergedSuperClusters =  cms.EDProducer('EgammaSuperClusterMerger',
00090     src = cms.VInputTag(
00091         cms.InputTag('correctedHybridSuperClusters'),
00092         cms.InputTag('correctedMulti5x5SuperClustersWithPreshower')
00093         )
00094     )
00095 
00096 ### Build candidates from all the merged superclusters
00097 ZmmgPhotonCandidates = cms.EDProducer('ConcreteEcalCandidateProducer',
00098     src = cms.InputTag('ZmmgMergedSuperClusters'),
00099     particleType = cms.string('gamma')
00100     )
00101 
00102 ### Select photon candidates with Et > 5 GeV
00103 ZmmgPhotons = cms.EDFilter('CandViewSelector',
00104     src = cms.InputTag('ZmmgPhotonCandidates'),
00105     cut = cms.string('et > 5'),
00106     filter = cms.bool(True)
00107     )
00108 
00109 ### Put together the photon sequence
00110 ZmmgPhotonSequence = cms.Sequence(
00111     ZmmgMergedSuperClusters *
00112     ZmmgPhotonCandidates *
00113     ZmmgPhotons
00114     )
00115     
00116     
00117 ###____________________________________________________________________________
00118 ###
00119 ###  Build the mu-mu-gamma filter sequence
00120 ###____________________________________________________________________________
00121 
00122 ### Combine dimuons and photons to mumugamma candidates requiring
00123 ###     1. trailing muon pt + photon et > 20 GeV
00124 ###     2. distance between photon and near muon deltaR < 1.5
00125 ###     3. sum of invariant masses of the mmg and mm systems < 200 GeV 
00126 ###     4. invariant mass of the mmg system > 40 GeV
00127 ### dimuon        = daughter(0)
00128 ### leading muon  = daughter(0).daughter(0)
00129 ### trailing muon = daughter(0).daughter(1)
00130 ### photon        = daughter(1)
00131 ZmmgCandidates = cms.EDProducer('CandViewShallowCloneCombiner',
00132     decay = cms.string('ZmmgDimuons ZmmgPhotons'),
00133     checkCharge = cms.bool(False),
00134     cut = cms.string('''
00135         daughter(0).daughter(1).pt + daughter(1).pt > 20 &
00136         min(deltaR(daughter(0).daughter(0).eta,
00137                    daughter(0).daughter(0).phi,
00138                    daughter(1).eta,
00139                    daughter(1).phi),
00140             deltaR(daughter(0).daughter(1).eta,
00141                    daughter(0).daughter(1).phi,
00142                    daughter(1).eta,
00143                    daughter(1).phi)) < 1.5 &
00144         mass + daughter(0).mass < 200 &
00145         mass > 40
00146         '''),
00147     )
00148     
00149 ### Require at least one mu-mu-gamma candidate passing the cuts
00150 ZmmgFilter = cms.EDFilter('CandViewCountFilter',
00151     src = cms.InputTag('ZmmgCandidates'),
00152     minNumber = cms.uint32(1)
00153     )
00154     
00155 ZmmgSequence = cms.Sequence(
00156     ZmmgCandidates *
00157     ZmmgFilter
00158     )
00159 
00160 
00161 ###____________________________________________________________________________
00162 ###
00163 ###  Build the full selection sequence for the ZMuMuGammaSkim
00164 ###____________________________________________________________________________
00165 
00166 ZmmgSkimSeq = cms.Sequence(
00167     ZmmgHLTFilter *
00168     ZmmgDimuonSequence *
00169     ZmmgPhotonSequence *
00170     ZmmgSequence
00171     )
00172