CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/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     ROOT::Math::XYZPoint position() const { return position_; }
00047     
00049     double emEnergy() const { return emEnergy_; }
00050     
00052     double hadEnergy() const { return hadEnergy_; }
00053     
00055     double fem() const { return fem_; }
00056     
00058     double depth() const { return depth_; }
00059     
00061     double fhot() const { return fhot_; }
00062 
00064     CastorRecHitRefs getUsedRecHits() const { return usedRecHits_; }
00065 
00067     CastorRecHitRefs::iterator rechitsBegin() const { return usedRecHits_.begin(); }
00068 
00070     CastorRecHitRefs::iterator rechitsEnd() const { return usedRecHits_.end(); }
00071 
00073     size_t rechitsSize() const { return usedRecHits_.size(); }
00074 
00076     void add( const CastorRecHitRef& rechit ) { usedRecHits_.push_back( rechit ); }
00077 
00079     bool operator >=(const CastorTower& rhs) const { return (energy_>=rhs.energy_); }
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     double xPos() const { return position_.x(); }
00092 
00094     double yPos() const { return position_.y(); }
00095 
00097     double rho() const { return position_.rho(); }
00098 
00099   private:
00100 
00102     double energy_;
00103     
00105     ROOT::Math::XYZPoint position_;
00106     
00108     double emEnergy_;
00109     
00111     double hadEnergy_;
00112     
00114     double fem_;
00115     
00117     double depth_;
00118 
00120     double fhot_;
00121 
00123     CastorRecHitRefs usedRecHits_;
00124   };
00125   
00127   typedef std::vector<CastorTower> CastorTowerCollection;
00128 
00129   // persistent reference to CastorTower objects
00130   typedef edm::Ref<CastorTowerCollection> CastorTowerRef;
00131 
00133   typedef edm::RefVector<CastorTowerCollection> CastorTowerRefVector;
00134 
00136   typedef CastorTowerRefVector::iterator CastorTower_iterator;
00137 
00138 }
00139 
00140 #endif