File indexing completed on 2025-08-05 08:14:37
0001 #ifndef __HCAL_H__
0002 #define __HCAL_H__
0003 #include <TString.h>
0004 #include <Event/fileEventiterator.h>
0005 #include <Event/Event.h>
0006 #include <map>
0007 #include <vector>
0008 class TFile;
0009 class TTree;
0010 class TString;
0011 class TGraph;
0012 class TCanvas;
0013 class TH1F;
0014 class TH2F;
0015 class TF1;
0016
0017 class hcal
0018 {
0019 public:
0020 hcal();
0021 ~hcal(){;}
0022 void Initialize();
0023 int evLoop(int nevt);
0024 int GetNextEvent();
0025 int collect(int);
0026 void setPrdf(TString & fin)
0027 { prdfName = fin; }
0028 void setPrdflist(TString &fin);
0029 void set_display(bool b)
0030 { display = b; }
0031 void Display();
0032 int Clear();
0033
0034 void SetCableMap(int _nch, int *_index)
0035 { NCH = _nch;
0036 channel_index.assign( _index, _index+_nch+1); }
0037
0038 TGraph* getSignal(int ch)
0039 { return gpulse[ch]; }
0040 static double SignalShape(double *x, double *par);
0041 static double SignalShapeNegative(double *x, double *par);
0042 void fitShape(int);
0043 void Save(char*);
0044 void set_positive_polarity(bool b)
0045 { polarity_positive = b; }
0046 void set_verbosity(bool b)
0047 { verbosity = b; }
0048 void set_plot_max(float max)
0049 { plot_max = max; }
0050 void set_plot_min(float min)
0051 { plot_min = min; }
0052 void FitDisplay();
0053 public:
0054 int runnumber;
0055 int nevents;
0056 TString prdfName;
0057 int NCH;
0058 int NSAMPLES;
0059 int PEDESTAL;
0060 bool display;
0061 Eventiterator *it;
0062 Event *evt;
0063 TGraph *gpulse[100];
0064 std::vector<int> channel_index;
0065 TF1 *fits[100];
0066 bool fit_analysis;
0067 TH2F *h2_fit_shape[100];
0068 TH1F *h_PulsePeaks[100];
0069 TH1F *h_PulseInt[100];
0070 TH2F *h2_Pulse_H_Int[100];
0071 TH2F *h_hilo[100];
0072 TH1F *h_gain[100];
0073 TH1F *h_tres[100];
0074 TH1F *h_ped_res[100];
0075 TH1F *h_saturation_rates;
0076 TH1F *h_info;
0077 TGraph *rate;
0078 TCanvas *c;
0079 float plot_max;
0080 float plot_min;
0081 TFile *fout;
0082 bool polarity_positive;
0083 bool verbosity;
0084 std::map<int,float> saturation_map;
0085 };
0086
0087 #endif