CMS 3D CMS Logo

SuperCluster.cc

Go to the documentation of this file.
00001 // $Id: SuperCluster.cc,v 1.12 2008/04/28 19:46:15 meridian Exp $
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 ), rawEnergy_(-1.) {
00008 }
00009 
00010 SuperCluster::SuperCluster( double energy, const math::XYZPoint& position,
00011                             const BasicClusterRef & seed,
00012                             const BasicClusterRefVector& clusters,
00013                             double Epreshower, double phiWidth, double etaWidth) :
00014   CaloCluster(energy,position), rawEnergy_(-1.)
00015 {
00016   phiWidth_ = phiWidth;
00017   etaWidth_ = etaWidth;
00018   seed_ = seed;
00019   preshowerEnergy_ = Epreshower;
00020 
00021   // set references to constituent basic clusters and update list of rechits
00022   for(BasicClusterRefVector::const_iterator bcit  = clusters.begin();
00023                                             bcit != clusters.end();
00024                                           ++bcit) {
00025     clusters_.push_back( (*bcit) );
00026 
00027     // updated list of used hits
00028     const std::vector<DetId> & v1 = (*bcit)->getHitsByDetId();
00029     for( std::vector<DetId>::const_iterator diIt = v1.begin();
00030                                             diIt != v1.end();
00031                                            ++diIt ) {
00032       usedHits_.push_back( (*diIt) );
00033     } // loop over rechits
00034   } // loop over basic clusters
00035 
00036 }
00037 
00038 double SuperCluster::rawEnergy() const
00039 {
00040   if (rawEnergy_<0) {
00041     rawEnergy_ = 0.;
00042     reco::basicCluster_iterator bcItr;
00043     for(bcItr = clustersBegin(); bcItr != clustersEnd(); bcItr++)
00044       {
00045         rawEnergy_ += (*bcItr)->energy();
00046       }
00047   }
00048   return rawEnergy_;
00049 }

Generated on Tue Jun 9 17:30:44 2009 for CMSSW by  doxygen 1.5.4