CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/RecoEgamma/EgammaHLTAlgos/interface/EgammaHLTHcalIsolation.h

Go to the documentation of this file.
00001 #ifndef EgammaHLTAlgos_EgammaHLTHcalIsolation_h
00002 #define EgammaHLTAlgos_EgammaHLTHcalIsolation_h
00003 // -*- C++ -*-
00004 //
00005 // Package:     EgammaHLTAlgos
00006 // Class  :     EgammaHLTHcalIsolation
00007 // 
00016 //
00017 // Original Author:  Monica Vazquez Acosta - CERN
00018 //         Created:  Tue Jun 13 12:18:35 CEST 2006
00019 // $Id: EgammaHLTHcalIsolation.h,v 1.4 2010/08/12 15:25:02 sharper Exp $
00020 // modifed by Sam Harper (RAL) 27/7/10
00021 
00022 //the class aims to as closely as possible emulate the RECO HCAL isolation
00023 //which uses CaloTowers
00024 //now CaloTowers are just rec-hits with E>Ethres except for tower 28 depth 3
00025 //which equally splits the energy between tower 28 and 29
00026 
00027 #include "DataFormats/EgammaCandidates/interface/Electron.h"
00028 #include "DataFormats/EgammaCandidates/interface/Photon.h"
00029 
00030 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
00031 
00032 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
00033 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00034 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
00035 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00036 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00037 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00038 
00039 #include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
00040 
00041 class HcalSeverityLevelComputer;
00042 class HcalChannelQuality;
00043 
00044 class EgammaHLTHcalIsolation
00045 {
00046 
00047  public:
00048   
00049   EgammaHLTHcalIsolation(float eMinHB,float eMinHE,float etMinHB,float etMinHE,
00050                          float innerCone,float outerCone,int depth) :
00051     eMinHB_(eMinHB),eMinHE_(eMinHE),etMinHB_(etMinHB),etMinHE_(etMinHE),
00052     innerCone_(innerCone),outerCone_(outerCone),depth_(depth),
00053     useRecoveredHcalHits_(1),hcalAcceptSeverityLevel_(9){}//{std::cout <<"innerCone "<<innerCone<<" outerCone "<<outerCone<<std::endl;}
00054     
00055     //first is the sum E, second is the sum Et
00056     std::pair<float,float> getSum(float candEta,float candPhi,
00057                                   const HBHERecHitCollection* hbhe, const CaloGeometry* geometry,
00058                                   const HcalSeverityLevelComputer* hcalSevLvlAlgo=NULL,
00059                                   const HcalChannelQuality* dbHcalChStatus=NULL)const;
00060     float getESum(float candEta,float candPhi, 
00061                   const HBHERecHitCollection* hbhe,
00062                   const CaloGeometry* geometry)const{return getSum(candEta,candPhi,hbhe,geometry).first;}
00063     float getEtSum(float candEta,float candPhi, 
00064                    const HBHERecHitCollection* hbhe, 
00065                    const CaloGeometry* geometry)const{return getSum(candEta,candPhi,hbhe,geometry).second;}
00066     float getESum(float candEta,float candPhi, 
00067                   const HBHERecHitCollection* hbhe,
00068                   const CaloGeometry* geometry,
00069                   const HcalSeverityLevelComputer* hcalSevLvlAlgo,
00070                   const HcalChannelQuality* dbHcalChStatus)const{return getSum(candEta,candPhi,hbhe,geometry,
00071                                                                                hcalSevLvlAlgo,dbHcalChStatus).first;}
00072     float getEtSum(float candEta,float candPhi, 
00073                    const HBHERecHitCollection* hbhe, 
00074                    const CaloGeometry* geometry,
00075                    const HcalSeverityLevelComputer* hcalSevLvlAlgo,
00076                    const HcalChannelQuality* dbHcalChStatus)const{return getSum(candEta,candPhi,hbhe,geometry,
00077                                                                                 hcalSevLvlAlgo,dbHcalChStatus).second;}
00078 
00079     //this is the effective depth of the rec-hit, basically converts 3 depth towers to 2 depths and all barrel to depth 1
00080     //this is defined when making the calotowers
00081     static int getEffectiveDepth(const HcalDetId id);
00082 
00083  private:  
00084     bool acceptHit_(const HcalDetId id,const GlobalPoint& pos,const float hitEnergy,
00085                     const float candEta,const float candPhi)const; 
00086     bool passMinE_(float energy,const HcalDetId id)const;
00087     bool passMinEt_(float et,const HcalDetId id)const;
00088     bool passDepth_(const HcalDetId id)const;
00089     //inspired from CaloTowersCreationAlgo::hcalChanStatusForCaloTower, we dont distingush from good from recovered and prob channels
00090     bool passCleaning_(const CaloRecHit* hit,const HcalSeverityLevelComputer* hcalSevLvlComp,
00091                        const HcalChannelQuality* hcalChanStatus)const;
00092 
00093  private:
00094 
00095   // ---------- member data --------------------------------
00096    // Parameters of isolation cone geometry. 
00097   float eMinHB_;
00098   float eMinHE_;
00099   float etMinHB_;
00100   float etMinHE_;
00101   float innerCone_;
00102   float outerCone_;
00103   int depth_;
00104   
00105   //cleaning parameters
00106   bool useRecoveredHcalHits_;
00107   int hcalAcceptSeverityLevel_;
00108 };
00109 
00110 
00111 #endif