2 |
* FTrkScanQlook_EXPERT.cxx |
* FTrkScanQlook_EXPERT.cxx |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version v2r00 |
* version v2r01 |
6 |
* Parameters: |
* Parameters: |
7 |
* file - the path to the root file to analyze |
* file - the path to the root file to analyze |
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 |
* value - the number of events to store in the .dat file with va1 values*10 + # of calibration (if #of cal = 0, select every calibration) |
12 |
* outfile - extension of output file (pdf,ps,gif,jpg) |
* outfile - extension of output file (pdf,ps,gif,jpg) |
13 |
* |
* |
14 |
*/ |
*/ |
29 |
#include <physics/tracker/TrackerEvent.h> |
#include <physics/tracker/TrackerEvent.h> |
30 |
#include <PscuHeader.h> |
#include <PscuHeader.h> |
31 |
#include <EventHeader.h> |
#include <EventHeader.h> |
32 |
|
#include <CalibTrk1Event.h> |
33 |
|
#include <CalibTrk2Event.h> |
34 |
#include <RunHeaderEvent.h> |
#include <RunHeaderEvent.h> |
35 |
// |
// |
36 |
|
|
145 |
pamela::EventHeader *eh=0,*eH=0; |
pamela::EventHeader *eh=0,*eH=0; |
146 |
pamela::PscuHeader *ph=0,*pH=0; |
pamela::PscuHeader *ph=0,*pH=0; |
147 |
pamela::RunHeaderEvent *reh=0; |
pamela::RunHeaderEvent *reh=0; |
148 |
|
pamela::CalibTrk1Event *trk1 = 0; |
149 |
|
pamela::CalibTrk2Event *trk2 = 0; |
150 |
pamela::EventCounter *cod=0; |
pamela::EventCounter *cod=0; |
151 |
|
|
152 |
pamela::PacketType *pctp=0; |
pamela::PacketType *pctp=0; |
167 |
otr->SetBranchAddress("Header",&eH); |
otr->SetBranchAddress("Header",&eH); |
168 |
otr->SetBranchAddress("RunHeader",&reh); |
otr->SetBranchAddress("RunHeader",&reh); |
169 |
|
|
170 |
|
TTree *otr1 = (TTree*)trackerFile->Get("CalibTrk1"); |
171 |
|
otr1->SetBranchAddress("CalibTrk1", &trk1); |
172 |
|
TTree *otr2 = (TTree*)trackerFile->Get("CalibTrk2"); |
173 |
|
otr2->SetBranchAddress("CalibTrk2", &trk2); |
174 |
|
|
175 |
// Define variables |
// Define variables |
176 |
Int_t nevents = tr->GetEntries(); |
Int_t nevents = tr->GetEntries(); |
177 |
Int_t neventH = otr->GetEntries(); |
Int_t neventH = otr->GetEntries(); |
178 |
|
Int_t cevents=0; |
179 |
|
|
180 |
|
if(otr1->GetEntries()==otr2->GetEntries()) |
181 |
|
cevents = otr1->GetEntries(); |
182 |
|
else printf("\nWARNING: CalibTrk1 entries is different from CalibTrk2 entries\n\n"); |
183 |
|
|
184 |
|
|
185 |
if ( nevents <= 0 ) { |
if ( nevents <= 0 ) { |
186 |
trackerFile->Close(); |
trackerFile->Close(); |
187 |
printf("The file is empty, exiting...\n"); |
printf("The file is empty, exiting...\n"); |
200 |
// |
// |
201 |
printf("\n Number of Entries: %d\n",nevents); |
printf("\n Number of Entries: %d\n",nevents); |
202 |
printf(" Number of Header Entries: %d\n",neventH); |
printf(" Number of Header Entries: %d\n",neventH); |
203 |
|
printf(" Number of Calibration: %d\n",cevents); |
204 |
|
|
205 |
Long64_t obt=0; |
Long64_t obt=0; |
206 |
Int_t eve,cin=0; |
Int_t eve,cin=0,cins=0; |
207 |
TString cal=""; |
TString cal=""; |
208 |
|
|
209 |
eve=3; |
eve=3; |
210 |
for(Int_t i=0;i<neventH;i++){ |
for(Int_t i=0;i<neventH;i++){ |
211 |
otr->GetEntry(i); |
otr->GetEntry(i); |
220 |
eve=2; |
eve=2; |
221 |
} |
} |
222 |
} |
} |
|
if(eve==3){ |
|
|
for(Int_t i=0;i<nevents;i++){ |
|
|
tr->GetEntry(i); |
|
|
ph = eh->GetPscuHeader(); |
|
|
cod = eh->GetCounter(); |
|
|
if(i==0) cin=cod->Get(pctp->CalibTrk1); |
|
|
if(reh->TRK_CALIB_USED==104) continue; |
|
|
if(event<0 && cod->Get(pctp->CalibTrk1)==cin+1){ |
|
|
eve=i+3; |
|
|
break; |
|
|
} |
|
|
else if(event>=0 && ph->GetOrbitalTime()>obt){ |
|
|
eve=i+3; |
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
223 |
|
|
224 |
int tot=2,totvalues=0,TOT=0; |
int tot=2,totvalues=0,TOT=0,totsum=0; |
225 |
if(event<0) tot=abs(event); |
if(event<0) tot=abs(event); |
226 |
if(value>0) totvalues=value; |
if(value>0) totvalues=value/10; |
227 |
|
|
228 |
TOT= tot > totvalues ? tot : totvalues; |
TOT= tot > totvalues ? tot : totvalues; |
229 |
|
if(value>0) totsum= (value/10) > 100 ? (value/10) : 100; |
230 |
|
else totsum=100; |
231 |
|
|
232 |
|
Int_t calev=cevents; |
233 |
|
|
234 |
TH1F *histomax[12][tot]; //histos of max signals |
TH1F *histomax[12][tot]; //histos of max signals |
235 |
TH1F *histocomp[12][tot]; //histos of compressed data |
TH1F *histocomp[12][tot]; //histos of compressed data |
236 |
TH1F *histofull[12][tot]; //histos of full data |
TH1F *histofull[12][tot]; //histos of full data |
237 |
TCanvas *c1[tot]; |
TCanvas *c1[tot],*csum[calev]; |
238 |
TH1F *histova[tot]; //histos of va1 signals |
TH1F *histova[tot]; |
239 |
|
TGraph*sum[12][calev][totsum/2]; |
240 |
TCanvas *cva[tot]; |
TCanvas *cva[tot]; |
241 |
|
|
242 |
|
TPad *trkpad[12]; //pad for histos |
243 |
|
|
244 |
|
stringstream fromfile,title,hid,message; |
245 |
|
TString figsa="",figsav="",figsava=""; |
246 |
|
Int_t canvasx=1200; |
247 |
|
Int_t canvasy=900; |
248 |
|
|
249 |
TLatex *t=new TLatex(); |
TLatex *t=new TLatex(); |
250 |
t->SetTextFont(32); |
t->SetTextFont(32); |
252 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
253 |
t->SetTextSize(0.02); |
t->SetTextSize(0.02); |
254 |
|
|
255 |
|
gStyle->SetLabelSize(0.06,"x"); |
256 |
|
gStyle->SetLabelSize(0.06,"y"); |
257 |
|
gStyle->SetTitleFontSize(0.1); |
258 |
|
gStyle->SetFillColor(10); |
259 |
|
gStyle->SetTitleFillColor(10); |
260 |
|
gStyle->SetOptStat(0); |
261 |
|
|
262 |
|
Int_t p[12],psum=0; |
263 |
|
Int_t whistostrip[3072]; |
264 |
|
for(int s=0;s<3072;s++) whistostrip[s]=s+1; |
265 |
|
|
266 |
|
if(eve==3){ |
267 |
|
for(Int_t i=0;i<nevents;i++){ |
268 |
|
tr->GetEntry(i); |
269 |
|
ph = eh->GetPscuHeader(); |
270 |
|
if(reh->TRK_CALIB_USED==104) continue; |
271 |
|
cod = eh->GetCounter(); |
272 |
|
if(value%10!=0){ |
273 |
|
if(i==0) cin=cod->Get(pctp->CalibTrk1)+((value%10)-1); |
274 |
|
if(cod->Get(pctp->CalibTrk1)==cin+1){ |
275 |
|
eve=i+3; |
276 |
|
cin=100; |
277 |
|
} |
278 |
|
} |
279 |
|
else { |
280 |
|
if(i==0) cin=cod->Get(pctp->CalibTrk1); |
281 |
|
if(event<0 && cod->Get(pctp->CalibTrk1)==cin+1){ |
282 |
|
eve=i+3; |
283 |
|
cin=100; |
284 |
|
} |
285 |
|
else if(event>=0 && ph->GetOrbitalTime()>obt && obt>0){ |
286 |
|
eve=i+3; |
287 |
|
obt=-1; |
288 |
|
} |
289 |
|
} |
290 |
|
if(i==0) cins=cod->Get(pctp->CalibTrk1); |
291 |
|
if(cod->Get(pctp->CalibTrk1)==cins+1){ |
292 |
|
psum=1; |
293 |
|
cins=cod->Get(pctp->CalibTrk1); |
294 |
|
} |
295 |
|
if(psum==1){ |
296 |
|
figsa=out+ffile+"_FTrkScanQLook_EXPERT_sumof"; |
297 |
|
figsa+=totsum; |
298 |
|
figsa+="events_cal"; |
299 |
|
figsa+=cins; |
300 |
|
csum[cins-1] = new TCanvas(figsa.Data(),"FTrkQLookSCAN",canvasx,canvasy); |
301 |
|
csum[cins-1]->SetFillColor(10); |
302 |
|
csum[cins-1]->Range(0,0,1,1); |
303 |
|
fromfile.str(""); |
304 |
|
fromfile<<"FTrkScanQLook_EXPERT File: "<<ffile<<" ----> Sum of "<<totsum<<" events after the "<<cins<<" calibration "; |
305 |
|
t->SetTextSize(0.02); |
306 |
|
t->DrawLatex(0.02,0.98,fromfile.str().c_str()); |
307 |
|
|
308 |
|
// draw pads |
309 |
|
Double_t posy = 0.95; // up y-coord - top pads |
310 |
|
Double_t hpad = 0.15; // pad height |
311 |
|
Double_t posx1=0; // left x-coord - pad column |
312 |
|
Double_t posx0=0; // x-coord - column division |
313 |
|
Double_t wrel = 0.6; // relative x size of first sub-column |
314 |
|
Double_t marg = 0.004; // margin among pads |
315 |
|
|
316 |
|
hpad = (posy-marg*11)/6; |
317 |
|
wrel = (1-marg*4)/2; |
318 |
|
for(Int_t n = 0; n<12; n++){ |
319 |
|
if ( (n+1)%2 ) { |
320 |
|
if(n>1)posy = posy-(marg*2+hpad); |
321 |
|
posx1 = marg; |
322 |
|
posx0 = posx1 + wrel; |
323 |
|
} else { |
324 |
|
posx1 = posx0 + 2*marg; |
325 |
|
posx0 = posx1 + wrel; |
326 |
|
}; |
327 |
|
|
328 |
|
/* -----------> pad for histograms */ |
329 |
|
trkpad[n] = new TPad("pad"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
330 |
|
trkpad[n]->SetFillColor(19); |
331 |
|
trkpad[n]->SetFrameFillColor(10); |
332 |
|
|
333 |
|
p[n]=0; |
334 |
|
} |
335 |
|
} |
336 |
|
if(psum>0 && psum<=totsum){ |
337 |
|
// = = = = = = = = = = = = = = = = = = = = = = = = = |
338 |
|
// create header dump retrieving event info |
339 |
|
// = = = = = = = = = = = = = = = = = = = = = = = = = |
340 |
|
Int_t ndsp=0; |
341 |
|
|
342 |
|
Int_t whistomax[3072]; |
343 |
|
Int_t whisto[3072]; |
344 |
|
Int_t whistocomp[3072]; |
345 |
|
Int_t whistofull[3072]; |
346 |
|
|
347 |
|
// // transmitted words |
348 |
|
Int_t word = 0; |
349 |
|
Int_t iword = 0; |
350 |
|
Int_t ii=0,ifull[12],icomp[12],imax[12],nn=0; |
351 |
|
trkword thisword; |
352 |
|
|
353 |
|
Int_t address,ladder; |
354 |
|
|
355 |
|
|
356 |
|
for(Int_t n = 0; n<12; n++){ |
357 |
|
ndsp = trk->DSPnumber[n]; |
358 |
|
nn = ndsp-1; |
359 |
|
ifull[nn]=0; |
360 |
|
icomp[nn]=0; |
361 |
|
imax[nn]=0; |
362 |
|
|
363 |
|
for(Int_t vi = 0; vi< 3072; vi++){ |
364 |
|
whistomax[vi] = -200; |
365 |
|
whistocomp[vi] = -200; |
366 |
|
whistofull[vi] = -200; |
367 |
|
whisto[vi] = -200; |
368 |
|
} |
369 |
|
|
370 |
|
// // trasmitted data |
371 |
|
// |
372 |
|
address = 0; |
373 |
|
ladder = 1; |
374 |
|
for(Int_t vi = 0; vi < trk->DATAlength[n] ; vi++){ |
375 |
|
word = trk->TrackerData.At(iword); |
376 |
|
thisword = datadecode(word); |
377 |
|
iword++; |
378 |
|
switch (thisword.type){ |
379 |
|
|
380 |
|
case 0: //ADC value |
381 |
|
whisto[address] = thisword.decode; |
382 |
|
address++; |
383 |
|
// cout << " adr " << address << "\n"; |
384 |
|
break; |
385 |
|
|
386 |
|
case 1: //address |
387 |
|
address = 1024*(ladder-1) + thisword.decode; |
388 |
|
// cout << " adr " << address << "\n"; |
389 |
|
break; |
390 |
|
|
391 |
|
case 2: //end-of-ladder |
392 |
|
ladder = thisword.decode; |
393 |
|
// cout << "Ladder " << ladder << "\n"; |
394 |
|
if(ladder==3){ |
395 |
|
// end of compressed data - FILL HISTO |
396 |
|
//cout << ">>> COMPRESSED data" << "\n"; |
397 |
|
for(ii = 0; ii < 3072; ii++){ |
398 |
|
whistocomp[ii]=whisto[ii]; |
399 |
|
whisto[ii] = -200; |
400 |
|
} |
401 |
|
address = 0; |
402 |
|
ladder = 1; |
403 |
|
}else if(ladder==6){ |
404 |
|
// end of full data - FILL HISTO |
405 |
|
//cout << ">>> FULL data" << "\n"; |
406 |
|
for(ii = 0; ii < 3072; ii++){ |
407 |
|
whistofull[ii]=whisto[ii]; |
408 |
|
whisto[ii] = -200; |
409 |
|
} |
410 |
|
address = 0; |
411 |
|
ladder = 1; |
412 |
|
}else{ |
413 |
|
if(ladder>3) ladder=ladder-3; |
414 |
|
address= ladder*1024; |
415 |
|
ladder = ladder + 1; |
416 |
|
} |
417 |
|
} |
418 |
|
} |
419 |
|
|
420 |
|
for(Int_t vi = 0; vi < 3072; vi++){ |
421 |
|
if(whistofull[vi]>-200){ |
422 |
|
if(vi==3071){ |
423 |
|
sum[nn][cins-1][p[nn]] = new TGraph(3072,whistostrip,whistofull); |
424 |
|
p[nn]++; |
425 |
|
} |
426 |
|
if(value%10==0 && value>0){ |
427 |
|
if(whistofull[vi]>0){ |
428 |
|
if(vi==0) values << (short int)ndsp << " "; |
429 |
|
values <<(short int) whistofull[vi] <<" "; |
430 |
|
if(vi==3071) values << endl; |
431 |
|
} |
432 |
|
} |
433 |
|
} |
434 |
|
} |
435 |
|
} |
436 |
|
psum++; |
437 |
|
if(value%10==0 && value>0) values << (short int)0 << endl << endl; |
438 |
|
} |
439 |
|
if(psum==totsum+1){ |
440 |
|
if(value%10==0 && value>0) values << (short int)(-cins) << endl << endl; |
441 |
|
psum=0; |
442 |
|
for(Int_t vi = 0; vi < 12; vi++){ |
443 |
|
TLine li,liva1; |
444 |
|
li.SetLineColor(38); |
445 |
|
li.SetLineStyle(4); |
446 |
|
li.SetLineWidth(2); |
447 |
|
liva1.SetLineColor(42); |
448 |
|
liva1.SetLineStyle(3); |
449 |
|
liva1.SetLineWidth(1); |
450 |
|
|
451 |
|
Float_t va1x=0; |
452 |
|
csum[cins-1]->cd(); |
453 |
|
trkpad[vi]->Draw(); |
454 |
|
trkpad[vi]->cd(); |
455 |
|
trkpad[vi]->SetFillColor(10); |
456 |
|
|
457 |
|
stringstream tit,hid; |
458 |
|
tit.str(""); |
459 |
|
hid.str(""); |
460 |
|
tit<<"DSP "<<vi+1; |
461 |
|
sum[vi][cins-1][0]->SetTitle(tit.str().c_str()); |
462 |
|
sum[vi][cins-1][0]->GetXaxis()->SetTitle("channel id"); |
463 |
|
sum[vi][cins-1][0]->GetXaxis()->CenterTitle(); |
464 |
|
sum[vi][cins-1][0]->GetXaxis()->SetRangeUser(0,3073); |
465 |
|
sum[vi][cins-1][0]->GetXaxis()->SetTitleSize(0.06); |
466 |
|
sum[vi][cins-1][0]->GetXaxis()->SetTitleOffset(0.8); |
467 |
|
sum[vi][cins-1][0]->GetYaxis()->SetTitle("ADC value"); |
468 |
|
sum[vi][cins-1][0]->GetYaxis()->SetTitleSize(0.09); |
469 |
|
sum[vi][cins-1][0]->GetYaxis()->SetTitleOffset(0.4); |
470 |
|
sum[vi][cins-1][0]->GetYaxis()->CenterTitle(); |
471 |
|
sum[vi][cins-1][0]->GetYaxis()->SetRangeUser(0,4500); |
472 |
|
sum[vi][cins-1][0]->SetMarkerStyle(20); |
473 |
|
sum[vi][cins-1][0]->SetMarkerSize(0.1); |
474 |
|
sum[vi][cins-1][0]->SetMarkerColor(4); |
475 |
|
sum[vi][cins-1][0]->Draw("ap"); |
476 |
|
hid<<p[vi]<<" events"; |
477 |
|
t->SetTextSize(0.11); |
478 |
|
t->DrawLatex(2400,4250,hid.str().c_str()); |
479 |
|
for(int pi=1; pi<p[vi];pi++){ |
480 |
|
sum[vi][cins-1][pi]->SetMarkerStyle(21); |
481 |
|
sum[vi][cins-1][pi]->SetMarkerSize(0.1); |
482 |
|
sum[vi][cins-1][pi]->SetMarkerColor(4); |
483 |
|
sum[vi][cins-1][pi]->Draw("p"); |
484 |
|
} |
485 |
|
for(int va=1; va<24; va++){ |
486 |
|
va1x=128*va; |
487 |
|
liva1.DrawLine(va1x,0.,va1x,4500.); |
488 |
|
} |
489 |
|
li.DrawLine(1024.5,0.,1024.5,4500.); |
490 |
|
li.DrawLine(2048.5,0.,2048.5,4500.); |
491 |
|
csum[cins-1]->Update(); |
492 |
|
hid.str(""); |
493 |
|
} |
494 |
|
if(strcmp(outfile.Data(),"ps") && strcmp(outfile.Data(),"pdf")){ |
495 |
|
figsa+="."+outfile; |
496 |
|
csum[cins-1]->Print(figsa.Data()); |
497 |
|
} |
498 |
|
} |
499 |
|
|
500 |
|
} |
501 |
|
} |
502 |
|
|
503 |
|
if(!strcmp(outfile.Data(),"ps") || !strcmp(outfile.Data(),"pdf")){ |
504 |
|
stringstream nom1,nom2,nom3; |
505 |
|
nom1<<out<<ffile<<"_FTrkScanQLook_EXPERT_sumof"<<totsum<<"event.ps("; |
506 |
|
nom2<<out<<ffile<<"_FTrkScanQLook_EXPERT_sumof"<<totsum<<"event.ps"; |
507 |
|
nom3<<out<<ffile<<"_FTrkScanQLook_EXPERT_sumof"<<totsum<<"event.ps)"; |
508 |
|
|
509 |
|
for(int va=0; va<cevents; va++){ |
510 |
|
if(cevents==1) csum[va]->Print(nom2.str().c_str(),"Landscape"); |
511 |
|
if(cevents>2){ |
512 |
|
if(va==0) csum[va]->Print(nom1.str().c_str(),"Landscape"); |
513 |
|
if(va>0 && va<cevents-1) csum[va]->Print(nom2.str().c_str(),"Landscape"); |
514 |
|
if(va>0 && va==cevents-1) csum[va]->Print(nom3.str().c_str(),"Landscape"); |
515 |
|
} |
516 |
|
} |
517 |
|
} |
518 |
|
// |
519 |
|
// Convert ps to pdf if required |
520 |
|
if(!strcmp(outfile.Data(),"pdf")){ |
521 |
|
stringstream com; |
522 |
|
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkScanQLook_EXPERT_sumof"<<totsum<<"event.ps "<<out<<ffile<<"_FTrkScanQLook_EXPERT_sumof"<<totsum<<"event.pdf"; |
523 |
|
system(com.str().c_str()); |
524 |
|
printf("\n---> ps file converted in pdf format!\n"); |
525 |
|
com.str(""); |
526 |
|
com<<"rm -f "<<out<<ffile<<"_FTrkScanQLook_EXPERT_sumof"<<totsum<<"event.ps "; |
527 |
|
system(com.str().c_str()); |
528 |
|
printf("---> ps file removed!\n\n"); |
529 |
|
com.str(""); |
530 |
|
} |
531 |
|
|
532 |
|
|
533 |
|
|
534 |
for(Int_t e=0;e<TOT;e++){ |
for(Int_t e=0;e<TOT;e++){ |
535 |
if(event<=0) |
if(event<=0 || (value%10!=0 && e==0)) |
536 |
event=eve; |
event=eve; |
537 |
else { |
else { |
538 |
event=event+1; |
event=event+1; |
546 |
tr->GetEntry(event); |
tr->GetEntry(event); |
547 |
//============================================================================ |
//============================================================================ |
548 |
|
|
549 |
gStyle->SetLabelSize(0.06,"x"); |
// draw display area |
550 |
gStyle->SetLabelSize(0.06,"y"); |
|
551 |
//gStyle->SetTitleFontSize(0.1); |
TPad *trkpad[12],*pad=0; //pad for histos |
552 |
gStyle->SetFillColor(10); |
TPaveText *trkpadtext[12]; //pad for header |
553 |
gStyle->SetTitleFillColor(10); |
Int_t ndsp=0; |
554 |
gStyle->SetTitleOffset(-1,"Y"); |
|
555 |
gStyle->SetOptStat(0); |
if((tot<TOT && e<tot) || tot==TOT){ |
|
|
|
|
// draw display area |
|
|
|
|
|
stringstream fromfile,title,hid,message; |
|
|
TString figsa="",figsav="",figsava=""; |
|
|
|
|
|
TPad *trkpad[12],*pad=0; //pad for histos |
|
|
TPaveText *trkpadtext[12]; //pad for header |
|
|
|
|
|
if((tot<TOT && e<tot) || tot==TOT){ |
|
|
Int_t canvasx=1200; |
|
|
Int_t canvasy=900; |
|
556 |
figsav=out+ffile+"_FTrkScanQLook_EXPERT_ev"; |
figsav=out+ffile+"_FTrkScanQLook_EXPERT_ev"; |
557 |
figsav+=event+1; |
figsav+=event+1; |
558 |
c1[e] = new TCanvas(figsav.Data(),"FTrkQLookSCAN",canvasx,canvasy); |
c1[e] = new TCanvas(figsav.Data(),"FTrkQLookSCAN",canvasx,canvasy); |
560 |
c1[e]->Range(0,0,1,1); |
c1[e]->Range(0,0,1,1); |
561 |
fromfile.str(""); |
fromfile.str(""); |
562 |
fromfile<<"FTrkScanQLook_EXPERT File: "<<ffile<<" ----> Entry "<<event; |
fromfile<<"FTrkScanQLook_EXPERT File: "<<ffile<<" ----> Entry "<<event; |
563 |
|
t->SetTextSize(0.02); |
564 |
t->DrawLatex(0.02,0.98,fromfile.str().c_str()); |
t->DrawLatex(0.02,0.98,fromfile.str().c_str()); |
565 |
t->DrawLatex(0.60,0.98,cal.Data()); |
t->DrawLatex(0.60,0.98,cal.Data()); |
566 |
|
|
608 |
/* -----------> pad for header dump */ |
/* -----------> pad for header dump */ |
609 |
trkpadtext[n] = new TPaveText((posx0+marg),(posy-hpad),posx2,posy); |
trkpadtext[n] = new TPaveText((posx0+marg),(posy-hpad),posx2,posy); |
610 |
/* -----------> HISTOGRAMS */ |
/* -----------> HISTOGRAMS */ |
611 |
|
|
612 |
|
title.str(""); |
613 |
title<<"DSP "<<n+1; |
title<<"DSP "<<n+1; |
614 |
hid<<"h"<<n+e*100; |
hid<<"h"<<n+e*100; |
615 |
histomax[n][e] = new TH1F(hid.str().c_str(),title.str().c_str(),3073,-0.5,3072.5); |
histomax[n][e] = new TH1F(hid.str().c_str(),title.str().c_str(),3073,-0.5,3072.5); |
631 |
pad = new TPad("padva"," ",0,0,1,0.97,18,0,0); |
pad = new TPad("padva"," ",0,0,1,0.97,18,0,0); |
632 |
pad->SetFillColor(19); |
pad->SetFillColor(19); |
633 |
pad->SetFrameFillColor(10); |
pad->SetFrameFillColor(10); |
634 |
} |
} |
635 |
// = = = = = = = = = = = = = = = = = = = = = = = = = |
// = = = = = = = = = = = = = = = = = = = = = = = = = |
636 |
// create header dump retrieving event info |
// create header dump retrieving event info |
637 |
// = = = = = = = = = = = = = = = = = = = = = = = = = |
// = = = = = = = = = = = = = = = = = = = = = = = = = |
638 |
Int_t ndsp=0; |
|
639 |
|
|
640 |
Double_t whistomax[3072]; |
Double_t whistomax[3072]; |
641 |
Double_t whisto[3072]; |
Double_t whisto[3072]; |
801 |
if(whistomax[i]>-200) imax[nn]=1; |
if(whistomax[i]>-200) imax[nn]=1; |
802 |
if(whistocomp[i]>-200) icomp[nn]=1; |
if(whistocomp[i]>-200) icomp[nn]=1; |
803 |
if(whistofull[i]>-200) ifull[nn]=1; |
if(whistofull[i]>-200) ifull[nn]=1; |
804 |
if(totvalues==TOT || (totvalues<TOT && e<totvalues)){ |
if(value%10!=0){ |
805 |
if(whistofull[i]>0){ |
if((totvalues<TOT && e<totvalues) || totvalues==TOT){ |
806 |
if(i==0) values << ndsp << " "; |
if(whistofull[i]>0){ |
807 |
values <<(short int) whistofull[i] <<" "; |
if(i==0) values << (short int)ndsp << " "; |
808 |
if(i==3071) values << endl; |
values <<(short int) whistofull[i] <<" "; |
809 |
|
if(i==3071) values << endl; |
810 |
|
} |
811 |
} |
} |
812 |
} |
} |
813 |
if((tot<TOT && e<tot) || tot==TOT){ |
if((tot<TOT && e<tot) || tot==TOT){ |
888 |
|
|
889 |
b.SetFillColor(107); |
b.SetFillColor(107); |
890 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
891 |
//b.DrawBox(384.,-500.,512.,4500.); |
b.DrawBox(384.,-500.,512.,4500.); |
892 |
b.DrawBox(2816.,-500.,2944.,4500.); |
b.DrawBox(2816.,-500.,2944.,4500.); |
893 |
b.DrawBox(2048.,-500.,2176.,4500.); |
b.DrawBox(2048.,-500.,2176.,4500.); |
894 |
} |
} |
901 |
b.SetFillColor(6); |
b.SetFillColor(6); |
902 |
b.SetFillStyle(3945); |
b.SetFillStyle(3945); |
903 |
b.DrawBox(2560.,-500.,2816.,4500.); |
b.DrawBox(2560.,-500.,2816.,4500.); |
904 |
b.DrawBox(1024.,-500.,1535.,4500.); |
b.DrawBox(1024.,-500.,1280.,4500.); |
905 |
|
|
906 |
b.SetFillColor(107); |
b.SetFillColor(107); |
907 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
908 |
b.DrawBox(512.,-500.,768.,4500.); |
b.DrawBox(512.,-500.,768.,4500.); |
909 |
b.DrawBox(1536.,-500.,1792.,4500.); |
b.DrawBox(1280.,-500.,1792.,4500.); |
910 |
} |
} |
911 |
else if(nn==7){ |
else if(nn==7){ |
912 |
b.SetFillColor(107); |
b.SetFillColor(107); |
922 |
b.SetFillColor(107); |
b.SetFillColor(107); |
923 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
924 |
b.DrawBox(256.,-500.,384.,4500.); |
b.DrawBox(256.,-500.,384.,4500.); |
925 |
//b.DrawBox(1280.,-500.,1408.,4500.); |
b.DrawBox(1280.,-500.,1535.,4500.); |
926 |
//b.DrawBox(1792.,-500.,1920.,4500.); |
b.DrawBox(1792.,-500.,1920.,4500.); |
927 |
} |
} |
928 |
else if(nn==10){ |
else if(nn==10){ |
929 |
b.SetFillColor(107); |
b.SetFillColor(107); |
960 |
|
|
961 |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
962 |
if(e==0){ |
if(e==0){ |
963 |
c1[e]->Print(nom1.str().c_str(),"Portrait"); |
c1[e]->Print(nom1.str().c_str(),"Landscape"); |
964 |
if(va1!=0) cva[e]->Print(nom2.str().c_str(),"Portrait"); |
if(va1!=0) cva[e]->Print(nom2.str().c_str(),"Landscape"); |
965 |
} |
} |
966 |
if(e>0 && tot>2){ |
if(e>0 && tot>2){ |
967 |
c1[e]->Print(nom2.str().c_str(),"Portrait"); |
c1[e]->Print(nom2.str().c_str(),"Landscape"); |
968 |
if(va1!=0) cva[e]->Print(nom2.str().c_str(),"Portrait"); |
if(va1!=0) cva[e]->Print(nom2.str().c_str(),"Landscape"); |
969 |
} |
} |
970 |
if(e==tot-1){ |
if(e==tot-1){ |
971 |
c1[e]->Print(nom2.str().c_str(),"Portrait"); |
c1[e]->Print(nom2.str().c_str(),"Landscape"); |
972 |
if(va1!=0) cva[e]->Print(nom3.str().c_str(),"Portrait"); |
if(va1!=0) cva[e]->Print(nom3.str().c_str(),"Landscape"); |
973 |
} |
} |
974 |
} |
} |
975 |
else{ |
else{ |
981 |
} |
} |
982 |
} |
} |
983 |
} |
} |
984 |
|
if(value%10!=0){ |
985 |
if(totvalues==TOT || (totvalues<TOT && e<totvalues)) |
if(totvalues==TOT || (totvalues<TOT && e<totvalues)) |
986 |
values << 0 << endl << endl; |
values << (short int)0 << endl << endl; |
987 |
|
} |
988 |
} |
} |
989 |
stringstream com; |
stringstream com; |
990 |
|
|