1 |
// |
// |
2 |
// Check the calorimter calibrations - Emiliano Mocchiutti |
// Check the calorimter calibrations - Emiliano Mocchiutti |
3 |
// |
// |
4 |
// FCaloCHKCALIB.c version 1.03 (2006-03-20) |
// FCaloCHKCALIB.c version 1.14 (2007-07-18) |
5 |
// |
// |
6 |
// The only input needed is the path to the directory created by YODA for the data file you want to analyze. |
// The only input needed is the path to the directory created by YODA for the data file you want to analyze. |
7 |
// |
// |
8 |
// Changelog: |
// Changelog: |
9 |
// |
// |
10 |
|
// 1.12 - 1.14 (2007-07-18): 05953 bug fixed (infinite loop). |
11 |
|
// |
12 |
|
// 1.12 - 1.13 (2006-09-22): Set upper limit in calvar plot. |
13 |
|
// |
14 |
|
// 1.07 - 1.12 (2006-08-04): bugs fixed. |
15 |
|
// |
16 |
|
// 1.07 - 1.11 (2006-07-17): Adapted to flight conditions. |
17 |
|
// |
18 |
|
// 1.06 - 1.07 (2006-05-29): Fixed bug in output filename when input is not in the form DW_YYMMDD_NNN. Changed threshold for bad strip warning (from 0.005 to 0.03). |
19 |
|
// |
20 |
|
// 1.05 - 1.06 (2006-03-22): Add optimize flag in compiling the script! |
21 |
|
// |
22 |
|
// 1.04 - 1.05 (2006-03-22): Corrected wrong .C files. |
23 |
|
// |
24 |
|
// 1.03 - 1.04 (2006-03-20): Documentation updated. |
25 |
|
// |
26 |
// 1.02 - 1.03 (2006-03-20): Changed name of shared libraries (for example from FCaloQLOOK_cxx.so to libFCaloQLOOK.so). |
// 1.02 - 1.03 (2006-03-20): Changed name of shared libraries (for example from FCaloQLOOK_cxx.so to libFCaloQLOOK.so). |
27 |
// |
// |
28 |
// 1.01 - 1.02 (2006-03-13): Include files from YODA without "event" directory. |
// 1.01 - 1.02 (2006-03-13): Include files from YODA without "event" directory. |
48 |
#include <TPaveLabel.h> |
#include <TPaveLabel.h> |
49 |
#include <TStyle.h> |
#include <TStyle.h> |
50 |
#include <TSystem.h> |
#include <TSystem.h> |
51 |
|
#include <TApplication.h> |
52 |
// |
// |
53 |
#include <CalibCalPedEvent.h> |
#include <CalibCalPedEvent.h> |
54 |
|
#include <PamelaRun.h> |
55 |
// |
// |
56 |
using namespace std; |
using namespace std; |
57 |
// |
// |
58 |
void stringcopy(TString& s1, const TString& s2, Int_t from=0, Int_t to=0){ |
void stringcopy(TString& s1, const TString& s2, Int_t from=0, Int_t to=0){ |
59 |
if ( to == 0 ){ |
if ( to == 0 ){ |
60 |
Int_t t2length = s2.Length(); |
Int_t t2length = s2.Length(); |
61 |
s1 = ""; |
s1 = ""; |
62 |
to = t2length; |
to = t2length; |
63 |
}; |
}; |
64 |
for (Int_t i = from; i<to; i++){ |
for (Int_t i = from; i<to; i++){ |
65 |
s1.Append(s2[i],1); |
s1.Append(s2[i],1); |
66 |
}; |
}; |
67 |
} |
} |
68 |
void stringappend(TString& s1, const TString& s2){ |
void stringappend(TString& s1, const TString& s2){ |
69 |
Int_t t2length = s2.Length(); |
Int_t t2length = s2.Length(); |
70 |
for (Int_t i = 0; i<t2length; i++){ |
for (Int_t i = 0; i<t2length; i++){ |
71 |
s1.Append(s2[i],1); |
s1.Append(s2[i],1); |
72 |
}; |
}; |
73 |
} |
} |
74 |
|
|
75 |
TString getFilename(const TString filename){ |
TString getFilename(const TString filename){ |
76 |
const string fil = (const char*)filename; |
// |
77 |
Int_t posiz = fil.find("dw_"); |
const string fil = gSystem->BaseName(filename.Data()); |
78 |
if ( posiz == -1 ) posiz = fil.find("DW_"); |
Int_t posiz = fil.find(".root"); |
79 |
if ( posiz == -1 ) return 0; |
// |
80 |
Int_t posiz2 = posiz+13; |
TString file2; |
81 |
TString file2; |
if ( posiz == -1 ){ |
82 |
stringcopy(file2,filename,posiz,posiz2); |
file2 = gSystem->BaseName(filename.Data()); |
83 |
|
} else { |
84 |
|
Int_t posiz2 = 0; |
85 |
|
stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz); |
86 |
TString pdat(".dat"); |
TString pdat(".dat"); |
87 |
stringappend(file2,pdat); |
stringappend(file2,pdat); |
88 |
return file2; |
}; |
89 |
|
return file2; |
90 |
} |
} |
91 |
|
|
92 |
typedef struct Calib { |
typedef struct Calib { |
93 |
Int_t iev; |
Int_t iev; |
94 |
Int_t cstwerr[4]; |
Int_t cstwerr[4];//per l'header contenente lo stato del calorimetro |
95 |
Float_t cperror[4]; |
Float_t cperror[4]; |
96 |
Float_t mip[2][22][96]; |
Float_t mip[2][22][96];//(xy,piano,strip) |
97 |
Float_t calped[2][22][96]; |
Float_t calped[2][22][96]; |
98 |
Float_t calgood[2][22][96]; |
Float_t calgood[2][22][96]; |
99 |
Float_t calthr[2][22][6]; |
Float_t calthr[2][22][6]; |
100 |
Float_t calrms[2][22][96]; |
Float_t calrms[2][22][96]; |
101 |
Float_t calbase[2][22][6]; |
Float_t calbase[2][22][6]; |
102 |
Float_t calvar[2][22][6]; |
Float_t calvar[2][22][6]; |
103 |
Float_t calpuls[2][22][96]; |
Float_t calpuls[2][22][96]; |
104 |
} calib; |
} calib; |
105 |
|
|
106 |
void FCaloCHKCALIB(TString filename, Long64_t calibnumber = 0, TString outDir = "", Int_t figmatra = 0, TString saveas = "ps"){ |
|
107 |
gStyle->SetPaperSize(19.,25.); |
|
108 |
// |
//main |
109 |
Float_t ccalrmsthr=0.99; |
void FCaloCHKCALIB(TString filename, Long64_t calibnumber = 0, TString outDir = "", Int_t figmatra = 0, TString saveas = "png", Bool_t iactive =false, Bool_t w4i=false){ |
110 |
Float_t ccalpedthr=0.99; |
|
111 |
Float_t ccalbadthr=0.005; |
gStyle->SetPaperSize(19.,25.); |
112 |
Float_t ccalthrthr=0.98; |
// |
113 |
Float_t ccalvarthr=0.99; |
TApplication *app = 0; //crea un ambiente root (app) |
114 |
Float_t ccalbasthr=0.99; |
if ( iactive ) app = new TApplication("app",0,0);//verifica se deve essere interattivo |
115 |
// |
// |
116 |
Float_t ccalrms; |
//definizione delle soglie per valutare problemi nell calibrazione |
117 |
Float_t ccalped; |
Float_t ccalrmsthr=0.95;// numero di strip con rms entro i limiti (99%) |
118 |
Float_t ccalbad; |
Float_t ccalpedthr=0.95;// numero di strip con piedistallo entro i limiti(99%) |
119 |
Float_t ccalthr; |
Float_t ccalbadthr=0.03;// 0.005 numero massimo di strip non utilizzate (3%) per calibrare |
120 |
Float_t ccalvar; |
Float_t ccalthrthr=0.95; |
121 |
Float_t ccalbas; |
Float_t ccalvarthr=0.95; |
122 |
// |
Float_t ccalbasthr=0.95; |
123 |
struct Calib calib; |
// |
124 |
stringstream titolo; |
Float_t ccalrms = 0.; |
125 |
stringstream xviewev; |
Float_t ccalped = 0.; |
126 |
stringstream yviewev; |
Float_t ccalbad = 0.; |
127 |
const char* startingdir = gSystem->WorkingDirectory(); |
Float_t ccalthr = 0.; |
128 |
if ( !strcmp(outDir.Data(),"") ) outDir = startingdir; |
Float_t ccalvar = 0.; |
129 |
TString fififile = getFilename(filename); |
Float_t ccalbas = 0.; |
130 |
const char *file; |
// |
131 |
file = fififile; |
struct Calib calib; |
132 |
// |
stringstream titolo, sottotitolo; |
133 |
ifstream myfile; |
stringstream xviewev; |
134 |
myfile.open(filename.Data()); |
stringstream yviewev; |
135 |
if ( !myfile ){ |
|
136 |
printf(" %s :no such file, exiting...\n\n",filename.Data()); |
//directory di lavoro |
137 |
|
const char* startingdir = gSystem->WorkingDirectory(); |
138 |
|
if ( !strcmp(outDir.Data(),"") ) outDir = startingdir; |
139 |
|
|
140 |
|
//nome del file |
141 |
|
TString fififile = getFilename(filename); |
142 |
|
const char *file; |
143 |
|
file = fififile; |
144 |
|
|
145 |
|
//verifica se esiste il file |
146 |
|
ifstream myfile; |
147 |
|
myfile.open(filename.Data()); |
148 |
|
if ( !myfile ){ |
149 |
|
printf(" %s :no such file, exiting...\n\n",filename.Data()); |
150 |
|
return; |
151 |
|
}; |
152 |
|
myfile.close(); |
153 |
|
// |
154 |
|
|
155 |
|
//apre il file in 'File' |
156 |
|
TFile *File = new TFile(filename.Data()); |
157 |
|
|
158 |
|
//crea struttura tree (tr) con il tree "CalibCalPed" in File |
159 |
|
TTree *tr = (TTree*)File->Get("CalibCalPed"); |
160 |
|
//definisco struttura tree per caricare gli header cpu |
161 |
|
TTree *cpuhe = (TTree*)File->Get("CalibHeader"); |
162 |
|
|
163 |
|
if ( !tr ) { |
164 |
|
printf(" CalibCalPed : no such tree in %s \n",filename.Data()); |
165 |
|
printf(" Exiting, are you sure this is a LEVEL0 not corrupted file? \n\n"); |
166 |
|
return; |
167 |
|
}; |
168 |
|
|
169 |
|
pamela::CalibCalPedEvent *ce = 0; |
170 |
|
pamela::EventHeader *eh = 0;//definisco variabili di tipo header |
171 |
|
pamela::EventHeader *ch =0;//definisco la variabile per header cpu |
172 |
|
// pamela::PscuHeader *ph = 0; //definisco variabile di tipo pscu |
173 |
|
|
174 |
|
// |
175 |
|
//UInt_t found; |
176 |
|
UInt_t cpuobt=0, obt=0, obt0=0, obt1=0, obt2=0, obt3=0; |
177 |
|
|
178 |
|
// tr->SetBranchStatus("*",0,&found); //disable all branches |
179 |
|
// |
180 |
|
// found = 0; |
181 |
|
// tr->SetBranchStatus("iev*",1,&found); |
182 |
|
// found = 0; |
183 |
|
// tr->SetBranchStatus("cstwerr*",1,&found); |
184 |
|
// // printf("enabled %i branches \n",found); |
185 |
|
// found = 0; |
186 |
|
// tr->SetBranchStatus("cperror*",1,&found); |
187 |
|
// //printf("enabled %i branches \n",found); |
188 |
|
// found = 0; |
189 |
|
// tr->SetBranchStatus("cal*",1,&found); |
190 |
|
// //printf("enabled %i branches \n",found); |
191 |
|
// found = 0; |
192 |
|
// tr->SetBranchStatus("CalibCalPed*",1,&found); |
193 |
|
//printf("enabled %i branches \n",found); |
194 |
|
// |
195 |
|
tr->SetBranchAddress("CalibCalPed", &ce);//dichiaro in che ramo trovare quello che voglio puntare con ce |
196 |
|
tr->SetBranchAddress("Header", &eh);//dichiaro dove trovare quello che voglio in he |
197 |
|
// |
198 |
|
cpuhe->SetBranchAddress("Header",&ch); |
199 |
|
// |
200 |
|
Long64_t ncalibs = tr->GetEntries();//cerca il ramo Entries (calibrazioni) |
201 |
|
if ( ncalibs == 0 || cpuhe->GetEntries() == 0){ |
202 |
|
printf(" No calibrations in this files! \n Exiting... \n"); |
203 |
|
return; |
204 |
|
}; |
205 |
|
// |
206 |
|
UInt_t cpuhead[1000]; |
207 |
|
memset(cpuhead, 0, 1000*sizeof(UInt_t)); |
208 |
|
for (Int_t i=0; i<cpuhe->GetEntries(); i++){ |
209 |
|
cpuhe->GetEntry(i); |
210 |
|
if ( i < 1000 ) cpuhead[i]=ch->GetPscuHeader()->GetOrbitalTime(); |
211 |
|
if ( i > 1000 ){ |
212 |
|
printf(" ERROR: too many calibrations in this file, cannot handle it \n Exiting... \n"); |
213 |
return; |
return; |
214 |
}; |
}; |
215 |
myfile.close(); |
}; |
216 |
// |
// |
217 |
TFile *File = new TFile(filename.Data()); |
printf("\n This file contains %i entries which corrispond to %i calibrations \n\n",(int)ncalibs,(int)ncalibs/4); |
218 |
// |
Long64_t minev = 0; |
219 |
TTree *tr = (TTree*)File->Get("CalibCalPed"); |
Long64_t maxev = ncalibs; |
220 |
if ( !tr ) { |
if ( calibnumber ){//calibnumber e' in ingresso nel main |
221 |
printf(" CalibCalPed : no such tree in %s \n",filename.Data()); |
minev = (calibnumber - 1)* 4; |
222 |
printf(" Exiting, are you sure this is a LEVEL0 not corrupted file? \n\n"); |
maxev = minev + 4; |
223 |
return; |
}; |
224 |
|
TCanvas *figura1;//finestra grafica che posso suddividere in piu' aree (pads) |
225 |
|
TCanvas *figura2 = 0; |
226 |
|
TCanvas *figura3; |
227 |
|
TCanvas *rapporto = 0; |
228 |
|
Int_t cmask = 127 ;//maschera per selezionare i Byte di errore dall'header |
229 |
|
Int_t cestw = 0; //variabile per contenere i Byte di errore del calorimetro estratti dall'header |
230 |
|
Int_t ver[4][23]; //variabile per riportare gli errori(22) su ogni sezione (4) |
231 |
|
|
232 |
|
//azzera ver |
233 |
|
for (Int_t k = 0; k < 4; k++ ){ |
234 |
|
for (Int_t m = 0; m < 23 ; m++ ){ |
235 |
|
ver[k][m] = 0 ; |
236 |
}; |
}; |
237 |
pamela::CalibCalPedEvent *ce = 0; |
}; |
238 |
|
// |
239 |
|
// |
240 |
|
const string fil = gSystem->BaseName(filename.Data()); |
241 |
|
Int_t posiz = fil.find(".root"); |
242 |
|
// |
243 |
|
TString file2; |
244 |
|
if ( posiz == -1 ){ |
245 |
|
file2 = gSystem->BaseName(filename.Data()); |
246 |
|
} else { |
247 |
|
Int_t posiz2 = 0; |
248 |
|
stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz); |
249 |
|
}; |
250 |
|
const char *figrec = file2; |
251 |
|
// |
252 |
|
const char *outdir = outDir; |
253 |
|
const char *format = saveas; |
254 |
|
stringstream figsave; //definisco stringhe i/o |
255 |
|
stringstream figsave1; |
256 |
|
stringstream figsave2; |
257 |
|
if ( !strcmp(format,"ps") ) { |
258 |
|
figsave.str(""); |
259 |
|
figsave << outdir << "/" ; |
260 |
|
figsave << figrec << "_CaloCHKCALIB."; |
261 |
|
figsave << format; |
262 |
|
figsave << "("; |
263 |
|
}; |
264 |
|
// |
265 |
|
|
266 |
|
//-----------------inizio CHECK per ricerca errori dal calorimetro------------------- |
267 |
|
// to check or not to check? this is the problem... |
268 |
|
|
269 |
|
Bool_t check = false;//azzera flag presenza errori |
270 |
|
|
271 |
|
// |
272 |
|
Int_t hi = (minev/4)-1; |
273 |
|
//inizio loop su tutti gli header degli eventi di calibrazione |
274 |
|
// for (Int_t ci = minev; ci < maxev ; ci+=4){ |
275 |
|
Int_t ci = minev; |
276 |
|
while ( ci < maxev ){ |
277 |
|
//scorre i pacchetti di 4 in 4 (cioe scorre le calibrazioni) |
278 |
|
Int_t incalrms = 0; |
279 |
|
Int_t outcalrms = 0; |
280 |
|
Int_t totcalbad = 0; |
281 |
|
Int_t incalped = 0; |
282 |
|
Int_t outcalped = 0; |
283 |
|
Int_t incalthr = 0; |
284 |
|
Int_t outcalthr = 0; |
285 |
|
Int_t incalvar = 0; |
286 |
|
Int_t outcalvar = 0; |
287 |
|
Int_t incalbas = 0; |
288 |
|
Int_t outcalbas = 0; |
289 |
|
//dall'albero calibheader, cerco obt dell cpu |
290 |
|
// cpuhe->GetEntry(ci/4); |
291 |
|
hi++; |
292 |
|
// cpuobt=ch->GetPscuHeader()->GetOrbitalTime(); |
293 |
|
cpuobt=cpuhead[hi]; |
294 |
|
obt0=0; |
295 |
|
obt1=0; |
296 |
|
obt2=0; |
297 |
|
obt3=0; |
298 |
// |
// |
299 |
UInt_t found; |
calib.iev=0; |
300 |
tr->SetBranchStatus("*",0,&found); //disable all branches |
memset(calib.cstwerr,0,4*sizeof(Int_t)); |
301 |
|
memset(calib.cperror,0,4*sizeof(Float_t)); |
302 |
|
memset(calib.calped,0,2*22*96*sizeof(Float_t)); |
303 |
|
memset(calib.calgood,0,2*22*96*sizeof(Float_t)); |
304 |
|
memset(calib.calrms,0,2*22*96*sizeof(Float_t)); |
305 |
|
memset(calib.calpuls,0,2*22*96*sizeof(Float_t)); |
306 |
|
memset(calib.calthr,0,2*22*6*sizeof(Float_t)); |
307 |
|
memset(calib.calvar,0,2*22*6*sizeof(Float_t)); |
308 |
|
memset(calib.calbase,0,2*22*6*sizeof(Float_t)); |
309 |
// |
// |
310 |
found = 0; |
//inizio loop su i 4 pacchetti per ogni calibrazione (scorre 4 successivi) |
311 |
tr->SetBranchStatus("iev*",1,&found); |
// for ( Int_t s=0 ; s<4 ;s++ ){ |
312 |
found = 0; |
Int_t s = 0; |
313 |
tr->SetBranchStatus("cstwerr*",1,&found); |
obt = cpuhead[hi]; |
314 |
// printf("enabled %i branches \n",found); |
// printf(" qui cpu header : %i hi %i entry %i \n",obt,hi,ci); |
315 |
found = 0; |
if ( !obt ) break; |
316 |
tr->SetBranchStatus("cperror*",1,&found); |
while ( (labs((Int_t)(obt-cpuhead[hi])) < 100000 && ci < maxev) || !cpuobt ){ |
317 |
//printf("enabled %i branches \n",found); |
|
318 |
found = 0; |
tr->GetEntry(ci);//sceglie la entry (calibrazione)del tree in cui ho tutte le sottostrutture |
319 |
tr->SetBranchStatus("cal*",1,&found); |
// tr->GetEntry(ci+s);//sceglie la entry (calibrazione)del tree in cui ho tutte le sottostrutture |
320 |
//printf("enabled %i branches \n",found); |
|
321 |
found = 0; |
//trovo l'OBT della entry (pacchetto) |
322 |
tr->SetBranchStatus("CalibCalPed*",1,&found); |
obt=eh->GetPscuHeader()->GetOrbitalTime();//cerca orbitaltime all'interno di Pscu |
323 |
//printf("enabled %i branches \n",found); |
// |
324 |
// |
//printf(" qui pkt header : %i \n",obt); |
325 |
tr->SetBranchAddress("CalibCalPed", &ce); |
|
326 |
// |
ci++; |
327 |
Long64_t ncalibs = tr->GetEntries(); |
|
328 |
if ( ncalibs == 0 ){ |
if ( labs((Int_t)(obt-cpuhead[hi])) < 100000 ){ |
329 |
printf(" No calibrations in this files! \n Exiting... \n"); |
|
330 |
return; |
// s++; |
331 |
}; |
if ( ce->cstwerr[0] ) s = 0; |
332 |
printf("\n This file contains %i entries which corrispond to %i calibrations \n\n",(int)ncalibs,(int)ncalibs/4); |
if ( ce->cstwerr[1] ) s = 1; |
333 |
Long64_t minev = 0; |
if ( ce->cstwerr[2] ) s = 2; |
334 |
Long64_t maxev = ncalibs; |
if ( ce->cstwerr[3] ) s = 3; |
335 |
if ( calibnumber ){ |
//printf(" qua pkt header : %i s = %i hi %i \n",obt,s,hi); |
336 |
minev = (calibnumber - 1)* 4; |
// |
337 |
maxev = minev + 4; |
calib.iev = ce->iev; |
338 |
}; |
cestw = 0; |
339 |
TCanvas *figura1; |
//cstwerr e' tutto l'header della sezione, mi interessano gli ultimi 2 Byte(errori del calorimetro) |
340 |
TCanvas *figura2 = 0; |
if ( ce->cstwerr[s] ){ |
341 |
TCanvas *figura3; |
cestw = ce->cstwerr[s] & cmask ; //confronto con la maschera per tenere solo gli |
342 |
TCanvas *rapporto = 0; |
ver[s][16]++;// ultimi 2 Byte (assegnati a cestw) |
|
Int_t cmask = 127 ; |
|
|
Int_t cestw = 0; |
|
|
Int_t ver[4][23]; |
|
|
// |
|
|
for (Int_t k = 0; k < 4; k++ ){ |
|
|
for (Int_t m = 0; m < 23 ; m++ ){ |
|
|
ver[k][m] = 0 ; |
|
343 |
}; |
}; |
344 |
}; |
if ( cestw ){//errori dal calorimetro |
345 |
|
if ( cestw & (1 << 0) ) ver[s][6]++ ;//spostati di uno e confronto se diverso 0 |
346 |
|
if ( cestw & (1 << 1) ) ver[s][5]++ ; |
347 |
|
if ( cestw & (1 << 2) ) ver[s][4]++ ; |
348 |
|
if ( cestw & (1 << 3) ) ver[s][3]++ ; |
349 |
|
if ( cestw & (1 << 4) ) ver[s][2]++ ; |
350 |
|
if ( cestw & (1 << 5) ) ver[s][1]++ ; |
351 |
|
if ( cestw & (1 << 6) ) ver[s][0]++ ; |
352 |
|
}; |
353 |
|
if ( ce->cperror[s] != 0. ){//errori dallo spacchettamento |
354 |
|
if (ce->cperror[s] == 128) ver[s][7]++ ; |
355 |
|
if (ce->cperror[s] == 129) ver[s][8]++ ; |
356 |
|
if (ce->cperror[s] == 130) { |
357 |
|
ver[s][9]++ ; |
358 |
|
ver[s][16]--; |
359 |
|
}; |
360 |
|
if (ce->cperror[s] == 132) ver[s][11]++ ; |
361 |
|
if (ce->cperror[s] == 140) ver[s][19]++ ; |
362 |
|
if (ce->cperror[s] == 141) ver[s][20]++ ; |
363 |
|
if (ce->cperror[s] == 142) ver[s][22]++ ; |
364 |
|
}; |
365 |
|
//lato oscuro :p |
366 |
|
for ( Int_t d=0 ; d<11 ;d++ ){ |
367 |
|
Int_t pre = -1; |
368 |
|
for ( Int_t j=0; j<96 ;j++){ |
369 |
|
if ( j%16 == 0 ) pre++; |
370 |
|
if ( s == 2 ){ |
371 |
|
//aggiungo obt del pacchetto che sta leggendo(obt) |
372 |
|
obt2=obt; |
373 |
|
calib.calped[0][2*d+1][j] = ce->calped[3][d][j]; |
374 |
|
calib.cstwerr[3] = ce->cstwerr[3]; |
375 |
|
calib.cperror[3] = ce->cperror[3]; |
376 |
|
calib.calgood[0][2*d+1][j] = ce->calgood[3][d][j]; |
377 |
|
calib.calthr[0][2*d+1][pre] = ce->calthr[3][d][pre]; |
378 |
|
calib.calrms[0][2*d+1][j] = ce->calrms[3][d][j]; |
379 |
|
calib.calbase[0][2*d+1][pre] = ce->calbase[3][d][pre]; |
380 |
|
calib.calvar[0][2*d+1][pre] = ce->calvar[3][d][pre]; |
381 |
|
}; |
382 |
|
if ( s == 3 ){ |
383 |
|
obt3=obt; |
384 |
|
calib.calped[0][2*d][j] = ce->calped[1][d][j]; |
385 |
|
calib.cstwerr[1] = ce->cstwerr[1]; |
386 |
|
calib.cperror[1] = ce->cperror[1]; |
387 |
|
calib.calgood[0][2*d][j] = ce->calgood[1][d][j]; |
388 |
|
calib.calthr[0][2*d][pre] = ce->calthr[1][d][pre]; |
389 |
|
calib.calrms[0][2*d][j] = ce->calrms[1][d][j]; |
390 |
|
calib.calbase[0][2*d][pre] = ce->calbase[1][d][pre]; |
391 |
|
calib.calvar[0][2*d][pre] = ce->calvar[1][d][pre]; |
392 |
|
}; |
393 |
|
if ( s == 0 ){ |
394 |
|
obt0=obt; |
395 |
|
calib.calped[1][2*d][j] = ce->calped[0][d][j]; |
396 |
|
calib.cstwerr[0] = ce->cstwerr[0]; |
397 |
|
calib.cperror[0] = ce->cperror[0]; |
398 |
|
calib.calgood[1][2*d][j] = ce->calgood[0][d][j]; |
399 |
|
calib.calthr[1][2*d][pre] = ce->calthr[0][d][pre]; |
400 |
|
calib.calrms[1][2*d][j] = ce->calrms[0][d][j]; |
401 |
|
calib.calbase[1][2*d][pre] = ce->calbase[0][d][pre]; |
402 |
|
calib.calvar[1][2*d][pre] = ce->calvar[0][d][pre]; |
403 |
|
}; |
404 |
|
if ( s == 1 ){ |
405 |
|
obt1=obt; |
406 |
|
calib.calped[1][2*d+1][j] = ce->calped[2][d][j]; |
407 |
|
calib.cstwerr[2] = ce->cstwerr[2]; |
408 |
|
calib.cperror[2] = ce->cperror[2]; |
409 |
|
calib.calgood[1][2*d+1][j] = ce->calgood[2][d][j]; |
410 |
|
calib.calthr[1][2*d+1][pre] = ce->calthr[2][d][pre]; |
411 |
|
calib.calrms[1][2*d+1][j] = ce->calrms[2][d][j]; |
412 |
|
calib.calbase[1][2*d+1][pre] = ce->calbase[2][d][pre]; |
413 |
|
calib.calvar[1][2*d+1][pre] = ce->calvar[2][d][pre]; |
414 |
|
}; |
415 |
|
|
416 |
|
}; |
417 |
|
};//chiuso for su si(sezioni) |
418 |
|
} else { |
419 |
|
ci--; |
420 |
|
}; |
421 |
|
};//chiuso for su ci(eventi) |
422 |
// |
// |
423 |
|
//fine CHECK |
424 |
|
|
425 |
// |
// |
426 |
const string fil = (const char*)filename; |
// Book the histograms: |
427 |
Int_t posiz = fil.find("dw_"); |
// Int_t i = (ci-minev)/4; |
428 |
if ( posiz == -1 ) posiz = fil.find("DW_"); |
Int_t i = hi; |
429 |
Int_t posiz2 = posiz+13; |
xviewev.str(""); |
430 |
TString file2; |
xviewev << "x-view event " << (i+1); |
431 |
stringcopy(file2,filename,posiz,posiz2); |
yviewev.str(""); |
432 |
// |
yviewev << "y-view event " << (i+1); |
433 |
const char *figrec = file2; |
TH2F *Xview = new TH2F(xviewev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
434 |
const char *outdir = outDir; |
TH2F *Yview = new TH2F(yviewev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
435 |
const char *format = saveas; |
|
436 |
stringstream figsave; |
|
437 |
stringstream figsave1; |
|
438 |
stringstream figsave2; |
//prepara gli istogrammi figures: |
439 |
|
gDirectory->Delete("C14"); |
440 |
|
gDirectory->Delete("C15"); |
441 |
|
gDirectory->Delete("C16"); |
442 |
|
//TH1F *calped = new TH1F("C14","calped",4230,-3.5,4227.5); |
443 |
|
// TH1F *calrms = new TH1F("C15","calrms",4230,-3.5,4228.5); |
444 |
|
TH1F *calped = new TH1F("C14","C14 calped",2112,-3.5,4227.5); //istogramma unidimensionale con valori float |
445 |
|
// TH1F *calrms = new TH1F("C15","calrms",264,-2.,4226.); |
446 |
|
TH1F *calrms = new TH1F("C15","C15 calrms",2112,-3.5,4228.5); |
447 |
|
TH1F *calbad = new TH1F("C16","C16 calgood",4230,-3.5,4228.5); |
448 |
// |
// |
449 |
// to check or not to check? this is the problem... |
gDirectory->Delete("C17"); |
450 |
|
gDirectory->Delete("C18"); |
451 |
|
gDirectory->Delete("C19"); |
452 |
|
TH1F *calthr = new TH1F("C17","C17 calthr",271,-4.5,268.5); |
453 |
|
TH1F *calvar = new TH1F("C18","C18 calvar",271,-4.5,268.5); |
454 |
|
TH1F *calbase = new TH1F("C19","C19 calbase",271,-4.5,268.5); |
455 |
// |
// |
456 |
Bool_t check = false; |
Int_t bgcolor = 10; |
457 |
|
TPad *pd1 = 0; |
458 |
|
TPad *pd2 = 0; |
459 |
|
TPad *palette = 0; |
460 |
|
TLatex *t=new TLatex(); |
461 |
|
|
462 |
// |
// |
463 |
for (Int_t ci = minev; ci < maxev ; ci+=4){ |
//pagina visualizzata solo se ci sono problemi |
464 |
// |
if ( figmatra ){//figmatra e' variabile in ingresso in main |
465 |
Int_t incalrms = 0; |
figura2 = new TCanvas("Calorimeter:_strip_RMS", "Calorimeter:_strip_RMS", 750, 650); |
466 |
Int_t outcalrms = 0; |
figura2->SetFillColor(10); |
467 |
Int_t totcalbad = 0; |
figura2->Range(0,0,100,100); |
468 |
Int_t incalped = 0; |
bgcolor = 10; |
469 |
Int_t outcalped = 0; |
pd1 = new TPad("pd1","This is pad1",0.02,0.05,0.88,0.49,bgcolor); |
470 |
Int_t incalthr = 0; |
pd2 = new TPad("pd2","This is pad2",0.02,0.51,0.88,0.95,bgcolor); |
471 |
Int_t outcalthr = 0; |
palette = new TPad("palette","This is palette",0.90,0.05,0.98,0.90,bgcolor); |
472 |
Int_t incalvar = 0; |
figura2->cd(); |
473 |
Int_t outcalvar = 0; |
gStyle->SetOptStat(""); |
474 |
Int_t incalbas = 0; |
t=new TLatex(); |
475 |
Int_t outcalbas = 0; |
t->SetTextFont(32); |
476 |
// |
t->SetTextColor(1); |
477 |
for ( Int_t s=0 ; s<4 ;s++ ){ |
t->SetTextSize(0.03); |
478 |
tr->GetEntry(ci+s); |
t->SetTextAlign(12); |
479 |
calib.iev = ce->iev; |
t->DrawLatex(90.,92.5,"ADC ch."); |
480 |
// |
pd1->Range(0,0,100,100); |
481 |
// |
pd2->Range(0,0,100,100); |
482 |
// |
palette->Range(0,0,100,100); |
483 |
cestw = 0; |
pd1->SetTicks(); |
484 |
if ( ce->cstwerr[s] ){ |
pd2->SetTicks(); |
485 |
cestw = ce->cstwerr[s] & cmask ; |
pd1->Draw(); |
486 |
ver[s][16]++; |
pd2->Draw(); |
487 |
}; |
palette->Draw(); |
488 |
if ( cestw ){ |
palette->cd(); |
489 |
if ( cestw & (1 << 0) ) ver[s][6]++ ; |
// palette |
490 |
if ( cestw & (1 << 1) ) ver[s][5]++ ; |
TPaveLabel *box1 = new TPaveLabel(2,2,98,14,"OFF",""); |
491 |
if ( cestw & (1 << 2) ) ver[s][4]++ ; |
box1->SetTextFont(32); |
492 |
if ( cestw & (1 << 3) ) ver[s][3]++ ; |
box1->SetTextColor(1); |
493 |
if ( cestw & (1 << 4) ) ver[s][2]++ ; |
box1->SetTextSize(0.25); |
494 |
if ( cestw & (1 << 5) ) ver[s][1]++ ; |
box1->SetFillColor(10); |
495 |
if ( cestw & (1 << 6) ) ver[s][0]++ ; |
box1->Draw(); |
496 |
}; |
TPaveLabel *box2 = new TPaveLabel(2,16,98,28,"0-1.5",""); |
497 |
if ( ce->cperror[s] != 0. ){ |
box2->SetTextFont(32); |
498 |
if (ce->cperror[s] == 128) ver[s][7]++ ; |
box2->SetTextColor(1); |
499 |
if (ce->cperror[s] == 129) ver[s][8]++ ; |
box2->SetTextSize(0.25); |
500 |
if (ce->cperror[s] == 130) { |
box2->SetFillColor(38); |
501 |
ver[s][9]++ ; |
box2->Draw(); |
502 |
ver[s][16]--; |
TPaveLabel *box3 = new TPaveLabel(2,30,98,42,"1.5-4",""); |
503 |
}; |
box3->SetTextFont(32); |
504 |
if (ce->cperror[s] == 132) ver[s][11]++ ; |
box3->SetTextColor(1); |
505 |
if (ce->cperror[s] == 140) ver[s][19]++ ; |
box3->SetTextSize(0.25); |
506 |
if (ce->cperror[s] == 141) ver[s][20]++ ; |
box3->SetFillColor(4); |
507 |
if (ce->cperror[s] == 142) ver[s][22]++ ; |
box3->Draw(); |
508 |
}; |
TPaveLabel *box4 = new TPaveLabel(2,44,98,56,"4-6.5",""); |
509 |
// |
box4->SetTextFont(32); |
510 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
box4->SetTextColor(1); |
511 |
Int_t pre = -1; |
box4->SetTextSize(0.25); |
512 |
for ( Int_t j=0; j<96 ;j++){ |
box4->SetFillColor(3); |
513 |
if ( j%16 == 0 ) pre++; |
box4->Draw(); |
514 |
if ( s == 2 ){ |
TPaveLabel *box5 = new TPaveLabel(2,58,98,70,"6.5-11.5",""); |
515 |
calib.calped[0][2*d+1][j] = ce->calped[3][d][j]; |
box5->SetTextFont(32); |
516 |
calib.cstwerr[3] = ce->cstwerr[3]; |
box5->SetTextColor(1); |
517 |
calib.cperror[3] = ce->cperror[3]; |
box5->SetTextSize(0.25); |
518 |
calib.calgood[0][2*d+1][j] = ce->calgood[3][d][j]; |
box5->SetFillColor(2); |
519 |
calib.calthr[0][2*d+1][pre] = ce->calthr[3][d][pre]; |
box5->Draw(); |
520 |
calib.calrms[0][2*d+1][j] = ce->calrms[3][d][j]; |
TPaveLabel *box6 = new TPaveLabel(2,72,98,84,">11.5",""); |
521 |
calib.calbase[0][2*d+1][pre] = ce->calbase[3][d][pre]; |
box6->SetTextFont(32); |
522 |
calib.calvar[0][2*d+1][pre] = ce->calvar[3][d][pre]; |
box6->SetTextColor(1); |
523 |
}; |
box6->SetTextSize(0.25); |
524 |
if ( s == 3 ){ |
box6->SetFillColor(6); |
525 |
calib.calped[0][2*d][j] = ce->calped[1][d][j]; |
box6->Draw(); |
526 |
calib.cstwerr[1] = ce->cstwerr[1]; |
TPaveLabel *box7 = new TPaveLabel(2,86,98,98,"BAD",""); |
527 |
calib.cperror[1] = ce->cperror[1]; |
box7->SetTextFont(32); |
528 |
calib.calgood[0][2*d][j] = ce->calgood[1][d][j]; |
box7->SetTextColor(10); |
529 |
calib.calthr[0][2*d][pre] = ce->calthr[1][d][pre]; |
box7->SetTextSize(0.25); |
530 |
calib.calrms[0][2*d][j] = ce->calrms[1][d][j]; |
box7->SetFillColor(1); |
531 |
calib.calbase[0][2*d][pre] = ce->calbase[1][d][pre]; |
box7->Draw(); |
532 |
calib.calvar[0][2*d][pre] = ce->calvar[1][d][pre]; |
// |
533 |
}; |
pd1->cd(); |
534 |
if ( s == 0 ){ |
gStyle->SetOptStat(""); |
535 |
calib.calped[1][2*d][j] = ce->calped[0][d][j]; |
Xview->SetXTitle("strip"); |
536 |
calib.cstwerr[0] = ce->cstwerr[0]; |
Xview->SetYTitle("X - plane"); |
537 |
calib.cperror[0] = ce->cperror[0]; |
Xview->GetYaxis()->SetTitleOffset(0.5); |
538 |
calib.calgood[1][2*d][j] = ce->calgood[0][d][j]; |
Xview->SetFillColor(bgcolor); |
539 |
calib.calthr[1][2*d][pre] = ce->calthr[0][d][pre]; |
Xview->Fill(1.,1.,1.); |
540 |
calib.calrms[1][2*d][j] = ce->calrms[0][d][j]; |
Xview->Draw("box"); |
541 |
calib.calbase[1][2*d][pre] = ce->calbase[0][d][pre]; |
pd1->Update(); |
542 |
calib.calvar[1][2*d][pre] = ce->calvar[0][d][pre]; |
pd2->cd(); |
543 |
}; |
gStyle->SetOptStat(""); |
544 |
if ( s == 1 ){ |
Yview->SetXTitle("strip"); |
545 |
calib.calped[1][2*d+1][j] = ce->calped[2][d][j]; |
Yview->SetYTitle("Y - plane"); |
546 |
calib.cstwerr[2] = ce->cstwerr[2]; |
Yview->GetYaxis()->SetTitleOffset(0.5); |
547 |
calib.cperror[2] = ce->cperror[2]; |
Yview->SetFillColor(bgcolor); |
548 |
calib.calgood[1][2*d+1][j] = ce->calgood[2][d][j]; |
Yview->Fill(1.,1.,1.); |
549 |
calib.calthr[1][2*d+1][pre] = ce->calthr[2][d][pre]; |
Yview->Draw("box"); |
550 |
calib.calrms[1][2*d+1][j] = ce->calrms[2][d][j]; |
pd2->Update(); |
551 |
calib.calbase[1][2*d+1][pre] = ce->calbase[2][d][pre]; |
}; |
552 |
calib.calvar[1][2*d+1][pre] = ce->calvar[2][d][pre]; |
// |
553 |
}; |
// run over views and planes |
554 |
}; |
//verifica quali strip sono state utilizzate per la calibrazione |
555 |
|
Int_t j = 0; |
556 |
|
Int_t g = 0; |
557 |
|
gStyle->SetOptStat(""); |
558 |
|
for (Int_t m = 0; m < 22; m++){//loop sui piani |
559 |
|
for (Int_t l = 0; l < 2; l++){//loop x y |
560 |
|
for (Int_t n = 0; n < 96; n++){ //loop sulle strip |
561 |
|
//controlla quante strip hanno piedistallo fuori dai limiti (escludendo quelle difettose) |
562 |
|
calped->Fill((float)j,calib.calped[l][m][n]); |
563 |
|
if ( (calib.calped[l][m][n] > 700. || calib.calped[l][m][n] < -700.) && (j < 4032 || j > 4048) ){ |
564 |
|
outcalped++; |
565 |
|
} else { |
566 |
|
incalped++; |
567 |
|
}; |
568 |
|
//controlla quali strip hanno rms fuori dai limiti (ponendo un limite diverso(piu' alto) per quelle difettose |
569 |
|
calrms->Fill((float)j,(calib.calrms[l][m][n]/4.)); |
570 |
|
if ( (((calib.calrms[l][m][n]/4.) > 10. || (calib.calrms[l][m][n]/4.) < 1.) && (j < 3440 || j > 3550)) || ( (j > 3439 && j < 3551) && ((calib.calrms[l][m][n]/4.) > 150. || (calib.calrms[l][m][n]/4.) < 1.)) ){ |
571 |
|
outcalrms++; |
572 |
|
} else { |
573 |
|
incalrms++; |
574 |
|
};//controlla (conta) quali strip sono state escluse dalla calibrazione |
575 |
|
calbad->Fill((float)j,(float)calib.calgood[l][m][n]); |
576 |
|
if ( calib.calgood[l][m][n] ) totcalbad++;//strip(orientazione(l),piano(m),numero(n))e' nulla, aumenta il |
577 |
|
// |
578 |
|
//preamplificatori(soglia max di calvar portata a 9, prima era 8) |
579 |
|
if ( n < 6 ){ |
580 |
|
calthr->Fill((float)g,(float)calib.calthr[l][m][n]);//controlla quali strip hanno soglia al difuori del limite(esclude) |
581 |
|
//(quelle difettose) |
582 |
|
if ( (calib.calthr[l][m][n] > 25. || calib.calthr[l][m][n] < 12.) && (g < 215 || g > 221) ){ |
583 |
|
outcalthr++; |
584 |
|
} else { |
585 |
|
incalthr++; |
586 |
}; |
}; |
587 |
}; |
calvar->Fill((float)g,(float)calib.calvar[l][m][n]);//controlla la varianza (esclude le difettose) |
588 |
// |
if ( (calib.calvar[l][m][n] > 9. || calib.calvar[l][m][n] < 1. ) && (g < 215 || g > 221) ){ |
589 |
// Book the histograms: |
outcalvar++; |
590 |
// |
} else { |
591 |
// |
incalvar++; |
|
Int_t i = (ci-minev)/4; |
|
|
xviewev.str(""); |
|
|
xviewev << "x-view event " << (i+1); |
|
|
yviewev.str(""); |
|
|
yviewev << "y-view event " << (i+1); |
|
|
TH2F *Xview = new TH2F(xviewev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
|
|
TH2F *Yview = new TH2F(yviewev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
|
|
// |
|
|
// figures: |
|
|
// |
|
|
gDirectory->Delete("C14"); |
|
|
gDirectory->Delete("C15"); |
|
|
gDirectory->Delete("C16"); |
|
|
TH1F *calped = new TH1F("C14","calped",4230,-3.5,4227.5); |
|
|
TH1F *calrms = new TH1F("C15","calrms",4230,-3.5,4228.5); |
|
|
TH1F *calbad = new TH1F("C16","calgood",4230,-3.5,4228.5); |
|
|
// |
|
|
gDirectory->Delete("C17"); |
|
|
gDirectory->Delete("C18"); |
|
|
gDirectory->Delete("C19"); |
|
|
TH1F *calthr = new TH1F("C17","calthr",271,-4.5,268.5); |
|
|
TH1F *calvar = new TH1F("C18","calvar",271,-4.5,268.5); |
|
|
TH1F *calbase = new TH1F("C19","calbase",271,-4.5,268.5); |
|
|
// |
|
|
Int_t bgcolor = 10; |
|
|
TPad *pd1 = 0; |
|
|
TPad *pd2 = 0; |
|
|
TPad *palette = 0; |
|
|
TLatex *t=new TLatex(); |
|
|
if ( figmatra ){ |
|
|
figura2 = new TCanvas("Calorimeter:_strip_RMS", "Calorimeter:_strip_RMS", 750, 650); |
|
|
figura2->SetFillColor(10); |
|
|
figura2->Range(0,0,100,100); |
|
|
bgcolor = 10; |
|
|
pd1 = new TPad("pd1","This is pad1",0.02,0.05,0.88,0.49,bgcolor); |
|
|
pd2 = new TPad("pd2","This is pad2",0.02,0.51,0.88,0.95,bgcolor); |
|
|
palette = new TPad("palette","This is palette",0.90,0.05,0.98,0.90,bgcolor); |
|
|
figura2->cd(); |
|
|
gStyle->SetOptStat(""); |
|
|
t=new TLatex(); |
|
|
t->SetTextFont(32); |
|
|
t->SetTextColor(1); |
|
|
t->SetTextSize(0.03); |
|
|
t->SetTextAlign(12); |
|
|
t->DrawLatex(90.,92.5,"ADC ch."); |
|
|
pd1->Range(0,0,100,100); |
|
|
pd2->Range(0,0,100,100); |
|
|
palette->Range(0,0,100,100); |
|
|
pd1->SetTicks(); |
|
|
pd2->SetTicks(); |
|
|
pd1->Draw(); |
|
|
pd2->Draw(); |
|
|
palette->Draw(); |
|
|
palette->cd(); |
|
|
// palette |
|
|
TPaveLabel *box1 = new TPaveLabel(2,2,98,14,"OFF",""); |
|
|
box1->SetTextFont(32); |
|
|
box1->SetTextColor(1); |
|
|
box1->SetTextSize(0.25); |
|
|
box1->SetFillColor(10); |
|
|
box1->Draw(); |
|
|
TPaveLabel *box2 = new TPaveLabel(2,16,98,28,"0-1.5",""); |
|
|
box2->SetTextFont(32); |
|
|
box2->SetTextColor(1); |
|
|
box2->SetTextSize(0.25); |
|
|
box2->SetFillColor(38); |
|
|
box2->Draw(); |
|
|
TPaveLabel *box3 = new TPaveLabel(2,30,98,42,"1.5-4",""); |
|
|
box3->SetTextFont(32); |
|
|
box3->SetTextColor(1); |
|
|
box3->SetTextSize(0.25); |
|
|
box3->SetFillColor(4); |
|
|
box3->Draw(); |
|
|
TPaveLabel *box4 = new TPaveLabel(2,44,98,56,"4-6.5",""); |
|
|
box4->SetTextFont(32); |
|
|
box4->SetTextColor(1); |
|
|
box4->SetTextSize(0.25); |
|
|
box4->SetFillColor(3); |
|
|
box4->Draw(); |
|
|
TPaveLabel *box5 = new TPaveLabel(2,58,98,70,"6.5-11.5",""); |
|
|
box5->SetTextFont(32); |
|
|
box5->SetTextColor(1); |
|
|
box5->SetTextSize(0.25); |
|
|
box5->SetFillColor(2); |
|
|
box5->Draw(); |
|
|
TPaveLabel *box6 = new TPaveLabel(2,72,98,84,">11.5",""); |
|
|
box6->SetTextFont(32); |
|
|
box6->SetTextColor(1); |
|
|
box6->SetTextSize(0.25); |
|
|
box6->SetFillColor(6); |
|
|
box6->Draw(); |
|
|
TPaveLabel *box7 = new TPaveLabel(2,86,98,98,"BAD",""); |
|
|
box7->SetTextFont(32); |
|
|
box7->SetTextColor(10); |
|
|
box7->SetTextSize(0.25); |
|
|
box7->SetFillColor(1); |
|
|
box7->Draw(); |
|
|
// |
|
|
pd1->cd(); |
|
|
gStyle->SetOptStat(""); |
|
|
Xview->SetXTitle("strip"); |
|
|
Xview->SetYTitle("X - plane"); |
|
|
Xview->GetYaxis()->SetTitleOffset(0.5); |
|
|
Xview->SetFillColor(bgcolor); |
|
|
Xview->Fill(1.,1.,1.); |
|
|
Xview->Draw("box"); |
|
|
pd1->Update(); |
|
|
pd2->cd(); |
|
|
gStyle->SetOptStat(""); |
|
|
Yview->SetXTitle("strip"); |
|
|
Yview->SetYTitle("Y - plane"); |
|
|
Yview->GetYaxis()->SetTitleOffset(0.5); |
|
|
Yview->SetFillColor(bgcolor); |
|
|
Yview->Fill(1.,1.,1.); |
|
|
Yview->Draw("box"); |
|
|
pd2->Update(); |
|
|
}; |
|
|
// |
|
|
// run over views and planes |
|
|
// |
|
|
Int_t j = 0; |
|
|
Int_t g = 0; |
|
|
gStyle->SetOptStat(""); |
|
|
for (Int_t m = 0; m < 22; m++){ |
|
|
for (Int_t l = 0; l < 2; l++){ |
|
|
for (Int_t n = 0; n < 96; n++){ |
|
|
// |
|
|
calped->Fill((float)j,calib.calped[l][m][n]); |
|
|
if ( (calib.calped[l][m][n] > 700. || calib.calped[l][m][n] < -700.) && (j < 4032 || j > 4048) ){ |
|
|
outcalped++; |
|
|
} else { |
|
|
incalped++; |
|
|
}; |
|
|
calrms->Fill((float)j,(calib.calrms[l][m][n]/4.)); |
|
|
if ( (calib.calrms[l][m][n]/4.) > 7. || (calib.calrms[l][m][n]/4.) < 1. ){ |
|
|
outcalrms++; |
|
|
} else { |
|
|
incalrms++; |
|
|
}; |
|
|
calbad->Fill((float)j,(float)calib.calgood[l][m][n]); |
|
|
if ( calib.calgood[l][m][n] ) totcalbad++; |
|
|
// |
|
|
if ( n < 6 ){ |
|
|
calthr->Fill((float)g,(float)calib.calthr[l][m][n]); |
|
|
if ( calib.calthr[l][m][n] > 21. || calib.calthr[l][m][n] < 12. ){ |
|
|
outcalthr++; |
|
|
} else { |
|
|
incalthr++; |
|
|
}; |
|
|
calvar->Fill((float)g,(float)calib.calvar[l][m][n]); |
|
|
if ( calib.calvar[l][m][n] > 8. || calib.calvar[l][m][n] < 1. ){ |
|
|
outcalvar++; |
|
|
} else { |
|
|
incalvar++; |
|
|
}; |
|
|
calbase->Fill((float)g,(float)calib.calbase[l][m][n]); |
|
|
if ( calib.calbase[l][m][n] > 4500. || calib.calbase[l][m][n] < 2000. ){ |
|
|
outcalbas++; |
|
|
} else { |
|
|
incalbas++; |
|
|
}; |
|
|
g++; |
|
|
}; |
|
|
// |
|
|
j++; |
|
|
// |
|
|
if ( figmatra ){ |
|
|
figura2->cd(); |
|
|
xviewev.str(""); |
|
|
xviewev << "x-view " << i; |
|
|
xviewev << " event " << n; |
|
|
xviewev << " " << m; |
|
|
xviewev << " " << l; |
|
|
yviewev.str(""); |
|
|
yviewev << "y-view " << i; |
|
|
yviewev << " event " << n; |
|
|
yviewev << " " << m; |
|
|
yviewev << " " << l; |
|
|
TH2F *Xview = new TH2F(xviewev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
|
|
TH2F *Yview = new TH2F(yviewev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
|
|
if ( calib.calrms[l][m][n] > 0 ){ |
|
|
Xview->SetFillColor(38); |
|
|
Yview->SetFillColor(38); |
|
|
}; |
|
|
if ( calib.calrms[l][m][n] > 6 ){ |
|
|
Xview->SetFillColor(4); |
|
|
Yview->SetFillColor(4); |
|
|
}; |
|
|
if ( calib.calrms[l][m][n] > 16 ){ |
|
|
Xview->SetFillColor(3); |
|
|
Yview->SetFillColor(3); |
|
|
}; |
|
|
if ( calib.calrms[l][m][n] > 26 ){ |
|
|
Xview->SetFillColor(2); |
|
|
Yview->SetFillColor(2); |
|
|
}; |
|
|
if ( calib.calrms[l][m][n] > 46 ){ |
|
|
Xview->SetFillColor(6); |
|
|
Yview->SetFillColor(6); |
|
|
}; |
|
|
if ( calib.calrms[l][m][n] <= 0 || calib.calrms[l][m][n] >30000 || calib.calped[l][m][n]>25000){ |
|
|
Xview->SetFillColor(10); |
|
|
Yview->SetFillColor(10); |
|
|
}; |
|
|
if ( calib.calgood[l][m][n] != 0 ){ |
|
|
Xview->SetFillColor(1); |
|
|
Yview->SetFillColor(1); |
|
|
}; |
|
|
if ( l == 0 ) { |
|
|
Xview->Fill(n,m,1.); |
|
|
pd1->cd(); |
|
|
Xview->Draw("box same"); |
|
|
}; |
|
|
if ( l == 1 ) { |
|
|
Yview->Fill(n,m,1.); |
|
|
pd2->cd(); |
|
|
Yview->Draw("box same"); |
|
|
}; |
|
|
}; |
|
|
}; |
|
592 |
}; |
}; |
593 |
}; |
calbase->Fill((float)g,(float)calib.calbase[l][m][n]);//controlla baseline |
594 |
if ( figmatra ){ |
if ( calib.calbase[l][m][n] > 5500. || calib.calbase[l][m][n] < 2000. ){ |
595 |
|
outcalbas++; |
596 |
|
} else { |
597 |
|
incalbas++; |
598 |
|
}; |
599 |
|
g++;//contatore preamplificatoripassa alla strip successiva (0-286) |
600 |
|
}; |
601 |
|
// |
602 |
|
j++;//contatore strip |
603 |
|
|
604 |
|
//istogrammi (solo se ci sono stati problemi) |
605 |
|
if ( figmatra ){ |
606 |
figura2->cd(); |
figura2->cd(); |
607 |
gStyle->SetOptStat(""); |
xviewev.str(""); |
608 |
gStyle->SetOptDate(0); |
xviewev << "x-view " << i; |
609 |
t=new TLatex(); |
xviewev << " event " << n; |
610 |
t->SetTextFont(32); |
xviewev << " " << m; |
611 |
t->SetTextColor(1); |
xviewev << " " << l; |
612 |
t->SetTextSize(0.03); |
yviewev.str(""); |
613 |
t->SetTextAlign(12); |
yviewev << "y-view " << i; |
614 |
titolo.str(""); |
yviewev << " event " << n; |
615 |
titolo << "C13 - Calorimeter: strip RMS - file "; |
yviewev << " " << m; |
616 |
titolo << file; |
yviewev << " " << l; |
617 |
titolo << " - calibration number "; |
TH2F *Xview = new TH2F(xviewev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5);//istogramma 2d |
618 |
titolo << (i+1); |
TH2F *Yview = new TH2F(yviewev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
619 |
t->DrawLatex(0.5,97.,titolo.str().c_str()); |
if ( calib.calrms[l][m][n] > 0 ){ |
620 |
pd1->Update(); |
Xview->SetFillColor(38); |
621 |
pd2->Update(); |
Yview->SetFillColor(38); |
622 |
figura2->Update(); |
}; |
623 |
}; |
if ( calib.calrms[l][m][n] > 6 ){ |
624 |
// |
Xview->SetFillColor(4); |
625 |
figura1 = new TCanvas("Calorimeter_calped_calrms_calgood", "Calorimeter_calped_calrms_calgood", 750, 950); |
Yview->SetFillColor(4); |
626 |
figura1->SetFillColor(10); |
}; |
627 |
figura1->Range(0,0,100,100); |
if ( calib.calrms[l][m][n] > 16 ){ |
628 |
// |
Xview->SetFillColor(3); |
629 |
ccalped = (float)incalped/((float)outcalped + (float)incalped); |
Yview->SetFillColor(3); |
630 |
Int_t f1pd1col = 10; |
}; |
631 |
if ( ccalped < ccalpedthr ) { |
if ( calib.calrms[l][m][n] > 26 ){ |
632 |
check = true; |
Xview->SetFillColor(2); |
633 |
f1pd1col = 45; |
Yview->SetFillColor(2); |
634 |
}; |
}; |
635 |
// |
if ( calib.calrms[l][m][n] > 46 ){ |
636 |
ccalrms = (float)incalrms/((float)outcalrms + (float)incalrms); |
Xview->SetFillColor(6); |
637 |
Int_t f1pd2col = 10; |
Yview->SetFillColor(6); |
638 |
if ( ccalrms < ccalrmsthr ) { |
}; |
639 |
check = true; |
if ( calib.calrms[l][m][n] <= 0 || calib.calrms[l][m][n] >30000 || calib.calped[l][m][n]>25000){ |
640 |
f1pd2col = 45; |
Xview->SetFillColor(10); |
641 |
}; |
Yview->SetFillColor(10); |
642 |
// |
}; |
643 |
ccalbad = (float)totcalbad/4224.; |
if ( calib.calgood[l][m][n] != 0 ){ |
644 |
Int_t f1pd3col = 10; |
Xview->SetFillColor(1); |
645 |
if ( ccalbad > ccalbadthr ) { |
Yview->SetFillColor(1); |
646 |
check = true; |
}; |
647 |
f1pd3col = 45; |
if ( l == 0 ) { |
648 |
}; |
Xview->Fill(n,m,1.); |
649 |
// |
pd1->cd(); |
650 |
TPad *f1pd1 = new TPad("f1pd1","This is f1pad1",0.02,0.684,0.98,0.95,f1pd1col); |
Xview->Draw("box same"); |
651 |
TPad *f1pd2 = new TPad("f1pd2","This is f1pad2",0.02,0.367,0.98,0.634,f1pd2col); |
}; |
652 |
TPad *f1pd3 = new TPad("f1pd3","This is f1pad3",0.02,0.05,0.98,0.317,f1pd3col); |
if ( l == 1 ) { |
653 |
figura1->Clear(); |
Yview->Fill(n,m,1.); |
654 |
figura1->cd(); |
pd2->cd(); |
655 |
f1pd1->SetTicks(); |
Yview->Draw("box same"); |
656 |
f1pd2->SetTicks(); |
}; |
657 |
f1pd3->SetTicks(); |
};//fine istogrammi |
658 |
f1pd1->Draw(); |
};//fine loop strip per piano |
659 |
f1pd2->Draw(); |
};//fine loop x y |
660 |
f1pd3->Draw(); |
};//fine loop piani |
661 |
figura1->Draw(); |
|
662 |
figura3 = new TCanvas("Calorimeter_calthr_calvar_calbase", "Calorimeter_calthr_calvar_calbase", 750, 950); |
//disega la figura |
663 |
figura3->SetFillColor(10); |
if ( figmatra ){ |
664 |
figura3->Range(0,0,100,100); |
figura2->cd(); |
665 |
// |
gStyle->SetOptStat(""); |
666 |
ccalthr = (float)incalthr/((float)outcalthr + (float)incalthr); |
gStyle->SetOptDate(0); |
667 |
Int_t f3pd1col = 10; |
t=new TLatex(); |
668 |
if ( ccalthr < ccalthrthr ) { |
t->SetTextFont(32); |
669 |
check = true; |
t->SetTextColor(1); |
670 |
f3pd1col = 45; |
t->SetTextSize(0.03); |
671 |
}; |
t->SetTextAlign(12); |
672 |
// |
titolo.str(""); |
673 |
ccalvar = (float)incalvar/((float)outcalvar + (float)incalvar); |
titolo << "C13 - Calorimeter: strip RMS - file "; |
674 |
Int_t f3pd2col = 10; |
titolo << file; |
675 |
if ( ccalvar < ccalvarthr ) { |
titolo << " - calibration number "; |
676 |
check = true; |
titolo << (i+1); |
677 |
f3pd2col = 45; |
t->DrawLatex(0.5,97.,titolo.str().c_str()); |
678 |
}; |
pd1->Update(); |
679 |
// |
pd2->Update(); |
680 |
ccalbas = (float)incalbas/((float)outcalbas + (float)incalbas); |
figura2->Update(); |
681 |
Int_t f3pd3col = 10; |
}; |
682 |
if ( ccalbas < ccalbasthr ) { |
//fine pagina visualizzata solo se ci sono problemi |
683 |
check = true; |
// |
684 |
f3pd3col = 45; |
|
685 |
|
//Prepara le finestre |
686 |
|
//finestra con figure C14,C15,C16 |
687 |
|
figura1 = new TCanvas("Calorimeter_calped_calrms_calgood", "Calorimeter_calped_calrms_calgood", 750, 950);//nuova finestra |
688 |
|
figura1->SetFillColor(10); |
689 |
|
figura1->Range(0,0,100,100); |
690 |
|
// |
691 |
|
ccalped = (float)incalped/((float)outcalped + (float)incalped); |
692 |
|
Int_t f1pd1col = 10;//costante=10 |
693 |
|
if ( ccalped < ccalpedthr ) { //se % strip con piedistallo buono < numero minimo segna soglia |
694 |
|
check = true; //flag per segnalare errori |
695 |
|
f1pd1col = 45; // (se ci sono problemi, cambia colore) |
696 |
|
}; |
697 |
|
// |
698 |
|
ccalrms = (float)incalrms/((float)outcalrms + (float)incalrms); |
699 |
|
Int_t f1pd2col = 10; |
700 |
|
if ( ccalrms < ccalrmsthr ) { //se % strip con rms buono< numero minimo segna errore |
701 |
|
check = true; |
702 |
|
f1pd2col = 45; |
703 |
|
}; |
704 |
|
// |
705 |
|
ccalbad = (float)totcalbad/4224.; |
706 |
|
Int_t f1pd3col = 10; |
707 |
|
if ( ccalbad > ccalbadthr ) { //se il numero di strip escluse dalla calibrazione e' troppo alto segna errore |
708 |
|
check = true; |
709 |
|
f1pd3col = 45; |
710 |
|
}; |
711 |
|
// |
712 |
|
TPad *f1pd1 = new TPad("f1pd1","This is f1pad1",0.02,0.684,0.98,0.95,f1pd1col);//prepara le pad di figura1 |
713 |
|
TPad *f1pd2 = new TPad("f1pd2","This is f1pad2",0.02,0.367,0.98,0.634,f1pd2col); |
714 |
|
TPad *f1pd3 = new TPad("f1pd3","This is f1pad3",0.02,0.05,0.98,0.317,f1pd3col); |
715 |
|
figura1->Clear(); |
716 |
|
figura1->cd(); |
717 |
|
f1pd1->SetTicks(); |
718 |
|
f1pd2->SetTicks(); |
719 |
|
f1pd3->SetTicks(); |
720 |
|
f1pd1->Draw(); |
721 |
|
f1pd2->Draw(); |
722 |
|
f1pd3->Draw(); |
723 |
|
figura1->Draw(); |
724 |
|
|
725 |
|
//finestra con figure C17,C18,C19 |
726 |
|
figura3 = new TCanvas("Calorimeter_calthr_calvar_calbase", "Calorimeter_calthr_calvar_calbase", 750, 950); |
727 |
|
figura3->SetFillColor(10); |
728 |
|
figura3->Range(0,0,100,100); |
729 |
|
// |
730 |
|
ccalthr = (float)incalthr/((float)outcalthr + (float)incalthr); |
731 |
|
Int_t f3pd1col = 10; |
732 |
|
if ( ccalthr < ccalthrthr ) { //controlla % strip fuori soglia |
733 |
|
check = true; |
734 |
|
f3pd1col = 45; |
735 |
|
}; |
736 |
|
// |
737 |
|
ccalvar = (float)incalvar/((float)outcalvar + (float)incalvar); |
738 |
|
Int_t f3pd2col = 10; |
739 |
|
if ( ccalvar < ccalvarthr ) { //controlla strip con varianza fuori dai limiti |
740 |
|
check = true; |
741 |
|
f3pd2col = 45; |
742 |
|
}; |
743 |
|
// |
744 |
|
ccalbas = (float)incalbas/((float)outcalbas + (float)incalbas); |
745 |
|
Int_t f3pd3col = 10; |
746 |
|
if ( ccalbas < ccalbasthr ) { //controlla strip con baseline fuori dai limiti |
747 |
|
check = true; |
748 |
|
f3pd3col = 45; |
749 |
|
}; |
750 |
|
// |
751 |
|
TPad *f3pd1 = new TPad("f3pd1","This is f3pad1",0.02,0.684,0.98,0.95,f3pd1col);//prepara le pad di figura 3 |
752 |
|
TPad *f3pd2 = new TPad("f3pd2","This is f3pad2",0.02,0.367,0.98,0.634,f3pd2col); |
753 |
|
TPad *f3pd3 = new TPad("f3pd3","This is f3pad3",0.02,0.05,0.98,0.317,f3pd3col); |
754 |
|
figura3->Clear();//cancella tutto in figura 3 |
755 |
|
figura3->cd(); |
756 |
|
f3pd1->SetTicks(); |
757 |
|
f3pd2->SetTicks(); |
758 |
|
f3pd3->SetTicks(); |
759 |
|
f3pd1->Draw(); |
760 |
|
f3pd2->Draw(); |
761 |
|
f3pd3->Draw(); |
762 |
|
figura3->Draw(); |
763 |
|
|
764 |
|
|
765 |
|
//mette i titoli nella figura 1 |
766 |
|
gStyle->SetOptStat("N"); |
767 |
|
figura1->cd(); |
768 |
|
gStyle->SetNdivisions(322,"x"); |
769 |
|
t=new TLatex(); |
770 |
|
t->SetTextFont(32); |
771 |
|
t->SetTextColor(1); |
772 |
|
t->SetTextSize(0.025); |
773 |
|
t->SetTextAlign(12); |
774 |
|
titolo.str(""); |
775 |
|
titolo << "EXPERT - Calorimeter: calped/calrms/calgood - file "; |
776 |
|
titolo << file; |
777 |
|
titolo << " - calibration number "; |
778 |
|
titolo << (i+1); |
779 |
|
sottotitolo.str(""); |
780 |
|
sottotitolo << "CPU OBT:" <<cpuobt; |
781 |
|
sottotitolo << " | OBT pk1:" <<obt0; |
782 |
|
sottotitolo << " - OBT pk2:"<<obt1; |
783 |
|
sottotitolo << " - OBT pk3:"<<obt2; |
784 |
|
sottotitolo << " - OBT pk4:"<<obt3; |
785 |
|
t->DrawLatex(0.5,98.,titolo.str().c_str()); |
786 |
|
t->SetTextSize(0.02); |
787 |
|
t->DrawLatex(0.5,96.,sottotitolo.str().c_str()); |
788 |
|
t->SetTextSize(0.03); |
789 |
|
// |
790 |
|
f1pd1->cd(); |
791 |
|
//titoli al grafico calped |
792 |
|
calped->GetXaxis()->SetNdivisions(322); |
793 |
|
calped->SetXTitle("strip"); |
794 |
|
calped->SetYTitle("ADC channels"); |
795 |
|
calped->SetMaximum(3000.); |
796 |
|
calped->SetMinimum(-3000.); |
797 |
|
//disegna istogramma calped |
798 |
|
calped->Draw(); |
799 |
|
//disegna la banda di accettazione |
800 |
|
TPolyLine *banda1; |
801 |
|
Double_t xc[4] = {0.,4224.,4224.,0.}; |
802 |
|
Double_t yc[4] = {-700.,-700.,700.,700.}; |
803 |
|
banda1 = new TPolyLine(4,xc,yc); |
804 |
|
banda1->SetLineColor(5); |
805 |
|
banda1->SetFillColor(5); |
806 |
|
banda1->SetLineWidth(1); |
807 |
|
banda1->Draw("fSAME"); |
808 |
|
//banda per le strip difettose |
809 |
|
TPolyLine *banda2; |
810 |
|
Double_t xc2[4] = {4031.5,4047.5,4047.5,4031.5}; |
811 |
|
// Double_t yc2[4] = {-2500.,-2500.,28000.,28000.}; |
812 |
|
Double_t yc2[4] = {-3000.,-3000.,3000.,3000.}; |
813 |
|
banda2 = new TPolyLine(4,xc2,yc2); |
814 |
|
banda2->SetLineColor(5); |
815 |
|
banda2->SetFillColor(5); |
816 |
|
banda2->SetLineWidth(1); |
817 |
|
banda2->Draw("fSAME"); |
818 |
|
|
819 |
|
calped->Draw("SAME"); |
820 |
|
// |
821 |
|
f1pd2->cd(); |
822 |
|
//prepara grafico calrms |
823 |
|
f1pd2->SetLogy(); |
824 |
|
calrms->GetXaxis()->SetNdivisions(322); |
825 |
|
//disegna istogramma calrms |
826 |
|
calrms->Draw(); |
827 |
|
//banda di accettazione |
828 |
|
Double_t xd[4] = {0.,4224.,4224.,0.}; |
829 |
|
Double_t yd[4] = {1.,1.,10.,10.}; |
830 |
|
banda1 = new TPolyLine(4,xd,yd); |
831 |
|
banda1->SetLineColor(5); |
832 |
|
banda1->SetFillColor(5); |
833 |
|
banda1->SetLineWidth(1); |
834 |
|
banda1->Draw("fSAME"); |
835 |
|
|
836 |
|
Float_t minrm = calrms->GetMinimum(); |
837 |
|
Float_t maxrm = calrms->GetMaximum(); |
838 |
|
Double_t xrm2[4] = {3449.,3551.,3551.,3449.}; |
839 |
|
Double_t yrm2[4] = {minrm,minrm,maxrm,maxrm}; |
840 |
|
//banda per strip difettose |
841 |
|
banda2 = new TPolyLine(4,xrm2,yrm2); |
842 |
|
banda2->SetLineColor(5); |
843 |
|
banda2->SetFillColor(5); |
844 |
|
banda2->SetLineWidth(1); |
845 |
|
banda2->Draw("fSAME"); |
846 |
|
|
847 |
|
calrms->SetXTitle("strip"); |
848 |
|
calrms->SetYTitle("ADC channels"); |
849 |
|
|
850 |
|
calrms->Draw("SAME"); |
851 |
|
//prepara grafico calbad |
852 |
|
f1pd3->cd(); |
853 |
|
gStyle->SetNdivisions(344,"x"); |
854 |
|
calbad->GetXaxis()->SetNdivisions(322); |
855 |
|
//disegna calbad |
856 |
|
calbad->Draw(); |
857 |
|
calbad->SetXTitle("strip"); |
858 |
|
calbad->SetYTitle("0=good 255=bad"); |
859 |
|
// |
860 |
|
f1pd1->Update(); |
861 |
|
f1pd2->Update(); |
862 |
|
f1pd3->Update(); |
863 |
|
figura1->Update(); |
864 |
|
// |
865 |
|
|
866 |
|
|
867 |
|
//pagina con figure C17,C18,C19 |
868 |
|
figura3->cd(); |
869 |
|
gStyle->SetNdivisions(644,"x"); |
870 |
|
t=new TLatex(); |
871 |
|
t->SetTextFont(32); |
872 |
|
t->SetTextColor(1); |
873 |
|
t->SetTextSize(0.025); |
874 |
|
t->SetTextAlign(12); |
875 |
|
titolo.str(""); |
876 |
|
titolo << "EXPERT - Calorimeter: calthr/calvar/calbase - file "; |
877 |
|
titolo << file; |
878 |
|
titolo << " - calibration number "; |
879 |
|
titolo << (i+1); |
880 |
|
t->DrawLatex(0.5,98.,titolo.str().c_str()); |
881 |
|
t->SetTextSize(0.02); |
882 |
|
t->DrawLatex(0.5,96.,sottotitolo.str().c_str()); |
883 |
|
t->SetTextSize(0.03); |
884 |
|
// |
885 |
|
f3pd1->cd(); |
886 |
|
calthr->GetXaxis()->SetNdivisions(644); |
887 |
|
calthr->SetXTitle("pre-amplifier"); |
888 |
|
calthr->SetYTitle("ADC channels"); |
889 |
|
calthr->Draw(); |
890 |
|
Double_t xe[4] = {0.,264.,264.,0.}; |
891 |
|
Double_t ye[4] = {12.,12.,25.,25.}; |
892 |
|
banda1 = new TPolyLine(4,xe,ye); |
893 |
|
banda1->SetLineColor(5); |
894 |
|
banda1->SetFillColor(5); |
895 |
|
banda1->SetLineWidth(1); |
896 |
|
banda1->Draw("fSAME"); |
897 |
|
|
898 |
|
minrm = calthr->GetMinimum(); |
899 |
|
maxrm = 1.05*calthr->GetMaximum(); |
900 |
|
Double_t xth2[4] = {215.,221.,221.,215.}; |
901 |
|
Double_t yth2[4] = {minrm,minrm,maxrm,maxrm}; |
902 |
|
banda2 = new TPolyLine(4,xth2,yth2); |
903 |
|
banda2->SetLineColor(5); |
904 |
|
banda2->SetFillColor(5); |
905 |
|
banda2->SetLineWidth(1); |
906 |
|
banda2->Draw("fSAME"); |
907 |
|
// |
908 |
|
calthr->Draw("SAME"); |
909 |
|
|
910 |
|
|
911 |
|
f3pd2->cd(); |
912 |
|
// gPad->SetLogy(); |
913 |
|
//banda di soglia per calvar portata a 9, prima era a 8) |
914 |
|
calvar->SetMaximum(25.); |
915 |
|
calvar->GetXaxis()->SetNdivisions(644); |
916 |
|
calvar->SetXTitle("pre-amplifier"); |
917 |
|
calvar->SetYTitle("ADC channels"); |
918 |
|
calvar->Draw(); |
919 |
|
Double_t xt[4] = {0.,264.,264.,0.}; |
920 |
|
Double_t yt[4] = {1.,1.,9.,9.}; |
921 |
|
banda1 = new TPolyLine(4,xt,yt); |
922 |
|
banda1->SetLineColor(5); |
923 |
|
banda1->SetFillColor(5); |
924 |
|
banda1->SetLineWidth(1); |
925 |
|
banda1->Draw("fSAME"); |
926 |
|
|
927 |
|
minrm = calvar->GetMinimum(); |
928 |
|
maxrm = 1.05*calvar->GetMaximum(); |
929 |
|
Double_t xva2[4] = {215.,221.,221.,215.}; |
930 |
|
Double_t yva2[4] = {minrm,minrm,maxrm,maxrm}; |
931 |
|
banda2 = new TPolyLine(4,xva2,yva2); |
932 |
|
banda2->SetLineColor(5); |
933 |
|
banda2->SetFillColor(5); |
934 |
|
banda2->SetLineWidth(1); |
935 |
|
banda2->Draw("fSAME"); |
936 |
|
// |
937 |
|
calvar->Draw("SAME"); |
938 |
|
|
939 |
|
|
940 |
|
f3pd3->cd(); |
941 |
|
calbase->GetXaxis()->SetNdivisions(644); |
942 |
|
calbase->SetXTitle("pre-amplifier"); |
943 |
|
calbase->SetYTitle("ADC channels"); |
944 |
|
calbase->Draw(); |
945 |
|
Double_t xg[4] = {0.,264.,264.,0.}; |
946 |
|
Double_t yg[4] = {2000.,2000.,5500.,5500.}; |
947 |
|
banda1 = new TPolyLine(4,xg,yg); |
948 |
|
banda1->SetLineColor(5); |
949 |
|
banda1->SetFillColor(5); |
950 |
|
banda1->SetLineWidth(1); |
951 |
|
banda1->Draw("fSAME"); |
952 |
|
calbase->Draw("SAME"); |
953 |
|
// |
954 |
|
f3pd1->Update(); |
955 |
|
f3pd2->Update(); |
956 |
|
f3pd3->Update(); |
957 |
|
figura3->Update(); |
958 |
|
// |
959 |
|
//file output |
960 |
|
if ( !strcmp(format,"ps") ) { |
961 |
|
if ( figmatra ) { |
962 |
|
figura2->Print(figsave.str().c_str(),"Portrait"); |
963 |
|
if ( ci == minev ) { |
964 |
|
figsave.str(""); |
965 |
|
figsave << outdir << "/" ; |
966 |
|
figsave << figrec << "_CaloCHKCALIB."; |
967 |
|
figsave << format; |
968 |
}; |
}; |
969 |
// |
}; |
970 |
TPad *f3pd1 = new TPad("f3pd1","This is f3pad1",0.02,0.684,0.98,0.95,f3pd1col); |
// |
971 |
TPad *f3pd2 = new TPad("f3pd2","This is f3pad2",0.02,0.367,0.98,0.634,f3pd2col); |
figura1->Print(figsave.str().c_str(),"Portrait"); |
972 |
TPad *f3pd3 = new TPad("f3pd3","This is f3pad3",0.02,0.05,0.98,0.317,f3pd3col); |
if ( ci == minev ) { |
973 |
figura3->Clear(); |
figsave.str(""); |
974 |
figura3->cd(); |
figsave << outdir << "/" ; |
975 |
f3pd1->SetTicks(); |
figsave << figrec << "_CaloCHKCALIB."; |
976 |
f3pd2->SetTicks(); |
figsave << format; |
977 |
f3pd3->SetTicks(); |
}; |
978 |
f3pd1->Draw(); |
// |
979 |
f3pd2->Draw(); |
figura3->Print(figsave.str().c_str(),"Portrait"); |
980 |
f3pd3->Draw(); |
// |
981 |
figura3->Draw(); |
} else { |
982 |
// |
if ( figmatra ) { |
983 |
gStyle->SetOptStat("N"); |
figsave.str(""); |
984 |
figura1->cd(); |
figsave << outdir << "/" ; |
985 |
gStyle->SetNdivisions(322,"x"); |
figsave << figrec << "_CaloCHKCALIB1_"; |
986 |
t=new TLatex(); |
figsave << (i+1) << "."; |
987 |
t->SetTextFont(32); |
figsave << format; |
988 |
t->SetTextColor(1); |
figura2->SaveAs(figsave.str().c_str()); |
989 |
t->SetTextSize(0.025); |
}; |
990 |
t->SetTextAlign(12); |
// |
991 |
titolo.str(""); |
figsave1.str(""); |
992 |
titolo << "EXPERT - Calorimeter: calped/calrms/calgood - file "; |
figsave1 << outdir << "/" ; |
993 |
titolo << file; |
figsave1 << figrec << "_CaloCHKCALIB2_"; |
994 |
titolo << " - calibration number "; |
figsave1 << (i+1) << "."; |
995 |
titolo << (i+1); |
figsave1 << format; |
996 |
t->DrawLatex(0.5,97.,titolo.str().c_str()); |
figura1->SaveAs(figsave1.str().c_str()); |
997 |
t->SetTextSize(0.03); |
// |
998 |
f1pd1->cd(); |
figsave2.str(""); |
999 |
// |
figsave2 << outdir << "/" ; |
1000 |
calped->GetXaxis()->SetNdivisions(322); |
figsave2 << figrec << "_CaloCHKCALIB3_"; |
1001 |
calped->SetXTitle("strip"); |
figsave2 << (i+1) << "."; |
1002 |
calped->SetYTitle("ADC channels"); |
figsave2 << format; |
1003 |
calped->Draw(); |
figura3->SaveAs(figsave2.str().c_str()); |
1004 |
TPolyLine *banda1; |
// |
1005 |
Double_t xc[4] = {0.,4224.,4224.,0.}; |
}; |
1006 |
Double_t yc[4] = {-700.,-700.,700.,700.}; |
if ( iactive && w4i ){ |
1007 |
banda1 = new TPolyLine(4,xc,yc); |
while ( gROOT->GetListOfCanvases()->FindObject(figura2) || gROOT->GetListOfCanvases()->FindObject(figura1) || gROOT->GetListOfCanvases()->FindObject(figura3) ){ |
1008 |
banda1->SetLineColor(5); |
gSystem->ProcessEvents(); |
1009 |
banda1->SetFillColor(5); |
gSystem->Sleep(10); |
1010 |
banda1->SetLineWidth(1); |
}; |
1011 |
banda1->Draw("fSAME"); |
}; |
1012 |
TPolyLine *banda2; |
};//fine del loop sulle calibrazioni |
1013 |
Double_t xc2[4] = {4031.5,4047.5,4047.5,4031.5}; |
// |
1014 |
Double_t yc2[4] = {-2500.,-2500.,28000.,28000.}; |
// |
1015 |
banda2 = new TPolyLine(4,xc2,yc2); |
// |
1016 |
banda2->SetLineColor(5); |
// |
1017 |
banda2->SetFillColor(5); |
// report sheet: |
1018 |
banda2->SetLineWidth(1); |
// |
1019 |
banda2->Draw("fSAME"); |
stringstream errore; |
1020 |
calped->Draw("SAME"); |
rapporto= new TCanvas("Calorimeter calibration report", "Calorimeter calibration report", 750, 950); |
1021 |
f1pd2->cd(); |
rapporto->cd(); |
1022 |
f1pd2->SetLogy(); |
rapporto->SetFillColor(10); |
1023 |
calrms->GetXaxis()->SetNdivisions(322); |
rapporto->Range(0,0,100,100); |
1024 |
calrms->Draw(); |
TLatex *t=new TLatex(); |
1025 |
Double_t xd[4] = {0.,4224.,4224.,0.}; |
t->SetTextFont(32); |
1026 |
Double_t yd[4] = {1.,1.,7.,7.}; |
t->SetTextColor(1); |
1027 |
banda1 = new TPolyLine(4,xd,yd); |
t->SetTextSize(0.035); |
1028 |
banda1->SetLineColor(5); |
t->SetTextAlign(12); |
1029 |
banda1->SetFillColor(5); |
errore.str(""); |
1030 |
banda1->SetLineWidth(1); |
errore << "BASIC - C20 - Calibrations in file: " << file; |
1031 |
banda1->Draw("fSAME"); |
errore << " "; |
1032 |
calrms->SetXTitle("strip"); |
t->SetTextSize(0.02); |
1033 |
calrms->SetYTitle("ADC channels"); |
t->DrawLatex(2.,99.,errore.str().c_str()); |
1034 |
calrms->Draw("SAME"); |
// |
1035 |
f1pd3->cd(); |
TPad *pad1; |
1036 |
gStyle->SetNdivisions(344,"x"); |
TPad *pad2; |
1037 |
calbad->GetXaxis()->SetNdivisions(322); |
TPad *pad3; |
1038 |
calbad->Draw(); |
TPad *pad4; |
1039 |
calbad->SetXTitle("strip"); |
pad1 = new TPad("pad1","This is pad1",0.02,0.47,0.49,0.90,19); |
1040 |
calbad->SetYTitle("0=good 255=bad"); |
pad2 = new TPad("pad2","This is pad2",0.51,0.47,0.98,0.90,19); |
1041 |
f1pd1->Update(); |
pad3 = new TPad("pad3","This is pad3",0.02,0.02,0.49,0.45,19); |
1042 |
f1pd2->Update(); |
pad4 = new TPad("pad4","This is pad4",0.51,0.02,0.98,0.45,19); |
1043 |
f1pd3->Update(); |
pad1->Range(0,0,100,100); |
1044 |
figura1->Update(); |
pad2->Range(0,0,100,100); |
1045 |
// |
pad3->Range(0,0,100,100); |
1046 |
figura3->cd(); |
pad4->Range(0,0,100,100); |
1047 |
gStyle->SetNdivisions(644,"x"); |
// |
1048 |
t=new TLatex(); |
pad1->Draw(); |
1049 |
t->SetTextFont(32); |
pad2->Draw(); |
1050 |
t->SetTextColor(1); |
pad3->Draw(); |
1051 |
t->SetTextSize(0.025); |
pad4->Draw(); |
1052 |
t->SetTextAlign(12); |
// |
1053 |
titolo.str(""); |
char *sezione = 0; |
1054 |
titolo << "EXPERT - Calorimeter: calthr/calvar/calbase - file "; |
for (Int_t si = 0; si < 4; si++){ |
1055 |
titolo << file; |
if (si == 2) |
1056 |
titolo << " - calibration number "; |
{ |
1057 |
titolo << (i+1); |
pad1->cd() ; |
1058 |
t->DrawLatex(0.5,97.,titolo.str().c_str()); |
sezione = "** Section YE (x even) **"; |
1059 |
t->SetTextSize(0.03); |
} |
1060 |
// |
if (si == 3) |
1061 |
f3pd1->cd(); |
{ |
1062 |
calthr->GetXaxis()->SetNdivisions(644); |
pad2->cd(); |
1063 |
calthr->SetXTitle("pre-amplifier"); |
sezione = "** Section YO (x odd) **"; |
1064 |
calthr->SetYTitle("ADC channels"); |
} |
1065 |
calthr->Draw(); |
if (si == 0) |
1066 |
Double_t xe[4] = {0.,264.,264.,0.}; |
{ |
1067 |
Double_t ye[4] = {12.,12.,21.,21.}; |
pad3->cd(); |
1068 |
banda1 = new TPolyLine(4,xe,ye); |
sezione = "** Section XE (y odd) **"; |
1069 |
banda1->SetLineColor(5); |
} |
1070 |
banda1->SetFillColor(5); |
if (si == 1) |
1071 |
banda1->SetLineWidth(1); |
{ |
1072 |
banda1->Draw("fSAME"); |
pad4->cd(); |
1073 |
calthr->Draw("SAME"); |
sezione = "** Section XO (y even) **"; |
1074 |
f3pd2->cd(); |
} |
1075 |
calvar->GetXaxis()->SetNdivisions(644); |
t->SetTextFont(32); |
1076 |
calvar->SetXTitle("pre-amplifier"); |
t->SetTextColor(1); |
1077 |
calvar->SetYTitle("ADC channels"); |
t->SetTextSize(0.05); |
1078 |
calvar->Draw(); |
t->SetTextAlign(12); |
1079 |
Double_t xt[4] = {0.,264.,264.,0.}; |
t->DrawLatex(33.,97.,sezione); |
1080 |
Double_t yt[4] = {1.,1.,8.,8.}; |
t->SetTextSize(0.05); |
1081 |
banda1 = new TPolyLine(4,xt,yt); |
|
1082 |
banda1->SetLineColor(5); |
//scorre ver cercando il j tipo di errore: 'si'=sezione |
1083 |
banda1->SetFillColor(5); |
for (Int_t j = 0; j < 23; j++){ |
1084 |
banda1->SetLineWidth(1); |
if ( ver[si][j] ) {//controlla se le sezioni di ver[si][j] sonoe diverse da zero. |
1085 |
banda1->Draw("fSAME"); |
t->SetTextColor(50); //controlla quali sono !=0 e assegna il rispettivo errore |
1086 |
calvar->Draw("SAME"); |
if (j == 0) {//del calorimetro |
1087 |
f3pd3->cd(); |
errore.str(""); |
1088 |
calbase->GetXaxis()->SetNdivisions(644); |
errore << "* DSP ack error: " << ver[si][j]; |
1089 |
calbase->SetXTitle("pre-amplifier"); |
errore << " time(s)"; |
1090 |
calbase->SetYTitle("ADC channels"); |
t->DrawLatex(2.,30.,errore.str().c_str()); |
1091 |
calbase->Draw(); |
check = true; |
1092 |
Double_t xg[4] = {0.,264.,264.,0.}; |
} |
1093 |
Double_t yg[4] = {2000.,2000.,4500.,4500.}; |
if (j == 1) {//calorimetro |
1094 |
banda1 = new TPolyLine(4,xg,yg); |
errore.str(""); |
1095 |
banda1->SetLineColor(5); |
errore << "* Temperature alarm: " << ver[si][j]; |
1096 |
banda1->SetFillColor(5); |
errore << " time(s)"; |
1097 |
banda1->SetLineWidth(1); |
t->DrawLatex(2.,74.,errore.str().c_str()); |
1098 |
banda1->Draw("fSAME"); |
check = true; |
1099 |
calbase->Draw("SAME"); |
} |
1100 |
f3pd1->Update(); |
if (j == 2) {//calorimetro |
1101 |
f3pd2->Update(); |
errore.str(""); |
1102 |
f3pd3->Update(); |
errore << "* Latch up alarm: " << ver[si][j]; |
1103 |
figura3->Update(); |
errore << " time(s)."; |
1104 |
// |
t->DrawLatex(2.,65.,errore.str().c_str()); |
1105 |
// |
check = true; |
1106 |
// |
} |
1107 |
if ( ci == maxev-4 ) { |
if (j == 3) {//calorimetro |
1108 |
// |
errore.str(""); |
1109 |
// report sheet: |
errore << "RAW mode: " << ver[si][j]; |
1110 |
// |
errore << " time(s)"; |
1111 |
stringstream errore; |
t->SetTextColor(38); |
1112 |
rapporto= new TCanvas("Calorimeter calibration report", "Calorimeter calibration report", 750, 950); |
t->DrawLatex(2.,90.,errore.str().c_str()); |
1113 |
rapporto->cd(); |
} |
1114 |
rapporto->SetFillColor(10); |
if (j == 4) {//calorimetro |
1115 |
rapporto->Range(0,0,100,100); |
errore.str(""); |
1116 |
t=new TLatex(); |
errore << "* CMD length error: " << ver[si][j]; |
1117 |
t->SetTextFont(32); |
errore << " time(s)"; |
1118 |
t->SetTextColor(1); |
t->DrawLatex(2.,66.,errore.str().c_str()); |
1119 |
t->SetTextSize(0.035); |
check = true; |
1120 |
t->SetTextAlign(12); |
} |
1121 |
errore.str(""); |
if (j == 5) {//calorimetro |
1122 |
errore << "BASIC - C20 - Calibrations in file: " << file; |
errore.str(""); |
1123 |
errore << " "; |
errore << "* Execution error: " << ver[si][j]; |
1124 |
t->SetTextSize(0.02); |
errore << " time(s)"; |
1125 |
t->DrawLatex(2.,99.,errore.str().c_str()); |
t->DrawLatex(2.,62.,errore.str().c_str()); |
1126 |
// |
check = true; |
1127 |
TPad *pad1; |
} |
1128 |
TPad *pad2; |
if (j == 6) {//calorimetro |
1129 |
TPad *pad3; |
errore.str(""); |
1130 |
TPad *pad4; |
errore << "* CRC error (st. word): " << ver[si][j]; |
1131 |
pad1 = new TPad("pad1","This is pad1",0.02,0.47,0.49,0.90,19); |
errore << " time(s)"; |
1132 |
pad2 = new TPad("pad2","This is pad2",0.51,0.47,0.98,0.90,19); |
t->DrawLatex(2.,58.,errore.str().c_str()); |
1133 |
pad3 = new TPad("pad3","This is pad3",0.02,0.02,0.49,0.45,19); |
check = true; |
1134 |
pad4 = new TPad("pad4","This is pad4",0.51,0.02,0.98,0.45,19); |
} |
1135 |
pad1->Range(0,0,100,100); |
if (j == 7) { |
1136 |
pad2->Range(0,0,100,100); |
errore.str(""); |
1137 |
pad3->Range(0,0,100,100); |
errore << "View or command not recognized: " << ver[si][j]; |
1138 |
pad4->Range(0,0,100,100); |
errore << " time(s)"; |
1139 |
// |
t->DrawLatex(2.,54.,errore.str().c_str()); |
1140 |
pad1->Draw(); |
check = true; |
1141 |
pad2->Draw(); |
} |
1142 |
pad3->Draw(); |
// |
1143 |
pad4->Draw(); |
if (j == 8) { |
1144 |
// |
errore.str(""); |
1145 |
char *sezione = 0; |
errore << "Missing section: " << ver[si][j]; |
1146 |
for (Int_t si = 0; si < 4; si++){ |
errore << " time(s)"; |
1147 |
if (si == 2) |
t->DrawLatex(2.,50.,errore.str().c_str()); |
1148 |
{ |
check = true; |
1149 |
pad1->cd() ; |
} |
1150 |
sezione = "** Section YE (x even) **"; |
if (j == 9) { |
1151 |
} |
errore.str(""); |
1152 |
if (si == 3) |
errore << "RAW MODE COMMAND: " << ver[si][j]; |
1153 |
{ |
errore << " time(s)"; |
1154 |
pad2->cd(); |
t->DrawLatex(2.,42.,errore.str().c_str()); |
1155 |
sezione = "** Section YO (x odd) **"; |
} |
1156 |
} |
if (j == 11) { |
1157 |
if (si == 0) |
errore.str(""); |
1158 |
{ |
errore << "CRC error (data): " << ver[si][j]; |
1159 |
pad3->cd(); |
errore << " time(s)"; |
1160 |
sezione = "** Section XE (y odd) **"; |
t->DrawLatex(2.,38.,errore.str().c_str()); |
1161 |
} |
check = true; |
1162 |
if (si == 1) |
} |
1163 |
{ |
if (j == 16) { |
1164 |
pad4->cd(); |
errore.str(""); |
1165 |
sezione = "** Section XO (y even) **"; |
errore << "Number of calibrations: " << ver[si][j]; |
1166 |
} |
t->SetTextColor(38); |
1167 |
t->SetTextFont(32); |
t->DrawLatex(2.,86.,errore.str().c_str()); |
1168 |
t->SetTextColor(1); |
} |
1169 |
t->SetTextSize(0.05); |
if (j == 19) { |
1170 |
t->SetTextAlign(12); |
errore.str(""); |
1171 |
t->DrawLatex(33.,97.,sezione); |
errore << "Pedestal checksum wrong: " << ver[si][j]; |
1172 |
t->SetTextSize(0.05); |
errore << " time(s)"; |
1173 |
for (Int_t j = 0; j < 23; j++){ |
t->DrawLatex(2.,14.,errore.str().c_str()); |
1174 |
if ( ver[si][j] ) { |
check = true; |
1175 |
t->SetTextColor(50); |
} |
1176 |
if (j == 0) { |
if (j == 20) { |
1177 |
errore.str(""); |
errore.str(""); |
1178 |
errore << "* DSP ack error: " << ver[si][j]; |
errore << "Thresholds checksum wrong: " << ver[si][j]; |
1179 |
errore << " time(s)"; |
errore << " time(s)"; |
1180 |
t->DrawLatex(2.,30.,errore.str().c_str()); |
t->DrawLatex(2.,10.,errore.str().c_str()); |
1181 |
check = true; |
check = true; |
1182 |
} |
} |
1183 |
if (j == 1) { |
if (j == 22) { |
1184 |
errore.str(""); |
errore.str(""); |
1185 |
errore << "* Temperature alarm: " << ver[si][j]; |
errore << "Packet length is zero (YODA input error), skipped: " << ver[si][j]; |
1186 |
errore << " time(s)"; |
errore << " time(s)"; |
1187 |
t->DrawLatex(2.,74.,errore.str().c_str()); |
t->DrawLatex(2.,3.,errore.str().c_str()); |
1188 |
check = true; |
check = true; |
|
} |
|
|
if (j == 2) { |
|
|
errore.str(""); |
|
|
errore << "* Latch up alarm: " << ver[si][j]; |
|
|
errore << " time(s)."; |
|
|
t->DrawLatex(2.,65.,errore.str().c_str()); |
|
|
check = true; |
|
|
} |
|
|
if (j == 3) { |
|
|
errore.str(""); |
|
|
errore << "RAW mode: " << ver[si][j]; |
|
|
errore << " time(s)"; |
|
|
t->SetTextColor(38); |
|
|
t->DrawLatex(2.,90.,errore.str().c_str()); |
|
|
} |
|
|
if (j == 4) { |
|
|
errore.str(""); |
|
|
errore << "* CMD length error: " << ver[si][j]; |
|
|
errore << " time(s)"; |
|
|
t->DrawLatex(2.,66.,errore.str().c_str()); |
|
|
check = true; |
|
|
} |
|
|
if (j == 5) { |
|
|
errore.str(""); |
|
|
errore << "* Execution error: " << ver[si][j]; |
|
|
errore << " time(s)"; |
|
|
t->DrawLatex(2.,62.,errore.str().c_str()); |
|
|
check = true; |
|
|
} |
|
|
if (j == 6) { |
|
|
errore.str(""); |
|
|
errore << "* CRC error (st. word): " << ver[si][j]; |
|
|
errore << " time(s)"; |
|
|
t->DrawLatex(2.,58.,errore.str().c_str()); |
|
|
check = true; |
|
|
} |
|
|
if (j == 7) { |
|
|
errore.str(""); |
|
|
errore << "View or command not recognized: " << ver[si][j]; |
|
|
errore << " time(s)"; |
|
|
t->DrawLatex(2.,54.,errore.str().c_str()); |
|
|
check = true; |
|
|
} |
|
|
// |
|
|
if (j == 8) { |
|
|
errore.str(""); |
|
|
errore << "Missing section: " << ver[si][j]; |
|
|
errore << " time(s)"; |
|
|
t->DrawLatex(2.,50.,errore.str().c_str()); |
|
|
check = true; |
|
|
} |
|
|
if (j == 9) { |
|
|
errore.str(""); |
|
|
errore << "RAW MODE COMMAND: " << ver[si][j]; |
|
|
errore << " time(s)"; |
|
|
t->DrawLatex(2.,42.,errore.str().c_str()); |
|
|
} |
|
|
if (j == 11) { |
|
|
errore.str(""); |
|
|
errore << "CRC error (data): " << ver[si][j]; |
|
|
errore << " time(s)"; |
|
|
t->DrawLatex(2.,38.,errore.str().c_str()); |
|
|
check = true; |
|
|
} |
|
|
if (j == 16) { |
|
|
errore.str(""); |
|
|
errore << "Number of calibrations: " << ver[si][j]; |
|
|
t->SetTextColor(38); |
|
|
t->DrawLatex(2.,86.,errore.str().c_str()); |
|
|
} |
|
|
if (j == 19) { |
|
|
errore.str(""); |
|
|
errore << "Pedestal checksum wrong: " << ver[si][j]; |
|
|
errore << " time(s)"; |
|
|
t->DrawLatex(2.,14.,errore.str().c_str()); |
|
|
check = true; |
|
|
} |
|
|
if (j == 20) { |
|
|
errore.str(""); |
|
|
errore << "Thresholds checksum wrong: " << ver[si][j]; |
|
|
errore << " time(s)"; |
|
|
t->DrawLatex(2.,10.,errore.str().c_str()); |
|
|
check = true; |
|
|
} |
|
|
if (j == 22) { |
|
|
errore.str(""); |
|
|
errore << "Packet length is zero (YODA input error), skipped: " << ver[si][j]; |
|
|
errore << " time(s)"; |
|
|
t->DrawLatex(2.,3.,errore.str().c_str()); |
|
|
check = true; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
}; |
|
|
rapporto->cd(); |
|
|
t->SetTextFont(32); |
|
|
t->SetTextColor(1); |
|
|
t->SetTextSize(0.035); |
|
|
t->SetTextAlign(12); |
|
|
t->DrawLatex(7.,95.,"Calorimeter CALIBRATION quick look: "); |
|
|
//printf("vediamo: ccalped %f ccalrms %f ccalbad %f ccalthr %f ccalvar %f ccalbas %f \n",ccalped,ccalrms,ccalbad,ccalthr,ccalvar,ccalbas); |
|
|
if ( check ) { |
|
|
t->SetTextColor(50); |
|
|
t->DrawLatex(65.,95.,"WARNING, CHECK!"); |
|
|
t->SetTextColor(1); |
|
|
} else { |
|
|
t->SetTextColor(38); |
|
|
t->DrawLatex(65.,95.,"OK!"); |
|
|
t->SetTextColor(1); |
|
|
}; |
|
|
rapporto->Update(); |
|
|
}; |
|
|
// |
|
|
if ( !strcmp(format,"ps") ) { |
|
|
if ( ci == minev ) { |
|
|
figsave.str(""); |
|
|
figsave << outdir << "/" ; |
|
|
figsave << figrec << "_chkcalib."; |
|
|
figsave << format; |
|
|
figsave << "("; |
|
|
}; |
|
|
if ( figmatra ) { |
|
|
figura2->Print(figsave.str().c_str(),"Portrait"); |
|
|
if ( ci == minev ) { |
|
|
figsave.str(""); |
|
|
figsave << outdir << "/" ; |
|
|
figsave << figrec << "_chkcalib."; |
|
|
figsave << format; |
|
|
}; |
|
|
}; |
|
|
// |
|
|
figura1->Print(figsave.str().c_str(),"Portrait"); |
|
|
if ( ci == minev ) { |
|
|
figsave.str(""); |
|
|
figsave << outdir << "/" ; |
|
|
figsave << figrec << "_chkcalib."; |
|
|
figsave << format; |
|
|
}; |
|
|
// |
|
|
figura3->Print(figsave.str().c_str(),"Portrait"); |
|
|
// |
|
|
if ( ci == maxev-4 ) { |
|
|
figsave.str(""); |
|
|
figsave << outdir << "/" ; |
|
|
figsave << figrec << "_chkcalib."; |
|
|
figsave << format; |
|
|
figsave << ")"; |
|
|
rapporto->Print(figsave.str().c_str(),"Portrait"); |
|
|
}; |
|
|
} else { |
|
|
if ( figmatra ) { |
|
|
figsave.str(""); |
|
|
figsave << outdir << "/" ; |
|
|
figsave << figrec << "_chkcalib1_"; |
|
|
figsave << (i+1) << "."; |
|
|
figsave << format; |
|
|
figura2->SaveAs(figsave.str().c_str()); |
|
|
}; |
|
|
// |
|
|
figsave1.str(""); |
|
|
figsave1 << outdir << "/" ; |
|
|
figsave1 << figrec << "_chkcalib2_"; |
|
|
figsave1 << (i+1) << "."; |
|
|
figsave1 << format; |
|
|
figura1->SaveAs(figsave1.str().c_str()); |
|
|
// |
|
|
figsave2.str(""); |
|
|
figsave2 << outdir << "/" ; |
|
|
figsave2 << figrec << "_chkcalib3_"; |
|
|
figsave2 << (i+1) << "."; |
|
|
figsave2 << format; |
|
|
figura3->SaveAs(figsave2.str().c_str()); |
|
|
// |
|
|
if ( ci == maxev-4 ) { |
|
|
figsave.str(""); |
|
|
figsave << outdir << "/" ; |
|
|
figsave << figrec << "_chkcalib_report."; |
|
|
figsave << format; |
|
|
rapporto->SaveAs(figsave.str().c_str()); |
|
|
}; |
|
1189 |
}; |
}; |
1190 |
|
}; |
1191 |
|
}; |
1192 |
|
}; |
1193 |
|
rapporto->cd(); |
1194 |
|
t->SetTextFont(32); |
1195 |
|
t->SetTextColor(1); |
1196 |
|
t->SetTextSize(0.035); |
1197 |
|
t->SetTextAlign(12); |
1198 |
|
t->DrawLatex(7.,95.,"Calorimeter CALIBRATION quick look: "); |
1199 |
|
printf(" ccalped %f ccalrms %f ccalbad %f ccalthr %f ccalvar %f ccalbas %f \n",ccalped,ccalrms,ccalbad,ccalthr,ccalvar,ccalbas); |
1200 |
|
|
1201 |
|
|
1202 |
|
if ( check ) { |
1203 |
|
t->SetTextColor(50); |
1204 |
|
t->DrawLatex(65.,95.,"WARNING, CHECK!"); |
1205 |
|
t->SetTextColor(1); |
1206 |
|
} else { |
1207 |
|
t->SetTextColor(38); |
1208 |
|
t->DrawLatex(65.,95.,"OK!"); |
1209 |
|
t->SetTextColor(1); |
1210 |
|
}; |
1211 |
|
rapporto->Update(); |
1212 |
|
// |
1213 |
|
if ( !strcmp(format,"ps") ) { |
1214 |
|
figsave.str(""); |
1215 |
|
figsave << outdir << "/" ; |
1216 |
|
figsave << figrec << "_CaloCHKCALIB."; |
1217 |
|
figsave << format; |
1218 |
|
figsave << ")"; |
1219 |
|
rapporto->Print(figsave.str().c_str(),"Portrait"); |
1220 |
|
} else { |
1221 |
|
figsave.str(""); |
1222 |
|
figsave << outdir << "/" ; |
1223 |
|
figsave << figrec << "_CaloCHKCALIB_report."; |
1224 |
|
figsave << format; |
1225 |
|
rapporto->SaveAs(figsave.str().c_str()); |
1226 |
|
}; |
1227 |
|
if ( iactive && w4i ){ |
1228 |
|
while ( gROOT->GetListOfCanvases()->FindObject(rapporto) ){ |
1229 |
|
gSystem->ProcessEvents(); |
1230 |
|
gSystem->Sleep(10); |
1231 |
}; |
}; |
1232 |
printf("\n"); |
}; |
1233 |
return; |
printf("\n"); |
1234 |
|
return; |
1235 |
} |
} |
1236 |
|
|