File indexing completed on 2025-08-05 08:18:06
0001 #ifndef G4INTT_PHG4INTTDIGITIZER_H
0002 #define G4INTT_PHG4INTTDIGITIZER_H
0003
0004 #include <phparameter/PHParameterInterface.h>
0005
0006 #include <fun4all/SubsysReco.h>
0007
0008 #include <intt/InttBadChannelMap.h>
0009
0010 #include <gsl/gsl_rng.h>
0011
0012 #include <map>
0013 #include <string> // for string
0014 #include <vector>
0015
0016 class PHCompositeNode;
0017 class InttBadChannelMap;
0018
0019 class PHG4InttDigitizer : public SubsysReco, public PHParameterInterface
0020 {
0021 public:
0022 PHG4InttDigitizer(const std::string &name = "PHG4InttDigitizer");
0023 ~PHG4InttDigitizer() override;
0024
0025
0026 int InitRun(PHCompositeNode *topNode) override;
0027
0028
0029 int process_event(PHCompositeNode *topNode) override;
0030
0031
0032 int End(PHCompositeNode *topNode) override;
0033
0034 void SetDefaultParameters() override;
0035
0036
0037 int LoadBadChannelMap() {return m_badmap.Load();}
0038 int LoadBadChannelMap(std::string const& s) {return m_badmap.Load(s);}
0039
0040 void Detector(const std::string &d) { detector = d; }
0041
0042 void set_adc_scale(const int &layer, std::vector<double> userrange_copy);
0043
0044 private:
0045 void CalculateLadderCellADCScale(PHCompositeNode *topNode);
0046
0047 void DigitizeLadderCells(PHCompositeNode *topNode);
0048
0049
0050 float added_noise();
0051
0052 std::string detector = "INTT";
0053
0054 float mNoiseMean = 457.2;
0055 float mNoiseSigma = 166.6;
0056 float mEnergyPerPair = 3.62e-9;
0057
0058
0059 std::map<int, unsigned int> _max_adc;
0060 std::map<int, float> _energy_scale;
0061
0062
0063
0064
0065 const unsigned int nadcbins = 8;
0066 std::map<int, std::vector<double>> _max_fphx_adc;
0067
0068 unsigned int m_nCells = 0;
0069 unsigned int m_nDeadCells = 0;
0070
0071
0072 gsl_rng *RandomGenerator = nullptr;
0073
0074 InttBadChannelMap m_badmap;
0075 };
0076
0077 #endif