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 ){ |
123 |
const Int_t sizeH=neventH; |
const Int_t sizeH=neventH; |
124 |
const Int_t sizeC=neventC; |
const Int_t sizeC=neventC; |
125 |
Int_t count=0,trk_cal_us[sizeH],countrun=1; |
Int_t count=0,trk_cal_us[sizeH],countrun=1; |
126 |
Double_t perc=0,xMIN=0,xMAX=0; |
Float_t perc=0,xMIN=0,xMAX=0; |
127 |
ULong64_t HOBT[sizeH],COBT[sizeC]; |
ULong64_t HOBT[sizeH],COBT[sizeC]; |
128 |
|
|
129 |
for (Int_t vi=0; vi<sizeH;vi++){ |
for (Int_t vi=0; vi<sizeH;vi++){ |
149 |
countrun+=1; |
countrun+=1; |
150 |
// printf("\n%lld\t\tcountrun=%d\n",HOBT[ev],countrun); |
// printf("\n%lld\t\tcountrun=%d\n",HOBT[ev],countrun); |
151 |
} |
} |
152 |
countrun+=20; |
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++){ |
221 |
//*************************************************************************************** |
//*************************************************************************************** |
222 |
|
|
223 |
|
|
224 |
Double_t posy = 0.95; // up y-coord - top pads |
Float_t posy = 0.95; // up y-coord - top pads |
225 |
Double_t hpad = 0; // pad height |
Float_t hpad = 0; // pad height |
226 |
Double_t posx1=0; // left x-coord - pad column |
Float_t posx1=0; // left x-coord - pad column |
227 |
Double_t posx0=0; // x-coord - column division |
Float_t posx0=0; // x-coord - column division |
228 |
Double_t wrel = 0; // relative x size of first sub-column |
Float_t wrel = 0; // relative x size of first sub-column |
229 |
Double_t marg = 0.004; // margin among pads |
Float_t marg = 0.004; // margin among pads |
230 |
|
|
231 |
hpad = (posy-marg*11)/6; |
hpad = (posy-marg*11)/6; |
232 |
wrel = (1-marg*4)/2; |
wrel = (1-marg*4)/2; |
269 |
t2->SetTextSize(0.08); |
t2->SetTextSize(0.08); |
270 |
|
|
271 |
Int_t i=0; |
Int_t i=0; |
272 |
Double_t x[30000], xb[30000]; |
Float_t x[MAXSTORAGE], xb[MAXSTORAGE]; |
273 |
Double_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; |
332 |
|
|
333 |
for (Int_t i=0; i<12 ; i++){ |
for (Int_t i=0; i<12 ; i++){ |
334 |
|
|
335 |
Double_t y[maxev-minev],yb[maxev-minev]; |
Float_t y[maxev-minev],yb[maxev-minev]; |
336 |
for(Int_t v=0;v<maxev-minev;v++){ |
for(Int_t v=0;v<maxev-minev;v++){ |
337 |
y[v]=yyd[v][i]; |
y[v]=yyd[v][i]; |
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; |