Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:25:02

0001 #ifndef RecoEgamma_EgammaTools_Spot_h
0002 #define RecoEgamma_EgammaTools_Spot_h
0003 
0004 #include "DataFormats/DetId/interface/DetId.h"
0005 #include <vector>
0006 
0007 namespace hgcal {
0008 
0009   class Spot {
0010   public:
0011     Spot(DetId detid, double energy, const std::vector<double>& row, unsigned int layer, float fraction, double mip)
0012         : detId_(detid),
0013           energy_(energy),
0014           row_(row),
0015           layer_(layer),
0016           fraction_(fraction),
0017           mip_(mip),
0018           multiplicity_(int(energy / mip)),
0019           subdet_(detid.subdetId()),
0020           isCore_(fraction > 0.) {}
0021     ~Spot() {}
0022     inline DetId detId() const { return detId_; }
0023     inline float energy() const { return energy_; }
0024     inline const double* row() const { return &row_[0]; }
0025     inline float fraction() const { return fraction_; }
0026     inline float mip() const { return mip_; }
0027     inline int multiplicity() const { return multiplicity_; }
0028     inline unsigned int layer() const { return layer_; }
0029     inline int subdet() const { return subdet_; }
0030     inline bool isCore() const { return isCore_; }
0031 
0032   private:
0033     DetId detId_;
0034     float energy_;
0035     std::vector<double> row_;
0036     unsigned int layer_;
0037     float fraction_;
0038     float mip_;
0039     int multiplicity_;
0040     int subdet_;
0041     bool isCore_;
0042   };
0043 
0044 }  // namespace hgcal
0045 
0046 #endif