Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LiteCaloEval.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file LiteCaloEval.h
1 // Tell emacs that this is a C++ source
2 // -*- C++ -*-.
3 #ifndef LITECALOEVAL_H
4 #define LITECALOEVAL_H
5 
6 #include <fun4all/SubsysReco.h>
7 
8 #include <string>
9 
10 class PHCompositeNode;
11 class TFile;
12 class TH1;
13 class TH2;
14 class TH3;
15 class TGraph;
16 class TNtuple;
17 class TF1;
18 
19 double LCE_fitf(double *f, double *p);
20 TGraph *LCE_grff = nullptr;
21 
22 class LiteCaloEval : public SubsysReco
23 {
24  public:
25 
26 
27  int m_myminbin = -1;
28  int m_mymaxbin = -3;
29 
30  enum Calo
31  {
32  NONE = 0,
33  CEMC = 1,
34  HCALIN = 2,
35  HCALOUT = 3
36  };
37 
38  LiteCaloEval(const std::string &name = "LiteCaloEval", const std::string &caloNm = "CEMC", const std::string &fnm = "outJF");
39 
40  // to distinguish when we want to implement input decal
41  void set_mode(int modeset)
42  {
43  mode = modeset;
44  }
45 
46  void set_UseTowerInfo(int setTowerInfo)
47  {
48  m_UseTowerInfo = setTowerInfo;
49  }
50 
51  virtual ~LiteCaloEval() {}
52 
59  int InitRun(PHCompositeNode *topNode) override;
60 
64  int process_event(PHCompositeNode *topNode) override;
65 
67  int End(PHCompositeNode *topNode) override;
68 
69  void CaloType(const Calo i)
70  {
71  calotype = i;
72  }
73 
74  // TNtuple -> to store fit parameters
75 
76  TFile *f_temp = nullptr;
77  /*
78  TNtuple *nt_corrVals;
79  TF1 *fit_func;
80  TF1 *fit_result;
81  float fit_value_mean;
82  float corr_val;
83  */
84 
85  // TF1 *mygaus;
86  void Get_Histos(const char *infile, const char *fun4all_file = "");
87  // void Fit_Histos();
88  void FitRelativeShifts(LiteCaloEval *ref_lce, int modeFitShifts);
89 
91  void setFitMax(float fitMax);
92  void setFitMin(float fitMin);
93 
95  float getFitMax();
96  float getFitMin();
97 
98 
99  void setInputTowerNodeName(const char * inpNodenm)
100  {
101  _inputnodename = inpNodenm;
102  }
103 
104 
105  private:
106  TFile *cal_output = nullptr;
107 
108  TH1 *hcal_out_eta_phi[24][64] = {};
109  TH1 *hcalout_eta[25] = {};
110  TH2 *hcalout_energy_eta = nullptr;
111  TH3 *hcalout_e_eta_phi = {};
112 
113  TH1 *hcal_in_eta_phi[24][64] = {};
114  TH1 *hcalin_eta[25] = {};
115  TH2 *hcalin_energy_eta = nullptr;
116  TH3 *hcalin_e_eta_phi = nullptr;
117 
118  TH1 *cemc_hist_eta_phi[96][258] = {};
119  TH1 *eta_hist[97] = {};
120  TH2 *energy_eta_hist = nullptr;
121  TH3 *e_eta_phi = nullptr;
122 
123  // TH2 *evtCentrality = nullptr;
124 
126  int _ievent = 0;
127  float fitmin = 0.;
128  float fitmax = 0.;
132 
133 
134  int mode = 0;
135 
136  // flag for using tower info
137  int m_UseTowerInfo = 0;
138 };
139 
140 #endif // LITECALOEVAL_H