File indexing completed on 2024-04-06 12:03:49
0001 #ifndef CastorReco_CastorTower_h
0002 #define CastorReco_CastorTower_h
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include <vector>
0012 #include <memory>
0013 #include "DataFormats/Math/interface/Point3D.h"
0014
0015 #include "DataFormats/Common/interface/RefProd.h"
0016 #include "DataFormats/Common/interface/Ref.h"
0017 #include "DataFormats/Common/interface/RefVector.h"
0018 #include "DataFormats/Common/interface/SortedCollection.h"
0019
0020 #include "DataFormats/HcalRecHit/interface/CastorRecHit.h"
0021
0022 #include "DataFormats/Candidate/interface/LeafCandidate.h"
0023
0024 namespace reco {
0025
0026 class CastorTower : public LeafCandidate {
0027 public:
0028 typedef edm::SortedCollection<CastorRecHit> CastorRecHitCollection;
0029 typedef edm::Ref<CastorRecHitCollection> CastorRecHitRef;
0030 typedef edm::RefVector<CastorRecHitCollection> CastorRecHitRefs;
0031
0032
0033
0034 CastorTower()
0035 : energy_(0.),
0036 position_(ROOT::Math::XYZPoint(0., 0., 0.)),
0037 emEnergy_(0.),
0038 hadEnergy_(0.),
0039 fem_(0.),
0040 depth_(0.),
0041 fhot_(0.) {}
0042
0043
0044 CastorTower(const double energy,
0045 const ROOT::Math::XYZPoint& position,
0046 const double emEnergy,
0047 const double hadEnergy,
0048 const double fem,
0049 const double depth,
0050 const double fhot,
0051 const CastorRecHitRefs& usedRecHits);
0052
0053
0054 ~CastorTower() override;
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 depth() const { return depth_; }
0070
0071
0072 double fhot() const { return fhot_; }
0073
0074
0075 CastorRecHitRefs getUsedRecHits() const { return usedRecHits_; }
0076
0077
0078 CastorRecHitRefs::iterator rechitsBegin() const { return usedRecHits_.begin(); }
0079
0080
0081 CastorRecHitRefs::iterator rechitsEnd() const { return usedRecHits_.end(); }
0082
0083
0084 size_t rechitsSize() const { return usedRecHits_.size(); }
0085
0086
0087 void add(const CastorRecHitRef& rechit) { usedRecHits_.push_back(rechit); }
0088
0089
0090 bool operator>=(const CastorTower& rhs) const { return (energy_ >= rhs.energy_); }
0091
0092
0093 bool operator>(const CastorTower& rhs) const { return (energy_ > rhs.energy_); }
0094
0095
0096 bool operator<=(const CastorTower& rhs) const { return (energy_ <= rhs.energy_); }
0097
0098
0099 bool operator<(const CastorTower& rhs) const { return (energy_ < rhs.energy_); }
0100
0101
0102 double xPos() const { return position_.x(); }
0103
0104
0105 double yPos() const { return position_.y(); }
0106
0107
0108 double rho() const { return position_.rho(); }
0109
0110 private:
0111
0112 double energy_;
0113
0114
0115 ROOT::Math::XYZPoint position_;
0116
0117
0118 double emEnergy_;
0119
0120
0121 double hadEnergy_;
0122
0123
0124 double fem_;
0125
0126
0127 double depth_;
0128
0129
0130 double fhot_;
0131
0132
0133 CastorRecHitRefs usedRecHits_;
0134 };
0135
0136
0137 typedef std::vector<CastorTower> CastorTowerCollection;
0138
0139
0140 typedef edm::Ref<CastorTowerCollection> CastorTowerRef;
0141
0142
0143 typedef edm::RefVector<CastorTowerCollection> CastorTowerRefVector;
0144
0145
0146 typedef CastorTowerRefVector::iterator CastorTower_iterator;
0147
0148 }
0149
0150 #endif