| 1 |
// |
| 2 |
// Check the calorimter calibrations - Emiliano Mocchiutti |
| 3 |
// |
| 4 |
// FCaloCHKCALIB.c version 1.13 (2006-09-22) |
| 5 |
// |
| 6 |
// The only input needed is the path to the directory created by YODA for the data file you want to analyze. |
| 7 |
// |
| 8 |
// Changelog: |
| 9 |
// |
| 10 |
// 1.12 - 1.13 (2006-09-22): Set upper limit in calvar plot. |
| 11 |
// |
| 12 |
// 1.07 - 1.12 (2006-08-04): bugs fixed. |
| 13 |
// |
| 14 |
// 1.07 - 1.11 (2006-07-17): Adapted to flight conditions. |
| 15 |
// |
| 16 |
// 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). |
| 17 |
// |
| 18 |
// 1.05 - 1.06 (2006-03-22): Add optimize flag in compiling the script! |
| 19 |
// |
| 20 |
// 1.04 - 1.05 (2006-03-22): Corrected wrong .C files. |
| 21 |
// |
| 22 |
// 1.03 - 1.04 (2006-03-20): Documentation updated. |
| 23 |
// |
| 24 |
// 1.02 - 1.03 (2006-03-20): Changed name of shared libraries (for example from FCaloQLOOK_cxx.so to libFCaloQLOOK.so). |
| 25 |
// |
| 26 |
// 1.01 - 1.02 (2006-03-13): Include files from YODA without "event" directory. |
| 27 |
// |
| 28 |
// 1.00 - 1.01 (2006-03-02): Works on YODA v6 output (single file), does not require anymore calocommon package. |
| 29 |
// |
| 30 |
// 0.00 - 1.00 (2006-03-02): Clone of CaloCHKCALIB.c |
| 31 |
// |
| 32 |
#include <iostream> |
| 33 |
#include <fstream> |
| 34 |
// |
| 35 |
#include <TTree.h> |
| 36 |
#include <TObject.h> |
| 37 |
#include <TString.h> |
| 38 |
#include <TFile.h> |
| 39 |
#include <TCanvas.h> |
| 40 |
#include <TH1.h> |
| 41 |
#include <TPolyLine.h> |
| 42 |
#include <TH1F.h> |
| 43 |
#include <TH2D.h> |
| 44 |
#include <TLatex.h> |
| 45 |
#include <TPad.h> |
| 46 |
#include <TPaveLabel.h> |
| 47 |
#include <TStyle.h> |
| 48 |
#include <TSystem.h> |
| 49 |
#include <TApplication.h> |
| 50 |
// |
| 51 |
#include <CalibCalPedEvent.h> |
| 52 |
// |
| 53 |
using namespace std; |
| 54 |
// |
| 55 |
void stringcopy(TString& s1, const TString& s2, Int_t from=0, Int_t to=0){ |
| 56 |
if ( to == 0 ){ |
| 57 |
Int_t t2length = s2.Length(); |
| 58 |
s1 = ""; |
| 59 |
to = t2length; |
| 60 |
}; |
| 61 |
for (Int_t i = from; i<to; i++){ |
| 62 |
s1.Append(s2[i],1); |
| 63 |
}; |
| 64 |
} |
| 65 |
void stringappend(TString& s1, const TString& s2){ |
| 66 |
Int_t t2length = s2.Length(); |
| 67 |
for (Int_t i = 0; i<t2length; i++){ |
| 68 |
s1.Append(s2[i],1); |
| 69 |
}; |
| 70 |
} |
| 71 |
|
| 72 |
TString getFilename(const TString filename){ |
| 73 |
// |
| 74 |
const string fil = gSystem->BaseName(filename.Data()); |
| 75 |
Int_t posiz = fil.find(".root"); |
| 76 |
// |
| 77 |
TString file2; |
| 78 |
if ( posiz == -1 ){ |
| 79 |
file2 = gSystem->BaseName(filename.Data()); |
| 80 |
} else { |
| 81 |
Int_t posiz2 = 0; |
| 82 |
stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz); |
| 83 |
TString pdat(".dat"); |
| 84 |
stringappend(file2,pdat); |
| 85 |
}; |
| 86 |
return file2; |
| 87 |
} |
| 88 |
|
| 89 |
typedef struct Calib { |
| 90 |
Int_t iev; |
| 91 |
Int_t cstwerr[4]; |
| 92 |
Float_t cperror[4]; |
| 93 |
Float_t mip[2][22][96]; |
| 94 |
Float_t calped[2][22][96]; |
| 95 |
Float_t calgood[2][22][96]; |
| 96 |
Float_t calthr[2][22][6]; |
| 97 |
Float_t calrms[2][22][96]; |
| 98 |
Float_t calbase[2][22][6]; |
| 99 |
Float_t calvar[2][22][6]; |
| 100 |
Float_t calpuls[2][22][96]; |
| 101 |
} calib; |
| 102 |
|
| 103 |
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){ |
| 104 |
gStyle->SetPaperSize(19.,25.); |
| 105 |
// |
| 106 |
TApplication *app = 0; |
| 107 |
if ( iactive ) app = new TApplication("app",0,0); |
| 108 |
Float_t ccalrmsthr=0.99; |
| 109 |
Float_t ccalpedthr=0.99; |
| 110 |
Float_t ccalbadthr=0.03;// 0.005 |
| 111 |
Float_t ccalthrthr=0.98; |
| 112 |
Float_t ccalvarthr=0.99; |
| 113 |
Float_t ccalbasthr=0.99; |
| 114 |
// |
| 115 |
Float_t ccalrms; |
| 116 |
Float_t ccalped; |
| 117 |
Float_t ccalbad; |
| 118 |
Float_t ccalthr; |
| 119 |
Float_t ccalvar; |
| 120 |
Float_t ccalbas; |
| 121 |
// |
| 122 |
struct Calib calib; |
| 123 |
stringstream titolo; |
| 124 |
stringstream xviewev; |
| 125 |
stringstream yviewev; |
| 126 |
const char* startingdir = gSystem->WorkingDirectory(); |
| 127 |
if ( !strcmp(outDir.Data(),"") ) outDir = startingdir; |
| 128 |
TString fififile = getFilename(filename); |
| 129 |
const char *file; |
| 130 |
file = fififile; |
| 131 |
// |
| 132 |
ifstream myfile; |
| 133 |
myfile.open(filename.Data()); |
| 134 |
if ( !myfile ){ |
| 135 |
printf(" %s :no such file, exiting...\n\n",filename.Data()); |
| 136 |
return; |
| 137 |
}; |
| 138 |
myfile.close(); |
| 139 |
// |
| 140 |
TFile *File = new TFile(filename.Data()); |
| 141 |
// |
| 142 |
TTree *tr = (TTree*)File->Get("CalibCalPed"); |
| 143 |
if ( !tr ) { |
| 144 |
printf(" CalibCalPed : no such tree in %s \n",filename.Data()); |
| 145 |
printf(" Exiting, are you sure this is a LEVEL0 not corrupted file? \n\n"); |
| 146 |
return; |
| 147 |
}; |
| 148 |
pamela::CalibCalPedEvent *ce = 0; |
| 149 |
// |
| 150 |
UInt_t found; |
| 151 |
tr->SetBranchStatus("*",0,&found); //disable all branches |
| 152 |
// |
| 153 |
found = 0; |
| 154 |
tr->SetBranchStatus("iev*",1,&found); |
| 155 |
found = 0; |
| 156 |
tr->SetBranchStatus("cstwerr*",1,&found); |
| 157 |
// printf("enabled %i branches \n",found); |
| 158 |
found = 0; |
| 159 |
tr->SetBranchStatus("cperror*",1,&found); |
| 160 |
//printf("enabled %i branches \n",found); |
| 161 |
found = 0; |
| 162 |
tr->SetBranchStatus("cal*",1,&found); |
| 163 |
//printf("enabled %i branches \n",found); |
| 164 |
found = 0; |
| 165 |
tr->SetBranchStatus("CalibCalPed*",1,&found); |
| 166 |
//printf("enabled %i branches \n",found); |
| 167 |
// |
| 168 |
tr->SetBranchAddress("CalibCalPed", &ce); |
| 169 |
// |
| 170 |
Long64_t ncalibs = tr->GetEntries(); |
| 171 |
if ( ncalibs == 0 ){ |
| 172 |
printf(" No calibrations in this files! \n Exiting... \n"); |
| 173 |
return; |
| 174 |
}; |
| 175 |
printf("\n This file contains %i entries which corrispond to %i calibrations \n\n",(int)ncalibs,(int)ncalibs/4); |
| 176 |
Long64_t minev = 0; |
| 177 |
Long64_t maxev = ncalibs; |
| 178 |
if ( calibnumber ){ |
| 179 |
minev = (calibnumber - 1)* 4; |
| 180 |
maxev = minev + 4; |
| 181 |
}; |
| 182 |
TCanvas *figura1; |
| 183 |
TCanvas *figura2 = 0; |
| 184 |
TCanvas *figura3; |
| 185 |
TCanvas *rapporto = 0; |
| 186 |
Int_t cmask = 127 ; |
| 187 |
Int_t cestw = 0; |
| 188 |
Int_t ver[4][23]; |
| 189 |
// |
| 190 |
for (Int_t k = 0; k < 4; k++ ){ |
| 191 |
for (Int_t m = 0; m < 23 ; m++ ){ |
| 192 |
ver[k][m] = 0 ; |
| 193 |
}; |
| 194 |
}; |
| 195 |
// |
| 196 |
// |
| 197 |
const string fil = gSystem->BaseName(filename.Data()); |
| 198 |
Int_t posiz = fil.find(".root"); |
| 199 |
// |
| 200 |
TString file2; |
| 201 |
if ( posiz == -1 ){ |
| 202 |
file2 = gSystem->BaseName(filename.Data()); |
| 203 |
} else { |
| 204 |
Int_t posiz2 = 0; |
| 205 |
stringcopy(file2,gSystem->BaseName(filename.Data()),posiz2,posiz); |
| 206 |
}; |
| 207 |
const char *figrec = file2; |
| 208 |
// |
| 209 |
const char *outdir = outDir; |
| 210 |
const char *format = saveas; |
| 211 |
stringstream figsave; |
| 212 |
stringstream figsave1; |
| 213 |
stringstream figsave2; |
| 214 |
// |
| 215 |
// to check or not to check? this is the problem... |
| 216 |
// |
| 217 |
Bool_t check = false; |
| 218 |
// |
| 219 |
for (Int_t ci = minev; ci < maxev ; ci+=4){ |
| 220 |
// |
| 221 |
Int_t incalrms = 0; |
| 222 |
Int_t outcalrms = 0; |
| 223 |
Int_t totcalbad = 0; |
| 224 |
Int_t incalped = 0; |
| 225 |
Int_t outcalped = 0; |
| 226 |
Int_t incalthr = 0; |
| 227 |
Int_t outcalthr = 0; |
| 228 |
Int_t incalvar = 0; |
| 229 |
Int_t outcalvar = 0; |
| 230 |
Int_t incalbas = 0; |
| 231 |
Int_t outcalbas = 0; |
| 232 |
// |
| 233 |
for ( Int_t s=0 ; s<4 ;s++ ){ |
| 234 |
tr->GetEntry(ci+s); |
| 235 |
calib.iev = ce->iev; |
| 236 |
// |
| 237 |
// |
| 238 |
// |
| 239 |
cestw = 0; |
| 240 |
if ( ce->cstwerr[s] ){ |
| 241 |
cestw = ce->cstwerr[s] & cmask ; |
| 242 |
ver[s][16]++; |
| 243 |
}; |
| 244 |
if ( cestw ){ |
| 245 |
if ( cestw & (1 << 0) ) ver[s][6]++ ; |
| 246 |
if ( cestw & (1 << 1) ) ver[s][5]++ ; |
| 247 |
if ( cestw & (1 << 2) ) ver[s][4]++ ; |
| 248 |
if ( cestw & (1 << 3) ) ver[s][3]++ ; |
| 249 |
if ( cestw & (1 << 4) ) ver[s][2]++ ; |
| 250 |
if ( cestw & (1 << 5) ) ver[s][1]++ ; |
| 251 |
if ( cestw & (1 << 6) ) ver[s][0]++ ; |
| 252 |
}; |
| 253 |
if ( ce->cperror[s] != 0. ){ |
| 254 |
if (ce->cperror[s] == 128) ver[s][7]++ ; |
| 255 |
if (ce->cperror[s] == 129) ver[s][8]++ ; |
| 256 |
if (ce->cperror[s] == 130) { |
| 257 |
ver[s][9]++ ; |
| 258 |
ver[s][16]--; |
| 259 |
}; |
| 260 |
if (ce->cperror[s] == 132) ver[s][11]++ ; |
| 261 |
if (ce->cperror[s] == 140) ver[s][19]++ ; |
| 262 |
if (ce->cperror[s] == 141) ver[s][20]++ ; |
| 263 |
if (ce->cperror[s] == 142) ver[s][22]++ ; |
| 264 |
}; |
| 265 |
// |
| 266 |
for ( Int_t d=0 ; d<11 ;d++ ){ |
| 267 |
Int_t pre = -1; |
| 268 |
for ( Int_t j=0; j<96 ;j++){ |
| 269 |
if ( j%16 == 0 ) pre++; |
| 270 |
if ( s == 2 ){ |
| 271 |
calib.calped[0][2*d+1][j] = ce->calped[3][d][j]; |
| 272 |
calib.cstwerr[3] = ce->cstwerr[3]; |
| 273 |
calib.cperror[3] = ce->cperror[3]; |
| 274 |
calib.calgood[0][2*d+1][j] = ce->calgood[3][d][j]; |
| 275 |
calib.calthr[0][2*d+1][pre] = ce->calthr[3][d][pre]; |
| 276 |
calib.calrms[0][2*d+1][j] = ce->calrms[3][d][j]; |
| 277 |
calib.calbase[0][2*d+1][pre] = ce->calbase[3][d][pre]; |
| 278 |
calib.calvar[0][2*d+1][pre] = ce->calvar[3][d][pre]; |
| 279 |
}; |
| 280 |
if ( s == 3 ){ |
| 281 |
calib.calped[0][2*d][j] = ce->calped[1][d][j]; |
| 282 |
calib.cstwerr[1] = ce->cstwerr[1]; |
| 283 |
calib.cperror[1] = ce->cperror[1]; |
| 284 |
calib.calgood[0][2*d][j] = ce->calgood[1][d][j]; |
| 285 |
calib.calthr[0][2*d][pre] = ce->calthr[1][d][pre]; |
| 286 |
calib.calrms[0][2*d][j] = ce->calrms[1][d][j]; |
| 287 |
calib.calbase[0][2*d][pre] = ce->calbase[1][d][pre]; |
| 288 |
calib.calvar[0][2*d][pre] = ce->calvar[1][d][pre]; |
| 289 |
}; |
| 290 |
if ( s == 0 ){ |
| 291 |
calib.calped[1][2*d][j] = ce->calped[0][d][j]; |
| 292 |
calib.cstwerr[0] = ce->cstwerr[0]; |
| 293 |
calib.cperror[0] = ce->cperror[0]; |
| 294 |
calib.calgood[1][2*d][j] = ce->calgood[0][d][j]; |
| 295 |
calib.calthr[1][2*d][pre] = ce->calthr[0][d][pre]; |
| 296 |
calib.calrms[1][2*d][j] = ce->calrms[0][d][j]; |
| 297 |
calib.calbase[1][2*d][pre] = ce->calbase[0][d][pre]; |
| 298 |
calib.calvar[1][2*d][pre] = ce->calvar[0][d][pre]; |
| 299 |
}; |
| 300 |
if ( s == 1 ){ |
| 301 |
calib.calped[1][2*d+1][j] = ce->calped[2][d][j]; |
| 302 |
calib.cstwerr[2] = ce->cstwerr[2]; |
| 303 |
calib.cperror[2] = ce->cperror[2]; |
| 304 |
calib.calgood[1][2*d+1][j] = ce->calgood[2][d][j]; |
| 305 |
calib.calthr[1][2*d+1][pre] = ce->calthr[2][d][pre]; |
| 306 |
calib.calrms[1][2*d+1][j] = ce->calrms[2][d][j]; |
| 307 |
calib.calbase[1][2*d+1][pre] = ce->calbase[2][d][pre]; |
| 308 |
calib.calvar[1][2*d+1][pre] = ce->calvar[2][d][pre]; |
| 309 |
}; |
| 310 |
}; |
| 311 |
}; |
| 312 |
}; |
| 313 |
// |
| 314 |
// Book the histograms: |
| 315 |
// |
| 316 |
// |
| 317 |
Int_t i = (ci-minev)/4; |
| 318 |
xviewev.str(""); |
| 319 |
xviewev << "x-view event " << (i+1); |
| 320 |
yviewev.str(""); |
| 321 |
yviewev << "y-view event " << (i+1); |
| 322 |
TH2F *Xview = new TH2F(xviewev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
| 323 |
TH2F *Yview = new TH2F(yviewev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
| 324 |
// |
| 325 |
// figures: |
| 326 |
// |
| 327 |
gDirectory->Delete("C14"); |
| 328 |
gDirectory->Delete("C15"); |
| 329 |
gDirectory->Delete("C16"); |
| 330 |
//TH1F *calped = new TH1F("C14","calped",4230,-3.5,4227.5); |
| 331 |
// TH1F *calrms = new TH1F("C15","calrms",4230,-3.5,4228.5); |
| 332 |
TH1F *calped = new TH1F("C14","calped",2112,-3.5,4227.5); |
| 333 |
// TH1F *calrms = new TH1F("C15","calrms",264,-2.,4226.); |
| 334 |
TH1F *calrms = new TH1F("C15","calrms",2112,-3.5,4228.5); |
| 335 |
TH1F *calbad = new TH1F("C16","calgood",4230,-3.5,4228.5); |
| 336 |
// |
| 337 |
gDirectory->Delete("C17"); |
| 338 |
gDirectory->Delete("C18"); |
| 339 |
gDirectory->Delete("C19"); |
| 340 |
TH1F *calthr = new TH1F("C17","calthr",271,-4.5,268.5); |
| 341 |
TH1F *calvar = new TH1F("C18","calvar",271,-4.5,268.5); |
| 342 |
TH1F *calbase = new TH1F("C19","calbase",271,-4.5,268.5); |
| 343 |
// |
| 344 |
Int_t bgcolor = 10; |
| 345 |
TPad *pd1 = 0; |
| 346 |
TPad *pd2 = 0; |
| 347 |
TPad *palette = 0; |
| 348 |
TLatex *t=new TLatex(); |
| 349 |
if ( figmatra ){ |
| 350 |
figura2 = new TCanvas("Calorimeter:_strip_RMS", "Calorimeter:_strip_RMS", 750, 650); |
| 351 |
figura2->SetFillColor(10); |
| 352 |
figura2->Range(0,0,100,100); |
| 353 |
bgcolor = 10; |
| 354 |
pd1 = new TPad("pd1","This is pad1",0.02,0.05,0.88,0.49,bgcolor); |
| 355 |
pd2 = new TPad("pd2","This is pad2",0.02,0.51,0.88,0.95,bgcolor); |
| 356 |
palette = new TPad("palette","This is palette",0.90,0.05,0.98,0.90,bgcolor); |
| 357 |
figura2->cd(); |
| 358 |
gStyle->SetOptStat(""); |
| 359 |
t=new TLatex(); |
| 360 |
t->SetTextFont(32); |
| 361 |
t->SetTextColor(1); |
| 362 |
t->SetTextSize(0.03); |
| 363 |
t->SetTextAlign(12); |
| 364 |
t->DrawLatex(90.,92.5,"ADC ch."); |
| 365 |
pd1->Range(0,0,100,100); |
| 366 |
pd2->Range(0,0,100,100); |
| 367 |
palette->Range(0,0,100,100); |
| 368 |
pd1->SetTicks(); |
| 369 |
pd2->SetTicks(); |
| 370 |
pd1->Draw(); |
| 371 |
pd2->Draw(); |
| 372 |
palette->Draw(); |
| 373 |
palette->cd(); |
| 374 |
// palette |
| 375 |
TPaveLabel *box1 = new TPaveLabel(2,2,98,14,"OFF",""); |
| 376 |
box1->SetTextFont(32); |
| 377 |
box1->SetTextColor(1); |
| 378 |
box1->SetTextSize(0.25); |
| 379 |
box1->SetFillColor(10); |
| 380 |
box1->Draw(); |
| 381 |
TPaveLabel *box2 = new TPaveLabel(2,16,98,28,"0-1.5",""); |
| 382 |
box2->SetTextFont(32); |
| 383 |
box2->SetTextColor(1); |
| 384 |
box2->SetTextSize(0.25); |
| 385 |
box2->SetFillColor(38); |
| 386 |
box2->Draw(); |
| 387 |
TPaveLabel *box3 = new TPaveLabel(2,30,98,42,"1.5-4",""); |
| 388 |
box3->SetTextFont(32); |
| 389 |
box3->SetTextColor(1); |
| 390 |
box3->SetTextSize(0.25); |
| 391 |
box3->SetFillColor(4); |
| 392 |
box3->Draw(); |
| 393 |
TPaveLabel *box4 = new TPaveLabel(2,44,98,56,"4-6.5",""); |
| 394 |
box4->SetTextFont(32); |
| 395 |
box4->SetTextColor(1); |
| 396 |
box4->SetTextSize(0.25); |
| 397 |
box4->SetFillColor(3); |
| 398 |
box4->Draw(); |
| 399 |
TPaveLabel *box5 = new TPaveLabel(2,58,98,70,"6.5-11.5",""); |
| 400 |
box5->SetTextFont(32); |
| 401 |
box5->SetTextColor(1); |
| 402 |
box5->SetTextSize(0.25); |
| 403 |
box5->SetFillColor(2); |
| 404 |
box5->Draw(); |
| 405 |
TPaveLabel *box6 = new TPaveLabel(2,72,98,84,">11.5",""); |
| 406 |
box6->SetTextFont(32); |
| 407 |
box6->SetTextColor(1); |
| 408 |
box6->SetTextSize(0.25); |
| 409 |
box6->SetFillColor(6); |
| 410 |
box6->Draw(); |
| 411 |
TPaveLabel *box7 = new TPaveLabel(2,86,98,98,"BAD",""); |
| 412 |
box7->SetTextFont(32); |
| 413 |
box7->SetTextColor(10); |
| 414 |
box7->SetTextSize(0.25); |
| 415 |
box7->SetFillColor(1); |
| 416 |
box7->Draw(); |
| 417 |
// |
| 418 |
pd1->cd(); |
| 419 |
gStyle->SetOptStat(""); |
| 420 |
Xview->SetXTitle("strip"); |
| 421 |
Xview->SetYTitle("X - plane"); |
| 422 |
Xview->GetYaxis()->SetTitleOffset(0.5); |
| 423 |
Xview->SetFillColor(bgcolor); |
| 424 |
Xview->Fill(1.,1.,1.); |
| 425 |
Xview->Draw("box"); |
| 426 |
pd1->Update(); |
| 427 |
pd2->cd(); |
| 428 |
gStyle->SetOptStat(""); |
| 429 |
Yview->SetXTitle("strip"); |
| 430 |
Yview->SetYTitle("Y - plane"); |
| 431 |
Yview->GetYaxis()->SetTitleOffset(0.5); |
| 432 |
Yview->SetFillColor(bgcolor); |
| 433 |
Yview->Fill(1.,1.,1.); |
| 434 |
Yview->Draw("box"); |
| 435 |
pd2->Update(); |
| 436 |
}; |
| 437 |
// |
| 438 |
// run over views and planes |
| 439 |
// |
| 440 |
Int_t j = 0; |
| 441 |
Int_t g = 0; |
| 442 |
gStyle->SetOptStat(""); |
| 443 |
for (Int_t m = 0; m < 22; m++){ |
| 444 |
for (Int_t l = 0; l < 2; l++){ |
| 445 |
for (Int_t n = 0; n < 96; n++){ |
| 446 |
// |
| 447 |
calped->Fill((float)j,calib.calped[l][m][n]); |
| 448 |
if ( (calib.calped[l][m][n] > 700. || calib.calped[l][m][n] < -700.) && (j < 4032 || j > 4048) ){ |
| 449 |
outcalped++; |
| 450 |
} else { |
| 451 |
incalped++; |
| 452 |
}; |
| 453 |
calrms->Fill((float)j,(calib.calrms[l][m][n]/4.)); |
| 454 |
if ( (((calib.calrms[l][m][n]/4.) > 7. || (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.)) ){ |
| 455 |
outcalrms++; |
| 456 |
} else { |
| 457 |
incalrms++; |
| 458 |
}; |
| 459 |
calbad->Fill((float)j,(float)calib.calgood[l][m][n]); |
| 460 |
if ( calib.calgood[l][m][n] ) totcalbad++; |
| 461 |
// |
| 462 |
if ( n < 6 ){ |
| 463 |
calthr->Fill((float)g,(float)calib.calthr[l][m][n]); |
| 464 |
if ( (calib.calthr[l][m][n] > 21. || calib.calthr[l][m][n] < 12.) && (g < 215 || g > 221) ){ |
| 465 |
outcalthr++; |
| 466 |
} else { |
| 467 |
incalthr++; |
| 468 |
}; |
| 469 |
calvar->Fill((float)g,(float)calib.calvar[l][m][n]); |
| 470 |
if ( (calib.calvar[l][m][n] > 8. || calib.calvar[l][m][n] < 1. ) && (g < 215 || g > 221) ){ |
| 471 |
outcalvar++; |
| 472 |
} else { |
| 473 |
incalvar++; |
| 474 |
}; |
| 475 |
calbase->Fill((float)g,(float)calib.calbase[l][m][n]); |
| 476 |
if ( calib.calbase[l][m][n] > 4500. || calib.calbase[l][m][n] < 2000. ){ |
| 477 |
outcalbas++; |
| 478 |
} else { |
| 479 |
incalbas++; |
| 480 |
}; |
| 481 |
g++; |
| 482 |
}; |
| 483 |
// |
| 484 |
j++; |
| 485 |
// |
| 486 |
if ( figmatra ){ |
| 487 |
figura2->cd(); |
| 488 |
xviewev.str(""); |
| 489 |
xviewev << "x-view " << i; |
| 490 |
xviewev << " event " << n; |
| 491 |
xviewev << " " << m; |
| 492 |
xviewev << " " << l; |
| 493 |
yviewev.str(""); |
| 494 |
yviewev << "y-view " << i; |
| 495 |
yviewev << " event " << n; |
| 496 |
yviewev << " " << m; |
| 497 |
yviewev << " " << l; |
| 498 |
TH2F *Xview = new TH2F(xviewev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
| 499 |
TH2F *Yview = new TH2F(yviewev.str().c_str(),"",96,-0.5,95.5,22,-0.5,21.5); |
| 500 |
if ( calib.calrms[l][m][n] > 0 ){ |
| 501 |
Xview->SetFillColor(38); |
| 502 |
Yview->SetFillColor(38); |
| 503 |
}; |
| 504 |
if ( calib.calrms[l][m][n] > 6 ){ |
| 505 |
Xview->SetFillColor(4); |
| 506 |
Yview->SetFillColor(4); |
| 507 |
}; |
| 508 |
if ( calib.calrms[l][m][n] > 16 ){ |
| 509 |
Xview->SetFillColor(3); |
| 510 |
Yview->SetFillColor(3); |
| 511 |
}; |
| 512 |
if ( calib.calrms[l][m][n] > 26 ){ |
| 513 |
Xview->SetFillColor(2); |
| 514 |
Yview->SetFillColor(2); |
| 515 |
}; |
| 516 |
if ( calib.calrms[l][m][n] > 46 ){ |
| 517 |
Xview->SetFillColor(6); |
| 518 |
Yview->SetFillColor(6); |
| 519 |
}; |
| 520 |
if ( calib.calrms[l][m][n] <= 0 || calib.calrms[l][m][n] >30000 || calib.calped[l][m][n]>25000){ |
| 521 |
Xview->SetFillColor(10); |
| 522 |
Yview->SetFillColor(10); |
| 523 |
}; |
| 524 |
if ( calib.calgood[l][m][n] != 0 ){ |
| 525 |
Xview->SetFillColor(1); |
| 526 |
Yview->SetFillColor(1); |
| 527 |
}; |
| 528 |
if ( l == 0 ) { |
| 529 |
Xview->Fill(n,m,1.); |
| 530 |
pd1->cd(); |
| 531 |
Xview->Draw("box same"); |
| 532 |
}; |
| 533 |
if ( l == 1 ) { |
| 534 |
Yview->Fill(n,m,1.); |
| 535 |
pd2->cd(); |
| 536 |
Yview->Draw("box same"); |
| 537 |
}; |
| 538 |
}; |
| 539 |
}; |
| 540 |
}; |
| 541 |
}; |
| 542 |
if ( figmatra ){ |
| 543 |
figura2->cd(); |
| 544 |
gStyle->SetOptStat(""); |
| 545 |
gStyle->SetOptDate(0); |
| 546 |
t=new TLatex(); |
| 547 |
t->SetTextFont(32); |
| 548 |
t->SetTextColor(1); |
| 549 |
t->SetTextSize(0.03); |
| 550 |
t->SetTextAlign(12); |
| 551 |
titolo.str(""); |
| 552 |
titolo << "C13 - Calorimeter: strip RMS - file "; |
| 553 |
titolo << file; |
| 554 |
titolo << " - calibration number "; |
| 555 |
titolo << (i+1); |
| 556 |
t->DrawLatex(0.5,97.,titolo.str().c_str()); |
| 557 |
pd1->Update(); |
| 558 |
pd2->Update(); |
| 559 |
figura2->Update(); |
| 560 |
}; |
| 561 |
// |
| 562 |
figura1 = new TCanvas("Calorimeter_calped_calrms_calgood", "Calorimeter_calped_calrms_calgood", 750, 950); |
| 563 |
figura1->SetFillColor(10); |
| 564 |
figura1->Range(0,0,100,100); |
| 565 |
// |
| 566 |
ccalped = (float)incalped/((float)outcalped + (float)incalped); |
| 567 |
Int_t f1pd1col = 10; |
| 568 |
if ( ccalped < ccalpedthr ) { |
| 569 |
check = true; |
| 570 |
f1pd1col = 45; |
| 571 |
}; |
| 572 |
// |
| 573 |
ccalrms = (float)incalrms/((float)outcalrms + (float)incalrms); |
| 574 |
Int_t f1pd2col = 10; |
| 575 |
if ( ccalrms < ccalrmsthr ) { |
| 576 |
check = true; |
| 577 |
f1pd2col = 45; |
| 578 |
}; |
| 579 |
// |
| 580 |
ccalbad = (float)totcalbad/4224.; |
| 581 |
Int_t f1pd3col = 10; |
| 582 |
if ( ccalbad > ccalbadthr ) { |
| 583 |
check = true; |
| 584 |
f1pd3col = 45; |
| 585 |
}; |
| 586 |
// |
| 587 |
TPad *f1pd1 = new TPad("f1pd1","This is f1pad1",0.02,0.684,0.98,0.95,f1pd1col); |
| 588 |
TPad *f1pd2 = new TPad("f1pd2","This is f1pad2",0.02,0.367,0.98,0.634,f1pd2col); |
| 589 |
TPad *f1pd3 = new TPad("f1pd3","This is f1pad3",0.02,0.05,0.98,0.317,f1pd3col); |
| 590 |
figura1->Clear(); |
| 591 |
figura1->cd(); |
| 592 |
f1pd1->SetTicks(); |
| 593 |
f1pd2->SetTicks(); |
| 594 |
f1pd3->SetTicks(); |
| 595 |
f1pd1->Draw(); |
| 596 |
f1pd2->Draw(); |
| 597 |
f1pd3->Draw(); |
| 598 |
figura1->Draw(); |
| 599 |
figura3 = new TCanvas("Calorimeter_calthr_calvar_calbase", "Calorimeter_calthr_calvar_calbase", 750, 950); |
| 600 |
figura3->SetFillColor(10); |
| 601 |
figura3->Range(0,0,100,100); |
| 602 |
// |
| 603 |
ccalthr = (float)incalthr/((float)outcalthr + (float)incalthr); |
| 604 |
Int_t f3pd1col = 10; |
| 605 |
if ( ccalthr < ccalthrthr ) { |
| 606 |
check = true; |
| 607 |
f3pd1col = 45; |
| 608 |
}; |
| 609 |
// |
| 610 |
ccalvar = (float)incalvar/((float)outcalvar + (float)incalvar); |
| 611 |
Int_t f3pd2col = 10; |
| 612 |
if ( ccalvar < ccalvarthr ) { |
| 613 |
check = true; |
| 614 |
f3pd2col = 45; |
| 615 |
}; |
| 616 |
// |
| 617 |
ccalbas = (float)incalbas/((float)outcalbas + (float)incalbas); |
| 618 |
Int_t f3pd3col = 10; |
| 619 |
if ( ccalbas < ccalbasthr ) { |
| 620 |
check = true; |
| 621 |
f3pd3col = 45; |
| 622 |
}; |
| 623 |
// |
| 624 |
TPad *f3pd1 = new TPad("f3pd1","This is f3pad1",0.02,0.684,0.98,0.95,f3pd1col); |
| 625 |
TPad *f3pd2 = new TPad("f3pd2","This is f3pad2",0.02,0.367,0.98,0.634,f3pd2col); |
| 626 |
TPad *f3pd3 = new TPad("f3pd3","This is f3pad3",0.02,0.05,0.98,0.317,f3pd3col); |
| 627 |
figura3->Clear(); |
| 628 |
figura3->cd(); |
| 629 |
f3pd1->SetTicks(); |
| 630 |
f3pd2->SetTicks(); |
| 631 |
f3pd3->SetTicks(); |
| 632 |
f3pd1->Draw(); |
| 633 |
f3pd2->Draw(); |
| 634 |
f3pd3->Draw(); |
| 635 |
figura3->Draw(); |
| 636 |
// |
| 637 |
gStyle->SetOptStat("N"); |
| 638 |
figura1->cd(); |
| 639 |
gStyle->SetNdivisions(322,"x"); |
| 640 |
t=new TLatex(); |
| 641 |
t->SetTextFont(32); |
| 642 |
t->SetTextColor(1); |
| 643 |
t->SetTextSize(0.025); |
| 644 |
t->SetTextAlign(12); |
| 645 |
titolo.str(""); |
| 646 |
titolo << "EXPERT - Calorimeter: calped/calrms/calgood - file "; |
| 647 |
titolo << file; |
| 648 |
titolo << " - calibration number "; |
| 649 |
titolo << (i+1); |
| 650 |
t->DrawLatex(0.5,97.,titolo.str().c_str()); |
| 651 |
t->SetTextSize(0.03); |
| 652 |
f1pd1->cd(); |
| 653 |
// |
| 654 |
calped->GetXaxis()->SetNdivisions(322); |
| 655 |
calped->SetXTitle("strip"); |
| 656 |
calped->SetYTitle("ADC channels"); |
| 657 |
calped->SetMaximum(3000.); |
| 658 |
calped->SetMinimum(-3000.); |
| 659 |
calped->Draw(); |
| 660 |
TPolyLine *banda1; |
| 661 |
Double_t xc[4] = {0.,4224.,4224.,0.}; |
| 662 |
Double_t yc[4] = {-700.,-700.,700.,700.}; |
| 663 |
banda1 = new TPolyLine(4,xc,yc); |
| 664 |
banda1->SetLineColor(5); |
| 665 |
banda1->SetFillColor(5); |
| 666 |
banda1->SetLineWidth(1); |
| 667 |
banda1->Draw("fSAME"); |
| 668 |
TPolyLine *banda2; |
| 669 |
Double_t xc2[4] = {4031.5,4047.5,4047.5,4031.5}; |
| 670 |
// Double_t yc2[4] = {-2500.,-2500.,28000.,28000.}; |
| 671 |
Double_t yc2[4] = {-3000.,-3000.,3000.,3000.}; |
| 672 |
banda2 = new TPolyLine(4,xc2,yc2); |
| 673 |
banda2->SetLineColor(5); |
| 674 |
banda2->SetFillColor(5); |
| 675 |
banda2->SetLineWidth(1); |
| 676 |
banda2->Draw("fSAME"); |
| 677 |
calped->Draw("SAME"); |
| 678 |
f1pd2->cd(); |
| 679 |
f1pd2->SetLogy(); |
| 680 |
calrms->GetXaxis()->SetNdivisions(322); |
| 681 |
calrms->Draw(); |
| 682 |
Double_t xd[4] = {0.,4224.,4224.,0.}; |
| 683 |
Double_t yd[4] = {1.,1.,7.,7.}; |
| 684 |
banda1 = new TPolyLine(4,xd,yd); |
| 685 |
banda1->SetLineColor(5); |
| 686 |
banda1->SetFillColor(5); |
| 687 |
banda1->SetLineWidth(1); |
| 688 |
banda1->Draw("fSAME"); |
| 689 |
Float_t minrm = calrms->GetMinimum(); |
| 690 |
Float_t maxrm = calrms->GetMaximum(); |
| 691 |
Double_t xrm2[4] = {3449.,3551.,3551.,3449.}; |
| 692 |
Double_t yrm2[4] = {minrm,minrm,maxrm,maxrm}; |
| 693 |
banda2 = new TPolyLine(4,xrm2,yrm2); |
| 694 |
banda2->SetLineColor(5); |
| 695 |
banda2->SetFillColor(5); |
| 696 |
banda2->SetLineWidth(1); |
| 697 |
banda2->Draw("fSAME"); |
| 698 |
calrms->SetXTitle("strip"); |
| 699 |
calrms->SetYTitle("ADC channels"); |
| 700 |
calrms->Draw("SAME"); |
| 701 |
f1pd3->cd(); |
| 702 |
gStyle->SetNdivisions(344,"x"); |
| 703 |
calbad->GetXaxis()->SetNdivisions(322); |
| 704 |
calbad->Draw(); |
| 705 |
calbad->SetXTitle("strip"); |
| 706 |
calbad->SetYTitle("0=good 255=bad"); |
| 707 |
f1pd1->Update(); |
| 708 |
f1pd2->Update(); |
| 709 |
f1pd3->Update(); |
| 710 |
figura1->Update(); |
| 711 |
// |
| 712 |
figura3->cd(); |
| 713 |
gStyle->SetNdivisions(644,"x"); |
| 714 |
t=new TLatex(); |
| 715 |
t->SetTextFont(32); |
| 716 |
t->SetTextColor(1); |
| 717 |
t->SetTextSize(0.025); |
| 718 |
t->SetTextAlign(12); |
| 719 |
titolo.str(""); |
| 720 |
titolo << "EXPERT - Calorimeter: calthr/calvar/calbase - file "; |
| 721 |
titolo << file; |
| 722 |
titolo << " - calibration number "; |
| 723 |
titolo << (i+1); |
| 724 |
t->DrawLatex(0.5,97.,titolo.str().c_str()); |
| 725 |
t->SetTextSize(0.03); |
| 726 |
// |
| 727 |
f3pd1->cd(); |
| 728 |
calthr->GetXaxis()->SetNdivisions(644); |
| 729 |
calthr->SetXTitle("pre-amplifier"); |
| 730 |
calthr->SetYTitle("ADC channels"); |
| 731 |
calthr->Draw(); |
| 732 |
Double_t xe[4] = {0.,264.,264.,0.}; |
| 733 |
Double_t ye[4] = {12.,12.,21.,21.}; |
| 734 |
banda1 = new TPolyLine(4,xe,ye); |
| 735 |
banda1->SetLineColor(5); |
| 736 |
banda1->SetFillColor(5); |
| 737 |
banda1->SetLineWidth(1); |
| 738 |
banda1->Draw("fSAME"); |
| 739 |
// |
| 740 |
minrm = calthr->GetMinimum(); |
| 741 |
maxrm = 1.05*calthr->GetMaximum(); |
| 742 |
Double_t xth2[4] = {215.,221.,221.,215.}; |
| 743 |
Double_t yth2[4] = {minrm,minrm,maxrm,maxrm}; |
| 744 |
banda2 = new TPolyLine(4,xth2,yth2); |
| 745 |
banda2->SetLineColor(5); |
| 746 |
banda2->SetFillColor(5); |
| 747 |
banda2->SetLineWidth(1); |
| 748 |
banda2->Draw("fSAME"); |
| 749 |
// |
| 750 |
calthr->Draw("SAME"); |
| 751 |
f3pd2->cd(); |
| 752 |
// gPad->SetLogy(); |
| 753 |
calvar->SetMaximum(25.); |
| 754 |
calvar->GetXaxis()->SetNdivisions(644); |
| 755 |
calvar->SetXTitle("pre-amplifier"); |
| 756 |
calvar->SetYTitle("ADC channels"); |
| 757 |
calvar->Draw(); |
| 758 |
Double_t xt[4] = {0.,264.,264.,0.}; |
| 759 |
Double_t yt[4] = {1.,1.,8.,8.}; |
| 760 |
banda1 = new TPolyLine(4,xt,yt); |
| 761 |
banda1->SetLineColor(5); |
| 762 |
banda1->SetFillColor(5); |
| 763 |
banda1->SetLineWidth(1); |
| 764 |
banda1->Draw("fSAME"); |
| 765 |
// |
| 766 |
minrm = calvar->GetMinimum(); |
| 767 |
maxrm = 1.05*calvar->GetMaximum(); |
| 768 |
Double_t xva2[4] = {215.,221.,221.,215.}; |
| 769 |
Double_t yva2[4] = {minrm,minrm,maxrm,maxrm}; |
| 770 |
banda2 = new TPolyLine(4,xva2,yva2); |
| 771 |
banda2->SetLineColor(5); |
| 772 |
banda2->SetFillColor(5); |
| 773 |
banda2->SetLineWidth(1); |
| 774 |
banda2->Draw("fSAME"); |
| 775 |
// |
| 776 |
calvar->Draw("SAME"); |
| 777 |
f3pd3->cd(); |
| 778 |
calbase->GetXaxis()->SetNdivisions(644); |
| 779 |
calbase->SetXTitle("pre-amplifier"); |
| 780 |
calbase->SetYTitle("ADC channels"); |
| 781 |
calbase->Draw(); |
| 782 |
Double_t xg[4] = {0.,264.,264.,0.}; |
| 783 |
Double_t yg[4] = {2000.,2000.,4500.,4500.}; |
| 784 |
banda1 = new TPolyLine(4,xg,yg); |
| 785 |
banda1->SetLineColor(5); |
| 786 |
banda1->SetFillColor(5); |
| 787 |
banda1->SetLineWidth(1); |
| 788 |
banda1->Draw("fSAME"); |
| 789 |
calbase->Draw("SAME"); |
| 790 |
f3pd1->Update(); |
| 791 |
f3pd2->Update(); |
| 792 |
f3pd3->Update(); |
| 793 |
figura3->Update(); |
| 794 |
// |
| 795 |
if ( !strcmp(format,"ps") ) { |
| 796 |
if ( ci == minev ) { |
| 797 |
figsave.str(""); |
| 798 |
figsave << outdir << "/" ; |
| 799 |
figsave << figrec << "_CaloCHKCALIB."; |
| 800 |
figsave << format; |
| 801 |
figsave << "("; |
| 802 |
}; |
| 803 |
if ( figmatra ) { |
| 804 |
figura2->Print(figsave.str().c_str(),"Portrait"); |
| 805 |
if ( ci == minev ) { |
| 806 |
figsave.str(""); |
| 807 |
figsave << outdir << "/" ; |
| 808 |
figsave << figrec << "_CaloCHKCALIB."; |
| 809 |
figsave << format; |
| 810 |
}; |
| 811 |
}; |
| 812 |
// |
| 813 |
figura1->Print(figsave.str().c_str(),"Portrait"); |
| 814 |
if ( ci == minev ) { |
| 815 |
figsave.str(""); |
| 816 |
figsave << outdir << "/" ; |
| 817 |
figsave << figrec << "_CaloCHKCALIB."; |
| 818 |
figsave << format; |
| 819 |
}; |
| 820 |
// |
| 821 |
figura3->Print(figsave.str().c_str(),"Portrait"); |
| 822 |
// |
| 823 |
} else { |
| 824 |
if ( figmatra ) { |
| 825 |
figsave.str(""); |
| 826 |
figsave << outdir << "/" ; |
| 827 |
figsave << figrec << "_CaloCHKCALIB1_"; |
| 828 |
figsave << (i+1) << "."; |
| 829 |
figsave << format; |
| 830 |
figura2->SaveAs(figsave.str().c_str()); |
| 831 |
}; |
| 832 |
// |
| 833 |
figsave1.str(""); |
| 834 |
figsave1 << outdir << "/" ; |
| 835 |
figsave1 << figrec << "_CaloCHKCALIB2_"; |
| 836 |
figsave1 << (i+1) << "."; |
| 837 |
figsave1 << format; |
| 838 |
figura1->SaveAs(figsave1.str().c_str()); |
| 839 |
// |
| 840 |
figsave2.str(""); |
| 841 |
figsave2 << outdir << "/" ; |
| 842 |
figsave2 << figrec << "_CaloCHKCALIB3_"; |
| 843 |
figsave2 << (i+1) << "."; |
| 844 |
figsave2 << format; |
| 845 |
figura3->SaveAs(figsave2.str().c_str()); |
| 846 |
// |
| 847 |
}; |
| 848 |
if ( iactive && w4i ){ |
| 849 |
while ( gROOT->GetListOfCanvases()->FindObject(figura2) || gROOT->GetListOfCanvases()->FindObject(figura1) || gROOT->GetListOfCanvases()->FindObject(figura3) ){ |
| 850 |
gSystem->ProcessEvents(); |
| 851 |
gSystem->Sleep(10); |
| 852 |
}; |
| 853 |
}; |
| 854 |
}; |
| 855 |
// |
| 856 |
// |
| 857 |
// |
| 858 |
// |
| 859 |
// report sheet: |
| 860 |
// |
| 861 |
stringstream errore; |
| 862 |
rapporto= new TCanvas("Calorimeter calibration report", "Calorimeter calibration report", 750, 950); |
| 863 |
rapporto->cd(); |
| 864 |
rapporto->SetFillColor(10); |
| 865 |
rapporto->Range(0,0,100,100); |
| 866 |
TLatex *t=new TLatex(); |
| 867 |
t->SetTextFont(32); |
| 868 |
t->SetTextColor(1); |
| 869 |
t->SetTextSize(0.035); |
| 870 |
t->SetTextAlign(12); |
| 871 |
errore.str(""); |
| 872 |
errore << "BASIC - C20 - Calibrations in file: " << file; |
| 873 |
errore << " "; |
| 874 |
t->SetTextSize(0.02); |
| 875 |
t->DrawLatex(2.,99.,errore.str().c_str()); |
| 876 |
// |
| 877 |
TPad *pad1; |
| 878 |
TPad *pad2; |
| 879 |
TPad *pad3; |
| 880 |
TPad *pad4; |
| 881 |
pad1 = new TPad("pad1","This is pad1",0.02,0.47,0.49,0.90,19); |
| 882 |
pad2 = new TPad("pad2","This is pad2",0.51,0.47,0.98,0.90,19); |
| 883 |
pad3 = new TPad("pad3","This is pad3",0.02,0.02,0.49,0.45,19); |
| 884 |
pad4 = new TPad("pad4","This is pad4",0.51,0.02,0.98,0.45,19); |
| 885 |
pad1->Range(0,0,100,100); |
| 886 |
pad2->Range(0,0,100,100); |
| 887 |
pad3->Range(0,0,100,100); |
| 888 |
pad4->Range(0,0,100,100); |
| 889 |
// |
| 890 |
pad1->Draw(); |
| 891 |
pad2->Draw(); |
| 892 |
pad3->Draw(); |
| 893 |
pad4->Draw(); |
| 894 |
// |
| 895 |
char *sezione = 0; |
| 896 |
for (Int_t si = 0; si < 4; si++){ |
| 897 |
if (si == 2) |
| 898 |
{ |
| 899 |
pad1->cd() ; |
| 900 |
sezione = "** Section YE (x even) **"; |
| 901 |
} |
| 902 |
if (si == 3) |
| 903 |
{ |
| 904 |
pad2->cd(); |
| 905 |
sezione = "** Section YO (x odd) **"; |
| 906 |
} |
| 907 |
if (si == 0) |
| 908 |
{ |
| 909 |
pad3->cd(); |
| 910 |
sezione = "** Section XE (y odd) **"; |
| 911 |
} |
| 912 |
if (si == 1) |
| 913 |
{ |
| 914 |
pad4->cd(); |
| 915 |
sezione = "** Section XO (y even) **"; |
| 916 |
} |
| 917 |
t->SetTextFont(32); |
| 918 |
t->SetTextColor(1); |
| 919 |
t->SetTextSize(0.05); |
| 920 |
t->SetTextAlign(12); |
| 921 |
t->DrawLatex(33.,97.,sezione); |
| 922 |
t->SetTextSize(0.05); |
| 923 |
for (Int_t j = 0; j < 23; j++){ |
| 924 |
if ( ver[si][j] ) { |
| 925 |
t->SetTextColor(50); |
| 926 |
if (j == 0) { |
| 927 |
errore.str(""); |
| 928 |
errore << "* DSP ack error: " << ver[si][j]; |
| 929 |
errore << " time(s)"; |
| 930 |
t->DrawLatex(2.,30.,errore.str().c_str()); |
| 931 |
check = true; |
| 932 |
} |
| 933 |
if (j == 1) { |
| 934 |
errore.str(""); |
| 935 |
errore << "* Temperature alarm: " << ver[si][j]; |
| 936 |
errore << " time(s)"; |
| 937 |
t->DrawLatex(2.,74.,errore.str().c_str()); |
| 938 |
check = true; |
| 939 |
} |
| 940 |
if (j == 2) { |
| 941 |
errore.str(""); |
| 942 |
errore << "* Latch up alarm: " << ver[si][j]; |
| 943 |
errore << " time(s)."; |
| 944 |
t->DrawLatex(2.,65.,errore.str().c_str()); |
| 945 |
check = true; |
| 946 |
} |
| 947 |
if (j == 3) { |
| 948 |
errore.str(""); |
| 949 |
errore << "RAW mode: " << ver[si][j]; |
| 950 |
errore << " time(s)"; |
| 951 |
t->SetTextColor(38); |
| 952 |
t->DrawLatex(2.,90.,errore.str().c_str()); |
| 953 |
} |
| 954 |
if (j == 4) { |
| 955 |
errore.str(""); |
| 956 |
errore << "* CMD length error: " << ver[si][j]; |
| 957 |
errore << " time(s)"; |
| 958 |
t->DrawLatex(2.,66.,errore.str().c_str()); |
| 959 |
check = true; |
| 960 |
} |
| 961 |
if (j == 5) { |
| 962 |
errore.str(""); |
| 963 |
errore << "* Execution error: " << ver[si][j]; |
| 964 |
errore << " time(s)"; |
| 965 |
t->DrawLatex(2.,62.,errore.str().c_str()); |
| 966 |
check = true; |
| 967 |
} |
| 968 |
if (j == 6) { |
| 969 |
errore.str(""); |
| 970 |
errore << "* CRC error (st. word): " << ver[si][j]; |
| 971 |
errore << " time(s)"; |
| 972 |
t->DrawLatex(2.,58.,errore.str().c_str()); |
| 973 |
check = true; |
| 974 |
} |
| 975 |
if (j == 7) { |
| 976 |
errore.str(""); |
| 977 |
errore << "View or command not recognized: " << ver[si][j]; |
| 978 |
errore << " time(s)"; |
| 979 |
t->DrawLatex(2.,54.,errore.str().c_str()); |
| 980 |
check = true; |
| 981 |
} |
| 982 |
// |
| 983 |
if (j == 8) { |
| 984 |
errore.str(""); |
| 985 |
errore << "Missing section: " << ver[si][j]; |
| 986 |
errore << " time(s)"; |
| 987 |
t->DrawLatex(2.,50.,errore.str().c_str()); |
| 988 |
check = true; |
| 989 |
} |
| 990 |
if (j == 9) { |
| 991 |
errore.str(""); |
| 992 |
errore << "RAW MODE COMMAND: " << ver[si][j]; |
| 993 |
errore << " time(s)"; |
| 994 |
t->DrawLatex(2.,42.,errore.str().c_str()); |
| 995 |
} |
| 996 |
if (j == 11) { |
| 997 |
errore.str(""); |
| 998 |
errore << "CRC error (data): " << ver[si][j]; |
| 999 |
errore << " time(s)"; |
| 1000 |
t->DrawLatex(2.,38.,errore.str().c_str()); |
| 1001 |
check = true; |
| 1002 |
} |
| 1003 |
if (j == 16) { |
| 1004 |
errore.str(""); |
| 1005 |
errore << "Number of calibrations: " << ver[si][j]; |
| 1006 |
t->SetTextColor(38); |
| 1007 |
t->DrawLatex(2.,86.,errore.str().c_str()); |
| 1008 |
} |
| 1009 |
if (j == 19) { |
| 1010 |
errore.str(""); |
| 1011 |
errore << "Pedestal checksum wrong: " << ver[si][j]; |
| 1012 |
errore << " time(s)"; |
| 1013 |
t->DrawLatex(2.,14.,errore.str().c_str()); |
| 1014 |
check = true; |
| 1015 |
} |
| 1016 |
if (j == 20) { |
| 1017 |
errore.str(""); |
| 1018 |
errore << "Thresholds checksum wrong: " << ver[si][j]; |
| 1019 |
errore << " time(s)"; |
| 1020 |
t->DrawLatex(2.,10.,errore.str().c_str()); |
| 1021 |
check = true; |
| 1022 |
} |
| 1023 |
if (j == 22) { |
| 1024 |
errore.str(""); |
| 1025 |
errore << "Packet length is zero (YODA input error), skipped: " << ver[si][j]; |
| 1026 |
errore << " time(s)"; |
| 1027 |
t->DrawLatex(2.,3.,errore.str().c_str()); |
| 1028 |
check = true; |
| 1029 |
}; |
| 1030 |
}; |
| 1031 |
}; |
| 1032 |
}; |
| 1033 |
rapporto->cd(); |
| 1034 |
t->SetTextFont(32); |
| 1035 |
t->SetTextColor(1); |
| 1036 |
t->SetTextSize(0.035); |
| 1037 |
t->SetTextAlign(12); |
| 1038 |
t->DrawLatex(7.,95.,"Calorimeter CALIBRATION quick look: "); |
| 1039 |
//printf("vediamo: ccalped %f ccalrms %f ccalbad %f ccalthr %f ccalvar %f ccalbas %f \n",ccalped,ccalrms,ccalbad,ccalthr,ccalvar,ccalbas); |
| 1040 |
if ( check ) { |
| 1041 |
t->SetTextColor(50); |
| 1042 |
t->DrawLatex(65.,95.,"WARNING, CHECK!"); |
| 1043 |
t->SetTextColor(1); |
| 1044 |
} else { |
| 1045 |
t->SetTextColor(38); |
| 1046 |
t->DrawLatex(65.,95.,"OK!"); |
| 1047 |
t->SetTextColor(1); |
| 1048 |
}; |
| 1049 |
rapporto->Update(); |
| 1050 |
// |
| 1051 |
if ( !strcmp(format,"ps") ) { |
| 1052 |
figsave.str(""); |
| 1053 |
figsave << outdir << "/" ; |
| 1054 |
figsave << figrec << "_CaloCHKCALIB."; |
| 1055 |
figsave << format; |
| 1056 |
figsave << ")"; |
| 1057 |
rapporto->Print(figsave.str().c_str(),"Portrait"); |
| 1058 |
} else { |
| 1059 |
figsave.str(""); |
| 1060 |
figsave << outdir << "/" ; |
| 1061 |
figsave << figrec << "_CaloCHKCALIB_report."; |
| 1062 |
figsave << format; |
| 1063 |
rapporto->SaveAs(figsave.str().c_str()); |
| 1064 |
}; |
| 1065 |
if ( iactive && w4i ){ |
| 1066 |
while ( gROOT->GetListOfCanvases()->FindObject(rapporto) ){ |
| 1067 |
gSystem->ProcessEvents(); |
| 1068 |
gSystem->Sleep(10); |
| 1069 |
}; |
| 1070 |
}; |
| 1071 |
printf("\n"); |
| 1072 |
return; |
| 1073 |
} |