Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:58:38

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 #HLTPath = "HLT_Ele*"
0004 #HLTProcessName = "HLT"
0005 myEleCollection =  cms.InputTag("gedGsfElectrons")
0006 
0007 MinEleNumberFilter = cms.EDFilter("CandViewCountFilter",
0008                                   src = myEleCollection,
0009                                   minNumber = cms.uint32(1)
0010                                   )
0011 
0012 ##    ____      __ _____ _           _                   
0013 ##   / ___|___ / _| ____| | ___  ___| |_ _ __ ___  _ __  
0014 ##  | |  _/ __| |_|  _| | |/ _ \/ __| __| '__/ _ \| '_ \ 
0015 ##  | |_| \__ \  _| |___| |  __/ (__| |_| | | (_) | | | |
0016 ##   \____|___/_| |_____|_|\___|\___|\__|_|  \___/|_| |_|
0017 ##  
0018 #  GsfElectron ################ 
0019 
0020 GsfMatchedPhotonCands = cms.EDProducer("ElectronMatchedCandidateProducer",
0021    src     = cms.InputTag("goodPhotons"),
0022    ReferenceElectronCollection = cms.untracked.InputTag("goodElectrons"),
0023    deltaR =  cms.untracked.double(0.3)
0024 )
0025 
0026 
0027 
0028                          
0029 ##    _____     _                         __  __       _       _     _             
0030 ##   |_   _| __(_) __ _  __ _  ___ _ __  |  \/  | __ _| |_ ___| |__ (_)_ __   __ _ 
0031 ##     | || '__| |/ _` |/ _` |/ _ \ '__| | |\/| |/ _` | __/ __| '_ \| | '_ \ / _` |
0032 ##     | || |  | | (_| | (_| |  __/ |    | |  | | (_| | || (__| | | | | | | | (_| |
0033 ##     |_||_|  |_|\__, |\__, |\___|_|    |_|  |_|\__,_|\__\___|_| |_|_|_| |_|\__, |
0034 ##                |___/ |___/                                                |___/ 
0035 ##   
0036 # Trigger  ##################
0037 #PassingHLT = cms.EDProducer("trgMatchGsfElectronProducer",    
0038 #    InputProducer = myEleCollection,
0039 #    hltTags = cms.untracked.string( HLTPath ),
0040 #    triggerEventTag = cms.untracked.InputTag("hltTriggerSummaryAOD","",HLTProcessName),
0041 #    triggerResultsTag = cms.untracked.InputTag("TriggerResults","",HLTProcessName)   
0042 #)
0043 
0044 
0045 
0046 import HLTrigger.HLTfilters.hltHighLevel_cfi
0047 ZSCHltFilter = HLTrigger.HLTfilters.hltHighLevel_cfi.hltHighLevel.clone(
0048     throw = cms.bool(False),
0049     HLTPaths = ['HLT_Ele27_CaloIdT_CaloIsoVL_TrkIdVL_TrkIsoVL_Ele15_CaloIdT_CaloIsoVL_trackless_v*']
0050     )
0051 
0052 # elecMetSeq = cms.Sequence( WEnuHltFilter * ele_sequence * elecMetFilter )
0053 
0054 ###MC check efficiency
0055 genEleFromZ = cms.EDFilter("CandViewSelector",
0056                               src = cms.InputTag("genParticles"),
0057                               cut = cms.string("(pdgId == 11 || pdgId == -11) && eta <2.5 && eta>-2.5 && pt > 15 && mother(0).pdgId == 23"),
0058                               )
0059 
0060 genEleFromW = cms.EDFilter("CandViewSelector",
0061                               src = cms.InputTag("genParticles"),
0062                               cut = cms.string("(pdgId == 11 || pdgId == -11) && eta <2.5 && eta>-2.5 && pt > 25 && (mother(0).pdgId == 24 || mother(0).pdgId == -24)"),
0063                               )
0064 
0065 genNuFromW = cms.EDFilter("CandViewSelector",
0066                               src = cms.InputTag("genParticles"),
0067                               cut = cms.string("(pdgId == 12 || pdgId == -12) && (mother(0).pdgId == 24 || mother(0).pdgId == -24)"),
0068                               )
0069 
0070 combZ = cms.EDProducer("CandViewShallowCloneCombiner",
0071                                  decay = cms.string("genEleFromZ genEleFromZ"),
0072                                  checkCharge = cms.bool(False),
0073                                  cut = cms.string("40 < mass < 140"),
0074                                  )
0075 
0076 combW = cms.EDProducer("CandViewShallowCloneCombiner",
0077                                  decay = cms.string("genEleFromW genNuFromW"),
0078                                  checkCharge = cms.bool(False),
0079                                  cut = cms.string(""),
0080                                  )
0081 
0082 ZFilterMC = cms.EDFilter("CandViewCountFilter",
0083                          src = cms.InputTag("combZ"),
0084                          minNumber = cms.uint32(1)
0085                          )
0086 
0087 WFilterMC = cms.EDFilter("CandViewCountFilter",
0088                          src = cms.InputTag("combW"),
0089                          minNumber = cms.uint32(1)
0090                          )
0091 
0092 
0093 ##    _____ _           _                     ___    _ 
0094 ##   | ____| | ___  ___| |_ _ __ ___  _ __   |_ _|__| |
0095 ##   |  _| | |/ _ \/ __| __| '__/ _ \| '_ \   | |/ _` |
0096 ##   | |___| |  __/ (__| |_| | | (_) | | | |  | | (_| |
0097 ##   |_____|_|\___|\___|\__|_|  \___/|_| |_| |___\__,_|
0098 ##   
0099 # Electron ID  ######
0100 
0101 selectedECALElectrons = cms.EDFilter("GsfElectronRefSelector",
0102                                  src = myEleCollection,
0103                                  cut = cms.string(
0104     "(abs(superCluster.eta)<3) && (energy*sin(superClusterPosition.theta)> 15)")
0105                                          )
0106 
0107 selectedECALMuons = cms.EDFilter("MuonRefSelector",
0108                                  src = cms.InputTag( 'muons' ),
0109                                  cut = cms.string("")
0110                                          )
0111 
0112 selectedECALPhotons = cms.EDFilter("PhotonRefSelector",
0113                                  src = cms.InputTag( 'gedPhotons' ),
0114                                  cut = cms.string(
0115     "(abs(superCluster.eta)<3) && (pt > 10)")
0116                                          )
0117 
0118 
0119 # This are the cuts at trigger level except ecalIso
0120 PassingVetoId = selectedECALElectrons.clone(
0121     cut = cms.string(
0122     selectedECALElectrons.cut.value() +
0123     " && (gsfTrack.hitPattern().numberOfLostHits(\'MISSING_INNER_HITS\')<=2)"
0124     " && ((isEB"
0125     " && ( ((pfIsolationVariables().sumChargedHadronPt + max(0.0,pfIsolationVariables().sumNeutralHadronEt + pfIsolationVariables().sumPhotonEt - 0.5 * pfIsolationVariables().sumPUPt))/p4.pt)<0.164369)"
0126     " && (full5x5_sigmaIetaIeta<0.011100)"
0127     " && ( -    0.252044<deltaPhiSuperClusterTrackAtVtx<    0.252044 )"
0128     " && ( -0.016315<deltaEtaSuperClusterTrackAtVtx<0.016315 )"
0129     " && (hadronicOverEm<0.345843)"
0130     ")"
0131     " || (isEE"
0132     " && (gsfTrack.hitPattern().numberOfLostHits(\'MISSING_INNER_HITS\')<=3)"
0133     " && ( ((pfIsolationVariables().sumChargedHadronPt + max(0.0,pfIsolationVariables().sumNeutralHadronEt + pfIsolationVariables().sumPhotonEt - 0.5 * pfIsolationVariables().sumPUPt))/p4.pt)<0.212604 )"
0134     " && (full5x5_sigmaIetaIeta<0.033987)"
0135     " && ( -0.245263<deltaPhiSuperClusterTrackAtVtx<0.245263 )"
0136     " && ( -0.010671<deltaEtaSuperClusterTrackAtVtx<0.010671 )"
0137     " && (hadronicOverEm<0.134691) "
0138     "))"
0139     )
0140     )
0141 
0142 PassingMuonVeryLooseId = selectedECALMuons.clone(
0143     cut = cms.string(
0144     selectedECALMuons.cut.value() +
0145     "(isPFMuon) && (isGlobalMuon || isTrackerMuon)"
0146     )
0147     )
0148 
0149 PassingPhotonVeryLooseId = selectedECALPhotons.clone(
0150     cut = cms.string(
0151     selectedECALPhotons.cut.value() +
0152     "&& ( (eta<1.479 && sigmaIetaIeta<0.02 && hadronicOverEm<0.06 )"
0153     "||"
0154     "( eta>=1.479 && sigmaIetaIeta<0.04 && hadronicOverEm<0.06 ) )"
0155     )
0156     )
0157 
0158 MuFilter = cms.EDFilter("CandViewCountFilter",
0159                          src = cms.InputTag("PassingMuonVeryLooseId"),
0160                          minNumber = cms.uint32(2)
0161                          )
0162 PhoFilter = cms.EDFilter("CandViewCountFilter",
0163                          src = cms.InputTag("PassingPhotonVeryLooseId"),
0164                          minNumber = cms.uint32(1)
0165                          )                         
0166 
0167 
0168 #------------------------------ electronID producer
0169 SCselector = cms.EDFilter("SuperClusterSelector",
0170                           src = cms.InputTag('correctedMulti5x5SuperClustersWithPreshower'),
0171                           cut = cms.string('(eta>2.4 || eta<-2.4) && (energy*sin(position.theta)> 15)')
0172                           )
0173 
0174 ### Build candidates from all the merged superclusters
0175 eleSC = cms.EDProducer('ConcreteEcalCandidateProducer',
0176                   src = cms.InputTag('SCselector'),
0177                   particleType = cms.string('gamma')
0178                   )
0179 
0180 # selectedCands = cms.EDFilter("AssociatedVariableMaxCutCandRefSelector",
0181 #                              src = cms.InputTag("eleSelectionProducers:loose"),
0182 #                              max = cms.double(0.5)
0183 #                              )
0184 
0185 #ecalCandidateMerged =  cms.EDProducer("CandViewMerger",
0186 #                                      src = cms.VInputTag("PassingVetoId", "eleSC")
0187 #                                      )
0188 
0189 eleSelSeq = cms.Sequence( selectedECALElectrons + PassingVetoId +
0190                           (SCselector*eleSC)
0191                           )
0192 
0193 muSelSeq = cms.Sequence( selectedECALMuons + selectedECALPhotons + PassingMuonVeryLooseId + PassingPhotonVeryLooseId + MuFilter + PhoFilter +
0194                           (SCselector*eleSC)
0195                           )
0196 
0197 
0198 ############################################################
0199 # Selectors
0200 ##############################
0201 ZeeSelector =  cms.EDProducer("CandViewShallowCloneCombiner",
0202                               decay = cms.string("PassingVetoId PassingVetoId"),
0203                               checkCharge = cms.bool(False),
0204                               cut   = cms.string("40 < mass < 140")
0205                               )
0206 
0207 
0208 #met, mt cuts for W selection
0209 MT="sqrt(2*daughter(0).pt*daughter(1).pt*(1 - cos(daughter(0).phi - daughter(1).phi)))"
0210 MET_CUT_MIN = 25.
0211 W_ELECTRON_ET_CUT_MIN = 30.0
0212 MT_CUT_MIN = 50.
0213 
0214 WenuSelector = cms.EDProducer("CandViewShallowCloneCombiner",
0215     decay = cms.string("pfMet PassingVetoId"), # charge coniugate states are implied
0216     checkCharge = cms.bool(False),                           
0217     cut   = cms.string(("daughter(0).pt > %f && daughter(1).pt > %f && "+MT+" > %f") % (MET_CUT_MIN, W_ELECTRON_ET_CUT_MIN, MT_CUT_MIN))
0218 )
0219 
0220 
0221 EleSCSelector = cms.EDProducer("CandViewShallowCloneCombiner",
0222                                decay = cms.string("PassingVetoId eleSC"),
0223                                checkCharge = cms.bool(False), 
0224                                cut = cms.string("40 < mass < 140")
0225                                )
0226 
0227 # for filtering events passing at least one of the filters
0228 WZSelector = cms.EDProducer("CandViewMerger",
0229                             src = cms.VInputTag("WenuSelector", "ZeeSelector", "EleSCSelector")
0230                             )
0231 
0232 ############################################################
0233 # Filters
0234 ##############################
0235 WenuFilter = cms.EDFilter("CandViewCountFilter",
0236                           src = cms.InputTag("WenuSelector"),
0237                           minNumber = cms.uint32(1)
0238                           )
0239 # filter events with at least one Zee candidate as identified by the ZeeSelector
0240 ZeeFilter = cms.EDFilter("CandViewCountFilter",
0241                          src = cms.InputTag("ZeeSelector"),
0242                          minNumber = cms.uint32(1)
0243                          )
0244 
0245 ZSCFilter = cms.EDFilter("CandViewCountFilter",
0246                          src = cms.InputTag("EleSCSelector"),
0247                          minNumber = cms.uint32(1)
0248                          )
0249 
0250 # filter for events passing at least one of the other filters
0251 WZFilter = cms.EDFilter("CandViewCountFilter",
0252                         src = cms.InputTag("WZSelector"),
0253                         minNumber = cms.uint32(1)
0254                         )
0255 
0256 
0257 
0258 ############################################################
0259 # Sequences
0260 ##############################
0261 
0262 preFilterSeq = cms.Sequence(MinEleNumberFilter)
0263 
0264 selectorProducerSeq = cms.Sequence(eleSelSeq * (ZeeSelector + WenuSelector + EleSCSelector) * WZSelector)
0265 
0266 ZeeSkimFilterSeq = cms.Sequence(preFilterSeq * selectorProducerSeq * 
0267                                  ZeeFilter)
0268 ZSCSkimFilterSeq = cms.Sequence(preFilterSeq * selectorProducerSeq * 
0269                                  ~ZeeFilter * ZSCFilter)
0270 WenuSkimFilterSeq = cms.Sequence(preFilterSeq * selectorProducerSeq * 
0271                                  ~ZeeFilter * ~ZSCFilter * WenuFilter)
0272 
0273 
0274 checkMCZSeq = cms.Sequence(genEleFromZ * combZ * ZFilterMC) #sequence to check Zskim efficiency respect to the MC
0275 checkMCWSeq = cms.Sequence(genEleFromW * genNuFromW * combW * WFilterMC) #sequence to check Wskim efficiency respect to the MC
0276 
0277 #FilterMuSeq = cms.Sequence(muSelSeq * (ZeeSelector + WenuSelector + EleSCSelector) * WZSelector)