Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TpcMon.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file TpcMon.h
1 #ifndef TPC_TPCMON_H
2 #define TPC_TPCMON_H
3 
4 #include <onlmon/OnlMon.h>
5 
6 #include <map>
7 #include <tpc/TpcMap.h> //this needs to be pointed to coresoftware - not sure how to do that on EBDCXX...
8 #include <memory>
9 #include <string>
10 #include <cmath>
11 #include <vector>
12 
13 
14 class Event;
15 class TH1;
16 class TH2;
17 class TTree;
18 
19 class TpcMon : public OnlMon
20 {
21  public:
22  TpcMon(const std::string &name);
23  virtual ~TpcMon();
24 
25  int process_event(Event *evt);
26  int Init();
27  int BeginRun(const int runno);
28  int Reset();
29 
30  protected:
31  int evtcnt = 0;
32  int idummy = 0;
33  int weird_counter = 0;
34 
35  static const int N_rBins = 4; //(one inner bin not filled, 2nd bin is R1, 3rd bin is R2, 4th bin is R3)
36  const int N_thBins = 12; //(12 theta bins of uniform angle (360/12 = 30 degrees = TMath::Pi()/6 ~= 0.523 rad)
37  const double rBin_edges[N_rBins+1] = {0.0, 0.256, 0.504, 0.752, 1.00}; //variable edges for radial dims
38 
39  //for X-Y channel plot
40  static const int N_rBins_XY = 66; //From Evgeny code - global to all modules
41  const double r_bins[N_rBins_XY + 1] = {217.83,
42  223.83, 229.83, 235.83, 241.83, 247.83, 253.83, 259.83, 265.83, 271.83, 277.83, 283.83, 289.83, 295.83, 301.83, 306.83,
43  311.05, 317.92, 323.31, 329.27, 334.63, 340.59, 345.95, 351.91, 357.27, 363.23, 368.59, 374.55, 379.91, 385.87, 391.23, 397.19, 402.49,
44  411.53, 421.70, 431.90, 442.11, 452.32, 462.52, 472.73, 482.94, 493.14, 503.35, 513.56, 523.76, 533.97, 544.18, 554.39, 564.59, 574.76,
45  583.67, 594.59, 605.57, 616.54, 627.51, 638.48, 649.45, 660.42, 671.39, 682.36, 693.33, 704.30, 715.27, 726.24, 737.21, 748.18, 759.11}; // From Evgeny code - global to all modules
46 
47  static const int N_phi_binx_XY_R1 = 1152; // from Evgeny code (0 to 2pi)
48  static const int N_phi_binx_XY_R2 = 1536; // from Evgeny code (0 to 2pi)
49  static const int N_phi_binx_XY_R3 = 2304; // from Evgeny code (0 to 2pi)
50 
51  static const int N_z_bins = 3350; // (50 ns time bins * ~12.3 micron/ns drift time = 615 microns). Drift Length = 1.03 * 10^6 microns. 2 *1.03 *10^6 microns / 615 microns = 3350 bins
52 
53  TH2 *NorthSideADC_clusterXY_R1 = nullptr;
54  TH2 *NorthSideADC_clusterXY_R2 = nullptr;
55  TH2 *NorthSideADC_clusterXY_R3 = nullptr;
56 
57  TH2 *SouthSideADC_clusterXY_R1 = nullptr;
58  TH2 *SouthSideADC_clusterXY_R2 = nullptr;
59  TH2 *SouthSideADC_clusterXY_R3 = nullptr;
60 
64 
68 
69  TH2 *NorthSideADC_clusterZY = nullptr;
70  TH2 *SouthSideADC_clusterZY = nullptr;
71 
74 
75  TH1 *tpchist1 = nullptr;
76  TH2 *tpchist2 = nullptr;
77 
78  TH2 *NorthSideADC = nullptr;
79  TH2 *SouthSideADC = nullptr;
80 
81  TH2 *ADC_vs_SAMPLE = nullptr;
82  TH2 *ADC_vs_SAMPLE_large = nullptr;
83 
84  TH1 *sample_size_hist = nullptr;
85  TH1 *Check_Sum_Error = nullptr;
86  TH1 *Check_Sums = nullptr;
87 
88  TH2 *MAXADC = nullptr;
89 
90  TH1 *RAWADC_1D_R1= nullptr;
91  TH1 *MAXADC_1D_R1 = nullptr;
92  TH1 *PEDEST_SUB_1D_R1 = nullptr;
93 
94  TH1 *RAWADC_1D_R2= nullptr;
95  TH1 *MAXADC_1D_R2 = nullptr;
96  TH1 *PEDEST_SUB_1D_R2 = nullptr;
97 
98  TH1 *RAWADC_1D_R3= nullptr;
99  TH1 *MAXADC_1D_R3 = nullptr;
100  TH1 *PEDEST_SUB_1D_R3 = nullptr;
101 
103 
104  TpcMap M; //declare Martin's map
105 
109 
110  int serverid;
111 
112  void Locate(int id, float *rbin, float *thbin);
113  int Index_from_Module(int sec_id, int fee_id);
114  int Module_ID(int fee_id);
115  int Max_Nine(int one, int two, int three, int four, int five, int six, int seven, int eight, int nine);
116  bool side(int server_id);
117  std::pair<float, float> calculateMedianAndStdDev(const std::vector<int>& values);
118 };
119 
120 #endif /* TPC_TPCMON_H */