File indexing completed on 2025-08-05 08:15:37
0001
0002
0003 #ifndef READDIGITALCURRENTS_READDIGITALCURRENTS_H
0004 #define READDIGITALCURRENTS_READDIGITALCURRENTS_H
0005
0006 #include <fun4all/SubsysReco.h>
0007
0008 #include <fstream>
0009 #include <map>
0010 #include <string>
0011 #include <vector>
0012
0013 class Fun4AllHistoManager;
0014 class PHCompositeNode;
0015
0016
0017
0018
0019 class TH1;
0020 class TH2;
0021 class TH3;
0022
0023 class readDigitalCurrents : public SubsysReco
0024 {
0025 public:
0026 readDigitalCurrents(const std::string &name = "readDigitalCurrents", const std::string &filename = "DC_Hist_OnPlane_WIBF.root");
0027
0028 virtual ~readDigitalCurrents();
0029
0030
0031
0032
0033
0034
0035 int Init(PHCompositeNode *topNode) override;
0036
0037
0038
0039
0040
0041
0042 int InitRun(PHCompositeNode *topNode) override;
0043
0044
0045
0046
0047 int process_event(PHCompositeNode *topNode) override;
0048
0049
0050 int ResetEvent(PHCompositeNode *topNode) override;
0051
0052
0053 int EndRun(const int runnumber) override;
0054
0055
0056 int End(PHCompositeNode *topNode) override;
0057
0058
0059 int Reset(PHCompositeNode * ) override;
0060
0061 void Print(const std::string &what = "ALL") const override;
0062
0063 void SetBeamXing(const std::vector<int> &beamXs);
0064 void SetEvtStart(int newEvtStart);
0065 void FillCSV(int fillCSVFile);
0066 void SetCollSyst(int coll_syst = 0);
0067 void SetIBF(double ampIBFfrac = 0.004);
0068 void SetCCGC(double f_ccgc = 0);
0069
0070
0071
0072 protected:
0073 Fun4AllHistoManager *hm{nullptr};
0074 std::string _filename;
0075
0076 std::map<int, int> _timestamps;
0077 std::vector<int> _keys;
0078 double _ampIBFfrac{0.02};
0079 int _collSyst{0};
0080 std::ofstream myCSVFile;
0081
0082 private:
0083 std::vector<int> _beamxing;
0084 int _evtstart{0};
0085
0086 int _fillCSVFile{0};
0087
0088 int _f_ccgc{0};
0089
0090 TH2 *_h_modules_measuredibf{nullptr};
0091
0092 TH1 *_h_R{nullptr};
0093 TH1 *_h_hits{nullptr};
0094 TH3 *_h_DC_SC{nullptr};
0095 TH2 *_h_DC_SC_XY{nullptr};
0096 TH2 *_h_hit_XY{nullptr};
0097 TH2 *_h_DC_E{nullptr};
0098
0099 static const int nFrames{30};
0100 TH3 *_h_SC_ibf[nFrames]{};
0101
0102 float _event_timestamp{0};
0103 float _event_bunchXing{0};
0104
0105
0106 double adc_pedestal{0.};
0107 double cm{1e1};
0108 double m{1e3};
0109 double mm{1};
0110
0111 double ns{1e-9};
0112 double s{1};
0113 double V{1};
0114
0115 double ionMobility{1.65 * cm * cm / V / s};
0116 double vIon{ionMobility * 400 * V / cm};
0117
0118
0119 };
0120
0121 #endif