Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:19:02

0001 // Tell emacs that this is a C++ source
0002 //  -*- C++ -*-.
0003 #ifndef G4DETECTORS_PHG4SCINTILLATORSLATV1_H
0004 #define G4DETECTORS_PHG4SCINTILLATORSLATV1_H
0005 
0006 #include "PHG4ScintillatorSlat.h"
0007 
0008 #include "PHG4ScintillatorSlatDefs.h"  // for keytype
0009 
0010 #include <g4main/PHG4HitDefs.h>
0011 
0012 #include <iostream>  // for cout, ostream
0013 #include <set>
0014 #include <utility>  // for make_pair, pair
0015 
0016 class PHG4ScintillatorSlatv1 : public PHG4ScintillatorSlat
0017 {
0018  public:
0019   PHG4ScintillatorSlatv1() {}
0020   ~PHG4ScintillatorSlatv1() override {}
0021 
0022   void identify(std::ostream& os = std::cout) const override;
0023 
0024   void add_edep(const double f, const double e, const double ly) override
0025   {
0026     edep += f;
0027     eion += e;
0028     light_yield += ly;
0029   }
0030   void add_hit_key(PHG4HitDefs::keytype i) override { hit_id.insert(i); }
0031 
0032   void set_key(PHG4ScintillatorSlatDefs::keytype i) override { key = i; }
0033   void set_light_yield(const double lightYield) { light_yield = lightYield; }
0034 
0035   short get_row() const override;
0036   short get_column() const override;
0037   PHG4ScintillatorSlatDefs::keytype get_key() const override { return key; }
0038   double get_edep() const override { return edep; }
0039   double get_eion() const override { return eion; }
0040   double get_light_yield() const override { return light_yield; }
0041   std::pair<std::set<PHG4HitDefs::keytype>::const_iterator, std::set<PHG4HitDefs::keytype>::const_iterator> get_hit_ids() const override { return std::make_pair(hit_id.begin(), hit_id.end()); }
0042 
0043  protected:
0044   PHG4ScintillatorSlatDefs::keytype key = ~0x0;
0045   double edep = 0.;
0046   double eion = 0.;
0047   double light_yield = 0.;
0048   std::set<PHG4HitDefs::keytype> hit_id;
0049 
0050   ClassDefOverride(PHG4ScintillatorSlatv1, 1)
0051 };
0052 
0053 #endif