File indexing completed on 2025-08-06 08:14:14
0001
0002
0003 #ifndef HCAL_TOWERID_H
0004 #define HCAL_TOWERID_H
0005
0006 #include <fun4all/SubsysReco.h>
0007
0008
0009 #include <string>
0010 #include <vector>
0011 #include <TTree.h>
0012 #include <TH1F.h>
0013 #include <TH2F.h>
0014
0015 class TTree;
0016 class PHCompositeNode;
0017 class Fun4AllHistoManager;
0018 class TFile;
0019 class RawCluster;
0020 class TowerInfoContainer;
0021
0022
0023 const int nTowers = 1536;
0024
0025 class hcal_towerid : public SubsysReco
0026 {
0027 public:
0028
0029 hcal_towerid(const std::string &name = "hcal_towerid",const std::string &Outfile = "towerid.root", const std::string &icdbtreename = "test.root", const std::string &ocdbtreename = "test2.root", float adccut_i = 250, float adccut_o = 250, float sigmas_lo = 1, float sigmas_hi = 4.5, float inner_f = 0.03, float outer_f = 0.03);
0030
0031 ~hcal_towerid() override;
0032
0033
0034
0035
0036
0037
0038 int Init(PHCompositeNode *topNode) override;
0039
0040
0041
0042
0043
0044
0045 int InitRun(PHCompositeNode *topNode) override;
0046
0047
0048
0049
0050 int process_event(PHCompositeNode *topNode) override;
0051
0052
0053 int ResetEvent(PHCompositeNode *topNode) override;
0054
0055
0056 int EndRun(const int runnumber) override;
0057
0058
0059 int End(PHCompositeNode *topNode) override;
0060
0061
0062 int Reset(PHCompositeNode * ) override;
0063
0064 void Print(const std::string &what = "ALL") const override;
0065 void FillHistograms(const int runnumber, const int segment);
0066
0067 void CalculateCutOffs(const int runnumber);
0068
0069 void WriteCDBTree(const int runnumber);
0070
0071 private:
0072
0073 TTree *Tinner;
0074 TTree *Touter;
0075 TFile *out;
0076
0077
0078
0079 TFile*fchannels;
0080 TTree *channels;
0081
0082
0083 std::string Outfile = "commissioning.root";
0084 TH1F* hEventCounter = NULL;
0085
0086
0087 TH2F* Fspec_i = NULL;
0088 TH2F* Fspec_o = NULL;
0089
0090
0091 TH2F* Fspeci_i = NULL;
0092 TH2F* Fspeci_o = NULL;
0093
0094
0095 TH2F* Espec_i = NULL;
0096 TH2F* Espec_o = NULL;
0097
0098 TH1F *iHCal_hist = NULL;
0099 TH1F *oHCal_hist = NULL;
0100
0101
0102 const std::string icdbtreename;
0103 const std::string ocdbtreename;
0104 float adccut_i;
0105 float adccut_o;
0106 float sigmas_lo;
0107 float sigmas_hi;
0108 float inner_f;
0109 float outer_f;
0110
0111 int hot_channels_i;
0112 int hot_channels_o;
0113 float itowerF[nTowers] = {0};
0114 float otowerF[nTowers] = {0};
0115
0116 float itowerE[nTowers] = {0};
0117 float otowerE[nTowers] = {0};
0118
0119 int ihottowers[nTowers] = {0};
0120 int ohottowers[nTowers] = {0};
0121
0122 int ideadtowers[nTowers] = {0};
0123 int odeadtowers[nTowers] = {0};
0124
0125 int icoldtowers[nTowers] = {0};
0126 int ocoldtowers[nTowers] = {0};
0127
0128 int hot_regions = 0;
0129 int cold_regions = 0;
0130
0131 int goodevents = 0;
0132 };
0133
0134 #endif