CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/DataFormats/EgammaReco/interface/SuperCluster.h

Go to the documentation of this file.
00001 #ifndef EgammaReco_SuperCluster_h
00002 #define EgammaReco_SuperCluster_h
00003 
00013 #include "DataFormats/Math/interface/Point3D.h"
00014 #include "DataFormats/CaloRecHit/interface/CaloCluster.h"
00015 #include "DataFormats/CaloRecHit/interface/CaloClusterFwd.h"
00016 #include "DataFormats/DetId/interface/DetId.h"
00017 
00018 
00019 namespace reco {
00020   class SuperCluster : public CaloCluster {
00021   public:
00022 
00023     typedef math::XYZPoint Point;
00024 
00026     SuperCluster() : CaloCluster(0., Point(0.,0.,0.)), preshowerEnergy_(0), rawEnergy_(-1.), phiWidth_(0), etaWidth_(0) {}
00027 
00029     SuperCluster( double energy, const Point& position );
00030 
00031     SuperCluster( double energy, const Point& position,
00032                   const CaloClusterPtr & seed,
00033                   const CaloClusterPtrVector& clusters,
00034                   double Epreshower=0.,
00035                   double phiWidth=0., double etaWidth=0. );
00036 
00037     // to be merged in the previous one? -- FIXME
00038     SuperCluster( double energy, const Point& position,
00039                   const CaloClusterPtr & seed,
00040                   const CaloClusterPtrVector& clusters,
00041                   const CaloClusterPtrVector& preshowerClusters,
00042                   double Epreshower=0.,
00043                   double phiWidth=0., double etaWidth=0. );
00044 
00045 
00047     double rawEnergy() const { return rawEnergy_; }
00048 
00050     double preshowerEnergy() const { return preshowerEnergy_; }
00051 
00053     double phiWidth() const { return phiWidth_; }
00054     double etaWidth() const { return etaWidth_; }
00055 
00056     //Assign new variables to supercluster
00057     void setPreshowerEnergy( double preshowerEnergy ) { preshowerEnergy_ = preshowerEnergy; };
00058     void setPhiWidth( double pw ) { phiWidth_ = pw; }
00059     void setEtaWidth( double ew ) { etaWidth_ = ew; }
00060 
00062     const CaloClusterPtr & seed() const { return seed_; }
00063 
00065     CaloCluster_iterator clustersBegin() const { return clusters_.begin(); }
00066 
00068     CaloCluster_iterator clustersEnd() const { return clusters_.end(); }
00069 
00071     CaloCluster_iterator preshowerClustersBegin() const { return preshowerClusters_.begin(); }
00072 
00074     CaloCluster_iterator preshowerClustersEnd() const { return preshowerClusters_.end(); }
00075 
00077     size_t clustersSize() const { return clusters_.size(); }
00078 
00080     //std::vector<DetId> getHitsByDetId() const { return usedHits_; }
00081 
00083     void setSeed( const CaloClusterPtr & r ) { seed_ = r; }
00084 
00086     void addCluster( const CaloClusterPtr & r ) { 
00087       clusters_.push_back( r ); 
00088       computeRawEnergy();
00089     }
00090 
00092     void addPreshowerCluster( const CaloClusterPtr & r ) { preshowerClusters_.push_back( r ); }
00093 
00100     void setPreshowerPlanesStatus(const uint32_t& status){
00101       uint32_t flags = flags_ & flagsMask_;
00102       flags_= flags | (status << flagsOffset_);
00103     }
00104 
00110     const int  getPreshowerPlanesStatus() const {
00111       return (flags_>>flagsOffset_);
00112     }
00113 
00114   private:
00115 
00116     void computeRawEnergy();
00117 
00119     CaloClusterPtr seed_;
00120 
00122     CaloClusterPtrVector clusters_;
00123 
00125     CaloClusterPtrVector preshowerClusters_;
00126 
00128     //std::vector<DetId> usedHits_;
00129 
00130     double preshowerEnergy_;
00131 
00132     double rawEnergy_;
00133     
00134     double phiWidth_;
00135     double etaWidth_;
00136 
00137   };
00138 
00139 }
00140 #endif