11 |
#include <TTree.h> |
#include <TTree.h> |
12 |
#include <TStyle.h> |
#include <TStyle.h> |
13 |
#include <TObjString.h> |
#include <TObjString.h> |
14 |
|
#include <TGraph.h> |
15 |
|
#include <TH1.h> |
16 |
|
#include <time.h> |
17 |
|
|
18 |
#include <utils/yodaUtility.h> |
#include <utils/yodaUtility.h> |
19 |
|
|
20 |
#define DEBUG 0 |
#define DEBUG 0 |
21 |
#define VERSION 1.2 |
#define VERSION 1.5 |
22 |
/* |
#define INTERVAL 100 |
23 |
* Anticounter physics quicklook |
#define FORMAT "png" |
|
* Plots a brief status report of the anticounter detectors |
|
|
* see document "Anticounter Quicklook Software" on www.particle.kth.se/~pearce/flight_ac_docs |
|
|
* for more details |
|
|
* |
|
|
* author Petter Hofverberg |
|
|
* version 1.0 |
|
|
* |
|
|
* author Maurizio Nagni |
|
|
* version 1.1 |
|
|
* Adapted for compilation and unique file YODA upacking |
|
|
* |
|
|
* |
|
|
* author Petter Hofverberg |
|
|
* version 1.2 |
|
|
* added a dummy version of the quicklook (-mode 0, default mode) |
|
|
*/ |
|
|
using namespace std; |
|
24 |
|
|
25 |
int AcQLOOK(TString base,int fromevent=0, int toevent=0, TString outDir = "./", TString format = "jpg", int fullversion=0){ |
using namespace std; |
26 |
|
|
27 |
//Int_t tmpSize; |
UInt_t found; |
28 |
ofstream outputFile; |
Int_t minevent,maxevent; |
29 |
stringstream oss; |
UShort_t ACheader[2]; |
30 |
|
TString *cardname = new TString[2]; |
31 |
pamela::anticounter::AnticounterEvent *ace = 0; |
TString *detector = new TString[16]; |
32 |
pamela::EventHeader *eh = 0; |
|
33 |
pamela::PscuHeader *ph = 0; |
|
34 |
TFile *rootFile = new TFile(base); |
int AcQLOOKbasic(TString base,int fromevent=0, int toevent=0, TString outDir = "./", TString format = FORMAT){ |
35 |
|
|
36 |
|
ofstream outputFile; |
37 |
|
stringstream oss; |
38 |
|
|
39 |
|
pamela::anticounter::AnticounterEvent *ace = 0; |
40 |
|
pamela::EventHeader *eh = 0; |
41 |
|
pamela::PscuHeader *ph = 0; |
42 |
|
TFile *rootFile = new TFile(base); |
43 |
if (rootFile->IsZombie()) |
if (rootFile->IsZombie()) |
44 |
exit(-1); |
exit(-1); |
45 |
TString fileName = ((TObjString*)base.Tokenize("\/")->Last())->GetString(); |
TString fileName = ((TObjString*)base.Tokenize('\/')->Last())->GetString(); |
46 |
TString filePath = base; |
TString filePath = base; |
47 |
filePath.ReplaceAll(fileName, ""); |
filePath.ReplaceAll(fileName, ""); |
48 |
fileName.ReplaceAll(".root", ""); |
fileName.ReplaceAll(".root", ""); |
49 |
|
|
50 |
//Takes the tree of the header file |
//Takes the tree of the header file |
51 |
TTree *tr = (TTree*)rootFile->Get("Physics"); |
TTree *tr = (TTree*)rootFile->Get("Physics"); |
52 |
|
|
53 |
|
tr->SetBranchStatus("*",0,&found); //disable all branches |
54 |
|
|
55 |
|
tr->SetBranchStatus("header*",1,&found); |
56 |
|
// printf("header: enabled %i branches \n",found); |
57 |
|
found = 0; |
58 |
|
tr->SetBranchStatus("status*",1,&found); |
59 |
|
// printf("status: enabled %i branches \n",found); |
60 |
|
found = 0; |
61 |
|
tr->SetBranchStatus("hitmap*",1,&found); |
62 |
|
// printf("hitmap: enabled %i branches \n",found); |
63 |
|
found = 0; |
64 |
|
tr->SetBranchStatus("regist*",1,&found); |
65 |
|
// printf("regist: enabled %i branches \n",found); |
66 |
|
found = 0; |
67 |
|
tr->SetBranchStatus("shift*",1,&found); |
68 |
|
// printf("shift: enabled %i branches \n",found); |
69 |
|
found = 0; |
70 |
|
tr->SetBranchStatus("counters*",1,&found); |
71 |
|
// printf("counters: enabled %i branches \n",found); |
72 |
|
found = 0; |
73 |
|
tr->SetBranchStatus("coinc*",1,&found); |
74 |
|
// printf("coinc: enabled %i branches \n",found); |
75 |
|
found = 0; |
76 |
|
tr->SetBranchStatus("trigg*",1,&found); |
77 |
|
// printf("trigg: enabled %i branches \n",found); |
78 |
|
found = 0; |
79 |
|
tr->SetBranchStatus("clock*",1,&found); |
80 |
|
// printf("clock: enabled %i branches \n",found); |
81 |
|
found = 0; |
82 |
|
tr->SetBranchStatus("temp*",1,&found); |
83 |
|
// printf("temp: enabled %i branches \n",found); |
84 |
|
found = 0; |
85 |
|
tr->SetBranchStatus("DAC*",1,&found); |
86 |
|
// printf("DAC: enabled %i branches \n",found); |
87 |
|
found = 0; |
88 |
|
tr->SetBranchStatus("CRC*",1,&found); |
89 |
|
// printf("CRC: enabled %i branches \n",found); |
90 |
|
|
91 |
|
found = 0; |
92 |
|
tr->SetBranchStatus("Pscu*",1,&found); |
93 |
|
// printf("enabled %i branches \n",found); |
94 |
|
found = 0; |
95 |
|
tr->SetBranchStatus("Anticounter*",1,&found); |
96 |
|
// printf("Ac enabled %i branches \n",found); |
97 |
|
found = 0; |
98 |
|
tr->SetBranchStatus("Header*",1,&found); |
99 |
|
// printf("head enabled %i branches \n",found); |
100 |
|
|
101 |
tr->SetBranchAddress("Anticounter", &ace); |
tr->SetBranchAddress("Anticounter", &ace); |
102 |
tr->SetBranchAddress("Header", &eh); |
tr->SetBranchAddress("Header", &eh); |
103 |
|
|
104 |
|
|
|
TString *mtitel = new TString[16]; |
|
|
mtitel[0]="CARD 4"; |
|
|
mtitel[1]="CAT 2"; |
|
|
mtitel[2]="CAS 1"; |
|
|
mtitel[3]="NC"; |
|
|
mtitel[4]="CARD 2"; |
|
|
mtitel[5]="CAT 4"; |
|
|
mtitel[6]="CAS 4"; |
|
|
mtitel[7]="NC"; |
|
|
mtitel[8]="CARD 3"; |
|
|
mtitel[9]="CAT 3"; |
|
|
mtitel[10]="CAS 3"; |
|
|
mtitel[11]="NC"; |
|
|
mtitel[12]="CARD 1"; |
|
|
mtitel[13]="CAT 1"; |
|
|
mtitel[14]="CAS 2"; |
|
|
mtitel[15]="NC"; |
|
|
|
|
|
TString *etitel = new TString[16]; |
|
|
etitel[0]="CARD 4"; |
|
|
etitel[1]="CAT 2"; |
|
|
etitel[2]="CAS 1"; |
|
|
etitel[3]="NC"; |
|
|
etitel[4]="CARD 2"; |
|
|
etitel[5]="CAT 4"; |
|
|
etitel[6]="CAS 4"; |
|
|
etitel[7]="NC"; |
|
|
etitel[8]="CARD 3"; |
|
|
etitel[9]="CAT 3"; |
|
|
etitel[10]="CAS 3"; |
|
|
etitel[11]="NC"; |
|
|
etitel[12]="CARD 1"; |
|
|
etitel[13]="CAT 1"; |
|
|
etitel[14]="CAS 2"; |
|
|
etitel[15]="NC"; |
|
|
|
|
|
//Long64_t |
|
|
int nevents = tr->GetEntries(); |
|
|
|
|
|
//tr->Scan("Pscu.Counter"); |
|
|
if(DEBUG) |
|
|
printf("Number of events: %d\n",nevents); |
|
|
|
|
|
int antal=nevents; |
|
|
|
|
|
/******************Book histograms**********************************************/ |
|
|
if(DEBUG) |
|
|
printf("Book histograms\n"); |
|
|
|
|
|
TH1D *nmbhitpmtCAS = new TH1D("nmbhitpmtCAS","Hit PMTs CAS",8,0.5,8.5); |
|
|
nmbhitpmtCAS->GetXaxis()->SetTitle("Number of hits"); |
|
|
//nmbhitpmtCAS->GetYaxis()->SetTitle("") |
|
|
TH1D *nmbhitpmtCAT = new TH1D("nmbhitpmtCAT","Hit PMTs CAT",8,0.5,8.5); |
|
|
TH1D *nmbhitpmtCARD = new TH1D("nmbhitpmtCARD","Hit PMTs CARD",8,0.5,8.5); |
|
|
|
|
|
//MAIN |
|
|
TH1D *counter1_m = new TH1D("counter1_m","Counter register CARD 4",75,1.,150.); |
|
|
counter1_m->GetXaxis()->SetTitle("rate [Hz]"); |
|
|
counter1_m->GetYaxis()->SetTitle("Events"); |
|
|
//counter1_m->SetBit(TH1D::kCanRebin); |
|
|
TH1D *counter2_m = new TH1D("counter2_m","Counter register CAT 2",75,1.,150.); |
|
|
counter2_m->GetXaxis()->SetTitle("rate [Hz]"); |
|
|
counter2_m->GetYaxis()->SetTitle("Events"); |
|
|
TH1D *counter3_m = new TH1D("counter3_m","Counter register CAS 1",75,1.,150.); |
|
|
TH1D *counter4_m = new TH1D("counter4_m","Counter register NC",75,1.,150.); |
|
|
TH1D *counter5_m = new TH1D("counter5_m","Counter register CARD 2",75,1.,150.); |
|
|
//counter5_m->SetBit(TH1D::kCanRebin); |
|
|
TH1D *counter6_m = new TH1D("counter6_m","Counter register CAT 4",75,1.,150.); |
|
|
TH1D *counter7_m = new TH1D("counter7_m","Counter register CAS 4",75,1.,150.); |
|
|
TH1D *counter8_m = new TH1D("counter8_m","Counter register NC",75,1.,150.); |
|
|
TH1D *counter9_m = new TH1D("counter9_m","Counter register CARD 3",75,1.,150.); |
|
|
TH1D *counter10_m = new TH1D("counter10_m","Counter register CAT 3",75,1.,150.); |
|
|
TH1D *counter11_m = new TH1D("counter11_m","Counter register CAS 3",75,1.,150.); |
|
|
TH1D *counter12_m = new TH1D("counter12_m","Counter register NC",75,1.,150.); |
|
|
TH1D *counter13_m = new TH1D("counter13_m","Counter register CARD 1",75,1.,150.); |
|
|
TH1D *counter14_m = new TH1D("counter14_m","Counter register CAT 1",75,1.,150.); |
|
|
TH1D *counter15_m = new TH1D("counter15_m","Counter register CAS 2",75,1.,150.); |
|
|
TH1D *counter16_m = new TH1D("counter16_m","Counter register NC",75,1.,150.); |
|
|
|
|
|
//EXTRA |
|
|
TH1D *counter1_e = new TH1D("counter1_e","Counter register CARD 4",75,1.,150.); |
|
|
TH1D *counter2_e = new TH1D("counter2_e","Counter register CAT 2",75,1.,150.); |
|
|
TH1D *counter3_e = new TH1D("counter3_e","Counter register CAS 1",75,1.,150.); |
|
|
TH1D *counter4_e = new TH1D("counter4_e","Counter register NC",75,1.,150.); |
|
|
TH1D *counter5_e = new TH1D("counter5_e","Counter register CARD 2",75,1.,150.); |
|
|
TH1D *counter6_e = new TH1D("counter6_e","Counter register CAT 4",75,1.,150.); |
|
|
TH1D *counter7_e = new TH1D("counter7_e","Counter register CAS 4",75,1.,150.); |
|
|
TH1D *counter8_e = new TH1D("counter8_e","Counter register NC",75,1.,150.); |
|
|
TH1D *counter9_e = new TH1D("counter9_e","Counter register CARD 3",75,1.,150.); |
|
|
TH1D *counter10_e = new TH1D("counter10_e","Counter register CAT 3",75,1.,150.); |
|
|
TH1D *counter11_e = new TH1D("counter11_e","Counter register CAS 3",75,1.,150.); |
|
|
TH1D *counter12_e = new TH1D("counter12_e","Counter register NC",75,1.,150.); |
|
|
TH1D *counter13_e = new TH1D("counter13_e","Counter register CARD 1",75,1.,150.); |
|
|
TH1D *counter14_e = new TH1D("counter14_e","Counter register CAT 1",75,1.,150.); |
|
|
TH1D *counter15_e = new TH1D("counter15_e","Counter register CAS 2",75,1.,150.); |
|
|
TH1D *counter16_e = new TH1D("counter16_e","Counter register NC",75,1.,150.); |
|
|
|
|
|
//MAIN |
|
|
TH1D *shift1_m = new TH1D("shift1_m","Shift register CARD 4",16,0.,16.); |
|
|
shift1_m->GetXaxis()->SetTitle("Bin"); |
|
|
shift1_m->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift2_m = new TH1D("shift2_m","Shift register CAT 2",16,0.,16.); |
|
|
shift2_m->GetXaxis()->SetTitle("Bin"); |
|
|
shift2_m->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift3_m = new TH1D("shift3_m","Shift register CAS 1",16,0.,16.); |
|
|
shift3_m->GetXaxis()->SetTitle("Bin"); |
|
|
shift3_m->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift4_m = new TH1D("shift4_m","Shift register NC",16,0.,16.); |
|
|
shift4_m->GetXaxis()->SetTitle("Bin"); |
|
|
shift4_m->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift5_m = new TH1D("shift5_m","Shift register CARD 2",16,0.,16.); |
|
|
shift5_m->GetXaxis()->SetTitle("Bin"); |
|
|
shift5_m->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift6_m = new TH1D("shift6_m","Shift register CAT 4",16,0.,16.); |
|
|
shift6_m->GetXaxis()->SetTitle("Bin"); |
|
|
shift6_m->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift7_m = new TH1D("shift7_m","Shift register CAS 4",16,0.,16.); |
|
|
shift7_m->GetXaxis()->SetTitle("Bin"); |
|
|
shift7_m->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift8_m = new TH1D("shift8_m","Shift register NC",16,0.,16.); |
|
|
shift8_m->GetXaxis()->SetTitle("Bin"); |
|
|
shift8_m->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift9_m = new TH1D("shift9_m","Shift register CARD 3",16,0.,16.); |
|
|
shift9_m->GetXaxis()->SetTitle("Bin"); |
|
|
shift9_m->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift10_m = new TH1D("shift10_m","Shift register CAT 3",16,0.,16.); |
|
|
shift10_m->GetXaxis()->SetTitle("Bin"); |
|
|
shift10_m->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift11_m = new TH1D("shift11_m","Shift register CAS 3",16,0.,16.); |
|
|
shift11_m->GetXaxis()->SetTitle("Bin"); |
|
|
shift11_m->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift12_m = new TH1D("shift12_m","Shift register NC",16,0.,16.); |
|
|
shift12_m->GetXaxis()->SetTitle("Bin"); |
|
|
shift12_m->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift13_m = new TH1D("shift13_m","Shift register CARD 1",16,0.,16.); |
|
|
shift13_m->GetXaxis()->SetTitle("Bin"); |
|
|
shift13_m->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift14_m = new TH1D("shift14_m","Shift register CAT 1",16,0.,16.); |
|
|
shift14_m->GetXaxis()->SetTitle("Bin"); |
|
|
shift14_m->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift15_m = new TH1D("shift15_m","Shift register CAS 2",16,0.,16.); |
|
|
shift15_m->GetXaxis()->SetTitle("Bin"); |
|
|
shift15_m->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift16_m = new TH1D("shift16_m","Shift register NC",16,0.,16.); |
|
|
shift16_m->GetXaxis()->SetTitle("Bin"); |
|
|
shift16_m->GetYaxis()->SetTitle("Content"); |
|
|
|
|
|
//EXTRA |
|
|
TH1D *shift1_e = new TH1D("shift1_e","Shift register 1",16,0.,16.); |
|
|
shift1_e->GetXaxis()->SetTitle("Bin"); |
|
|
shift1_e->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift2_e = new TH1D("shift2_e","Shift register 2",16,0.,16.); |
|
|
shift2_e->GetXaxis()->SetTitle("Bin"); |
|
|
shift2_e->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift3_e = new TH1D("shift3_e","Shift register 3",16,0.,16.); |
|
|
shift3_e->GetXaxis()->SetTitle("Bin"); |
|
|
shift3_e->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift4_e = new TH1D("shift4_e","Shift register 4",16,0.,16.); |
|
|
shift4_e->GetXaxis()->SetTitle("Bin"); |
|
|
shift4_e->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift5_e = new TH1D("shift5_e","Shift register 5",16,0.,16.); |
|
|
shift5_e->GetXaxis()->SetTitle("Bin"); |
|
|
shift5_e->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift6_e = new TH1D("shift6_e","Shift register 6",16,0.,16.); |
|
|
shift6_e->GetXaxis()->SetTitle("Bin"); |
|
|
shift6_e->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift7_e = new TH1D("shift7_e","Shift register 7",16,0.,16.); |
|
|
shift7_e->GetXaxis()->SetTitle("Bin"); |
|
|
shift7_e->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift8_e = new TH1D("shift8_e","Shift register 8",16,0.,16.); |
|
|
shift8_e->GetXaxis()->SetTitle("Bin"); |
|
|
shift8_e->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift9_e = new TH1D("shift9_e","Shift register 9",16,0.,16.); |
|
|
shift9_e->GetXaxis()->SetTitle("Bin"); |
|
|
shift9_e->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift10_e = new TH1D("shift10_e","Shift register 10",16,0.,16.); |
|
|
shift10_e->GetXaxis()->SetTitle("Bin"); |
|
|
shift10_e->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift11_e = new TH1D("shift11_e","Shift register 11",16,0.,16.); |
|
|
shift11_e->GetXaxis()->SetTitle("Bin"); |
|
|
shift11_e->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift12_e = new TH1D("shift12_e","Shift register 12",16,0.,16.); |
|
|
shift12_e->GetXaxis()->SetTitle("Bin"); |
|
|
shift12_e->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift13_e = new TH1D("shift13_e","Shift register 13",16,0.,16.); |
|
|
shift13_e->GetXaxis()->SetTitle("Bin"); |
|
|
shift13_e->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift14_e = new TH1D("shift14_e","Shift register 14",16,0.,16.); |
|
|
shift14_e->GetXaxis()->SetTitle("Bin"); |
|
|
shift14_e->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift15_e = new TH1D("shift15_e","Shift register 15",16,0.,16.); |
|
|
shift15_e->GetXaxis()->SetTitle("Bin"); |
|
|
shift15_e->GetYaxis()->SetTitle("Content"); |
|
|
TH1D *shift16_e = new TH1D("shift16_e","Shift register 16",16,0.,16.); |
|
|
shift16_e->GetXaxis()->SetTitle("Bin"); |
|
|
shift16_e->GetYaxis()->SetTitle("Content"); |
|
|
|
|
|
|
|
|
|
|
|
//MAIN |
|
|
TH1D *head_m = new TH1D("head_m","Status and Headers",10,0.,10.); |
|
|
head_m->GetXaxis()->SetBinLabel(1,"Event CRC M"); |
|
|
head_m->GetXaxis()->SetBinLabel(2,"Headers M"); |
|
|
head_m->GetXaxis()->SetBinLabel(3,"CRC M"); |
|
|
head_m->GetXaxis()->SetBinLabel(4,"Dsp M"); |
|
|
head_m->GetXaxis()->SetBinLabel(5,"Reg M"); |
|
|
head_m->GetXaxis()->SetBinLabel(6,"Event CRC E"); |
|
|
head_m->GetXaxis()->SetBinLabel(7,"Headers E"); |
|
|
head_m->GetXaxis()->SetBinLabel(8,"CRC E"); |
|
|
head_m->GetXaxis()->SetBinLabel(9,"Dsp E"); |
|
|
head_m->GetXaxis()->SetBinLabel(10,"Reg E"); |
|
|
head_m->GetYaxis()->SetTitle("Errors"); |
|
|
head_m->SetMinimum(0); |
|
|
|
|
|
TH1D *hitmap_m = new TH1D("hitmap_m","Hitmap",16,0.,16.); |
|
|
hitmap_m->GetXaxis()->SetBinLabel(1,mtitel[0]); |
|
|
hitmap_m->GetXaxis()->SetBinLabel(2,mtitel[1]); |
|
|
hitmap_m->GetXaxis()->SetBinLabel(3,mtitel[2]); |
|
|
hitmap_m->GetXaxis()->SetBinLabel(4,mtitel[3]); |
|
|
hitmap_m->GetXaxis()->SetBinLabel(5,mtitel[4]); |
|
|
hitmap_m->GetXaxis()->SetBinLabel(6,mtitel[5]); |
|
|
hitmap_m->GetXaxis()->SetBinLabel(7,mtitel[6]); |
|
|
hitmap_m->GetXaxis()->SetBinLabel(8,mtitel[7]); |
|
|
hitmap_m->GetXaxis()->SetBinLabel(9,mtitel[8]); |
|
|
hitmap_m->GetXaxis()->SetBinLabel(10,mtitel[9]); |
|
|
hitmap_m->GetXaxis()->SetBinLabel(11,mtitel[10]); |
|
|
hitmap_m->GetXaxis()->SetBinLabel(12,mtitel[11]); |
|
|
hitmap_m->GetXaxis()->SetBinLabel(13,mtitel[12]); |
|
|
hitmap_m->GetXaxis()->SetBinLabel(14,mtitel[13]); |
|
|
hitmap_m->GetXaxis()->SetBinLabel(15,mtitel[14]); |
|
|
hitmap_m->GetXaxis()->SetBinLabel(16,mtitel[15]); |
|
|
hitmap_m->GetYaxis()->SetTitle("Hits"); |
|
|
|
|
|
TH1D *pmtstatus_m = new TH1D("pmtstatus_m","Coincidence errors MAIN",16,0.,16.); |
|
|
pmtstatus_m->GetXaxis()->SetBinLabel(1,mtitel[0]); |
|
|
pmtstatus_m->GetXaxis()->SetBinLabel(2,mtitel[1]); |
|
|
pmtstatus_m->GetXaxis()->SetBinLabel(3,mtitel[2]); |
|
|
pmtstatus_m->GetXaxis()->SetBinLabel(4,mtitel[3]); |
|
|
pmtstatus_m->GetXaxis()->SetBinLabel(5,mtitel[4]); |
|
|
pmtstatus_m->GetXaxis()->SetBinLabel(6,mtitel[5]); |
|
|
pmtstatus_m->GetXaxis()->SetBinLabel(7,mtitel[6]); |
|
|
pmtstatus_m->GetXaxis()->SetBinLabel(8,mtitel[7]); |
|
|
pmtstatus_m->GetXaxis()->SetBinLabel(9,mtitel[8]); |
|
|
pmtstatus_m->GetXaxis()->SetBinLabel(10,mtitel[9]); |
|
|
pmtstatus_m->GetXaxis()->SetBinLabel(11,mtitel[10]); |
|
|
pmtstatus_m->GetXaxis()->SetBinLabel(12,mtitel[11]); |
|
|
pmtstatus_m->GetXaxis()->SetBinLabel(13,mtitel[12]); |
|
|
pmtstatus_m->GetXaxis()->SetBinLabel(14,mtitel[13]); |
|
|
pmtstatus_m->GetXaxis()->SetBinLabel(15,mtitel[14]); |
|
|
pmtstatus_m->GetXaxis()->SetBinLabel(16,mtitel[15]); |
|
|
pmtstatus_m->GetYaxis()->SetTitle("Errors"); |
|
|
|
|
|
//if(fromevent==0 && toevent==0) |
|
|
TH1D *trigg_m = new TH1D("trigg_m","Trigger dev",antal,0.,antal); |
|
|
/*if(toevent>0 && fromevent>0) |
|
|
TH1D *trigg_m = new TH1D("trigg_m","Trigger dev",toevent-fromevent,fromevent,toevent); |
|
|
if(toevent==0 && fromevent>0) |
|
|
TH1D *trigg_m = new TH1D("trigg_m","Trigger dev",1,fromevent,fromevent+1);*/ |
|
|
//trigg_m->SetMinimum(0); |
|
|
trigg_m->GetYaxis()->SetTitle("Triggers"); |
|
|
trigg_m->GetXaxis()->SetTitle("Event number"); |
|
|
|
|
|
TH1D *timebtrigg_m = new TH1D("timebtrigg_m","Time between triggers",100,0.,5.); |
|
|
//timebtrigg_m->SetBit(TH1D::kCanRebin); |
|
|
timebtrigg_m->GetYaxis()->SetTitle("Events"); |
|
|
timebtrigg_m->GetXaxis()->SetTitle("Time [s]"); |
|
|
|
|
|
//if(fromevent==0 && toevent==0){ |
|
|
TH1D *crc_m = new TH1D("crc_m","crc MAIN",antal,0.,antal); |
|
|
TH1D *headerr_m = new TH1D("headerr_m","headerr_m",antal,0.,antal); |
|
|
TH1D *crcerr_m = new TH1D("crcerr_m","crcerr_m",antal,0.,antal); |
|
|
TH1D *dsperr_m = new TH1D("dsperr_m","dsperr_m",antal,0.,antal); |
|
|
TH1D *regerr_m = new TH1D("regerr_m","regerr_m",antal,0.,antal); |
|
|
//} |
|
|
/* |
|
|
if(toevent>0 && fromevent>0){ |
|
|
TH1D *crc_m = new TH1D("crc_m","crc MAIN",toevent-fromevent,fromevent,toevent); |
|
|
TH1D *headerr_m = new TH1D("headerr_m","headerr_m",toevent-fromevent,fromevent,toevent); |
|
|
TH1D *crcerr_m = new TH1D("crcerr_m","crcerr_m",toevent-fromevent,fromevent,toevent); |
|
|
TH1D *dsperr_m = new TH1D("dsperr_m","dsperr_m",toevent-fromevent,fromevent,toevent); |
|
|
TH1D *regerr_m = new TH1D("regerr_m","regerr_m",toevent-fromevent,fromevent,toevent); |
|
|
} |
|
|
if(toevent==0 && fromevent>0){ |
|
|
TH1D *crc_m = new TH1D("crc_m","crc MAIN",1,fromevent,fromevent+1); |
|
|
TH1D *headerr_m = new TH1D("headerr_m","headerr_m",1,fromevent,fromevent+1); |
|
|
TH1D *crcerr_m = new TH1D("crcerr_m","crcerr_m",1,fromevent,fromevent+1); |
|
|
TH1D *dsperr_m = new TH1D("dsperr_m","dsperr_m",1,fromevent,fromevent+1); |
|
|
TH1D *regerr_m = new TH1D("regerr_m","regerr_m",1,fromevent,fromevent+1); |
|
|
}*/ |
|
|
|
|
|
TH1D *dtrigg_m = new TH1D("dtrigg_m","Trigger increment",10,0.,10.); |
|
|
dtrigg_m->GetYaxis()->SetTitle("Events"); |
|
|
dtrigg_m->GetXaxis()->SetTitle("Trigger increment"); |
|
|
|
|
|
TH1D *timebtrigg_e = new TH1D("timebtrigg_e","Time between triggers EXTRA",100,0.,5.); |
|
|
//timebtrigg_e->SetBit(TH1D::kCanRebin); |
|
|
timebtrigg_e->GetYaxis()->SetTitle("Events"); |
|
|
timebtrigg_e->GetXaxis()->SetTitle("Time [s]"); |
|
|
|
|
|
|
|
|
// if(fromevent==0 && toevent==0){ |
|
|
TH1D *crc_e = new TH1D("crc_e","crc EXTRA",antal,0.,antal); |
|
|
TH1D *headerr_e = new TH1D("headerr_e","headerr_e",antal,0.,antal); |
|
|
TH1D *crcerr_e = new TH1D("crcerr_e","crcerr_e",antal,0.,antal); |
|
|
TH1D *dsperr_e = new TH1D("dsperr_e","dsperr_e",antal,0.,antal); |
|
|
TH1D *regerr_e = new TH1D("regerr_e","regerr_e",antal,0.,antal); |
|
|
//} |
|
|
/* |
|
|
if(toevent>0 && fromevent>0){ |
|
|
TH1D *crc_e = new TH1D("crc_e","crc EXTRA",toevent-fromevent,fromevent,toevent); |
|
|
TH1D *headerr_e = new TH1D("headerr_e","headerr_e",toevent-fromevent,fromevent,toevent); |
|
|
TH1D *crcerr_e = new TH1D("crcerr_e","crcerr_e",toevent-fromevent,fromevent,toevent); |
|
|
TH1D *dsperr_e = new TH1D("dsperr_e","dsperr_e",toevent-fromevent,fromevent,toevent); |
|
|
TH1D *regerr_e = new TH1D("regerr_e","regerr_e",toevent-fromevent,fromevent,toevent); |
|
|
} |
|
|
if(toevent==0 && fromevent>0){ |
|
|
TH1D *crc_e = new TH1D("crc_e","crc EXTRA",1,fromevent,fromevent+1); |
|
|
TH1D *headerr_e = new TH1D("headerr_e","headerr_e",1,fromevent,fromevent+1); |
|
|
TH1D *crcerr_e = new TH1D("crcerr_e","crcerr_e",1,fromevent,fromevent+1); |
|
|
TH1D *dsperr_e = new TH1D("dsperr_e","dsperr_e",1,fromevent,fromevent+1); |
|
|
TH1D *regerr_e = new TH1D("regerr_e","regerr_e",1,fromevent,fromevent+1); |
|
|
}*/ |
|
|
//if(fromevent==0 && toevent==0){ |
|
|
TH1D *T_right_m = new TH1D("T_right_m","Temperature MAIN",antal,0.,antal); |
|
|
TH1D *T_actel_m = new TH1D("T_actel_m","Temperature MAIN",antal,0.,antal); |
|
|
TH1D *T_dsp_m = new TH1D("T_dsp_m","Temperature MAIN",antal,0.,antal); |
|
|
TH1D *T_left_m = new TH1D("T_left_m","Temperature MAIN",antal,0.,antal); |
|
|
//} |
|
|
/* |
|
|
if(fromevent>0 && toevent>0){ |
|
|
TH1D *T_right_m = new TH1D("T_right_m","Temperature MAIN",toevent-fromevent,fromevent,toevent); |
|
|
TH1D *T_actel_m = new TH1D("T_actel_m","Temperature MAIN",toevent-fromevent,fromevent,toevent); |
|
|
TH1D *T_dsp_m = new TH1D("T_dsp_m","Temperature MAIN",toevent-fromevent,fromevent,toevent); |
|
|
TH1D *T_left_m = new TH1D("T_left_m","Temperature MAIN",toevent-fromevent,fromevent,toevent); |
|
|
} |
|
|
if(fromevent>0 && toevent==0){ |
|
|
TH1D *T_right_m = new TH1D("T_right_m","Temperature MAIN",1,fromevent,fromevent+1); |
|
|
TH1D *T_actel_m = new TH1D("T_actel_m","Temperature MAIN",1,fromevent,fromevent+1); |
|
|
TH1D *T_dsp_m = new TH1D("T_dsp_m","Temperature MAIN",1,fromevent,fromevent+1); |
|
|
TH1D *T_left_m = new TH1D("T_left_m","Temperature MAIN",1,fromevent,fromevent+1); |
|
|
} |
|
|
*/ |
|
|
T_right_m->GetXaxis()->SetTitle("Event number"); |
|
|
T_right_m->GetYaxis()->SetTitle("Temp [C]"); |
|
|
T_right_m->SetMinimum(10); |
|
|
T_right_m->SetMaximum(50); |
|
|
//T_actel_m->SetMinimum(0); |
|
|
//T_actel_m->SetMaximum(700); |
|
|
//T_dsp_m->SetMinimum(0); |
|
|
//T_dsp_m->SetMaximum(700); |
|
|
//T_left_m->SetMinimum(0); |
|
|
//T_left_m->SetMaximum(700); |
|
|
|
|
|
//if(fromevent==0 && toevent==0){ |
|
|
TH1D *T_right_e = new TH1D("T_right_e","Temperature EXTRA",antal,0.,antal); |
|
|
TH1D *T_actel_e = new TH1D("T_actel_e","Temperature EXTRA",antal,0.,antal); |
|
|
TH1D *T_dsp_e = new TH1D("T_dsp_e","Temperature EXTRA",antal,0.,antal); |
|
|
TH1D *T_left_e = new TH1D("T_left_e","Temperature EXTRA",antal,0.,antal); |
|
|
//} |
|
|
/* |
|
|
if(fromevent>0 && toevent>0){ |
|
|
TH1D *T_right_e = new TH1D("T_right_e","Temperature EXTRA",toevent-fromevent,fromevent,toevent); |
|
|
TH1D *T_actel_e = new TH1D("T_actel_e","Temperature EXTRA",toevent-fromevent,fromevent,toevent); |
|
|
TH1D *T_dsp_e = new TH1D("T_dsp_e","Temperature EXTRA",toevent-fromevent,fromevent,toevent); |
|
|
TH1D *T_left_e = new TH1D("T_left_e","Temperature EXTRA",toevent-fromevent,fromevent,toevent); |
|
|
} |
|
|
if(fromevent>0 && toevent==0){ |
|
|
TH1D *T_right_e = new TH1D("T_right_e","Temperature EXTRA",1,fromevent,fromevent+1); |
|
|
TH1D *T_actel_e = new TH1D("T_actel_e","Temperature EXTRA",1,fromevent,fromevent+1); |
|
|
TH1D *T_dsp_e = new TH1D("T_dsp_e","Temperature EXTRA",1,fromevent,fromevent+1); |
|
|
TH1D *T_left_e = new TH1D("T_left_e","Temperature EXTRA",1,fromevent,fromevent+1); |
|
|
} |
|
|
*/ |
|
|
T_right_e->GetXaxis()->SetTitle("Event number"); |
|
|
T_right_e->GetYaxis()->SetTitle("Temp [C]"); |
|
|
T_right_e->SetMinimum(10); |
|
|
T_right_e->SetMaximum(50); |
|
|
|
|
|
//EXTRA |
|
|
TH1D *head_e = new TH1D("head_e","Status and Headers",10,0.,10.); |
|
|
head_e->GetXaxis()->SetBinLabel(1,"CRC event M"); |
|
|
head_e->GetXaxis()->SetBinLabel(2,"Headers M"); |
|
|
head_e->GetXaxis()->SetBinLabel(3,"CRC M"); |
|
|
head_e->GetXaxis()->SetBinLabel(4,"Dsp M"); |
|
|
head_e->GetXaxis()->SetBinLabel(5,"Reg M"); |
|
|
head_e->GetXaxis()->SetBinLabel(6,"CRC event E"); |
|
|
head_e->GetXaxis()->SetBinLabel(7,"Headers E"); |
|
|
head_e->GetXaxis()->SetBinLabel(8,"CRC E"); |
|
|
head_e->GetXaxis()->SetBinLabel(9,"Dsp E"); |
|
|
head_e->GetXaxis()->SetBinLabel(10,"Reg E"); |
|
|
head_e->GetYaxis()->SetTitle("Errors"); |
|
|
head_e->SetMinimum(0); |
|
|
|
|
|
/* INTE |
|
|
TH1D *head_e = new TH1D("head_e","Status and Headers",9,0.,9.); |
|
|
head_e->GetXaxis()->SetBinLabel(1,"Status"); |
|
|
head_e->GetXaxis()->SetBinLabel(2,"Reg 0"); |
|
|
head_e->GetXaxis()->SetBinLabel(3,"Reg 1"); |
|
|
head_e->GetXaxis()->SetBinLabel(4,"Reg 2"); |
|
|
head_e->GetXaxis()->SetBinLabel(5,"Reg 3"); |
|
|
head_e->GetXaxis()->SetBinLabel(6,"Reg 4"); |
|
|
head_e->GetXaxis()->SetBinLabel(7,"Reg 5"); |
|
|
head_e->GetXaxis()->SetBinLabel(8,"Head 1"); |
|
|
head_e->GetXaxis()->SetBinLabel(9,"Head 2"); |
|
|
head_e->GetYaxis()->SetTitle("Errors"); |
|
|
*/ |
|
|
|
|
|
TH1D *hitmap_e = new TH1D("hitmap_e","Hitmap EXTRA",16,0.,16.); |
|
|
hitmap_e->GetXaxis()->SetBinLabel(1,etitel[0]); |
|
|
hitmap_e->GetXaxis()->SetBinLabel(2,etitel[1]); |
|
|
hitmap_e->GetXaxis()->SetBinLabel(3,etitel[2]); |
|
|
hitmap_e->GetXaxis()->SetBinLabel(4,etitel[3]); |
|
|
hitmap_e->GetXaxis()->SetBinLabel(5,etitel[4]); |
|
|
hitmap_e->GetXaxis()->SetBinLabel(6,etitel[5]); |
|
|
hitmap_e->GetXaxis()->SetBinLabel(7,etitel[6]); |
|
|
hitmap_e->GetXaxis()->SetBinLabel(8,etitel[7]); |
|
|
hitmap_e->GetXaxis()->SetBinLabel(9,etitel[8]); |
|
|
hitmap_e->GetXaxis()->SetBinLabel(10,etitel[9]); |
|
|
hitmap_e->GetXaxis()->SetBinLabel(11,etitel[10]); |
|
|
hitmap_e->GetXaxis()->SetBinLabel(12,etitel[11]); |
|
|
hitmap_e->GetXaxis()->SetBinLabel(13,etitel[12]); |
|
|
hitmap_e->GetXaxis()->SetBinLabel(14,etitel[13]); |
|
|
hitmap_e->GetXaxis()->SetBinLabel(15,etitel[14]); |
|
|
hitmap_e->GetXaxis()->SetBinLabel(16,etitel[15]); |
|
|
hitmap_e->GetYaxis()->SetTitle("Hits"); |
|
|
|
|
|
TH1D *pmtstatus_e = new TH1D("pmtstatus_e","Coincidence errors EXTRA",16,0.,16.); |
|
|
pmtstatus_e->GetXaxis()->SetBinLabel(1,mtitel[0]); |
|
|
pmtstatus_e->GetXaxis()->SetBinLabel(2,mtitel[1]); |
|
|
pmtstatus_e->GetXaxis()->SetBinLabel(3,mtitel[2]); |
|
|
pmtstatus_e->GetXaxis()->SetBinLabel(4,mtitel[3]); |
|
|
pmtstatus_e->GetXaxis()->SetBinLabel(5,mtitel[4]); |
|
|
pmtstatus_e->GetXaxis()->SetBinLabel(6,mtitel[5]); |
|
|
pmtstatus_e->GetXaxis()->SetBinLabel(7,mtitel[6]); |
|
|
pmtstatus_e->GetXaxis()->SetBinLabel(8,mtitel[7]); |
|
|
pmtstatus_e->GetXaxis()->SetBinLabel(9,mtitel[8]); |
|
|
pmtstatus_e->GetXaxis()->SetBinLabel(10,mtitel[9]); |
|
|
pmtstatus_e->GetXaxis()->SetBinLabel(11,mtitel[10]); |
|
|
pmtstatus_e->GetXaxis()->SetBinLabel(12,mtitel[11]); |
|
|
pmtstatus_e->GetXaxis()->SetBinLabel(13,mtitel[12]); |
|
|
pmtstatus_e->GetXaxis()->SetBinLabel(14,mtitel[13]); |
|
|
pmtstatus_e->GetXaxis()->SetBinLabel(15,mtitel[14]); |
|
|
pmtstatus_e->GetXaxis()->SetBinLabel(16,mtitel[15]); |
|
|
pmtstatus_e->GetYaxis()->SetTitle("Errors"); |
|
|
|
|
|
//if(fromevent==0 && toevent==0) |
|
|
TH1D *trigg_e = new TH1D("trigg_e","Triggers EXTRA",antal,0.,antal); |
|
|
//if(fromevent>0 && toevent>0) |
|
|
//TH1D *trigg_e = new TH1D("trigg_e","Triggers EXTRA",toevent-fromevent,fromevent,toevent); |
|
|
// if(fromevent>0 && toevent==0) |
|
|
//TH1D *trigg_e = new TH1D("trigg_e","Triggers EXTRA",1,fromevent,fromevent+1); |
|
|
trigg_e->GetYaxis()->SetTitle("Triggers"); |
|
|
trigg_e->GetXaxis()->SetTitle("Event number"); |
|
|
TH1D *dtrigg_e = new TH1D("dtrigg_e","Trigger increment EXTRA",10,0.,10.); |
|
|
dtrigg_e->GetYaxis()->SetTitle("Events"); |
|
|
dtrigg_e->GetXaxis()->SetTitle("Trigger increment"); |
|
|
|
|
|
|
|
|
|
|
|
/********************************************************************************/ |
|
|
|
|
|
//Long64_t nevents = tr->GetEntries(); |
|
|
//Int_t mintime = tr->GetMinimum("Pscu.OrbitalTime"); |
|
|
//Int_t maxtime = tr->GetMaximum("Pscu.OrbitalTime"); |
|
|
//Int_t nbintime = (maxtime-mintime)/1000; |
|
|
char *error; |
|
|
error=" this is a very long line of characters as workaround "; |
|
|
|
|
|
/*******************Declarations*****************/ |
|
|
if(DEBUG) |
|
|
printf("Declarate variables\n"); |
|
|
//cout << "Events: " << nevents << endl; |
|
|
//const Int_t size = nevents; |
|
|
//cout << "entries: " << size << endl; |
|
|
//printf("nentries %d\n",size); |
|
|
Double_t cputime; |
|
|
UShort_t cnt = 1; |
|
|
//unsigned int CRCcheck[2]; |
|
|
//unsigned int wordbuf[2][63]; |
|
|
|
|
|
int totevents=0; |
|
|
int crcevents[2]; |
|
|
crcevents[0]=0; |
|
|
crcevents[1]=0; |
|
|
|
|
|
UShort_t CRCcheck[2]; |
|
|
UShort_t Status[2]; |
|
|
UShort_t Reg[2][6]; |
|
|
UShort_t Header[2][2]; |
|
|
UShort_t Hitmap[2]; |
|
|
UShort_t Trigger[2]; |
|
|
Short_t Trigg_old[2]={-1,-1}; |
|
|
UShort_t Temp[2][4]; |
|
|
|
|
|
UShort_t timeLSB[2]; |
|
|
UShort_t timeMSB[2]; |
|
|
Double_t time[2]; |
|
|
Double_t tid1[2]; |
|
|
Double_t tid2[2]; |
|
|
Double_t tid3[2]; |
|
|
|
|
|
Int_t Counter[2][16]; |
|
|
Int_t Counter1[2][16]; |
|
|
Int_t Counter2[2][16]; |
|
|
Int_t Counter3[2][16]; |
|
|
Double_t rate[2][16]; |
|
|
Double_t rate10[2][16]; |
|
|
Int_t rate10cnt[2][16]; |
|
|
Int_t cntmltp=10; |
|
|
|
|
|
UShort_t Shift[2][16]; |
|
|
int tmp; |
|
|
int vec[2][16][16]; |
|
|
//UShort_t pack[2][16]; |
|
|
int hitsCAS,hitsCAT,hitsCARD; |
|
|
|
|
|
|
|
|
//UShort_t timeLSB[2]; |
|
|
//UShort_t timeMSB[2]; |
|
|
//Double_t time[2]; |
|
|
//Double_t tid1[2]; |
|
|
//Double_t tid2[2]; |
|
|
//Double_t tid3[2]; |
|
105 |
|
|
106 |
//Double_t hits_x[size],hits_y_m[size],hits_y_e[size]; |
|
107 |
|
Int_t nevents = tr->GetEntries(); |
108 |
/*************************************************/ |
|
109 |
|
//check that the selected range of events is ok |
110 |
|
|
|
// |
|
|
// run over each event and take out some variables |
|
|
// |
|
111 |
if ( fromevent > toevent && toevent ){ |
if ( fromevent > toevent && toevent ){ |
|
printf("It must be fromevent < toevent \n"); |
|
112 |
return -1; |
return -1; |
113 |
}; |
}; |
|
|
|
|
|
|
114 |
if ( fromevent > nevents || fromevent < 0 ) { |
if ( fromevent > nevents || fromevent < 0 ) { |
|
//printf("You can choose fromevent between 0 (all) and %d \n",nevents); |
|
115 |
return -1; |
return -1; |
116 |
}; |
}; |
|
|
|
117 |
if ( toevent > nevents || toevent < 0 ) { |
if ( toevent > nevents || toevent < 0 ) { |
|
//printf("You can choose toevent between 0 (all) and %d \n",nevents); |
|
118 |
return -1; |
return -1; |
119 |
}; |
}; |
120 |
int minevent,maxevent; |
|
121 |
if ( fromevent == 0 ) { |
if ( fromevent == 0 ) { |
122 |
minevent = 0; |
minevent = 0; |
123 |
maxevent = nevents; |
maxevent = nevents; |
130 |
}; |
}; |
131 |
}; |
}; |
132 |
|
|
133 |
//strange bug, this line have to be here... |
/******************* VARIABLE DECLARATION ***************/ |
|
//CRC=crc(CRC,0x0); |
|
134 |
|
|
135 |
//int what=0; |
ACheader[0]=0xAC11; |
136 |
|
ACheader[1]=0xAC22; |
137 |
|
|
138 |
if(DEBUG) |
detector[0]="CARD 4"; |
139 |
printf("Zero variables\n"); |
detector[1]="CAT 2"; |
140 |
|
detector[2]="CAS 1"; |
141 |
|
detector[3]="NC"; |
142 |
|
detector[4]="CARD 2"; |
143 |
|
detector[5]="CAT 4"; |
144 |
|
detector[6]="CAS 4"; |
145 |
|
detector[7]="NC"; |
146 |
|
detector[8]="CARD 3"; |
147 |
|
detector[9]="CAT 3"; |
148 |
|
detector[10]="CAS 3"; |
149 |
|
detector[11]="NC"; |
150 |
|
detector[12]="CARD 1"; |
151 |
|
detector[13]="CAT 1"; |
152 |
|
detector[14]="CAS 2"; |
153 |
|
detector[15]="NC"; |
154 |
|
|
155 |
|
|
156 |
|
/******************** HISTOGRAM DECLARATION *************/ |
157 |
|
|
158 |
|
TH1D *hitmap_h[2]; |
159 |
|
hitmap_h[0] = new TH1D("Hitmap MAIN","Hitmap",16,0.,16.); |
160 |
|
hitmap_h[1] = new TH1D("Hitmap EXTRA","Hitmap",16,0.,16.); |
161 |
|
|
162 |
for(Int_t b=0;b<2;b++){ |
TH1D *status_h = new TH1D("Status","Status",10,0.,10.); |
163 |
for(Int_t a=0;a<16;a++){ |
|
164 |
rate10[b][a]=0; |
/********************* MAIN LOOP **********************/ |
|
rate10cnt[b][a]=0; |
|
|
} |
|
|
} |
|
|
//Go through all events and update histograms and plots |
|
|
//for (Int_t i = 0; i < nevents; i++){ |
|
|
if(fullversion) |
|
|
{ |
|
|
if(DEBUG) |
|
|
printf("Start looping over events (FULL VERSION)\n"); |
|
|
for (Int_t i = minevent; i < maxevent; i++){ |
|
|
//printf("1"); |
|
|
//printf("%d%c",100*(i-minevent)/(maxevent-minevent),37); |
|
|
//printf("2"); |
|
|
//fflush(stdout); |
|
|
ph = eh->GetPscuHeader(); |
|
|
cputime = ph->GetOrbitalTime(); |
|
|
if(DEBUG) |
|
|
printf("Processing event %d\n",i); |
|
|
tr->GetEntry(i); |
|
|
|
|
|
totevents=totevents+1; |
|
|
|
|
|
//CRC check |
|
|
CRCcheck[0]=ace->CRCcheck[0]; |
|
|
CRCcheck[1]=ace->CRCcheck[1]; |
|
|
if(CRCcheck[0]==0) |
|
|
{ |
|
|
head_m->Fill(0.0); |
|
|
crcevents[0]++; |
|
|
} |
|
|
if(CRCcheck[1]==0) |
|
|
{ |
|
|
head_e->Fill(5.0); |
|
|
crcevents[1]++; |
|
|
} |
|
|
|
|
|
if(DEBUG) |
|
|
printf("Fetch parameters\n"); |
|
|
//fetch parameters |
|
|
for(Int_t b = 0; b<2; b++){ |
|
|
for(Int_t j = 0; j < 16; j++){ |
|
|
Shift[b][j] = ace->shift[b][j]; |
|
|
} |
|
|
} |
|
|
|
|
|
cnt=1; |
|
|
for(Int_t b = 0; b < 2; b++){ //card |
|
|
for(Int_t k = 0; k < 16; k++){ //shift register |
|
|
for(Int_t l = 0; l < 16; l++){ //bin |
|
|
tmp = ((Shift[b][k] & cnt) > 0 ? 1 : 0); |
|
|
vec[b][k][l]=tmp; |
|
|
cnt=cnt<<1; |
|
|
} |
|
|
cnt=1; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//fetch parameters |
|
|
for(int b = 0; b<2; b++){ |
|
|
//cout << ace->status << endl; |
|
|
timeLSB[b] = ace->clock[b][0]; |
|
|
timeMSB[b] = ace->clock[b][1]; |
|
|
|
|
|
Status[b] = ace->status[b]; |
|
|
for(Int_t j = 0; j < 6; j++) |
|
|
Reg[b][j] = ace->regist[b][j]; |
|
|
Header[b][0] = ace->header[b][0]; |
|
|
Header[b][1] = ace->header[b][1]; |
|
|
Hitmap[b] = ace->hitmap[b]; |
|
|
|
|
|
Trigger[b] = ace->trigg[b]; |
|
|
Temp[b][0] = ((ace->temp[b][0]) & 0x00FF); |
|
|
Temp[b][1] = ((ace->temp[b][0]) & 0xFF00)/256; |
|
|
Temp[b][2] = ((ace->temp[b][1]) & 0x00FF); |
|
|
Temp[b][3] = ((ace->temp[b][1]) & 0xFF00)/256; |
|
|
for(Int_t j = 0; j < 16; j++) |
|
|
Counter[b][j] = ace->counters[b][j]; |
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
hitsCAS=hitsCAT=hitsCARD=0; |
|
|
for(int b=0;b<2;b++) |
|
|
{ |
|
|
if((Hitmap[b] & 0x0001) > 0) hitsCARD++; |
|
|
if((Hitmap[b] & 0x0002) > 0) hitsCAT++; |
|
|
if((Hitmap[b] & 0x0004) > 0) hitsCAS++; |
|
|
if((Hitmap[b] & 0x0010) > 0) hitsCARD++; |
|
|
if((Hitmap[b] & 0x0020) > 0) hitsCAT++; |
|
|
if((Hitmap[b] & 0x0040) > 0) hitsCAS++; |
|
|
if((Hitmap[b] & 0x0100) > 0) hitsCARD++; |
|
|
if((Hitmap[b] & 0x0200) > 0) hitsCAT++; |
|
|
if((Hitmap[b] & 0x0400) > 0) hitsCAS++; |
|
|
if((Hitmap[b] & 0x1000) > 0) hitsCARD++; |
|
|
if((Hitmap[b] & 0x2000) > 0) hitsCAT++; |
|
|
if((Hitmap[b] & 0x4000) > 0) hitsCAS++; |
|
|
} |
|
|
cnt=1; |
|
|
//check that both PMTs have seen events, and if not, increment histogram with 1. |
|
|
/* |
|
|
if((ace->CRCcheck[0])==1 && (ace->CRCcheck[1])==1){ |
|
|
|
|
|
//hits_x[i-minevent] = cputime; |
|
|
//hits_y_m[i-minevent] = ace->trigg[0]; |
|
|
//hits_y_e[i-minevent] = ace->trigg[1]; |
|
|
|
|
|
for(int j=0;j<16;j++){ |
|
|
if((Hitmap[0] & cnt) > 0){ |
|
|
//cout << "E" << endl; |
|
|
if((Hitmap[1] & cnt) == 0){ |
|
|
pmtstatus_e->Fill(j,1.); |
|
|
//cout << "E filled" << endl; |
|
|
} |
|
|
} |
|
|
if((Hitmap[1] & cnt) > 0){ |
|
|
//cout << "M" << endl; |
|
|
if((Hitmap[0] & cnt) == 0){ |
|
|
pmtstatus_m->Fill(j,1.); |
|
|
//cout << "M filled" << endl; |
|
|
} |
|
|
} |
|
|
cnt=cnt<<1; |
|
|
} |
|
|
} |
|
|
*/ |
|
|
cnt=1; |
|
|
|
|
|
|
|
|
//tempL=hex>>8; |
|
|
//tempR=hex-(tempL<<8); |
|
|
if(DEBUG) |
|
|
printf("Calc time b events\n"); |
|
|
//time between events (tid3[b]) |
|
|
for(Int_t b = 0; b<2; b++){ |
|
|
time[b]=(timeMSB[b]*(pow(2,16))+timeLSB[b]); |
|
|
|
|
|
if(i==minevent) |
|
|
tid1[b]=time[b]; |
|
|
else{ |
|
|
tid2[b]=tid1[b]; |
|
|
tid1[b]=time[b]; |
|
|
} |
|
|
if(tid1[b]<tid2[b]) |
|
|
tid2[b]=tid2[b]-4294967294; |
|
|
|
|
|
tid3[b]=(tid1[b]-tid2[b])/(25*1000000); |
|
|
//printf("%f\n",tid3[b]); |
|
|
} |
|
|
|
|
|
|
|
|
//number of counts between events Counter3[b][j] -> rate[b][j] |
|
|
for(Int_t b=0;b<2;b++){ |
|
|
for(Int_t j = 0; j < 16; j++){ |
|
|
if(i==minevent) |
|
|
Counter1[b][j]=Counter[b][j]; |
|
|
else{ |
|
|
Counter2[b][j]=Counter1[b][j]; |
|
|
Counter1[b][j]=Counter[b][j]; |
|
|
} |
|
|
Counter3[b][j]=Counter1[b][j]-Counter2[b][j]; |
|
|
if(Counter3[b][j]<0) |
|
|
Counter3[b][j]=Counter3[b][j]+65535; |
|
|
if(tid3[b]>0){ |
|
|
rate[b][j]=Counter3[b][j]/tid3[b]; |
|
|
rate10[b][j]=rate10[b][j]+rate[b][j]; |
|
|
rate10cnt[b][j]=rate10cnt[b][j]+1; |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
//fill histograms MAIN |
|
|
if(DEBUG) |
|
|
printf("Fill histogram MAIN\n"); |
|
|
|
|
|
if(CRCcheck[0]==CRCcheck[1]==1) |
|
|
{ |
|
|
nmbhitpmtCAS->Fill(hitsCAS,1); |
|
|
nmbhitpmtCAT->Fill(hitsCAT,1); |
|
|
nmbhitpmtCARD->Fill(hitsCARD,1); |
|
|
} |
|
|
if(CRCcheck[0]==1) |
|
|
{ |
|
|
for(Int_t j = 0; j < 16; j++){ |
|
|
shift1_m->Fill(j,vec[0][j][0]); |
|
|
shift2_m->Fill(j,vec[0][j][1]); |
|
|
shift3_m->Fill(j,vec[0][j][2]); |
|
|
shift4_m->Fill(j,vec[0][j][3]); |
|
|
shift5_m->Fill(j,vec[0][j][4]); |
|
|
shift6_m->Fill(j,vec[0][j][5]); |
|
|
shift7_m->Fill(j,vec[0][j][6]); |
|
|
shift8_m->Fill(j,vec[0][j][7]); |
|
|
shift9_m->Fill(j,vec[0][j][8]); |
|
|
shift10_m->Fill(j,vec[0][j][9]); |
|
|
shift11_m->Fill(j,vec[0][j][10]); |
|
|
shift12_m->Fill(j,vec[0][j][11]); |
|
|
shift13_m->Fill(j,vec[0][j][12]); |
|
|
shift14_m->Fill(j,vec[0][j][13]); |
|
|
shift15_m->Fill(j,vec[0][j][14]); |
|
|
shift16_m->Fill(j,vec[0][j][15]); |
|
|
} |
|
|
} |
|
|
|
|
|
//fill histograms EXTRA |
|
|
if(DEBUG) |
|
|
printf("Fill histogram EXTRA\n"); |
|
|
if(CRCcheck[1]==1) |
|
|
{ |
|
|
for(Int_t j = 0; j < 16; j++){ |
|
|
shift1_e->Fill(j,vec[1][j][0]); |
|
|
shift2_e->Fill(j,vec[1][j][1]); |
|
|
shift3_e->Fill(j,vec[1][j][2]); |
|
|
shift4_e->Fill(j,vec[1][j][3]); |
|
|
shift5_e->Fill(j,vec[1][j][4]); |
|
|
shift6_e->Fill(j,vec[1][j][5]); |
|
|
shift7_e->Fill(j,vec[1][j][6]); |
|
|
shift8_e->Fill(j,vec[1][j][7]); |
|
|
shift9_e->Fill(j,vec[1][j][8]); |
|
|
shift10_e->Fill(j,vec[1][j][9]); |
|
|
shift11_e->Fill(j,vec[1][j][10]); |
|
|
shift12_e->Fill(j,vec[1][j][11]); |
|
|
shift13_e->Fill(j,vec[1][j][12]); |
|
|
shift14_e->Fill(j,vec[1][j][13]); |
|
|
shift15_e->Fill(j,vec[1][j][14]); |
|
|
shift16_e->Fill(j,vec[1][j][15]); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(((ace->CRCcheck[0])==1) && (ace->CRC[0]!=0)){ |
|
|
if((Header[0][0] != 0xACAC) || (Header[0][1] != 0xAC11)){ |
|
|
head_m->Fill(1.,1); |
|
|
headerr_m->Fill(i,Trigger[0]);} |
|
|
if((Status[0] & 0x8000) < 0x8000){ |
|
|
head_m->Fill(2.,1); |
|
|
crcerr_m->Fill(i,Trigger[0]);} |
|
|
if((Status[0] & 0x4000) < 0x4000){ |
|
|
head_m->Fill(3.,1); |
|
|
dsperr_m->Fill(i,Trigger[0]);} |
|
|
if((Status[0] & 0x01FF) < 0x01FF){ |
|
|
head_m->Fill(4.,1); |
|
|
regerr_m->Fill(i,Trigger[0]);} |
|
|
T_right_m->Fill(i,Temp[0][0]*2.8-273.); |
|
|
T_actel_m->Fill(i,Temp[0][1]*2.8-273.); |
|
|
T_dsp_m->Fill(i,Temp[0][2]*2.8-273.); |
|
|
T_left_m->Fill(i,Temp[0][3]*2.8-273.); |
|
|
trigg_m->Fill(i,Trigger[0]); |
|
|
dtrigg_m->Fill(Trigger[0]-Trigg_old[0],Trigg_old[0] == -1 ? 0 : 1); |
|
|
Trigg_old[0]=Trigger[0]; |
|
|
timebtrigg_m->Fill(tid3[0],1.); |
|
|
|
|
|
|
|
|
if(DEBUG) |
|
|
printf("Calculate rates\n"); |
|
|
if(i!=minevent){ |
|
|
//fill histograms MAIN |
|
|
if(rate10cnt[0][0]==cntmltp){ |
|
|
counter1_m->Fill(rate10[0][0]/10.,1); |
|
|
//printf("rate :%d\n",rate10[0][0]); |
|
|
rate10cnt[0][0]=0; |
|
|
rate10[0][0]=0; |
|
|
} |
|
|
if(rate10cnt[0][1]==cntmltp){ |
|
|
counter2_m->Fill(rate10[0][1]/10.,1); |
|
|
rate10cnt[0][1]=0; |
|
|
rate10[0][1]=0; |
|
|
} |
|
|
if(rate10cnt[0][2]==cntmltp){ |
|
|
counter3_m->Fill(rate10[0][2]/10.,1); |
|
|
rate10cnt[0][2]=0; |
|
|
rate10[0][2]=0; |
|
|
} |
|
|
if(rate10cnt[0][3]==cntmltp){ |
|
|
counter4_m->Fill(rate10[0][3]/10.,1); |
|
|
rate10cnt[0][3]=0; |
|
|
rate10[0][3]=0; |
|
|
} |
|
|
if(rate10cnt[0][4]==cntmltp){ |
|
|
counter5_m->Fill(rate10[0][4]/10.,1); |
|
|
rate10cnt[0][4]=0; |
|
|
rate10[0][4]=0; |
|
|
} |
|
|
if(rate10cnt[0][5]==cntmltp){ |
|
|
counter6_m->Fill(rate10[0][5]/10.,1); |
|
|
rate10cnt[0][5]=0; |
|
|
rate10[0][5]=0; |
|
|
} |
|
|
if(rate10cnt[0][6]==cntmltp){ |
|
|
counter7_m->Fill(rate10[0][6]/10.,1); |
|
|
rate10cnt[0][6]=0; |
|
|
rate10[0][6]=0; |
|
|
} |
|
|
if(rate10cnt[0][7]==cntmltp){ |
|
|
counter8_m->Fill(rate10[0][7]/10.,1); |
|
|
rate10cnt[0][7]=0; |
|
|
rate10[0][7]=0; |
|
|
} |
|
|
if(rate10cnt[0][8]==cntmltp){ |
|
|
counter9_m->Fill(rate10[0][8]/10.,1); |
|
|
rate10cnt[0][8]=0; |
|
|
rate10[0][8]=0; |
|
|
} |
|
|
if(rate10cnt[0][9]==cntmltp){ |
|
|
counter10_m->Fill(rate10[0][9]/10.,1); |
|
|
rate10cnt[0][9]=0; |
|
|
rate10[0][9]=0; |
|
|
} |
|
|
if(rate10cnt[0][10]==cntmltp){ |
|
|
counter11_m->Fill(rate10[0][10]/10.,1); |
|
|
rate10cnt[0][10]=0; |
|
|
rate10[0][10]=0; |
|
|
} |
|
|
if(rate10cnt[0][11]==cntmltp){ |
|
|
counter12_m->Fill(rate10[0][11]/10.,1); |
|
|
rate10cnt[0][11]=0; |
|
|
rate10[0][11]=0; |
|
|
} |
|
|
if(rate10cnt[0][12]==cntmltp){ |
|
|
counter13_m->Fill(rate10[0][12]/10.,1); |
|
|
rate10cnt[0][12]=0; |
|
|
rate10[0][12]=0; |
|
|
} |
|
|
if(rate10cnt[0][13]==cntmltp){ |
|
|
counter14_m->Fill(rate10[0][13]/10.,1); |
|
|
rate10cnt[0][13]=0; |
|
|
rate10[0][13]=0; |
|
|
} |
|
|
if(rate10cnt[0][14]==cntmltp){ |
|
|
counter15_m->Fill(rate10[0][14]/10.,1); |
|
|
rate10cnt[0][14]=0; |
|
|
rate10[0][14]=0; |
|
|
} |
|
|
if(rate10cnt[0][15]==cntmltp){ |
|
|
counter16_m->Fill(rate10[0][15]/10,1); |
|
|
rate10cnt[0][15]=0; |
|
|
rate10[0][15]=0; |
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
//fill histograms EXTRA |
|
|
if(((ace->CRCcheck[1])==1) && (ace->CRC[1]!=0)){ |
|
|
if((Header[1][0] != 0xACAC) || (Header[1][1] != 0xAC22)){ |
|
|
head_e->Fill(6.,1); |
|
|
headerr_e->Fill(i,Trigger[1]); |
|
|
//headerr_e->Fill(i,testtrigg); |
|
|
//cout << "i: " << i << " Trigger: " << Trigger[1] << endl; |
|
|
} |
|
|
if((Status[1] & 0x8000) < 0x8000){ |
|
|
head_e->Fill(7.,1); |
|
|
crcerr_e->Fill(i,Trigger[1]);} |
|
|
if((Status[1] & 0x4000) < 0x4000){ |
|
|
head_e->Fill(8.,1); |
|
|
dsperr_e->Fill(i,Trigger[1]);} |
|
|
if((Status[1] & 0x01FF) < 0x01FF){ |
|
|
head_e->Fill(9.,1); |
|
|
regerr_e->Fill(i,Trigger[1]);} |
|
|
T_right_e->Fill(i,Temp[1][0]*2.8-273.); |
|
|
T_actel_e->Fill(i,Temp[1][1]*2.8-273.); |
|
|
T_dsp_e->Fill(i,Temp[1][2]*2.8-273.); |
|
|
T_left_e->Fill(i,Temp[1][3]*2.8-273.); |
|
|
trigg_e->Fill(i,Trigger[1]); |
|
|
dtrigg_e->Fill(Trigger[1]-Trigg_old[1],Trigg_old[1] == -1 ? 0 : 1); |
|
|
Trigg_old[1]=Trigger[1]; |
|
|
timebtrigg_e->Fill(tid3[1],1.); |
|
|
|
|
|
if(i!=minevent){ |
|
|
//fill histograms EXTRA |
|
|
if(rate10cnt[1][0]==cntmltp){ |
|
|
counter1_e->Fill(rate10[1][0]/10.,1); |
|
|
//printf("rate :%d\n",rate10[1][0]); |
|
|
rate10cnt[1][0]=0; |
|
|
rate10[1][0]=0; |
|
|
} |
|
|
if(rate10cnt[1][1]==cntmltp){ |
|
|
counter2_e->Fill(rate10[1][1]/10.,1); |
|
|
rate10cnt[1][1]=0; |
|
|
rate10[1][1]=0; |
|
|
} |
|
|
if(rate10cnt[1][2]==cntmltp){ |
|
|
counter3_e->Fill(rate10[1][2]/10.,1); |
|
|
rate10cnt[1][2]=0; |
|
|
rate10[1][2]=0; |
|
|
} |
|
|
if(rate10cnt[1][3]==cntmltp){ |
|
|
counter4_e->Fill(rate10[1][3]/10.,1); |
|
|
rate10cnt[1][3]=0; |
|
|
rate10[1][3]=0; |
|
|
} |
|
|
if(rate10cnt[1][4]==cntmltp){ |
|
|
counter5_e->Fill(rate10[1][4]/10.,1); |
|
|
rate10cnt[1][4]=0; |
|
|
rate10[1][4]=0; |
|
|
} |
|
|
if(rate10cnt[1][5]==cntmltp){ |
|
|
counter6_e->Fill(rate10[1][5]/10.,1); |
|
|
rate10cnt[1][5]=0; |
|
|
rate10[1][5]=0; |
|
|
} |
|
|
if(rate10cnt[1][6]==cntmltp){ |
|
|
counter7_e->Fill(rate10[1][6]/10.,1); |
|
|
rate10cnt[1][6]=0; |
|
|
rate10[1][6]=0; |
|
|
} |
|
|
if(rate10cnt[1][7]==cntmltp){ |
|
|
counter8_e->Fill(rate10[1][7]/10.,1); |
|
|
rate10cnt[1][7]=0; |
|
|
rate10[1][7]=0; |
|
|
} |
|
|
if(rate10cnt[1][8]==cntmltp){ |
|
|
counter9_e->Fill(rate10[1][8]/10.,1); |
|
|
rate10cnt[1][8]=0; |
|
|
rate10[1][8]=0; |
|
|
} |
|
|
if(rate10cnt[1][9]==cntmltp){ |
|
|
counter10_e->Fill(rate10[1][9]/10.,1); |
|
|
rate10cnt[1][9]=0; |
|
|
rate10[1][9]=0; |
|
|
} |
|
|
if(rate10cnt[1][10]==cntmltp){ |
|
|
counter11_e->Fill(rate10[1][10]/10.,1); |
|
|
rate10cnt[1][10]=0; |
|
|
rate10[1][10]=0; |
|
|
} |
|
|
if(rate10cnt[1][11]==cntmltp){ |
|
|
counter12_e->Fill(rate10[1][11]/10.,1); |
|
|
rate10cnt[1][11]=0; |
|
|
rate10[1][11]=0; |
|
|
} |
|
|
if(rate10cnt[1][12]==cntmltp){ |
|
|
counter13_e->Fill(rate10[1][12]/10.,1); |
|
|
rate10cnt[1][12]=0; |
|
|
rate10[1][12]=0; |
|
|
} |
|
|
if(rate10cnt[1][13]==cntmltp){ |
|
|
counter14_e->Fill(rate10[1][13]/10.,1); |
|
|
rate10cnt[1][13]=0; |
|
|
rate10[1][13]=0; |
|
|
} |
|
|
if(rate10cnt[1][14]==cntmltp){ |
|
|
counter15_e->Fill(rate10[1][14]/10.,1); |
|
|
rate10cnt[1][14]=0; |
|
|
rate10[1][14]=0; |
|
|
} |
|
|
if(rate10cnt[1][15]==cntmltp){ |
|
|
counter16_e->Fill(rate10[1][15]/10,1); |
|
|
rate10cnt[1][15]=0; |
|
|
rate10[1][15]=0; |
|
|
} |
|
|
} |
|
|
} |
|
|
cnt=1; |
|
|
for(Int_t j = 0; j < 16; j++){ |
|
|
if((ace->CRCcheck[0])==1) |
|
|
hitmap_m->Fill(j,(Hitmap[0] & cnt)>0 ? 1 : 0); |
|
|
if((ace->CRCcheck[1])==1) |
|
|
hitmap_e->Fill(j,(Hitmap[1] & cnt)>0 ? 1 : 0); |
|
|
cnt=cnt<<1; |
|
|
} |
|
|
|
|
|
cnt=1; |
|
|
/* |
|
|
if((100*(i-minevent)/(maxevent-minevent))<10.) |
|
|
printf("%c%c",8,8); |
|
|
else |
|
|
printf("%c%c%c",8,8,8); |
|
|
*/ |
|
|
} |
|
|
} |
|
165 |
|
|
166 |
if(!fullversion) |
for (Int_t i = minevent; i < maxevent; i++){ |
|
{ |
|
|
if(DEBUG) |
|
|
printf("Start looping over events (DUMMY VERSION)\n"); |
|
|
for (Int_t i = minevent; i < maxevent; i++){ |
|
|
//printf("1"); |
|
|
//printf("%d%c",100*(i-minevent)/(maxevent-minevent),37); |
|
|
//printf("2"); |
|
|
//fflush(stdout); |
|
|
ph = eh->GetPscuHeader(); |
|
|
cputime = ph->GetOrbitalTime(); |
|
|
if(DEBUG) |
|
|
printf("Processing event %d\n",i); |
|
|
tr->GetEntry(i); |
|
|
|
|
|
totevents=totevents+1; |
|
|
|
|
|
//CRC check |
|
|
CRCcheck[0]=ace->CRCcheck[0]; |
|
|
CRCcheck[1]=ace->CRCcheck[1]; |
|
|
if(CRCcheck[0]==0) |
|
|
{ |
|
|
head_m->Fill(0.0); |
|
|
crcevents[0]++; |
|
|
} |
|
|
if(CRCcheck[1]==0) |
|
|
{ |
|
|
head_e->Fill(5.0); |
|
|
crcevents[1]++; |
|
|
} |
|
167 |
|
|
168 |
//fetch parameters |
tr->GetEntry(i); |
169 |
for(int b = 0; b<2; b++){ |
ph = eh->GetPscuHeader(); |
|
Status[b] = ace->status[b]; |
|
|
for(Int_t j = 0; j < 6; j++) |
|
|
Reg[b][j] = ace->regist[b][j]; |
|
|
Header[b][0] = ace->header[b][0]; |
|
|
Header[b][1] = ace->header[b][1]; |
|
|
Hitmap[b] = ace->hitmap[b]; |
|
|
} |
|
|
|
|
|
hitsCAS=hitsCAT=hitsCARD=0; |
|
|
for(int b=0;b<2;b++) |
|
|
{ |
|
|
if((Hitmap[b] & 0x0001) > 0) hitsCARD++; |
|
|
if((Hitmap[b] & 0x0002) > 0) hitsCAT++; |
|
|
if((Hitmap[b] & 0x0004) > 0) hitsCAS++; |
|
|
if((Hitmap[b] & 0x0010) > 0) hitsCARD++; |
|
|
if((Hitmap[b] & 0x0020) > 0) hitsCAT++; |
|
|
if((Hitmap[b] & 0x0040) > 0) hitsCAS++; |
|
|
if((Hitmap[b] & 0x0100) > 0) hitsCARD++; |
|
|
if((Hitmap[b] & 0x0200) > 0) hitsCAT++; |
|
|
if((Hitmap[b] & 0x0400) > 0) hitsCAS++; |
|
|
if((Hitmap[b] & 0x1000) > 0) hitsCARD++; |
|
|
if((Hitmap[b] & 0x2000) > 0) hitsCAT++; |
|
|
if((Hitmap[b] & 0x4000) > 0) hitsCAS++; |
|
|
} |
|
|
|
|
|
if(((ace->CRCcheck[0])==1) && (ace->CRC[0]!=0)){ |
|
|
if((Header[0][0] != 0xACAC) || (Header[0][1] != 0xAC11)){ |
|
|
head_m->Fill(1.,1); |
|
|
headerr_m->Fill(i,Trigger[0]);} |
|
|
if((Status[0] & 0x8000) < 0x8000){ |
|
|
head_m->Fill(2.,1); |
|
|
crcerr_m->Fill(i,Trigger[0]);} |
|
|
if((Status[0] & 0x4000) < 0x4000){ |
|
|
head_m->Fill(3.,1); |
|
|
dsperr_m->Fill(i,Trigger[0]);} |
|
|
if((Status[0] & 0x01FF) < 0x01FF){ |
|
|
head_m->Fill(4.,1); |
|
|
regerr_m->Fill(i,Trigger[0]);} |
|
|
} |
|
|
|
|
|
//fill histograms EXTRA |
|
|
if(((ace->CRCcheck[1])==1) && (ace->CRC[1]!=0)){ |
|
|
if((Header[1][0] != 0xACAC) || (Header[1][1] != 0xAC22)){ |
|
|
head_e->Fill(6.,1); |
|
|
headerr_e->Fill(i,Trigger[1]); |
|
|
//headerr_e->Fill(i,testtrigg); |
|
|
//cout << "i: " << i << " Trigger: " << Trigger[1] << endl; |
|
|
} |
|
|
if((Status[1] & 0x8000) < 0x8000){ |
|
|
head_e->Fill(7.,1); |
|
|
crcerr_e->Fill(i,Trigger[1]);} |
|
|
if((Status[1] & 0x4000) < 0x4000){ |
|
|
head_e->Fill(8.,1); |
|
|
dsperr_e->Fill(i,Trigger[1]);} |
|
|
if((Status[1] & 0x01FF) < 0x01FF){ |
|
|
head_e->Fill(9.,1); |
|
|
regerr_e->Fill(i,Trigger[1]);} |
|
|
|
|
|
cnt=1; |
|
|
for(Int_t j = 0; j < 16; j++){ |
|
|
if((ace->CRCcheck[0])==1) |
|
|
hitmap_m->Fill(j,(Hitmap[0] & cnt)>0 ? 1 : 0); |
|
|
if((ace->CRCcheck[1])==1) |
|
|
hitmap_e->Fill(j,(Hitmap[1] & cnt)>0 ? 1 : 0); |
|
|
cnt=cnt<<1; |
|
|
} |
|
|
|
|
|
cnt=1; |
|
|
} |
|
|
} |
|
|
} |
|
170 |
|
|
171 |
//printf("%d%c\n",100,37); |
for(Int_t card=0;card<2;card++) |
172 |
//fflush(stdout); |
{ |
173 |
//printf("\n********* QLOOK SHORT INFO **********\n\n"); |
//Proceed only if crc is ok |
174 |
//printf("Events: %d\nCrc Main %d\nCrc Extra: %d\n",totevents,crcevents[0],crcevents[1]); |
if(ace->CRCcheck[card]==1) |
175 |
//printf("Calibrations: %d\n",nCalibs); |
{ |
176 |
//printf("\n**************************************\n"); |
|
177 |
//printf("\nOpening canvases...\n"); |
//hitmap |
178 |
//cout << "hits: " << what << endl; |
for(Int_t ch_cnt=0;ch_cnt<16;ch_cnt++) |
179 |
//Draw histograms |
{ |
180 |
//gStyle->SetPalette(1); |
if( (ace->hitmap[card] & (0x1<<ch_cnt)) > 0 ) |
181 |
|
hitmap_h[card]->Fill(ch_cnt,1.); |
182 |
|
} |
183 |
|
//Status |
184 |
|
if((ace->header[card][0] != 0xACAC) || (ace->header[card][1] != ACheader[card])) |
185 |
|
status_h->Fill(1.+5.*card,1.); |
186 |
|
if((ace->status[card] & 0x8000) < 0x8000) //crc |
187 |
|
status_h->Fill(2.+5.*card,1.); |
188 |
|
if((ace->status[card] & 0x4000) < 0x4000) //dsp |
189 |
|
status_h->Fill(3.+5.*card,1.); |
190 |
|
if((ace->status[card] & 0x01FF) < 0x01FF) //reg |
191 |
|
status_h->Fill(4.+5*card,1.); |
192 |
|
|
193 |
|
}//if(crc check) |
194 |
|
/******************************************************/ |
195 |
|
else |
196 |
|
status_h->Fill(5.*card,1.); //event crc |
197 |
|
}//for(card) |
198 |
|
|
199 |
if(DEBUG) |
}//for(events) |
|
printf("Start plotting\n"); |
|
200 |
|
|
201 |
/***************************************** PLOTTING *****************************************/ |
/***************************************** PLOTTING *****************************************/ |
202 |
|
|
|
//Variables |
|
|
TCanvas *Canv_report1,*Canv_report2,*Canv_report3,*Canv_report4; |
|
|
TLatex *t; |
|
|
TPad *pd1,*pd2,*pd3,*pd4,*pd5,*pd6,*pd7,*pd8,*pd9,*pd10,*pd11,*pd12; |
|
|
TLine *linje; |
|
|
TLegend *leg_m,*leg_e,*leg1_m; |
|
|
Int_t i; |
|
|
Double_t max1,max2; |
|
203 |
char *namn = "KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK"; |
char *namn = "KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK"; |
204 |
int mposition = 80; |
int mposition = 80; |
205 |
int eposition = 80; |
int eposition = 80; |
206 |
char *figsave = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"; |
char *figsave1 = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"; |
207 |
char *mystring = "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"; |
char *mystring = "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"; |
208 |
//char *tmpchar = "JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ"; |
|
209 |
TBox *b1,*b2,*b3,*b4,*b5; |
TBox *b1,*b2,*b3,*b4,*b5; |
210 |
gStyle->SetOptDate(0); |
gStyle->SetOptDate(0); |
211 |
TString *merr = new TString[5]; |
TString *merr = new TString[5]; |
214 |
merr[2]="CRC"; |
merr[2]="CRC"; |
215 |
merr[3]="Dsp"; |
merr[3]="Dsp"; |
216 |
merr[4]="Reg"; |
merr[4]="Reg"; |
217 |
|
|
218 |
|
TCanvas *sheet1 = new TCanvas("Sheet 1","Sheet 1"); //base |
219 |
|
sheet1->Range(0,0,100,100); |
220 |
|
sheet1->Draw(); |
221 |
|
b1 = new TBox(10,84.5,90,85.5); |
222 |
|
b2 = new TBox(49.5,95,50.5,5); |
223 |
|
b1->SetFillColor(1); |
224 |
|
b2->SetFillColor(1); |
225 |
|
b1->Draw(); |
226 |
|
b2->Draw(); |
227 |
|
|
228 |
|
TLatex *t=new TLatex(); |
229 |
|
t->SetTextFont(40); |
230 |
|
t->SetTextColor(1); |
231 |
|
t->SetTextAlign(12); |
232 |
|
t->SetTextSize(0.04); |
233 |
|
namn = "AntiCounter MAIN card"; |
234 |
|
t->DrawLatex(10,90,namn); |
235 |
|
t->SetTextColor(1); |
236 |
|
namn = "AntiCounter EXTRA card"; |
237 |
|
t->DrawLatex(58,90,namn); |
238 |
|
t->SetTextSize(0.025); |
239 |
|
|
240 |
|
for(Int_t ch=1;ch<17;ch++) |
241 |
|
{ |
242 |
|
if(ch!=4 && ch!=8 && ch!=12 && ch!=16 && hitmap_h[0]->GetBinContent(ch)==0){ |
243 |
|
mystring = Form("%s channel empty",detector[ch-1].Data()); |
244 |
|
t->SetTextColor(2); |
245 |
|
t->DrawLatex(15,mposition,mystring); |
246 |
|
mposition -= 4; |
247 |
|
} |
248 |
|
if(ch!=4 && ch!=8 && ch!=12 && ch!=16 && hitmap_h[1]->GetBinContent(ch)==0){ |
249 |
|
mystring = Form("%s channel empty",detector[ch-1].Data()); |
250 |
|
t->SetTextColor(2); |
251 |
|
t->DrawLatex(65,eposition,mystring); |
252 |
|
eposition -= 4; |
253 |
|
} |
254 |
|
} |
255 |
|
for(Int_t ch=0;ch<5;ch++) |
256 |
|
{ |
257 |
|
if(status_h->GetBinContent(ch+1)>0){ |
258 |
|
mposition -= 4; |
259 |
|
mystring = Form("%d %s errors",(int)status_h->GetBinContent(ch+1),merr[ch].Data()); |
260 |
|
t->SetTextColor(2); |
261 |
|
t->DrawLatex(15,mposition,mystring); |
262 |
|
} |
263 |
|
if(status_h->GetBinContent(ch+5+1)>0){ |
264 |
|
eposition -= 4; |
265 |
|
mystring = Form("%d %s errors",(int)status_h->GetBinContent(ch+5+1),merr[ch].Data()); |
266 |
|
t->SetTextColor(2); |
267 |
|
t->DrawLatex(65,eposition,mystring); |
268 |
|
} |
269 |
|
} |
270 |
|
//if no errors |
271 |
|
if(mposition==80) |
272 |
|
{ |
273 |
|
namn = "AC main working"; |
274 |
|
t->SetTextSize(0.035); |
275 |
|
t->SetTextColor(1); |
276 |
|
t->DrawLatex(15,50,namn); |
277 |
|
} |
278 |
|
if(eposition==80) |
279 |
|
{ |
280 |
|
namn = "AC extra working"; |
281 |
|
t->SetTextSize(0.035); |
282 |
|
t->SetTextColor(1); |
283 |
|
t->DrawLatex(65,50,namn); |
284 |
|
} |
285 |
|
if(mposition!=80 || eposition!=80) |
286 |
|
{ |
287 |
|
namn = "AC malfunction"; |
288 |
|
t->SetTextSize(0.035); |
289 |
|
t->SetTextColor(1); |
290 |
|
t->DrawLatex(41.5,97.3,namn); |
291 |
|
b3 = new TBox(10,96,40,98.5); |
292 |
|
b4 = new TBox(10,1.5,90,4); |
293 |
|
b5 = new TBox(60,96,90,98.5); |
294 |
|
b3->SetFillColor(2); |
295 |
|
b4->SetFillColor(2); |
296 |
|
b5->SetFillColor(2); |
297 |
|
b3->Draw(); |
298 |
|
b4->Draw(); |
299 |
|
b5->Draw(); |
300 |
|
} |
301 |
|
|
302 |
|
figsave1 = Form("%s/%s_AcQLOOKbasic.%s",outDir.Data(),fileName.Data(),format.Data()); |
303 |
|
sheet1->SaveAs(figsave1); |
304 |
|
|
305 |
|
return 1; |
306 |
|
|
307 |
|
} //end AcBasic |
308 |
|
|
309 |
|
|
310 |
|
int AcQLOOKpro(TString base,int fromevent=0, int toevent=0, TString outDir = "./", TString format = FORMAT){ |
311 |
|
|
312 |
|
//Float_t startTime,stopTime; |
313 |
|
//Float_t time1,time2,time3,time4; |
314 |
|
|
315 |
|
//startTime = clock(); |
316 |
|
|
317 |
|
ofstream outputFile; |
318 |
|
stringstream oss; |
319 |
|
|
320 |
|
pamela::anticounter::AnticounterEvent *ace = 0; |
321 |
|
pamela::EventHeader *eh = 0; |
322 |
|
pamela::PscuHeader *ph = 0; |
323 |
|
TFile *rootFile = new TFile(base); |
324 |
|
if (rootFile->IsZombie()) |
325 |
|
exit(-1); |
326 |
|
TString fileName = ((TObjString*)base.Tokenize('\/')->Last())->GetString(); |
327 |
|
TString filePath = base; |
328 |
|
filePath.ReplaceAll(fileName, ""); |
329 |
|
fileName.ReplaceAll(".root", ""); |
330 |
|
|
331 |
|
//Takes the tree of the header file |
332 |
|
TTree *tr = (TTree*)rootFile->Get("Physics"); |
333 |
|
|
334 |
|
tr->SetBranchStatus("*",0,&found); //disable all branches |
335 |
|
|
336 |
if(!fullversion) |
tr->SetBranchStatus("header*",1,&found); |
337 |
|
// printf("header: enabled %i branches \n",found); |
338 |
|
found = 0; |
339 |
|
tr->SetBranchStatus("status*",1,&found); |
340 |
|
// printf("status: enabled %i branches \n",found); |
341 |
|
found = 0; |
342 |
|
tr->SetBranchStatus("hitmap*",1,&found); |
343 |
|
// printf("hitmap: enabled %i branches \n",found); |
344 |
|
found = 0; |
345 |
|
tr->SetBranchStatus("regist*",1,&found); |
346 |
|
// printf("regist: enabled %i branches \n",found); |
347 |
|
found = 0; |
348 |
|
tr->SetBranchStatus("shift*",1,&found); |
349 |
|
// printf("shift: enabled %i branches \n",found); |
350 |
|
found = 0; |
351 |
|
tr->SetBranchStatus("counters*",1,&found); |
352 |
|
// printf("counters: enabled %i branches \n",found); |
353 |
|
found = 0; |
354 |
|
tr->SetBranchStatus("coinc*",1,&found); |
355 |
|
// printf("coinc: enabled %i branches \n",found); |
356 |
|
found = 0; |
357 |
|
tr->SetBranchStatus("trigg*",1,&found); |
358 |
|
// printf("trigg: enabled %i branches \n",found); |
359 |
|
found = 0; |
360 |
|
tr->SetBranchStatus("clock*",1,&found); |
361 |
|
// printf("clock: enabled %i branches \n",found); |
362 |
|
found = 0; |
363 |
|
tr->SetBranchStatus("temp*",1,&found); |
364 |
|
// printf("temp: enabled %i branches \n",found); |
365 |
|
found = 0; |
366 |
|
tr->SetBranchStatus("DAC*",1,&found); |
367 |
|
// printf("DAC: enabled %i branches \n",found); |
368 |
|
found = 0; |
369 |
|
tr->SetBranchStatus("CRC*",1,&found); |
370 |
|
// printf("CRC: enabled %i branches \n",found); |
371 |
|
found = 0; |
372 |
|
|
373 |
|
tr->SetBranchStatus("Pscu*",1,&found); |
374 |
|
// printf("enabled %i branches \n",found); |
375 |
|
found = 0; |
376 |
|
tr->SetBranchStatus("Anticounter*",1,&found); |
377 |
|
// printf("Ac enabled %i branches \n",found); |
378 |
|
found = 0; |
379 |
|
tr->SetBranchStatus("Header*",1,&found); |
380 |
|
// printf("head enabled %i branches \n",found); |
381 |
|
|
382 |
|
tr->SetBranchAddress("Anticounter", &ace); |
383 |
|
tr->SetBranchAddress("Header", &eh); |
384 |
|
|
385 |
|
/*************************** VARIABLE DECLARATION **************************/ |
386 |
|
|
387 |
|
ACheader[0]=0xAC11; |
388 |
|
ACheader[1]=0xAC22; |
389 |
|
|
390 |
|
cardname[0] = "MAIN"; |
391 |
|
cardname[1] = "EXTRA"; |
392 |
|
|
393 |
|
detector[0]="CARD 4"; |
394 |
|
detector[1]="CAT 2"; |
395 |
|
detector[2]="CAS 1"; |
396 |
|
detector[3]="NC"; |
397 |
|
detector[4]="CARD 2"; |
398 |
|
detector[5]="CAT 4"; |
399 |
|
detector[6]="CAS 4"; |
400 |
|
detector[7]="NC"; |
401 |
|
detector[8]="CARD 3"; |
402 |
|
detector[9]="CAT 3"; |
403 |
|
detector[10]="CAS 3"; |
404 |
|
detector[11]="NC"; |
405 |
|
detector[12]="CARD 1"; |
406 |
|
detector[13]="CAT 1"; |
407 |
|
detector[14]="CAS 2"; |
408 |
|
detector[15]="NC"; |
409 |
|
|
410 |
|
// ANTICOUNTER VARIABLES |
411 |
|
|
412 |
|
Double_t ac_clock_old[2] = {-1., -1.}; |
413 |
|
Double_t ac_clock_new[2] = {-1., -1.}; |
414 |
|
Double_t ac_clock100_new[2] = {-1.,-1.}; |
415 |
|
Double_t ac_clock100_old[2] = {-1.,-1.}; |
416 |
|
Double_t ac_clock_diff[2]; |
417 |
|
Double_t ac_clock100_diff[2]; |
418 |
|
Double_t counter_old[2][16]; |
419 |
|
Double_t counter_new[2][16]; |
420 |
|
Double_t counter_diff[2][16]; |
421 |
|
|
422 |
|
// MISC VARIABLES |
423 |
|
|
424 |
|
Double_t obt; |
425 |
|
Int_t hitsCARD,hitsCAT,hitsCAS; |
426 |
|
Int_t interval_cnt = 0; |
427 |
|
Int_t paramEvent = 0; |
428 |
|
Int_t paramEvents; |
429 |
|
Int_t minevent,maxevent; |
430 |
|
char *figsave = " "; |
431 |
|
UShort_t ACheader[2]; |
432 |
|
ACheader[0]=0xAC11; |
433 |
|
ACheader[1]=0xAC22; |
434 |
|
|
435 |
|
Int_t *det_map = new Int_t[12]; |
436 |
|
det_map[0]=2; |
437 |
|
det_map[1]=14; |
438 |
|
det_map[2]=10; |
439 |
|
det_map[3]=6; |
440 |
|
det_map[4]=13; |
441 |
|
det_map[5]=1; |
442 |
|
det_map[6]=9; |
443 |
|
det_map[7]=5; |
444 |
|
det_map[8]=12; |
445 |
|
det_map[9]=4; |
446 |
|
det_map[10]=8; |
447 |
|
det_map[11]=0; |
448 |
|
|
449 |
|
TString *detector = new TString[16]; |
450 |
|
detector[0]="CARD 4"; |
451 |
|
detector[1]="CAT 2"; |
452 |
|
detector[2]="CAS 1"; |
453 |
|
detector[3]="NC"; |
454 |
|
detector[4]="CARD 2"; |
455 |
|
detector[5]="CAT 4"; |
456 |
|
detector[6]="CAS 4"; |
457 |
|
detector[7]="NC"; |
458 |
|
detector[8]="CARD 3"; |
459 |
|
detector[9]="CAT 3"; |
460 |
|
detector[10]="CAS 3"; |
461 |
|
detector[11]="NC"; |
462 |
|
detector[12]="CARD 1"; |
463 |
|
detector[13]="CAT 1"; |
464 |
|
detector[14]="CAS 2"; |
465 |
|
detector[15]="NC"; |
466 |
|
|
467 |
|
TString *cardname = new TString[2]; |
468 |
|
cardname[0] = "MAIN"; |
469 |
|
cardname[1] = "EXTRA"; |
470 |
|
char histotitel[30]; |
471 |
|
|
472 |
|
Int_t nevents = tr->GetEntries(); |
473 |
|
|
474 |
|
//check that the selected range of events is ok |
475 |
|
if ( fromevent > toevent && toevent ){ |
476 |
|
return -1; |
477 |
|
}; |
478 |
|
if ( fromevent > nevents || fromevent < 0 ) { |
479 |
|
return -1; |
480 |
|
}; |
481 |
|
if ( toevent > nevents || toevent < 0 ) { |
482 |
|
return -1; |
483 |
|
}; |
484 |
|
|
485 |
|
if ( fromevent == 0 ) { |
486 |
|
minevent = 0; |
487 |
|
maxevent = nevents; |
488 |
|
} else { |
489 |
|
minevent = fromevent - 1; |
490 |
|
if ( toevent > 0 ){ |
491 |
|
maxevent = toevent; |
492 |
|
} else { |
493 |
|
maxevent = fromevent; |
494 |
|
}; |
495 |
|
}; |
496 |
|
|
497 |
|
paramEvents = (Int_t)((Float_t)nevents/(Float_t)INTERVAL); |
498 |
|
|
499 |
|
/************************* HISTOGRAM and GRAPH DECLARATION *******************************/ |
500 |
|
|
501 |
|
TH1D *hitmap_h[2]; |
502 |
|
TH1D *nmbhitpmtCARD_h = new TH1D("#hit PMTs CARD","#hit PMTs",8,0.5,8.5); |
503 |
|
TH1D *nmbhitpmtCAT_h = new TH1D("#hit PMTs CAT","#hit PMTs",8,0.5,8.5); |
504 |
|
TH1D *nmbhitpmtCAS_h = new TH1D("#hit PMTs CAS","#hit PMTs",8,0.5,8.5); |
505 |
|
TH1D *time_between_trigg_h[2]; |
506 |
|
TH1D *shiftreg_h[2][16]; |
507 |
|
|
508 |
|
for(Int_t card=0;card<2;card++) |
509 |
{ |
{ |
510 |
Canv_report1 = new TCanvas("QL Report Sheet 1","QL Report Sheet 1", 1280, 1024); //base |
sprintf(histotitel,"Hitmap %s",cardname[card].Data()); |
511 |
Canv_report1->Range(0,0,100,100); |
hitmap_h[card] = new TH1D(histotitel,"Hitmap",16,0.,16.); |
|
//Canv_report1->Divide(2,2); |
|
|
Canv_report1->Draw(); |
|
|
b1 = new TBox(10,84.5,90,85.5); |
|
|
b2 = new TBox(49.5,95,50.5,5); |
|
|
b1->SetFillColor(1); |
|
|
b2->SetFillColor(1); |
|
|
b1->Draw(); |
|
|
b2->Draw(); |
|
|
|
|
512 |
|
|
513 |
t=new TLatex(); |
hitmap_h[card]->GetXaxis()->SetBinLabel(1,detector[0]); |
514 |
t->SetTextFont(40); |
hitmap_h[card]->GetXaxis()->SetBinLabel(2,detector[1]); |
515 |
t->SetTextColor(1); |
hitmap_h[card]->GetXaxis()->SetBinLabel(3,detector[2]); |
516 |
t->SetTextAlign(12); |
hitmap_h[card]->GetXaxis()->SetBinLabel(4,detector[3]); |
517 |
t->SetTextSize(0.04); |
hitmap_h[card]->GetXaxis()->SetBinLabel(5,detector[4]); |
518 |
namn = "AntiCounter MAIN card"; |
hitmap_h[card]->GetXaxis()->SetBinLabel(6,detector[5]); |
519 |
t->DrawLatex(10,90,namn); |
hitmap_h[card]->GetXaxis()->SetBinLabel(7,detector[6]); |
520 |
t->SetTextColor(1); |
hitmap_h[card]->GetXaxis()->SetBinLabel(8,detector[7]); |
521 |
namn = "AntiCounter EXTRA card"; |
hitmap_h[card]->GetXaxis()->SetBinLabel(9,detector[8]); |
522 |
t->DrawLatex(58,90,namn); |
hitmap_h[card]->GetXaxis()->SetBinLabel(10,detector[9]); |
523 |
t->SetTextSize(0.025); |
hitmap_h[card]->GetXaxis()->SetBinLabel(11,detector[10]); |
524 |
//Canv_report1->cd(1); |
hitmap_h[card]->GetXaxis()->SetBinLabel(12,detector[11]); |
525 |
for(i=1;i<17;i++) |
hitmap_h[card]->GetXaxis()->SetBinLabel(13,detector[12]); |
526 |
{ |
hitmap_h[card]->GetXaxis()->SetBinLabel(14,detector[13]); |
527 |
if(i!=4 && i!=8 && i!=12 && i!=16 && hitmap_m->GetBinContent(i)==0){ |
hitmap_h[card]->GetXaxis()->SetBinLabel(15,detector[14]); |
528 |
mystring = Form("%s channel empty",mtitel[i-1].Data()); |
hitmap_h[card]->GetXaxis()->SetBinLabel(16,detector[15]); |
529 |
t->SetTextColor(2); |
hitmap_h[card]->GetYaxis()->SetTitle("Hits"); |
530 |
t->DrawLatex(15,mposition,mystring); |
|
531 |
mposition -= 4; |
sprintf(histotitel,"Time between triggers %s",cardname[card].Data()); |
532 |
} |
time_between_trigg_h[card] = new TH1D(histotitel,"Time between triggers",100,0.,0.01); |
533 |
if(i!=4 && i!=8 && i!=12 && i!=16 && hitmap_e->GetBinContent(i)==0){ |
time_between_trigg_h[card]->SetBit(TH1::kCanRebin); |
534 |
mystring = Form("%s channel empty",etitel[i-1].Data()); |
|
535 |
t->SetTextColor(2); |
for(Int_t ch = 0; ch < 16; ch++) |
|
t->DrawLatex(65,eposition,mystring); |
|
|
eposition -= 4; |
|
|
} |
|
|
} |
|
|
for(i=0;i<5;i++) |
|
|
{ |
|
|
if(head_m->GetBinContent(i+1)>0){ |
|
|
mposition -= 4; |
|
|
mystring = Form("%d %s errors",(int)head_m->GetBinContent(i+1),merr[i].Data()); |
|
|
t->SetTextColor(2); |
|
|
t->DrawLatex(15,mposition,mystring); |
|
|
} |
|
|
if(head_e->GetBinContent(i+5+1)>0){ |
|
|
eposition -= 4; |
|
|
mystring = Form("%d %s errors",(int)head_e->GetBinContent(i+5+1),merr[i].Data()); |
|
|
t->SetTextColor(2); |
|
|
t->DrawLatex(65,eposition,mystring); |
|
|
} |
|
|
} |
|
|
//if no errors |
|
|
if(mposition==80) |
|
|
{ |
|
|
namn = "AC main working"; |
|
|
t->SetTextSize(0.035); |
|
|
t->SetTextColor(1); |
|
|
t->DrawLatex(15,50,namn); |
|
|
} |
|
|
if(eposition==80) |
|
|
{ |
|
|
namn = "AC extra working"; |
|
|
t->SetTextSize(0.035); |
|
|
t->SetTextColor(1); |
|
|
t->DrawLatex(65,50,namn); |
|
|
} |
|
|
if(mposition!=80 || eposition!=80) |
|
536 |
{ |
{ |
537 |
namn = "AC malfunction"; |
sprintf(histotitel,"Shift Register %s Ch %d",cardname[card].Data(),ch+1); |
538 |
t->SetTextSize(0.035); |
shiftreg_h[card][ch] = new TH1D(histotitel,detector[ch].Data(),16,0.,16.); |
|
t->SetTextColor(1); |
|
|
t->DrawLatex(41.5,97.3,namn); |
|
|
b3 = new TBox(10,96,40,98.5); |
|
|
b4 = new TBox(10,1.5,90,4); |
|
|
b5 = new TBox(60,96,90,98.5); |
|
|
b3->SetFillColor(2); |
|
|
b4->SetFillColor(2); |
|
|
b5->SetFillColor(2); |
|
|
b3->Draw(); |
|
|
b4->Draw(); |
|
|
b5->Draw(); |
|
539 |
} |
} |
|
//head_m->Draw(); |
|
|
//head_e->Draw("SAME"); |
|
|
//Canv_report1->cd(3); |
|
|
//hitmap_m->SetStats(kFALSE); |
|
|
//hitmap_m->Draw(); |
|
|
//Canv_report1->cd(4); |
|
|
//hitmap_e->SetStats(kFALSE); |
|
|
//hitmap_e->Draw(); |
|
|
|
|
540 |
} |
} |
541 |
if(fullversion) |
|
542 |
{ |
TH1D *status_h = new TH1D("Status","Status",12,0.,12.); |
543 |
//Anticounter report sheet 1 |
status_h->GetXaxis()->SetBinLabel(1,"CRC event M"); |
544 |
Canv_report1 = new TCanvas("QL Report Sheet 1","QL Report Sheet 1", 1280, 1024); //base |
status_h->GetXaxis()->SetBinLabel(2,"Headers M"); |
545 |
Canv_report1->Range(0,0,100,100); |
status_h->GetXaxis()->SetBinLabel(3,"CRC M"); |
546 |
//tsf = (TSystemFile*)AcList->First(); |
status_h->GetXaxis()->SetBinLabel(4,"Dsp M"); |
547 |
|
status_h->GetXaxis()->SetBinLabel(5,"Temp M"); |
548 |
//sprintf(error,"File: %s ",tsf->GetName()); |
status_h->GetXaxis()->SetBinLabel(6,"Reg M"); |
549 |
//printf("A3\n"); |
status_h->GetXaxis()->SetBinLabel(7,"CRC event E"); |
550 |
t=new TLatex(); |
status_h->GetXaxis()->SetBinLabel(8,"Headers E"); |
551 |
t->SetTextFont(32); |
status_h->GetXaxis()->SetBinLabel(9,"CRC E"); |
552 |
t->SetTextColor(1); |
status_h->GetXaxis()->SetBinLabel(10,"Dsp E"); |
553 |
t->SetTextAlign(12); |
status_h->GetXaxis()->SetBinLabel(11,"Temp E"); |
554 |
t->SetTextSize(0.015); |
status_h->GetXaxis()->SetBinLabel(12,"Reg E"); |
555 |
//t->DrawLatex(2.,99.,error); |
status_h->GetYaxis()->SetTitle("# of Errors"); |
556 |
t->SetTextSize(0.02); |
status_h->SetMinimum(0); |
557 |
namn = "MAIN"; |
|
558 |
t->DrawLatex(82,99,namn); |
Double_t *temp_gr[2][4]; |
559 |
t->SetTextColor(2); |
for(Int_t i=0;i<2;i++) |
560 |
namn="EXTRA"; |
for(Int_t j=0;j<4;j++) |
561 |
t->DrawLatex(89,99,namn); |
temp_gr[i][j] = new Double_t[paramEvents+1]; |
562 |
t->SetTextColor(1); |
|
563 |
pd1 = new TPad("pd1","This is pad1",0.02,0.02,0.49,0.49,17); //lower left |
for(Int_t i=0;i<2;i++) |
564 |
pd2 = new TPad("pd2","This is pad2",0.51,0.02,0.98,0.49,17); //lower right |
for(Int_t j=0;j<4;j++) |
565 |
//pd3 = new TPad("pd3","This is pad3",0.51,0.51,0.98,0.74,17); //upper-lower right |
for(Int_t k=0;k<(paramEvents+1);k++) |
566 |
pd4 = new TPad("pd4","This is pad4",0.02,0.51,0.49,0.98,17); //upper left |
temp_gr[i][j][k] = 0.; |
567 |
//pd5 = new TPad("pd5","This is pad5",0.51,0.25,0.98,0.49,17); //lower-upper right |
|
568 |
pd3 = new TPad("pd3","This is pad3",0.51,0.51,0.98,0.98,17); //upper right |
Double_t *trigger_gr[2]; |
569 |
|
trigger_gr[0] = new Double_t[paramEvents+1]; |
570 |
Canv_report1->cd(); |
trigger_gr[1] = new Double_t[paramEvents+1]; |
571 |
//pd1->Range(0,0,100,100); |
|
572 |
//pd2->Range(0,0,100,100); |
Double_t *singles_gr[2][16]; |
573 |
//pd3->Range(0,0,100,100); |
for(Int_t i=0;i<2;i++){ |
574 |
//pd4->Range(0,0,100,100); |
for(Int_t j=0;j<16;j++){ |
575 |
//pd5->Range(0,0,100,100); |
singles_gr[i][j] = new Double_t[paramEvents+1]; |
576 |
//pd6->Range(0,0,100,100); |
} |
577 |
pd1->Draw(); |
} |
578 |
pd2->Draw(); |
for(Int_t i=0;i<2;i++){ |
579 |
pd3->Draw(); |
for(Int_t j=0;j<16;j++){ |
580 |
pd4->Draw(); |
for(Int_t k=0;k<(paramEvents+1);k++){ |
581 |
//pd5->Draw(); |
singles_gr[i][j][k] = 0.; |
582 |
//pd6->Draw(); |
} |
583 |
|
} |
584 |
pd3->cd(); //upper right |
} |
585 |
if(head_m->GetMaximum()>head_e->GetMaximum()) |
|
586 |
head_m->SetMaximum(1.1*head_m->GetMaximum()); |
Double_t *event_obt = new Double_t[paramEvents+1]; |
587 |
else |
|
588 |
head_m->SetMaximum(1.1*head_e->GetMaximum()); |
|
589 |
head_m->SetLineColor(1); |
/**********************************************************************************/ |
590 |
head_m->SetStats(kFALSE); |
|
|
head_m->Draw(); |
|
|
head_e->SetLineColor(2); |
|
|
head_e->Draw("SAME"); |
|
|
linje = new TLine(50,0,0,100); |
|
|
linje->SetLineColor(1); |
|
|
linje->Draw("SAME"); |
|
|
|
|
|
|
|
|
//pmtstatus_m->SetLineColor(1); |
|
|
//pmtstatus_m->Draw(); |
|
|
//hitmap_e->SetLineColor(2); |
|
|
//hitmap_e->Draw("SAME"); |
|
|
|
|
|
pd4->cd(); //lower right |
|
|
hitmap_m->SetLineColor(1); |
|
|
hitmap_m->SetStats(kFALSE); |
|
|
hitmap_m->Draw(); |
|
|
|
|
|
//pd5->cd(); //lower-upper right |
|
|
hitmap_e->SetLineColor(2); |
|
|
hitmap_e->SetStats(kFALSE); |
|
|
hitmap_e->Draw("SAME"); |
|
|
|
|
|
pd1->cd(); |
|
|
T_right_m->SetLineColor(1); |
|
|
T_right_m->SetStats(kFALSE); |
|
|
T_right_m->Draw(); |
|
|
T_actel_m->SetLineColor(2); |
|
|
T_actel_m->Draw("SAME"); |
|
|
T_dsp_m->SetLineColor(3); |
|
|
T_dsp_m->Draw("SAME"); |
|
|
T_left_m->SetLineColor(4); |
|
|
T_left_m->Draw("SAME"); |
|
|
|
|
|
leg_m = new TLegend(0.78,0.63,0.9,0.8); |
|
|
leg_m->AddEntry(T_right_m,"Right","l"); |
|
|
leg_m->AddEntry(T_actel_m,"Actel","l"); |
|
|
leg_m->AddEntry(T_dsp_m,"Dsp","l"); |
|
|
leg_m->AddEntry(T_left_m,"Left","l"); |
|
|
leg_m->Draw(); |
|
|
|
|
|
|
|
|
//pd2->cd(); |
|
|
//pmtstatus_e->SetLineColor(1); |
|
|
//pmtstatus_e->Draw(); |
|
|
//TGraph *gr1 = new TGraph(antal,hits_x,hits_y_m); |
|
|
//gr1->Draw("AC*"); |
|
|
|
|
|
pd2->cd(); |
|
|
T_right_e->SetLineColor(1); |
|
|
T_right_e->SetStats(kFALSE); |
|
|
T_right_e->Draw(); |
|
|
T_actel_e->SetLineColor(2); |
|
|
T_actel_e->Draw("SAME"); |
|
|
T_dsp_e->SetLineColor(3); |
|
|
T_dsp_e->Draw("SAME"); |
|
|
T_left_e->SetLineColor(4); |
|
|
T_left_e->Draw("SAME"); |
|
|
|
|
|
leg_e = new TLegend(0.78,0.63,0.9,0.8); |
|
|
leg_e->AddEntry(T_right_e,"Right","l"); |
|
|
leg_e->AddEntry(T_actel_e,"Actel","l"); |
|
|
leg_e->AddEntry(T_dsp_e,"Dsp","l"); |
|
|
leg_e->AddEntry(T_left_e,"Left","l"); |
|
|
leg_e->Draw(); |
|
|
|
|
|
//pd6->cd(); //upper-upper right |
|
|
//hitmap_m->SetLineColor(1); |
|
|
//hitmap_m->Draw(); |
|
|
|
|
|
/* |
|
|
TA INTE MED |
|
|
pd4->cd(); |
|
|
T_right_m->SetLineColor(1); |
|
|
T_right_m->Draw(); |
|
|
T_actel_m->SetLineColor(1); |
|
|
T_actel_m->Draw("SAME"); |
|
|
//T_dsp_m->SetLineColor(1); |
|
|
//T_dsp_m->Draw("SAME"); |
|
|
T_left_m->SetLineColor(1); |
|
|
T_left_m->Draw("SAME"); |
|
|
T_right_e->SetLineColor(2); |
|
|
T_right_e->Draw("SAME"); |
|
|
T_actel_e->SetLineColor(2); |
|
|
T_actel_e->Draw("SAME"); |
|
|
//T_dsp_e->SetLineColor(2); |
|
|
//T_dsp_e->Draw("SAME"); |
|
|
T_left_e->SetLineColor(2); |
|
|
T_left_e->Draw("SAME"); |
|
|
*/ |
|
|
//Canv_report1->Update(); |
|
|
|
|
|
//report sheet 2 |
|
|
//ps->NewPage(); |
|
|
Canv_report2 = new TCanvas("QL Report Sheet 2","QL Report Sheet 2", 1280, 1024); |
|
|
Canv_report2->Range(0,0,100,100); |
|
|
//tsf = (TSystemFile*)AcList->First(); |
|
|
//sprintf(error,"File: %s ",tsf->GetName()); |
|
|
//TLatex *t=new TLatex(); |
|
|
t->SetTextFont(32); |
|
|
t->SetTextColor(1); |
|
|
t->SetTextAlign(12); |
|
|
t->SetTextSize(0.015); |
|
|
//t->DrawLatex(2.,99.,error); |
|
|
t->SetTextSize(0.02); |
|
|
namn="MAIN"; |
|
|
t->DrawLatex(82,99,namn); |
|
|
t->SetTextColor(2); |
|
|
namn="EXTRA"; |
|
|
t->DrawLatex(89,99,namn); |
|
|
t->SetTextColor(1); |
|
|
//TPad *pd1,*pd2,*pd3,*pd4,*pd5,*pd6,*pd7; |
|
|
pd1 = new TPad("pd1","This is pad1",0.02,0.51,0.49,0.98,17); |
|
|
pd2 = new TPad("pd2","This is pad2",0.51,0.51,0.98,0.98,17); |
|
|
pd3 = new TPad("pd3","This is pad3",0.02,0.02,0.49,0.49,17); |
|
|
pd4 = new TPad("pd4","This is pad4",0.51,0.02,0.74,0.24,17); //down-left |
|
|
pd5 = new TPad("pd5","This is pad5",0.76,0.02,0.98,0.24,17); //down-right |
|
|
pd6 = new TPad("pd6","This is pad6",0.51,0.24,0.74,0.49,17); //up-left |
|
|
pd7 = new TPad("pd7","This is pad7",0.76,0.24,0.98,0.49,17); //up-right |
|
|
Canv_report2->cd(); |
|
|
//pd1->Range(0,0,100,100); |
|
|
//pd2->Range(0,0,100,100); |
|
|
//pd3->Range(0,0,100,100); |
|
|
//pd4->Range(0,0,100,100); |
|
|
//pd5->Range(0,0,100,100); |
|
|
//pd6->Range(0,0,100,100); |
|
|
//pd7->Range(0,0,100,100); |
|
|
pd1->Draw(); |
|
|
pd2->Draw(); |
|
|
pd3->Draw(); |
|
|
pd4->Draw(); |
|
|
pd5->Draw(); |
|
|
pd6->Draw(); |
|
|
pd7->Draw(); |
|
|
|
|
|
max1 = trigg_m->GetMaximum(); |
|
|
max2 = trigg_e->GetMaximum(); |
|
|
if(max1>max2) |
|
|
trigg_m->SetMaximum(1.03*max1); |
|
|
else |
|
|
trigg_m->SetMaximum(1.03*max2); |
|
|
|
|
|
pd1->cd(); //lower left |
|
|
trigg_m->SetLineColor(1); |
|
|
trigg_m->SetStats(kFALSE); |
|
|
trigg_m->Draw(); |
|
|
|
|
|
crc_m->SetMarkerStyle(22); |
|
|
crc_m->SetMarkerSize(1.); |
|
|
crc_m->SetMarkerColor(9); |
|
|
crc_m->Draw("SAMEP"); |
|
|
|
|
|
headerr_m->SetMarkerStyle(5); |
|
|
headerr_m->SetMarkerSize(1.); |
|
|
headerr_m->SetMarkerColor(9); |
|
|
headerr_m->Draw("SAMEP"); |
|
|
|
|
|
crcerr_m->SetMarkerStyle(2); |
|
|
crcerr_m->SetMarkerSize(1.); |
|
|
crcerr_m->SetMarkerColor(9); |
|
|
crcerr_m->Draw("SAMEP"); |
|
|
|
|
|
dsperr_m->SetMarkerStyle(7); |
|
|
dsperr_m->SetMarkerSize(1.); |
|
|
dsperr_m->SetMarkerColor(9); |
|
|
dsperr_m->Draw("SAMEP"); |
|
|
|
|
|
regerr_m->SetMarkerStyle(4); |
|
|
regerr_m->SetMarkerSize(1.); |
|
|
regerr_m->SetMarkerColor(9); |
|
|
regerr_m->Draw("SAMEP"); |
|
|
|
|
|
leg1_m = new TLegend(0.7,0.5,0.87,0.7); |
|
|
leg1_m->AddEntry(crc_m,"CRC","p"); |
|
|
leg1_m->AddEntry(headerr_m,"Headers","p"); |
|
|
leg1_m->AddEntry(crcerr_m,"Cmd CRC","p"); |
|
|
leg1_m->AddEntry(dsperr_m,"Dsp","p"); |
|
|
leg1_m->AddEntry(regerr_m,"Reg","p"); |
|
|
leg1_m->SetHeader("ERRORS"); |
|
|
leg1_m->Draw(); |
|
|
|
|
|
//Canv_report1->Update(); |
|
|
|
|
|
trigg_e->SetLineColor(2); |
|
|
//trigg_e->SetMaximum(1.03*trigg_e->GetMaximum()); |
|
|
trigg_e->SetStats(kFALSE); |
|
|
trigg_e->Draw("SAME"); |
|
|
|
|
|
//TGaxis *axis = new TGaxis(gPad->GetUxmax(),gPad->GetUymin(),gPad->GetUxmax(),gPad->GetUymax(),0,rightmax,510,"+L"); |
|
|
//axis->SetLineColor(2); |
|
|
//axis->Draw(); |
|
|
|
|
|
crc_e->SetMarkerStyle(22); |
|
|
crc_e->SetMarkerSize(1.); |
|
|
crc_e->SetMarkerColor(9); |
|
|
crc_e->Draw("SAMEP"); |
|
|
|
|
|
headerr_e->SetMarkerStyle(5); |
|
|
headerr_e->SetMarkerSize(1.); |
|
|
headerr_e->SetMarkerColor(9); |
|
|
headerr_e->Draw("SAMEP"); |
|
|
|
|
|
crcerr_e->SetMarkerStyle(2); |
|
|
crcerr_e->SetMarkerSize(1.); |
|
|
crcerr_e->SetMarkerColor(9); |
|
|
crcerr_e->Draw("SAMEP"); |
|
|
|
|
|
dsperr_e->SetMarkerStyle(7); |
|
|
dsperr_e->SetMarkerSize(1.); |
|
|
dsperr_e->SetMarkerColor(9); |
|
|
dsperr_e->Draw("SAMEP"); |
|
|
|
|
|
regerr_e->SetMarkerStyle(4); |
|
|
regerr_e->SetMarkerSize(1.); |
|
|
regerr_e->SetMarkerColor(9); |
|
|
regerr_e->Draw("SAMEP"); |
|
|
/* |
|
|
TLegend *leg1_e = new TLegend(0.7,0.5,0.87,0.7); |
|
|
leg1_e->AddEntry(crc_e,"CRC","p"); |
|
|
leg1_e->AddEntry(headerr_e,"Headers","p"); |
|
|
leg1_e->AddEntry(crcerr_e,"Cmd CRC","p"); |
|
|
leg1_e->AddEntry(dsperr_e,"Dsp","p"); |
|
|
leg1_e->AddEntry(regerr_e,"Reg","p"); |
|
|
leg1_e->SetHeader("Errors EXTRA"); |
|
|
leg1_e->Draw(); |
|
|
*/ |
|
|
/* |
|
|
pd4->cd(); //upper left |
|
|
int max1 = head_m->GetMaximum(); |
|
|
int max2 = head_e->GetMaximum(); |
|
|
if(max1>max2) |
|
|
head_m->SetMaximum(1.1*max1); |
|
|
else |
|
|
head_m->SetMaximum(1.1*max2); |
|
|
|
|
|
head_m->SetLineColor(1); |
|
|
head_m->Draw(); |
|
|
head_e->SetLineColor(2); |
|
|
head_e->Draw("SAME"); |
|
|
*/ |
|
|
/* |
|
|
pd3->cd(); //upper right |
|
|
if(head_m->GetMaximum()>head_e->GetMaximum()) |
|
|
head_m->SetMaximum(1.1*head_m->GetMaximum()); |
|
|
else |
|
|
head_m->SetMaximum(1.1*head_e->GetMaximum()); |
|
|
head_m->SetLineColor(1); |
|
|
head_m->SetStats(kFALSE); |
|
|
head_m->Draw(); |
|
|
head_e->SetLineColor(2); |
|
|
head_e->Draw("SAME"); |
|
|
TLine *linje = new TLine(50,0,0,100); |
|
|
linje->SetLineColor(1); |
|
|
linje->Draw("SAME"); |
|
|
*/ |
|
|
|
|
|
pd2->cd(); |
|
|
pd2->SetLogy(1); |
|
|
dtrigg_m->SetLineColor(1); |
|
|
dtrigg_m->SetStats(kFALSE); |
|
|
dtrigg_m->Draw(); |
|
|
dtrigg_e->SetLineColor(2); |
|
|
dtrigg_e->SetStats(kFALSE); |
|
|
dtrigg_e->Draw("SAME"); |
|
|
|
|
|
pd3->cd(); |
|
|
pd3->SetLogy(1); |
|
|
timebtrigg_m->SetLineColor(1); |
|
|
//timebtrigg_m->SetStats(kFALSE); |
|
|
timebtrigg_m->Draw(); |
|
|
timebtrigg_e->SetLineColor(2); |
|
|
timebtrigg_e->SetMarkerStyle(2); |
|
|
timebtrigg_e->SetMarkerSize(1.); |
|
|
timebtrigg_e->SetMarkerColor(2); |
|
|
//timebtrigg_e->SetPolyMarker(2) |
|
|
timebtrigg_e->SetStats(kFALSE); |
|
|
timebtrigg_e->Draw("PSAME"); |
|
|
|
|
|
pd4->cd(); |
|
|
pd4->SetLogy(1); |
|
|
nmbhitpmtCAS->SetLineColor(1); |
|
|
nmbhitpmtCAS->SetStats(kFALSE); |
|
|
nmbhitpmtCAS->Draw(); |
|
|
|
|
|
pd7->cd(); |
|
|
pd5->SetLogy(1); |
|
|
nmbhitpmtCAT->SetLineColor(1); |
|
|
nmbhitpmtCAT->SetStats(kFALSE); |
|
|
nmbhitpmtCAT->Draw(); |
|
|
|
|
|
pd6->cd(); |
|
|
pd6->SetLogy(1); |
|
|
nmbhitpmtCARD->SetLineColor(1); |
|
|
nmbhitpmtCARD->SetStats(kFALSE); |
|
|
nmbhitpmtCARD->Draw(); |
|
|
|
|
|
|
|
|
/* |
|
|
TLegend *hitpmt = new TLegend(0.7,0.5,0.87,0.7); |
|
|
hitpmt->AddEntry(nmbhitpmtCAS,"CAS","L"); |
|
|
hitpmt->AddEntry(nmbhitpmtCAT,"CAT","L"); |
|
|
hitpmt->AddEntry(nmbhitpmtCARD,"CARD","L"); |
|
|
hitpmt->SetHeader("Detector"); |
|
|
hitpmt->Draw(); |
|
|
*/ |
|
|
//pd4->SetLogy(1); |
|
|
//timebtrigg_e->SetLineColor(2); |
|
|
//timebtrigg_e->SetStats(kFALSE); |
|
|
//timebtrigg_e->Draw(); |
|
|
|
|
591 |
|
|
592 |
//report sheet 3 |
/********************* MAIN LOOP **********************/ |
593 |
//report sheet 1 |
|
594 |
Canv_report3 = new TCanvas("QL Report Sheet 3","QL Report Sheet 3", 1280, 1024); |
//time1 = clock(); |
595 |
//TCanvas *Counter_report1 = new TCanvas("COUNTER Report sheet", "COUNTER Report sheet", 1280, 1024); |
//printf("Init time: %f\n",(Double_t) (time1 - startTime) / (Double_t) CLOCKS_PER_SEC); |
596 |
Canv_report3->Range(0,0,100,100); |
|
597 |
//tsf = (TSystemFile*) AcList->First(); |
//iterators used in the loop |
598 |
//sprintf(error,"File: %s ",tsf->GetName()); |
Int_t card, ch, bin; |
599 |
//TLatex *t=new TLatex(); |
|
600 |
|
for (Int_t i = minevent; i < maxevent; i++){ |
601 |
|
|
602 |
|
interval_cnt++; |
603 |
|
|
604 |
|
tr->GetEntry(i); |
605 |
|
ph = eh->GetPscuHeader(); |
606 |
|
obt = ph->GetOrbitalTime(); |
607 |
|
|
608 |
|
hitsCARD=hitsCAT=hitsCAS=0; |
609 |
|
|
610 |
|
for(card=0;card<2;card++) |
611 |
|
{ |
612 |
|
//proceed only if crc of event is ok |
613 |
|
//printf("CRC: %hx\n",ace->CRCcheck[card]); |
614 |
|
//printf("Hitmap: %hx\n\n",ace->hitmap[card]); |
615 |
|
if(ace->CRCcheck[card]==1) |
616 |
|
{ |
617 |
|
//clock |
618 |
|
ac_clock_old[card] = ac_clock_new[card]; |
619 |
|
ac_clock_new[card] = ace->clock[card][1]*0xFFFF + ace->clock[card][0]; |
620 |
|
if(ac_clock_new[card] - ac_clock_old[card] < 0.) |
621 |
|
ac_clock_diff[card] = 0xFFFFFFFF+ac_clock_new[card]-ac_clock_old[card]; |
622 |
|
else |
623 |
|
ac_clock_diff[card] = ac_clock_new[card]-ac_clock_old[card]; |
624 |
|
|
625 |
|
if(ac_clock_old[card] > 0. && 0.000000025*ac_clock_diff[card]<10.) |
626 |
|
time_between_trigg_h[card]->Fill( 0.000000025*ac_clock_diff[card] ); |
627 |
|
|
628 |
|
//counters, singlesrate & shift reg content |
629 |
|
for(ch=0;ch<16;ch++) |
630 |
|
{ |
631 |
|
counter_old[card][ch] = counter_new[card][ch]; |
632 |
|
counter_new[card][ch] = ace->counters[card][ch]; |
633 |
|
if(counter_new[card][ch] - counter_old[card][ch] < 0.) |
634 |
|
counter_diff[card][ch] = 0xFFFF + counter_new[card][ch] - counter_old[card][ch]; |
635 |
|
else |
636 |
|
counter_diff[card][ch] = counter_new[card][ch] - counter_old[card][ch]; |
637 |
|
|
638 |
|
singles_gr[card][ch][paramEvent] += (Double_t)counter_diff[card][ch]; |
639 |
|
|
640 |
|
for(bin = 0; bin < 16; bin++){ |
641 |
|
shiftreg_h[card][bin]->Fill(ch,ace->shift[card][ch] & 0x1<<bin); |
642 |
|
} |
643 |
|
|
644 |
|
//hitmap |
645 |
|
if( (ace->hitmap[card] & (0x1<<ch)) > 0 ){ |
646 |
|
hitmap_h[card]->Fill(ch,1.); |
647 |
|
if(ch==0 || ch==4 || ch==8 || ch==12) |
648 |
|
hitsCARD++; |
649 |
|
else if(ch==1 || ch==5 || ch==9 || ch==13) |
650 |
|
hitsCAT++; |
651 |
|
else if(ch==2 || ch==6 || ch==10 || ch==14) |
652 |
|
hitsCAS++; |
653 |
|
} |
654 |
|
|
655 |
|
} |
656 |
|
|
657 |
|
//Status |
658 |
|
if((ace->header[card][0] != 0xACAC) || (ace->header[card][1] != ACheader[card])) |
659 |
|
status_h->Fill(1.+6.*card,1.); |
660 |
|
if((ace->status[card] & 0x8000) < 0x8000) //crc |
661 |
|
status_h->Fill(2.+6.*card,1.); |
662 |
|
if((ace->status[card] & 0x6000) < 0x6000) //dsp |
663 |
|
status_h->Fill(3.+6.*card,1.); |
664 |
|
if((ace->status[card] & 0x0E00) < 0x0E00) //temp |
665 |
|
status_h->Fill(4.+6.*card,1.); |
666 |
|
if((ace->status[card] & 0x01FF) < 0x01FF) //reg |
667 |
|
status_h->Fill(4.+6*card,1.); |
668 |
|
|
669 |
|
//temperature (left on cards) |
670 |
|
temp_gr[card][0][paramEvent] += ( ((ace->temp[card][0] & 0x00FF))*2.8 - 273. )/(Float_t)INTERVAL; |
671 |
|
temp_gr[card][1][paramEvent] += ( ((ace->temp[card][0] & 0xFF00)/256)*2.8 - 273. )/(Float_t)INTERVAL; |
672 |
|
temp_gr[card][2][paramEvent] += ( ((ace->temp[card][1] & 0x00FF))*2.8 - 273. )/(Float_t)INTERVAL; |
673 |
|
temp_gr[card][3][paramEvent] += ( ((ace->temp[card][1] & 0xFF00)/256)*2.8 - 273. )/(Float_t)INTERVAL; |
674 |
|
|
675 |
|
}//if(crc check) |
676 |
|
else |
677 |
|
status_h->Fill(6.*card,1.); //event crc |
678 |
|
}//for(card) |
679 |
|
|
680 |
|
nmbhitpmtCARD_h->Fill(hitsCARD); |
681 |
|
nmbhitpmtCAS_h->Fill(hitsCAS); |
682 |
|
nmbhitpmtCAT_h->Fill(hitsCAT); |
683 |
|
|
684 |
|
|
685 |
|
if(interval_cnt==INTERVAL) |
686 |
|
{ |
687 |
|
event_obt[paramEvent] = ph->GetOrbitalTime(); |
688 |
|
|
689 |
|
for(card=0;card<2;card++) |
690 |
|
{ |
691 |
|
ac_clock100_old[card] = ac_clock100_new[card]; |
692 |
|
ac_clock100_new[card] = (ace->clock[card][1])*0xFFFF + ace->clock[card][0]; |
693 |
|
if((ac_clock100_new[card]-ac_clock100_old[card]) < 0.) |
694 |
|
ac_clock100_diff[card] = 0xFFFFFFFF+ac_clock100_new[card]-ac_clock100_old[card]; |
695 |
|
else |
696 |
|
ac_clock100_diff[card] = ac_clock100_new[card]-ac_clock100_old[card]; |
697 |
|
|
698 |
|
trigger_gr[card][paramEvent] = (Float_t)INTERVAL/(0.000000025*ac_clock100_diff[card]); |
699 |
|
|
700 |
|
for(ch=0;ch<16;ch++) |
701 |
|
singles_gr[card][ch][paramEvent] = singles_gr[card][ch][paramEvent]/(Double_t)(0.000000025*ac_clock100_diff[card]); |
702 |
|
|
703 |
|
}//for(card) |
704 |
|
interval_cnt=0; |
705 |
|
paramEvent++; |
706 |
|
}//if(interval_cnt)) |
707 |
|
|
708 |
|
} //for(events) |
709 |
|
|
710 |
|
//time2 = clock(); |
711 |
|
//printf("Loop time: %f\n",(Double_t) (time2 - time1) / (Double_t) CLOCKS_PER_SEC); |
712 |
|
|
713 |
|
/****************************** PLOTTING ***************************/ |
714 |
|
|
715 |
|
TCanvas *sheet1 = new TCanvas("Sheet 1"); |
716 |
|
sheet1->Range(0,0,100,100); |
717 |
|
sheet1->Draw(); |
718 |
|
sheet1->cd(); |
719 |
|
|
720 |
|
TLatex *t=new TLatex(); |
721 |
t->SetTextFont(32); |
t->SetTextFont(32); |
722 |
t->SetTextColor(1); |
t->SetTextColor(1); |
723 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
724 |
t->SetTextSize(0.015); |
t->SetTextSize(0.02); |
725 |
//t->DrawLatex(2.,99.,error); |
|
726 |
//char *namn; |
TPad *pd1 = new TPad("pd1","This is pad1",0.02,0.02,0.49,0.49,17); //lower left |
727 |
//TLatex *t2 = new TLatex(); |
TPad *pd2 = new TPad("pd2","This is pad2",0.51,0.02,0.98,0.49,17); //lower right |
728 |
|
TPad *pd4 = new TPad("pd4","This is pad4",0.02,0.51,0.49,0.98,17); //upper left |
729 |
|
TPad *pd3 = new TPad("pd3","This is pad3",0.51,0.51,0.98,0.98,17); //upper right |
730 |
|
|
731 |
|
|
732 |
|
pd4->Range(0,0,100,100); |
733 |
|
sheet1->cd(); |
734 |
|
pd1->Draw(); |
735 |
|
pd2->Draw(); |
736 |
|
pd3->Draw(); |
737 |
|
pd4->Draw(); |
738 |
|
|
739 |
|
pd4->cd(); |
740 |
|
char namn3[30]; |
741 |
|
char namn4[40]; |
742 |
|
sprintf(namn3,"Anticounter Quicklook v%.1f",VERSION); |
743 |
|
sprintf(namn4,"File: %s",fileName.Data()); |
744 |
|
t->SetTextSize(0.1); |
745 |
|
t->DrawLatex(5,90,namn3); |
746 |
|
t->SetTextSize(0.1); |
747 |
|
t->DrawLatex(20,50,namn4); |
748 |
|
|
749 |
|
t->SetTextSize(0.02); |
750 |
|
|
751 |
|
pd3->cd(); |
752 |
|
status_h->SetLineColor(1); |
753 |
|
status_h->SetStats(kFALSE); |
754 |
|
status_h->Draw(); |
755 |
|
|
756 |
|
pd1->cd(); |
757 |
|
TGraph *temperatureRIGHT_M_g = new TGraph(paramEvents,event_obt,temp_gr[0][0]); |
758 |
|
TGraph *temperatureACTEL_M_g = new TGraph(paramEvents,event_obt,temp_gr[0][1]); |
759 |
|
TGraph *temperatureLEFT_M_g = new TGraph(paramEvents,event_obt,temp_gr[0][2]); |
760 |
|
TGraph *temperatureDSP_M_g = new TGraph(paramEvents,event_obt,temp_gr[0][3]); |
761 |
|
temperatureRIGHT_M_g->SetMaximum(50.); |
762 |
|
temperatureRIGHT_M_g->SetMinimum(0.); |
763 |
|
temperatureRIGHT_M_g->SetTitle("Temperature MAIN"); |
764 |
|
temperatureRIGHT_M_g->GetXaxis()->SetTitle("Obt [ms]"); |
765 |
|
temperatureRIGHT_M_g->GetYaxis()->SetTitle("T [Celsius]"); |
766 |
|
temperatureRIGHT_M_g->SetMarkerColor(1); |
767 |
|
temperatureACTEL_M_g->SetMarkerColor(2); |
768 |
|
temperatureLEFT_M_g->SetMarkerColor(3); |
769 |
|
temperatureDSP_M_g->SetMarkerColor(4); |
770 |
|
temperatureRIGHT_M_g->Draw("AP"); |
771 |
|
temperatureACTEL_M_g->Draw("PSAME"); |
772 |
|
temperatureLEFT_M_g->Draw("PSAME"); |
773 |
|
temperatureDSP_M_g->Draw("PSAME"); |
774 |
|
|
775 |
|
TLegend *legTempM = new TLegend(0.72,0.63,0.85,0.8); |
776 |
|
legTempM->AddEntry(temperatureRIGHT_M_g,"Right","P"); |
777 |
|
legTempM->AddEntry(temperatureACTEL_M_g,"Actel","P"); |
778 |
|
legTempM->AddEntry(temperatureLEFT_M_g,"Left","P"); |
779 |
|
legTempM->AddEntry(temperatureDSP_M_g,"Dsp","P"); |
780 |
|
legTempM->Draw(); |
781 |
|
|
782 |
|
pd2->cd(); |
783 |
|
TGraph *temperatureRIGHT_E_g = new TGraph(paramEvents,event_obt,temp_gr[1][0]); |
784 |
|
TGraph *temperatureACTEL_E_g = new TGraph(paramEvents,event_obt,temp_gr[1][1]); |
785 |
|
TGraph *temperatureLEFT_E_g = new TGraph(paramEvents,event_obt,temp_gr[1][2]); |
786 |
|
TGraph *temperatureDSP_E_g = new TGraph(paramEvents,event_obt,temp_gr[1][3]); |
787 |
|
temperatureRIGHT_E_g->SetTitle("Temperature EXTRA"); |
788 |
|
temperatureRIGHT_E_g->GetXaxis()->SetTitle("Obt [ms]"); |
789 |
|
temperatureRIGHT_E_g->GetYaxis()->SetTitle("T [Celsius]"); |
790 |
|
temperatureRIGHT_E_g->SetMarkerColor(1); |
791 |
|
temperatureACTEL_E_g->SetMarkerColor(2); |
792 |
|
temperatureLEFT_E_g->SetMarkerColor(3); |
793 |
|
temperatureDSP_E_g->SetMarkerColor(4); |
794 |
|
temperatureRIGHT_E_g->SetLineColor(1); |
795 |
|
temperatureACTEL_E_g->SetLineColor(2); |
796 |
|
temperatureLEFT_E_g->SetLineColor(3); |
797 |
|
temperatureDSP_E_g->SetLineColor(4); |
798 |
|
|
799 |
|
|
800 |
|
temperatureRIGHT_E_g->SetMaximum(50.); |
801 |
|
temperatureRIGHT_E_g->SetMinimum(0.); |
802 |
|
temperatureRIGHT_E_g->Draw("AL"); |
803 |
|
temperatureACTEL_E_g->Draw("LSAME"); |
804 |
|
temperatureLEFT_E_g->Draw("LSAME"); |
805 |
|
temperatureDSP_E_g->Draw("LSAME"); |
806 |
|
|
807 |
|
TLegend *legTempE = new TLegend(0.72,0.63,0.86,0.8); |
808 |
|
legTempE->AddEntry(temperatureRIGHT_E_g,"Right","L"); |
809 |
|
legTempE->AddEntry(temperatureACTEL_E_g,"Actel","L"); |
810 |
|
legTempE->AddEntry(temperatureLEFT_E_g,"Left","L"); |
811 |
|
legTempE->AddEntry(temperatureDSP_E_g,"Dsp","L"); |
812 |
|
legTempE->Draw(); |
813 |
|
|
814 |
|
/************************/ |
815 |
|
|
816 |
|
TCanvas *sheet2 = new TCanvas("Sheet 2"); |
817 |
|
sheet2->Range(0,0,100,100); |
818 |
|
sheet2->Draw(); |
819 |
|
sheet2->cd(); |
820 |
|
|
821 |
|
TPad *pd21 = new TPad("pd21","This is pad1",0.02,0.02,0.49,0.49,17); //lower left |
822 |
|
//TPad *pd22 = new TPad("pd22","This is pad2",0.51,0.02,0.98,0.49,17); //lower right |
823 |
|
TPad *pd22_1 = new TPad("pd22_1","This is pad22_1",0.51,0.02,0.65,0.49,17); |
824 |
|
TPad *pd22_2 = new TPad("pd22_3","This is pad22_2",0.67,0.02,0.81,0.49,17); |
825 |
|
TPad *pd22_3 = new TPad("pd22_4","This is pad22_3",0.83,0.02,0.97,0.49,17); |
826 |
|
|
827 |
|
TPad *pd24 = new TPad("pd24","This is pad4",0.02,0.51,0.49,0.98,17); //upper left |
828 |
|
TPad *pd23 = new TPad("pd23","This is pad3",0.51,0.51,0.98,0.98,17); //upper right |
829 |
|
sheet2->cd(); |
830 |
|
pd21->Draw(); |
831 |
|
pd22_1->Draw(); |
832 |
|
pd22_2->Draw(); |
833 |
|
pd22_3->Draw(); |
834 |
|
pd23->Draw(); |
835 |
|
pd24->Draw(); |
836 |
|
|
837 |
|
t->SetTextColor(1); |
838 |
|
t->DrawLatex(82,99,cardname[0]); |
839 |
|
t->SetTextColor(2); |
840 |
|
t->DrawLatex(89,99,cardname[1]); |
841 |
|
|
842 |
|
pd24->cd(); |
843 |
|
TGraph *triggM_gr = new TGraph(paramEvents,event_obt,trigger_gr[0]); |
844 |
|
TGraph *triggE_gr = new TGraph(paramEvents,event_obt,trigger_gr[1]); |
845 |
|
triggM_gr->SetTitle("Trigger Rate"); |
846 |
|
triggM_gr->GetXaxis()->SetTitle("Obt [ms]"); |
847 |
|
triggM_gr->GetYaxis()->SetTitle("f [Hz]"); |
848 |
|
triggM_gr->SetMarkerColor(1); |
849 |
|
triggE_gr->SetMarkerColor(2); |
850 |
|
triggM_gr->SetLineColor(1); |
851 |
|
triggE_gr->SetLineColor(2); |
852 |
|
triggM_gr->Draw("AL"); |
853 |
|
triggE_gr->Draw("LSAME"); |
854 |
|
|
855 |
|
pd23->cd(); |
856 |
|
gPad->SetLogy(1); |
857 |
|
time_between_trigg_h[0]->GetXaxis()->SetTitle("Time [s]"); |
858 |
|
time_between_trigg_h[0]->SetLineColor(1); |
859 |
|
time_between_trigg_h[1]->SetLineColor(2); |
860 |
|
if(time_between_trigg_h[0]->GetMaximum() < time_between_trigg_h[1]->GetMaximum()) |
861 |
|
time_between_trigg_h[0]->SetMaximum(1.3*time_between_trigg_h[1]->GetMaximum()); |
862 |
|
//time_between_trigg_h[0]->SetStats(kFALSE); |
863 |
|
time_between_trigg_h[0]->Draw(); |
864 |
|
time_between_trigg_h[1]->SetStats(kFALSE); |
865 |
|
time_between_trigg_h[1]->Draw("SAME"); |
866 |
|
|
867 |
|
|
868 |
|
pd21->cd(); |
869 |
|
hitmap_h[0]->SetStats(kFALSE); |
870 |
|
hitmap_h[1]->SetStats(kFALSE); |
871 |
|
hitmap_h[0]->SetLineColor(1); |
872 |
|
if(hitmap_h[0]->GetMaximum() < hitmap_h[1]->GetMaximum()) |
873 |
|
hitmap_h[0]->SetMaximum(1.1*hitmap_h[1]->GetMaximum()); |
874 |
|
hitmap_h[0]->Draw(); |
875 |
|
hitmap_h[1]->SetLineColor(2); |
876 |
|
hitmap_h[1]->Draw("SAME"); |
877 |
|
|
878 |
|
|
879 |
|
pd22_1->cd(); |
880 |
|
gPad->SetLogy(1); |
881 |
|
nmbhitpmtCARD_h->SetTitle("CARD"); |
882 |
|
nmbhitpmtCARD_h->GetXaxis()->SetTitle("Nmb of hits"); |
883 |
|
nmbhitpmtCARD_h->GetYaxis()->SetTitle("Events"); |
884 |
|
nmbhitpmtCARD_h->SetStats(kFALSE); |
885 |
|
nmbhitpmtCARD_h->SetLineColor(1); |
886 |
|
nmbhitpmtCARD_h->Draw(); |
887 |
|
|
888 |
|
pd22_2->cd(); |
889 |
|
gPad->SetLogy(1); |
890 |
|
nmbhitpmtCAT_h->SetTitle("CAT"); |
891 |
|
nmbhitpmtCAT_h->GetXaxis()->SetTitle("Nmb of hits"); |
892 |
|
nmbhitpmtCAT_h->GetYaxis()->SetTitle("Events"); |
893 |
|
nmbhitpmtCAT_h->SetStats(kFALSE); |
894 |
|
nmbhitpmtCAT_h->SetLineColor(1); |
895 |
|
nmbhitpmtCAT_h->Draw(); |
896 |
|
|
897 |
|
pd22_3->cd(); |
898 |
|
gPad->SetLogy(1); |
899 |
|
nmbhitpmtCAS_h->SetTitle("CAS"); |
900 |
|
nmbhitpmtCAS_h->GetXaxis()->SetTitle("Nmb of hits"); |
901 |
|
nmbhitpmtCAS_h->GetYaxis()->SetTitle("Events"); |
902 |
|
nmbhitpmtCAS_h->SetStats(kFALSE); |
903 |
|
nmbhitpmtCAS_h->SetLineColor(1); |
904 |
|
nmbhitpmtCAS_h->Draw(); |
905 |
|
|
906 |
|
/* |
907 |
|
if(nmbhitpmtCAT_h->GetMaximum() > nmbhitpmtCARD_h->GetMaximum()) |
908 |
|
{ |
909 |
|
if(nmbhitpmtCAT_h->GetMaximum() > nmbhitpmtCAS_h->GetMaximum()) |
910 |
|
nmbhitpmtCARD_h->SetMaximum(1.2*nmbhitpmtCAT_h->GetMaximum()); |
911 |
|
else |
912 |
|
nmbhitpmtCARD_h->SetMaximum(1.2*nmbhitpmtCAS_h->GetMaximum()); |
913 |
|
} |
914 |
|
nmbhitpmtCARD_h->SetLineColor(1); |
915 |
|
nmbhitpmtCAT_h->SetLineColor(2); |
916 |
|
nmbhitpmtCAS_h->SetLineColor(3); |
917 |
|
nmbhitpmtCARD_h->SetMarkerStyle(20); |
918 |
|
nmbhitpmtCAT_h->SetMarkerStyle(21); |
919 |
|
nmbhitpmtCAS_h->SetMarkerStyle(22); |
920 |
|
nmbhitpmtCARD_h->Draw("P"); |
921 |
|
nmbhitpmtCAT_h->Draw("PSAME"); |
922 |
|
nmbhitpmtCAS_h->Draw("PSAME"); |
923 |
|
|
924 |
|
TLegend *leghitpmt = new TLegend(0.72,0.63,0.86,0.8); |
925 |
|
leghitpmt->AddEntry(nmbhitpmtCARD_h,"CARD","P"); |
926 |
|
leghitpmt->AddEntry(nmbhitpmtCAT_h,"CAT","P"); |
927 |
|
leghitpmt->AddEntry(nmbhitpmtCAS_h,"CAS","P"); |
928 |
|
leghitpmt->Draw(); |
929 |
|
*/ |
930 |
|
|
931 |
|
/********** SHEET 3 *********/ |
932 |
|
|
933 |
|
TCanvas *sheet3 = new TCanvas("Sheet 3"); |
934 |
|
//sheet2->Divide(4,4); |
935 |
|
sheet3->Draw(); |
936 |
|
sheet3->cd(); |
937 |
|
|
938 |
|
sheet3->Range(0,0,100,100); |
939 |
|
|
940 |
t->SetTextFont(32); |
t->SetTextFont(32); |
941 |
t->SetTextColor(1); |
t->SetTextColor(1); |
942 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
943 |
t->SetTextSize(0.035); |
t->SetTextSize(0.035); |
944 |
|
char *namn = " "; |
945 |
namn="Singles Counters"; |
|
946 |
|
namn="Singles Rate"; |
947 |
t->DrawLatex(40.,95,namn); |
t->DrawLatex(40.,95,namn); |
948 |
namn="CAS"; |
namn="CAS"; |
949 |
t->DrawLatex(4.,95.,namn); |
t->DrawLatex(4.,95.,namn); |
952 |
namn="CARD"; |
namn="CARD"; |
953 |
t->DrawLatex(4.,34.,namn); |
t->DrawLatex(4.,34.,namn); |
954 |
|
|
|
t->SetTextFont(32); |
|
|
t->SetTextColor(1); |
|
|
t->SetTextAlign(12); |
|
955 |
t->SetTextSize(0.02); |
t->SetTextSize(0.02); |
956 |
namn="MAIN"; |
namn="MAIN"; |
957 |
t->DrawLatex(85,98,namn); |
t->DrawLatex(85,98,namn); |
958 |
t->SetTextColor(2); |
t->SetTextColor(2); |
959 |
namn="EXTRA"; |
namn="EXTRA"; |
960 |
t->DrawLatex(85,95,namn); |
t->DrawLatex(85,95,namn); |
961 |
//TPad *pd1,*pd2,*pd3,*pd4,*pd5,*pd6,*pd7,*pd8,*pd9,*pd10,*pd11,*pd12; |
|
962 |
pd1 = new TPad("pd1","This is pad1",0.,0.68,0.25,.92); |
Float_t pad_x1[12] = {0.,0.25,0.5,0.75,0.,0.25,0.5,0.75,0.,0.25,0.5,0.75}; |
963 |
pd2 = new TPad("pd2","This is pad2",0.25,0.68,0.5,.92); |
Float_t pad_x2[12] = {0.25,0.5,0.75,1.0,0.25,0.5,0.75,1.,0.25,0.5,0.75,1.}; |
964 |
pd3 = new TPad("pd3","This is pad3",0.5,0.68,0.75,.92); |
Float_t pad_y1[12] = {0.68,0.68,0.68,0.68,0.37,0.37,0.37,0.37,0.06,0.06,0.06,0.06}; |
965 |
pd4 = new TPad("pd4","This is pad4",0.75,0.68,1.0,.92); |
Float_t pad_y2[12] = {0.92,0.92,0.92,0.92,0.62,0.62,0.62,0.62,0.31,0.31,0.31,0.31}; |
966 |
pd5 = new TPad("pd5","This is pad5",0.,0.37,0.25,0.62); |
TPad *singles_Pads[12]; |
967 |
pd6 = new TPad("pd6","This is pad6",0.25,0.37,.5,0.62); |
|
968 |
pd7 = new TPad("pd7","This is pad7",0.5,0.37,0.75,0.62); |
char singlesname[30]; |
969 |
pd8 = new TPad("pd8","This is pad8",0.75,0.37,1.0,0.62); |
for(Int_t ch=0;ch<12;ch++){ |
970 |
pd9 = new TPad("pd9","This is pad9",0.0,0.06,0.25,0.31); |
sprintf(singlesname,"Pad%d",ch+1); |
971 |
pd10 = new TPad("pd10","This is pad10",0.25,0.06,.5,0.31); |
singles_Pads[ch] = new TPad(singlesname,singlesname,pad_x1[ch],pad_y1[ch],pad_x2[ch],pad_y2[ch]); |
972 |
pd11 = new TPad("pd11","This is pad11",0.5,0.06,0.75,0.31); |
singles_Pads[ch]->Draw(); |
973 |
pd12 = new TPad("pd12","This is pad12",0.75,0.06,1.,0.31); |
} |
974 |
//pd13 = new TPad("pd13","This is pad13",0.,0.0,0.25,0.25); |
|
975 |
//pd14 = new TPad("pd14","This is pad14",0.25,0.0,.5,0.25); |
sheet3->cd(); |
976 |
//pd15 = new TPad("pd15","This is pad15",0.5,0.0,0.75,0.25); |
singles_gr[0][4][0]=0.; |
977 |
//pd16 = new TPad("pd16","This is pad16",0.75,0.0,1.0,0.25); |
TGraph *singlesrate_g[2][12]; |
978 |
Canv_report3->cd(); |
Int_t k; |
979 |
//pd1->Range(0,0,100,100); |
for(Int_t card=0;card<2;card++){ |
980 |
//pd2->Range(0,0,100,100); |
k=0; |
981 |
//pd3->Range(0,0,100,100); |
for(Int_t ch=0;ch<16;ch++){ |
982 |
//pd4->Range(0,0,100,100); |
if(ch!=3 && ch!=7 && ch!= 11 && ch!=15){ |
983 |
//pd5->Range(0,0,100,100); |
//printf("k %d ch %d\n",k,ch); |
984 |
//pd6->Range(0,0,100,100); |
singles_Pads[k]->cd(); |
985 |
//pd7->Range(0,0,100,100); |
singles_gr[card][det_map[k]][0]=0.0; |
986 |
//pd8->Range(0,0,100,100); |
singlesrate_g[card][k] = new TGraph(paramEvents,event_obt,singles_gr[card][det_map[k]]); |
987 |
//pd9->Range(0,0,100,100); |
singlesrate_g[card][k]->SetMarkerColor(card+1); |
988 |
//pd10->Range(0,0,100,100); |
singlesrate_g[card][k]->GetXaxis()->SetTitle("Obt [ms]"); |
989 |
//pd11->Range(0,0,100,100); |
singlesrate_g[card][k]->GetYaxis()->SetTitle("f [Hz]"); |
990 |
//pd12->Range(0,0,100,100); |
singlesrate_g[card][k]->SetTitle(detector[det_map[k]].Data()); |
991 |
//pd13->Range(0,0,100,100); |
if(card==0) |
992 |
//pd14->Range(0,0,100,100); |
singlesrate_g[card][k]->Draw("AP"); |
993 |
//pd15->Range(0,0,100,100); |
else |
994 |
//pd16->Range(0,0,100,100); |
singlesrate_g[card][k]->Draw("PSAME"); |
995 |
pd1->Draw(); |
k++; |
996 |
pd2->Draw(); |
} |
997 |
pd3->Draw(); |
} |
998 |
pd4->Draw(); |
} |
999 |
pd5->Draw(); |
|
1000 |
pd6->Draw(); |
/********** SHEET 4 *********/ |
1001 |
pd7->Draw(); |
|
1002 |
pd8->Draw(); |
TCanvas *sheet4 = new TCanvas("Sheet 4"); |
1003 |
pd9->Draw(); |
//sheet2->Divide(4,4); |
1004 |
pd10->Draw(); |
sheet4->Draw(); |
1005 |
pd11->Draw(); |
sheet4->cd(); |
1006 |
pd12->Draw(); |
|
1007 |
//pd13->Draw(); |
sheet4->Range(0,0,100,100); |
1008 |
//pd14->Draw(); |
|
|
//pd15->Draw(); |
|
|
//pd16->Draw(); |
|
|
pd1->cd(); |
|
|
counter3_m->SetLineColor(1); |
|
|
counter3_m->Draw(); |
|
|
counter3_e->SetLineColor(2); |
|
|
counter3_e->Draw("SAME"); |
|
|
pd2->cd(); |
|
|
counter15_m->SetLineColor(1); |
|
|
counter15_m->Draw(); |
|
|
counter15_e->SetLineColor(2); |
|
|
counter15_e->Draw("SAME"); |
|
|
pd3->cd(); |
|
|
counter11_m->SetLineColor(1); |
|
|
counter11_m->Draw(); |
|
|
counter11_e->SetLineColor(2); |
|
|
counter11_e->Draw("SAME"); |
|
|
pd4->cd(); |
|
|
counter7_m->SetLineColor(1); |
|
|
counter7_m->Draw(); |
|
|
counter7_e->SetLineColor(2); |
|
|
counter7_e->Draw("SAME"); |
|
|
pd5->cd(); |
|
|
counter14_m->SetLineColor(1); |
|
|
counter14_m->Draw(); |
|
|
counter14_e->SetLineColor(2); |
|
|
counter14_e->Draw("SAME"); |
|
|
pd6->cd(); |
|
|
counter2_m->SetLineColor(1); |
|
|
counter2_m->Draw(); |
|
|
counter2_e->SetLineColor(2); |
|
|
counter2_e->Draw("SAME"); |
|
|
pd7->cd(); |
|
|
counter3_m->SetLineColor(1); |
|
|
counter10_m->Draw(); |
|
|
counter10_e->SetLineColor(2); |
|
|
counter10_e->Draw("SAME"); |
|
|
pd8->cd(); |
|
|
counter6_m->SetLineColor(1); |
|
|
counter6_m->Draw(); |
|
|
counter6_e->SetLineColor(2); |
|
|
counter6_e->Draw("SAME"); |
|
|
pd9->cd(); |
|
|
counter13_m->SetLineColor(1); |
|
|
counter13_m->Draw(); |
|
|
counter13_e->SetLineColor(2); |
|
|
counter13_e->Draw("SAME"); |
|
|
pd10->cd(); |
|
|
counter5_m->SetLineColor(1); |
|
|
counter5_m->Draw(); |
|
|
counter5_e->SetLineColor(2); |
|
|
counter5_e->Draw("SAME"); |
|
|
pd11->cd(); |
|
|
counter9_m->SetLineColor(1); |
|
|
counter9_m->Draw(); |
|
|
counter9_e->SetLineColor(2); |
|
|
counter9_e->Draw("SAME"); |
|
|
pd12->cd(); |
|
|
counter1_m->SetLineColor(1); |
|
|
counter1_m->Draw(); |
|
|
counter1_e->SetLineColor(2); |
|
|
counter1_e->Draw("SAME"); |
|
|
|
|
|
//report sheet 4 |
|
|
Canv_report4 = new TCanvas("QL Report sheet 4", "QL Report sheet 4", 1280, 1024); |
|
|
Canv_report4->Range(0,0,100,100); |
|
|
//tsf = (TSystemFile*)AcList->First(); |
|
|
//sprintf(error,"File: %s ",tsf->GetName()); |
|
|
//TLatex *t=new TLatex(); |
|
|
t->SetTextFont(32); |
|
|
t->SetTextColor(1); |
|
|
t->SetTextAlign(12); |
|
|
t->SetTextSize(0.015); |
|
|
//t->DrawLatex(2.,99.,error); |
|
|
//char *namn; |
|
|
//TLatex *t2 = new TLatex(); |
|
1009 |
t->SetTextFont(32); |
t->SetTextFont(32); |
1010 |
t->SetTextColor(1); |
t->SetTextColor(1); |
1011 |
t->SetTextAlign(12); |
t->SetTextAlign(12); |
1012 |
t->SetTextSize(0.035); |
t->SetTextSize(0.035); |
1013 |
|
|
1014 |
|
namn="Shift Register Content"; |
1015 |
|
t->DrawLatex(40.,95,namn); |
1016 |
namn="CAS"; |
namn="CAS"; |
1017 |
t->DrawLatex(4.,94.,namn); |
t->DrawLatex(4.,95.,namn); |
1018 |
namn="CAT"; |
namn="CAT"; |
1019 |
t->DrawLatex(4.,65.,namn); |
t->DrawLatex(4.,65.,namn); |
1020 |
namn="CARD"; |
namn="CARD"; |
1021 |
t->DrawLatex(4.,34.,namn); |
t->DrawLatex(4.,34.,namn); |
1022 |
namn="Shift register content"; |
|
|
t->DrawLatex(39.,95,namn); |
|
|
t->SetTextFont(32); |
|
|
t->SetTextColor(1); |
|
|
t->SetTextAlign(12); |
|
1023 |
t->SetTextSize(0.02); |
t->SetTextSize(0.02); |
1024 |
namn="MAIN"; |
namn="MAIN"; |
1025 |
t->DrawLatex(85,98,namn); |
t->DrawLatex(85,98,namn); |
1027 |
namn="EXTRA"; |
namn="EXTRA"; |
1028 |
t->DrawLatex(85,95,namn); |
t->DrawLatex(85,95,namn); |
1029 |
|
|
1030 |
//TPad *pd1,*pd2,*pd3,*pd4,*pd5,*pd6,*pd7,*pd8,*pd9,*pd10,*pd11,*pd12; |
TPad *shift_Pads[12]; |
1031 |
pd1 = new TPad("pd1","This is pad1",0.,0.68,0.25,.92); |
|
1032 |
pd2 = new TPad("pd2","This is pad2",0.25,0.68,0.5,.92); |
for(Int_t ch=0;ch<12;ch++){ |
1033 |
pd3 = new TPad("pd3","This is pad3",0.5,0.68,0.75,.92); |
sprintf(singlesname,"ShiftPad%d",ch+1); |
1034 |
pd4 = new TPad("pd4","This is pad4",0.75,0.68,1.0,.92); |
shift_Pads[ch] = new TPad(singlesname,singlesname,pad_x1[ch],pad_y1[ch],pad_x2[ch],pad_y2[ch]); |
1035 |
pd5 = new TPad("pd5","This is pad5",0.,0.37,0.25,0.62); |
shift_Pads[ch]->Draw(); |
1036 |
pd6 = new TPad("pd6","This is pad6",0.25,0.37,.5,0.62); |
} |
1037 |
pd7 = new TPad("pd7","This is pad7",0.5,0.37,0.75,0.62); |
|
1038 |
pd8 = new TPad("pd8","This is pad8",0.75,0.37,1.0,0.62); |
sheet4->cd(); |
1039 |
pd9 = new TPad("pd9","This is pad9",0.0,0.06,0.25,0.31); |
for(Int_t card=0;card<2;card++){ |
1040 |
pd10 = new TPad("pd10","This is pad10",0.25,0.06,.5,0.31); |
k=0; |
1041 |
pd11 = new TPad("pd11","This is pad11",0.5,0.06,0.75,0.31); |
for(Int_t ch=0;ch<16;ch++){ |
1042 |
pd12 = new TPad("pd12","This is pad12",0.75,0.06,1.,0.31); |
if(ch!=3 && ch!=7 && ch!= 11 && ch!=15){ |
1043 |
//pd13 = new TPad("pd13","This is pad13",0.,0.0,0.25,0.25); |
//printf("k %d ch %d\n",k,ch); |
1044 |
//pd14 = new TPad("pd14","This is pad14",0.25,0.0,.5,0.25); |
shift_Pads[k]->cd(); |
1045 |
//pd15 = new TPad("pd15","This is pad15",0.5,0.0,0.75,0.25); |
gPad->SetLogy(1); |
1046 |
//pd16 = new TPad("pd16","This is pad16",0.75,0.0,1.0,0.25); |
shiftreg_h[card][det_map[k]]->SetStats(kFALSE); |
1047 |
Canv_report4->cd(); |
shiftreg_h[card][det_map[k]]->SetLineColor(1+card); |
1048 |
//pd1->Range(0,0,100,100); |
shiftreg_h[card][det_map[k]]->SetMinimum(0.); |
1049 |
pd1->SetLogy(1); |
shiftreg_h[card][det_map[k]]->Scale(1./shiftreg_h[card][det_map[k]]->Integral()); |
1050 |
//pd2->Range(0,0,100,100); |
if(card==0) |
1051 |
pd2->SetLogy(1); |
shiftreg_h[card][det_map[k]]->Draw(); |
1052 |
//pd3->Range(0,0,100,100); |
else |
1053 |
pd3->SetLogy(1); |
shiftreg_h[card][det_map[k]]->Draw("SAME"); |
1054 |
// pd4->Range(0,0,100,100); |
k++; |
1055 |
pd4->SetLogy(1); |
} |
|
//pd5->Range(0,0,100,100); |
|
|
pd5->SetLogy(1); |
|
|
//pd6->Range(0,0,100,100); |
|
|
pd6->SetLogy(1); |
|
|
//pd7->Range(0,0,100,100); |
|
|
pd7->SetLogy(1); |
|
|
//pd8->Range(0,0,100,100); |
|
|
pd8->SetLogy(1); |
|
|
//pd9->Range(0,0,100,100); |
|
|
pd9->SetLogy(1); |
|
|
//pd10->Range(0,0,100,100); |
|
|
pd10->SetLogy(1); |
|
|
//pd11->Range(0,0,100,100); |
|
|
pd11->SetLogy(1); |
|
|
//pd12->Range(0,0,100,100); |
|
|
pd12->SetLogy(1); |
|
|
//pd13->Range(0,0,100,100); |
|
|
//pd14->Range(0,0,100,100); |
|
|
//pd15->Range(0,0,100,100); |
|
|
//pd16->Range(0,0,100,100); |
|
|
pd1->Draw(); |
|
|
pd2->Draw(); |
|
|
pd3->Draw(); |
|
|
pd4->Draw(); |
|
|
pd5->Draw(); |
|
|
pd6->Draw(); |
|
|
pd7->Draw(); |
|
|
pd8->Draw(); |
|
|
pd9->Draw(); |
|
|
pd10->Draw(); |
|
|
pd11->Draw(); |
|
|
pd12->Draw(); |
|
|
//pd13->Draw(); |
|
|
//pd14->Draw(); |
|
|
//pd15->Draw(); |
|
|
//pd16->Draw(); |
|
|
pd1->cd(); |
|
|
shift3_m->SetLineColor(1); |
|
|
shift3_m->Draw(); |
|
|
shift3_e->SetLineColor(2); |
|
|
shift3_e->Draw("SAME"); |
|
|
pd2->cd(); |
|
|
shift15_m->SetLineColor(1); |
|
|
shift15_m->Draw(); |
|
|
shift15_e->SetLineColor(2); |
|
|
shift15_e->Draw("SAME"); |
|
|
pd3->cd(); |
|
|
shift11_m->SetLineColor(1); |
|
|
shift11_m->Draw(); |
|
|
shift11_e->SetLineColor(2); |
|
|
shift11_e->Draw("SAME"); |
|
|
pd4->cd(); |
|
|
shift7_m->SetLineColor(1); |
|
|
shift7_m->Draw(); |
|
|
shift7_e->SetLineColor(2); |
|
|
shift7_e->Draw("SAME"); |
|
|
pd5->cd(); |
|
|
shift14_m->SetLineColor(1); |
|
|
shift14_m->Draw(); |
|
|
shift14_e->SetLineColor(2); |
|
|
shift14_e->Draw("SAME"); |
|
|
pd6->cd(); |
|
|
shift2_m->SetLineColor(1); |
|
|
shift2_m->Draw(); |
|
|
shift2_e->SetLineColor(2); |
|
|
shift2_e->Draw("SAME"); |
|
|
pd7->cd(); |
|
|
shift3_m->SetLineColor(1); |
|
|
shift10_m->Draw(); |
|
|
shift10_e->SetLineColor(2); |
|
|
shift10_e->Draw("SAME"); |
|
|
pd8->cd(); |
|
|
shift6_m->SetLineColor(1); |
|
|
shift6_m->Draw(); |
|
|
shift6_e->SetLineColor(2); |
|
|
shift6_e->Draw("SAME"); |
|
|
pd9->cd(); |
|
|
shift13_m->SetLineColor(1); |
|
|
shift13_m->Draw(); |
|
|
shift13_e->SetLineColor(2); |
|
|
shift13_e->Draw("SAME"); |
|
|
pd10->cd(); |
|
|
shift5_m->SetLineColor(1); |
|
|
shift5_m->Draw(); |
|
|
shift5_e->SetLineColor(2); |
|
|
shift5_e->Draw("SAME"); |
|
|
pd11->cd(); |
|
|
shift9_m->SetLineColor(1); |
|
|
shift9_m->Draw(); |
|
|
shift9_e->SetLineColor(2); |
|
|
shift9_e->Draw("SAME"); |
|
|
pd12->cd(); |
|
|
shift1_m->SetLineColor(1); |
|
|
shift1_m->Draw(); |
|
|
shift1_e->SetLineColor(2); |
|
|
shift1_e->Draw("SAME"); |
|
|
}//if(fullversion) |
|
|
|
|
|
|
|
|
//Name the file |
|
|
//const string fil = (const char*)fileName; |
|
|
|
|
|
//Int_t posiz = fil.find("dw_"); |
|
|
//if ( posiz == -1 ) posiz = fil.find("DW_"); |
|
|
//Int_t posiz2 = posiz+13; |
|
|
//TString file2; |
|
|
//stringcopy(file2,base,posiz,posiz2); |
|
|
// |
|
|
//const char *figrec = file2; |
|
|
|
|
|
//string *outdir = new string(outDir); |
|
|
//string *Format = new string(format); |
|
|
//char *figsave = 0; |
|
|
if(fullversion) |
|
|
{ |
|
|
figsave = Form("%s/AcQLOOK1_%s.%s",outDir.Data(),fileName.Data(),format.Data()); |
|
|
Canv_report1->SaveAs(figsave); |
|
|
figsave = Form("%s/AcQLOOK2_%s.%s",outDir.Data(),fileName.Data(),format.Data()); |
|
|
Canv_report2->SaveAs(figsave); |
|
|
figsave = Form("%s/AcQLOOK3_%s.%s",outDir.Data(),fileName.Data(),format.Data()); |
|
|
Canv_report3->SaveAs(figsave); |
|
|
figsave = Form("%s/AcQLOOK4_%s.%s",outDir.Data(),fileName.Data(),format.Data()); |
|
|
Canv_report4->SaveAs(figsave); |
|
|
} |
|
|
if(!fullversion) |
|
|
{ |
|
|
figsave = Form("%s/AcQLOOK_%s.%s",outDir.Data(),fileName.Data(),format.Data()); |
|
|
Canv_report1->SaveAs(figsave); |
|
1056 |
} |
} |
1057 |
|
} |
1058 |
|
|
1059 |
|
|
1060 |
|
figsave = Form("%s/%s_AcQLOOK1.%s",outDir.Data(),fileName.Data(),format.Data()); |
1061 |
|
sheet1->SaveAs(figsave); |
1062 |
|
|
1063 |
|
figsave = Form("%s/%s_AcQLOOK2.%s",outDir.Data(),fileName.Data(),format.Data()); |
1064 |
|
sheet2->SaveAs(figsave); |
1065 |
|
|
1066 |
//Delete variables |
figsave = Form("%s/%s_AcQLOOK3.%s",outDir.Data(),fileName.Data(),format.Data()); |
1067 |
//delete Canv_report1,Canv_report2,Canv_report3,Canv_report4; |
sheet3->SaveAs(figsave); |
|
//delete t; |
|
|
//delete pd1,pd2,pd3,pd4,pd5,pd6,pd7,pd8,pd9,pd10,pd11,pd12; |
|
|
//delete linje; |
|
|
//delete leg_m,leg_e,leg1_m; |
|
|
|
|
|
//delete nmbhitpmtCAS,nmbhitpmtCAT,nmbhitpmtCARD; |
|
|
//delete counter1_m,counter2_m,counter3_m,counter4_m,counter5_m,counter6_m,counter7_m,counter8_m,counter9_m,counter10_m,counter11_m,counter12_m,counter13_m,counter14_m,counter15_m,counter16_m; |
|
|
//delete counter1_e,counter2_e,counter3_e,counter4_e,counter5_e,counter6_e,counter7_e,counter8_e,counter9_e,counter10_e,counter11_e,counter12_e,counter13_e,counter14_e,counter15_e,counter16_e; |
|
|
//delete shift1_m,shift2_m,shift3_m,shift4_m,shift5_m,shift6_m,shift7_m,shift8_m,shift9_m,shift10_m,shift11_m,shift12_m,shift13_m,shift14_m,shift15_m,shift16_m; |
|
|
//delete shift1_e,shift2_e,shift3_e,shift4_e,shift5_e,shift6_e,shift7_e,shift8_e,shift9_e,shift10_e,shift11_e,shift12_e,shift13_e,shift14_e,shift15_e,shift16_e; |
|
|
//delete head_m,head_e,hitmap_m,hitmap_e; |
|
|
//delete pmtstatus_m,pmtstatus_e; |
|
|
//delete trigg_m,trigg_e,timebtrigg_m,timebtrigg_e,dtrigg_m,dtrigg_e; |
|
|
//delete crc_m,headerr_m,crcerr_m,dsperr_m,regerr_m; |
|
|
//delete crc_e,headerr_e,crcerr_e,dsperr_e,regerr_e; |
|
|
//delete T_right_m,T_actel_m,T_dsp_m,T_left_m; |
|
|
//delete T_right_e,T_actel_e,T_dsp_e,T_left_e; |
|
|
//delete rootFile; |
|
|
//delete mtitel,etitel; |
|
1068 |
|
|
1069 |
return 0; |
figsave = Form("%s/%s_AcQLOOK4.%s",outDir.Data(),fileName.Data(),format.Data()); |
1070 |
|
sheet4->SaveAs(figsave); |
1071 |
|
|
1072 |
|
|
1073 |
|
delete sheet1; |
1074 |
|
delete hitmap_h[0]; |
1075 |
|
delete hitmap_h[1]; |
1076 |
|
|
1077 |
|
//stopTime = clock(); |
1078 |
|
//printf("Draw time: %f\n\n",(Double_t) (stopTime - time2) / (Double_t) CLOCKS_PER_SEC); |
1079 |
|
//printf("Exc time: %f\n",(Double_t) (stopTime-startTime) / (Double_t) CLOCKS_PER_SEC); |
1080 |
|
|
1081 |
|
|
1082 |
|
return 1; |
1083 |
|
|
1084 |
} |
} |
1085 |
|
|
1086 |
|
|
1087 |
int main(int argc, char* argv[]){ |
int main(int argc, char* argv[]){ |
1088 |
TString outDir = "."; |
TString outDir = "."; |
1089 |
TString format = "jpg"; |
TString format = FORMAT; |
1090 |
int from = 0; |
int from = 0; |
1091 |
int to = 0; |
int to = 0; |
1092 |
int mode = 0; |
int mode = 0; |
1146 |
} |
} |
1147 |
} |
} |
1148 |
|
|
|
|
|
1149 |
if (!strcmp(argv[i], "-to")) { |
if (!strcmp(argv[i], "-to")) { |
1150 |
if (++i >= argc){ |
if (++i >= argc){ |
1151 |
printf( "-to needs arguments. \n"); |
printf( "-to needs arguments. \n"); |
1168 |
exit(1); |
exit(1); |
1169 |
} |
} |
1170 |
if (isdigit(*argv[i]) && (atoi(argv[i]) > 0)) { |
if (isdigit(*argv[i]) && (atoi(argv[i]) > 0)) { |
1171 |
to = atoi(argv[i]); |
from = atoi(argv[i]); |
1172 |
} else { |
} else { |
1173 |
cerr << "-from needs a integer value. \n"; |
cerr << "-from needs a integer value. \n"; |
1174 |
cout << "Try '--help' for more information. \n"; |
cout << "Try '--help' for more information. \n"; |
1177 |
} |
} |
1178 |
|
|
1179 |
} |
} |
1180 |
AcQLOOK(argv[1], from, to, outDir, format,mode); |
|
1181 |
|
if(mode==0) |
1182 |
|
AcQLOOKbasic(argv[1], from, to, outDir, format); |
1183 |
|
else if(mode==1) |
1184 |
|
AcQLOOKpro(argv[1], from, to, outDir, format); |
1185 |
|
else |
1186 |
|
printf("Wrong mode argument. Try --help for more information\n"); |
1187 |
|
|
1188 |
} |
} |