1 |
/** |
/** |
2 |
* FTrkQLook_BASIC.cpp |
* FTrkQLook_BASIC.cxx |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version 2.0 |
* version v1r05 |
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 |
17 |
#include <TCanvas.h> |
#include <TCanvas.h> |
18 |
#include <TGraph.h> |
#include <TGraph.h> |
19 |
#include <TStyle.h> |
#include <TStyle.h> |
20 |
|
#include <TFile.h> |
21 |
#include <TTree.h> |
#include <TTree.h> |
22 |
#include <TArrow.h> |
#include <TArrow.h> |
23 |
// |
// |
25 |
#include <PscuHeader.h> |
#include <PscuHeader.h> |
26 |
#include <EventHeader.h> |
#include <EventHeader.h> |
27 |
#include <RunHeaderEvent.h> |
#include <RunHeaderEvent.h> |
28 |
|
#include <EventCounter.h> |
29 |
|
#include <PacketType.h> |
30 |
// |
// |
31 |
|
#define MAXSTORAGE 50000 |
|
void stringcopy(TString& s1, const TString& s2, Int_t from=0, Int_t to=0){ |
|
|
if ( to == 0 ){ |
|
|
Int_t t2length = s2.Length(); |
|
|
s1 = ""; |
|
|
to = t2length; |
|
|
}; |
|
|
for (Int_t i = from; i<to; i++){ |
|
|
s1.Append(s2[i],1); |
|
|
}; |
|
|
}; |
|
|
|
|
32 |
|
|
33 |
void FTrkQLook_BASIC(TString file,Int_t fromevent,Int_t toevent, TString outdir,TString outfile) |
void FTrkQLook_BASIC(TString file,Int_t fromevent,Int_t toevent, TString outdir,TString outfile) |
34 |
{ |
{ |
35 |
// |
// |
36 |
// obtain information about the data file and select the output dir |
// obtain information about the data file and select the output dir |
37 |
const string filepath=file.Data(); |
Int_t dwpos = file.Last('/'); |
38 |
Int_t dwpos = filepath.rfind("/"); |
Int_t dwpos1 = file.Last('.'); |
|
Int_t dwpos1 = filepath.find(".root"); |
|
|
TString fpath=(filepath.c_str()); |
|
39 |
TString base,ffile ; |
TString base,ffile ; |
40 |
stringcopy(ffile,fpath,dwpos+1,dwpos1); |
ffile=file(dwpos+1,dwpos1-(dwpos+1)); |
41 |
stringcopy(base,fpath,0,dwpos); |
if(dwpos>0) base=file(0,dwpos); |
|
if(dwpos>0) base+="/"; |
|
42 |
|
|
43 |
TString out; |
TString out; |
44 |
if(outdir.Length()==0){ |
if(outdir.Length()==0){ |
46 |
}else{ |
}else{ |
47 |
out = outdir; |
out = outdir; |
48 |
} |
} |
49 |
|
if(out.Last('/')+1<out.Length()) out+="/"; |
50 |
|
|
51 |
// |
// |
52 |
// inizialise the variables and open the file |
// inizialise the variables and open the file |
54 |
pamela::EventHeader *eh=0,*eH=0,*ceh=0; |
pamela::EventHeader *eh=0,*eH=0,*ceh=0; |
55 |
pamela::RunHeaderEvent *reh=0; |
pamela::RunHeaderEvent *reh=0; |
56 |
pamela::PscuHeader *ph=0,*pH=0; |
pamela::PscuHeader *ph=0,*pH=0; |
57 |
|
pamela::EventCounter *cod=0; |
58 |
|
|
59 |
|
pamela::PacketType *pctp=0; |
60 |
|
|
61 |
TFile *datafile = new TFile(file); |
TFile *datafile = new TFile(file); |
62 |
TTree *otr = (TTree*)datafile->Get("RunHeader"); |
TTree *otr = (TTree*)datafile->Get("RunHeader"); |
67 |
tr->SetBranchAddress("Header",&eh); |
tr->SetBranchAddress("Header",&eh); |
68 |
TTree *ctr = (TTree*)datafile->Get("CalibTrk1"); |
TTree *ctr = (TTree*)datafile->Get("CalibTrk1"); |
69 |
ctr->SetBranchAddress("Header",&ceh); |
ctr->SetBranchAddress("Header",&ceh); |
|
|
|
70 |
|
|
71 |
Long64_t neventC = ctr->GetEntries(); |
Long64_t neventC = ctr->GetEntries(); |
72 |
Long64_t nevent = tr->GetEntries(); |
Long64_t nevent = tr->GetEntries(); |
111 |
// |
// |
112 |
// other variables definitions |
// other variables definitions |
113 |
stringstream oss,fromfile,isfile; |
stringstream oss,fromfile,isfile; |
114 |
const Int_t sizeH=neventH; |
// |
115 |
const Int_t sizeC=neventC; |
// information about the RunHeader |
116 |
Int_t count=0,trk_cal_us[sizeH],countrun=1; |
Int_t HOBT[neventH]; |
117 |
Double_t perc=0,xMIN=0,xMAX=0; |
Int_t trk_cal_us[neventH]; |
118 |
ULong64_t HOBT[sizeH],COBT[sizeC]; |
for (Int_t vi=0; vi<neventH;vi++){ |
|
|
|
|
for (Int_t vi=0; vi<sizeH;vi++){ |
|
119 |
HOBT[vi]=0; |
HOBT[vi]=0; |
120 |
trk_cal_us[vi]=0; |
trk_cal_us[vi]=0; |
121 |
} |
} |
122 |
for (Int_t vi=0; vi<sizeC;vi++){ |
|
|
COBT[vi]=0; |
|
|
} |
|
|
|
|
|
//*************************************************************************************** |
|
|
// LOOP on each event |
|
|
//*************************************************************************************** |
|
|
|
|
123 |
// |
// |
124 |
// information about trk_calib_used |
// information about RunHeader |
125 |
|
Int_t countnboot=1; |
126 |
for (Int_t ev=0; ev<neventH; ev++){ |
for (Int_t ev=0; ev<neventH; ev++){ |
127 |
otr->GetEntry(ev); |
otr->GetEntry(ev); |
128 |
pH = eH->GetPscuHeader(); |
pH = eH->GetPscuHeader(); |
129 |
HOBT[ev]= pH->GetOrbitalTime(); |
HOBT[ev]= pH->GetOrbitalTime(); |
130 |
trk_cal_us[ev]=reh->TRK_CALIB_USED; |
trk_cal_us[ev]=reh->TRK_CALIB_USED; |
131 |
if((HOBT[ev]<HOBT[ev-1]) && ev>0) |
if((HOBT[ev]<HOBT[ev-1]) && ev>0) |
132 |
countrun+=1; |
countnboot+=1; |
|
// printf("\n%lld\t\tcountrun=%d\n",HOBT[ev],countrun); |
|
133 |
} |
} |
134 |
countrun+=20; |
countnboot+=2*(Int_t)nevent/MAXSTORAGE; |
135 |
printf("\ncountrun=%d\n",countrun); |
// printf("\ncountnboot=%d\n",countnboot); |
136 |
|
|
137 |
// |
// |
138 |
// information about calibration OBT |
// information about calibration OBT |
139 |
|
Int_t COBT[neventC]; |
140 |
|
for (Int_t vi=0; vi<neventC;vi++){ |
141 |
|
COBT[vi]=0; |
142 |
|
} |
143 |
for (Int_t ev=0; ev<neventC; ev++){ |
for (Int_t ev=0; ev<neventC; ev++){ |
144 |
ctr->GetEntry(ev); |
ctr->GetEntry(ev); |
145 |
pH = ceh->GetPscuHeader(); |
pH = ceh->GetPscuHeader(); |
146 |
COBT[ev]= pH->GetOrbitalTime(); |
COBT[ev]= pH->GetOrbitalTime(); |
147 |
} |
} |
148 |
|
|
149 |
//**************************************************************************************** |
// |
150 |
//Output figure |
// Style options |
|
//**************************************************************************************** |
|
151 |
gStyle->SetLabelSize(0.06,"x"); |
gStyle->SetLabelSize(0.06,"x"); |
152 |
gStyle->SetLabelSize(0.06,"y"); |
gStyle->SetLabelSize(0.06,"y"); |
153 |
gStyle->SetStatFontSize(0.075); |
gStyle->SetStatFontSize(0.075); |
160 |
gStyle->SetTitleSize(0.06,"y"); |
gStyle->SetTitleSize(0.06,"y"); |
161 |
gStyle->SetTitleSize(0.055,"x"); |
gStyle->SetTitleSize(0.055,"x"); |
162 |
|
|
163 |
|
//*************************************************************************************** |
164 |
|
// LOOP on each event |
165 |
|
//*************************************************************************************** |
166 |
|
|
167 |
|
if (fromevent!=0) |
168 |
|
printf("\n Scan of events from %i to %i ... \n",minevent,maxevent-1); |
169 |
|
else |
170 |
|
printf("\n Scan of events from %i to %i ... \n",minevent+1,maxevent); |
171 |
|
|
172 |
|
|
173 |
Int_t minev=minevent,maxev=maxevent,countHOBT=0,countCOBT=0; |
Int_t minev=minevent,maxev=maxevent,hin=0,hfin=0,cin=0,cfin=0; |
174 |
TPad *pad[12][countrun] ; //pad for histos |
TPad *pad[12][countnboot]; |
175 |
TGraph *dataletime[12][countrun],*dataletime1[12][countrun]; |
TGraph *dataletime[12][countnboot],*dataletime1[12][countnboot]; |
176 |
TCanvas *DataTimeCanv[countrun]; |
TCanvas *DataTimeCanv[countnboot]; |
177 |
for(Int_t ii=0; ii<countrun;ii++){ |
for(Int_t ii=0; ii<countnboot;ii++){ |
178 |
fromfile<<"FTrkQLook_BASIC File: "<<ffile; |
fromfile<<"FTrkQLook_BASIC File: "<<ffile; |
179 |
isfile<<"DATALENGTH vs. OBT pag"<<ii+1; |
isfile<<"DATALENGTH vs. OBT pag"<<ii+1; |
180 |
DataTimeCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
DataTimeCanv[ii]=new TCanvas(isfile.str().c_str(),isfile.str().c_str(),900,1200); |
207 |
isfile.str(""); |
isfile.str(""); |
208 |
|
|
209 |
fromfile<<"The green arrow (if present) points out the time of the online calibration"; |
fromfile<<"The green arrow (if present) points out the time of the online calibration"; |
210 |
t->DrawLatex(10.,96.,fromfile.str().c_str()); |
t->DrawLatex(7.,96.,fromfile.str().c_str()); |
211 |
fromfile.str(""); |
fromfile.str(""); |
212 |
|
|
213 |
//************************************************************************************* |
//************************************************************************************* |
215 |
//*************************************************************************************** |
//*************************************************************************************** |
216 |
|
|
217 |
|
|
218 |
Double_t posy = 0.95; // up y-coord - top pads |
Float_t posy = 0.95; // up y-coord - top pads |
219 |
Double_t hpad = 0; // pad height |
Float_t hpad = 0; // pad height |
220 |
Double_t posx1=0; // left x-coord - pad column |
Float_t posx1=0; // left x-coord - pad column |
221 |
Double_t posx0=0; // x-coord - column division |
Float_t posx0=0; // x-coord - column division |
222 |
Double_t wrel = 0; // relative x size of first sub-column |
Float_t wrel = 0; // relative x size of first sub-column |
223 |
Double_t marg = 0.004; // margin among pads |
Float_t marg = 0.004; // margin among pads |
224 |
|
|
225 |
hpad = (posy-marg*11)/6; |
hpad = (posy-marg*11)/6; |
226 |
wrel = (1-marg*4)/2; |
wrel = (1-marg*4)/2; |
251 |
|
|
252 |
TArrow ar; |
TArrow ar; |
253 |
ar.SetLineColor(3); |
ar.SetLineColor(3); |
|
//********************************************************************************** |
|
|
// Fill Graphs and Histos |
|
|
//********************************************************************************** |
|
254 |
stringstream calus; |
stringstream calus; |
255 |
|
|
256 |
TLatex *t2=new TLatex(); |
TLatex *t2=new TLatex(); |
260 |
t2->SetTextSize(0.08); |
t2->SetTextSize(0.08); |
261 |
|
|
262 |
Int_t i=0; |
Int_t i=0; |
263 |
Double_t x[30000], xb[30000]; |
Float_t x[MAXSTORAGE], xb[MAXSTORAGE]; |
264 |
Double_t yyd[30000][12],yyb[30000][12]; |
Float_t yyd[MAXSTORAGE][12],yyb[MAXSTORAGE][12]; |
265 |
|
Int_t countbad[12]; |
266 |
|
Float_t perc=0,xMIN=0.,xMAX=0.; |
267 |
|
for (Int_t n=0; n<12 ; n++) |
268 |
|
countbad[n]=0; |
269 |
|
|
270 |
|
// |
271 |
|
// obtain values of the datalenght |
272 |
for (Int_t ev=minev; ev<maxevent; ev++){ |
for (Int_t ev=minev; ev<maxevent; ev++){ |
273 |
tr->GetEntry(ev); |
tr->GetEntry(ev); |
274 |
ph = eh->GetPscuHeader(); |
ph = eh->GetPscuHeader(); |
275 |
|
cod = eh->GetCounter(); |
276 |
|
|
277 |
|
if(ev==minev){ |
278 |
|
if(cod->Get(pctp->CalibTrk1)>0) cin=cod->Get(pctp->CalibTrk1)-1; |
279 |
|
else cin=cod->Get(pctp->CalibTrk1); |
280 |
|
if(cin==cfin-1) cin+=1; |
281 |
|
|
282 |
|
if(cod->Get(pctp->RunHeader)>0) hin=cod->Get(pctp->RunHeader)-1; |
283 |
|
else hin=cod->Get(pctp->RunHeader); |
284 |
|
if(hin==hfin-1) hin+=1; |
285 |
|
} |
286 |
|
|
287 |
if(ev==maxevent-1) maxev=maxevent-1; |
if(ev==maxevent-1) maxev=maxevent-1; |
288 |
// printf("prova00\n"); |
|
289 |
if((ph->GetOrbitalTime()<x[ev-minev-1]&&ev-minev!=0) || ev-minev>30000){ |
if((ph->GetOrbitalTime()<x[ev-minev-1] && ev-minev!=0) || ev-minev==MAXSTORAGE){ |
290 |
maxev=ev; |
maxev=ev; |
|
// printf("prova12\n"); |
|
291 |
break; |
break; |
292 |
} |
} |
293 |
else{ |
else{ |
294 |
|
cfin=cod->Get(pctp->CalibTrk1); |
295 |
|
hfin=cod->Get(pctp->RunHeader); |
296 |
x[(ev-minev)]= ph->GetOrbitalTime(); |
x[(ev-minev)]= ph->GetOrbitalTime(); |
297 |
i=0; |
i=0; |
298 |
|
|
|
// printf("prova0 %d\n ",ev); |
|
299 |
for (Int_t n=0; n<12 ; n++){ |
for (Int_t n=0; n<12 ; n++){ |
300 |
perc=0; |
yyb[countbad[n]][i]=0; |
301 |
count=0; |
xb[countbad[n]]= 0; |
|
yyb[count][i]=0; |
|
|
xb[count]= 0; |
|
302 |
|
|
303 |
i=te->DSPnumber[n]-1; |
i=te->DSPnumber[n]-1; |
304 |
|
|
306 |
if(i==6){ |
if(i==6){ |
307 |
if(yyd[(ev-minev)][i]>1500){ |
if(yyd[(ev-minev)][i]>1500){ |
308 |
if(yyd[(ev-minev)][i]<3075){ |
if(yyd[(ev-minev)][i]<3075){ |
309 |
yyb[count][i]= yyd[(ev-minev)][i]; |
yyb[countbad[i]][i]= yyd[(ev-minev)][i]; |
310 |
xb[count]= x[(ev-minev)]; |
xb[countbad[i]]= x[(ev-minev)]; |
311 |
count++; |
countbad[i]+=1; |
312 |
} |
} |
313 |
} |
} |
314 |
} |
} |
315 |
else{ |
else{ |
316 |
if(yyd[(ev-minev)][i]>750){ |
if(yyd[(ev-minev)][i]>750){ |
317 |
if(yyd[(ev-minev)][i]<3075){ |
if(yyd[(ev-minev)][i]<3075){ |
318 |
yyb[count][i]= yyd[(ev-minev)][i]; |
yyb[countbad[i]][i]= yyd[(ev-minev)][i]; |
319 |
xb[count]= x[(ev-minev)]; |
xb[countbad[i]]= x[(ev-minev)]; |
320 |
count++; |
countbad[i]+=1; |
321 |
} |
} |
322 |
} |
} |
323 |
} |
} |
324 |
} |
} |
325 |
} |
} |
326 |
} |
} |
|
|
|
|
// printf("prova2\n"); |
|
|
if(ii==0 && COBT[0]<x[0]){ |
|
|
// printf("\n%f-(%f-%lld) div 10 \n",x[0],x[maxev-minev-1],COBT[0]); |
|
|
xMIN=x[0]-(x[maxev-minev-1]-COBT[0])/10; |
|
|
xMAX=x[maxev-minev-1]+(x[maxev-minev-1]-COBT[0])/10; |
|
|
// printf("\nxMIN=%f\txMAX=%f\n",xMIN,xMAX); |
|
|
} |
|
|
else{ |
|
|
// printf("\n%f\t%f \n",x[0],x[maxev-minev-1]); |
|
|
xMIN=x[0]-(x[maxev-minev-1]-x[0])/10; |
|
|
xMAX=x[maxev-minev-1]+(x[maxev-minev-1]-x[0])/10; |
|
|
// printf("\nxMIN=%f\txMAX=%f\n",xMIN,xMAX); |
|
|
if(xMIN<0) xMIN=0; |
|
|
} |
|
327 |
|
|
328 |
|
// |
329 |
|
// define limit for the Xaxis of the graphs |
330 |
|
|
331 |
|
xMAX=x[maxev-minev-1]+(x[maxev-minev-1]-x[0])/10; |
332 |
|
if(xMAX>1000000) xMIN=x[0]-(x[maxev-minev-1]-x[0])/10; |
333 |
|
if(xMAX<1000000 || xMIN<0) xMIN=0.; |
334 |
|
|
335 |
|
|
336 |
|
// |
337 |
|
// Draw Histos |
338 |
for (Int_t i=0; i<12 ; i++){ |
for (Int_t i=0; i<12 ; i++){ |
339 |
|
|
340 |
Double_t y[maxev-minev],yb[maxev-minev]; |
Float_t y[maxev-minev],yb[maxev-minev]; |
341 |
for(Int_t v=0;v<maxev-minev;v++){ |
for(Int_t v=0;v<maxev-minev;v++){ |
342 |
y[v]=yyd[v][i]; |
y[v]=yyd[v][i]; |
343 |
yb[v]=yyb[v][i]; |
yb[v]=yyb[v][i]; |
344 |
} |
} |
345 |
|
|
346 |
// printf("prova3\n"); |
if(xMAX<1000000){ |
347 |
|
x[maxev-minev-1]=0.; |
348 |
|
y[maxev-minev-1]=0.; |
349 |
|
} |
350 |
|
|
351 |
if((maxev-minev)>1000){ |
if((maxev-minev)>1000){ |
352 |
perc=(count*100)/(maxev-minev); |
perc=(countbad[i]*100)/(maxev-minev); |
353 |
if(perc>10) pad[i][ii]->SetFillColor(2); |
if(perc>10) pad[i][ii]->SetFillColor(2); |
354 |
else pad[i][ii]->SetFillColor(10); |
else pad[i][ii]->SetFillColor(10); |
355 |
} |
} |
356 |
else{ |
else{ |
357 |
if(count>=100) pad[i][ii]->SetFillColor(2); |
if(countbad[i]>=100) pad[i][ii]->SetFillColor(2); |
358 |
else pad[i][ii]->SetFillColor(10); |
else pad[i][ii]->SetFillColor(10); |
359 |
} |
} |
360 |
|
|
364 |
pad[i][ii]->Draw(); |
pad[i][ii]->Draw(); |
365 |
pad[i][ii]->cd(); |
pad[i][ii]->cd(); |
366 |
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); |
|
367 |
dataletime[i][ii]->SetTitle(oss.str().c_str()); |
dataletime[i][ii]->SetTitle(oss.str().c_str()); |
368 |
dataletime[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
dataletime[i][ii]->GetXaxis()->SetTitle("OBT (ms)"); |
369 |
dataletime[i][ii]->GetXaxis()->CenterTitle(); |
dataletime[i][ii]->GetXaxis()->CenterTitle(); |
|
// dataletime[i][ii]->GetXaxis()->SetRangeUser(min,max); |
|
370 |
dataletime[i][ii]->GetXaxis()->SetRangeUser(xMIN,xMAX); |
dataletime[i][ii]->GetXaxis()->SetRangeUser(xMIN,xMAX); |
371 |
dataletime[i][ii]->GetYaxis()->SetTitle("datalength (Word 13 bit)"); |
dataletime[i][ii]->GetYaxis()->SetTitle("datalength (Word 13 bit)"); |
372 |
dataletime[i][ii]->GetYaxis()->CenterTitle(); |
dataletime[i][ii]->GetYaxis()->CenterTitle(); |
373 |
if(i==6) dataletime[i][ii]->GetYaxis()->SetRangeUser(0,4500); |
if(i==6) dataletime[i][ii]->GetYaxis()->SetRangeUser(0,4500); |
374 |
else dataletime[i][ii]->GetYaxis()->SetRangeUser(0,3500); |
else dataletime[i][ii]->GetYaxis()->SetRangeUser(0,4000); |
375 |
dataletime[i][ii]->SetMarkerStyle(21); |
dataletime[i][ii]->SetMarkerStyle(21); |
376 |
if((maxev-minev)<50) dataletime[i][ii]->SetMarkerSize(0.5); |
if((maxev-minev)<50) dataletime[i][ii]->SetMarkerSize(0.5); |
377 |
else dataletime[i][ii]->SetMarkerSize(0.3); |
else dataletime[i][ii]->SetMarkerSize(0.1); |
378 |
dataletime[i][ii]->SetMarkerColor(4); |
dataletime[i][ii]->SetMarkerColor(4); |
379 |
dataletime[i][ii]->Draw("ap"); |
dataletime[i][ii]->Draw("ap"); |
380 |
|
|
|
// printf("prova4\n"); |
|
381 |
|
|
382 |
if((maxev-minev)>1000 && perc>10){ |
if((maxev-minev)>1000 && perc>10){ |
383 |
dataletime1[i][ii]= new TGraph(count,xb,yb); |
dataletime1[i][ii]= new TGraph(countbad[i],xb,yb); |
384 |
dataletime1[i][ii]->SetMarkerStyle(21); |
dataletime1[i][ii]->SetMarkerStyle(21); |
385 |
if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5); |
if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5); |
386 |
else dataletime1[i][ii]->SetMarkerSize(0.3); |
else dataletime1[i][ii]->SetMarkerSize(0.1); |
387 |
dataletime1[i][ii]->SetMarkerColor(2); |
dataletime1[i][ii]->SetMarkerColor(2); |
388 |
dataletime1[i][ii]->Draw("psame"); |
dataletime1[i][ii]->Draw("psame"); |
389 |
} |
} |
390 |
else if((maxev-minev)<1000 && count>=100){ |
else if((maxev-minev)<1000 && countbad[i]>=100){ |
391 |
dataletime1[i][ii]= new TGraph(count,xb,yb); |
dataletime1[i][ii]= new TGraph(countbad[i],xb,yb); |
392 |
dataletime1[i][ii]->SetMarkerStyle(21); |
dataletime1[i][ii]->SetMarkerStyle(21); |
393 |
if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5); |
if((maxev-minev)<50) dataletime1[i][ii]->SetMarkerSize(0.5); |
394 |
else dataletime1[i][ii]->SetMarkerSize(0.3); |
else dataletime1[i][ii]->SetMarkerSize(0.1); |
395 |
dataletime1[i][ii]->SetMarkerColor(2); |
dataletime1[i][ii]->SetMarkerColor(2); |
396 |
dataletime1[i][ii]->Draw("psame"); |
dataletime1[i][ii]->Draw("psame"); |
397 |
} |
} |
398 |
li.SetLineColor(1); |
li.SetLineColor(1); |
399 |
li.SetLineStyle(1); |
li.SetLineStyle(1); |
400 |
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); |
|
401 |
if(i!=6) li.DrawLine(xMIN,750,xMAX,750); |
if(i!=6) li.DrawLine(xMIN,750,xMAX,750); |
402 |
else li.DrawLine(xMIN,1500,xMAX,1500); |
else li.DrawLine(xMIN,1500,xMAX,1500); |
403 |
li.DrawLine(xMIN,3075,xMAX,3075); |
li.DrawLine(xMIN,3075,xMAX,3075); |
405 |
li.SetLineColor(12); |
li.SetLineColor(12); |
406 |
li.SetLineStyle(4); |
li.SetLineStyle(4); |
407 |
li.SetLineWidth(1); |
li.SetLineWidth(1); |
408 |
for(Int_t j=countHOBT;j<neventH;j++){ |
for(Int_t j=hin;j<hfin;j++){ |
409 |
if(HOBT[j]<HOBT[j-1] && j!=countHOBT || HOBT[j]>x[maxev-minev-1]){ |
if(i==6) li.DrawLine(HOBT[j],0.,HOBT[j],4500.); |
410 |
if(i==11) countHOBT=j; |
else li.DrawLine(HOBT[j],0.,HOBT[j],4000.); |
411 |
break; |
if(trk_cal_us[j]==104){ |
412 |
} |
calus<<"D"; |
413 |
|
t2->SetTextColor(6); |
414 |
|
if(i==6) t2->DrawLatex(HOBT[j],4350.,calus.str().c_str()); |
415 |
|
else t2->DrawLatex(HOBT[j],3850.,calus.str().c_str()); |
416 |
|
calus.str(""); |
417 |
|
} |
418 |
else{ |
else{ |
419 |
if( HOBT[j]>xMIN && HOBT[j]<x[maxev-minev-1]){ |
calus<<"O"; |
420 |
if(i==6) li.DrawLine(HOBT[j],0.,HOBT[j],4500.); |
t2->SetTextColor(3); |
421 |
else li.DrawLine(HOBT[j],0.,HOBT[j],3500.); |
if(i==6) t2->DrawLatex(HOBT[j],4350.,calus.str().c_str()); |
422 |
if(trk_cal_us[j]==104){ |
else t2->DrawLatex(HOBT[j],3850.,calus.str().c_str()); |
423 |
calus<<"D"; |
calus.str(""); |
|
t2->SetTextColor(6); |
|
|
if(i==6) t2->DrawLatex(HOBT[j],4350.,calus.str().c_str()); |
|
|
else t2->DrawLatex(HOBT[j],3350.,calus.str().c_str()); |
|
|
calus.str(""); |
|
|
} |
|
|
else{ |
|
|
calus<<"O"; |
|
|
t2->SetTextColor(3); |
|
|
if(i==6) t2->DrawLatex(HOBT[j],4350.,calus.str().c_str()); |
|
|
else t2->DrawLatex(HOBT[j],3350.,calus.str().c_str()); |
|
|
calus.str(""); |
|
|
} |
|
|
} |
|
424 |
} |
} |
425 |
} |
} |
426 |
// if(ii==0){ |
for(Int_t j=cin;j<cfin;j++){ |
427 |
// if(i==6) ar.DrawArrow(COBT[0],1700.,COBT[0],2700.,0.01,"<"); |
if(i==6) ar.DrawArrow(COBT[j],1700.,COBT[j],2700.,0.01,"<"); |
428 |
// else ar.DrawArrow(COBT[0],1000.,COBT[0],2000.,0.01,"<"); |
else ar.DrawArrow(COBT[j],1000.,COBT[j],2000.,0.01,"<"); |
|
// } |
|
|
for(Int_t j=countCOBT;j<neventC;j++){ |
|
|
if(COBT[j]<COBT[j-1] && j!=countCOBT || COBT[j]>x[maxev-minev-1]){ |
|
|
if(i==11) countCOBT=j; |
|
|
break; |
|
|
} |
|
|
else{ |
|
|
if( COBT[j]>xMIN && COBT[j]<x[maxev-minev-1]){ |
|
|
if(i==6) ar.DrawArrow(COBT[j],1700.,COBT[j],2700.,0.01,"<"); |
|
|
else ar.DrawArrow(COBT[j],1000.,COBT[j],2000.,0.01,"<"); |
|
|
} |
|
|
} |
|
429 |
} |
} |
430 |
|
|
431 |
oss.str(""); |
oss.str(""); |
432 |
DataTimeCanv[ii]->Update(); |
DataTimeCanv[ii]->Update(); |
433 |
} |
} |
434 |
|
|
435 |
minev=maxev; |
minev=maxev; |
|
printf("\ncountrun=%d\n",ii); |
|
436 |
if(maxev==maxevent-1) { |
if(maxev==maxevent-1) { |
437 |
countrun=ii+1; |
countnboot=ii+1; |
438 |
break; |
break; |
439 |
} |
} |
440 |
} |
} |
441 |
printf("... end of packets. \n"); |
printf("... end of packets. \n"); |
442 |
|
|
443 |
//************************************************************************* |
//************************************************************************* |
444 |
// Save output Files |
// Save output Files |
445 |
//************************************************************************* |
//************************************************************************* |
446 |
stringstream nom1,nom2,nom3; |
stringstream nom1,nom2,nom3; |
447 |
|
|
448 |
for(Int_t fl=0;fl<countrun;fl++){ |
for(Int_t fl=0;fl<countnboot;fl++){ |
449 |
if(countrun==1){ |
if(countnboot==1){ |
450 |
nom1<<ffile<<"_FTrkQLook_BASIC."<<outfile.Data(); |
nom1<<ffile<<"_FTrkQLook_BASIC."<<outfile.Data(); |
451 |
DataTimeCanv[fl]->Print(out+nom1.str().c_str()); |
DataTimeCanv[fl]->Print(out+nom1.str().c_str()); |
452 |
nom1.str(""); |
nom1.str(""); |
453 |
} |
} |
454 |
|
|
455 |
if(countrun>=2){ |
if(countnboot>=2){ |
456 |
if(!strcmp(outfile.Data(),"ps") || !strcmp(outfile.Data(),"pdf")){ |
if(!strcmp(outfile.Data(),"ps") || !strcmp(outfile.Data(),"pdf")){ |
457 |
nom1.str(""); |
nom1.str(""); |
458 |
nom2.str(""); |
nom2.str(""); |
461 |
nom2<<ffile<<"_FTrkQLook_BASIC.ps"; |
nom2<<ffile<<"_FTrkQLook_BASIC.ps"; |
462 |
nom3<<ffile<<"_FTrkQLook_BASIC.ps)"; |
nom3<<ffile<<"_FTrkQLook_BASIC.ps)"; |
463 |
if(fl==0) DataTimeCanv[fl]->Print(out+nom1.str().c_str(),"portrait"); |
if(fl==0) DataTimeCanv[fl]->Print(out+nom1.str().c_str(),"portrait"); |
464 |
else if(fl==countrun-1) DataTimeCanv[fl]->Print(out+nom3.str().c_str(),"portrait"); |
else if(fl==countnboot-1) DataTimeCanv[fl]->Print(out+nom3.str().c_str(),"portrait"); |
465 |
else DataTimeCanv[fl]->Print(out+nom2.str().c_str(),"portrait"); |
else DataTimeCanv[fl]->Print(out+nom2.str().c_str(),"portrait"); |
466 |
|
|
467 |
} |
} |
473 |
} |
} |
474 |
} |
} |
475 |
|
|
476 |
if(!strcmp(outfile.Data(),"pdf") && countrun>=2){ |
// |
477 |
|
// Convert ps to pdf if required |
478 |
|
if(!strcmp(outfile.Data(),"pdf") && countnboot>=2){ |
479 |
stringstream com; |
stringstream com; |
480 |
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_BASIC.ps "<<out<<ffile<<"_FTrkQLook_BASIC.pdf"; |
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkQLook_BASIC.ps "<<out<<ffile<<"_FTrkQLook_BASIC.pdf"; |
481 |
system(com.str().c_str()); |
system(com.str().c_str()); |