CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/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 
00020 #include "DataFormats/CastorReco/interface/CastorCell.h"
00021 #include "DataFormats/Candidate/interface/LeafCandidate.h"
00022 
00023 namespace reco {
00024 
00025   class CastorTower : public LeafCandidate {
00026   public:
00027 
00028     // default constructor. Set energy and position to zero
00029  
00030     CastorTower() : energy_(0.), position_(ROOT::Math::XYZPoint(0.,0.,0.)), emEnergy_(0.), hadEnergy_(0.), fem_(0.), depth_(0.), fhot_(0.) { }
00031 
00032     // constructor from values
00033     CastorTower(const double energy, const ROOT::Math::XYZPoint& position, const double emEnergy, const double hadEnergy, const double fem,
00034                 const double depth, const double fhot, const CastorCellRefVector& usedCells);
00035 
00037     virtual ~CastorTower();
00038 
00040     double energy() const { return energy_; }
00041 
00043     ROOT::Math::XYZPoint position() const { return position_; }
00044     
00046     double emEnergy() const { return emEnergy_; }
00047     
00049     double hadEnergy() const { return hadEnergy_; }
00050     
00052     double fem() const { return fem_; }
00053     
00055     double depth() const { return depth_; }
00056     
00058     double fhot() const { return fhot_; }
00059 
00061     CastorCellRefVector getUsedCells() const { return usedCells_; }
00062 
00064     CastorCell_iterator cellsBegin() const { return usedCells_.begin(); }
00065 
00067     CastorCell_iterator cellsEnd() const { return usedCells_.end(); }
00068 
00070     size_t cellsSize() const { return usedCells_.size(); }
00071 
00073     void add( const CastorCellRef & cell ) { usedCells_.push_back( cell ); }
00074 
00076     bool operator >=(const CastorTower& rhs) const { return (energy_>=rhs.energy_); }
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     double eta() const { return position_.eta(); }
00089 
00091     double phi() const { return position_.phi(); }
00092 
00094     double x() const { return position_.x(); }
00095 
00097     double y() const { return position_.y(); }
00098 
00100     double rho() const { return position_.rho(); }
00101 
00102   private:
00103 
00105     double energy_;
00106     
00108     ROOT::Math::XYZPoint position_;
00109     
00111     double emEnergy_;
00112     
00114     double hadEnergy_;
00115     
00117     double fem_;
00118     
00120     double depth_;
00121 
00123     double fhot_;
00124 
00126     CastorCellRefVector usedCells_;
00127   };
00128   
00130   typedef std::vector<CastorTower> CastorTowerCollection;
00131 
00132   // persistent reference to CastorTower objects
00133   typedef edm::Ref<CastorTowerCollection> CastorTowerRef;
00134 
00136   typedef edm::RefVector<CastorTowerCollection> CastorTowerRefVector;
00137 
00139   typedef CastorTowerRefVector::iterator CastorTower_iterator;
00140 
00141 }
00142 
00143 #endif