CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
EgammaHLTHcalIsolation Class Reference

#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
 
float getESum (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
 
float getEtSum (float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry, const HcalSeverityLevelComputer *hcalSevLvlAlgo, const HcalChannelQuality *dbHcalChStatus) 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_
 

Detailed Description

Description: sum pt hcal hits in cone around egamma candidate

Usage: <usage>

Definition at line 44 of file EgammaHLTHcalIsolation.h.

Constructor & Destructor Documentation

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.

50  :
51  eMinHB_(eMinHB),eMinHE_(eMinHE),etMinHB_(etMinHB),etMinHE_(etMinHE),
52  innerCone_(innerCone),outerCone_(outerCone),depth_(depth),
53  useRecoveredHcalHits_(1),hcalAcceptSeverityLevel_(9){}//{std::cout <<"innerCone "<<innerCone<<" outerCone "<<outerCone<<std::endl;}

Member Function Documentation

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 reco::deltaR2(), PV3DBase< T, PVType, FrameType >::eta(), create_public_lumi_plots::exp, innerCone_, outerCone_, passDepth_(), passMinE_(), passMinEt_(), PV3DBase< T, PVType, FrameType >::phi(), and funct::sin().

67 {
68  if(passMinE_(hitEnergy,id) && passDepth_(id)){ //doing the energy and depth cuts first will avoid potentially slow eta calc
69  float innerConeSq = innerCone_*innerCone_;
70  float outerConeSq = outerCone_*outerCone_;
71 
72  float hitEta = pos.eta();
73  float hitPhi = pos.phi();
74 
75  float dR2 = reco::deltaR2(candEta,candPhi,hitEta,hitPhi);
76 
77  if(dR2>=innerConeSq && dR2<outerConeSq) { //pass inner and outer cone cuts
78  float hitEt = hitEnergy*sin(2*atan(exp(-hitEta)));
79  if(passMinEt_(hitEt,id)) return true; //and we've passed the last requirement
80  }//end dR check
81  }//end min energy + depth check
82 
83  return false;
84 }
bool passDepth_(const HcalDetId id) const
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
bool passMinEt_(float et, const HcalDetId id) const
double deltaR2(double eta1, double phi1, double eta2, double phi2)
Definition: deltaR.h:13
T eta() const
Definition: PV3DBase.h:75
bool passMinE_(float energy, const HcalDetId id) const
int EgammaHLTHcalIsolation::getEffectiveDepth ( const HcalDetId  id)
static

Definition at line 132 of file EgammaHLTHcalIsolation.cc.

Referenced by passDepth_().

133 {
134  int iEtaAbs = id.ietaAbs();
135  int depth = id.depth();
136  if(iEtaAbs<=17 ||
137  (iEtaAbs<=29 && depth==1) ||
138  (iEtaAbs>=27 && iEtaAbs<=29 && depth==2)){
139  return 1;
140  }else return 2;
141 
142 }
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().

62  {return getSum(candEta,candPhi,hbhe,geometry).first;}
std::pair< float, float > getSum(float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry, const HcalSeverityLevelComputer *hcalSevLvlAlgo=NULL, const HcalChannelQuality *dbHcalChStatus=NULL) const
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().

70  {return getSum(candEta,candPhi,hbhe,geometry,
71  hcalSevLvlAlgo,dbHcalChStatus).first;}
std::pair< float, float > getSum(float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry, const HcalSeverityLevelComputer *hcalSevLvlAlgo=NULL, const HcalChannelQuality *dbHcalChStatus=NULL) const
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().

65  {return getSum(candEta,candPhi,hbhe,geometry).second;}
std::pair< float, float > getSum(float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry, const HcalSeverityLevelComputer *hcalSevLvlAlgo=NULL, const HcalChannelQuality *dbHcalChStatus=NULL) const
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().

76  {return getSum(candEta,candPhi,hbhe,geometry,
77  hcalSevLvlAlgo,dbHcalChStatus).second;}
std::pair< float, float > getSum(float candEta, float candPhi, const HBHERecHitCollection *hbhe, const CaloGeometry *geometry, const HcalSeverityLevelComputer *hcalSevLvlAlgo=NULL, const HcalChannelQuality *dbHcalChStatus=NULL) const
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().

26 {
27  float sumE=0.;
28  float sumEt=0.;
29 
30  for(HBHERecHitCollection::const_iterator hbheItr = hbhe->begin(); hbheItr != hbhe->end(); ++hbheItr){
31  if(passCleaning_(&(*hbheItr),hcalSevLvlAlgo,dbHcalChStatus)){
32  // if(hbheItr->id().ietaAbs()==29) continue;
33 
34  HcalDetId id = hbheItr->id();
35  if(!(id.ietaAbs()==28 && id.depth()==3)){ //default normal case
36  float energy = hbheItr->energy();
37  const GlobalPoint& pos = geometry->getPosition(id);
38  if(acceptHit_(id,pos,energy,candEta,candPhi)){
39  sumE+=energy;
40  sumEt+=energy*sin(pos.theta());
41  }
42  }else{
43  //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
44  float energy = hbheItr->energy()/2.;
45  HcalDetId tower28Id(id.subdet(),28*id.zside(),id.iphi(),2);
46  const GlobalPoint& tower28Pos = geometry->getPosition(tower28Id);
47  if(acceptHit_(id,tower28Pos,energy,candEta,candPhi)){
48  sumE+=energy;
49  sumEt+=energy*sin(tower28Pos.theta());
50  }
51  HcalDetId tower29Id(id.subdet(),29*id.zside(),id.iphi(),2);
52  const GlobalPoint& tower29Pos = geometry->getPosition(tower29Id);
53  if(acceptHit_(id,tower29Pos,energy,candEta,candPhi)){
54  sumE+=energy;
55  sumEt+=energy*sin(tower29Pos.theta());
56  }
57  }//end of the special case for tower 28 depth 3
58  }//end cleaning check
59  }//end of loop over all rec hits
60  return std::make_pair(sumE,sumEt);
61 
62 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
bool passCleaning_(const CaloRecHit *hit, const HcalSeverityLevelComputer *hcalSevLvlComp, const HcalChannelQuality *hcalChanStatus) const
std::vector< T >::const_iterator const_iterator
Geom::Theta< T > theta() const
Definition: PV3DBase.h:74
const GlobalPoint & getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:68
const_iterator end() const
bool acceptHit_(const HcalDetId id, const GlobalPoint &pos, const float hitEnergy, const float candEta, const float candPhi) const
const_iterator begin() const
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_.

112 {
113  if(hcalSevLvlComp==NULL || hcalChanStatus==NULL) return true; //return true if we dont have valid pointers
114 
115  const DetId id = hit->detid();
116 
117  const uint32_t recHitFlag = hit->flags();
118  const uint32_t dbStatusFlag = hcalChanStatus->getValues(id)->getValue();
119 
120  int severityLevel = hcalSevLvlComp->getSeverityLevel(id,recHitFlag,dbStatusFlag);
121  bool isRecovered = hcalSevLvlComp->recoveredRecHit(id,recHitFlag);
122 
123  if(severityLevel == 0) return true;
124  else if(isRecovered) return useRecoveredHcalHits_;
125  else if(severityLevel <= hcalAcceptSeverityLevel_) return true;
126  else return false;
127 }
const DetId & detid() const
Definition: CaloRecHit.h:22
#define NULL
Definition: scimark2.h:8
bool recoveredRecHit(const DetId &myid, const uint32_t &myflag) const
uint32_t flags() const
Definition: CaloRecHit.h:23
Definition: DetId.h:20
int getSeverityLevel(const DetId &myid, const uint32_t &myflag, const uint32_t &mystatus) const
uint32_t getValue() const
const Item * getValues(DetId fId) const
bool EgammaHLTHcalIsolation::passDepth_ ( const HcalDetId  id) const
private

Definition at line 101 of file EgammaHLTHcalIsolation.cc.

References depth_, and getEffectiveDepth().

Referenced by acceptHit_().

102 {
103  if(depth_==-1) return true; //I wish we had chosen 0 as all depths but EgammaTowerIsolation chose -1 and 0 as invalid
104  else if(getEffectiveDepth(id)==depth_) return true;
105  else return false;
106 
107 }
static int getEffectiveDepth(const HcalDetId id)
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_().

87 {
88  if(id.subdet()==HcalBarrel && energy>=eMinHB_) return true;
89  else if(id.subdet()==HcalEndcap && energy>=eMinHE_) return true;
90  else return false;
91 }
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_().

94 {
95  if(id.subdet()==HcalBarrel && et>=etMinHB_) return true;
96  else if(id.subdet()==HcalEndcap && et>=etMinHE_) return true;
97  else return false;
98 
99 }

Member Data Documentation

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_().