Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:18:51

0001 #ifndef G4MBD_BBCDIGITIZATION_H
0002 #define G4MBD_BBCDIGITIZATION_H
0003 
0004 #include <fun4all/SubsysReco.h>
0005 
0006 #include <Rtypes.h>
0007 
0008 #include <gsl/gsl_rng.h>
0009 
0010 #include <cmath>
0011 #include <map>
0012 #include <array>
0013 #include <string>
0014 
0015 // Forward declarations
0016 class PHCompositeNode;
0017 class PHG4HitContainer;
0018 class PHG4TruthInfoContainer;
0019 class EventHeader;
0020 class MbdPmtContainer;
0021 class TDatabasePDG;
0022 class TRandom3;
0023 class TH1;
0024 class TH2;
0025 class TF1;
0026 
0027 class MbdDigitization : public SubsysReco
0028 {
0029  public:
0030   // Default constructor
0031   MbdDigitization(const std::string &name = "MbdDigitization");
0032 
0033   ~MbdDigitization() override;
0034 
0035   //! Initialization, called for at overall initialization
0036   int Init(PHCompositeNode *) override;
0037 
0038   //! Initialization at start of every run
0039   int InitRun(PHCompositeNode *) override;
0040 
0041   //! Process Event, called for each event
0042   int process_event(PHCompositeNode *) override;
0043 
0044   //! Reset after every event
0045   // int ResetEvent(PHCompositeNode * /*topNode*/) override;
0046 
0047   //! End, write and close files
0048   int End(PHCompositeNode *) override { return 0; }
0049 
0050   //! Set time resolution (each channel has same time resol)
0051   void set_tres(const Float_t tr) { _tres = tr; }
0052 
0053  private:
0054   void CreateNodes(PHCompositeNode *topNode);  // Create all the nodes
0055   void GetNodes(PHCompositeNode *);            // Get all the needed nodes
0056 
0057   Float_t f_vx = NAN;
0058   Float_t f_vy = NAN;
0059   Float_t f_vz = NAN;
0060   Float_t f_vt = NAN;
0061   Float_t f_pmtq[128]{};   // equiv. nch in each pmt
0062   Float_t f_pmtt0[128]{};  // time in each pmt
0063   Float_t f_pmtt1[128]{};  // time in each pmt
0064   Float_t f_pmtnpe[128]{}; // npe in each pmt
0065 
0066   // gains
0067   std::array<Float_t,128> _gains = {};
0068 
0069   TF1 *gaussian = nullptr;
0070 
0071   //
0072   TDatabasePDG *_pdg = nullptr;
0073   gsl_rng *m_RandomGenerator = nullptr;
0074   unsigned int m_Seed = 0;
0075   Float_t _tres = NAN;  // time resolution of one channel
0076 
0077   std::map<int, int> _pids;  // PIDs of tracks in the BBC
0078 
0079   // Input Objects from DST
0080   PHG4TruthInfoContainer *_truth_container {nullptr};
0081   PHG4HitContainer *_bbchits {nullptr};
0082 
0083   // Output to DST
0084   MbdPmtContainer *_bbcpmts {nullptr};
0085 };
0086 
0087 #endif  //* __BBCDIGITIZATION_H__ *//