Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:06:47

0001 import FWCore.ParameterSet.Config as cms
0002 
0003 ##                      _              _       
0004 ##   ___ ___  _ __  ___| |_ __ _ _ __ | |_ ___ 
0005 ##  / __/ _ \| '_ \/ __| __/ _` | '_ \| __/ __|
0006 ## | (_| (_) | | | \__ \ || (_| | | | | |_\__ \
0007 ##  \___\___/|_| |_|___/\__\__,_|_| |_|\__|___/
0008 ##                                              
0009 
0010 HLTPath = "HLT_Ele*"
0011 HLTProcessName = "HLT"
0012 
0013 #electron cuts
0014 ELECTRON_ET_CUT_MIN = 10.0
0015 TAG_ELECTRON_ET_CUT_MIN = 20.0
0016 W_ELECTRON_ET_CUT_MIN = 27.0
0017 ELECTRON_COLL = "gedGsfElectrons"
0018 ELECTRON_CUTS = "(abs(superCluster.eta)<2.5) && (ecalEnergy*sin(superClusterPosition.theta)>" + str(ELECTRON_ET_CUT_MIN) + ")"
0019 
0020 #met, mt cuts for W selection
0021 MET_CUT_MIN = 20.
0022 MT_CUT_MIN = 50.
0023 
0024 ##    ____      __ _____ _           _                   
0025 ##   / ___|___ / _| ____| | ___  ___| |_ _ __ ___  _ __  
0026 ##  | |  _/ __| |_|  _| | |/ _ \/ __| __| '__/ _ \| '_ \ 
0027 ##  | |_| \__ \  _| |___| |  __/ (__| |_| | | (_) | | | |
0028 ##   \____|___/_| |_____|_|\___|\___|\__|_|  \___/|_| |_|
0029 ##  
0030 #  GsfElectron ################ 
0031 goodElectrons = cms.EDFilter("GsfElectronRefSelector",
0032     src = cms.InputTag( ELECTRON_COLL ),
0033     cut = cms.string( ELECTRON_CUTS )    
0034 )
0035 
0036 GsfMatchedPhotonCands = cms.EDProducer("ElectronMatchedCandidateProducer",
0037    src     = cms.InputTag("goodPhotons"),
0038    ReferenceElectronCollection = cms.untracked.InputTag("goodElectrons"),
0039    deltaR =  cms.untracked.double(0.3)
0040 )
0041 
0042 ##    _____ _           _                     ___    _ 
0043 ##   | ____| | ___  ___| |_ _ __ ___  _ __   |_ _|__| |
0044 ##   |  _| | |/ _ \/ __| __| '__/ _ \| '_ \   | |/ _` |
0045 ##   | |___| |  __/ (__| |_| | | (_) | | | |  | | (_| |
0046 ##   |_____|_|\___|\___|\__|_|  \___/|_| |_| |___\__,_|
0047 ##   
0048 # Electron ID  ######
0049 PassingWP90 = goodElectrons.clone(
0050 cut = cms.string(
0051     goodElectrons.cut.value() +
0052     " && (gsfTrack.hitPattern().numberOfLostHits(\'MISSING_INNER_HITS\')<=1 && !(-0.02<convDist<0.02 && -0.02<convDcot<0.02))" #wrt std WP90 allowing 1 numberOfMissingExpectedHits 
0053     " && (ecalEnergy*sin(superClusterPosition.theta)>" + str(ELECTRON_ET_CUT_MIN) + ")"
0054     " && ((isEB"
0055     " && ( dr03TkSumPt/p4.Pt <0.12 && dr03EcalRecHitSumEt/p4.Pt < 0.09 && dr03HcalTowerSumEt/p4.Pt  < 0.1 )"
0056     " && (sigmaIetaIeta<0.01)"
0057     " && ( -0.8<deltaPhiSuperClusterTrackAtVtx<0.8 )"
0058     " && ( -0.007<deltaEtaSuperClusterTrackAtVtx<0.007 )"
0059     " && (hadronicOverEm<0.12)"
0060     ")"
0061     " || (isEE"
0062     " && ( dr03TkSumPt/p4.Pt <0.07 && dr03EcalRecHitSumEt/p4.Pt < 0.07 && dr03HcalTowerSumEt/p4.Pt  < 0.07 )"
0063     " && (sigmaIetaIeta<0.03)"
0064     " && ( -0.7<deltaPhiSuperClusterTrackAtVtx<0.7 )" 
0065     " && ( -0.009<deltaEtaSuperClusterTrackAtVtx<0.009 )"
0066     " && (hadronicOverEm<0.1) "
0067     "))"
0068     )
0069 )
0070 
0071 PassingWP80 = goodElectrons.clone(
0072 cut = cms.string(
0073     goodElectrons.cut.value() +
0074     " && (gsfTrack.hitPattern().numberOfLostHits(\'MISSING_INNER_HITS\')==0 && !(-0.02<convDist<0.02 && -0.02<convDcot<0.02))" 
0075     " && (ecalEnergy*sin(superClusterPosition.theta)>" + str(ELECTRON_ET_CUT_MIN) + ")"
0076     " && ((isEB"
0077     " && ( dr03TkSumPt/p4.Pt <0.12 && dr03EcalRecHitSumEt/p4.Pt < 0.09 && dr03HcalTowerSumEt/p4.Pt  < 0.1 )" #wrt std WP80 relaxing iso cuts to WP90 
0078     " && (sigmaIetaIeta<0.01)"
0079     " && ( -0.06<deltaPhiSuperClusterTrackAtVtx<0.06 )"
0080     " && ( -0.004<deltaEtaSuperClusterTrackAtVtx<0.004 )"
0081     " && (hadronicOverEm<0.12)"
0082     ")"
0083     " || (isEE"
0084     " && ( dr03TkSumPt/p4.Pt <0.05 && dr03EcalRecHitSumEt/p4.Pt < 0.06 && dr03HcalTowerSumEt/p4.Pt  < 0.03 )"
0085     " && (sigmaIetaIeta<0.03)"
0086     " && ( -0.03<deltaPhiSuperClusterTrackAtVtx<0.03 )" 
0087     " && ( -0.007<deltaEtaSuperClusterTrackAtVtx<0.007 )"
0088     " && (hadronicOverEm<0.10) "
0089     "))"
0090     )
0091 ) 
0092 
0093                          
0094 ##    _____     _                         __  __       _       _     _             
0095 ##   |_   _| __(_) __ _  __ _  ___ _ __  |  \/  | __ _| |_ ___| |__ (_)_ __   __ _ 
0096 ##     | || '__| |/ _` |/ _` |/ _ \ '__| | |\/| |/ _` | __/ __| '_ \| | '_ \ / _` |
0097 ##     | || |  | | (_| | (_| |  __/ |    | |  | | (_| | || (__| | | | | | | | (_| |
0098 ##     |_||_|  |_|\__, |\__, |\___|_|    |_|  |_|\__,_|\__\___|_| |_|_|_| |_|\__, |
0099 ##                |___/ |___/                                                |___/ 
0100 ##   
0101 # Trigger  ##################
0102 PassingHLT = cms.EDProducer("trgMatchGsfElectronProducer",    
0103     InputProducer = cms.InputTag( ELECTRON_COLL ),                          
0104     hltTags = cms.untracked.string( HLTPath ),
0105     triggerEventTag = cms.untracked.InputTag("hltTriggerSummaryAOD","",HLTProcessName),
0106     triggerResultsTag = cms.untracked.InputTag("TriggerResults","",HLTProcessName),
0107     stageL1Trigger = cms.uint32(1),
0108     # Stage-1 L1T inputs
0109     l1GtRecordInputTag = cms.InputTag('gtDigis'),
0110     l1GtReadoutRecordInputTag = cms.InputTag('gtDigis'),
0111 )
0112 from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger
0113 stage2L1Trigger.toModify(PassingHLT,
0114     stageL1Trigger = 2,
0115     # Stage-2 L1T inputs
0116     l1tAlgBlkInputTag = cms.InputTag('gtStage2Digis'),
0117     l1tExtBlkInputTag = cms.InputTag('gtStage2Digis'),
0118     # remove Stage-1 L1T inputs
0119     l1GtRecordInputTag = None,
0120     l1GtReadoutRecordInputTag = None,
0121 )
0122 
0123 ##    _____             ____        __ _       _ _   _             
0124 ##   |_   _|_ _  __ _  |  _ \  ___ / _(_)_ __ (_) |_(_) ___  _ __  
0125 ##     | |/ _` |/ _` | | | | |/ _ \ |_| | '_ \| | __| |/ _ \| '_ \ 
0126 ##     | | (_| | (_| | | |_| |  __/  _| | | | | | |_| | (_) | | | |
0127 ##     |_|\__,_|\__, | |____/ \___|_| |_|_| |_|_|\__|_|\___/|_| |_|
0128 ##              |___/
0129 ## 
0130 WElecTagHLT = PassingHLT.clone(
0131     InputProducer = cms.InputTag( "PassingWP80" )
0132     )
0133 
0134 ele_sequence = cms.Sequence(
0135     goodElectrons +
0136     PassingWP80 + 
0137     WElecTagHLT
0138     )
0139 
0140 
0141 ##    _____ ___   ____    ____       _          
0142 ##   |_   _( _ ) |  _ \  |  _ \ __ _(_)_ __ ___ 
0143 ##     | | / _ \/\ |_) | | |_) / _` | | '__/ __|
0144 ##     | || (_>  <  __/  |  __/ (_| | | |  \__ \
0145 ##     |_| \___/\/_|     |_|   \__,_|_|_|  |___/
0146 ##                                              
0147 ##   
0148 
0149 MT="sqrt(2*daughter(0).pt*daughter(1).pt*(1 - cos(daughter(0).phi - daughter(1).phi)))"
0150 elecMet = cms.EDProducer("CandViewShallowCloneCombiner",
0151     decay = cms.string("pfMet WElecTagHLT"), # charge coniugate states are implied
0152     checkCharge = cms.bool(False),                           
0153     cut   = cms.string(("daughter(0).pt > %f && daughter(1).pt > %f && "+MT+" > %f") % (MET_CUT_MIN, W_ELECTRON_ET_CUT_MIN, MT_CUT_MIN))
0154 )
0155 elecMetCounter = cms.EDFilter("CandViewCountFilter",
0156                                     src = cms.InputTag("elecMet"),
0157                                     minNumber = cms.uint32(1)
0158                                     )
0159 elecMetFilter = cms.Sequence(elecMet * elecMetCounter)
0160 
0161 import HLTrigger.HLTfilters.hltHighLevel_cfi
0162 WEnuHltFilter = HLTrigger.HLTfilters.hltHighLevel_cfi.hltHighLevel.clone(
0163     throw = cms.bool(False),
0164     HLTPaths = [HLTPath]
0165     )
0166 
0167 #--------------------------#
0168 #recompute rho
0169 import RecoJets.Configuration.RecoPFJets_cff
0170 kt6PFJetsForRhoCorrectionWElectronSkim = RecoJets.Configuration.RecoPFJets_cff.kt6PFJets.clone(
0171     doRhoFastjet = True,
0172     Rho_EtaMax = 2.5
0173 )
0174 
0175 
0176 elecMetSeq = cms.Sequence( WEnuHltFilter * ele_sequence * elecMetFilter * kt6PFJetsForRhoCorrectionWElectronSkim)
0177 
0178 
0179 from Configuration.EventContent.AlCaRecoOutput_cff import OutALCARECOEcalCalElectron
0180 WElectronSkimContent = OutALCARECOEcalCalElectron.clone()
0181 WElectronSkimContent.outputCommands.extend( [ 
0182   "keep *_pfMet_*_*", 
0183   "keep *_kt6*_rho_*", 
0184   "keep *_offlinePrimaryVerticesWithBS_*_*",
0185   "keep *_generator_*_*", 
0186   "keep *_rawDataCollector_*_*",
0187   'keep recoCaloClusters_*_*_*', 
0188   'keep recoPreshowerClusters_*_*_*',
0189   'keep *_reducedEcalRecHits*_*_*',
0190   'keep *_offlineBeamSpot_*_*',
0191   'keep *_allConversions_*_*',
0192   'keep *_gtDigis_*_*'
0193  ] )