Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
towerid.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file towerid.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef TOWERID_H
4 #define TOWERID_H
5 
6 #include <fun4all/SubsysReco.h>
7 //#include <cdbobjects/CDBTTree.h>
8 
9 #include <string>
10 #include <vector>
11 #include <TTree.h>
12 #include <TH1F.h>
13 #include <TH2F.h>
14 
15 class TTree;
16 class PHCompositeNode;
18 class TFile;
19 class RawCluster;
20 class TowerInfoContainer;
21 
22 const int nTowers = 24576;
23 const int nIB = 384;
24 const int nSectors = 64;
25 const int nTowersIB = 64;
26 const int nTowersSec = 384;
27 
28 class towerid : public SubsysReco
29 {
30  public:
31 
32  towerid(const std::string &name = "towerid.root", const std::string &cdbtreename = "test.root", float adccut_sg = 250,float adccut_k = 500, float sigmas_lo = 1, float sigmas_hi = 4.5, float SG_f = 0.55, float Kur_f = 0.55, float region_f = 0.55);
33 
34  ~towerid() override;
35 
41  int Init(PHCompositeNode *topNode) override;
42 
48  int InitRun(PHCompositeNode *topNode) override;
49 
53  int process_event(PHCompositeNode *topNode) override;
54 
56  int ResetEvent(PHCompositeNode *topNode) override;
57 
59  int EndRun(const int runnumber) override;
60 
62  int End(PHCompositeNode *topNode) override;
63 
65  int Reset(PHCompositeNode * /*topNode*/) override;
66 
67  void Print(const std::string &what = "ALL") const override;
68 
69  //histogram filler so we don't have to call the End function
70  void FillHistograms(const int runnumber, const int segment);
71 
72  void CalculateCutOffs(const int runnumber);
73 
74  void WriteCDBTree(const int runnumber);
75 
76  private:
77 
78  TTree *T;
79  TFile *out;
80 
81 // CDBTTree *cdbttree;
82 
83  TFile*fchannels;
84  TTree *channels;
85 
86  int fiber_type = 0;
87 
88  //Fun4AllHistoManager *hm = nullptr;
89  std::string Outfile = "commissioning.root";
90 
91  TH1F* hEventCounter = NULL;
92 
93  TH2F* Fspec = NULL;
94  TH2F* Fspec_SG = NULL;
95  TH2F* Fspec_K = NULL;
96  TH2F* Fspec_sector = NULL;
97  TH2F* Fspec_IB = NULL;
98 
99  TH2F* Fspeci = NULL;
100  TH2F* Fspeci_SG = NULL;
101  TH2F* Fspeci_K = NULL;
102  TH2F* Fspeci_sector = NULL;
103  TH2F* Fspeci_IB = NULL;
104 
105  TH2F* Espec = NULL;
106  TH2F* Espec_SG = NULL;
107  TH2F* Espec_K = NULL;
108  TH2F* Espec_sector = NULL;
109  TH2F* Espec_IB = NULL;
110 
112 
113  float adccut_sg;
114  float adccut_k;
115  float sigmas_lo;
116  float sigmas_hi;
117  float SG_f;
118  float Kur_f;
119  float region_f;
120 
122  float towerF[nTowers] = {0};
123  float sectorF[nSectors] = {0};
124  float ibF[nIB] = {0};
125 
126  float towerE[nTowers] = {0};
127  float sectorE[nSectors] = {0};
128  float ibE[nIB] = {0};
129 
130  int hottowers[nTowers] = {0};
131  int hotIB[nIB] = {0};
132  int hotsectors[nSectors] = {0};
133  int deadtowers[nTowers] = {0};
134 
135 
136  int coldtowers[nTowers] = {0};
137  int coldIB[nIB] = {0};
138  int coldsectors[nSectors] = {0};
139  int hot_regions = 0;
140  int cold_regions = 0;
141 
142 
143  int goodevents = 0;
144 };
145 
146 #endif