CMS 3D CMS Logo

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

Go to the documentation of this file.
00001 // $Id: Photon.cc,v 1.22.2.1 2011/03/08 17:55:59 chamont Exp $
00002 #include "DataFormats/EgammaCandidates/interface/Photon.h"
00003 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
00004 
00005 using namespace reco;
00006 
00007 Photon::Photon( const LorentzVector & p4,
00008                 Point caloPos,
00009     const PhotonCoreRef & core,
00010                 const Point & vtx) :
00011     RecoCandidate( 0, p4, vtx, 22 ),
00012     caloPosition_( caloPos ),
00013     photonCore_(core),
00014     pixelSeed_(false)
00015  {}
00016 
00017 
00018 Photon::Photon( const Photon& rhs ) :
00019   RecoCandidate(rhs),
00020   caloPosition_(rhs.caloPosition_),
00021   photonCore_ ( rhs.photonCore_),
00022   pixelSeed_  ( rhs.pixelSeed_ ),
00023   fiducialFlagBlock_ ( rhs.fiducialFlagBlock_ ),
00024   isolationR04_ ( rhs.isolationR04_),
00025   isolationR03_ ( rhs.isolationR03_),
00026   showerShapeBlock_ ( rhs.showerShapeBlock_),
00027   pfIsolation_ ( rhs.pfIsolation_ )
00028  {}
00029 
00030 
00031 
00032 
00033 Photon::~Photon() { }
00034 
00035 Photon * Photon::clone() const {
00036   return new Photon( * this );
00037 }
00038 
00039 
00040 bool Photon::overlap( const Candidate & c ) const {
00041   const RecoCandidate * o = dynamic_cast<const RecoCandidate *>( & c );
00042   return ( o != 0 &&
00043            ( checkOverlap( superCluster(), o->superCluster() ) )
00044            );
00045   return false;
00046 }
00047 
00048 void Photon::setVertex(const Point & vertex) {
00049   math::XYZVectorF direction = caloPosition() - vertex;
00050   double energy = this->energy();
00051   math::XYZVectorF momentum = direction.unit() * energy;
00052   math::XYZTLorentzVector lv(momentum.x(), momentum.y(), momentum.z(), energy );
00053   setP4(lv);
00054   vertex_ = vertex;
00055 }
00056 
00057