CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/EgammaCandidates/interface/Photon.h

Go to the documentation of this file.
00001 #ifndef EgammaCandidates_Photon_h
00002 #define EgammaCandidates_Photon_h
00003 
00013 #include "DataFormats/RecoCandidate/interface/RecoCandidate.h"
00014 #include "DataFormats/EgammaCandidates/interface/ConversionFwd.h"
00015 #include "DataFormats/EgammaCandidates/interface/PhotonCore.h"
00016 #include "DataFormats/EgammaReco/interface/ElectronSeed.h"
00017 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
00018 #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
00019 
00020 
00021 namespace reco {
00022 
00023   class Photon : public RecoCandidate {
00024   public:
00026     struct  FiducialFlags;
00027     struct  IsolationVariables;
00028     struct  ShowerShape;
00029     
00031     Photon() : RecoCandidate() { pixelSeed_=false; }
00032 
00034     Photon ( const Photon&); 
00035 
00037     Photon( const LorentzVector & p4, 
00038             Point caloPos, 
00039             const PhotonCoreRef & core,  
00040             const Point & vtx = Point( 0, 0, 0 ) );
00041 
00043     virtual ~Photon();
00044 
00046     virtual Photon * clone() const;
00047 
00049     reco::PhotonCoreRef photonCore() const { return photonCore_;}
00050     //
00052     //
00053     // retrieve provenance
00054     bool isPFlowPhoton() const {return this->photonCore()->isPFlowPhoton();}
00055     bool isStandardPhoton() const {return this->photonCore()->isStandardPhoton();}
00057     reco::SuperClusterRef superCluster() const {return this->photonCore()->superCluster();}
00059     reco::SuperClusterRef pfSuperCluster() const {return this->photonCore()->pfSuperCluster();}
00061     reco::ConversionRefVector conversions() const {return this->photonCore()->conversions() ;}  
00063     bool hasConversionTracks() const { if (this->photonCore()->conversions().size() > 0)  return true; else return false;}
00065     reco::ElectronSeedRefVector electronPixelSeeds() const {return this->photonCore()->electronPixelSeeds();}
00067     bool hasPixelSeed() const { if ((this->photonCore()->electronPixelSeeds()).size() > 0 ) return true; else return false; }
00068 
00069 
00070  
00072     math::XYZPointF caloPosition() const {return caloPosition_;}
00074     void setVertex(const Point & vertex);
00076     bool isPhoton() const { return true ; }
00077 
00078     //=======================================================
00079     // Fiducial Flags
00080     //=======================================================
00081     struct  FiducialFlags
00082     {
00083       
00084       //Fiducial flags
00085       bool isEB;//Photon is in EB
00086       bool isEE;//Photon is in EE
00087       bool isEBEtaGap;//Photon is in supermodule/supercrystal eta gap in EB
00088       bool isEBPhiGap;//Photon is in supermodule/supercrystal phi gap in EB
00089       bool isEERingGap;//Photon is in crystal ring gap in EE
00090       bool isEEDeeGap;//Photon is in crystal dee gap in EE
00091       bool isEBEEGap;//Photon is in border between EB and EE.
00092       
00093       FiducialFlags():
00094         isEB(false),
00095            isEE(false),
00096            isEBEtaGap(false),
00097            isEBPhiGap(false),
00098            isEERingGap(false),
00099            isEEDeeGap(false),
00100            isEBEEGap(false)
00101            
00102       {}
00103       
00104       
00105     };
00106 
00108     void setFiducialVolumeFlags  ( const FiducialFlags&  a )  { fiducialFlagBlock_= a ;}
00111     bool isEB() const{return  fiducialFlagBlock_.isEB;}
00112     // true if photon is in ECAL endcap
00113     bool isEE() const{return fiducialFlagBlock_.isEE;}
00115     bool isEBGap() const { return (isEBEtaGap() || isEBPhiGap()); }
00116     bool isEBEtaGap() const{return fiducialFlagBlock_.isEBEtaGap;}
00117     bool isEBPhiGap() const{return fiducialFlagBlock_.isEBPhiGap;}
00119     bool isEEGap() const { return (isEERingGap() || isEEDeeGap()); }
00120     bool isEERingGap() const{return fiducialFlagBlock_.isEERingGap;}
00121     bool isEEDeeGap() const{return fiducialFlagBlock_.isEEDeeGap;}
00123     bool isEBEEGap() const{return fiducialFlagBlock_.isEBEEGap;}
00124 
00125     //=======================================================
00126     // Shower Shape Variables
00127     //=======================================================
00128 
00129     struct ShowerShape
00130     {
00131       float sigmaEtaEta ;
00132       float sigmaIetaIeta ;
00133       float e1x5 ;
00134       float e2x5 ;
00135       float e3x3 ;
00136       float e5x5 ;
00137       float maxEnergyXtal ; 
00138       float hcalDepth1OverEcal ; // hcal over ecal energy using first hcal depth
00139       float hcalDepth2OverEcal ; // hcal over ecal energy using 2nd hcal depth
00140       ShowerShape()
00141         : sigmaEtaEta(std::numeric_limits<float>::infinity()),
00142            sigmaIetaIeta(std::numeric_limits<float>::infinity()),
00143            e1x5(0), 
00144            e2x5(0), 
00145            e3x3(0), 
00146            e5x5(0), 
00147            maxEnergyXtal(0),
00148            hcalDepth1OverEcal(0),
00149            hcalDepth2OverEcal(0)
00150            
00151       {}
00152     } ;
00153     void setShowerShapeVariables ( const ShowerShape& a )     { showerShapeBlock_ = a ;}
00155     float hadronicOverEm() const {return   showerShapeBlock_.hcalDepth1OverEcal + showerShapeBlock_.hcalDepth2OverEcal  ;}
00157     float hadronicDepth1OverEm() const {return  showerShapeBlock_.hcalDepth1OverEcal  ;}
00159     float hadronicDepth2OverEm() const {return  showerShapeBlock_.hcalDepth2OverEcal  ;}
00160 
00162     float e1x5()            const {return showerShapeBlock_.e1x5;}
00163     float e2x5()            const {return showerShapeBlock_.e2x5;}
00164     float e3x3()            const {return showerShapeBlock_.e3x3;}
00165     float e5x5()            const {return showerShapeBlock_.e5x5;}
00166     float maxEnergyXtal()   const {return showerShapeBlock_.maxEnergyXtal;}
00167     float sigmaEtaEta()     const {return showerShapeBlock_.sigmaEtaEta;}
00168     float sigmaIetaIeta()   const {return showerShapeBlock_.sigmaIetaIeta;}
00169     float r1x5 ()           const {return showerShapeBlock_.e1x5/showerShapeBlock_.e5x5;}
00170     float r2x5 ()           const {return showerShapeBlock_.e2x5/showerShapeBlock_.e5x5;}
00171     float r9 ()             const {return showerShapeBlock_.e3x3/this->superCluster()->rawEnergy();}  
00172 
00173 
00174 
00175     //=======================================================
00176     // Isolation Variables
00177     //=======================================================
00178 
00179     struct IsolationVariables
00180     {
00181       //These are analysis quantities calculated in the PhotonIDAlgo class
00182       
00183       //EcalRecHit isolation
00184       float ecalRecHitSumEt;
00185       //HcalDepth1Tower isolation
00186       float hcalTowerSumEt;
00187       //HcalDepth1Tower isolation
00188       float hcalDepth1TowerSumEt;
00189       //HcalDepth2Tower isolation
00190       float hcalDepth2TowerSumEt;
00191       //Sum of track pT in a cone of dR
00192       float trkSumPtSolidCone;
00193       //Sum of track pT in a hollow cone of outer radius, inner radius
00194       float trkSumPtHollowCone;
00195       //Number of tracks in a cone of dR
00196       int nTrkSolidCone;
00197       //Number of tracks in a hollow cone of outer radius, inner radius
00198       int nTrkHollowCone;
00199       
00200       IsolationVariables():
00201         
00202         ecalRecHitSumEt(0),
00203            hcalTowerSumEt(0),
00204            hcalDepth1TowerSumEt(0),
00205            hcalDepth2TowerSumEt(0),
00206            trkSumPtSolidCone(0),
00207            trkSumPtHollowCone(0),
00208            nTrkSolidCone(0),
00209            nTrkHollowCone(0)
00210            
00211       {}
00212       
00213       
00214     };
00215 
00216 
00217     struct PflowIsolationVariables
00218     {
00219 
00220       float chargedHadronIso;
00221       float neutralHadronIso;
00222       float photonIso ;
00223       
00224       
00225       PflowIsolationVariables():
00226         
00227         chargedHadronIso(0),
00228         neutralHadronIso(0),
00229         photonIso(0)
00230                    
00231       {}
00232       
00233       
00234     };
00235 
00236     
00238     void setIsolationVariables ( const IsolationVariables& isolInDr04, const IsolationVariables& isolInDr03) {  isolationR04_ = isolInDr04 ; isolationR03_ = isolInDr03 ;} 
00240     void setPflowIsolationVariables ( const PflowIsolationVariables& pfisol ) {  pfIsolation_ = pfisol;} 
00241 
00244     float ecalRecHitSumEtConeDR04()      const{return  isolationR04_.ecalRecHitSumEt;}
00246     float hcalTowerSumEtConeDR04()      const{return  isolationR04_.hcalTowerSumEt ;}
00248     float hcalDepth1TowerSumEtConeDR04()      const{return  isolationR04_.hcalDepth1TowerSumEt;}
00250     float hcalDepth2TowerSumEtConeDR04()      const{return  isolationR04_.hcalDepth2TowerSumEt;}
00251     //  Track pT sum c
00252     float trkSumPtSolidConeDR04()    const{return   isolationR04_.trkSumPtSolidCone;}
00253     //As above, excluding the core at the center of the cone
00254     float trkSumPtHollowConeDR04()   const{return   isolationR04_.trkSumPtHollowCone;}
00255     //Returns number of tracks in a cone of dR
00256     int nTrkSolidConeDR04()              const{return   isolationR04_.nTrkSolidCone;}
00257     //As above, excluding the core at the center of the cone
00258     int nTrkHollowConeDR04()            const{return   isolationR04_.nTrkHollowCone;}
00259     //
00261     float ecalRecHitSumEtConeDR03()      const{return  isolationR03_.ecalRecHitSumEt;}
00263     float hcalTowerSumEtConeDR03()      const{return isolationR03_.hcalTowerSumEt;}
00265     float hcalDepth1TowerSumEtConeDR03()      const{return isolationR03_.hcalDepth1TowerSumEt;}
00267     float hcalDepth2TowerSumEtConeDR03()      const{return isolationR03_.hcalDepth2TowerSumEt;}
00268     //  Track pT sum c
00269     float trkSumPtSolidConeDR03()    const{return  isolationR03_.trkSumPtSolidCone;}
00270     //As above, excluding the core at the center of the cone
00271     float trkSumPtHollowConeDR03()   const{return  isolationR03_.trkSumPtHollowCone;}
00272     //Returns number of tracks in a cone of dR
00273     int nTrkSolidConeDR03()              const{return  isolationR03_.nTrkSolidCone;}
00274     //As above, excluding the core at the center of the cone
00275     int nTrkHollowConeDR03()             const{return  isolationR03_.nTrkHollowCone;}
00276 
00277 
00278 
00280     float chargedHadronIso() const {return  pfIsolation_.chargedHadronIso;}
00281     float neutralHadronIso() const {return  pfIsolation_.neutralHadronIso;}
00282     float photonIso() const {return  pfIsolation_.photonIso;}
00283 
00284 
00285   private:
00287     virtual bool overlap( const Candidate & ) const;
00289     math::XYZPointF caloPosition_;
00291     reco::PhotonCoreRef photonCore_;
00292     //
00293     bool pixelSeed_;
00294     //
00295     FiducialFlags fiducialFlagBlock_;
00296     IsolationVariables isolationR04_;
00297     IsolationVariables isolationR03_;
00298     ShowerShape        showerShapeBlock_;
00299     PflowIsolationVariables pfIsolation_;
00300  
00301 
00302   };
00303   
00304 }
00305 
00306 #endif