Changeset 12275
- Timestamp:
- 10/26/11 10:53:20 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/gainanalysis.C
r12166 r12275 21 21 { 22 22 //****************************************************************************** 23 //Read a datafile and plot the DRS-calibrated data 24 //ATTENTION: only works for ROI=1024 23 //Read a file with G-APD singles, analyse them and plot the spectra 24 //This source code is best read with a wide editor (>100 characters per line) or a horizontal scroll bar. 25 //ATTENTION: this script only works for ROI=1024 25 26 // (array indices of the calibration wrong otherwise) 26 27 //****************************************************************************** … … 92 93 Double_t par_init[5+2*n_peaks] = {70,90,100,15,10,15,10,30,30}; 93 94 Double_t parread_tmp[5+2*n_peaks]; 94 Double_t parread[data_px][5+2*n_peaks];95 95 // TF1 *f_peaks = new TF1("total","[2]*TMath::Exp(-(x-[0])*(x-[0])/(2*[3]*[3])) + [4]*TMath::Exp(-(x-[0]-[1])*(x-[0]-[1])/(2*[5]*[5])) + [6]*TMath::Exp(-(x-[0]-2*[1])*(x-[0]-2*[1])/(2*[7]*[7])) + [8]*TMath::Exp(-(x-[0]-3*[1])*(x-[0]-3*[1])/(2*[9]*[9])) + [10]*TMath::Exp(-(x-[12])*(x-[12])/(2*[11]*[11]))",fit_start,fit_end); 96 96 // Double_t par_init[3+2*n_peaks] = {70,90,500000,15,50000,15,5000,15,500,15,800000,20,0}; … … 120 120 121 121 //------------------------------------------- 122 //Oscilloscope 122 //Oscilloscope (search for peaks and fill integral into the histograms) 123 123 //------------------------------------------- 124 124 // float threshold = pedestal_mean+pedestal_rms; … … 174 174 // canv_spect->Update(); 175 175 //*********************** 176 177 //------------------------------------------- 178 //Fit the histograms and store the parameters into parread 179 //parread_dist: peak difference (gain) per pixel, parread_x: x-Values for the TGraph 180 //------------------------------------------- 181 Double_t parread[data_px][5+2*n_peaks]; 176 182 Double_t parread_dist[data_px]; 177 183 Double_t parread_x[data_px]; … … 196 202 } 197 203 204 //------------------------------------------- 205 //Plot the gain of all pixel 206 //------------------------------------------- 198 207 canv_gain->cd(); 199 208 TGraph* plot_gain = new TGraph(data_px,parread_x,parread_dist); … … 207 216 208 217 //------------------------------------------- 209 //Draw the data where the gain is out of limits 218 //Draw the spectrum of pixel where the gain is out of limits 219 //Drawn are the fitted function (f_peaks) and its components (f_peak[i], f_pedestal) 210 220 //------------------------------------------- 211 221 char temp = 'x'; … … 238 248 } 239 249 } 240 //------------------------------------------- 241 //Draw the data 250 251 //------------------------------------------- 252 //Give the possibility to draw the spectrum of any pixel 242 253 //------------------------------------------- 243 254 canv_spect->cd();
Note:
See TracChangeset
for help on using the changeset viewer.