Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:55

0001 #ifndef CastorReco_CastorCell_h
0002 #define CastorReco_CastorCell_h
0003 /** \class reco::CastorCell CastorCell.h DataFormats/CastorReco/CastorCell.h
0004  *  
0005  * Class for CastorCells made of full simulation/data
0006  *
0007  * \author Hans Van Haevermaet, University of Antwerp
0008  *
0009  *
0010  */
0011 
0012 #include <vector>
0013 #include <memory>
0014 #include "DataFormats/Math/interface/Point3D.h"
0015 
0016 #include "DataFormats/Common/interface/RefProd.h"
0017 #include "DataFormats/Common/interface/Ref.h"
0018 #include "DataFormats/Common/interface/RefVector.h"
0019 
0020 namespace reco {
0021 
0022   class CastorCell {
0023   public:
0024     /// default constructor. Sets energy and position to zero
0025     CastorCell() : energy_(0.), position_(ROOT::Math::XYZPoint(0., 0., 0.)) {}
0026 
0027     /// constructor from values
0028     CastorCell(const double energy, const ROOT::Math::XYZPoint& position);
0029 
0030     /// destructor
0031     virtual ~CastorCell();
0032 
0033     /// cell energy
0034     double energy() const { return energy_; }
0035 
0036     /// cell centroid position
0037     ROOT::Math::XYZPoint position() const { return position_; }
0038 
0039     /// comparison >= operator
0040     bool operator>=(const CastorCell& rhs) const { return (energy_ >= rhs.energy_); }
0041 
0042     /// comparison > operator
0043     bool operator>(const CastorCell& rhs) const { return (energy_ > rhs.energy_); }
0044 
0045     /// comparison <= operator
0046     bool operator<=(const CastorCell& rhs) const { return (energy_ <= rhs.energy_); }
0047 
0048     /// comparison <= operator
0049     bool operator<(const CastorCell& rhs) const { return (energy_ < rhs.energy_); }
0050 
0051     /// z coordinate of cell centroid
0052     double z() const { return position_.z(); }
0053 
0054     /// azimuthal angle of cell centroid
0055     double phi() const { return position_.phi(); }
0056 
0057     /// x coordinate of cell centroid
0058     double x() const { return position_.x(); }
0059 
0060     /// y coordinate of cell centroid
0061     double y() const { return position_.y(); }
0062 
0063     /// rho coordinate of cell centroid
0064     double rho() const { return position_.rho(); }
0065 
0066     /// eta coordinate of cell centroid
0067     double eta() const { return position_.eta(); }
0068 
0069   private:
0070     /// cell energy
0071     double energy_;
0072 
0073     /// cell centroid position
0074     ROOT::Math::XYZPoint position_;
0075   };
0076 
0077   /// collection of CastorCell objects
0078   typedef std::vector<CastorCell> CastorCellCollection;
0079 
0080   // persistent reference to CastorCell objects
0081   typedef edm::Ref<CastorCellCollection> CastorCellRef;
0082 
0083   /// vector of references to CastorCell objects all in the same collection
0084   typedef edm::RefVector<CastorCellCollection> CastorCellRefVector;
0085 
0086   /// iterator over a vector of references to CastorCell objects all in the same collection
0087   typedef CastorCellRefVector::iterator CastorCell_iterator;
0088 }  // namespace reco
0089 
0090 #endif