Go to the documentation of this file.00001
00002 #include "DataFormats/EgammaReco/interface/BasicCluster.h"
00003 #include "DataFormats/EgammaReco/interface/SuperCluster.h"
00004 using namespace reco;
00005
00006 SuperCluster::SuperCluster( double energy, const math::XYZPoint& position ) :
00007 CaloCluster( energy, position ), preshowerEnergy_(0), rawEnergy_(0), phiWidth_(0), etaWidth_(0), preshowerEnergy1_(0), preshowerEnergy2_(0) {
00008 }
00009
00010
00011
00012 SuperCluster::SuperCluster( double energy, const math::XYZPoint& position,
00013 const CaloClusterPtr & seed,
00014 const CaloClusterPtrVector& clusters,
00015 double Epreshower, double phiWidth, double etaWidth, double Epreshower1, double Epreshower2) :
00016 CaloCluster(energy,position), rawEnergy_(0)
00017 {
00018 phiWidth_ = phiWidth;
00019 etaWidth_ = etaWidth;
00020 seed_ = seed;
00021 preshowerEnergy_ = Epreshower;
00022 preshowerEnergy1_ = Epreshower1;
00023 preshowerEnergy2_ = Epreshower2;
00024
00025
00026 for(CaloClusterPtrVector::const_iterator bcit = clusters.begin();
00027 bcit != clusters.end();
00028 ++bcit) {
00029 clusters_.push_back( (*bcit) );
00030
00031
00032 const std::vector< std::pair<DetId, float> > & v1 = (*bcit)->hitsAndFractions();
00033 for( std::vector< std::pair<DetId, float> >::const_iterator diIt = v1.begin();
00034 diIt != v1.end();
00035 ++diIt ) {
00036 hitsAndFractions_.push_back( (*diIt) );
00037 }
00038 }
00039
00040 computeRawEnergy();
00041 }
00042
00043
00044
00045 SuperCluster::SuperCluster( double energy, const math::XYZPoint& position,
00046 const CaloClusterPtr & seed,
00047 const CaloClusterPtrVector& clusters,
00048 const CaloClusterPtrVector& preshowerClusters,
00049 double Epreshower, double phiWidth, double etaWidth, double Epreshower1, double Epreshower2) :
00050 CaloCluster(energy,position), rawEnergy_(-1.)
00051 {
00052 phiWidth_ = phiWidth;
00053 etaWidth_ = etaWidth;
00054 seed_ = seed;
00055 preshowerEnergy_ = Epreshower;
00056 preshowerEnergy1_ = Epreshower1;
00057 preshowerEnergy2_ = Epreshower2;
00058
00059
00060 for(CaloClusterPtrVector::const_iterator bcit = clusters.begin();
00061 bcit != clusters.end();
00062 ++bcit) {
00063 clusters_.push_back( (*bcit) );
00064
00065
00066 const std::vector< std::pair<DetId, float> > & v1 = (*bcit)->hitsAndFractions();
00067 for( std::vector< std::pair<DetId, float> >::const_iterator diIt = v1.begin();
00068 diIt != v1.end();
00069 ++diIt ) {
00070 hitsAndFractions_.push_back( (*diIt) );
00071 }
00072 }
00073
00074
00075 for(CaloClusterPtrVector::const_iterator pcit = preshowerClusters.begin();
00076 pcit != preshowerClusters.end();
00077 ++pcit) {
00078 preshowerClusters_.push_back( (*pcit) );
00079 }
00080 computeRawEnergy();
00081 }
00082
00083
00084
00085 void SuperCluster::computeRawEnergy() {
00086
00087 rawEnergy_ = 0.;
00088 for(CaloClusterPtrVector::const_iterator bcItr = clustersBegin();
00089 bcItr != clustersEnd(); bcItr++){
00090 rawEnergy_ += (*bcItr)->energy();
00091 }
00092 }