2 |
* FTrkQLook_BASIC.cxx |
* FTrkQLook_BASIC.cxx |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version v1r07 |
* version v1r11 |
6 |
* Parameters: |
* Parameters: |
7 |
* file - the data file to analyze |
* file - the data file to analyze |
8 |
* fromevent - first event to analyze |
* fromevent - first event to analyze |
263 |
Long64_t x[MAXSTORAGE], xb[MAXSTORAGE]; |
Long64_t x[MAXSTORAGE], xb[MAXSTORAGE]; |
264 |
Float_t yyd[MAXSTORAGE][12],yyb[MAXSTORAGE][12]; |
Float_t yyd[MAXSTORAGE][12],yyb[MAXSTORAGE][12]; |
265 |
Int_t countbad[12]; |
Int_t countbad[12]; |
266 |
Float_t perc=0,xMIN=0.,xMAX=0.; |
Float_t perc=0; |
267 |
|
Double_t xMIN=0.,xMAX=0.; |
268 |
for (Int_t n=0; n<12 ; n++) |
for (Int_t n=0; n<12 ; n++) |
269 |
countbad[n]=0; |
countbad[n]=0; |
270 |
|
|
297 |
x[(ev-minev)]= ph->GetOrbitalTime(); |
x[(ev-minev)]= ph->GetOrbitalTime(); |
298 |
i=0; |
i=0; |
299 |
|
|
300 |
for (Int_t n=0; n<12 ; n++){ |
for (Int_t n=0; n<12 ; n++){ |
301 |
yyb[countbad[n]][i]=0; |
i=te->DSPnumber[n]-1; |
302 |
xb[countbad[n]]= 0; |
if(i>=0){ |
303 |
|
if(i<12){ |
304 |
i=te->DSPnumber[n]-1; |
yyb[countbad[i]][i]=0; |
305 |
|
xb[countbad[i]]= 0; |
306 |
yyd[(ev-minev)][i]=te->DATAlength[n]; |
|
307 |
if(i==6){ |
yyd[(ev-minev)][i]=te->DATAlength[n]; |
308 |
if(yyd[(ev-minev)][i]>1500){ |
if(i==6){ |
309 |
if(yyd[(ev-minev)][i]<3075){ |
if(yyd[(ev-minev)][i]>1500){ |
310 |
yyb[countbad[i]][i]= yyd[(ev-minev)][i]; |
if(yyd[(ev-minev)][i]<3075){ |
311 |
xb[countbad[i]]= x[(ev-minev)]; |
yyb[countbad[i]][i]= yyd[(ev-minev)][i]; |
312 |
countbad[i]+=1; |
xb[countbad[i]]= x[(ev-minev)]; |
313 |
|
countbad[i]+=1; |
314 |
|
} |
315 |
|
} |
316 |
} |
} |
317 |
} |
else{ |
318 |
} |
if(yyd[(ev-minev)][i]>750){ |
319 |
else{ |
if(yyd[(ev-minev)][i]<3075){ |
320 |
if(yyd[(ev-minev)][i]>750){ |
yyb[countbad[i]][i]= yyd[(ev-minev)][i]; |
321 |
if(yyd[(ev-minev)][i]<3075){ |
xb[countbad[i]]= x[(ev-minev)]; |
322 |
yyb[countbad[i]][i]= yyd[(ev-minev)][i]; |
countbad[i]+=1; |
323 |
xb[countbad[i]]= x[(ev-minev)]; |
} |
324 |
countbad[i]+=1; |
} |
325 |
} |
} |
326 |
} |
} |
327 |
} |
} |
328 |
} |
} |
329 |
} |
} |
330 |
} |
} |
331 |
|
|
334 |
|
|
335 |
xMAX=x[maxev-minev-1]+(x[maxev-minev-1]-x[0])/10; |
xMAX=x[maxev-minev-1]+(x[maxev-minev-1]-x[0])/10; |
336 |
if(xMAX>1000000) xMIN=x[0]-(x[maxev-minev-1]-x[0])/10; |
if(xMAX>1000000) xMIN=x[0]-(x[maxev-minev-1]-x[0])/10; |
337 |
if(xMAX<1000000 || xMIN<0) xMIN=0.; |
if(xMAX<1000000 || xMIN<0) xMIN=0.; |
338 |
|
if(xMIN==xMAX) xMIN=x[0] * x[0]/xMAX; |
339 |
|
|
340 |
|
|
341 |
// |
// |
342 |
// Draw Histos |
// Draw Histos |
343 |
for (Int_t i=0; i<12 ; i++){ |
for (Int_t n=0; n<12 ; n++){ |
344 |
|
|
345 |
Double_t yd[maxev-minev],ybd[maxev-minev]; |
Double_t yd[maxev-minev],ybd[maxev-minev]; |
346 |
Double_t xd[maxev-minev],xbd[maxev-minev]; |
Double_t xd[maxev-minev],xbd[maxev-minev]; |
347 |
|
|
348 |
for(Int_t v=0;v<maxev-minev;v++){ |
for(Int_t v=0;v<maxev-minev;v++){ |
349 |
yd[v]=(Double_t)yyd[v][i]; |
yd[v]=(Double_t)yyd[v][n]; |
350 |
ybd[v]=(Double_t)yyb[v][i]; |
ybd[v]=(Double_t)yyb[v][n]; |
351 |
xd[v]=(Double_t)x[v]; |
xd[v]=(Double_t)x[v]; |
352 |
xbd[v]=(Double_t)xb[v]; |
xbd[v]=(Double_t)xb[v]; |
353 |
} |
} |
358 |
} |
} |
359 |
|
|
360 |
if((maxev-minev)>1000){ |
if((maxev-minev)>1000){ |
361 |
perc=(countbad[i]*100)/(maxev-minev); |
perc=(countbad[n]*100)/(maxev-minev); |
362 |
if(perc>10) pad[i][ii]->SetFillColor(2); |
if(perc>10) pad[n][ii]->SetFillColor(2); |
363 |
else pad[i][ii]->SetFillColor(10); |
else pad[n][ii]->SetFillColor(10); |
364 |
|
|
365 |
} |
} |
366 |
else{ |
else{ |
367 |
if(countbad[i]>=100) pad[i][ii]->SetFillColor(2); |
if(countbad[n]>=100) pad[n][ii]->SetFillColor(2); |
368 |
else pad[i][ii]->SetFillColor(10); |
else pad[n][ii]->SetFillColor(10); |
369 |
} |
} |
370 |
|
|
371 |
oss<<"DSP "<<i+1; |
oss<<"DSP "<<n+1; |
372 |
DataTimeCanv[ii]->cd(); |
DataTimeCanv[ii]->cd(); |
373 |
pad[i][ii]->SetFrameFillColor(10); |
pad[n][ii]->SetFrameFillColor(10); |
374 |
pad[i][ii]->Draw(); |
pad[n][ii]->Draw(); |
375 |
pad[i][ii]->cd(); |
pad[n][ii]->cd(); |
376 |
dataletime[i][ii]= new TGraph((maxev-minev),xd,yd); |
dataletime[n][ii]= new TGraph((maxev-minev),xd,yd); |
377 |
dataletime[i][ii]->SetTitle(oss.str().c_str()); |
if(maxev-minev==1) dataletime[n][ii]->GetXaxis()->SetNdivisions(-501); |
378 |
dataletime[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
dataletime[n][ii]->SetTitle(oss.str().c_str()); |
379 |
dataletime[i][ii]->GetXaxis()->CenterTitle(); |
dataletime[n][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
380 |
dataletime[i][ii]->GetXaxis()->SetRangeUser(xMIN,xMAX); |
dataletime[n][ii]->GetXaxis()->CenterTitle(); |
381 |
dataletime[i][ii]->GetYaxis()->SetTitle("datalength (Word 13 bit)"); |
dataletime[n][ii]->GetXaxis()->SetRangeUser(xMIN,xMAX); |
382 |
dataletime[i][ii]->GetYaxis()->CenterTitle(); |
dataletime[n][ii]->GetYaxis()->SetTitle("datalength (Word 13 bit)"); |
383 |
if(i==6) dataletime[i][ii]->GetYaxis()->SetRangeUser(0,4500); |
dataletime[n][ii]->GetYaxis()->CenterTitle(); |
384 |
else dataletime[i][ii]->GetYaxis()->SetRangeUser(0,4000); |
if(i==6) dataletime[n][ii]->GetYaxis()->SetRangeUser(0,4500); |
385 |
dataletime[i][ii]->SetMarkerStyle(21); |
else dataletime[n][ii]->GetYaxis()->SetRangeUser(0,4000); |
386 |
if((maxev-minev)<50) dataletime[i][ii]->SetMarkerSize(0.5); |
dataletime[n][ii]->SetMarkerStyle(21); |
387 |
else dataletime[i][ii]->SetMarkerSize(0.1); |
if((maxev-minev)<50) dataletime[n][ii]->SetMarkerSize(0.5); |
388 |
dataletime[i][ii]->SetMarkerColor(4); |
else dataletime[n][ii]->SetMarkerSize(0.1); |
389 |
dataletime[i][ii]->Draw("ap"); |
dataletime[n][ii]->SetMarkerColor(4); |
390 |
|
dataletime[n][ii]->Draw("ap"); |
391 |
|
|
392 |
|
|
393 |
if((maxev-minev)>1000 && perc>10){ |
if((maxev-minev)>1000 && perc>10){ |
394 |
dataletime1[i][ii]= new TGraph(countbad[i],xbd,ybd); |
dataletime1[n][ii]= new TGraph(countbad[n],xbd,ybd); |
395 |
dataletime1[i][ii]->SetMarkerStyle(21); |
dataletime1[n][ii]->SetMarkerStyle(21); |
396 |
if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5); |
dataletime1[n][ii]->SetMarkerSize(0.1); |
397 |
else dataletime1[i][ii]->SetMarkerSize(0.1); |
dataletime1[n][ii]->SetMarkerColor(2); |
398 |
dataletime1[i][ii]->SetMarkerColor(2); |
dataletime1[n][ii]->Draw("psame"); |
399 |
dataletime1[i][ii]->Draw("psame"); |
} |
400 |
} |
else if((maxev-minev)<1000 && countbad[n]>=100){ |
401 |
else if((maxev-minev)<1000 && countbad[i]>=100){ |
dataletime1[n][ii]= new TGraph(countbad[n],xbd,ybd); |
402 |
dataletime1[i][ii]= new TGraph(countbad[i],xbd,ybd); |
dataletime1[n][ii]->SetMarkerStyle(21); |
403 |
dataletime1[i][ii]->SetMarkerStyle(21); |
if((maxev-minev)<50) dataletime1[n][ii]->SetMarkerSize(0.5); |
404 |
if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5); |
else dataletime1[n][ii]->SetMarkerSize(0.1); |
405 |
else dataletime1[i][ii]->SetMarkerSize(0.1); |
dataletime1[n][ii]->SetMarkerColor(2); |
406 |
dataletime1[i][ii]->SetMarkerColor(2); |
dataletime1[n][ii]->Draw("psame"); |
|
dataletime1[i][ii]->Draw("psame"); |
|
407 |
} |
} |
408 |
li.SetLineColor(1); |
li.SetLineColor(1); |
409 |
li.SetLineStyle(1); |
li.SetLineStyle(1); |