source: JEM-EUSO/equalization_gain/trunk/src/PlotScurvesAll-diffFit.h @ 202

Last change on this file since 202 was 202, checked in by dagoret, 11 years ago

class Analysis put debug

File size: 4.4 KB
Line 
1//
2//
3// Definition of classes
4//
5#ifndef _PLOTSCURVESALLDIFFFIT_H_
6#define _PLOTSCURVESALLDIFFFIT_H_
7
8#include <iostream>
9#include "TString.h"
10#include "PlotScurvesAll-diffFitConst.h"
11
12
13class TCanvas;
14class TH1D;
15class TF1;
16
17void PlotScurve(
18                Int_t    kDrawCh=31,
19                TString  fname=kFname,
20                TString  fname_ped=kFnamePed, //ASIC_D ped_file
21                Double_t dac_half_spe_fix = -1,
22                TString  fname_gain="gain-org.txt",
23                Int_t    fit_min=kFitMin,
24                Int_t    fit_max=kFitMax,
25                Int_t    fit_min_scurve=kFitMinS,
26                Int_t    fit_max_scurve=kFitMaxS,
27                Bool_t   kBoard=0, //0:ASIC_C, 1:ASIC_D
28                Int_t    kChRef=kRefCh,//ASIC_C
29                Bool_t   checkAve=0 //0:use ref pix, 1:check average
30                );
31
32
33//-------------------------------------------------------------
34// Same work presented inside the analysis class
35//
36//
37//-------------------------------------------------------------
38
39class Analysis
40{
41 public:
42
43  Analysis(); // construtor to clean variables, and create object on the heap
44
45  ~Analysis(); // destructor to clean object form the heap
46
47  // Main analysis function to be called from outside
48
49void PlotScurve(
50                Int_t    kDrawCh=31,
51                TString  fname=kFname,
52                TString  fname_ped=kFnamePed, //ASIC_D ped_file
53                Double_t dac_half_spe_fix = -1,
54                TString  fname_gain="gain-org.txt",
55                Int_t    fit_min=kFitMin,
56                Int_t    fit_max=kFitMax,
57                Int_t    fit_min_scurve=kFitMinS,
58                Int_t    fit_max_scurve=kFitMaxS,
59                Bool_t   kBoard=0, //0:ASIC_C, 1:ASIC_D
60                Int_t    kChRef=kRefCh,//ASIC_C
61                Bool_t   checkAve=0 //0:use ref pix, 1:check average
62                );
63/*
64void PlotScurve(
65                Int_t    kDrawCh,
66                TString  fname,
67                TString  fname_ped, //ASIC_D ped_file
68                Double_t dac_half_spe_fix,
69                TString  fname_gain,
70                Int_t    fit_min,
71                Int_t    fit_max,
72                Int_t    fit_min_scurve,
73                Int_t    fit_max_scurve,
74                Bool_t   kBoard, //0:ASIC_C, 1:ASIC_D
75                Int_t    kChRef,//ASIC_C
76                Bool_t   checkAve //0:use ref pix, 1:check average
77                );
78
79*/
80
81
82private:
83
84 void Init();
85 void OpenGainFile(const TString);
86 void FillHistoName();
87 void ReadGainFile(const TString,Bool_t);
88 void ProcessSingleChannel(
89                Int_t    kDrawCh,
90                TString  fname,
91                TString  fname_ped, //ASIC_D ped_file
92                Double_t dac_half_spe_fix,
93                TString  fname_gain,
94                Int_t    fit_min,
95                Int_t    fit_max,
96                Int_t    fit_min_scurve,
97                Int_t    fit_max_scurve,
98                Bool_t   kBoard, //0:ASIC_C, 1:ASIC_D
99                Int_t    kChRef//ASIC_C
100         );
101 void ComputeDACAverage(Double_t dac_half_spe_fix ,Int_t    kChRef,Bool_t checkAve); //0:use ref pix, 1:check average)
102 void OutputGain(const TString fname_out);
103
104// common variables to the analysis
105     TString *input;
106     TString *input_ped;
107     Int_t    ch; // index on current channel under analysis
108     Float_t  dac_half_sum; 
109     Float_t  dac_ped_sum;   
110     Float_t  dac_spe_sum;   
111     Float_t  dac_sfit_sum;     
112     Float_t  diff_sum;     
113     Float_t  mean_sum;       
114     Float_t  maxBinSum;
115
116// output of the PlotScurve Analysis
117     Double_t dac_half[kNch];
118     Double_t dac_ped[kNch];
119     Double_t dac_spe[kNch];
120     Double_t dac_sfit[kNch];
121     Double_t mean_diff[kNch];
122     Double_t gain_org[kNch]; // array containing the initial gain values
123     Double_t sfit_chiS[kNch];
124     Double_t flag_fit[kNch];
125
126     //canvas pointers
127
128     TCanvas *c1; //smoothed S-curves
129     TCanvas *c2; //differentiated histograms of smoothed s-curves
130     TCanvas *c5;
131     TCanvas *c3;           
132     TCanvas *c4;
133
134     //histograms
135
136     TString  name_hist[kNch];
137     TString  name_hist_ped[kNch];
138     TString  name_hist_diff[kNch];
139     TString  name_hist_diff_fit[kNch];
140     TString  name_fit_diff[kNch];
141     TH1D    *hist_scurve; // smoothed S-curves
142     TH1D    *hist_scurve_ped; // S-curves for pedestal runs
143     TH1D    *hist_diff; // differentiated histograms of smoothed s-curves
144     TH1D    *hist_diff_fit; // differentiated histograms of fitted s-curves
145     TF1     *fit_sdiff;  // function fitted on differentiated histograms of fitted s-curves
146
147     Int_t trigger; 
148     Int_t trigger_fit; 
149     Int_t trigger_mean;
150     Int_t trigger_sfit;
151     
152     Float_t dac_ped_ave  ; //absolute value
153     Float_t dac_half_ave  ;
154     Float_t dac_spe_ave   ;
155     Float_t dac_sfit_ave;
156     Float_t mean_diff_ave ;//dac_sfit of ch31 of ASIC_C with the 180 for lower gain pixels
157 
158     Double_t dac_half_spe;
159
160};
161
162#endif
163
164//-------------------------------------------------------------------------------------------------
165// Configure (x)emacs for this file ...
166// Local Variables:
167// mode: c++
168// compile-command: "(make;) "
169// End:
Note: See TracBrowser for help on using the repository browser.