2 |
* FTrkQLook_BASIC.cxx |
* FTrkQLook_BASIC.cxx |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version v1r06 |
* version v1r10 |
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 |
103 |
} else if (toevent > nevent) { |
} else if (toevent > nevent) { |
104 |
maxevent = nevent; |
maxevent = nevent; |
105 |
} else { |
} else { |
106 |
maxevent = toevent+1; |
maxevent = nevent; |
107 |
} |
} |
108 |
nevent=maxevent-minevent ; |
nevent=maxevent-minevent ; |
109 |
} |
} |
131 |
if((HOBT[ev]<HOBT[ev-1]) && ev>0) |
if((HOBT[ev]<HOBT[ev-1]) && ev>0) |
132 |
countnboot+=1; |
countnboot+=1; |
133 |
} |
} |
134 |
countnboot+=2*(Int_t)nevent/MAXSTORAGE; |
countnboot+=(Int_t)(2*nevent/MAXSTORAGE); |
135 |
// printf("\ncountnboot=%d\n",countnboot); |
// printf("\ncountnboot=%d\n",countnboot); |
136 |
|
|
137 |
// |
// |
296 |
x[(ev-minev)]= ph->GetOrbitalTime(); |
x[(ev-minev)]= ph->GetOrbitalTime(); |
297 |
i=0; |
i=0; |
298 |
|
|
299 |
for (Int_t n=0; n<12 ; n++){ |
for (Int_t n=0; n<12 ; n++){ |
300 |
yyb[countbad[n]][i]=0; |
i=te->DSPnumber[n]-1; |
301 |
xb[countbad[n]]= 0; |
if(i>=0){ |
302 |
|
if(i<12){ |
303 |
i=te->DSPnumber[n]-1; |
yyb[countbad[i]][i]=0; |
304 |
|
xb[countbad[i]]= 0; |
305 |
yyd[(ev-minev)][i]=te->DATAlength[n]; |
|
306 |
if(i==6){ |
yyd[(ev-minev)][i]=te->DATAlength[n]; |
307 |
if(yyd[(ev-minev)][i]>1500){ |
if(i==6){ |
308 |
if(yyd[(ev-minev)][i]<3075){ |
if(yyd[(ev-minev)][i]>1500){ |
309 |
yyb[countbad[i]][i]= yyd[(ev-minev)][i]; |
if(yyd[(ev-minev)][i]<3075){ |
310 |
xb[countbad[i]]= x[(ev-minev)]; |
yyb[countbad[i]][i]= yyd[(ev-minev)][i]; |
311 |
countbad[i]+=1; |
xb[countbad[i]]= x[(ev-minev)]; |
312 |
|
countbad[i]+=1; |
313 |
|
} |
314 |
|
} |
315 |
} |
} |
316 |
} |
else{ |
317 |
} |
if(yyd[(ev-minev)][i]>750){ |
318 |
else{ |
if(yyd[(ev-minev)][i]<3075){ |
319 |
if(yyd[(ev-minev)][i]>750){ |
yyb[countbad[i]][i]= yyd[(ev-minev)][i]; |
320 |
if(yyd[(ev-minev)][i]<3075){ |
xb[countbad[i]]= x[(ev-minev)]; |
321 |
yyb[countbad[i]][i]= yyd[(ev-minev)][i]; |
countbad[i]+=1; |
322 |
xb[countbad[i]]= x[(ev-minev)]; |
} |
323 |
countbad[i]+=1; |
} |
324 |
} |
} |
325 |
} |
} |
326 |
} |
} |
327 |
} |
} |
328 |
} |
} |
329 |
} |
} |
330 |
|
|
338 |
|
|
339 |
// |
// |
340 |
// Draw Histos |
// Draw Histos |
341 |
for (Int_t i=0; i<12 ; i++){ |
for (Int_t n=0; n<12 ; n++){ |
342 |
|
|
343 |
Double_t yd[maxev-minev],ybd[maxev-minev]; |
Double_t yd[maxev-minev],ybd[maxev-minev]; |
344 |
Double_t xd[maxev-minev],xbd[maxev-minev]; |
Double_t xd[maxev-minev],xbd[maxev-minev]; |
345 |
|
|
346 |
for(Int_t v=0;v<maxev-minev;v++){ |
for(Int_t v=0;v<maxev-minev;v++){ |
347 |
yd[v]=(Double_t)yyd[v][i]; |
yd[v]=(Double_t)yyd[v][n]; |
348 |
ybd[v]=(Double_t)yyb[v][i]; |
ybd[v]=(Double_t)yyb[v][n]; |
349 |
xd[v]=(Double_t)x[v]; |
xd[v]=(Double_t)x[v]; |
350 |
xbd[v]=(Double_t)xb[v]; |
xbd[v]=(Double_t)xb[v]; |
351 |
} |
} |
356 |
} |
} |
357 |
|
|
358 |
if((maxev-minev)>1000){ |
if((maxev-minev)>1000){ |
359 |
perc=(countbad[i]*100)/(maxev-minev); |
perc=(countbad[n]*100)/(maxev-minev); |
360 |
if(perc>10) pad[i][ii]->SetFillColor(2); |
if(perc>10) pad[n][ii]->SetFillColor(2); |
361 |
else pad[i][ii]->SetFillColor(10); |
else pad[n][ii]->SetFillColor(10); |
362 |
|
|
363 |
} |
} |
364 |
else{ |
else{ |
365 |
if(countbad[i]>=100) pad[i][ii]->SetFillColor(2); |
if(countbad[n]>=100) pad[n][ii]->SetFillColor(2); |
366 |
else pad[i][ii]->SetFillColor(10); |
else pad[n][ii]->SetFillColor(10); |
367 |
} |
} |
368 |
|
|
369 |
oss<<"DSP "<<i+1; |
oss<<"DSP "<<n+1; |
370 |
DataTimeCanv[ii]->cd(); |
DataTimeCanv[ii]->cd(); |
371 |
pad[i][ii]->SetFrameFillColor(10); |
pad[n][ii]->SetFrameFillColor(10); |
372 |
pad[i][ii]->Draw(); |
pad[n][ii]->Draw(); |
373 |
pad[i][ii]->cd(); |
pad[n][ii]->cd(); |
374 |
dataletime[i][ii]= new TGraph((maxev-minev),xd,yd); |
dataletime[n][ii]= new TGraph((maxev-minev),xd,yd); |
375 |
dataletime[i][ii]->SetTitle(oss.str().c_str()); |
if(maxev-minev==1) dataletime[n][ii]->GetXaxis()->SetNdivisions(-501); |
376 |
dataletime[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
dataletime[n][ii]->SetTitle(oss.str().c_str()); |
377 |
dataletime[i][ii]->GetXaxis()->CenterTitle(); |
dataletime[n][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
378 |
dataletime[i][ii]->GetXaxis()->SetRangeUser(xMIN,xMAX); |
dataletime[n][ii]->GetXaxis()->CenterTitle(); |
379 |
dataletime[i][ii]->GetYaxis()->SetTitle("datalength (Word 13 bit)"); |
dataletime[n][ii]->GetXaxis()->SetRangeUser(xMIN,xMAX); |
380 |
dataletime[i][ii]->GetYaxis()->CenterTitle(); |
dataletime[n][ii]->GetYaxis()->SetTitle("datalength (Word 13 bit)"); |
381 |
if(i==6) dataletime[i][ii]->GetYaxis()->SetRangeUser(0,4500); |
dataletime[n][ii]->GetYaxis()->CenterTitle(); |
382 |
else dataletime[i][ii]->GetYaxis()->SetRangeUser(0,4000); |
if(i==6) dataletime[n][ii]->GetYaxis()->SetRangeUser(0,4500); |
383 |
dataletime[i][ii]->SetMarkerStyle(21); |
else dataletime[n][ii]->GetYaxis()->SetRangeUser(0,4000); |
384 |
if((maxev-minev)<50) dataletime[i][ii]->SetMarkerSize(0.5); |
dataletime[n][ii]->SetMarkerStyle(21); |
385 |
else dataletime[i][ii]->SetMarkerSize(0.1); |
if((maxev-minev)<50) dataletime[n][ii]->SetMarkerSize(0.5); |
386 |
dataletime[i][ii]->SetMarkerColor(4); |
else dataletime[n][ii]->SetMarkerSize(0.1); |
387 |
dataletime[i][ii]->Draw("ap"); |
dataletime[n][ii]->SetMarkerColor(4); |
388 |
|
dataletime[n][ii]->Draw("ap"); |
389 |
|
|
390 |
|
|
391 |
if((maxev-minev)>1000 && perc>10){ |
if((maxev-minev)>1000 && perc>10){ |
392 |
dataletime1[i][ii]= new TGraph(countbad[i],xbd,ybd); |
dataletime1[n][ii]= new TGraph(countbad[n],xbd,ybd); |
393 |
dataletime1[i][ii]->SetMarkerStyle(21); |
dataletime1[n][ii]->SetMarkerStyle(21); |
394 |
if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5); |
dataletime1[n][ii]->SetMarkerSize(0.1); |
395 |
else dataletime1[i][ii]->SetMarkerSize(0.1); |
dataletime1[n][ii]->SetMarkerColor(2); |
396 |
dataletime1[i][ii]->SetMarkerColor(2); |
dataletime1[n][ii]->Draw("psame"); |
397 |
dataletime1[i][ii]->Draw("psame"); |
} |
398 |
} |
else if((maxev-minev)<1000 && countbad[n]>=100){ |
399 |
else if((maxev-minev)<1000 && countbad[i]>=100){ |
dataletime1[n][ii]= new TGraph(countbad[n],xbd,ybd); |
400 |
dataletime1[i][ii]= new TGraph(countbad[i],xbd,ybd); |
dataletime1[n][ii]->SetMarkerStyle(21); |
401 |
dataletime1[i][ii]->SetMarkerStyle(21); |
if((maxev-minev)<50) dataletime1[n][ii]->SetMarkerSize(0.5); |
402 |
if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5); |
else dataletime1[n][ii]->SetMarkerSize(0.1); |
403 |
else dataletime1[i][ii]->SetMarkerSize(0.1); |
dataletime1[n][ii]->SetMarkerColor(2); |
404 |
dataletime1[i][ii]->SetMarkerColor(2); |
dataletime1[n][ii]->Draw("psame"); |
|
dataletime1[i][ii]->Draw("psame"); |
|
405 |
} |
} |
406 |
li.SetLineColor(1); |
li.SetLineColor(1); |
407 |
li.SetLineStyle(1); |
li.SetLineStyle(1); |