File indexing completed on 2024-04-06 12:03:49
0001 #ifndef CastorReco_CastorCluster_h
0002 #define CastorReco_CastorCluster_h
0003
0004
0005
0006
0007
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
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
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
0051 virtual ~CastorCluster();
0052
0053
0054 double energy() const { return energy_; }
0055
0056
0057 ROOT::Math::XYZPoint position() const { return position_; }
0058
0059
0060 double emEnergy() const { return emEnergy_; }
0061
0062
0063 double hadEnergy() const { return hadEnergy_; }
0064
0065
0066 double fem() const { return fem_; }
0067
0068
0069 double width() const { return width_; }
0070
0071
0072 double depth() const { return depth_; }
0073
0074
0075 double fhot() const { return fhot_; }
0076
0077
0078 double sigmaz() const { return sigmaz_; }
0079
0080
0081 CastorTowerRefVector getUsedTowers() const { return usedTowers_; }
0082
0083
0084 CastorTower_iterator towersBegin() const { return usedTowers_.begin(); }
0085
0086
0087 CastorTower_iterator towersEnd() const { return usedTowers_.end(); }
0088
0089
0090 size_t towersSize() const { return usedTowers_.size(); }
0091
0092
0093 void add(const CastorTowerRef& tower) { usedTowers_.push_back(tower); }
0094
0095
0096 bool operator>=(const CastorCluster& rhs) const { return (energy_ >= rhs.energy_); }
0097
0098
0099 bool operator>(const CastorCluster& rhs) const { return (energy_ > rhs.energy_); }
0100
0101
0102 bool operator<=(const CastorCluster& rhs) const { return (energy_ <= rhs.energy_); }
0103
0104
0105 bool operator<(const CastorCluster& rhs) const { return (energy_ < rhs.energy_); }
0106
0107
0108 double eta() const { return position_.eta(); }
0109
0110
0111 double phi() const { return position_.phi(); }
0112
0113
0114 double x() const { return position_.x(); }
0115
0116
0117 double y() const { return position_.y(); }
0118
0119
0120 double rho() const { return position_.rho(); }
0121
0122 private:
0123
0124 double energy_;
0125
0126
0127 ROOT::Math::XYZPoint position_;
0128
0129
0130 double emEnergy_;
0131
0132
0133 double hadEnergy_;
0134
0135
0136 double fem_;
0137
0138
0139 double width_;
0140
0141
0142 double depth_;
0143
0144
0145 double fhot_;
0146
0147
0148 double sigmaz_;
0149
0150
0151 CastorTowerRefVector usedTowers_;
0152 };
0153
0154
0155 typedef std::vector<CastorCluster> CastorClusterCollection;
0156
0157
0158 typedef edm::Ref<CastorClusterCollection> CastorClusterRef;
0159
0160
0161 typedef edm::RefVector<CastorClusterCollection> CastorClusterRefVector;
0162
0163
0164 typedef CastorClusterRefVector::iterator CastorCluster_iterator;
0165 }
0166
0167 #endif