25 |
#include <EventHeader.h> |
#include <EventHeader.h> |
26 |
#include <RunHeaderEvent.h> |
#include <RunHeaderEvent.h> |
27 |
// |
// |
28 |
|
#define MAXSTORAGE 50000 |
29 |
|
|
30 |
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){ |
31 |
if ( to == 0 ){ |
if ( to == 0 ){ |
150 |
// printf("\n%lld\t\tcountrun=%d\n",HOBT[ev],countrun); |
// printf("\n%lld\t\tcountrun=%d\n",HOBT[ev],countrun); |
151 |
} |
} |
152 |
countrun+=(Int_t)nevent/30000; |
countrun+=(Int_t)nevent/30000; |
153 |
printf("\ncountrun=%d\n",countrun); |
// printf("\ncountrun=%d\n",countrun); |
154 |
|
|
155 |
// |
// |
156 |
// information about calibration OBT |
// information about calibration OBT |
157 |
for (Int_t ev=0; ev<neventC; ev++){ |
for (Int_t ev=0; ev<neventC; ev++){ |
269 |
t2->SetTextSize(0.08); |
t2->SetTextSize(0.08); |
270 |
|
|
271 |
Int_t i=0; |
Int_t i=0; |
272 |
Float_t x[30000], xb[30000]; |
Float_t x[MAXSTORAGE], xb[MAXSTORAGE]; |
273 |
Float_t yyd[30000][12],yyb[30000][12]; |
Float_t yyd[MAXSTORAGE][12],yyb[MAXSTORAGE][12]; |
274 |
for (Int_t ev=minev; ev<maxevent; ev++){ |
for (Int_t ev=minev; ev<maxevent; ev++){ |
275 |
tr->GetEntry(ev); |
tr->GetEntry(ev); |
276 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
277 |
|
|
278 |
if(ev==maxevent-1) maxev=maxevent-1; |
if(ev==maxevent-1) maxev=maxevent-1; |
279 |
// printf("prova00\n"); |
if((ph->GetOrbitalTime()<x[ev-minev-1]&&ev-minev!=0) || ev-minev==MAXSTORAGE){ |
|
if((ph->GetOrbitalTime()<x[ev-minev-1]&&ev-minev!=0) || ev-minev==30000){ |
|
280 |
maxev=ev; |
maxev=ev; |
|
// printf("prova12\n"); |
|
281 |
break; |
break; |
282 |
} |
} |
283 |
else{ |
else{ |
284 |
x[(ev-minev)]= ph->GetOrbitalTime(); |
x[(ev-minev)]= ph->GetOrbitalTime(); |
285 |
i=0; |
i=0; |
286 |
|
|
|
// printf("prova0 %d\n ",ev); |
|
287 |
for (Int_t n=0; n<12 ; n++){ |
for (Int_t n=0; n<12 ; n++){ |
288 |
perc=0; |
perc=0; |
289 |
count=0; |
count=0; |
315 |
} |
} |
316 |
} |
} |
317 |
|
|
|
// printf("prova2\n"); |
|
318 |
if(ii==0 && COBT[0]<x[0]){ |
if(ii==0 && COBT[0]<x[0]){ |
319 |
// printf("\n%f-(%f-%lld) div 10 \n",x[0],x[maxev-minev-1],COBT[0]); |
// printf("\n%f-(%f-%lld) div 10 \n",x[0],x[maxev-minev-1],COBT[0]); |
320 |
xMIN=x[0]-(x[maxev-minev-1]-COBT[0])/10; |
xMIN=x[0]-(x[maxev-minev-1]-COBT[0])/10; |
338 |
yb[v]=yyb[v][i]; |
yb[v]=yyb[v][i]; |
339 |
} |
} |
340 |
|
|
|
// printf("prova3\n"); |
|
341 |
if((maxev-minev)>1000){ |
if((maxev-minev)>1000){ |
342 |
perc=(count*100)/(maxev-minev); |
perc=(count*100)/(maxev-minev); |
343 |
if(perc>10) pad[i][ii]->SetFillColor(2); |
if(perc>10) pad[i][ii]->SetFillColor(2); |
354 |
pad[i][ii]->Draw(); |
pad[i][ii]->Draw(); |
355 |
pad[i][ii]->cd(); |
pad[i][ii]->cd(); |
356 |
dataletime[i][ii]= new TGraph((maxev-minev),x,y); |
dataletime[i][ii]= new TGraph((maxev-minev),x,y); |
|
// printf("\nentries nel graph= %d\n",maxev-minev); |
|
357 |
dataletime[i][ii]->SetTitle(oss.str().c_str()); |
dataletime[i][ii]->SetTitle(oss.str().c_str()); |
358 |
dataletime[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
dataletime[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
359 |
dataletime[i][ii]->GetXaxis()->CenterTitle(); |
dataletime[i][ii]->GetXaxis()->CenterTitle(); |
|
// dataletime[i][ii]->GetXaxis()->SetRangeUser(min,max); |
|
360 |
dataletime[i][ii]->GetXaxis()->SetRangeUser(xMIN,xMAX); |
dataletime[i][ii]->GetXaxis()->SetRangeUser(xMIN,xMAX); |
361 |
dataletime[i][ii]->GetYaxis()->SetTitle("datalength (Word 13 bit)"); |
dataletime[i][ii]->GetYaxis()->SetTitle("datalength (Word 13 bit)"); |
362 |
dataletime[i][ii]->GetYaxis()->CenterTitle(); |
dataletime[i][ii]->GetYaxis()->CenterTitle(); |
368 |
dataletime[i][ii]->SetMarkerColor(4); |
dataletime[i][ii]->SetMarkerColor(4); |
369 |
dataletime[i][ii]->Draw("ap"); |
dataletime[i][ii]->Draw("ap"); |
370 |
|
|
|
// printf("prova4\n"); |
|
371 |
|
|
372 |
if((maxev-minev)>1000 && perc>10){ |
if((maxev-minev)>1000 && perc>10){ |
373 |
dataletime1[i][ii]= new TGraph(count,xb,yb); |
dataletime1[i][ii]= new TGraph(count,xb,yb); |
388 |
li.SetLineColor(1); |
li.SetLineColor(1); |
389 |
li.SetLineStyle(1); |
li.SetLineStyle(1); |
390 |
li.SetLineWidth(1); |
li.SetLineWidth(1); |
|
// if(i!=6) li.DrawLine(min,750,max,750); |
|
|
// else li.DrawLine(min,1500,max,1500); |
|
|
// li.DrawLine(min,3075,max,3075); |
|
391 |
if(i!=6) li.DrawLine(xMIN,750,xMAX,750); |
if(i!=6) li.DrawLine(xMIN,750,xMAX,750); |
392 |
else li.DrawLine(xMIN,1500,xMAX,1500); |
else li.DrawLine(xMIN,1500,xMAX,1500); |
393 |
li.DrawLine(xMIN,3075,xMAX,3075); |
li.DrawLine(xMIN,3075,xMAX,3075); |
421 |
} |
} |
422 |
} |
} |
423 |
} |
} |
|
// if(ii==0){ |
|
|
// if(i==6) ar.DrawArrow(COBT[0],1700.,COBT[0],2700.,0.01,"<"); |
|
|
// else ar.DrawArrow(COBT[0],1000.,COBT[0],2000.,0.01,"<"); |
|
|
// } |
|
424 |
for(Int_t j=countCOBT;j<neventC;j++){ |
for(Int_t j=countCOBT;j<neventC;j++){ |
425 |
if(COBT[j]<COBT[j-1] && j!=countCOBT || COBT[j]>x[maxev-minev-1]){ |
if(COBT[j]<COBT[j-1] && j!=countCOBT || COBT[j]>x[maxev-minev-1]){ |
426 |
if(i==11) countCOBT=j; |
if(i==11) countCOBT=j; |
439 |
} |
} |
440 |
|
|
441 |
minev=maxev; |
minev=maxev; |
442 |
printf("\ncountrun=%d\n",ii); |
// printf("\ncountrun=%d\n",ii); |
443 |
if(maxev==maxevent-1) { |
if(maxev==maxevent-1) { |
444 |
countrun=ii+1; |
countrun=ii+1; |
445 |
break; |
break; |