Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:19:46

0001 #ifndef TOWERINFO_H
0002 #define TOWERINFO_H
0003 
0004 #include <phool/PHObject.h>
0005 
0006 #include <g4main/PHG4HitDefs.h>
0007 
0008 #include <limits>
0009 #include <map>
0010 
0011 class TowerInfo : public PHObject
0012 {
0013  public:
0014   typedef std::map<PHG4HitDefs::keytype, float> EdepMap;
0015   typedef std::map<int, float> ShowerEdepMap;
0016   TowerInfo() = default;
0017   ~TowerInfo() override = default;
0018   void Reset() override { return; }
0019 
0020   virtual void set_time(float /*t*/) { return; }
0021   virtual float get_time() { return std::numeric_limits<float>::quiet_NaN(); }
0022   virtual void set_time_short(short /*t*/) { return; }
0023   virtual short get_time_short() { return -1; }
0024   virtual void set_energy(float /*energy*/) { return; }
0025   virtual float get_energy() { return std::numeric_limits<float>::quiet_NaN(); }
0026   virtual void copy_tower(TowerInfo* /*tower*/) { return; }
0027   virtual void set_chi2(float /*chi2*/) { return; }
0028   virtual float get_chi2() { return std::numeric_limits<float>::quiet_NaN(); }
0029   virtual void set_pedestal(float /*pedestal*/) { return; }
0030   virtual float get_pedestal() { return std::numeric_limits<float>::quiet_NaN(); }
0031   virtual void set_isHot(bool /*isHot*/) { return; }
0032   virtual bool get_isHot() const { return false; }
0033   virtual void set_isBadTime(bool /*isBadTime*/) { return; }
0034   virtual bool get_isBadTime() const { return false; }
0035   virtual void set_isBadChi2(bool /*isBadChi2*/) { return; }
0036   virtual bool get_isBadChi2() const { return false; }
0037   virtual void set_isNotInstr(bool /*isNotInstr*/) { return; }
0038   virtual bool get_isNotInstr() const { return false; }
0039   virtual void set_isNoCalib(bool /*isNotInstr*/) { return; }
0040   virtual bool get_isNoCalib() const { return false; }
0041   virtual void set_isZS(bool /*isZS*/) { return; }
0042   virtual bool get_isZS() const { return false; }
0043   virtual void set_isRecovered(bool /*isRecovered*/) { return; }
0044   virtual bool get_isRecovered() const { return false; }
0045   virtual void set_isSaturated(bool /*isSaturated*/) { return; }
0046   virtual bool get_isSaturated() const { return false; }
0047   virtual bool get_isGood() const { return true; }
0048   virtual uint8_t get_status() const { return 0; }
0049   virtual void set_status(uint8_t /*status*/) { return; }
0050   // methods in v3
0051   virtual int get_nsample() const { return 0; }
0052   virtual int16_t get_waveform_value(int /*index*/) const { return -1; }
0053   virtual void set_waveform_value(int /*index*/, int16_t /*value*/) { return; }
0054   // methods in sim v1
0055   virtual EdepMap& get_hitEdepMap()
0056   {
0057     static EdepMap dummy;
0058     return dummy;
0059   }
0060   virtual ShowerEdepMap& get_showerEdepMap()
0061   {
0062     static ShowerEdepMap dummy;
0063     return dummy;
0064   }
0065   virtual const EdepMap& get_hitEdepMap() const
0066   {
0067     static EdepMap dummy;
0068     return dummy;
0069   }
0070   virtual const ShowerEdepMap& get_showerEdepMap() const
0071   {
0072     static ShowerEdepMap dummy;
0073     return dummy;
0074   }
0075   virtual void add_edep(const PHG4HitDefs::keytype /*g4hitid*/, const float /*edep*/) { return; }
0076   virtual void add_shower_edep(const int /*showerid*/, const float /*edep*/) { return; }
0077 
0078  private:
0079   ClassDefOverride(TowerInfo, 1);
0080 };
0081 
0082 #endif