8 |
* outdir - total path of output file |
* outdir - total path of output file |
9 |
* event - the number of the single event to analyze |
* event - the number of the single event to analyze |
10 |
* va1 - the number of the single va1 to analyze (dsp*100+va1) |
* va1 - the number of the single va1 to analyze (dsp*100+va1) |
11 |
|
* value - the number of events to store in the .dat file with va1 values |
12 |
* outfile - extension of output file (pdf,ps,gif,jpg) |
* outfile - extension of output file (pdf,ps,gif,jpg) |
13 |
* |
* |
14 |
*/ |
*/ |
15 |
// |
// |
16 |
#include <iostream> |
#include <iostream> |
17 |
#include <sstream> |
#include <sstream> |
18 |
|
#include <fstream> |
19 |
// |
// |
20 |
#include <TPaveText.h> |
#include <TPaveText.h> |
21 |
#include <TLatex.h> |
#include <TLatex.h> |
120 |
} |
} |
121 |
|
|
122 |
|
|
123 |
void FTrkScanQLook_EXPERT(TString file, TString outdir,Int_t event, Int_t va1, TString outfile) |
void FTrkScanQLook_EXPERT(TString file, TString outdir,Int_t event, Int_t va1, Int_t value, TString outfile) |
124 |
{ |
{ |
125 |
|
|
126 |
// |
// |
172 |
return; |
return; |
173 |
} |
} |
174 |
|
|
175 |
|
// |
176 |
|
// open the output text files for the alarms |
177 |
|
TString fname = out+ffile; |
178 |
|
int slen=fname.Length(); |
179 |
|
int last=fname.Last('_'); |
180 |
|
if(last<(slen-1))fname.Append('_'); |
181 |
|
fname.Append("FTrk-DSP-values.dat"); |
182 |
|
ofstream values(fname,ios::out); |
183 |
|
|
184 |
|
// |
185 |
printf("\n Number of Entries: %d\n",nevents); |
printf("\n Number of Entries: %d\n",nevents); |
186 |
printf(" Number of Header Entries: %d\n",neventH); |
printf(" Number of Header Entries: %d\n",neventH); |
187 |
|
|
188 |
Long64_t obt=0; |
Long64_t obt=0; |
189 |
Int_t eve,cin=0;//,p=0; |
Int_t eve,cin=0; |
|
// if(event<0) Int_t eve[abs(event)]; |
|
190 |
TString cal=""; |
TString cal=""; |
191 |
|
|
192 |
eve=3; |
eve=3; |
|
//ev[0]=3; |
|
|
// ev[1]=4; |
|
193 |
for(Int_t i=0;i<neventH;i++){ |
for(Int_t i=0;i<neventH;i++){ |
194 |
otr->GetEntry(i); |
otr->GetEntry(i); |
195 |
pH = eH->GetPscuHeader(); |
pH = eH->GetPscuHeader(); |
201 |
if(i==neventH-1){ |
if(i==neventH-1){ |
202 |
cal="***** ONLINE CALIBRATION NOT FOUND IN THIS FILE *****"; |
cal="***** ONLINE CALIBRATION NOT FOUND IN THIS FILE *****"; |
203 |
eve=2; |
eve=2; |
|
// ev[0]=2; |
|
|
//ev[1]=3; |
|
204 |
} |
} |
205 |
} |
} |
206 |
if(eve==3){ |
if(eve==3){ |
216 |
} |
} |
217 |
else if(event>=0 && ph->GetOrbitalTime()>obt){ |
else if(event>=0 && ph->GetOrbitalTime()>obt){ |
218 |
eve=i+3; |
eve=i+3; |
|
//ev[0]=i+3; |
|
|
//ev[1]=i+4; |
|
219 |
break; |
break; |
220 |
} |
} |
221 |
} |
} |
222 |
} |
} |
223 |
|
|
224 |
int tot=2; |
int tot=2,totvalues=0,TOT=0; |
225 |
if(event<0) tot=abs(event); |
if(event<0) tot=abs(event); |
226 |
|
if(value>0) totvalues=value; |
227 |
|
|
228 |
|
TOT= tot > totvalues ? tot : totvalues; |
229 |
|
|
230 |
TH1F *histomax[12][tot]; //histos of max signals |
TH1F *histomax[12][tot]; //histos of max signals |
231 |
TH1F *histocomp[12][tot]; //histos of compressed data |
TH1F *histocomp[12][tot]; //histos of compressed data |
242 |
t->SetTextSize(0.02); |
t->SetTextSize(0.02); |
243 |
|
|
244 |
|
|
245 |
for(Int_t e=0;e<tot;e++){ |
for(Int_t e=0;e<TOT;e++){ |
246 |
if(event<=0) |
if(event<=0) |
247 |
event=eve; |
event=eve; |
248 |
else { |
else { |
249 |
event=event+e; |
event=event+1; |
250 |
if(event>eve-3 && eve>2) |
if(event>eve-3 && eve>2) |
251 |
cal="Event with online calibration"; |
cal="Event with online calibration"; |
252 |
else |
else |
257 |
tr->GetEntry(event); |
tr->GetEntry(event); |
258 |
//============================================================================ |
//============================================================================ |
259 |
|
|
260 |
gStyle->SetLabelSize(0.06,"x"); |
gStyle->SetLabelSize(0.06,"x"); |
261 |
gStyle->SetLabelSize(0.06,"y"); |
gStyle->SetLabelSize(0.06,"y"); |
262 |
//gStyle->SetTitleFontSize(0.1); |
//gStyle->SetTitleFontSize(0.1); |
263 |
gStyle->SetFillColor(10); |
gStyle->SetFillColor(10); |
264 |
gStyle->SetTitleFillColor(10); |
gStyle->SetTitleFillColor(10); |
265 |
gStyle->SetTitleOffset(-1,"Y"); |
gStyle->SetTitleOffset(-1,"Y"); |
266 |
gStyle->SetOptStat(0); |
gStyle->SetOptStat(0); |
267 |
|
|
268 |
// draw display area |
// draw display area |
269 |
|
|
270 |
stringstream fromfile,title,hid,message; |
stringstream fromfile,title,hid,message; |
271 |
TString figsa="",figsav="",figsava=""; |
TString figsa="",figsav="",figsava=""; |
272 |
|
|
273 |
Int_t canvasx=1200; |
TPad *trkpad[12],*pad=0; //pad for histos |
274 |
Int_t canvasy=900; |
TPaveText *trkpadtext[12]; //pad for header |
275 |
figsav=out+ffile+"_FTrkScanQLook_EXPERT_ev"; |
|
276 |
figsav+=event+1; |
if((tot<TOT && e<tot) || tot==TOT){ |
277 |
c1[e] = new TCanvas(figsav.Data(),"FTrkQLookSCAN",canvasx,canvasy); |
Int_t canvasx=1200; |
278 |
c1[e]->SetFillColor(10); |
Int_t canvasy=900; |
279 |
c1[e]->Range(0,0,1,1); |
figsav=out+ffile+"_FTrkScanQLook_EXPERT_ev"; |
280 |
fromfile.str(""); |
figsav+=event+1; |
281 |
fromfile<<"FTrkScanQLook_EXPERT File: "<<ffile<<" ----> Entry "<<event; |
c1[e] = new TCanvas(figsav.Data(),"FTrkQLookSCAN",canvasx,canvasy); |
282 |
t->DrawLatex(0.02,0.98,fromfile.str().c_str()); |
c1[e]->SetFillColor(10); |
283 |
t->DrawLatex(0.60,0.98,cal.Data()); |
c1[e]->Range(0,0,1,1); |
|
|
|
|
if(va1!=0){ |
|
|
figsava=out+ffile+"_FTrkScanQLook_EXPERT_ev"; |
|
|
figsava+=event+1; |
|
|
figsava+="_DSP"; |
|
|
figsava+=(int)(va1/100); |
|
|
figsava+="_VA1-"; |
|
|
figsava+=va1%100; |
|
|
cva[e] = new TCanvas(figsava.Data(),"TrkQLookSCAN VA1",canvasx,canvasy); |
|
|
cva[e]->SetFillColor(10); |
|
|
cva[e]->Range(0,0,1,1); |
|
284 |
fromfile.str(""); |
fromfile.str(""); |
285 |
fromfile<<"FTrkScanQLook_EXPERT File: "<<ffile<<" ----> Entry "<<event<<" --> DSP "<<(int)(va1/100)<<" --> va1 "<<va1%100; |
fromfile<<"FTrkScanQLook_EXPERT File: "<<ffile<<" ----> Entry "<<event; |
286 |
t->DrawLatex(0.02,0.98,fromfile.str().c_str()); |
t->DrawLatex(0.02,0.98,fromfile.str().c_str()); |
287 |
// t->DrawLatex(0.65,0.98,cal.Data()); |
t->DrawLatex(0.60,0.98,cal.Data()); |
|
} |
|
288 |
|
|
289 |
// draw pads |
if(va1!=0){ |
290 |
TPad *trkpad[12],*pad; //pad for histos |
figsava=out+ffile+"_FTrkScanQLook_EXPERT_ev"; |
291 |
TPaveText *trkpadtext[12]; //pad for header |
figsava+=event+1; |
292 |
Double_t posy = 0.95; // up y-coord - top pads |
figsava+="_DSP"; |
293 |
Double_t hpad = 0.15; // pad height |
figsava+=(int)(va1/100); |
294 |
Double_t posx1=0; // left x-coord - pad column |
figsava+="_VA1-"; |
295 |
Double_t posx2=0; // right x-coord - pad olumn |
figsava+=va1%100; |
296 |
Double_t posx0=0; // x-coord - column division |
cva[e] = new TCanvas(figsava.Data(),"TrkQLookSCAN VA1",canvasx,canvasy); |
297 |
Double_t wrel = 0.6; // relative x size of first sub-column |
cva[e]->SetFillColor(10); |
298 |
Double_t marg = 0.004; // margin among pads |
cva[e]->Range(0,0,1,1); |
299 |
|
fromfile.str(""); |
300 |
|
fromfile<<"FTrkScanQLook_EXPERT File: "<<ffile<<" ----> Entry "<<event<<" --> DSP "<<(int)(va1/100)<<" --> va1 "<<va1%100; |
301 |
|
t->DrawLatex(0.02,0.98,fromfile.str().c_str()); |
302 |
|
// t->DrawLatex(0.65,0.98,cal.Data()); |
303 |
|
} |
304 |
|
|
305 |
for(Int_t n = 0; n<12; n++){ |
// draw pads |
306 |
if ( (n+1)%2 ) { |
Double_t posy = 0.95; // up y-coord - top pads |
307 |
if(n>1)posy = posy-(marg*2+hpad); |
Double_t hpad = 0.15; // pad height |
308 |
posx1 = marg; |
Double_t posx1=0; // left x-coord - pad column |
309 |
posx2 = 0.5 - marg; |
Double_t posx2=0; // right x-coord - pad olumn |
310 |
posx0 = 0.5*wrel; |
Double_t posx0=0; // x-coord - column division |
311 |
} else { |
Double_t wrel = 0.6; // relative x size of first sub-column |
312 |
posx1 = posx1 + 0.5; |
Double_t marg = 0.004; // margin among pads |
313 |
posx2 = posx2 + 0.5; |
|
314 |
posx0 = posx0 + 0.5; |
for(Int_t n = 0; n<12; n++){ |
315 |
}; |
if ( (n+1)%2 ) { |
316 |
|
if(n>1)posy = posy-(marg*2+hpad); |
317 |
|
posx1 = marg; |
318 |
|
posx2 = 0.5 - marg; |
319 |
|
posx0 = 0.5*wrel; |
320 |
|
} else { |
321 |
|
posx1 = posx1 + 0.5; |
322 |
|
posx2 = posx2 + 0.5; |
323 |
|
posx0 = posx0 + 0.5; |
324 |
|
}; |
325 |
|
|
326 |
|
/* -----------> pad for histograms */ |
327 |
|
trkpad[n] = new TPad("pad"," ",posx1,posy-hpad,posx0-marg,posy,18,0,0); |
328 |
|
trkpad[n]->SetFillColor(19); |
329 |
|
trkpad[n]->SetFrameFillColor(10); |
330 |
|
/* -----------> pad for header dump */ |
331 |
|
trkpadtext[n] = new TPaveText((posx0+marg),(posy-hpad),posx2,posy); |
332 |
|
/* -----------> HISTOGRAMS */ |
333 |
|
|
334 |
|
title<<"DSP "<<n+1; |
335 |
|
hid<<"h"<<n+e*100; |
336 |
|
histomax[n][e] = new TH1F(hid.str().c_str(),title.str().c_str(),3073,-0.5,3072.5); |
337 |
|
hid<<"hh"<<n+e*100; |
338 |
|
histocomp[n][e] = new TH1F(hid.str().c_str(),title.str().c_str(),3073,-0.5,3072.5); |
339 |
|
hid<<"hhh"<<n+e*100; |
340 |
|
histofull[n][e] = new TH1F(hid.str().c_str(),title.str().c_str(),3073,-0.5,3072.5); |
341 |
|
title.str(""); |
342 |
|
hid.str(""); |
343 |
|
} |
344 |
|
if(va1!=0){ |
345 |
|
title.str(""); |
346 |
|
title<<"DSP "<<(int)(va1/100)<<" -- va1 "<<va1%100; |
347 |
|
hid<<"va"<<e; |
348 |
|
histova[e] = new TH1F(hid.str().c_str(),title.str().c_str(),130,0,129); |
349 |
|
} //end loop on views |
350 |
|
|
351 |
/* -----------> pad for histograms */ |
/* -----------> pad for histograms */ |
352 |
trkpad[n] = new TPad("pad"," ",posx1,posy-hpad,posx0-marg,posy,18,0,0); |
pad = new TPad("padva"," ",0,0,1,0.97,18,0,0); |
353 |
trkpad[n]->SetFillColor(19); |
pad->SetFillColor(19); |
354 |
trkpad[n]->SetFrameFillColor(10); |
pad->SetFrameFillColor(10); |
355 |
/* -----------> pad for header dump */ |
} |
|
trkpadtext[n] = new TPaveText((posx0+marg),(posy-hpad),posx2,posy); |
|
|
/* -----------> HISTOGRAMS */ |
|
|
|
|
|
title<<"DSP "<<n+1; |
|
|
hid<<"h"<<n+e*100; |
|
|
histomax[n][e] = new TH1F(hid.str().c_str(),title.str().c_str(),3073,-0.5,3072.5); |
|
|
hid<<"hh"<<n+e*100; |
|
|
histocomp[n][e] = new TH1F(hid.str().c_str(),title.str().c_str(),3073,-0.5,3072.5); |
|
|
hid<<"hhh"<<n+e*100; |
|
|
histofull[n][e] = new TH1F(hid.str().c_str(),title.str().c_str(),3073,-0.5,3072.5); |
|
|
title.str(""); |
|
|
hid.str(""); |
|
|
} |
|
|
if(va1!=0){ |
|
|
title.str(""); |
|
|
title<<"DSP "<<(int)(va1/100)<<" -- va1 "<<va1%100; |
|
|
hid<<"va"<<e; |
|
|
histova[e] = new TH1F(hid.str().c_str(),title.str().c_str(),129,-0.5,128.5); |
|
|
} //end loop on views |
|
|
|
|
|
/* -----------> pad for histograms */ |
|
|
pad = new TPad("padva"," ",0,0,1,0.97,18,0,0); |
|
|
pad->SetFillColor(19); |
|
|
pad->SetFrameFillColor(10); |
|
|
|
|
356 |
// = = = = = = = = = = = = = = = = = = = = = = = = = |
// = = = = = = = = = = = = = = = = = = = = = = = = = |
357 |
// create header dump retrieving event info |
// create header dump retrieving event info |
358 |
// = = = = = = = = = = = = = = = = = = = = = = = = = |
// = = = = = = = = = = = = = = = = = = = = = = = = = |
372 |
trkword thisword; |
trkword thisword; |
373 |
|
|
374 |
Int_t address,ladder; |
Int_t address,ladder; |
375 |
|
|
376 |
|
|
377 |
for(Int_t n = 0; n<12; n++){ |
for(Int_t n = 0; n<12; n++){ |
378 |
|
|
379 |
ndsp = trk->DSPnumber[n]; |
ndsp = trk->DSPnumber[n]; |
383 |
imax[nn]=0; |
imax[nn]=0; |
384 |
if(ndsp>0){ |
if(ndsp>0){ |
385 |
if(ndsp<13){ |
if(ndsp<13){ |
386 |
|
if((tot<TOT && e<tot) || tot==TOT){ |
387 |
|
|
388 |
/*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.* |
/*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.* |
389 |
* |
* |
390 |
* Write event LEVEL0 report |
* Write event LEVEL0 report |
391 |
* |
* |
392 |
*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*/ |
*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*/ |
393 |
|
|
394 |
trkpadtext[nn]->SetTextFont(40); |
trkpadtext[nn]->SetTextFont(40); |
395 |
trkpadtext[nn]->SetFillColor(33); |
trkpadtext[nn]->SetFillColor(33); |
396 |
trkpadtext[nn]->SetTextSize(0.012); |
trkpadtext[nn]->SetTextSize(0.012); |
397 |
trkpadtext[nn]->SetTextAlign(13); |
trkpadtext[nn]->SetTextAlign(13); |
398 |
|
|
399 |
trkpadtext[nn]->AddText(" "); |
trkpadtext[nn]->AddText(" "); |
400 |
message<<"DAQ mode --------> "<<trk->DAQmode[n]; |
message<<"DAQ mode --------> "<<trk->DAQmode[n]; |
401 |
trkpadtext[nn]->AddText(message.str().c_str()); |
trkpadtext[nn]->AddText(message.str().c_str()); |
402 |
message.str(""); |
message.str(""); |
403 |
message<<"Event number --------> "<<trk->eventn[n]; |
message<<"Event number --------> "<<trk->eventn[n]; |
404 |
trkpadtext[nn]->AddText(message.str().c_str()); |
trkpadtext[nn]->AddText(message.str().c_str()); |
405 |
message.str(""); |
message.str(""); |
406 |
message<<"13-bit words --------> "<<trk->DATAlength[n]; |
message<<"13-bit words --------> "<<trk->DATAlength[n]; |
407 |
trkpadtext[nn]->AddText(message.str().c_str()); |
trkpadtext[nn]->AddText(message.str().c_str()); |
408 |
message.str(""); |
message.str(""); |
409 |
if (!(nn%2)&&trk->signcluster[n][0]!=0) message<<"L1 add: "<<trk->addrcluster[n][0]<<" - sign: "<<1024-(trk->signcluster[n][0]); |
if (!(nn%2)&&trk->signcluster[n][0]!=0) message<<"L1 add: "<<trk->addrcluster[n][0]<<" - sign: "<<1024-(trk->signcluster[n][0]); |
410 |
else message<<"L1 add: "<<trk->addrcluster[n][0]<<" - sign: "<<(trk->signcluster[n][0]); |
else message<<"L1 add: "<<trk->addrcluster[n][0]<<" - sign: "<<(trk->signcluster[n][0]); |
411 |
trkpadtext[nn]->AddText(message.str().c_str()); |
trkpadtext[nn]->AddText(message.str().c_str()); |
412 |
message.str(""); |
message.str(""); |
413 |
if (!(nn%2)&&trk->signcluster[n][1]!=0) message<<"L2 add: "<<trk->addrcluster[n][1]<<" - sign: "<<1024-(trk->signcluster[n][1]); |
if (!(nn%2)&&trk->signcluster[n][1]!=0) message<<"L2 add: "<<trk->addrcluster[n][1]<<" - sign: "<<1024-(trk->signcluster[n][1]); |
414 |
else message<<"L2 add: "<<trk->addrcluster[n][1]<<" - sign: "<<trk->signcluster[n][1]; |
else message<<"L2 add: "<<trk->addrcluster[n][1]<<" - sign: "<<trk->signcluster[n][1]; |
415 |
trkpadtext[nn]->AddText(message.str().c_str()); |
trkpadtext[nn]->AddText(message.str().c_str()); |
416 |
message.str(""); |
message.str(""); |
417 |
if (!(nn%2)&&trk->signcluster[n][2]!=0) message<<"L3 add: "<<trk->addrcluster[n][2]<<" - sign: "<<1024-(trk->signcluster[n][2]); |
if (!(nn%2)&&trk->signcluster[n][2]!=0) message<<"L3 add: "<<trk->addrcluster[n][2]<<" - sign: "<<1024-(trk->signcluster[n][2]); |
418 |
else message<<"L3 add: "<<trk->addrcluster[n][2]<<" - sign: "<<trk->signcluster[n][2]; |
else message<<"L3 add: "<<trk->addrcluster[n][2]<<" - sign: "<<trk->signcluster[n][2]; |
419 |
trkpadtext[nn]->AddText(message.str().c_str()); |
trkpadtext[nn]->AddText(message.str().c_str()); |
420 |
message.str(""); |
message.str(""); |
421 |
message<<"NCLUST "<<trk->nclust[n]<<" CUTC "<<trk->cutc[n]<<" CUTCL "<<trk->cutcl[n]; |
message<<"NCLUST "<<trk->nclust[n]<<" CUTC "<<trk->cutc[n]<<" CUTCL "<<trk->cutcl[n]; |
422 |
trkpadtext[nn]->AddText(message.str().c_str()); |
trkpadtext[nn]->AddText(message.str().c_str()); |
423 |
message.str(""); |
message.str(""); |
424 |
message<<"Comp. time "<<trk->compressiontime[n]<<" x 0.051ms = "<<0.051*trk->compressiontime[n]<<" ms"; |
message<<"Comp. time "<<trk->compressiontime[n]<<" x 0.051ms = "<<0.051*trk->compressiontime[n]<<" ms"; |
425 |
trkpadtext[nn]->AddText(message.str().c_str()); |
trkpadtext[nn]->AddText(message.str().c_str()); |
426 |
message.str(""); |
message.str(""); |
427 |
trkpadtext[nn]->AddText(" "); |
trkpadtext[nn]->AddText(" "); |
428 |
message<<"CRC --> "<<trk->crc[n]; |
message<<"CRC --> "<<trk->crc[n]; |
429 |
trkpadtext[nn]->AddText(message.str().c_str()); |
trkpadtext[nn]->AddText(message.str().c_str()); |
430 |
message.str(""); |
message.str(""); |
431 |
message<<"FL1-6 --> "<<trk->fl1[n]<<" "<<trk->fl2[n]<<" "<<trk->fl3[n]<<" "<<trk->fl4[n]<<" "<<trk->fl5[n]<<" "<<trk->fl6[n]<<" FC "<<trk->fc[n]; |
message<<"FL1-6 --> "<<trk->fl1[n]<<" "<<trk->fl2[n]<<" "<<trk->fl3[n]<<" "<<trk->fl4[n]<<" "<<trk->fl5[n]<<" "<<trk->fl6[n]<<" FC "<<trk->fc[n]; |
432 |
trkpadtext[nn]->AddText(message.str().c_str()); |
trkpadtext[nn]->AddText(message.str().c_str()); |
433 |
message.str(""); |
message.str(""); |
434 |
trkpadtext[nn]->AddText(" "); |
trkpadtext[nn]->AddText(" "); |
435 |
trkpadtext[nn]->AddLine(0,0,0,0); |
trkpadtext[nn]->AddLine(0,0,0,0); |
436 |
message<<"PNum "<<trk->pnum[n]<<" - BId "<<trk->bid[n]<<" ALARM "<<trk->alarm[n]; |
message<<"PNum "<<trk->pnum[n]<<" - BId "<<trk->bid[n]<<" ALARM "<<trk->alarm[n]; |
437 |
trkpadtext[nn]->AddText(message.str().c_str()); |
trkpadtext[nn]->AddText(message.str().c_str()); |
438 |
message.str(""); |
message.str(""); |
439 |
message<<"Cmd "<<trk->cmdnum[n]<<" --- Answer length "<<trk->aswr[n]<<" byte"; |
message<<"Cmd "<<trk->cmdnum[n]<<" --- Answer length "<<trk->aswr[n]<<" byte"; |
440 |
trkpadtext[nn]->AddText(message.str().c_str()); |
trkpadtext[nn]->AddText(message.str().c_str()); |
441 |
message.str(""); |
message.str(""); |
442 |
trkpadtext[nn]->AddText(" "); |
trkpadtext[nn]->AddText(" "); |
443 |
|
|
444 |
TOTDATAlength_check = TOTDATAlength_check + trk->DATAlength[n]; |
TOTDATAlength_check = TOTDATAlength_check + trk->DATAlength[n]; |
445 |
|
} |
446 |
/*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.* |
/*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.* |
447 |
* |
* |
448 |
* Plot event LEVEL0 histo |
* Plot event LEVEL0 histo |
450 |
*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*/ |
*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*.*/ |
451 |
|
|
452 |
//============================================= |
//============================================= |
453 |
|
} |
454 |
|
for(Int_t i = 0; i< 3072; i++){ |
455 |
|
whistomax[i] = -200; |
456 |
|
whistocomp[i] = -200; |
457 |
|
whistofull[i] = -200; |
458 |
|
whisto[i] = -200; |
459 |
|
} |
460 |
|
|
461 |
for(Int_t i = 0; i< 3072; i++){ |
// =============== |
462 |
whistomax[i] = -200; |
// trasmitted data |
463 |
whistocomp[i] = -200; |
// =============== |
464 |
whistofull[i] = -200; |
|
465 |
whisto[i] = -200; |
address = 0; |
466 |
} |
ladder = 1; |
467 |
|
for(Int_t i = 0; i < trk->DATAlength[n] ; i++){ |
468 |
// =============== |
word = trk->TrackerData.At(iword); |
469 |
// trasmitted data |
thisword = datadecode(word); |
470 |
// =============== |
iword++; |
471 |
|
switch (thisword.type){ |
|
address = 0; |
|
|
ladder = 1; |
|
|
for(Int_t i = 0; i < trk->DATAlength[n] ; i++){ |
|
|
word = trk->TrackerData.At(iword); |
|
|
thisword = datadecode(word); |
|
|
iword++; |
|
|
switch (thisword.type){ |
|
472 |
|
|
473 |
case 0: //ADC value |
case 0: //ADC value |
474 |
whisto[address] = thisword.decode; |
whisto[address] = thisword.decode; |
475 |
address++; |
address++; |
476 |
// cout << " adr " << address << "\n"; |
// cout << " adr " << address << "\n"; |
477 |
break; |
break; |
478 |
|
|
479 |
case 1: //address |
case 1: //address |
480 |
address = 1024*(ladder-1) + thisword.decode; |
address = 1024*(ladder-1) + thisword.decode; |
481 |
// cout << " adr " << address << "\n"; |
// cout << " adr " << address << "\n"; |
482 |
break; |
break; |
483 |
|
|
484 |
case 2: //end-of-ladder |
case 2: //end-of-ladder |
485 |
ladder = thisword.decode; |
ladder = thisword.decode; |
486 |
// cout << "Ladder " << ladder << "\n"; |
// cout << "Ladder " << ladder << "\n"; |
487 |
if(ladder==3){ |
if(ladder==3){ |
488 |
// end of compressed data - FILL HISTO |
// end of compressed data - FILL HISTO |
489 |
//cout << ">>> COMPRESSED data" << "\n"; |
//cout << ">>> COMPRESSED data" << "\n"; |
490 |
for(ii = 0; ii < 3072; ii++){ |
for(ii = 0; ii < 3072; ii++){ |
491 |
whistocomp[ii]=whisto[ii]; |
whistocomp[ii]=whisto[ii]; |
492 |
whisto[ii] = -200; |
whisto[ii] = -200; |
|
} |
|
|
address = 0; |
|
|
ladder = 1; |
|
|
}else if(ladder==6){ |
|
|
// end of full data - FILL HISTO |
|
|
//cout << ">>> FULL data" << "\n"; |
|
|
for(ii = 0; ii < 3072; ii++){ |
|
|
whistofull[ii]=whisto[ii]; |
|
|
whisto[ii] = -200; |
|
|
} |
|
|
address = 0; |
|
|
ladder = 1; |
|
|
}else{ |
|
|
if(ladder>3) ladder=ladder-3; |
|
|
address= ladder*1024; |
|
|
ladder = ladder + 1; |
|
493 |
} |
} |
494 |
} |
address = 0; |
495 |
|
ladder = 1; |
496 |
|
}else if(ladder==6){ |
497 |
|
// end of full data - FILL HISTO |
498 |
|
//cout << ">>> FULL data" << "\n"; |
499 |
|
for(ii = 0; ii < 3072; ii++){ |
500 |
|
whistofull[ii]=whisto[ii]; |
501 |
|
whisto[ii] = -200; |
502 |
|
} |
503 |
|
address = 0; |
504 |
|
ladder = 1; |
505 |
|
}else{ |
506 |
|
if(ladder>3) ladder=ladder-3; |
507 |
|
address= ladder*1024; |
508 |
|
ladder = ladder + 1; |
509 |
|
} |
510 |
} |
} |
511 |
|
} |
512 |
|
|
513 |
|
|
514 |
// =============== |
// =============== |
515 |
// maximum signals |
// maximum signals |
516 |
// =============== |
// =============== |
517 |
if(trk->signcluster[nn][0]!=0) whistomax[ 0+(int)trk->addrcluster[nn][0]] = whistocomp[ 0+(int)trk->addrcluster[nn][0]]; |
if(trk->signcluster[nn][0]!=0) whistomax[ 0+(int)trk->addrcluster[nn][0]] = whistocomp[ 0+(int)trk->addrcluster[nn][0]]; |
518 |
if(trk->signcluster[nn][1]!=0) whistomax[1024+(int)trk->addrcluster[nn][1]] = whistocomp[1024+(int)trk->addrcluster[nn][1]]; |
if(trk->signcluster[nn][1]!=0) whistomax[1024+(int)trk->addrcluster[nn][1]] = whistocomp[1024+(int)trk->addrcluster[nn][1]]; |
519 |
if(trk->signcluster[nn][2]!=0) whistomax[2048+(int)trk->addrcluster[nn][2]] = whistocomp[2048+(int)trk->addrcluster[nn][2]]; |
if(trk->signcluster[nn][2]!=0) whistomax[2048+(int)trk->addrcluster[nn][2]] = whistocomp[2048+(int)trk->addrcluster[nn][2]]; |
520 |
|
|
521 |
for(Int_t i = 0; i < 3072; i++){ |
for(Int_t i = 0; i < 3072; i++){ |
522 |
if(whistomax[i]>-200) imax[nn]=1; |
if(whistomax[i]>-200) imax[nn]=1; |
523 |
if(whistocomp[i]>-200) icomp[nn]=1; |
if(whistocomp[i]>-200) icomp[nn]=1; |
524 |
if(whistofull[i]>-200) ifull[nn]=1; |
if(whistofull[i]>-200) ifull[nn]=1; |
525 |
|
if(totvalues==TOT || (totvalues<TOT && e<totvalues)){ |
526 |
|
if(whistofull[i]>0){ |
527 |
|
if(i==0) values << ndsp << " "; |
528 |
|
values <<(short int) whistofull[i] <<" "; |
529 |
|
if(i==3071) values << endl; |
530 |
|
} |
531 |
|
} |
532 |
|
if((tot<TOT && e<tot) || tot==TOT){ |
533 |
histomax[nn][e]->Fill((Float_t)i,whistomax[i]); |
histomax[nn][e]->Fill((Float_t)i,whistomax[i]); |
534 |
histocomp[nn][e]->Fill((Float_t)i,whistocomp[i]); |
histocomp[nn][e]->Fill((Float_t)i,whistocomp[i]); |
535 |
histofull[nn][e]->Fill((Float_t)i,whistofull[i]); |
histofull[nn][e]->Fill((Float_t)i,whistofull[i]); |
538 |
histova[e]->Fill((Float_t)(i-128*((va1%100)-1)+1),whistofull[i]); |
histova[e]->Fill((Float_t)(i-128*((va1%100)-1)+1),whistofull[i]); |
539 |
} |
} |
540 |
} |
} |
541 |
|
} |
542 |
|
|
543 |
|
if((tot<TOT && e<tot) || tot==TOT){ |
544 |
TBox b; |
TBox b; |
545 |
TLine li,liva1; |
TLine li,liva1; |
546 |
li.SetLineColor(38); |
li.SetLineColor(38); |
667 |
li.DrawLine(2048.5,-500.,2048.5,4500.); |
li.DrawLine(2048.5,-500.,2048.5,4500.); |
668 |
c1[e]->Update(); |
c1[e]->Update(); |
669 |
} |
} |
670 |
|
|
671 |
} |
} |
|
|
|
672 |
}//end loop on views |
}//end loop on views |
673 |
|
|
674 |
stringstream nom1,nom2,nom3; |
if((tot<TOT && e<tot) || tot==TOT){ |
675 |
nom1<<out<<ffile<<"_FTrkScanQLook_EXPERT.ps("; |
stringstream nom1,nom2,nom3; |
676 |
nom2<<out<<ffile<<"_FTrkScanQLook_EXPERT.ps"; |
nom1<<out<<ffile<<"_FTrkScanQLook_EXPERT.ps("; |
677 |
nom3<<out<<ffile<<"_FTrkScanQLook_EXPERT.ps)"; |
nom2<<out<<ffile<<"_FTrkScanQLook_EXPERT.ps"; |
678 |
|
nom3<<out<<ffile<<"_FTrkScanQLook_EXPERT.ps)"; |
679 |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
|
680 |
if(e==0){ |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
681 |
c1[e]->Print(nom1.str().c_str(),"Portrait"); |
if(e==0){ |
682 |
if(va1!=0) cva[e]->Print(nom2.str().c_str(),"Portrait"); |
c1[e]->Print(nom1.str().c_str(),"Portrait"); |
683 |
} |
if(va1!=0) cva[e]->Print(nom2.str().c_str(),"Portrait"); |
684 |
if(e>0 && tot>2){ |
} |
685 |
c1[e]->Print(nom2.str().c_str(),"Portrait"); |
if(e>0 && tot>2){ |
686 |
if(va1!=0) cva[e]->Print(nom2.str().c_str(),"Portrait"); |
c1[e]->Print(nom2.str().c_str(),"Portrait"); |
687 |
} |
if(va1!=0) cva[e]->Print(nom2.str().c_str(),"Portrait"); |
688 |
if(e==tot-1){ |
} |
689 |
c1[e]->Print(nom2.str().c_str(),"Portrait"); |
if(e==tot-1){ |
690 |
if(va1!=0) cva[e]->Print(nom3.str().c_str(),"Portrait"); |
c1[e]->Print(nom2.str().c_str(),"Portrait"); |
691 |
|
if(va1!=0) cva[e]->Print(nom3.str().c_str(),"Portrait"); |
692 |
|
} |
693 |
} |
} |
694 |
} |
else{ |
695 |
else{ |
figsav+="."+outfile; |
696 |
figsav+="."+outfile; |
c1[e]->Print(figsav.Data()); |
697 |
c1[e]->Print(figsav.Data()); |
if(va1!=0){ |
698 |
if(va1!=0){ |
figsava+="."+outfile; |
699 |
figsava+="."+outfile; |
cva[e]->Print(figsava.Data()); |
700 |
cva[e]->Print(figsava.Data()); |
} |
701 |
} |
} |
702 |
} |
} |
703 |
|
|
704 |
|
if(totvalues==TOT || (totvalues<TOT && e<totvalues)) |
705 |
|
values << 0 << endl << endl; |
706 |
|
} |
707 |
|
stringstream com; |
708 |
|
|
709 |
|
values.close(); |
710 |
|
if(value==0){ |
711 |
|
com<<"rm -f "<<fname; |
712 |
|
system(com.str().c_str()); |
713 |
} |
} |
|
|
|
714 |
// |
// |
715 |
// Convert ps to pdf if required |
// Convert ps to pdf if required |
716 |
if(!strcmp(outfile.Data(),"pdf")){ |
if(!strcmp(outfile.Data(),"pdf")){ |
|
stringstream com; |
|
717 |
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkScanQLook_EXPERT.ps "<<out<<ffile<<"_FTrkScanQLook_EXPERT.pdf"; |
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkScanQLook_EXPERT.ps "<<out<<ffile<<"_FTrkScanQLook_EXPERT.pdf"; |
718 |
system(com.str().c_str()); |
system(com.str().c_str()); |
719 |
printf("\n---> ps file converted in pdf format!\n"); |
printf("\n---> ps file converted in pdf format!\n"); |
723 |
printf("---> ps file removed!\n\n"); |
printf("---> ps file removed!\n\n"); |
724 |
com.str(""); |
com.str(""); |
725 |
} |
} |
726 |
|
|
727 |
return; |
return; |
728 |
} |
} |