Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef CastorReco_CastorCluster_h
0002 #define CastorReco_CastorCluster_h
0003 /** \class reco::CastorCluster CastorCluster.h DataFormats/CastorReco/CastorCluster.h
0004  *  
0005  * Class for Castor clusters
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 #include "DataFormats/CastorReco/interface/CastorTower.h"
0021 
0022 namespace reco {
0023 
0024   class CastorCluster {
0025   public:
0026     /// default constructor. Sets energy and position to zero
0027     CastorCluster()
0028         : energy_(0.),
0029           position_(ROOT::Math::XYZPoint(0., 0., 0.)),
0030           emEnergy_(0.),
0031           hadEnergy_(0.),
0032           fem_(0.),
0033           width_(0.),
0034           depth_(0.),
0035           fhot_(0.),
0036           sigmaz_(0.) {}
0037 
0038     /// constructor from values
0039     CastorCluster(const double energy,
0040                   const ROOT::Math::XYZPoint& position,
0041                   const double emEnergy,
0042                   const double hadEnergy,
0043                   const double fem,
0044                   const double width,
0045                   const double depth,
0046                   const double fhot,
0047                   const double sigmaz,
0048                   const CastorTowerRefVector& usedTowers);
0049 
0050     /// destructor
0051     virtual ~CastorCluster();
0052 
0053     /// cluster energy
0054     double energy() const { return energy_; }
0055 
0056     /// cluster centroid position
0057     ROOT::Math::XYZPoint position() const { return position_; }
0058 
0059     /// cluster em energy
0060     double emEnergy() const { return emEnergy_; }
0061 
0062     /// cluster had energy
0063     double hadEnergy() const { return hadEnergy_; }
0064 
0065     /// cluster em/tot ratio
0066     double fem() const { return fem_; }
0067 
0068     /// cluster width in phi
0069     double width() const { return width_; }
0070 
0071     /// cluster depth in z
0072     double depth() const { return depth_; }
0073 
0074     /// cluster hotcell/tot ratio
0075     double fhot() const { return fhot_; }
0076 
0077     /// cluster sigma z
0078     double sigmaz() const { return sigmaz_; }
0079 
0080     /// vector of used Towers
0081     CastorTowerRefVector getUsedTowers() const { return usedTowers_; }
0082 
0083     /// fist iterator over CastorTower constituents
0084     CastorTower_iterator towersBegin() const { return usedTowers_.begin(); }
0085 
0086     /// last iterator over CastorTower constituents
0087     CastorTower_iterator towersEnd() const { return usedTowers_.end(); }
0088 
0089     /// number of CastorTower constituents
0090     size_t towersSize() const { return usedTowers_.size(); }
0091 
0092     /// add reference to constituent CastorTower
0093     void add(const CastorTowerRef& tower) { usedTowers_.push_back(tower); }
0094 
0095     /// comparison >= operator
0096     bool operator>=(const CastorCluster& rhs) const { return (energy_ >= rhs.energy_); }
0097 
0098     /// comparison > operator
0099     bool operator>(const CastorCluster& rhs) const { return (energy_ > rhs.energy_); }
0100 
0101     /// comparison <= operator
0102     bool operator<=(const CastorCluster& rhs) const { return (energy_ <= rhs.energy_); }
0103 
0104     /// comparison <= operator
0105     bool operator<(const CastorCluster& rhs) const { return (energy_ < rhs.energy_); }
0106 
0107     /// pseudorapidity of cluster centroid
0108     double eta() const { return position_.eta(); }
0109 
0110     /// azimuthal angle of cluster centroid
0111     double phi() const { return position_.phi(); }
0112 
0113     /// x of cluster centroid
0114     double x() const { return position_.x(); }
0115 
0116     /// y of cluster centroid
0117     double y() const { return position_.y(); }
0118 
0119     /// rho of cluster centroid
0120     double rho() const { return position_.rho(); }
0121 
0122   private:
0123     /// cluster energy
0124     double energy_;
0125 
0126     /// cluster centroid position
0127     ROOT::Math::XYZPoint position_;
0128 
0129     /// cluster em energy
0130     double emEnergy_;
0131 
0132     /// cluster had energy
0133     double hadEnergy_;
0134 
0135     /// cluster em/tot Ratio
0136     double fem_;
0137 
0138     /// cluster width
0139     double width_;
0140 
0141     /// cluster depth
0142     double depth_;
0143 
0144     /// cluster hotcell/tot ratio
0145     double fhot_;
0146 
0147     /// cluster sigma z
0148     double sigmaz_;
0149 
0150     /// references to CastorTower constituents
0151     CastorTowerRefVector usedTowers_;
0152   };
0153 
0154   /// collection of CastorCluster objects
0155   typedef std::vector<CastorCluster> CastorClusterCollection;
0156 
0157   // persistent reference to CastorCluster objects
0158   typedef edm::Ref<CastorClusterCollection> CastorClusterRef;
0159 
0160   /// vector of references to CastorCluster objects all in the same collection
0161   typedef edm::RefVector<CastorClusterCollection> CastorClusterRefVector;
0162 
0163   /// iterator over a vector of references to CastorCluster objects all in the same collection
0164   typedef CastorClusterRefVector::iterator CastorCluster_iterator;
0165 }  // namespace reco
0166 
0167 #endif