CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/DPGAnalysis/Skims/python/WElectronSkim_cff.py

Go to the documentation of this file.
00001 import FWCore.ParameterSet.Config as cms
00002 
00003 ##                      _              _       
00004 ##   ___ ___  _ __  ___| |_ __ _ _ __ | |_ ___ 
00005 ##  / __/ _ \| '_ \/ __| __/ _` | '_ \| __/ __|
00006 ## | (_| (_) | | | \__ \ || (_| | | | | |_\__ \
00007 ##  \___\___/|_| |_|___/\__\__,_|_| |_|\__|___/
00008 ##                                              
00009 
00010 HLTPath = "HLT_Ele*"
00011 HLTProcessName = "HLT"
00012 
00013 #electron cuts
00014 ELECTRON_ET_CUT_MIN = 10.0
00015 TAG_ELECTRON_ET_CUT_MIN = 20.0
00016 W_ELECTRON_ET_CUT_MIN = 27.0
00017 ELECTRON_COLL = "gsfElectrons"
00018 ELECTRON_CUTS = "(abs(superCluster.eta)<2.5) && (ecalEnergy*sin(superClusterPosition.theta)>" + str(ELECTRON_ET_CUT_MIN) + ")"
00019 
00020 #met, mt cuts for W selection
00021 MET_CUT_MIN = 20.
00022 MT_CUT_MIN = 50.
00023 
00024 ##    ____      __ _____ _           _                   
00025 ##   / ___|___ / _| ____| | ___  ___| |_ _ __ ___  _ __  
00026 ##  | |  _/ __| |_|  _| | |/ _ \/ __| __| '__/ _ \| '_ \ 
00027 ##  | |_| \__ \  _| |___| |  __/ (__| |_| | | (_) | | | |
00028 ##   \____|___/_| |_____|_|\___|\___|\__|_|  \___/|_| |_|
00029 ##  
00030 #  GsfElectron ################ 
00031 goodElectrons = cms.EDFilter("GsfElectronRefSelector",
00032     src = cms.InputTag( ELECTRON_COLL ),
00033     cut = cms.string( ELECTRON_CUTS )    
00034 )
00035 
00036 GsfMatchedPhotonCands = cms.EDProducer("ElectronMatchedCandidateProducer",
00037    src     = cms.InputTag("goodPhotons"),
00038    ReferenceElectronCollection = cms.untracked.InputTag("goodElectrons"),
00039    deltaR =  cms.untracked.double(0.3)
00040 )
00041 
00042 ##    _____ _           _                     ___    _ 
00043 ##   | ____| | ___  ___| |_ _ __ ___  _ __   |_ _|__| |
00044 ##   |  _| | |/ _ \/ __| __| '__/ _ \| '_ \   | |/ _` |
00045 ##   | |___| |  __/ (__| |_| | | (_) | | | |  | | (_| |
00046 ##   |_____|_|\___|\___|\__|_|  \___/|_| |_| |___\__,_|
00047 ##   
00048 # Electron ID  ######
00049 PassingWP90 = goodElectrons.clone(
00050 cut = cms.string(
00051     goodElectrons.cut.value() +
00052     " && (gsfTrack.trackerExpectedHitsInner.numberOfHits<=1 && !(-0.02<convDist<0.02 && -0.02<convDcot<0.02))" #wrt std WP90 allowing 1 numberOfMissingExpectedHits 
00053     " && (ecalEnergy*sin(superClusterPosition.theta)>" + str(ELECTRON_ET_CUT_MIN) + ")"
00054     " && ((isEB"
00055     " && ( dr03TkSumPt/p4.Pt <0.12 && dr03EcalRecHitSumEt/p4.Pt < 0.09 && dr03HcalTowerSumEt/p4.Pt  < 0.1 )"
00056     " && (sigmaIetaIeta<0.01)"
00057     " && ( -0.8<deltaPhiSuperClusterTrackAtVtx<0.8 )"
00058     " && ( -0.007<deltaEtaSuperClusterTrackAtVtx<0.007 )"
00059     " && (hadronicOverEm<0.12)"
00060     ")"
00061     " || (isEE"
00062     " && ( dr03TkSumPt/p4.Pt <0.07 && dr03EcalRecHitSumEt/p4.Pt < 0.07 && dr03HcalTowerSumEt/p4.Pt  < 0.07 )"
00063     " && (sigmaIetaIeta<0.03)"
00064     " && ( -0.7<deltaPhiSuperClusterTrackAtVtx<0.7 )" 
00065     " && ( -0.009<deltaEtaSuperClusterTrackAtVtx<0.009 )"
00066     " && (hadronicOverEm<0.1) "
00067     "))"
00068     )
00069 )
00070 
00071 PassingWP80 = goodElectrons.clone(
00072 cut = cms.string(
00073     goodElectrons.cut.value() +
00074     " && (gsfTrack.trackerExpectedHitsInner.numberOfHits==0 && !(-0.02<convDist<0.02 && -0.02<convDcot<0.02))" 
00075     " && (ecalEnergy*sin(superClusterPosition.theta)>" + str(ELECTRON_ET_CUT_MIN) + ")"
00076     " && ((isEB"
00077     " && ( dr03TkSumPt/p4.Pt <0.12 && dr03EcalRecHitSumEt/p4.Pt < 0.09 && dr03HcalTowerSumEt/p4.Pt  < 0.1 )" #wrt std WP80 relaxing iso cuts to WP90 
00078     " && (sigmaIetaIeta<0.01)"
00079     " && ( -0.06<deltaPhiSuperClusterTrackAtVtx<0.06 )"
00080     " && ( -0.004<deltaEtaSuperClusterTrackAtVtx<0.004 )"
00081     " && (hadronicOverEm<0.12)"
00082     ")"
00083     " || (isEE"
00084     " && ( dr03TkSumPt/p4.Pt <0.05 && dr03EcalRecHitSumEt/p4.Pt < 0.06 && dr03HcalTowerSumEt/p4.Pt  < 0.03 )"
00085     " && (sigmaIetaIeta<0.03)"
00086     " && ( -0.03<deltaPhiSuperClusterTrackAtVtx<0.03 )" 
00087     " && ( -0.007<deltaEtaSuperClusterTrackAtVtx<0.007 )"
00088     " && (hadronicOverEm<0.10) "
00089     "))"
00090     )
00091 ) 
00092 
00093                          
00094 ##    _____     _                         __  __       _       _     _             
00095 ##   |_   _| __(_) __ _  __ _  ___ _ __  |  \/  | __ _| |_ ___| |__ (_)_ __   __ _ 
00096 ##     | || '__| |/ _` |/ _` |/ _ \ '__| | |\/| |/ _` | __/ __| '_ \| | '_ \ / _` |
00097 ##     | || |  | | (_| | (_| |  __/ |    | |  | | (_| | || (__| | | | | | | | (_| |
00098 ##     |_||_|  |_|\__, |\__, |\___|_|    |_|  |_|\__,_|\__\___|_| |_|_|_| |_|\__, |
00099 ##                |___/ |___/                                                |___/ 
00100 ##   
00101 # Trigger  ##################
00102 PassingHLT = cms.EDProducer("trgMatchGsfElectronProducer",    
00103     InputProducer = cms.InputTag( ELECTRON_COLL ),                          
00104     hltTags = cms.untracked.string( HLTPath ),
00105     triggerEventTag = cms.untracked.InputTag("hltTriggerSummaryAOD","",HLTProcessName),
00106     triggerResultsTag = cms.untracked.InputTag("TriggerResults","",HLTProcessName)   
00107 )
00108 
00109 ##    _____             ____        __ _       _ _   _             
00110 ##   |_   _|_ _  __ _  |  _ \  ___ / _(_)_ __ (_) |_(_) ___  _ __  
00111 ##     | |/ _` |/ _` | | | | |/ _ \ |_| | '_ \| | __| |/ _ \| '_ \ 
00112 ##     | | (_| | (_| | | |_| |  __/  _| | | | | | |_| | (_) | | | |
00113 ##     |_|\__,_|\__, | |____/ \___|_| |_|_| |_|_|\__|_|\___/|_| |_|
00114 ##              |___/
00115 ## 
00116 WElecTagHLT = PassingHLT.clone(
00117     InputProducer = cms.InputTag( "PassingWP80" )
00118     )
00119 
00120 ele_sequence = cms.Sequence(
00121     goodElectrons +
00122     PassingWP80 + 
00123     WElecTagHLT
00124     )
00125 
00126 
00127 ##    _____ ___   ____    ____       _          
00128 ##   |_   _( _ ) |  _ \  |  _ \ __ _(_)_ __ ___ 
00129 ##     | | / _ \/\ |_) | | |_) / _` | | '__/ __|
00130 ##     | || (_>  <  __/  |  __/ (_| | | |  \__ \
00131 ##     |_| \___/\/_|     |_|   \__,_|_|_|  |___/
00132 ##                                              
00133 ##   
00134 
00135 MT="sqrt(2*daughter(0).pt*daughter(1).pt*(1 - cos(daughter(0).phi - daughter(1).phi)))"
00136 elecMet = cms.EDProducer("CandViewShallowCloneCombiner",
00137     decay = cms.string("pfMet WElecTagHLT"), # charge coniugate states are implied
00138     checkCharge = cms.bool(False),                           
00139     cut   = cms.string(("daughter(0).pt > %f && daughter(1).pt > %f && "+MT+" > %f") % (MET_CUT_MIN, W_ELECTRON_ET_CUT_MIN, MT_CUT_MIN))
00140 )
00141 elecMetCounter = cms.EDFilter("CandViewCountFilter",
00142                                     src = cms.InputTag("elecMet"),
00143                                     minNumber = cms.uint32(1)
00144                                     )
00145 elecMetFilter = cms.Sequence(elecMet * elecMetCounter)
00146 
00147 import HLTrigger.HLTfilters.hltHighLevel_cfi
00148 WEnuHltFilter = HLTrigger.HLTfilters.hltHighLevel_cfi.hltHighLevel.clone(
00149     throw = cms.bool(False),
00150     HLTPaths = [HLTPath]
00151     )
00152 
00153 #--------------------------#
00154 #recompute rho
00155 import RecoJets.Configuration.RecoPFJets_cff
00156 kt6PFJetsForRhoCorrection = RecoJets.Configuration.RecoPFJets_cff.kt6PFJets.clone(
00157     doRhoFastjet = True,
00158     Rho_EtaMax = 2.5
00159 )
00160 
00161 
00162 elecMetSeq = cms.Sequence( WEnuHltFilter * ele_sequence * elecMetFilter * kt6PFJetsForRhoCorrection)
00163 
00164 
00165 from Configuration.EventContent.EventContent_cff import OutALCARECOEcalCalElectron
00166 WElectronSkimContent = OutALCARECOEcalCalElectron.clone()
00167 WElectronSkimContent.outputCommands.extend( [ 
00168   "keep *_pfMet_*_*", 
00169   "keep *_kt6*_rho_*", 
00170   "keep *_offlinePrimaryVerticesWithBS_*_*",
00171   "keep *_generator_*_*", 
00172   "keep *_rawDataCollector_*_*",
00173   'keep recoCaloClusters_*_*_*', 
00174   'keep recoPreshowerClusters_*_*_*',
00175   'keep *_reducedEcalRecHits*_*_*',
00176   'keep *_offlineBeamSpot_*_*',
00177   'keep *_allConversions_*_*',
00178   'keep *_gtDigis_*_*'
00179  ] )