CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Attributes

egHLT::OffEgSel Class Reference

#include <EgHLTOffEgSel.h>

List of all members.

Public Member Functions

const EgCutValuesebCuts () const
const EgCutValueseeCuts () const
int getCutCode (const OffEle &ele, int cutMask=~0x0) const
int getCutCode (const OffPho &pho, int cutMask=~0x0) const
 OffEgSel ()
 OffEgSel (const edm::ParameterSet &config)
bool passCuts (const OffEle &ele, int cutMask=~0x0) const
bool passCuts (const OffPho &pho, int cutMask=~0x0) const
void setEBCuts (const EgCutValues &cuts)
void setEECuts (const EgCutValues &cuts)
void setup (const edm::ParameterSet &)
 ~OffEgSel ()

Static Public Member Functions

static int getCutCode (const OffEle &ele, const EgCutValues &cuts, int cutMask=~0x0)
static int getCutCode (const OffPho &pho, const EgCutValues &cuts, int cutMask=~0x0)

Private Attributes

EgCutValues ebCutValues_
EgCutValues eeCutValues_

Detailed Description

Definition at line 24 of file EgHLTOffEgSel.h.


Constructor & Destructor Documentation

egHLT::OffEgSel::OffEgSel ( ) [inline]

Definition at line 32 of file EgHLTOffEgSel.h.

{}//default, it doesnt to anything
egHLT::OffEgSel::OffEgSel ( const edm::ParameterSet config) [inline, explicit]

Definition at line 33 of file EgHLTOffEgSel.h.

References setup().

{setup(config);}
egHLT::OffEgSel::~OffEgSel ( ) [inline]

Definition at line 34 of file EgHLTOffEgSel.h.

{} //we own nothing so default destructor, copy and assignment okay

Member Function Documentation

const EgCutValues& egHLT::OffEgSel::ebCuts ( ) const [inline]

Definition at line 48 of file EgHLTOffEgSel.h.

References ebCutValues_.

{return ebCutValues_;}
const EgCutValues& egHLT::OffEgSel::eeCuts ( ) const [inline]

Definition at line 49 of file EgHLTOffEgSel.h.

References eeCutValues_.

{return eeCutValues_;}
int OffEgSel::getCutCode ( const OffPho pho,
int  cutMask = ~0x0 
) const

Definition at line 91 of file EgHLTOffEgSel.cc.

References egHLT::OffPho::detEta(), ebCutValues_, eeCutValues_, and getCutCode().

{
  if(fabs(pho.detEta())<1.5) return getCutCode(pho,ebCutValues_,cutMask);
  else return getCutCode(pho,eeCutValues_,cutMask);
}
int OffEgSel::getCutCode ( const OffEle ele,
int  cutMask = ~0x0 
) const

Definition at line 18 of file EgHLTOffEgSel.cc.

References egHLT::OffEle::detEta(), ebCutValues_, and eeCutValues_.

Referenced by egHLT::OffHelper::fillOffEleVec(), egHLT::OffHelper::fillOffPhoVec(), getCutCode(), and passCuts().

{
  if(fabs(ele.detEta())<1.5) return getCutCode(ele,ebCutValues_,cutMask);
  else return getCutCode(ele,eeCutValues_,cutMask);
}
int OffEgSel::getCutCode ( const OffEle ele,
const EgCutValues cuts,
int  cutMask = ~0x0 
) [static]

Definition at line 24 of file EgHLTOffEgSel.cc.

References egHLT::OffEle::caloEnergy(), egHLT::EgCutCodes::CRACK, egHLT::EgCutCodes::CTFTRACK, egHLT::OffEle::ctfTrack(), egHLT::OffEle::ctfTrkHitsFound(), egHLT::OffEle::ctfTrkHitsLost(), egHLT::OffEle::ctfTrkInnerRadius(), egHLT::OffEle::ctfTrkOuterRadius(), egHLT::EgCutValues::cutMask, egHLT::OffEle::dEtaIn(), egHLT::EgCutCodes::DETAIN, egHLT::EgCutCodes::DETETA, egHLT::EgCutCodes::DPHIIN, egHLT::OffEle::dPhiIn(), egHLT::EgCutCodes::ET, egHLT::OffEle::et(), egHLT::OffEle::etaSC(), egHLT::EgCutCodes::HADEM, egHLT::EgCutCodes::HLTDETAIN, egHLT::OffEle::hltDEtaIn(), egHLT::EgCutCodes::HLTDPHIIN, egHLT::OffEle::hltDPhiIn(), egHLT::OffEle::hltInvEInvP(), egHLT::EgCutCodes::HLTINVEINVP, egHLT::OffEle::hltIsolEm(), egHLT::EgCutCodes::HLTISOLEM, egHLT::OffEle::hltIsolHad(), egHLT::EgCutCodes::HLTISOLHAD, egHLT::OffEle::hltIsolTrksEle(), egHLT::EgCutCodes::HLTISOLTRKSELE, egHLT::OffEle::hltIsolTrksPho(), egHLT::EgCutCodes::HLTISOLTRKSPHO, egHLT::OffEle::hOverE(), egHLT::OffEle::invEInvP(), egHLT::EgCutCodes::INVEINVP, egHLT::OffEle::isGap(), egHLT::OffEle::isolEm(), egHLT::EgCutCodes::ISOLEM, egHLT::EgCutValues::isolEmConstTerm, egHLT::EgCutValues::isolEmGradStart, egHLT::EgCutValues::isolEmGradTerm, egHLT::OffEle::isolHad(), egHLT::EgCutCodes::ISOLHAD, egHLT::EgCutValues::isolHadConstTerm, egHLT::EgCutValues::isolHadGradStart, egHLT::EgCutValues::isolHadGradTerm, egHLT::OffEle::isolPtTrks(), egHLT::EgCutCodes::ISOLPTTRKS, egHLT::EgCutValues::isolPtTrksConstTerm, egHLT::EgCutValues::isolPtTrksGradStart, egHLT::EgCutValues::isolPtTrksGradTerm, egHLT::EgCutValues::maxCTFTrkInnerRadius, egHLT::EgCutValues::maxDEtaIn, egHLT::EgCutValues::maxDPhiIn, egHLT::EgCutValues::maxEta, egHLT::EgCutValues::maxHadem, egHLT::EgCutValues::maxHadEnergy, egHLT::EgCutValues::maxHLTDEtaIn, egHLT::EgCutValues::maxHLTDPhiIn, egHLT::EgCutValues::maxHLTInvEInvP, egHLT::EgCutValues::maxHLTIsolEm, egHLT::EgCutValues::maxHLTIsolEmOverEt, egHLT::EgCutValues::maxHLTIsolEmOverEt2, egHLT::EgCutValues::maxHLTIsolHad, egHLT::EgCutValues::maxHLTIsolHadOverEt, egHLT::EgCutValues::maxHLTIsolHadOverEt2, egHLT::EgCutValues::maxHLTIsolTrksEle, egHLT::EgCutValues::maxHLTIsolTrksEleOverPt, egHLT::EgCutValues::maxHLTIsolTrksEleOverPt2, egHLT::EgCutValues::maxHLTIsolTrksPho, egHLT::EgCutValues::maxHLTIsolTrksPhoOverPt, egHLT::EgCutValues::maxHLTIsolTrksPhoOverPt2, egHLT::EgCutValues::maxInvEInvP, egHLT::EgCutValues::maxNrCTFTrkHitsLost, egHLT::EgCutCodes::MAXR9, egHLT::EgCutValues::maxR9, egHLT::EgCutValues::maxSigmaEtaEta, egHLT::EgCutValues::maxSigmaIEtaIEta, egHLT::EgCutValues::minCTFTrkOuterRadius, egHLT::EgCutValues::minEt, egHLT::EgCutValues::minEta, egHLT::EgCutValues::minNrCTFTrkHits, egHLT::EgCutValues::minR9, egHLT::EgCutCodes::MINR9, egHLT::OffEle::r9(), egHLT::EgCutValues::requirePixelHitsIfOuterInOuter, egHLT::EgCutCodes::SIGMAETAETA, egHLT::OffEle::sigmaEtaEta(), egHLT::OffEle::sigmaIEtaIEta(), egHLT::EgCutCodes::SIGMAIETAIETA, and egHLT::OffEle::validCTFTrack().

{ 
  int cutCode = 0x0;
  //kinematic cuts
  if(ele.et() < cuts.minEt) cutCode |= EgCutCodes::ET;
  if(fabs(ele.etaSC()) < cuts.minEta || fabs(ele.etaSC()) > cuts.maxEta) cutCode |= EgCutCodes::DETETA;
  if(ele.isGap()) cutCode |= EgCutCodes::CRACK;
  //track cuts
  if(fabs(ele.dEtaIn()) > cuts.maxDEtaIn ) cutCode |=EgCutCodes::DETAIN;
  if(fabs(ele.dPhiIn()) > cuts.maxDPhiIn ) cutCode |=EgCutCodes::DPHIIN;
  if(ele.invEInvP() > cuts.maxInvEInvP) cutCode |= EgCutCodes::INVEINVP;
  //supercluster cuts
  if(ele.hOverE() > cuts.maxHadem && ele.hOverE()*ele.caloEnergy() > cuts.maxHadEnergy) cutCode |= EgCutCodes::HADEM;
  if(ele.sigmaIEtaIEta() > cuts.maxSigmaIEtaIEta) cutCode |= EgCutCodes::SIGMAIETAIETA;
  if(ele.sigmaEtaEta() > cuts.maxSigmaEtaEta) cutCode |= EgCutCodes::SIGMAETAETA;
  //---Morse-------
  //if(ele.r9()<cuts.minR9) cutCode |= EgCutCodes::R9;
  if(ele.r9() < cuts.minR9) cutCode |= EgCutCodes::MINR9;
  if(ele.r9() > cuts.maxR9) cutCode |= EgCutCodes::MAXR9;
  //----------------
  
  //std isolation cuts
  if(ele.isolEm()>( cuts.isolEmConstTerm + cuts.isolEmGradTerm*(ele.et()<cuts.isolEmGradStart ? 0. : (ele.et()-cuts.isolEmGradStart)))) cutCode |=EgCutCodes::ISOLEM;
  if(ele.isolHad()> (cuts.isolHadConstTerm + cuts.isolHadGradTerm*(ele.et()<cuts.isolHadGradStart ? 0. : (ele.et()-cuts.isolHadGradStart)))) cutCode |=EgCutCodes::ISOLHAD;
  if(ele.isolPtTrks() > (cuts.isolPtTrksConstTerm + cuts.isolPtTrksGradTerm*(ele.et()<cuts.isolPtTrksGradStart ? 0. : (ele.et()-cuts.isolPtTrksGradStart))))cutCode |=EgCutCodes::ISOLPTTRKS; 
  //ele Nr trks not defined, assume it passes
  //hlt isolation cuts
  if(ele.et()<=0.){//even it if et<=0, we give it a shot at passing isolation. Note this should be an impossible case
    if(ele.hltIsolTrksEle() > cuts.maxHLTIsolTrksEle) cutCode |=EgCutCodes::HLTISOLTRKSELE;
    if(ele.hltIsolTrksPho() > cuts.maxHLTIsolTrksPho) cutCode |=EgCutCodes::HLTISOLTRKSPHO;
    if(ele.hltIsolHad() > cuts.maxHLTIsolHad) cutCode |=EgCutCodes::HLTISOLHAD;
    if(ele.hltIsolEm() > cuts.maxHLTIsolEm) cutCode |=EgCutCodes::HLTISOLEM;
  }else{ 
    if(ele.hltIsolTrksEle() > cuts.maxHLTIsolTrksEle && ele.hltIsolTrksEle()/ele.et() > cuts.maxHLTIsolTrksEleOverPt &&
       ele.hltIsolTrksEle()/ele.et()/ele.et() > cuts.maxHLTIsolTrksEleOverPt2 ) cutCode |=EgCutCodes::HLTISOLTRKSELE;
    if(ele.hltIsolTrksPho() > cuts.maxHLTIsolTrksPho && ele.hltIsolTrksPho()/ele.et() > cuts.maxHLTIsolTrksPhoOverPt &&
       ele.hltIsolTrksPho()/ele.et()/ele.et() > cuts.maxHLTIsolTrksPhoOverPt2 ) cutCode |=EgCutCodes::HLTISOLTRKSPHO;
    if(ele.hltIsolHad() > cuts.maxHLTIsolHad && ele.hltIsolHad()/ele.et() > cuts.maxHLTIsolHadOverEt &&
       ele.hltIsolHad()/ele.et()/ele.et() > cuts.maxHLTIsolHadOverEt2) cutCode |=EgCutCodes::HLTISOLHAD;
    if(ele.hltIsolEm() > cuts.maxHLTIsolEm && ele.hltIsolEm()/ele.et() > cuts.maxHLTIsolEmOverEt &&
       ele.hltIsolEm()/ele.et()/ele.et() > cuts.maxHLTIsolEmOverEt2) cutCode |=EgCutCodes::HLTISOLEM;
  }
 
 
  //cuts on CTF track, HLT tracking doesnt handle poor quaility tracks
  if(ele.validCTFTrack()){
    if(!(ele.ctfTrkOuterRadius() >= cuts.minCTFTrkOuterRadius && //note I'm NOTing the result of the AND
         ele.ctfTrkInnerRadius() <= cuts.maxCTFTrkInnerRadius &&
         
         ele.ctfTrkHitsFound() >= cuts.minNrCTFTrkHits && 
         ele.ctfTrkHitsLost() <= cuts.maxNrCTFTrkHitsLost)) cutCode |=EgCutCodes::CTFTRACK; //the next line can also set this bit
    if(cuts.requirePixelHitsIfOuterInOuter){
      DetId innerDetId(ele.ctfTrack()->extra()->innerDetId());
      DetId outerDetId(ele.ctfTrack()->extra()->outerDetId());
    
      if(outerDetId.subdetId()>=5 && innerDetId.subdetId()>=3) cutCode |=EgCutCodes::CTFTRACK; //1,2 = pixel, 3,4,5,6 sistrip
    }
    // std::cout <<"eta "<<ele.detEta()<<" max inner "<<cuts.maxCTFTrkInnerRadius<<" inner "<<ele.ctfTrkInnerRadius()<<std::endl;
  }else cutCode |=EgCutCodes::CTFTRACK;

  if(fabs(ele.hltDEtaIn()) > cuts.maxHLTDEtaIn) cutCode |=EgCutCodes::HLTDETAIN;
  if(fabs(ele.hltDPhiIn()) > cuts.maxHLTDPhiIn) cutCode |=EgCutCodes::HLTDPHIIN;
  if(fabs(ele.hltInvEInvP()) > cuts.maxHLTInvEInvP) cutCode |=EgCutCodes::HLTINVEINVP;

  return (cutCode & cuts.cutMask & cutMask);
}
int OffEgSel::getCutCode ( const OffPho pho,
const EgCutValues cuts,
int  cutMask = ~0x0 
) [static]

Definition at line 98 of file EgHLTOffEgSel.cc.

References egHLT::EgCutCodes::CRACK, egHLT::EgCutCodes::CTFTRACK, egHLT::EgCutValues::cutMask, egHLT::EgCutCodes::DETAIN, egHLT::EgCutCodes::DETETA, egHLT::EgCutCodes::DPHIIN, egHLT::OffPho::energy(), egHLT::EgCutCodes::ET, egHLT::OffPho::et(), egHLT::OffPho::etaSC(), egHLT::EgCutCodes::HADEM, egHLT::EgCutCodes::HLTDETAIN, egHLT::EgCutCodes::HLTDPHIIN, egHLT::EgCutCodes::HLTINVEINVP, egHLT::OffPho::hltIsolEm(), egHLT::EgCutCodes::HLTISOLEM, egHLT::OffPho::hltIsolHad(), egHLT::EgCutCodes::HLTISOLHAD, egHLT::OffPho::hltIsolTrks(), egHLT::EgCutCodes::HLTISOLTRKSELE, egHLT::EgCutCodes::HLTISOLTRKSPHO, egHLT::OffPho::hOverE(), egHLT::EgCutCodes::INVEINVP, egHLT::OffPho::isGap(), egHLT::OffPho::isolEm(), egHLT::EgCutCodes::ISOLEM, egHLT::EgCutValues::isolEmConstTerm, egHLT::EgCutValues::isolEmGradStart, egHLT::EgCutValues::isolEmGradTerm, egHLT::OffPho::isolHad(), egHLT::EgCutCodes::ISOLHAD, egHLT::EgCutValues::isolHadConstTerm, egHLT::EgCutValues::isolHadGradStart, egHLT::EgCutValues::isolHadGradTerm, egHLT::EgCutCodes::ISOLNRTRKS, egHLT::OffPho::isolNrTrks(), egHLT::EgCutValues::isolNrTrksConstTerm, egHLT::OffPho::isolPtTrks(), egHLT::EgCutCodes::ISOLPTTRKS, egHLT::EgCutValues::isolPtTrksConstTerm, egHLT::EgCutValues::isolPtTrksGradStart, egHLT::EgCutValues::isolPtTrksGradTerm, egHLT::EgCutValues::maxEta, egHLT::EgCutValues::maxHadem, egHLT::EgCutValues::maxHadEnergy, egHLT::EgCutValues::maxHLTIsolEm, egHLT::EgCutValues::maxHLTIsolEmOverEt, egHLT::EgCutValues::maxHLTIsolEmOverEt2, egHLT::EgCutValues::maxHLTIsolHad, egHLT::EgCutValues::maxHLTIsolHadOverEt, egHLT::EgCutValues::maxHLTIsolHadOverEt2, egHLT::EgCutValues::maxHLTIsolTrksPho, egHLT::EgCutValues::maxHLTIsolTrksPhoOverPt, egHLT::EgCutValues::maxHLTIsolTrksPhoOverPt2, egHLT::EgCutCodes::MAXR9, egHLT::EgCutValues::maxR9, egHLT::EgCutValues::maxSigmaEtaEta, egHLT::EgCutValues::maxSigmaIEtaIEta, egHLT::EgCutValues::minEt, egHLT::EgCutValues::minEta, egHLT::EgCutValues::minR9, egHLT::EgCutCodes::MINR9, egHLT::OffPho::r9(), egHLT::EgCutCodes::SIGMAETAETA, egHLT::OffPho::sigmaEtaEta(), egHLT::EgCutCodes::SIGMAIETAIETA, and egHLT::OffPho::sigmaIEtaIEta().

{ 
  int cutCode = 0x0;
  //kinematic cuts
  if(pho.et()< cuts.minEt) cutCode |= EgCutCodes::ET;
  if(fabs(pho.etaSC())< cuts.minEta || fabs(pho.etaSC())>cuts.maxEta) cutCode |= EgCutCodes::DETETA;
  if(pho.isGap()) cutCode |= EgCutCodes::CRACK;
  //track cuts (all fail)
  cutCode |=EgCutCodes::DETAIN;
  cutCode |=EgCutCodes::DPHIIN;
  cutCode |=EgCutCodes::INVEINVP;
  //supercluster cuts
  if(pho.hOverE()> cuts.maxHadem && pho.hOverE()*pho.energy()>cuts.maxHadEnergy) cutCode |= EgCutCodes::HADEM;
  if(pho.sigmaIEtaIEta()>cuts.maxSigmaIEtaIEta) cutCode |= EgCutCodes::SIGMAIETAIETA; 
  if(pho.sigmaEtaEta()>cuts.maxSigmaEtaEta) cutCode |= EgCutCodes::SIGMAETAETA; 
  //----Morse--------
  //if(pho.r9()<cuts.minR9) cutCode |= EgCutCodes::R9;
  if(pho.r9()<cuts.minR9) cutCode |= EgCutCodes::MINR9;
  if(pho.r9()>cuts.maxR9) cutCode |= EgCutCodes::MAXR9;
  //----------------
  //std isolation cuts
  if(pho.isolEm()>( cuts.isolEmConstTerm + cuts.isolEmGradTerm*(pho.et()<cuts.isolEmGradStart ? 0. : (pho.et()-cuts.isolEmGradStart)))) cutCode |=EgCutCodes::ISOLEM;
  if(pho.isolHad()> (cuts.isolHadConstTerm + cuts.isolHadGradTerm*(pho.et()<cuts.isolHadGradStart ? 0. : (pho.et()-cuts.isolHadGradStart)))) cutCode |=EgCutCodes::ISOLHAD;
  if(pho.isolPtTrks() > (cuts.isolPtTrksConstTerm + cuts.isolPtTrksGradTerm*(pho.et()<cuts.isolPtTrksGradStart ? 0. : (pho.et()-cuts.isolPtTrksGradStart))))cutCode |=EgCutCodes::ISOLPTTRKS;
  if(pho.isolNrTrks() > cuts.isolNrTrksConstTerm) cutCode |=EgCutCodes::ISOLNRTRKS;

  //hlt isolation cuts
  cutCode |=EgCutCodes::HLTISOLTRKSELE; //automatically fails ele track isolation
  if(pho.et()<=0.){ //even it if et<=0, we give it a shot at passing isolation. Note this should be an impossible case
    if(pho.hltIsolTrks() > cuts.maxHLTIsolTrksPho) cutCode |=EgCutCodes::HLTISOLTRKSPHO;
    if(pho.hltIsolHad() > cuts.maxHLTIsolHad) cutCode |=EgCutCodes::HLTISOLHAD;
    if(pho.hltIsolEm() > cuts.maxHLTIsolEm) cutCode |=EgCutCodes::HLTISOLEM;
  }else{ 
    if(pho.hltIsolTrks() > cuts.maxHLTIsolTrksPho && pho.hltIsolTrks()/pho.et() > cuts.maxHLTIsolTrksPhoOverPt &&
       pho.hltIsolTrks()/pho.et()/pho.et() > cuts.maxHLTIsolTrksPhoOverPt2 ) cutCode |=EgCutCodes::HLTISOLTRKSPHO;
    if(pho.hltIsolHad() > cuts.maxHLTIsolHad && pho.hltIsolHad()/pho.et() > cuts.maxHLTIsolHadOverEt &&
       pho.hltIsolHad()/pho.et()/pho.et() > cuts.maxHLTIsolHadOverEt2) cutCode |=EgCutCodes::HLTISOLHAD;
    if(pho.hltIsolEm() > cuts.maxHLTIsolEm && pho.hltIsolEm()/pho.et() > cuts.maxHLTIsolEmOverEt &&
       pho.hltIsolEm()/pho.et()/pho.et() > cuts.maxHLTIsolEmOverEt2) cutCode |=EgCutCodes::HLTISOLEM;
  }

  //track cuts, photon will automatically fail them (for now)
  cutCode |=EgCutCodes::CTFTRACK;
  cutCode |=EgCutCodes::HLTDETAIN;
  cutCode |=EgCutCodes::HLTDPHIIN;
  cutCode |=EgCutCodes::HLTINVEINVP;
  
  return (cutCode & cuts.cutMask & cutMask) ;
}
bool egHLT::OffEgSel::passCuts ( const OffPho pho,
int  cutMask = ~0x0 
) const [inline]

Definition at line 41 of file EgHLTOffEgSel.h.

References getCutCode().

{return getCutCode(pho,cutMask)==0x0;}
bool egHLT::OffEgSel::passCuts ( const OffEle ele,
int  cutMask = ~0x0 
) const [inline]

Definition at line 37 of file EgHLTOffEgSel.h.

References getCutCode().

{return getCutCode(ele,cutMask)==0x0;}
void egHLT::OffEgSel::setEBCuts ( const EgCutValues cuts) [inline]

Definition at line 45 of file EgHLTOffEgSel.h.

References hpstanc_transforms::cuts, and ebCutValues_.

void egHLT::OffEgSel::setEECuts ( const EgCutValues cuts) [inline]

Definition at line 46 of file EgHLTOffEgSel.h.

References hpstanc_transforms::cuts, and eeCutValues_.

void OffEgSel::setup ( const edm::ParameterSet iConfig)

Member Data Documentation

Definition at line 28 of file EgHLTOffEgSel.h.

Referenced by ebCuts(), getCutCode(), setEBCuts(), and setup().

Definition at line 29 of file EgHLTOffEgSel.h.

Referenced by eeCuts(), getCutCode(), setEECuts(), and setup().