CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DataFormats/CastorReco/interface/CastorTower.h

Go to the documentation of this file.
00001 #ifndef CastorReco_CastorTower_h
00002 #define CastorReco_CastorTower_h
00003 
00012 #include <vector>
00013 #include <memory>
00014 #include "DataFormats/Math/interface/Point3D.h"
00015 
00016 #include "DataFormats/Common/interface/RefProd.h"
00017 #include "DataFormats/Common/interface/Ref.h"
00018 #include "DataFormats/Common/interface/RefVector.h"
00019 #include "DataFormats/Common/interface/SortedCollection.h"
00020 
00021 #include "DataFormats/HcalRecHit/interface/CastorRecHit.h"
00022 //#include "DataFormats/HcalRecHit/interface/HcalRecHitFwd.h"
00023 #include "DataFormats/Candidate/interface/LeafCandidate.h"
00024 
00025 namespace reco {
00026 
00027   class CastorTower : public LeafCandidate {
00028   public:
00029      
00030     typedef edm::SortedCollection<CastorRecHit> CastorRecHitCollection;
00031     typedef edm::Ref<CastorRecHitCollection> CastorRecHitRef;
00032     typedef edm::RefVector<CastorRecHitCollection> CastorRecHitRefs;
00033     
00034     // default constructor. Set energy and position to zero
00035  
00036     CastorTower() : energy_(0.), position_(ROOT::Math::XYZPoint(0.,0.,0.)), emEnergy_(0.), hadEnergy_(0.), fem_(0.), depth_(0.), fhot_(0.) { }
00037 
00038     // constructor from values
00039     CastorTower(const double energy, const ROOT::Math::XYZPoint& position, const double emEnergy, const double hadEnergy, const double fem,
00040                 const double depth, const double fhot, const CastorRecHitRefs& usedRecHits);
00041 
00043     virtual ~CastorTower();
00044 
00046     double energy() const { return energy_; }
00047 
00049     ROOT::Math::XYZPoint position() const { return position_; }
00050     
00052     double emEnergy() const { return emEnergy_; }
00053     
00055     double hadEnergy() const { return hadEnergy_; }
00056     
00058     double fem() const { return fem_; }
00059     
00061     double depth() const { return depth_; }
00062     
00064     double fhot() const { return fhot_; }
00065 
00067     CastorRecHitRefs getUsedRecHits() const { return usedRecHits_; }
00068 
00070     CastorRecHitRefs::iterator rechitsBegin() const { return usedRecHits_.begin(); }
00071 
00073     CastorRecHitRefs::iterator rechitsEnd() const { return usedRecHits_.end(); }
00074 
00076     size_t rechitsSize() const { return usedRecHits_.size(); }
00077 
00079     void add( const CastorRecHitRef& rechit ) { usedRecHits_.push_back( rechit ); }
00080 
00082     bool operator >=(const CastorTower& rhs) const { return (energy_>=rhs.energy_); }
00083 
00085     bool operator > (const CastorTower& rhs) const { return (energy_> rhs.energy_); }
00086 
00088     bool operator <=(const CastorTower& rhs) const { return (energy_<=rhs.energy_); }
00089 
00091     bool operator < (const CastorTower& rhs) const { return (energy_< rhs.energy_); }
00092 
00094     double eta() const { return position_.eta(); }
00095 
00097     double phi() const { return position_.phi(); }
00098 
00100     double x() const { return position_.x(); }
00101 
00103     double y() const { return position_.y(); }
00104 
00106     double rho() const { return position_.rho(); }
00107 
00108   private:
00109 
00111     double energy_;
00112     
00114     ROOT::Math::XYZPoint position_;
00115     
00117     double emEnergy_;
00118     
00120     double hadEnergy_;
00121     
00123     double fem_;
00124     
00126     double depth_;
00127 
00129     double fhot_;
00130 
00132     CastorRecHitRefs usedRecHits_;
00133   };
00134   
00136   typedef std::vector<CastorTower> CastorTowerCollection;
00137 
00138   // persistent reference to CastorTower objects
00139   typedef edm::Ref<CastorTowerCollection> CastorTowerRef;
00140 
00142   typedef edm::RefVector<CastorTowerCollection> CastorTowerRefVector;
00143 
00145   typedef CastorTowerRefVector::iterator CastorTower_iterator;
00146 
00147 }
00148 
00149 #endif