3 |
#include <EventHeader.h> |
#include <EventHeader.h> |
4 |
|
|
5 |
#include <fstream> |
#include <fstream> |
6 |
|
#include <vector> |
7 |
|
|
8 |
#include <TCanvas.h> |
#include <TCanvas.h> |
9 |
#include <TLatex.h> |
#include <TLatex.h> |
14 |
#include <TObjString.h> |
#include <TObjString.h> |
15 |
#include <TGraph.h> |
#include <TGraph.h> |
16 |
#include <TH1.h> |
#include <TH1.h> |
17 |
|
#include <time.h> |
18 |
|
|
19 |
#include <utils/yodaUtility.h> |
#include <utils/yodaUtility.h> |
20 |
|
|
21 |
#define DEBUG 0 |
#define DEBUG 0 |
22 |
#define VERSION 1.4 |
#define VERSION 1.5 |
23 |
#define INTERVAL 100 |
#define INTERVAL 100 |
24 |
|
#define FORMAT "png" |
25 |
|
|
26 |
using namespace std; |
using namespace std; |
27 |
|
|
28 |
|
UInt_t found; |
29 |
Int_t minevent,maxevent; |
Int_t minevent,maxevent; |
30 |
UShort_t ACheader[2]; |
UShort_t ACheader[2]; |
31 |
TString *cardname = new TString[2]; |
TString *cardname = new TString[2]; |
32 |
TString *detector = new TString[16]; |
TString *detector = new TString[16]; |
33 |
|
|
34 |
|
|
35 |
int AcQLOOKbasic(TString base,int fromevent=0, int toevent=0, TString outDir = "./", TString format = "jpg"){ |
int AcQLOOKbasic(TString base,int fromevent=0, int toevent=0, TString outDir = "./", TString format = FORMAT){ |
36 |
|
|
37 |
ofstream outputFile; |
ofstream outputFile; |
38 |
stringstream oss; |
stringstream oss; |
51 |
//Takes the tree of the header file |
//Takes the tree of the header file |
52 |
TTree *tr = (TTree*)rootFile->Get("Physics"); |
TTree *tr = (TTree*)rootFile->Get("Physics"); |
53 |
|
|
54 |
|
tr->SetBranchStatus("*",0,&found); //disable all branches |
55 |
|
|
56 |
|
tr->SetBranchStatus("header*",1,&found); |
57 |
|
// printf("header: enabled %i branches \n",found); |
58 |
|
found = 0; |
59 |
|
tr->SetBranchStatus("status*",1,&found); |
60 |
|
// printf("status: enabled %i branches \n",found); |
61 |
|
found = 0; |
62 |
|
tr->SetBranchStatus("hitmap*",1,&found); |
63 |
|
// printf("hitmap: enabled %i branches \n",found); |
64 |
|
found = 0; |
65 |
|
tr->SetBranchStatus("regist*",1,&found); |
66 |
|
// printf("regist: enabled %i branches \n",found); |
67 |
|
found = 0; |
68 |
|
tr->SetBranchStatus("shift*",1,&found); |
69 |
|
// printf("shift: enabled %i branches \n",found); |
70 |
|
found = 0; |
71 |
|
tr->SetBranchStatus("counters*",1,&found); |
72 |
|
// printf("counters: enabled %i branches \n",found); |
73 |
|
found = 0; |
74 |
|
tr->SetBranchStatus("coinc*",1,&found); |
75 |
|
// printf("coinc: enabled %i branches \n",found); |
76 |
|
found = 0; |
77 |
|
tr->SetBranchStatus("trigg*",1,&found); |
78 |
|
// printf("trigg: enabled %i branches \n",found); |
79 |
|
found = 0; |
80 |
|
tr->SetBranchStatus("clock*",1,&found); |
81 |
|
// printf("clock: enabled %i branches \n",found); |
82 |
|
found = 0; |
83 |
|
tr->SetBranchStatus("temp*",1,&found); |
84 |
|
// printf("temp: enabled %i branches \n",found); |
85 |
|
found = 0; |
86 |
|
tr->SetBranchStatus("DAC*",1,&found); |
87 |
|
// printf("DAC: enabled %i branches \n",found); |
88 |
|
found = 0; |
89 |
|
tr->SetBranchStatus("CRC*",1,&found); |
90 |
|
// printf("CRC: enabled %i branches \n",found); |
91 |
|
|
92 |
|
found = 0; |
93 |
|
tr->SetBranchStatus("Pscu*",1,&found); |
94 |
|
// printf("enabled %i branches \n",found); |
95 |
|
found = 0; |
96 |
|
tr->SetBranchStatus("Anticounter*",1,&found); |
97 |
|
// printf("Ac enabled %i branches \n",found); |
98 |
|
found = 0; |
99 |
|
tr->SetBranchStatus("Header*",1,&found); |
100 |
|
// printf("head enabled %i branches \n",found); |
101 |
|
|
102 |
tr->SetBranchAddress("Anticounter", &ace); |
tr->SetBranchAddress("Anticounter", &ace); |
103 |
tr->SetBranchAddress("Header", &eh); |
tr->SetBranchAddress("Header", &eh); |
104 |
|
|
105 |
|
|
106 |
|
|
107 |
|
|
108 |
Int_t nevents = tr->GetEntries(); |
Int_t nevents = tr->GetEntries(); |
109 |
|
|
110 |
//check that the selected range of events is ok |
//check that the selected range of events is ok |
308 |
} //end AcBasic |
} //end AcBasic |
309 |
|
|
310 |
|
|
311 |
int AcQLOOKpro(TString base,int fromevent=0, int toevent=0, TString outDir = "./", TString format = "jpg"){ |
int AcQLOOKpro(TString base,int fromevent=0, int toevent=0, TString outDir = "./", TString format = FORMAT){ |
312 |
|
|
313 |
|
//Float_t startTime,stopTime; |
314 |
|
//Float_t time1,time2,time3,time4; |
315 |
|
|
316 |
|
//startTime = clock(); |
317 |
|
|
318 |
ofstream outputFile; |
ofstream outputFile; |
319 |
stringstream oss; |
stringstream oss; |
331 |
|
|
332 |
//Takes the tree of the header file |
//Takes the tree of the header file |
333 |
TTree *tr = (TTree*)rootFile->Get("Physics"); |
TTree *tr = (TTree*)rootFile->Get("Physics"); |
334 |
|
|
335 |
|
tr->SetBranchStatus("*",0,&found); //disable all branches |
336 |
|
|
337 |
|
tr->SetBranchStatus("header*",1,&found); |
338 |
|
// printf("header: enabled %i branches \n",found); |
339 |
|
found = 0; |
340 |
|
tr->SetBranchStatus("status*",1,&found); |
341 |
|
// printf("status: enabled %i branches \n",found); |
342 |
|
found = 0; |
343 |
|
tr->SetBranchStatus("hitmap*",1,&found); |
344 |
|
// printf("hitmap: enabled %i branches \n",found); |
345 |
|
found = 0; |
346 |
|
tr->SetBranchStatus("regist*",1,&found); |
347 |
|
// printf("regist: enabled %i branches \n",found); |
348 |
|
found = 0; |
349 |
|
tr->SetBranchStatus("shift*",1,&found); |
350 |
|
// printf("shift: enabled %i branches \n",found); |
351 |
|
found = 0; |
352 |
|
tr->SetBranchStatus("counters*",1,&found); |
353 |
|
// printf("counters: enabled %i branches \n",found); |
354 |
|
found = 0; |
355 |
|
tr->SetBranchStatus("coinc*",1,&found); |
356 |
|
// printf("coinc: enabled %i branches \n",found); |
357 |
|
found = 0; |
358 |
|
tr->SetBranchStatus("trigg*",1,&found); |
359 |
|
// printf("trigg: enabled %i branches \n",found); |
360 |
|
found = 0; |
361 |
|
tr->SetBranchStatus("clock*",1,&found); |
362 |
|
// printf("clock: enabled %i branches \n",found); |
363 |
|
found = 0; |
364 |
|
tr->SetBranchStatus("temp*",1,&found); |
365 |
|
// printf("temp: enabled %i branches \n",found); |
366 |
|
found = 0; |
367 |
|
tr->SetBranchStatus("DAC*",1,&found); |
368 |
|
// printf("DAC: enabled %i branches \n",found); |
369 |
|
found = 0; |
370 |
|
tr->SetBranchStatus("CRC*",1,&found); |
371 |
|
// printf("CRC: enabled %i branches \n",found); |
372 |
|
found = 0; |
373 |
|
|
374 |
|
tr->SetBranchStatus("Pscu*",1,&found); |
375 |
|
// printf("enabled %i branches \n",found); |
376 |
|
found = 0; |
377 |
|
tr->SetBranchStatus("Anticounter*",1,&found); |
378 |
|
// printf("Ac enabled %i branches \n",found); |
379 |
|
found = 0; |
380 |
|
tr->SetBranchStatus("Header*",1,&found); |
381 |
|
// printf("head enabled %i branches \n",found); |
382 |
|
|
383 |
tr->SetBranchAddress("Anticounter", &ace); |
tr->SetBranchAddress("Anticounter", &ace); |
384 |
tr->SetBranchAddress("Header", &eh); |
tr->SetBranchAddress("Header", &eh); |
385 |
|
|
429 |
Int_t paramEvents; |
Int_t paramEvents; |
430 |
Int_t minevent,maxevent; |
Int_t minevent,maxevent; |
431 |
char *figsave = " "; |
char *figsave = " "; |
|
Int_t ch_cnt; |
|
432 |
UShort_t ACheader[2]; |
UShort_t ACheader[2]; |
433 |
ACheader[0]=0xAC11; |
ACheader[0]=0xAC11; |
434 |
ACheader[1]=0xAC22; |
ACheader[1]=0xAC22; |
435 |
|
|
436 |
|
vector<int> Err_type(0); |
437 |
|
vector<float> Err_obt(0); |
438 |
|
vector<int> Err_evt(0); |
439 |
|
|
440 |
|
|
441 |
Int_t *det_map = new Int_t[12]; |
Int_t *det_map = new Int_t[12]; |
442 |
det_map[0]=2; |
det_map[0]=2; |
443 |
det_map[1]=14; |
det_map[1]=14; |
545 |
} |
} |
546 |
} |
} |
547 |
|
|
548 |
TH1D *status_h = new TH1D("Status","Status",10,0.,10.); |
TH1D *status_h = new TH1D("Status","Status",12,0.,12.); |
549 |
status_h->GetXaxis()->SetBinLabel(1,"CRC event M"); |
status_h->GetXaxis()->SetBinLabel(1,"Headers M"); |
550 |
status_h->GetXaxis()->SetBinLabel(2,"Headers M"); |
status_h->GetXaxis()->SetBinLabel(2,"CRC M"); |
551 |
status_h->GetXaxis()->SetBinLabel(3,"CRC M"); |
status_h->GetXaxis()->SetBinLabel(3,"Dsp M"); |
552 |
status_h->GetXaxis()->SetBinLabel(4,"Dsp M"); |
status_h->GetXaxis()->SetBinLabel(4,"Temp M"); |
553 |
status_h->GetXaxis()->SetBinLabel(5,"Reg M"); |
status_h->GetXaxis()->SetBinLabel(5,"Reg M"); |
554 |
status_h->GetXaxis()->SetBinLabel(6,"CRC event E"); |
status_h->GetXaxis()->SetBinLabel(6,"CRC Event M"); |
555 |
status_h->GetXaxis()->SetBinLabel(7,"Headers E"); |
status_h->GetXaxis()->SetBinLabel(7,"Headers E"); |
556 |
status_h->GetXaxis()->SetBinLabel(8,"CRC E"); |
status_h->GetXaxis()->SetBinLabel(8,"CRC E"); |
557 |
status_h->GetXaxis()->SetBinLabel(9,"Dsp E"); |
status_h->GetXaxis()->SetBinLabel(9,"Dsp E"); |
558 |
status_h->GetXaxis()->SetBinLabel(10,"Reg E"); |
status_h->GetXaxis()->SetBinLabel(10,"Temp E"); |
559 |
|
status_h->GetXaxis()->SetBinLabel(11,"Reg E"); |
560 |
|
status_h->GetXaxis()->SetBinLabel(12,"CRC Event E"); |
561 |
status_h->GetYaxis()->SetTitle("# of Errors"); |
status_h->GetYaxis()->SetTitle("# of Errors"); |
562 |
status_h->SetMinimum(0); |
status_h->SetMinimum(0); |
563 |
|
|
597 |
|
|
598 |
/********************* MAIN LOOP **********************/ |
/********************* MAIN LOOP **********************/ |
599 |
|
|
600 |
//UShort_t tshift[16]; |
//time1 = clock(); |
601 |
|
//printf("Init time: %f\n",(Double_t) (time1 - startTime) / (Double_t) CLOCKS_PER_SEC); |
602 |
|
|
603 |
|
//iterators used in the loop |
604 |
|
Int_t card, ch, bin; |
605 |
|
|
606 |
for (Int_t i = minevent; i < maxevent; i++){ |
for (Int_t i = minevent; i < maxevent; i++){ |
607 |
|
|
613 |
|
|
614 |
hitsCARD=hitsCAT=hitsCAS=0; |
hitsCARD=hitsCAT=hitsCAS=0; |
615 |
|
|
616 |
/* |
for(card=0;card<2;card++) |
|
for(Int_t ii=0;ii<16;ii++) |
|
|
tshift[ii]=0; |
|
|
for(Int_t ii=0;ii<16;ii++) |
|
|
{ |
|
|
for(Int_t jj=0;jj<16;jj++) |
|
|
{ |
|
|
if(ace->shift[0][jj] & (1<<ii)) |
|
|
tshift[ii]=(1<<jj) | tshift[ii]; |
|
|
else |
|
|
tshift[ii]=(~(1<<jj)) & tshift[ii]; |
|
|
} |
|
|
for(Int_t kk=0;kk<16;kk++) |
|
|
shiftreg_h[0][ii]->Fill(kk,tshift[ii] & 0x1<<kk); |
|
|
} |
|
|
*/ |
|
|
//printf("johan %hx\n",tshift[0]); |
|
|
|
|
|
for(Int_t card=0;card<2;card++) |
|
617 |
{ |
{ |
618 |
//proceed only if crc of event is ok |
//proceed only if crc of event is ok |
619 |
/******************************************************/ |
//printf("CRC: %hx\n",ace->CRCcheck[card]); |
620 |
|
//printf("Hitmap: %hx\n\n",ace->hitmap[card]); |
621 |
if(ace->CRCcheck[card]==1) |
if(ace->CRCcheck[card]==1) |
622 |
{ |
{ |
623 |
//clock |
//clock |
632 |
time_between_trigg_h[card]->Fill( 0.000000025*ac_clock_diff[card] ); |
time_between_trigg_h[card]->Fill( 0.000000025*ac_clock_diff[card] ); |
633 |
|
|
634 |
//counters, singlesrate & shift reg content |
//counters, singlesrate & shift reg content |
635 |
for(Int_t ch=0;ch<16;ch++){ |
for(ch=0;ch<16;ch++) |
|
counter_old[card][ch] = counter_new[card][ch]; |
|
|
counter_new[card][ch] = ace->counters[card][ch]; |
|
|
if(counter_new[card][ch] - counter_old[card][ch] < 0.) |
|
|
counter_diff[card][ch] = 0xFFFF + counter_new[card][ch] - counter_old[card][ch]; |
|
|
else |
|
|
counter_diff[card][ch] = counter_new[card][ch] - counter_old[card][ch]; |
|
|
|
|
|
singles_gr[card][ch][paramEvent] += (Double_t)counter_diff[card][ch]; |
|
|
|
|
|
|
|
|
for(Int_t bin = 0; bin < 16; bin++){ |
|
|
shiftreg_h[card][bin]->Fill(ch,ace->shift[card][ch] & 0x1<<bin); |
|
|
} |
|
|
} |
|
|
|
|
|
//hitmap |
|
|
for(ch_cnt=0;ch_cnt<16;ch_cnt++) |
|
636 |
{ |
{ |
637 |
if( (ace->hitmap[card] & (0x1<<ch_cnt)) > 0 ){ |
counter_old[card][ch] = counter_new[card][ch]; |
638 |
hitmap_h[card]->Fill(ch_cnt,1.); |
counter_new[card][ch] = ace->counters[card][ch]; |
639 |
if(ch_cnt==0 || ch_cnt==4 || ch_cnt==8 || ch_cnt==12) |
if(counter_new[card][ch] - counter_old[card][ch] < 0.) |
640 |
|
counter_diff[card][ch] = 0xFFFF + counter_new[card][ch] - counter_old[card][ch]; |
641 |
|
else |
642 |
|
counter_diff[card][ch] = counter_new[card][ch] - counter_old[card][ch]; |
643 |
|
|
644 |
|
singles_gr[card][ch][paramEvent] += (Double_t)counter_diff[card][ch]; |
645 |
|
|
646 |
|
for(bin = 0; bin < 16; bin++){ |
647 |
|
shiftreg_h[card][bin]->Fill(ch,ace->shift[card][ch] & 0x1<<bin); |
648 |
|
} |
649 |
|
|
650 |
|
//hitmap |
651 |
|
if( (ace->hitmap[card] & (0x1<<ch)) > 0 ){ |
652 |
|
hitmap_h[card]->Fill(ch,1.); |
653 |
|
if(ch==0 || ch==4 || ch==8 || ch==12) |
654 |
hitsCARD++; |
hitsCARD++; |
655 |
else if(ch_cnt==1 || ch_cnt==5 || ch_cnt==9 || ch_cnt==13) |
else if(ch==1 || ch==5 || ch==9 || ch==13) |
656 |
hitsCAT++; |
hitsCAT++; |
657 |
else if(ch_cnt==2 || ch_cnt==6 || ch_cnt==10 || ch_cnt==14) |
else if(ch==2 || ch==6 || ch==10 || ch==14) |
658 |
hitsCAS++; |
hitsCAS++; |
659 |
} |
} |
660 |
|
|
661 |
} |
} |
662 |
|
|
663 |
//Status |
//Status |
664 |
if((ace->header[card][0] != 0xACAC) || (ace->header[card][1] != ACheader[card])) |
if((ace->header[card][0] != 0xACAC) || (ace->header[card][1] != ACheader[card])){ |
665 |
status_h->Fill(1.+5.*card,1.); |
status_h->Fill(6.*card,1.); |
666 |
if((ace->status[card] & 0x8000) < 0x8000) //crc |
Err_type.push_back(6*card); |
667 |
status_h->Fill(2.+5.*card,1.); |
Err_obt.push_back(ph->GetOrbitalTime()); |
668 |
if((ace->status[card] & 0x4000) < 0x4000) //dsp |
Err_evt.push_back(i); |
669 |
status_h->Fill(3.+5.*card,1.); |
} |
670 |
if((ace->status[card] & 0x01FF) < 0x01FF) //reg |
if((ace->status[card] & 0x8000) < 0x8000){ //crc |
671 |
status_h->Fill(4.+5*card,1.); |
status_h->Fill(1.+6.*card,1.); |
672 |
|
Err_type.push_back(1+6*card); |
673 |
|
Err_obt.push_back(ph->GetOrbitalTime()); |
674 |
|
Err_evt.push_back(i); |
675 |
|
} |
676 |
|
if((ace->status[card] & 0x6000) < 0x6000){ //dsp |
677 |
|
status_h->Fill(2.+6.*card,1.); |
678 |
|
Err_type.push_back(2+6*card); |
679 |
|
Err_obt.push_back(ph->GetOrbitalTime()); |
680 |
|
Err_evt.push_back(i); |
681 |
|
} |
682 |
|
if((ace->status[card] & 0x0E00) < 0x0E00){ //temp |
683 |
|
status_h->Fill(3.+6.*card,1.); |
684 |
|
Err_type.push_back(3+6*card); |
685 |
|
Err_obt.push_back(ph->GetOrbitalTime()); |
686 |
|
Err_evt.push_back(i); |
687 |
|
} |
688 |
|
if((ace->status[card] & 0x01FF) < 0x01FF){ //reg |
689 |
|
status_h->Fill(4.+6.*card,1.); |
690 |
|
Err_type.push_back(4+6*card); |
691 |
|
Err_obt.push_back(ph->GetOrbitalTime()); |
692 |
|
Err_evt.push_back(i); |
693 |
|
} |
694 |
|
|
695 |
//temperature (left on cards) |
//temperature (left on cards) |
696 |
temp_gr[card][0][paramEvent] += ( ((ace->temp[card][0] & 0x00FF))*2.8 - 273. )/(Float_t)INTERVAL; |
temp_gr[card][0][paramEvent] += ( ((ace->temp[card][0] & 0x00FF))*2.8 - 273. )/(Float_t)INTERVAL; |
699 |
temp_gr[card][3][paramEvent] += ( ((ace->temp[card][1] & 0xFF00)/256)*2.8 - 273. )/(Float_t)INTERVAL; |
temp_gr[card][3][paramEvent] += ( ((ace->temp[card][1] & 0xFF00)/256)*2.8 - 273. )/(Float_t)INTERVAL; |
700 |
|
|
701 |
}//if(crc check) |
}//if(crc check) |
702 |
/******************************************************/ |
else{ |
703 |
else |
status_h->Fill(5.+6.*card,1.); //event crc |
704 |
status_h->Fill(5.*card,1.); //event crc |
Err_type.push_back(5+6*card); |
705 |
|
Err_obt.push_back(ph->GetOrbitalTime()); |
706 |
|
Err_evt.push_back(i); |
707 |
|
} |
708 |
}//for(card) |
}//for(card) |
709 |
|
|
710 |
nmbhitpmtCARD_h->Fill(hitsCARD); |
nmbhitpmtCARD_h->Fill(hitsCARD); |
712 |
nmbhitpmtCAT_h->Fill(hitsCAT); |
nmbhitpmtCAT_h->Fill(hitsCAT); |
713 |
|
|
714 |
|
|
|
if(interval_cnt==(Int_t)((Float_t)INTERVAL/2.)) |
|
|
event_obt[paramEvent] = ph->GetOrbitalTime(); |
|
|
|
|
715 |
if(interval_cnt==INTERVAL) |
if(interval_cnt==INTERVAL) |
716 |
{ |
{ |
717 |
for(Int_t card=0;card<2;card++) |
event_obt[paramEvent] = ph->GetOrbitalTime(); |
718 |
|
|
719 |
|
for(card=0;card<2;card++) |
720 |
{ |
{ |
721 |
ac_clock100_old[card] = ac_clock100_new[card]; |
ac_clock100_old[card] = ac_clock100_new[card]; |
722 |
ac_clock100_new[card] = (ace->clock[card][1])*0xFFFF + ace->clock[card][0]; |
ac_clock100_new[card] = (ace->clock[card][1])*0xFFFF + ace->clock[card][0]; |
727 |
|
|
728 |
trigger_gr[card][paramEvent] = (Float_t)INTERVAL/(0.000000025*ac_clock100_diff[card]); |
trigger_gr[card][paramEvent] = (Float_t)INTERVAL/(0.000000025*ac_clock100_diff[card]); |
729 |
|
|
730 |
for(Int_t ch=0;ch<16;ch++) |
for(ch=0;ch<16;ch++) |
731 |
singles_gr[card][ch][paramEvent] = singles_gr[card][ch][paramEvent]/(Double_t)(0.000000025*ac_clock100_diff[card]); |
singles_gr[card][ch][paramEvent] = singles_gr[card][ch][paramEvent]/(Double_t)(0.000000025*ac_clock100_diff[card]); |
732 |
|
|
733 |
}//for(card) |
}//for(card) |
734 |
interval_cnt=0; |
interval_cnt=0; |
735 |
paramEvent++; |
paramEvent++; |
736 |
}//if(interval_cnt)) |
}//if(interval_cnt)) |
737 |
/* |
|
|
for(card=0;card<2;card++) |
|
|
for(Int_t ch=0;ch<16;ch++) |
|
|
for(Int_t bin=0;bin<16;bin++) |
|
|
shiftreg_h[card][ch]->Fill(bin,vec[card][bin][ch]); |
|
|
*/ |
|
738 |
} //for(events) |
} //for(events) |
739 |
|
|
740 |
|
//for(Int_t i=0;i<Err_type.size();i++) |
741 |
|
//printf("%d\t%f\t%d\n\n",Err_type.at(i),Err_obt.at(i),Err_evt.at(i)); |
742 |
|
|
743 |
|
//Time2 = clock(); |
744 |
|
//printf("Loop time: %f\n",(Double_t) (time2 - time1) / (Double_t) CLOCKS_PER_SEC); |
745 |
|
|
746 |
/****************************** PLOTTING ***************************/ |
/****************************** PLOTTING ***************************/ |
747 |
|
|
770 |
pd4->Draw(); |
pd4->Draw(); |
771 |
|
|
772 |
pd4->cd(); |
pd4->cd(); |
|
char *namn2 = "Anticounter Quicklook"; |
|
773 |
char namn3[30]; |
char namn3[30]; |
774 |
sprintf(namn3,"Version %.1f",VERSION); |
char namn4[40]; |
775 |
|
char namn5[30]; |
776 |
|
sprintf(namn3,"Anticounter Quicklook v%.1f",VERSION); |
777 |
|
sprintf(namn4,"File: %s",fileName.Data()); |
778 |
|
sprintf(namn5,"Events: %d",nevents); |
779 |
t->SetTextSize(0.1); |
t->SetTextSize(0.1); |
780 |
t->DrawLatex(20,60,namn2); |
t->DrawLatex(5,90,namn3); |
781 |
t->DrawLatex(20,40,namn3); |
t->SetTextSize(0.1); |
782 |
|
t->DrawLatex(20,50,namn4); |
783 |
|
t->DrawLatex(20,40,namn5); |
784 |
|
|
785 |
t->SetTextSize(0.02); |
t->SetTextSize(0.02); |
786 |
|
|
787 |
pd3->cd(); |
pd3->cd(); |
803 |
temperatureACTEL_M_g->SetMarkerColor(2); |
temperatureACTEL_M_g->SetMarkerColor(2); |
804 |
temperatureLEFT_M_g->SetMarkerColor(3); |
temperatureLEFT_M_g->SetMarkerColor(3); |
805 |
temperatureDSP_M_g->SetMarkerColor(4); |
temperatureDSP_M_g->SetMarkerColor(4); |
806 |
temperatureRIGHT_M_g->Draw("AP"); |
temperatureRIGHT_M_g->SetLineColor(1); |
807 |
temperatureACTEL_M_g->Draw("PSAME"); |
temperatureACTEL_M_g->SetLineColor(2); |
808 |
temperatureLEFT_M_g->Draw("PSAME"); |
temperatureLEFT_M_g->SetLineColor(3); |
809 |
temperatureDSP_M_g->Draw("PSAME"); |
temperatureDSP_M_g->SetLineColor(4); |
810 |
|
temperatureRIGHT_M_g->Draw("AL"); |
811 |
|
temperatureACTEL_M_g->Draw("LSAME"); |
812 |
|
temperatureLEFT_M_g->Draw("LSAME"); |
813 |
|
temperatureDSP_M_g->Draw("LSAME"); |
814 |
|
|
815 |
TLegend *legTempM = new TLegend(0.72,0.63,0.85,0.8); |
TLegend *legTempM = new TLegend(0.72,0.63,0.85,0.8); |
816 |
legTempM->AddEntry(temperatureRIGHT_M_g,"Right","P"); |
legTempM->AddEntry(temperatureRIGHT_M_g,"Right","P"); |
831 |
temperatureACTEL_E_g->SetMarkerColor(2); |
temperatureACTEL_E_g->SetMarkerColor(2); |
832 |
temperatureLEFT_E_g->SetMarkerColor(3); |
temperatureLEFT_E_g->SetMarkerColor(3); |
833 |
temperatureDSP_E_g->SetMarkerColor(4); |
temperatureDSP_E_g->SetMarkerColor(4); |
834 |
|
temperatureRIGHT_E_g->SetLineColor(1); |
835 |
|
temperatureACTEL_E_g->SetLineColor(2); |
836 |
|
temperatureLEFT_E_g->SetLineColor(3); |
837 |
|
temperatureDSP_E_g->SetLineColor(4); |
838 |
|
|
839 |
|
|
840 |
temperatureRIGHT_E_g->SetMaximum(50.); |
temperatureRIGHT_E_g->SetMaximum(50.); |
841 |
temperatureRIGHT_E_g->SetMinimum(0.); |
temperatureRIGHT_E_g->SetMinimum(0.); |
842 |
temperatureRIGHT_E_g->Draw("AP"); |
temperatureRIGHT_E_g->Draw("AL"); |
843 |
temperatureACTEL_E_g->Draw("PSAME"); |
temperatureACTEL_E_g->Draw("LSAME"); |
844 |
temperatureLEFT_E_g->Draw("PSAME"); |
temperatureLEFT_E_g->Draw("LSAME"); |
845 |
temperatureDSP_E_g->Draw("PSAME"); |
temperatureDSP_E_g->Draw("LSAME"); |
846 |
|
|
847 |
TLegend *legTempE = new TLegend(0.72,0.63,0.86,0.8); |
TLegend *legTempE = new TLegend(0.72,0.63,0.86,0.8); |
848 |
legTempE->AddEntry(temperatureRIGHT_E_g,"Right","P"); |
legTempE->AddEntry(temperatureRIGHT_E_g,"Right","L"); |
849 |
legTempE->AddEntry(temperatureACTEL_E_g,"Actel","P"); |
legTempE->AddEntry(temperatureACTEL_E_g,"Actel","L"); |
850 |
legTempE->AddEntry(temperatureLEFT_E_g,"Left","P"); |
legTempE->AddEntry(temperatureLEFT_E_g,"Left","L"); |
851 |
legTempE->AddEntry(temperatureDSP_E_g,"Dsp","P"); |
legTempE->AddEntry(temperatureDSP_E_g,"Dsp","L"); |
852 |
legTempE->Draw(); |
legTempE->Draw(); |
853 |
|
|
854 |
/************************/ |
/************************/ |
887 |
triggM_gr->GetYaxis()->SetTitle("f [Hz]"); |
triggM_gr->GetYaxis()->SetTitle("f [Hz]"); |
888 |
triggM_gr->SetMarkerColor(1); |
triggM_gr->SetMarkerColor(1); |
889 |
triggE_gr->SetMarkerColor(2); |
triggE_gr->SetMarkerColor(2); |
890 |
triggM_gr->Draw("AP"); |
triggM_gr->SetLineColor(1); |
891 |
triggE_gr->Draw("PSAME"); |
triggE_gr->SetLineColor(2); |
892 |
|
triggM_gr->Draw("AL"); |
893 |
|
triggE_gr->Draw("LSAME"); |
894 |
|
|
895 |
pd23->cd(); |
pd23->cd(); |
896 |
gPad->SetLogy(1); |
gPad->SetLogy(1); |
1024 |
singles_Pads[k]->cd(); |
singles_Pads[k]->cd(); |
1025 |
singles_gr[card][det_map[k]][0]=0.0; |
singles_gr[card][det_map[k]][0]=0.0; |
1026 |
singlesrate_g[card][k] = new TGraph(paramEvents,event_obt,singles_gr[card][det_map[k]]); |
singlesrate_g[card][k] = new TGraph(paramEvents,event_obt,singles_gr[card][det_map[k]]); |
1027 |
singlesrate_g[card][k]->SetMarkerColor(card+1); |
singlesrate_g[card][k]->SetLineColor(card+1); |
1028 |
singlesrate_g[card][k]->GetXaxis()->SetTitle("Obt [ms]"); |
singlesrate_g[card][k]->GetXaxis()->SetTitle("Obt [ms]"); |
1029 |
singlesrate_g[card][k]->GetYaxis()->SetTitle("f [Hz]"); |
singlesrate_g[card][k]->GetYaxis()->SetTitle("f [Hz]"); |
1030 |
singlesrate_g[card][k]->SetTitle(detector[det_map[k]].Data()); |
singlesrate_g[card][k]->SetTitle(detector[det_map[k]].Data()); |
1031 |
if(card==0) |
if(card==0) |
1032 |
singlesrate_g[card][k]->Draw("AP"); |
singlesrate_g[card][k]->Draw("AL"); |
1033 |
else |
else |
1034 |
singlesrate_g[card][k]->Draw("PSAME"); |
singlesrate_g[card][k]->Draw("LSAME"); |
1035 |
k++; |
k++; |
1036 |
} |
} |
1037 |
} |
} |
1095 |
} |
} |
1096 |
} |
} |
1097 |
} |
} |
1098 |
|
|
1099 |
|
// Plot error report if any error occurs |
1100 |
|
|
1101 |
|
//char *namn6 = "KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK"; |
1102 |
|
int mposition = 80; |
1103 |
|
int eposition = 80; |
1104 |
|
char *mystring = "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"; |
1105 |
|
TString *merr; |
1106 |
|
TBox *b1,*b2; |
1107 |
|
|
1108 |
|
TCanvas *sheetError; |
1109 |
|
|
1110 |
figsave = Form("%s/%s_AcQLOOK1.%s",outDir.Data(),fileName.Data(),format.Data()); |
if(Err_type.size() > 0) |
1111 |
|
{ |
1112 |
|
merr = new TString[12]; |
1113 |
|
merr[0]="Header"; |
1114 |
|
merr[1]="CRC"; |
1115 |
|
merr[2]="Dsp"; |
1116 |
|
merr[3]="Temp"; |
1117 |
|
merr[4]="Reg"; |
1118 |
|
merr[5]="Event CRC"; |
1119 |
|
merr[6]="Header"; |
1120 |
|
merr[7]="CRC"; |
1121 |
|
merr[8]="Dsp"; |
1122 |
|
merr[9]="Temp"; |
1123 |
|
merr[10]="Reg"; |
1124 |
|
merr[11]="Event CRC"; |
1125 |
|
|
1126 |
|
sheetError = new TCanvas("Sheet Error","Sheet Error"); //base |
1127 |
|
sheetError->Range(0,0,100,100); |
1128 |
|
sheetError->Draw(); |
1129 |
|
b1 = new TBox(10,83.5,90,84.5); |
1130 |
|
b2 = new TBox(49.5,90,50.5,5); |
1131 |
|
b1->SetFillColor(1); |
1132 |
|
b2->SetFillColor(1); |
1133 |
|
b1->Draw(); |
1134 |
|
b2->Draw(); |
1135 |
|
|
1136 |
|
t->SetTextFont(40); |
1137 |
|
t->SetTextColor(1); |
1138 |
|
t->SetTextAlign(12); |
1139 |
|
t->SetTextSize(0.04); |
1140 |
|
namn = "AntiCounter Error Report"; |
1141 |
|
t->DrawLatex(37,94,namn); |
1142 |
|
t->SetTextColor(1); |
1143 |
|
namn = "MAIN card"; |
1144 |
|
t->DrawLatex(15,87,namn); |
1145 |
|
t->SetTextColor(1); |
1146 |
|
namn = "EXTRA card"; |
1147 |
|
t->DrawLatex(65,87,namn); |
1148 |
|
t->SetTextSize(0.015); |
1149 |
|
|
1150 |
|
|
1151 |
|
//for(Int_t i=0;i<Err_type.size();i++) |
1152 |
|
UInt_t iter = 0; |
1153 |
|
while(iter<Err_type.size()) |
1154 |
|
{ |
1155 |
|
mystring = Form("%s error obt %d \t event nmb %d",merr[Err_type.at(iter)].Data(),(int)Err_obt.at(iter),Err_evt.at(iter)); |
1156 |
|
t->SetTextColor(2); |
1157 |
|
if(Err_type.at(iter) < 7 && mposition>10){ |
1158 |
|
mposition -= 2; |
1159 |
|
t->DrawLatex(15,mposition,mystring); |
1160 |
|
} |
1161 |
|
else if(eposition>10){ |
1162 |
|
eposition -= 2; |
1163 |
|
t->DrawLatex(65,eposition,mystring); |
1164 |
|
} |
1165 |
|
iter++; |
1166 |
|
} |
1167 |
|
if(mposition<10) |
1168 |
|
t->DrawLatex(15,5,"More errors in run!"); |
1169 |
|
if(eposition<10) |
1170 |
|
t->DrawLatex(65,5,"More errors in run!"); |
1171 |
|
|
1172 |
|
figsave = Form("%s/%s_AcQLOOK_Error.%s",outDir.Data(),fileName.Data(),format.Data()); |
1173 |
|
sheetError->SaveAs(figsave); |
1174 |
|
} |
1175 |
|
|
1176 |
|
figsave = Form("%s/%s_AcQLOOK_Status.%s",outDir.Data(),fileName.Data(),format.Data()); |
1177 |
sheet1->SaveAs(figsave); |
sheet1->SaveAs(figsave); |
1178 |
|
|
1179 |
figsave = Form("%s/%s_AcQLOOK2.%s",outDir.Data(),fileName.Data(),format.Data()); |
figsave = Form("%s/%s_AcQLOOK_Trigger.%s",outDir.Data(),fileName.Data(),format.Data()); |
1180 |
sheet2->SaveAs(figsave); |
sheet2->SaveAs(figsave); |
1181 |
|
|
1182 |
figsave = Form("%s/%s_AcQLOOK3.%s",outDir.Data(),fileName.Data(),format.Data()); |
figsave = Form("%s/%s_AcQLOOK_Singles.%s",outDir.Data(),fileName.Data(),format.Data()); |
1183 |
sheet3->SaveAs(figsave); |
sheet3->SaveAs(figsave); |
1184 |
|
|
1185 |
figsave = Form("%s/%s_AcQLOOK4.%s",outDir.Data(),fileName.Data(),format.Data()); |
figsave = Form("%s/%s_AcQLOOK_Shift.%s",outDir.Data(),fileName.Data(),format.Data()); |
1186 |
sheet4->SaveAs(figsave); |
sheet4->SaveAs(figsave); |
1187 |
|
|
|
|
|
1188 |
delete sheet1; |
delete sheet1; |
1189 |
delete hitmap_h[0]; |
delete hitmap_h[0]; |
1190 |
delete hitmap_h[1]; |
delete hitmap_h[1]; |
1191 |
|
|
1192 |
|
//stopTime = clock(); |
1193 |
|
//printf("Draw time: %f\n\n",(Double_t) (stopTime - time2) / (Double_t) CLOCKS_PER_SEC); |
1194 |
|
//printf("Exc time: %f\n",(Double_t) (stopTime-startTime) / (Double_t) CLOCKS_PER_SEC); |
1195 |
|
|
1196 |
return 1; |
return 1; |
1197 |
|
|
1198 |
} |
} |
1200 |
|
|
1201 |
int main(int argc, char* argv[]){ |
int main(int argc, char* argv[]){ |
1202 |
TString outDir = "."; |
TString outDir = "."; |
1203 |
TString format = "jpg"; |
TString format = FORMAT; |
1204 |
int from = 0; |
int from = 0; |
1205 |
int to = 0; |
int to = 0; |
1206 |
int mode = 0; |
int mode = 0; |