2 |
* FTrkScanQlook_EXPERT.cxx |
* FTrkScanQlook_EXPERT.cxx |
3 |
* |
* |
4 |
* autor: D.Fedele |
* autor: D.Fedele |
5 |
* version v2r00 |
* version v2r07 |
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; |
ULong_t obt=0,hobt[neventH]; |
206 |
Int_t eve,cin=0; |
Int_t eve,cin=0,cins=0,br=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); |
212 |
pH = eH->GetPscuHeader(); |
pH = eH->GetPscuHeader(); |
213 |
if(reh->TRK_CALIB_USED!=104){ |
hobt[i]= pH->GetOrbitalTime(); |
214 |
|
if(reh->TRK_CALIB_USED!=104 && br==0){ |
215 |
obt = pH->GetOrbitalTime(); |
obt = pH->GetOrbitalTime(); |
216 |
cal="Event with online calibration"; |
cal="Event with online calibration"; |
217 |
break; |
br=1; |
218 |
} |
} |
219 |
if(i==neventH-1){ |
if(i==neventH-1 && br==0){ |
220 |
cal="***** ONLINE CALIBRATION NOT FOUND IN THIS FILE *****"; |
cal="***** ONLINE CALIBRATION NOT FOUND IN THIS FILE *****"; |
221 |
eve=2; |
eve=2; |
222 |
} |
} |
223 |
} |
} |
|
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; |
|
|
} |
|
|
} |
|
|
} |
|
224 |
|
|
225 |
int tot=2,totvalues=0,TOT=0; |
int tot=2,totvalues=0,TOT=0,totsum=0; |
226 |
if(event<0) tot=abs(event); |
if(event<0) tot=abs(event); |
227 |
if(value>0) totvalues=value; |
if(value>0) totvalues=value/10; |
228 |
|
|
229 |
TOT= tot > totvalues ? tot : totvalues; |
TOT= tot > totvalues ? tot : totvalues; |
230 |
|
if(value>0) totsum= (value/10) > 100 ? (value/10) : 100; |
231 |
|
else totsum=100; |
232 |
|
|
233 |
|
Int_t calev=cevents; |
234 |
|
|
235 |
TH1F *histomax[12][tot]; //histos of max signals |
TH1F *histomax[12][tot]; //histos of max signals |
236 |
TH1F *histocomp[12][tot]; //histos of compressed data |
TH1F *histocomp[12][tot]; //histos of compressed data |
237 |
TH1F *histofull[12][tot]; //histos of full data |
TH1F *histofull[12][tot]; //histos of full data |
238 |
TCanvas *c1[tot]; |
TCanvas *c1[tot],*csum[calev]; |
239 |
TH1F *histova[tot]; //histos of va1 signals |
TH1F *histova[tot]; |
240 |
|
TGraph*sum[12][calev][totsum/2]; |
241 |
TCanvas *cva[tot]; |
TCanvas *cva[tot]; |
242 |
|
|
243 |
|
TPad *trkpad[12]; //pad for histos |
244 |
|
|
245 |
|
stringstream fromfile,title,hid,message; |
246 |
|
TString figsa="",figsav="",figsava=""; |
247 |
|
Int_t canvasx=1200; |
248 |
|
Int_t canvasy=900; |
249 |
|
|
250 |
TLatex *t=new TLatex(); |
TLatex *t=new TLatex(); |
251 |
t->SetTextFont(32); |
t->SetTextFont(32); |
253 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
254 |
t->SetTextSize(0.02); |
t->SetTextSize(0.02); |
255 |
|
|
256 |
|
gStyle->SetLabelSize(0.06,"x"); |
257 |
|
gStyle->SetLabelSize(0.06,"y"); |
258 |
|
gStyle->SetTitleFontSize(0.1); |
259 |
|
gStyle->SetFillColor(10); |
260 |
|
gStyle->SetTitleFillColor(10); |
261 |
|
gStyle->SetOptStat(0); |
262 |
|
|
263 |
|
Int_t p[12],psum=0; |
264 |
|
Int_t whistostrip[3072]; |
265 |
|
for(int s=0;s<3072;s++) whistostrip[s]=s+1; |
266 |
|
|
267 |
|
if(eve==3){ |
268 |
|
for(Int_t i=0;i<nevents;i++){ |
269 |
|
tr->GetEntry(i); |
270 |
|
ph = eh->GetPscuHeader(); |
271 |
|
if(reh->TRK_CALIB_USED==104) continue; |
272 |
|
cod = eh->GetCounter(); |
273 |
|
if(value%10!=0){ |
274 |
|
if(i==0) cin=cod->Get(pctp->CalibTrk1)+((value%10)-1); |
275 |
|
if(cod->Get(pctp->CalibTrk1)==cin+1){ |
276 |
|
eve=i+3; |
277 |
|
cin=100; |
278 |
|
} |
279 |
|
} |
280 |
|
else { |
281 |
|
if(i==0) cin=cod->Get(pctp->CalibTrk1); |
282 |
|
if(event<0 && cod->Get(pctp->CalibTrk1)==cin+1){ |
283 |
|
eve=i+3; |
284 |
|
cin=100; |
285 |
|
} |
286 |
|
else if(event>=0 && (ULong_t)ph->GetOrbitalTime()>obt && obt>0){ |
287 |
|
eve=i+3; |
288 |
|
obt=0; |
289 |
|
} |
290 |
|
} |
291 |
|
if(i==0) cins=cod->Get(pctp->CalibTrk1); |
292 |
|
if(cod->Get(pctp->CalibTrk1)==cins+1){ |
293 |
|
psum=1; |
294 |
|
cins=cod->Get(pctp->CalibTrk1); |
295 |
|
} |
296 |
|
if(psum==1){ |
297 |
|
figsa=out+ffile+"_FTrkScanQLook_EXPERT_sumof"; |
298 |
|
figsa+=totsum; |
299 |
|
figsa+="events_cal"; |
300 |
|
figsa+=cins; |
301 |
|
csum[cins-1] = new TCanvas(figsa.Data(),"FTrkQLookSCAN",canvasx,canvasy); |
302 |
|
csum[cins-1]->SetFillColor(10); |
303 |
|
csum[cins-1]->Range(0,0,1,1); |
304 |
|
fromfile.str(""); |
305 |
|
fromfile<<"FTrkScanQLook_EXPERT File: "<<ffile<<" ----> Sum of "<<totsum<<" events after the "<<cins<<" calibration at OBT= "<<hobt[(cod->Get(pctp->RunHeader))-1]; |
306 |
|
t->SetTextSize(0.02); |
307 |
|
t->DrawLatex(0.02,0.98,fromfile.str().c_str()); |
308 |
|
|
309 |
|
// draw pads |
310 |
|
Double_t posy = 0.95; // up y-coord - top pads |
311 |
|
Double_t hpad = 0.15; // pad height |
312 |
|
Double_t posx1=0; // left x-coord - pad column |
313 |
|
Double_t posx0=0; // x-coord - column division |
314 |
|
Double_t wrel = 0.6; // relative x size of first sub-column |
315 |
|
Double_t marg = 0.004; // margin among pads |
316 |
|
|
317 |
|
hpad = (posy-marg*11)/6; |
318 |
|
wrel = (1-marg*4)/2; |
319 |
|
for(Int_t n = 0; n<12; n++){ |
320 |
|
if ( (n+1)%2 ) { |
321 |
|
if(n>1)posy = posy-(marg*2+hpad); |
322 |
|
posx1 = marg; |
323 |
|
posx0 = posx1 + wrel; |
324 |
|
} else { |
325 |
|
posx1 = posx0 + 2*marg; |
326 |
|
posx0 = posx1 + wrel; |
327 |
|
}; |
328 |
|
|
329 |
|
/* -----------> pad for histograms */ |
330 |
|
trkpad[n] = new TPad("pad"," ",posx1,posy-hpad,posx0,posy,18,0,0); |
331 |
|
trkpad[n]->SetFillColor(19); |
332 |
|
trkpad[n]->SetFrameFillColor(10); |
333 |
|
|
334 |
|
p[n]=0; |
335 |
|
} |
336 |
|
} |
337 |
|
if(psum>0 && psum<=totsum){ |
338 |
|
// = = = = = = = = = = = = = = = = = = = = = = = = = |
339 |
|
// create header dump retrieving event info |
340 |
|
// = = = = = = = = = = = = = = = = = = = = = = = = = |
341 |
|
Int_t ndsp=0; |
342 |
|
|
343 |
|
Int_t whistomax[3072]; |
344 |
|
Int_t whisto[3072]; |
345 |
|
Int_t whistocomp[3072]; |
346 |
|
Int_t whistofull[3072]; |
347 |
|
|
348 |
|
// // transmitted words |
349 |
|
Int_t word = 0; |
350 |
|
Int_t iword = 0; |
351 |
|
Int_t ii=0,ifull[12],icomp[12],imax[12],nn=0; |
352 |
|
trkword thisword; |
353 |
|
|
354 |
|
Int_t address,ladder; |
355 |
|
|
356 |
|
|
357 |
|
for(Int_t n = 0; n<12; n++){ |
358 |
|
ndsp = trk->DSPnumber[n]; |
359 |
|
nn = ndsp-1; |
360 |
|
ifull[nn]=0; |
361 |
|
icomp[nn]=0; |
362 |
|
imax[nn]=0; |
363 |
|
|
364 |
|
for(Int_t vi = 0; vi< 3072; vi++){ |
365 |
|
whistomax[vi] = -200; |
366 |
|
whistocomp[vi] = -200; |
367 |
|
whistofull[vi] = -200; |
368 |
|
whisto[vi] = -200; |
369 |
|
} |
370 |
|
|
371 |
|
// // trasmitted data |
372 |
|
// |
373 |
|
address = 0; |
374 |
|
ladder = 1; |
375 |
|
for(Int_t vi = 0; vi < trk->DATAlength[n] ; vi++){ |
376 |
|
word = trk->TrackerData.At(iword); |
377 |
|
thisword = datadecode(word); |
378 |
|
iword++; |
379 |
|
switch (thisword.type){ |
380 |
|
|
381 |
|
case 0: //ADC value |
382 |
|
whisto[address] = thisword.decode; |
383 |
|
address++; |
384 |
|
// cout << " adr " << address << "\n"; |
385 |
|
break; |
386 |
|
|
387 |
|
case 1: //address |
388 |
|
address = 1024*(ladder-1) + thisword.decode; |
389 |
|
// cout << " adr " << address << "\n"; |
390 |
|
break; |
391 |
|
|
392 |
|
case 2: //end-of-ladder |
393 |
|
ladder = thisword.decode; |
394 |
|
// cout << "Ladder " << ladder << "\n"; |
395 |
|
if(ladder==3){ |
396 |
|
// end of compressed data - FILL HISTO |
397 |
|
//cout << ">>> COMPRESSED data" << "\n"; |
398 |
|
for(ii = 0; ii < 3072; ii++){ |
399 |
|
whistocomp[ii]=whisto[ii]; |
400 |
|
whisto[ii] = -200; |
401 |
|
} |
402 |
|
address = 0; |
403 |
|
ladder = 1; |
404 |
|
}else if(ladder==6){ |
405 |
|
// end of full data - FILL HISTO |
406 |
|
//cout << ">>> FULL data" << "\n"; |
407 |
|
for(ii = 0; ii < 3072; ii++){ |
408 |
|
whistofull[ii]=whisto[ii]; |
409 |
|
whisto[ii] = -200; |
410 |
|
} |
411 |
|
address = 0; |
412 |
|
ladder = 1; |
413 |
|
}else{ |
414 |
|
if(ladder>3) ladder=ladder-3; |
415 |
|
address= ladder*1024; |
416 |
|
ladder = ladder + 1; |
417 |
|
} |
418 |
|
} |
419 |
|
} |
420 |
|
|
421 |
|
for(Int_t vi = 0; vi < 3072; vi++){ |
422 |
|
if(whistofull[vi]>-200){ |
423 |
|
if(vi==3071){ |
424 |
|
sum[nn][cins-1][p[nn]] = new TGraph(3072,whistostrip,whistofull); |
425 |
|
p[nn]++; |
426 |
|
} |
427 |
|
if(value%10==0 && value>0){ |
428 |
|
if(whistofull[vi]>0){ |
429 |
|
if(vi==0) values << (short int)ndsp << " "; |
430 |
|
values <<(short int) whistofull[vi] <<" "; |
431 |
|
if(vi==3071) values << endl; |
432 |
|
} |
433 |
|
} |
434 |
|
} |
435 |
|
} |
436 |
|
} |
437 |
|
psum++; |
438 |
|
if(value%10==0 && value>0) values << (short int)0 << endl << endl; |
439 |
|
} |
440 |
|
if(psum==totsum+1){ |
441 |
|
if(value%10==0 && value>0) values << (short int)(-cins) << endl << endl; |
442 |
|
psum=0; |
443 |
|
for(Int_t vi = 0; vi < 12; vi++){ |
444 |
|
TLine li,liva1; |
445 |
|
li.SetLineColor(38); |
446 |
|
li.SetLineStyle(4); |
447 |
|
li.SetLineWidth(2); |
448 |
|
liva1.SetLineColor(42); |
449 |
|
liva1.SetLineStyle(3); |
450 |
|
liva1.SetLineWidth(1); |
451 |
|
|
452 |
|
Float_t va1x=0; |
453 |
|
csum[cins-1]->cd(); |
454 |
|
trkpad[vi]->Draw(); |
455 |
|
trkpad[vi]->cd(); |
456 |
|
trkpad[vi]->SetFillColor(10); |
457 |
|
|
458 |
|
stringstream tit,hid; |
459 |
|
tit.str(""); |
460 |
|
hid.str(""); |
461 |
|
tit<<"DSP "<<vi+1; |
462 |
|
sum[vi][cins-1][0]->SetTitle(tit.str().c_str()); |
463 |
|
sum[vi][cins-1][0]->GetXaxis()->SetTitle("channel id"); |
464 |
|
sum[vi][cins-1][0]->GetXaxis()->CenterTitle(); |
465 |
|
sum[vi][cins-1][0]->GetXaxis()->SetRangeUser(0,3073); |
466 |
|
sum[vi][cins-1][0]->GetXaxis()->SetTitleSize(0.06); |
467 |
|
sum[vi][cins-1][0]->GetXaxis()->SetTitleOffset(0.8); |
468 |
|
sum[vi][cins-1][0]->GetYaxis()->SetTitle("ADC value"); |
469 |
|
sum[vi][cins-1][0]->GetYaxis()->SetTitleSize(0.09); |
470 |
|
sum[vi][cins-1][0]->GetYaxis()->SetTitleOffset(0.4); |
471 |
|
sum[vi][cins-1][0]->GetYaxis()->CenterTitle(); |
472 |
|
sum[vi][cins-1][0]->GetYaxis()->SetRangeUser(0,4500); |
473 |
|
sum[vi][cins-1][0]->SetMarkerStyle(20); |
474 |
|
sum[vi][cins-1][0]->SetMarkerSize(0.1); |
475 |
|
sum[vi][cins-1][0]->SetMarkerColor(4); |
476 |
|
sum[vi][cins-1][0]->Draw("ap"); |
477 |
|
hid<<p[vi]<<" events"; |
478 |
|
t->SetTextSize(0.11); |
479 |
|
t->DrawLatex(2400,4250,hid.str().c_str()); |
480 |
|
for(int pi=1; pi<p[vi];pi++){ |
481 |
|
sum[vi][cins-1][pi]->SetMarkerStyle(21); |
482 |
|
sum[vi][cins-1][pi]->SetMarkerSize(0.1); |
483 |
|
sum[vi][cins-1][pi]->SetMarkerColor(4); |
484 |
|
sum[vi][cins-1][pi]->Draw("p"); |
485 |
|
} |
486 |
|
for(int va=1; va<24; va++){ |
487 |
|
va1x=128*va; |
488 |
|
liva1.DrawLine(va1x,0.,va1x,4500.); |
489 |
|
} |
490 |
|
li.DrawLine(1024.5,0.,1024.5,4500.); |
491 |
|
li.DrawLine(2048.5,0.,2048.5,4500.); |
492 |
|
csum[cins-1]->Update(); |
493 |
|
hid.str(""); |
494 |
|
} |
495 |
|
if(strcmp(outfile.Data(),"ps") && strcmp(outfile.Data(),"pdf")){ |
496 |
|
figsa+="."+outfile; |
497 |
|
csum[cins-1]->Print(figsa.Data()); |
498 |
|
} |
499 |
|
} |
500 |
|
|
501 |
|
} |
502 |
|
} |
503 |
|
|
504 |
|
if(!strcmp(outfile.Data(),"ps") || !strcmp(outfile.Data(),"pdf")){ |
505 |
|
stringstream nom1,nom2,nom3; |
506 |
|
nom1<<out<<ffile<<"_FTrkScanQLook_EXPERT_sumof"<<totsum<<"event.ps("; |
507 |
|
nom2<<out<<ffile<<"_FTrkScanQLook_EXPERT_sumof"<<totsum<<"event.ps"; |
508 |
|
nom3<<out<<ffile<<"_FTrkScanQLook_EXPERT_sumof"<<totsum<<"event.ps)"; |
509 |
|
|
510 |
|
for(int va=0; va<cevents; va++){ |
511 |
|
if(cevents==1) csum[va]->Print(nom2.str().c_str(),"Landscape"); |
512 |
|
if(cevents>2){ |
513 |
|
if(va==0) csum[va]->Print(nom1.str().c_str(),"Landscape"); |
514 |
|
if(va>0 && va<cevents-1) csum[va]->Print(nom2.str().c_str(),"Landscape"); |
515 |
|
if(va>0 && va==cevents-1) csum[va]->Print(nom3.str().c_str(),"Landscape"); |
516 |
|
} |
517 |
|
} |
518 |
|
} |
519 |
|
// |
520 |
|
// Convert ps to pdf if required |
521 |
|
if(!strcmp(outfile.Data(),"pdf")){ |
522 |
|
stringstream com; |
523 |
|
com<<"ps2pdf13 "<<out<<ffile<<"_FTrkScanQLook_EXPERT_sumof"<<totsum<<"event.ps "<<out<<ffile<<"_FTrkScanQLook_EXPERT_sumof"<<totsum<<"event.pdf"; |
524 |
|
system(com.str().c_str()); |
525 |
|
printf("\n---> ps file converted in pdf format!\n"); |
526 |
|
com.str(""); |
527 |
|
com<<"rm -f "<<out<<ffile<<"_FTrkScanQLook_EXPERT_sumof"<<totsum<<"event.ps "; |
528 |
|
system(com.str().c_str()); |
529 |
|
printf("---> ps file removed!\n\n"); |
530 |
|
com.str(""); |
531 |
|
} |
532 |
|
|
533 |
|
|
534 |
|
|
535 |
for(Int_t e=0;e<TOT;e++){ |
for(Int_t e=0;e<TOT;e++){ |
536 |
if(event<=0) |
if(event<=0 || (value%10!=0 && e==0)) |
537 |
event=eve; |
event=eve; |
538 |
else { |
else { |
539 |
event=event+1; |
event=event+1; |
547 |
tr->GetEntry(event); |
tr->GetEntry(event); |
548 |
//============================================================================ |
//============================================================================ |
549 |
|
|
550 |
gStyle->SetLabelSize(0.06,"x"); |
// draw display area |
551 |
gStyle->SetLabelSize(0.06,"y"); |
|
552 |
//gStyle->SetTitleFontSize(0.1); |
TPad *trkpad[12],*pad=0; //pad for histos |
553 |
gStyle->SetFillColor(10); |
TPaveText *trkpadtext[12]; //pad for header |
554 |
gStyle->SetTitleFillColor(10); |
Int_t ndsp=0; |
555 |
gStyle->SetTitleOffset(-1,"Y"); |
|
556 |
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; |
|
557 |
figsav=out+ffile+"_FTrkScanQLook_EXPERT_ev"; |
figsav=out+ffile+"_FTrkScanQLook_EXPERT_ev"; |
558 |
figsav+=event+1; |
figsav+=event+1; |
559 |
c1[e] = new TCanvas(figsav.Data(),"FTrkQLookSCAN",canvasx,canvasy); |
c1[e] = new TCanvas(figsav.Data(),"FTrkQLookSCAN",canvasx,canvasy); |
561 |
c1[e]->Range(0,0,1,1); |
c1[e]->Range(0,0,1,1); |
562 |
fromfile.str(""); |
fromfile.str(""); |
563 |
fromfile<<"FTrkScanQLook_EXPERT File: "<<ffile<<" ----> Entry "<<event; |
fromfile<<"FTrkScanQLook_EXPERT File: "<<ffile<<" ----> Entry "<<event; |
564 |
|
t->SetTextSize(0.02); |
565 |
t->DrawLatex(0.02,0.98,fromfile.str().c_str()); |
t->DrawLatex(0.02,0.98,fromfile.str().c_str()); |
566 |
t->DrawLatex(0.60,0.98,cal.Data()); |
t->DrawLatex(0.60,0.98,cal.Data()); |
567 |
|
|
609 |
/* -----------> pad for header dump */ |
/* -----------> pad for header dump */ |
610 |
trkpadtext[n] = new TPaveText((posx0+marg),(posy-hpad),posx2,posy); |
trkpadtext[n] = new TPaveText((posx0+marg),(posy-hpad),posx2,posy); |
611 |
/* -----------> HISTOGRAMS */ |
/* -----------> HISTOGRAMS */ |
612 |
|
|
613 |
|
title.str(""); |
614 |
title<<"DSP "<<n+1; |
title<<"DSP "<<n+1; |
615 |
hid<<"h"<<n+e*100; |
hid<<"h"<<n+e*100; |
616 |
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); |
632 |
pad = new TPad("padva"," ",0,0,1,0.97,18,0,0); |
pad = new TPad("padva"," ",0,0,1,0.97,18,0,0); |
633 |
pad->SetFillColor(19); |
pad->SetFillColor(19); |
634 |
pad->SetFrameFillColor(10); |
pad->SetFrameFillColor(10); |
635 |
} |
} |
636 |
// = = = = = = = = = = = = = = = = = = = = = = = = = |
// = = = = = = = = = = = = = = = = = = = = = = = = = |
637 |
// create header dump retrieving event info |
// create header dump retrieving event info |
638 |
// = = = = = = = = = = = = = = = = = = = = = = = = = |
// = = = = = = = = = = = = = = = = = = = = = = = = = |
639 |
Int_t ndsp=0; |
|
640 |
|
|
641 |
Double_t whistomax[3072]; |
Double_t whistomax[3072]; |
642 |
Double_t whisto[3072]; |
Double_t whisto[3072]; |
802 |
if(whistomax[i]>-200) imax[nn]=1; |
if(whistomax[i]>-200) imax[nn]=1; |
803 |
if(whistocomp[i]>-200) icomp[nn]=1; |
if(whistocomp[i]>-200) icomp[nn]=1; |
804 |
if(whistofull[i]>-200) ifull[nn]=1; |
if(whistofull[i]>-200) ifull[nn]=1; |
805 |
if(totvalues==TOT || (totvalues<TOT && e<totvalues)){ |
if(value%10!=0){ |
806 |
if(whistofull[i]>0){ |
if((totvalues<TOT && e<totvalues) || totvalues==TOT){ |
807 |
if(i==0) values << (short int)ndsp << " "; |
if(whistofull[i]>0){ |
808 |
values <<(short int) whistofull[i] <<" "; |
if(i==0) values << (short int)ndsp << " "; |
809 |
if(i==3071) values << endl; |
values <<(short int) whistofull[i] <<" "; |
810 |
|
if(i==3071) values << endl; |
811 |
|
} |
812 |
} |
} |
813 |
} |
} |
814 |
if((tot<TOT && e<tot) || tot==TOT){ |
if((tot<TOT && e<tot) || tot==TOT){ |
880 |
if(nn==0){ |
if(nn==0){ |
881 |
b.SetFillColor(107); |
b.SetFillColor(107); |
882 |
b.SetFillStyle(3945); |
b.SetFillStyle(3945); |
883 |
|
b.DrawBox(256.,-500.,384.,4500); |
884 |
b.DrawBox(768.,-500.,2047.,4500.); |
b.DrawBox(768.,-500.,2047.,4500.); |
885 |
} |
} |
886 |
else if(nn==1){ |
else if(nn==1){ |
890 |
|
|
891 |
b.SetFillColor(107); |
b.SetFillColor(107); |
892 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
893 |
//b.DrawBox(384.,-500.,512.,4500.); |
b.DrawBox(384.,-500.,512.,4500.); |
894 |
|
b.DrawBox(2048.,-500.,2432.,4500.); |
895 |
b.DrawBox(2816.,-500.,2944.,4500.); |
b.DrawBox(2816.,-500.,2944.,4500.); |
896 |
b.DrawBox(2048.,-500.,2176.,4500.); |
} |
897 |
|
else if(nn==3){ |
898 |
|
b.SetFillColor(107); |
899 |
|
b.SetFillStyle(3954); |
900 |
|
b.DrawBox(2816.,-500.,3070.,4500.); |
901 |
} |
} |
902 |
else if(nn==4){ |
else if(nn==4){ |
903 |
b.SetFillColor(107); |
b.SetFillColor(107); |
904 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
905 |
b.DrawBox(384.,-500.,512.,4500.); |
b.DrawBox(256.,-500.,512.,4500.); |
906 |
|
b.DrawBox(2816.,-500.,3070.,4500.); |
907 |
|
} |
908 |
|
else if(nn==5){ |
909 |
|
b.SetFillColor(107); |
910 |
|
b.SetFillStyle(3954); |
911 |
|
b.DrawBox(896.,-500.,1024.,4500.); |
912 |
} |
} |
913 |
else if(nn==6){ |
else if(nn==6){ |
|
b.SetFillColor(6); |
|
|
b.SetFillStyle(3945); |
|
|
b.DrawBox(2560.,-500.,2816.,4500.); |
|
|
b.DrawBox(1024.,-500.,1535.,4500.); |
|
|
|
|
914 |
b.SetFillColor(107); |
b.SetFillColor(107); |
915 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
916 |
b.DrawBox(512.,-500.,768.,4500.); |
b.DrawBox(512.,-500.,768.,4500.); |
917 |
b.DrawBox(1536.,-500.,1792.,4500.); |
b.DrawBox(1024.,-500.,1280.,4500.); |
918 |
|
b.DrawBox(1280.,-500.,1792.,4500.); |
919 |
|
b.DrawBox(2560.,-500.,2816.,4500.); |
920 |
} |
} |
921 |
else if(nn==7){ |
else if(nn==7){ |
922 |
b.SetFillColor(107); |
b.SetFillColor(107); |
923 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
924 |
b.DrawBox(512.,-500.,768.,4500.); |
b.DrawBox(512.,-500.,768.,4500.); |
925 |
|
b.DrawBox(896.,-500.,1535.,4500.); |
926 |
|
b.DrawBox(2024.,-500.,2280.,4500.); |
927 |
} |
} |
928 |
else if(nn==8){ |
else if(nn==8){ |
929 |
b.SetFillColor(107); |
b.SetFillColor(107); |
933 |
else if(nn==9){ |
else if(nn==9){ |
934 |
b.SetFillColor(107); |
b.SetFillColor(107); |
935 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
936 |
|
b.DrawBox(0.,-500.,128.,4500.); |
937 |
b.DrawBox(256.,-500.,384.,4500.); |
b.DrawBox(256.,-500.,384.,4500.); |
938 |
//b.DrawBox(1280.,-500.,1408.,4500.); |
b.DrawBox(512.,-500.,640.,4500.); |
939 |
//b.DrawBox(1792.,-500.,1920.,4500.); |
b.DrawBox(896.,-500.,1024.,4500.); |
940 |
|
b.DrawBox(1280.,-500.,1535.,4500.); |
941 |
|
b.DrawBox(1792.,-500.,1920.,4500.); |
942 |
} |
} |
943 |
else if(nn==10){ |
else if(nn==10){ |
944 |
b.SetFillColor(107); |
b.SetFillColor(107); |
945 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
946 |
b.DrawBox(2048.,-500.,3070.,4500.); |
b.DrawBox(0.,-500.,256.,4500.); |
947 |
|
b.DrawBox(1024.,-500.,1152.,4500.); |
948 |
|
b.DrawBox(1768.,-500.,3070.,4500.); |
949 |
} |
} |
950 |
else if(nn==11){ |
else if(nn==11){ |
951 |
b.SetFillColor(6); |
b.SetFillColor(6); |
956 |
b.SetFillStyle(3954); |
b.SetFillStyle(3954); |
957 |
b.DrawBox(0.,-500.,512.,4500.); |
b.DrawBox(0.,-500.,512.,4500.); |
958 |
b.DrawBox(1920.,-500.,2560.,4500.); |
b.DrawBox(1920.,-500.,2560.,4500.); |
959 |
|
b.DrawBox(2816.,-500.,3070.,4500.); |
960 |
} |
} |
961 |
for(int va=1; va<24; va++){ |
for(int va=1; va<24; va++){ |
962 |
va1x=128*va; |
va1x=128*va; |
978 |
|
|
979 |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
if(!strcmp(outfile.Data(),"ps")||!strcmp(outfile.Data(),"pdf")){ |
980 |
if(e==0){ |
if(e==0){ |
981 |
c1[e]->Print(nom1.str().c_str(),"Portrait"); |
c1[e]->Print(nom1.str().c_str(),"Landscape"); |
982 |
if(va1!=0) cva[e]->Print(nom2.str().c_str(),"Portrait"); |
if(va1!=0) cva[e]->Print(nom2.str().c_str(),"Landscape"); |
983 |
} |
} |
984 |
if(e>0 && tot>2){ |
if(e>0 && tot>2){ |
985 |
c1[e]->Print(nom2.str().c_str(),"Portrait"); |
c1[e]->Print(nom2.str().c_str(),"Landscape"); |
986 |
if(va1!=0) cva[e]->Print(nom2.str().c_str(),"Portrait"); |
if(va1!=0) cva[e]->Print(nom2.str().c_str(),"Landscape"); |
987 |
} |
} |
988 |
if(e==tot-1){ |
if(e==tot-1){ |
989 |
c1[e]->Print(nom2.str().c_str(),"Portrait"); |
c1[e]->Print(nom2.str().c_str(),"Landscape"); |
990 |
if(va1!=0) cva[e]->Print(nom3.str().c_str(),"Portrait"); |
if(va1!=0) cva[e]->Print(nom3.str().c_str(),"Landscape"); |
991 |
} |
} |
992 |
} |
} |
993 |
else{ |
else{ |
999 |
} |
} |
1000 |
} |
} |
1001 |
} |
} |
1002 |
|
if(value%10!=0){ |
1003 |
if(totvalues==TOT || (totvalues<TOT && e<totvalues)) |
if(totvalues==TOT || (totvalues<TOT && e<totvalues)) |
1004 |
values << (short int)0 << endl << endl; |
values << (short int)0 << endl << endl; |
1005 |
|
} |
1006 |
} |
} |
1007 |
stringstream com; |
stringstream com; |
1008 |
|
|