Go to the documentation of this file.00001 #include "DQMOffline/Trigger/interface/EgHLTOffEgSel.h"
00002
00003 #include "DQMOffline/Trigger/interface/EgHLTEgCutCodes.h"
00004 #include "DQMOffline/Trigger/interface/EgHLTOffEle.h"
00005 #include "DQMOffline/Trigger/interface/EgHLTOffPho.h"
00006
00007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00008
00009 using namespace egHLT;
00010
00011 void OffEgSel::setup(const edm::ParameterSet& iConfig)
00012 {
00013 ebCutValues_.setup(iConfig.getParameter<edm::ParameterSet>("barrel"));
00014 eeCutValues_.setup(iConfig.getParameter<edm::ParameterSet>("endcap"));
00015 }
00016
00017
00018 int OffEgSel::getCutCode(const OffEle& ele,int cutMask)const
00019 {
00020 if(fabs(ele.detEta())<1.5) return getCutCode(ele,ebCutValues_,cutMask);
00021 else return getCutCode(ele,eeCutValues_,cutMask);
00022 }
00023
00024 int OffEgSel::getCutCode(const OffEle& ele,const EgCutValues& cuts,int cutMask)
00025 {
00026 int cutCode = 0x0;
00027
00028 if(ele.et() < cuts.minEt) cutCode |= EgCutCodes::ET;
00029 if(fabs(ele.etaSC()) < cuts.minEta || fabs(ele.etaSC()) > cuts.maxEta) cutCode |= EgCutCodes::DETETA;
00030 if(ele.isGap()) cutCode |= EgCutCodes::CRACK;
00031
00032 if(fabs(ele.dEtaIn()) > cuts.maxDEtaIn ) cutCode |=EgCutCodes::DETAIN;
00033 if(fabs(ele.dPhiIn()) > cuts.maxDPhiIn ) cutCode |=EgCutCodes::DPHIIN;
00034 if(ele.invEInvP() > cuts.maxInvEInvP) cutCode |= EgCutCodes::INVEINVP;
00035
00036 if(ele.hOverE() > cuts.maxHadem && ele.hOverE()*ele.caloEnergy() > cuts.maxHadEnergy) cutCode |= EgCutCodes::HADEM;
00037 if(ele.sigmaIEtaIEta() > cuts.maxSigmaIEtaIEta) cutCode |= EgCutCodes::SIGMAIETAIETA;
00038 if(ele.sigmaEtaEta() > cuts.maxSigmaEtaEta) cutCode |= EgCutCodes::SIGMAETAETA;
00039
00040
00041 if(ele.r9() < cuts.minR9) cutCode |= EgCutCodes::MINR9;
00042 if(ele.r9() > cuts.maxR9) cutCode |= EgCutCodes::MAXR9;
00043
00044
00045
00046 if(ele.isolEm()>( cuts.isolEmConstTerm + cuts.isolEmGradTerm*(ele.et()<cuts.isolEmGradStart ? 0. : (ele.et()-cuts.isolEmGradStart)))) cutCode |=EgCutCodes::ISOLEM;
00047 if(ele.isolHad()> (cuts.isolHadConstTerm + cuts.isolHadGradTerm*(ele.et()<cuts.isolHadGradStart ? 0. : (ele.et()-cuts.isolHadGradStart)))) cutCode |=EgCutCodes::ISOLHAD;
00048 if(ele.isolPtTrks() > (cuts.isolPtTrksConstTerm + cuts.isolPtTrksGradTerm*(ele.et()<cuts.isolPtTrksGradStart ? 0. : (ele.et()-cuts.isolPtTrksGradStart))))cutCode |=EgCutCodes::ISOLPTTRKS;
00049
00050
00051 if(ele.et()<=0.){
00052 if(ele.hltIsolTrksEle() > cuts.maxHLTIsolTrksEle) cutCode |=EgCutCodes::HLTISOLTRKSELE;
00053 if(ele.hltIsolTrksPho() > cuts.maxHLTIsolTrksPho) cutCode |=EgCutCodes::HLTISOLTRKSPHO;
00054 if(ele.hltIsolHad() > cuts.maxHLTIsolHad) cutCode |=EgCutCodes::HLTISOLHAD;
00055 if(ele.hltIsolEm() > cuts.maxHLTIsolEm) cutCode |=EgCutCodes::HLTISOLEM;
00056 }else{
00057 if(ele.hltIsolTrksEle() > cuts.maxHLTIsolTrksEle && ele.hltIsolTrksEle()/ele.et() > cuts.maxHLTIsolTrksEleOverPt &&
00058 ele.hltIsolTrksEle()/ele.et()/ele.et() > cuts.maxHLTIsolTrksEleOverPt2 ) cutCode |=EgCutCodes::HLTISOLTRKSELE;
00059 if(ele.hltIsolTrksPho() > cuts.maxHLTIsolTrksPho && ele.hltIsolTrksPho()/ele.et() > cuts.maxHLTIsolTrksPhoOverPt &&
00060 ele.hltIsolTrksPho()/ele.et()/ele.et() > cuts.maxHLTIsolTrksPhoOverPt2 ) cutCode |=EgCutCodes::HLTISOLTRKSPHO;
00061 if(ele.hltIsolHad() > cuts.maxHLTIsolHad && ele.hltIsolHad()/ele.et() > cuts.maxHLTIsolHadOverEt &&
00062 ele.hltIsolHad()/ele.et()/ele.et() > cuts.maxHLTIsolHadOverEt2) cutCode |=EgCutCodes::HLTISOLHAD;
00063 if(ele.hltIsolEm() > cuts.maxHLTIsolEm && ele.hltIsolEm()/ele.et() > cuts.maxHLTIsolEmOverEt &&
00064 ele.hltIsolEm()/ele.et()/ele.et() > cuts.maxHLTIsolEmOverEt2) cutCode |=EgCutCodes::HLTISOLEM;
00065 }
00066
00067
00068
00069 if(ele.validCTFTrack()){
00070 if(!(ele.ctfTrkOuterRadius() >= cuts.minCTFTrkOuterRadius &&
00071 ele.ctfTrkInnerRadius() <= cuts.maxCTFTrkInnerRadius &&
00072
00073 ele.ctfTrkHitsFound() >= cuts.minNrCTFTrkHits &&
00074 ele.ctfTrkHitsLost() <= cuts.maxNrCTFTrkHitsLost)) cutCode |=EgCutCodes::CTFTRACK;
00075 if(cuts.requirePixelHitsIfOuterInOuter){
00076 DetId innerDetId(ele.ctfTrack()->extra()->innerDetId());
00077 DetId outerDetId(ele.ctfTrack()->extra()->outerDetId());
00078
00079 if(outerDetId.subdetId()>=5 && innerDetId.subdetId()>=3) cutCode |=EgCutCodes::CTFTRACK;
00080 }
00081
00082 }else cutCode |=EgCutCodes::CTFTRACK;
00083
00084 if(fabs(ele.hltDEtaIn()) > cuts.maxHLTDEtaIn) cutCode |=EgCutCodes::HLTDETAIN;
00085 if(fabs(ele.hltDPhiIn()) > cuts.maxHLTDPhiIn) cutCode |=EgCutCodes::HLTDPHIIN;
00086 if(fabs(ele.hltInvEInvP()) > cuts.maxHLTInvEInvP) cutCode |=EgCutCodes::HLTINVEINVP;
00087
00088 return (cutCode & cuts.cutMask & cutMask);
00089 }
00090
00091 int OffEgSel::getCutCode(const OffPho& pho,int cutMask)const
00092 {
00093 if(fabs(pho.detEta())<1.5) return getCutCode(pho,ebCutValues_,cutMask);
00094 else return getCutCode(pho,eeCutValues_,cutMask);
00095 }
00096
00097
00098 int OffEgSel::getCutCode(const OffPho& pho,const EgCutValues& cuts,int cutMask)
00099 {
00100 int cutCode = 0x0;
00101
00102 if(pho.et()< cuts.minEt) cutCode |= EgCutCodes::ET;
00103 if(fabs(pho.etaSC())< cuts.minEta || fabs(pho.etaSC())>cuts.maxEta) cutCode |= EgCutCodes::DETETA;
00104 if(pho.isGap()) cutCode |= EgCutCodes::CRACK;
00105
00106 cutCode |=EgCutCodes::DETAIN;
00107 cutCode |=EgCutCodes::DPHIIN;
00108 cutCode |=EgCutCodes::INVEINVP;
00109
00110 if(pho.hOverE()> cuts.maxHadem && pho.hOverE()*pho.energy()>cuts.maxHadEnergy) cutCode |= EgCutCodes::HADEM;
00111 if(pho.sigmaIEtaIEta()>cuts.maxSigmaIEtaIEta) cutCode |= EgCutCodes::SIGMAIETAIETA;
00112 if(pho.sigmaEtaEta()>cuts.maxSigmaEtaEta) cutCode |= EgCutCodes::SIGMAETAETA;
00113
00114
00115 if(pho.r9()<cuts.minR9) cutCode |= EgCutCodes::MINR9;
00116 if(pho.r9()>cuts.maxR9) cutCode |= EgCutCodes::MAXR9;
00117
00118
00119 if(pho.isolEm()>( cuts.isolEmConstTerm + cuts.isolEmGradTerm*(pho.et()<cuts.isolEmGradStart ? 0. : (pho.et()-cuts.isolEmGradStart)))) cutCode |=EgCutCodes::ISOLEM;
00120 if(pho.isolHad()> (cuts.isolHadConstTerm + cuts.isolHadGradTerm*(pho.et()<cuts.isolHadGradStart ? 0. : (pho.et()-cuts.isolHadGradStart)))) cutCode |=EgCutCodes::ISOLHAD;
00121 if(pho.isolPtTrks() > (cuts.isolPtTrksConstTerm + cuts.isolPtTrksGradTerm*(pho.et()<cuts.isolPtTrksGradStart ? 0. : (pho.et()-cuts.isolPtTrksGradStart))))cutCode |=EgCutCodes::ISOLPTTRKS;
00122 if(pho.isolNrTrks() > cuts.isolNrTrksConstTerm) cutCode |=EgCutCodes::ISOLNRTRKS;
00123
00124
00125 cutCode |=EgCutCodes::HLTISOLTRKSELE;
00126 if(pho.et()<=0.){
00127 if(pho.hltIsolTrks() > cuts.maxHLTIsolTrksPho) cutCode |=EgCutCodes::HLTISOLTRKSPHO;
00128 if(pho.hltIsolHad() > cuts.maxHLTIsolHad) cutCode |=EgCutCodes::HLTISOLHAD;
00129 if(pho.hltIsolEm() > cuts.maxHLTIsolEm) cutCode |=EgCutCodes::HLTISOLEM;
00130 }else{
00131 if(pho.hltIsolTrks() > cuts.maxHLTIsolTrksPho && pho.hltIsolTrks()/pho.et() > cuts.maxHLTIsolTrksPhoOverPt &&
00132 pho.hltIsolTrks()/pho.et()/pho.et() > cuts.maxHLTIsolTrksPhoOverPt2 ) cutCode |=EgCutCodes::HLTISOLTRKSPHO;
00133 if(pho.hltIsolHad() > cuts.maxHLTIsolHad && pho.hltIsolHad()/pho.et() > cuts.maxHLTIsolHadOverEt &&
00134 pho.hltIsolHad()/pho.et()/pho.et() > cuts.maxHLTIsolHadOverEt2) cutCode |=EgCutCodes::HLTISOLHAD;
00135 if(pho.hltIsolEm() > cuts.maxHLTIsolEm && pho.hltIsolEm()/pho.et() > cuts.maxHLTIsolEmOverEt &&
00136 pho.hltIsolEm()/pho.et()/pho.et() > cuts.maxHLTIsolEmOverEt2) cutCode |=EgCutCodes::HLTISOLEM;
00137 }
00138
00139
00140 cutCode |=EgCutCodes::CTFTRACK;
00141 cutCode |=EgCutCodes::HLTDETAIN;
00142 cutCode |=EgCutCodes::HLTDPHIIN;
00143 cutCode |=EgCutCodes::HLTINVEINVP;
00144
00145 return (cutCode & cuts.cutMask & cutMask) ;
00146 }