#include <RecoEgamma/EgammaHLTAlgos/interface/EgammaHLTHcalIsolation.h>
Public Member Functions | |
EgammaHLTHcalIsolation (float eMinHB, float eMinHE, float etMinHB, float etMinHE, float innerCone, float outerCone, int depth) | |
float | getESum (float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry, const HcalSeverityLevelComputer *hcalSevLvlAlgo, const HcalChannelQuality *dbHcalChStatus) const |
float | getESum (float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry) const |
float | getEtSum (float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry, const HcalSeverityLevelComputer *hcalSevLvlAlgo, const HcalChannelQuality *dbHcalChStatus) const |
float | getEtSum (float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry) const |
std::pair< float, float > | getSum (float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry, const HcalSeverityLevelComputer *hcalSevLvlAlgo=NULL, const HcalChannelQuality *dbHcalChStatus=NULL) const |
Static Public Member Functions | |
static int | getEffectiveDepth (const HcalDetId id) |
Private Member Functions | |
bool | acceptHit_ (const HcalDetId id, const GlobalPoint &pos, const float hitEnergy, const float candEta, const float candPhi) const |
bool | passCleaning_ (const CaloRecHit *hit, const HcalSeverityLevelComputer *hcalSevLvlComp, const HcalChannelQuality *hcalChanStatus) const |
bool | passDepth_ (const HcalDetId id) const |
bool | passMinE_ (float energy, const HcalDetId id) const |
bool | passMinEt_ (float et, const HcalDetId id) const |
Private Attributes | |
int | depth_ |
float | eMinHB_ |
float | eMinHE_ |
float | etMinHB_ |
float | etMinHE_ |
int | hcalAcceptSeverityLevel_ |
float | innerCone_ |
float | outerCone_ |
bool | useRecoveredHcalHits_ |
Description: sum pt hcal hits in cone around egamma candidate
Usage: <usage>
Definition at line 44 of file EgammaHLTHcalIsolation.h.
EgammaHLTHcalIsolation::EgammaHLTHcalIsolation | ( | float | eMinHB, |
float | eMinHE, | ||
float | etMinHB, | ||
float | etMinHE, | ||
float | innerCone, | ||
float | outerCone, | ||
int | depth | ||
) | [inline] |
Definition at line 49 of file EgammaHLTHcalIsolation.h.
: eMinHB_(eMinHB),eMinHE_(eMinHE),etMinHB_(etMinHB),etMinHE_(etMinHE), innerCone_(innerCone),outerCone_(outerCone),depth_(depth), useRecoveredHcalHits_(1),hcalAcceptSeverityLevel_(9){}//{std::cout <<"innerCone "<<innerCone<<" outerCone "<<outerCone<<std::endl;}
bool EgammaHLTHcalIsolation::acceptHit_ | ( | const HcalDetId | id, |
const GlobalPoint & | pos, | ||
const float | hitEnergy, | ||
const float | candEta, | ||
const float | candPhi | ||
) | const [private] |
Definition at line 66 of file EgammaHLTHcalIsolation.cc.
References Geom::deltaR2(), PV3DBase< T, PVType, FrameType >::eta(), funct::exp(), innerCone_, outerCone_, passDepth_(), passMinE_(), passMinEt_(), PV3DBase< T, PVType, FrameType >::phi(), and funct::sin().
{ if(passMinE_(hitEnergy,id) && passDepth_(id)){ //doing the energy and depth cuts first will avoid potentially slow eta calc float innerConeSq = innerCone_*innerCone_; float outerConeSq = outerCone_*outerCone_; float hitEta = pos.eta(); float hitPhi = pos.phi(); float dR2 = reco::deltaR2(candEta,candPhi,hitEta,hitPhi); if(dR2>=innerConeSq && dR2<outerConeSq) { //pass inner and outer cone cuts float hitEt = hitEnergy*sin(2*atan(exp(-hitEta))); if(passMinEt_(hitEt,id)) return true; //and we've passed the last requirement }//end dR check }//end min energy + depth check return false; }
int EgammaHLTHcalIsolation::getEffectiveDepth | ( | const HcalDetId | id | ) | [static] |
Definition at line 132 of file EgammaHLTHcalIsolation.cc.
Referenced by passDepth_().
{ int iEtaAbs = id.ietaAbs(); int depth = id.depth(); if(iEtaAbs<=17 || (iEtaAbs<=29 && depth==1) || (iEtaAbs>=27 && iEtaAbs<=29 && depth==2)){ return 1; }else return 2; }
float EgammaHLTHcalIsolation::getESum | ( | float | candEta, |
float | candPhi, | ||
const HBHERecHitCollection * | hbhe, | ||
const CaloGeometry * | geometry, | ||
const HcalSeverityLevelComputer * | hcalSevLvlAlgo, | ||
const HcalChannelQuality * | dbHcalChStatus | ||
) | const [inline] |
Definition at line 66 of file EgammaHLTHcalIsolation.h.
References getSum().
{return getSum(candEta,candPhi,hbhe,geometry, hcalSevLvlAlgo,dbHcalChStatus).first;}
float EgammaHLTHcalIsolation::getESum | ( | float | candEta, |
float | candPhi, | ||
const HBHERecHitCollection * | hbhe, | ||
const CaloGeometry * | geometry | ||
) | const [inline] |
Definition at line 60 of file EgammaHLTHcalIsolation.h.
References getSum().
Referenced by EgammaHLTHcalIsolationProducersRegional::produce().
{return getSum(candEta,candPhi,hbhe,geometry).first;}
float EgammaHLTHcalIsolation::getEtSum | ( | float | candEta, |
float | candPhi, | ||
const HBHERecHitCollection * | hbhe, | ||
const CaloGeometry * | geometry, | ||
const HcalSeverityLevelComputer * | hcalSevLvlAlgo, | ||
const HcalChannelQuality * | dbHcalChStatus | ||
) | const [inline] |
Definition at line 72 of file EgammaHLTHcalIsolation.h.
References getSum().
{return getSum(candEta,candPhi,hbhe,geometry, hcalSevLvlAlgo,dbHcalChStatus).second;}
float EgammaHLTHcalIsolation::getEtSum | ( | float | candEta, |
float | candPhi, | ||
const HBHERecHitCollection * | hbhe, | ||
const CaloGeometry * | geometry | ||
) | const [inline] |
Definition at line 63 of file EgammaHLTHcalIsolation.h.
References getSum().
Referenced by EgammaHLTHcalIsolationProducersRegional::produce().
{return getSum(candEta,candPhi,hbhe,geometry).second;}
std::pair< float, float > EgammaHLTHcalIsolation::getSum | ( | float | candEta, |
float | candPhi, | ||
const HBHERecHitCollection * | hbhe, | ||
const CaloGeometry * | geometry, | ||
const HcalSeverityLevelComputer * | hcalSevLvlAlgo = NULL , |
||
const HcalChannelQuality * | dbHcalChStatus = NULL |
||
) | const |
Definition at line 25 of file EgammaHLTHcalIsolation.cc.
References relval_parameters_module::energy, geometry, pos, funct::sin(), and PV3DBase< T, PVType, FrameType >::theta().
Referenced by getESum(), and getEtSum().
{ float sumE=0.; float sumEt=0.; for(HBHERecHitCollection::const_iterator hbheItr = hbhe->begin(); hbheItr != hbhe->end(); ++hbheItr){ if(passCleaning_(&(*hbheItr),hcalSevLvlAlgo,dbHcalChStatus)){ // if(hbheItr->id().ietaAbs()==29) continue; HcalDetId id = hbheItr->id(); if(!(id.ietaAbs()==28 && id.depth()==3)){ //default normal case float energy = hbheItr->energy(); const GlobalPoint& pos = geometry->getPosition(id); if(acceptHit_(id,pos,energy,candEta,candPhi)){ sumE+=energy; sumEt+=energy*sin(pos.theta()); } }else{ //the special case, tower 28 depth 3 is split between tower 28 and 29 when using calo towers so we have to emulate it. To do this we need to divide energy by 2 and then check seperately if 28 and 29 are accepted float energy = hbheItr->energy()/2.; HcalDetId tower28Id(id.subdet(),28*id.zside(),id.iphi(),2); const GlobalPoint& tower28Pos = geometry->getPosition(tower28Id); if(acceptHit_(id,tower28Pos,energy,candEta,candPhi)){ sumE+=energy; sumEt+=energy*sin(tower28Pos.theta()); } HcalDetId tower29Id(id.subdet(),29*id.zside(),id.iphi(),2); const GlobalPoint& tower29Pos = geometry->getPosition(tower29Id); if(acceptHit_(id,tower29Pos,energy,candEta,candPhi)){ sumE+=energy; sumEt+=energy*sin(tower29Pos.theta()); } }//end of the special case for tower 28 depth 3 }//end cleaning check }//end of loop over all rec hits return std::make_pair(sumE,sumEt); }
bool EgammaHLTHcalIsolation::passCleaning_ | ( | const CaloRecHit * | hit, |
const HcalSeverityLevelComputer * | hcalSevLvlComp, | ||
const HcalChannelQuality * | hcalChanStatus | ||
) | const [private] |
Definition at line 110 of file EgammaHLTHcalIsolation.cc.
References CaloRecHit::detid(), CaloRecHit::flags(), HcalSeverityLevelComputer::getSeverityLevel(), HcalChannelStatus::getValue(), HcalCondObjectContainer< Item >::getValues(), hcalAcceptSeverityLevel_, NULL, HcalSeverityLevelComputer::recoveredRecHit(), and useRecoveredHcalHits_.
{ if(hcalSevLvlComp==NULL || hcalChanStatus==NULL) return true; //return true if we dont have valid pointers const DetId id = hit->detid(); const uint32_t recHitFlag = hit->flags(); const uint32_t dbStatusFlag = hcalChanStatus->getValues(id)->getValue(); int severityLevel = hcalSevLvlComp->getSeverityLevel(id,recHitFlag,dbStatusFlag); bool isRecovered = hcalSevLvlComp->recoveredRecHit(id,recHitFlag); if(severityLevel == 0) return true; else if(isRecovered) return useRecoveredHcalHits_; else if(severityLevel <= hcalAcceptSeverityLevel_) return true; else return false; }
bool EgammaHLTHcalIsolation::passDepth_ | ( | const HcalDetId | id | ) | const [private] |
Definition at line 101 of file EgammaHLTHcalIsolation.cc.
References depth_, and getEffectiveDepth().
Referenced by acceptHit_().
{ if(depth_==-1) return true; //I wish we had chosen 0 as all depths but EgammaTowerIsolation chose -1 and 0 as invalid else if(getEffectiveDepth(id)==depth_) return true; else return false; }
bool EgammaHLTHcalIsolation::passMinE_ | ( | float | energy, |
const HcalDetId | id | ||
) | const [private] |
Definition at line 86 of file EgammaHLTHcalIsolation.cc.
References eMinHB_, eMinHE_, HcalBarrel, and HcalEndcap.
Referenced by acceptHit_().
{ if(id.subdet()==HcalBarrel && energy>=eMinHB_) return true; else if(id.subdet()==HcalEndcap && energy>=eMinHE_) return true; else return false; }
bool EgammaHLTHcalIsolation::passMinEt_ | ( | float | et, |
const HcalDetId | id | ||
) | const [private] |
Definition at line 93 of file EgammaHLTHcalIsolation.cc.
References etMinHB_, etMinHE_, HcalBarrel, and HcalEndcap.
Referenced by acceptHit_().
{ if(id.subdet()==HcalBarrel && et>=etMinHB_) return true; else if(id.subdet()==HcalEndcap && et>=etMinHE_) return true; else return false; }
int EgammaHLTHcalIsolation::depth_ [private] |
Definition at line 103 of file EgammaHLTHcalIsolation.h.
Referenced by passDepth_().
float EgammaHLTHcalIsolation::eMinHB_ [private] |
Definition at line 97 of file EgammaHLTHcalIsolation.h.
Referenced by passMinE_().
float EgammaHLTHcalIsolation::eMinHE_ [private] |
Definition at line 98 of file EgammaHLTHcalIsolation.h.
Referenced by passMinE_().
float EgammaHLTHcalIsolation::etMinHB_ [private] |
Definition at line 99 of file EgammaHLTHcalIsolation.h.
Referenced by passMinEt_().
float EgammaHLTHcalIsolation::etMinHE_ [private] |
Definition at line 100 of file EgammaHLTHcalIsolation.h.
Referenced by passMinEt_().
int EgammaHLTHcalIsolation::hcalAcceptSeverityLevel_ [private] |
Definition at line 107 of file EgammaHLTHcalIsolation.h.
Referenced by passCleaning_().
float EgammaHLTHcalIsolation::innerCone_ [private] |
Definition at line 101 of file EgammaHLTHcalIsolation.h.
Referenced by acceptHit_().
float EgammaHLTHcalIsolation::outerCone_ [private] |
Definition at line 102 of file EgammaHLTHcalIsolation.h.
Referenced by acceptHit_().
bool EgammaHLTHcalIsolation::useRecoveredHcalHits_ [private] |
Definition at line 106 of file EgammaHLTHcalIsolation.h.
Referenced by passCleaning_().