CastorCell

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
#ifndef CastorReco_CastorCell_h
#define CastorReco_CastorCell_h
/** \class reco::CastorCell CastorCell.h DataFormats/CastorReco/CastorCell.h
 *  
 * Class for CastorCells made of full simulation/data
 *
 * \author Hans Van Haevermaet, University of Antwerp
 *
 *
 */

#include <vector>
#include <memory>
#include "DataFormats/Math/interface/Point3D.h"

#include "DataFormats/Common/interface/RefProd.h"
#include "DataFormats/Common/interface/Ref.h"
#include "DataFormats/Common/interface/RefVector.h"

namespace reco {

  class CastorCell {
  public:
    /// default constructor. Sets energy and position to zero
    CastorCell() : energy_(0.), position_(ROOT::Math::XYZPoint(0., 0., 0.)) {}

    /// constructor from values
    CastorCell(const double energy, const ROOT::Math::XYZPoint& position);

    /// destructor
    virtual ~CastorCell();

    /// cell energy
    double energy() const { return energy_; }

    /// cell centroid position
    ROOT::Math::XYZPoint position() const { return position_; }

    /// comparison >= operator
    bool operator>=(const CastorCell& rhs) const { return (energy_ >= rhs.energy_); }

    /// comparison > operator
    bool operator>(const CastorCell& rhs) const { return (energy_ > rhs.energy_); }

    /// comparison <= operator
    bool operator<=(const CastorCell& rhs) const { return (energy_ <= rhs.energy_); }

    /// comparison <= operator
    bool operator<(const CastorCell& rhs) const { return (energy_ < rhs.energy_); }

    /// z coordinate of cell centroid
    double z() const { return position_.z(); }

    /// azimuthal angle of cell centroid
    double phi() const { return position_.phi(); }

    /// x coordinate of cell centroid
    double x() const { return position_.x(); }

    /// y coordinate of cell centroid
    double y() const { return position_.y(); }

    /// rho coordinate of cell centroid
    double rho() const { return position_.rho(); }

    /// eta coordinate of cell centroid
    double eta() const { return position_.eta(); }

  private:
    /// cell energy
    double energy_;

    /// cell centroid position
    ROOT::Math::XYZPoint position_;
  };

  /// collection of CastorCell objects
  typedef std::vector<CastorCell> CastorCellCollection;

  // persistent reference to CastorCell objects
  typedef edm::Ref<CastorCellCollection> CastorCellRef;

  /// vector of references to CastorCell objects all in the same collection
  typedef edm::RefVector<CastorCellCollection> CastorCellRefVector;

  /// iterator over a vector of references to CastorCell objects all in the same collection
  typedef CastorCellRefVector::iterator CastorCell_iterator;
}  // namespace reco

#endif