| 2 | #include <PscuHeader.h> | #include <PscuHeader.h> | 
| 3 | #include <EventHeader.h> | #include <EventHeader.h> | 
| 4 |  |  | 
| 5 |  | #include <TFile.h> | 
| 6 | #include <fstream> | #include <fstream> | 
| 7 |  | #include <vector> | 
| 8 |  | #include <iostream> | 
| 9 | #include <TCanvas.h> | #include <TCanvas.h> | 
| 10 | #include <TLatex.h> | #include <TLatex.h> | 
| 11 | #include <TLegend.h> | #include <TLegend.h> | 
| 13 | #include <TTree.h> | #include <TTree.h> | 
| 14 | #include <TStyle.h> | #include <TStyle.h> | 
| 15 | #include <TObjString.h> | #include <TObjString.h> | 
| 16 |  | #include <TGraph.h> | 
| 17 |  | #include <TH1.h> | 
| 18 |  | #include <time.h> | 
| 19 |  |  | 
| 20 | #include <utils/yodaUtility.h> | //#include <utils/yodaUtility.h> | 
| 21 |  |  | 
| 22 | #define DEBUG 0 | #define DEBUG 0 | 
| 23 | #define VERSION 1.2 | #define VERSION 1.5 | 
| 24 | /* | #define INTERVAL 100 | 
| 25 | * 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; |  | 
| 26 |  |  | 
| 27 | int AcQLOOK(TString base,int fromevent=0, int toevent=0, TString outDir = "./", TString format = "jpg", int fullversion=0){ | using namespace std; | 
| 28 |  |  | 
| 29 | //Int_t       tmpSize; | UInt_t found; | 
| 30 | ofstream      outputFile; | Int_t minevent,maxevent; | 
| 31 | stringstream  oss; | UShort_t ACheader[2]; | 
| 32 |  | TString *cardname = new TString[2]; | 
| 33 | pamela::anticounter::AnticounterEvent *ace      = 0; | TString *detector = new TString[16]; | 
| 34 | pamela::EventHeader                   *eh       = 0; |  | 
| 35 | pamela::PscuHeader                    *ph       = 0; |  | 
| 36 | TFile                                 *rootFile = new TFile(base); | int AcQLOOKbasic(TString base,int fromevent=0, int toevent=0, TString outDir = "./", TString format = FORMAT){ | 
| 37 |  |  | 
| 38 |  | ofstream      outputFile; | 
| 39 |  | stringstream  oss; | 
| 40 |  |  | 
| 41 |  | pamela::anticounter::AnticounterEvent *ace      = 0; | 
| 42 |  | pamela::EventHeader                   *eh       = 0; | 
| 43 |  | pamela::PscuHeader                    *ph       = 0; | 
| 44 |  | TFile                                 *rootFile = new TFile(base); | 
| 45 | if (rootFile->IsZombie()) | if (rootFile->IsZombie()) | 
| 46 | exit(-1); | exit(-1); | 
| 47 | TString fileName = ((TObjString*)base.Tokenize("\/")->Last())->GetString(); | TString fileName = ((TObjString*)base.Tokenize('\/')->Last())->GetString(); | 
| 48 | TString filePath = base; | TString filePath = base; | 
| 49 | filePath.ReplaceAll(fileName, ""); | filePath.ReplaceAll(fileName, ""); | 
| 50 | fileName.ReplaceAll(".root", ""); | fileName.ReplaceAll(".root", ""); | 
| 51 |  |  | 
| 52 | //Takes the tree of the header file | //Takes the tree of the header file | 
| 53 | TTree *tr = (TTree*)rootFile->Get("Physics"); | TTree *tr = (TTree*)rootFile->Get("Physics"); | 
| 54 |  |  | 
| 55 |  | tr->SetBranchStatus("*",0,&found); //disable all branches | 
| 56 |  |  | 
| 57 |  | tr->SetBranchStatus("header*",1,&found); | 
| 58 |  | // printf("header: enabled %i branches \n",found); | 
| 59 |  | found = 0; | 
| 60 |  | tr->SetBranchStatus("status*",1,&found); | 
| 61 |  | //  printf("status: enabled %i branches \n",found); | 
| 62 |  | found = 0; | 
| 63 |  | tr->SetBranchStatus("hitmap*",1,&found); | 
| 64 |  | //  printf("hitmap: enabled %i branches \n",found); | 
| 65 |  | found = 0; | 
| 66 |  | tr->SetBranchStatus("regist*",1,&found); | 
| 67 |  | //  printf("regist: enabled %i branches \n",found); | 
| 68 |  | found = 0; | 
| 69 |  | tr->SetBranchStatus("shift*",1,&found); | 
| 70 |  | //  printf("shift: enabled %i branches \n",found); | 
| 71 |  | found = 0; | 
| 72 |  | tr->SetBranchStatus("counters*",1,&found); | 
| 73 |  | //  printf("counters: enabled %i branches \n",found); | 
| 74 |  | found = 0; | 
| 75 |  | tr->SetBranchStatus("coinc*",1,&found); | 
| 76 |  | //  printf("coinc: enabled %i branches \n",found); | 
| 77 |  | found = 0; | 
| 78 |  | tr->SetBranchStatus("trigg*",1,&found); | 
| 79 |  | //  printf("trigg: enabled %i branches \n",found); | 
| 80 |  | found = 0; | 
| 81 |  | tr->SetBranchStatus("clock*",1,&found); | 
| 82 |  | //  printf("clock: enabled %i branches \n",found); | 
| 83 |  | found = 0; | 
| 84 |  | tr->SetBranchStatus("temp*",1,&found); | 
| 85 |  | //  printf("temp: enabled %i branches \n",found); | 
| 86 |  | found = 0; | 
| 87 |  | tr->SetBranchStatus("DAC*",1,&found); | 
| 88 |  | //  printf("DAC: enabled %i branches \n",found); | 
| 89 |  | found = 0; | 
| 90 |  | tr->SetBranchStatus("CRC*",1,&found); | 
| 91 |  | //  printf("CRC: enabled %i branches \n",found); | 
| 92 |  |  | 
| 93 |  | found = 0; | 
| 94 |  | tr->SetBranchStatus("Pscu*",1,&found); | 
| 95 |  | // printf("enabled %i branches \n",found); | 
| 96 |  | found = 0; | 
| 97 |  | tr->SetBranchStatus("Anticounter*",1,&found); | 
| 98 |  | // printf("Ac enabled %i branches \n",found); | 
| 99 |  | found = 0; | 
| 100 |  | tr->SetBranchStatus("Header*",1,&found); | 
| 101 |  | // printf("head enabled %i branches \n",found); | 
| 102 |  |  | 
| 103 | tr->SetBranchAddress("Anticounter", &ace); | tr->SetBranchAddress("Anticounter", &ace); | 
| 104 | tr->SetBranchAddress("Header", &eh); | tr->SetBranchAddress("Header", &eh); | 
| 105 |  |  | 
| 106 |  |  | 
|  | 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]; |  | 
| 107 |  |  | 
| 108 | //Double_t hits_x[size],hits_y_m[size],hits_y_e[size]; |  | 
| 109 |  | Int_t nevents = tr->GetEntries(); | 
| 110 | /*************************************************/ |  | 
| 111 |  | //check that the selected range of events is ok | 
| 112 |  |  | 
|  | // |  | 
|  | // run over each event and take out some variables |  | 
|  | // |  | 
| 113 | if ( fromevent > toevent && toevent ){ | if ( fromevent > toevent && toevent ){ | 
|  | printf("It must be fromevent < toevent \n"); |  | 
| 114 | return -1; | return -1; | 
| 115 | }; | }; | 
|  |  |  | 
|  |  |  | 
| 116 | if ( fromevent > nevents || fromevent < 0 ) { | if ( fromevent > nevents || fromevent < 0 ) { | 
|  | //printf("You can choose fromevent between 0 (all) and %d \n",nevents); |  | 
| 117 | return -1; | return -1; | 
| 118 | }; | }; | 
|  |  |  | 
| 119 | if ( toevent > nevents || toevent < 0 ) { | if ( toevent > nevents || toevent < 0 ) { | 
|  | //printf("You can choose toevent between 0 (all) and %d \n",nevents); |  | 
| 120 | return -1; | return -1; | 
| 121 | }; | }; | 
| 122 | int minevent,maxevent; |  | 
| 123 | if ( fromevent == 0 ) { | if ( fromevent == 0 ) { | 
| 124 | minevent = 0; | minevent = 0; | 
| 125 | maxevent = nevents; | maxevent = nevents; | 
| 132 | }; | }; | 
| 133 | }; | }; | 
| 134 |  |  | 
| 135 | //strange bug, this line have to be here... | /******************* VARIABLE DECLARATION ***************/ | 
|  | //CRC=crc(CRC,0x0); |  | 
| 136 |  |  | 
| 137 | //int what=0; | ACheader[0]=0xAC11; | 
| 138 |  | ACheader[1]=0xAC22; | 
| 139 |  |  | 
| 140 | if(DEBUG) | detector[0]="CARD 4"; | 
| 141 | printf("Zero variables\n"); | detector[1]="CAT 2"; | 
| 142 |  | detector[2]="CAS 1"; | 
| 143 |  | detector[3]="NC"; | 
| 144 |  | detector[4]="CARD 2"; | 
| 145 |  | detector[5]="CAT 4"; | 
| 146 |  | detector[6]="CAS 4"; | 
| 147 |  | detector[7]="NC"; | 
| 148 |  | detector[8]="CARD 3"; | 
| 149 |  | detector[9]="CAT 3"; | 
| 150 |  | detector[10]="CAS 3"; | 
| 151 |  | detector[11]="NC"; | 
| 152 |  | detector[12]="CARD 1"; | 
| 153 |  | detector[13]="CAT 1"; | 
| 154 |  | detector[14]="CAS 2"; | 
| 155 |  | detector[15]="NC"; | 
| 156 |  |  | 
| 157 |  |  | 
| 158 |  | /******************** HISTOGRAM DECLARATION *************/ | 
| 159 |  |  | 
| 160 |  | TH1D *hitmap_h[2]; | 
| 161 |  | hitmap_h[0] = new TH1D("Hitmap MAIN","Hitmap",16,0.,16.); | 
| 162 |  | hitmap_h[1] = new TH1D("Hitmap EXTRA","Hitmap",16,0.,16.); | 
| 163 |  |  | 
| 164 | for(Int_t b=0;b<2;b++){ | TH1D *status_h = new TH1D("Status","Status",10,0.,10.); | 
| 165 | for(Int_t a=0;a<16;a++){ |  | 
| 166 | 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); |  | 
|  | */ |  | 
|  | } |  | 
|  | } |  | 
| 167 |  |  | 
| 168 | 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]++; |  | 
|  | } |  | 
| 169 |  |  | 
| 170 | //fetch parameters | tr->GetEntry(i); | 
| 171 | 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; |  | 
|  | } |  | 
|  | } |  | 
|  | } |  | 
| 172 |  |  | 
| 173 | //printf("%d%c\n",100,37); | for(Int_t card=0;card<2;card++) | 
| 174 | //fflush(stdout); | { | 
| 175 | //printf("\n********* QLOOK SHORT INFO **********\n\n"); | //Proceed only if crc is ok | 
| 176 | //printf("Events: %d\nCrc Main %d\nCrc Extra: %d\n",totevents,crcevents[0],crcevents[1]); | if(ace->CRCcheck[card]==1) | 
| 177 | //printf("Calibrations: %d\n",nCalibs); | { | 
| 178 | //printf("\n**************************************\n"); |  | 
| 179 | //printf("\nOpening canvases...\n"); | //hitmap | 
| 180 | //cout << "hits: " << what << endl; | for(Int_t ch_cnt=0;ch_cnt<16;ch_cnt++) | 
| 181 | //Draw histograms | { | 
| 182 | //gStyle->SetPalette(1); | if( (ace->hitmap[card] & (0x1<<ch_cnt)) > 0 ) | 
| 183 |  | hitmap_h[card]->Fill(ch_cnt,1.); | 
| 184 |  | } | 
| 185 |  | //Status | 
| 186 |  | if((ace->header[card][0] != 0xACAC) || (ace->header[card][1] != ACheader[card])) | 
| 187 |  | status_h->Fill(1.+5.*card,1.); | 
| 188 |  | if((ace->status[card] & 0x8000) < 0x8000) //crc | 
| 189 |  | status_h->Fill(2.+5.*card,1.); | 
| 190 |  | if((ace->status[card] & 0x4000) < 0x4000) //dsp | 
| 191 |  | status_h->Fill(3.+5.*card,1.); | 
| 192 |  | if((ace->status[card] & 0x01FF) < 0x01FF) //reg | 
| 193 |  | status_h->Fill(4.+5*card,1.); | 
| 194 |  |  | 
| 195 |  | }//if(crc check) | 
| 196 |  | /******************************************************/ | 
| 197 |  | else | 
| 198 |  | status_h->Fill(5.*card,1.); //event crc | 
| 199 |  | }//for(card) | 
| 200 |  |  | 
| 201 | if(DEBUG) | }//for(events) | 
|  | printf("Start plotting\n"); |  | 
| 202 |  |  | 
| 203 | /***************************************** PLOTTING *****************************************/ | /***************************************** PLOTTING *****************************************/ | 
| 204 |  |  | 
|  | //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; |  | 
| 205 | char *namn = "KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK"; | char *namn = "KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK"; | 
| 206 | int mposition = 80; | int mposition = 80; | 
| 207 | int eposition = 80; | int eposition = 80; | 
| 208 | char *figsave = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"; | char *figsave1 = "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"; | 
| 209 | char *mystring = "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"; | char *mystring = "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"; | 
| 210 | //char *tmpchar = "JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ"; |  | 
| 211 | TBox *b1,*b2,*b3,*b4,*b5; | TBox *b1,*b2,*b3,*b4,*b5; | 
| 212 | gStyle->SetOptDate(0); | gStyle->SetOptDate(0); | 
| 213 | TString *merr = new TString[5]; | TString *merr = new TString[5]; | 
| 216 | merr[2]="CRC"; | merr[2]="CRC"; | 
| 217 | merr[3]="Dsp"; | merr[3]="Dsp"; | 
| 218 | merr[4]="Reg"; | merr[4]="Reg"; | 
| 219 |  |  | 
| 220 |  | TCanvas *sheet1 = new TCanvas("Sheet 1","Sheet 1"); //base | 
| 221 |  | sheet1->Range(0,0,100,100); | 
| 222 |  | sheet1->Draw(); | 
| 223 |  | b1 = new TBox(10,84.5,90,85.5); | 
| 224 |  | b2 = new TBox(49.5,95,50.5,5); | 
| 225 |  | b1->SetFillColor(1); | 
| 226 |  | b2->SetFillColor(1); | 
| 227 |  | b1->Draw(); | 
| 228 |  | b2->Draw(); | 
| 229 |  |  | 
| 230 |  | TLatex *t=new TLatex(); | 
| 231 |  | t->SetTextFont(40); | 
| 232 |  | t->SetTextColor(1); | 
| 233 |  | t->SetTextAlign(12); | 
| 234 |  | t->SetTextSize(0.04); | 
| 235 |  | namn = "AntiCounter MAIN card"; | 
| 236 |  | t->DrawLatex(10,90,namn); | 
| 237 |  | t->SetTextColor(1); | 
| 238 |  | namn = "AntiCounter EXTRA card"; | 
| 239 |  | t->DrawLatex(58,90,namn); | 
| 240 |  | t->SetTextSize(0.025); | 
| 241 |  |  | 
| 242 |  | for(Int_t ch=1;ch<17;ch++) | 
| 243 |  | { | 
| 244 |  | if(ch!=4 && ch!=8 && ch!=12 && ch!=16 && hitmap_h[0]->GetBinContent(ch)==0){ | 
| 245 |  | mystring = Form("%s channel empty",detector[ch-1].Data()); | 
| 246 |  | t->SetTextColor(2); | 
| 247 |  | t->DrawLatex(15,mposition,mystring); | 
| 248 |  | mposition -= 4; | 
| 249 |  | } | 
| 250 |  | if(ch!=4 && ch!=8 && ch!=12 && ch!=16 && hitmap_h[1]->GetBinContent(ch)==0){ | 
| 251 |  | mystring = Form("%s channel empty",detector[ch-1].Data()); | 
| 252 |  | t->SetTextColor(2); | 
| 253 |  | t->DrawLatex(65,eposition,mystring); | 
| 254 |  | eposition -= 4; | 
| 255 |  | } | 
| 256 |  | } | 
| 257 |  | for(Int_t ch=0;ch<5;ch++) | 
| 258 |  | { | 
| 259 |  | if(status_h->GetBinContent(ch+1)>0){ | 
| 260 |  | mposition -= 4; | 
| 261 |  | mystring = Form("%d %s errors",(int)status_h->GetBinContent(ch+1),merr[ch].Data()); | 
| 262 |  | t->SetTextColor(2); | 
| 263 |  | t->DrawLatex(15,mposition,mystring); | 
| 264 |  | } | 
| 265 |  | if(status_h->GetBinContent(ch+5+1)>0){ | 
| 266 |  | eposition -= 4; | 
| 267 |  | mystring = Form("%d %s errors",(int)status_h->GetBinContent(ch+5+1),merr[ch].Data()); | 
| 268 |  | t->SetTextColor(2); | 
| 269 |  | t->DrawLatex(65,eposition,mystring); | 
| 270 |  | } | 
| 271 |  | } | 
| 272 |  | //if no errors | 
| 273 |  | if(mposition==80) | 
| 274 |  | { | 
| 275 |  | namn = "AC main working"; | 
| 276 |  | t->SetTextSize(0.035); | 
| 277 |  | t->SetTextColor(1); | 
| 278 |  | t->DrawLatex(15,50,namn); | 
| 279 |  | } | 
| 280 |  | if(eposition==80) | 
| 281 |  | { | 
| 282 |  | namn = "AC extra working"; | 
| 283 |  | t->SetTextSize(0.035); | 
| 284 |  | t->SetTextColor(1); | 
| 285 |  | t->DrawLatex(65,50,namn); | 
| 286 |  | } | 
| 287 |  | if(mposition!=80 || eposition!=80) | 
| 288 |  | { | 
| 289 |  | namn = "AC malfunction"; | 
| 290 |  | t->SetTextSize(0.035); | 
| 291 |  | t->SetTextColor(1); | 
| 292 |  | t->DrawLatex(41.5,97.3,namn); | 
| 293 |  | b3 = new TBox(10,96,40,98.5); | 
| 294 |  | b4 = new TBox(10,1.5,90,4); | 
| 295 |  | b5 = new TBox(60,96,90,98.5); | 
| 296 |  | b3->SetFillColor(2); | 
| 297 |  | b4->SetFillColor(2); | 
| 298 |  | b5->SetFillColor(2); | 
| 299 |  | b3->Draw(); | 
| 300 |  | b4->Draw(); | 
| 301 |  | b5->Draw(); | 
| 302 |  | } | 
| 303 |  |  | 
| 304 |  | figsave1 = Form("%s/%s_AcQLOOKbasic.%s",outDir.Data(),fileName.Data(),format.Data()); | 
| 305 |  | sheet1->SaveAs(figsave1); | 
| 306 |  |  | 
| 307 |  | return 1; | 
| 308 |  |  | 
| 309 |  | } //end AcBasic | 
| 310 |  |  | 
| 311 |  |  | 
| 312 |  | int AcQLOOKpro(TString base,int fromevent=0, int toevent=0, TString outDir = "./", TString format = FORMAT){ | 
| 313 |  |  | 
| 314 |  | //Float_t startTime,stopTime; | 
| 315 |  | //Float_t time1,time2,time3,time4; | 
| 316 |  |  | 
| 317 |  | //startTime = clock(); | 
| 318 |  |  | 
| 319 | if(!fullversion) | ofstream      outputFile; | 
| 320 |  | stringstream  oss; | 
| 321 |  |  | 
| 322 |  | pamela::anticounter::AnticounterEvent *ace      = 0; | 
| 323 |  | pamela::EventHeader                   *eh       = 0; | 
| 324 |  | pamela::PscuHeader                    *ph       = 0; | 
| 325 |  | TFile                                 *rootFile = new TFile(base); | 
| 326 |  | if (rootFile->IsZombie()) | 
| 327 |  | exit(-1); | 
| 328 |  | TString fileName = ((TObjString*)base.Tokenize('\/')->Last())->GetString(); | 
| 329 |  | TString filePath = base; | 
| 330 |  | filePath.ReplaceAll(fileName, ""); | 
| 331 |  | fileName.ReplaceAll(".root", ""); | 
| 332 |  |  | 
| 333 |  | //Takes the tree of the header file | 
| 334 |  | TTree *tr = (TTree*)rootFile->Get("Physics"); | 
| 335 |  |  | 
| 336 |  | tr->SetBranchStatus("*",0,&found); //disable all branches | 
| 337 |  |  | 
| 338 |  | tr->SetBranchStatus("header*",1,&found); | 
| 339 |  | //  printf("header: enabled %i branches \n",found); | 
| 340 |  | found = 0; | 
| 341 |  | tr->SetBranchStatus("status*",1,&found); | 
| 342 |  | //  printf("status: enabled %i branches \n",found); | 
| 343 |  | found = 0; | 
| 344 |  | tr->SetBranchStatus("hitmap*",1,&found); | 
| 345 |  | //  printf("hitmap: enabled %i branches \n",found); | 
| 346 |  | found = 0; | 
| 347 |  | tr->SetBranchStatus("regist*",1,&found); | 
| 348 |  | //  printf("regist: enabled %i branches \n",found); | 
| 349 |  | found = 0; | 
| 350 |  | tr->SetBranchStatus("shift*",1,&found); | 
| 351 |  | //  printf("shift: enabled %i branches \n",found); | 
| 352 |  | found = 0; | 
| 353 |  | tr->SetBranchStatus("counters*",1,&found); | 
| 354 |  | //  printf("counters: enabled %i branches \n",found); | 
| 355 |  | found = 0; | 
| 356 |  | tr->SetBranchStatus("coinc*",1,&found); | 
| 357 |  | //  printf("coinc: enabled %i branches \n",found); | 
| 358 |  | found = 0; | 
| 359 |  | tr->SetBranchStatus("trigg*",1,&found); | 
| 360 |  | //  printf("trigg: enabled %i branches \n",found); | 
| 361 |  | found = 0; | 
| 362 |  | tr->SetBranchStatus("clock*",1,&found); | 
| 363 |  | //  printf("clock: enabled %i branches \n",found); | 
| 364 |  | found = 0; | 
| 365 |  | tr->SetBranchStatus("temp*",1,&found); | 
| 366 |  | //  printf("temp: enabled %i branches \n",found); | 
| 367 |  | found = 0; | 
| 368 |  | tr->SetBranchStatus("DAC*",1,&found); | 
| 369 |  | //  printf("DAC: enabled %i branches \n",found); | 
| 370 |  | found = 0; | 
| 371 |  | tr->SetBranchStatus("CRC*",1,&found); | 
| 372 |  | //  printf("CRC: enabled %i branches \n",found); | 
| 373 |  | found = 0; | 
| 374 |  |  | 
| 375 |  | tr->SetBranchStatus("Pscu*",1,&found); | 
| 376 |  | //  printf("enabled %i branches \n",found); | 
| 377 |  | found = 0; | 
| 378 |  | tr->SetBranchStatus("Anticounter*",1,&found); | 
| 379 |  | //  printf("Ac enabled %i branches \n",found); | 
| 380 |  | found = 0; | 
| 381 |  | tr->SetBranchStatus("Header*",1,&found); | 
| 382 |  | //  printf("head enabled %i branches \n",found); | 
| 383 |  |  | 
| 384 |  | tr->SetBranchAddress("Anticounter", &ace); | 
| 385 |  | tr->SetBranchAddress("Header", &eh); | 
| 386 |  |  | 
| 387 |  | /***************************  VARIABLE DECLARATION  **************************/ | 
| 388 |  |  | 
| 389 |  | ACheader[0]=0xAC11; | 
| 390 |  | ACheader[1]=0xAC22; | 
| 391 |  |  | 
| 392 |  | cardname[0] = "MAIN"; | 
| 393 |  | cardname[1] = "EXTRA"; | 
| 394 |  |  | 
| 395 |  | detector[0]="CARD 4"; | 
| 396 |  | detector[1]="CAT 2"; | 
| 397 |  | detector[2]="CAS 1"; | 
| 398 |  | detector[3]="NC"; | 
| 399 |  | detector[4]="CARD 2"; | 
| 400 |  | detector[5]="CAT 4"; | 
| 401 |  | detector[6]="CAS 4"; | 
| 402 |  | detector[7]="NC"; | 
| 403 |  | detector[8]="CARD 3"; | 
| 404 |  | detector[9]="CAT 3"; | 
| 405 |  | detector[10]="CAS 3"; | 
| 406 |  | detector[11]="NC"; | 
| 407 |  | detector[12]="CARD 1"; | 
| 408 |  | detector[13]="CAT 1"; | 
| 409 |  | detector[14]="CAS 2"; | 
| 410 |  | detector[15]="NC"; | 
| 411 |  |  | 
| 412 |  | // ANTICOUNTER VARIABLES | 
| 413 |  |  | 
| 414 |  | Double_t ac_clock_old[2] = {-1., -1.}; | 
| 415 |  | Double_t ac_clock_new[2] = {-1., -1.}; | 
| 416 |  | Double_t ac_clock100_new[2] = {-1.,-1.}; | 
| 417 |  | Double_t ac_clock100_old[2] = {-1.,-1.}; | 
| 418 |  | Double_t ac_clock_diff[2]; | 
| 419 |  | Double_t ac_clock100_diff[2]; | 
| 420 |  | Double_t counter_old[2][16]; | 
| 421 |  | Double_t counter_new[2][16]; | 
| 422 |  | Double_t counter_diff[2][16]; | 
| 423 |  |  | 
| 424 |  | // MISC VARIABLES | 
| 425 |  |  | 
| 426 |  | UInt_t obt; | 
| 427 |  | Int_t hitsCARD,hitsCAT,hitsCAS; | 
| 428 |  | Int_t interval_cnt = 0; | 
| 429 |  | Int_t paramEvent = 0; | 
| 430 |  | Int_t paramEvents; | 
| 431 |  | Int_t minevent,maxevent; | 
| 432 |  | char *figsave = "                                                         "; | 
| 433 |  | UShort_t ACheader[2]; | 
| 434 |  | ACheader[0]=0xAC11; | 
| 435 |  | ACheader[1]=0xAC22; | 
| 436 |  |  | 
| 437 |  | vector<int> Err_type(0); | 
| 438 |  | vector<float> Err_obt(0); | 
| 439 |  | vector<int> Err_evt(0); | 
| 440 |  |  | 
| 441 |  |  | 
| 442 |  | Int_t *det_map = new Int_t[12]; | 
| 443 |  | det_map[0]=2; | 
| 444 |  | det_map[1]=14; | 
| 445 |  | det_map[2]=10; | 
| 446 |  | det_map[3]=6; | 
| 447 |  | det_map[4]=13; | 
| 448 |  | det_map[5]=1; | 
| 449 |  | det_map[6]=9; | 
| 450 |  | det_map[7]=5; | 
| 451 |  | det_map[8]=12; | 
| 452 |  | det_map[9]=4; | 
| 453 |  | det_map[10]=8; | 
| 454 |  | det_map[11]=0; | 
| 455 |  |  | 
| 456 |  | TString *detector = new TString[16]; | 
| 457 |  | detector[0]="CARD 4"; | 
| 458 |  | detector[1]="CAT 2"; | 
| 459 |  | detector[2]="CAS 1"; | 
| 460 |  | detector[3]="NC"; | 
| 461 |  | detector[4]="CARD 2"; | 
| 462 |  | detector[5]="CAT 4"; | 
| 463 |  | detector[6]="CAS 4"; | 
| 464 |  | detector[7]="NC"; | 
| 465 |  | detector[8]="CARD 3"; | 
| 466 |  | detector[9]="CAT 3"; | 
| 467 |  | detector[10]="CAS 3"; | 
| 468 |  | detector[11]="NC"; | 
| 469 |  | detector[12]="CARD 1"; | 
| 470 |  | detector[13]="CAT 1"; | 
| 471 |  | detector[14]="CAS 2"; | 
| 472 |  | detector[15]="NC"; | 
| 473 |  |  | 
| 474 |  | TString *cardname = new TString[2]; | 
| 475 |  | cardname[0] = "MAIN"; | 
| 476 |  | cardname[1] = "EXTRA"; | 
| 477 |  | char histotitel[30]; | 
| 478 |  |  | 
| 479 |  | Int_t nevents = tr->GetEntries(); | 
| 480 |  |  | 
| 481 |  | //check that the selected range of events is ok | 
| 482 |  | if ( fromevent > toevent && toevent ){ | 
| 483 |  | return -1; | 
| 484 |  | }; | 
| 485 |  | if ( fromevent > nevents || fromevent < 0 ) { | 
| 486 |  | return -1; | 
| 487 |  | }; | 
| 488 |  | if ( toevent > nevents || toevent < 0 ) { | 
| 489 |  | return -1; | 
| 490 |  | }; | 
| 491 |  |  | 
| 492 |  | if ( fromevent == 0 ) { | 
| 493 |  | minevent = 0; | 
| 494 |  | maxevent = nevents; | 
| 495 |  | } else { | 
| 496 |  | minevent = fromevent - 1; | 
| 497 |  | if ( toevent > 0 ){ | 
| 498 |  | maxevent = toevent; | 
| 499 |  | } else { | 
| 500 |  | maxevent = fromevent; | 
| 501 |  | }; | 
| 502 |  | }; | 
| 503 |  |  | 
| 504 |  | paramEvents = (Int_t)((Float_t)nevents/(Float_t)INTERVAL); | 
| 505 |  |  | 
| 506 |  | /*************************  HISTOGRAM and GRAPH DECLARATION  *******************************/ | 
| 507 |  |  | 
| 508 |  | TH1D *hitmap_h[2]; | 
| 509 |  | TH1D *nmbhitpmtCARD_h = new TH1D("#hit PMTs CARD","#hit PMTs",8,0.5,8.5); | 
| 510 |  | TH1D *nmbhitpmtCAT_h = new TH1D("#hit PMTs CAT","#hit PMTs",8,0.5,8.5); | 
| 511 |  | TH1D *nmbhitpmtCAS_h = new TH1D("#hit PMTs CAS","#hit PMTs",8,0.5,8.5); | 
| 512 |  | TH1D *time_between_trigg_h[2]; | 
| 513 |  | TH1D *shiftreg_h[2][16]; | 
| 514 |  |  | 
| 515 |  | for(Int_t card=0;card<2;card++) | 
| 516 | { | { | 
| 517 | Canv_report1 = new TCanvas("QL Report Sheet 1","QL Report Sheet 1", 1280, 1024); //base | sprintf(histotitel,"Hitmap %s",cardname[card].Data()); | 
| 518 | 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(); |  | 
|  |  |  | 
| 519 |  |  | 
| 520 | t=new TLatex(); | hitmap_h[card]->GetXaxis()->SetBinLabel(1,detector[0]); | 
| 521 | t->SetTextFont(40); | hitmap_h[card]->GetXaxis()->SetBinLabel(2,detector[1]); | 
| 522 | t->SetTextColor(1); | hitmap_h[card]->GetXaxis()->SetBinLabel(3,detector[2]); | 
| 523 | t->SetTextAlign(12); | hitmap_h[card]->GetXaxis()->SetBinLabel(4,detector[3]); | 
| 524 | t->SetTextSize(0.04); | hitmap_h[card]->GetXaxis()->SetBinLabel(5,detector[4]); | 
| 525 | namn = "AntiCounter MAIN card"; | hitmap_h[card]->GetXaxis()->SetBinLabel(6,detector[5]); | 
| 526 | t->DrawLatex(10,90,namn); | hitmap_h[card]->GetXaxis()->SetBinLabel(7,detector[6]); | 
| 527 | t->SetTextColor(1); | hitmap_h[card]->GetXaxis()->SetBinLabel(8,detector[7]); | 
| 528 | namn = "AntiCounter EXTRA card"; | hitmap_h[card]->GetXaxis()->SetBinLabel(9,detector[8]); | 
| 529 | t->DrawLatex(58,90,namn); | hitmap_h[card]->GetXaxis()->SetBinLabel(10,detector[9]); | 
| 530 | t->SetTextSize(0.025); | hitmap_h[card]->GetXaxis()->SetBinLabel(11,detector[10]); | 
| 531 | //Canv_report1->cd(1); | hitmap_h[card]->GetXaxis()->SetBinLabel(12,detector[11]); | 
| 532 | for(i=1;i<17;i++) | hitmap_h[card]->GetXaxis()->SetBinLabel(13,detector[12]); | 
| 533 | { | hitmap_h[card]->GetXaxis()->SetBinLabel(14,detector[13]); | 
| 534 | if(i!=4 && i!=8 && i!=12 && i!=16 && hitmap_m->GetBinContent(i)==0){ | hitmap_h[card]->GetXaxis()->SetBinLabel(15,detector[14]); | 
| 535 | mystring = Form("%s channel empty",mtitel[i-1].Data()); | hitmap_h[card]->GetXaxis()->SetBinLabel(16,detector[15]); | 
| 536 | t->SetTextColor(2); | hitmap_h[card]->GetYaxis()->SetTitle("Hits"); | 
| 537 | t->DrawLatex(15,mposition,mystring); |  | 
| 538 | mposition -= 4; | sprintf(histotitel,"Time between triggers %s",cardname[card].Data()); | 
| 539 | } | time_between_trigg_h[card] = new TH1D(histotitel,"Time between triggers",100,0.,0.01); | 
| 540 | if(i!=4 && i!=8 && i!=12 && i!=16 && hitmap_e->GetBinContent(i)==0){ | time_between_trigg_h[card]->SetBit(TH1::kCanRebin); | 
| 541 | mystring = Form("%s channel empty",etitel[i-1].Data()); |  | 
| 542 | 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) |  | 
| 543 | { | { | 
| 544 | namn = "AC malfunction"; | sprintf(histotitel,"Shift Register %s Ch %d",cardname[card].Data(),ch+1); | 
| 545 | 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(); |  | 
| 546 | } | } | 
|  | //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(); |  | 
|  |  |  | 
| 547 | } | } | 
| 548 | if(fullversion) |  | 
| 549 | { | TH1D *status_h = new TH1D("Status","Status",12,0.,12.); | 
| 550 | //Anticounter report sheet 1 | status_h->GetXaxis()->SetBinLabel(1,"Headers M"); | 
| 551 | Canv_report1 = new TCanvas("QL Report Sheet 1","QL Report Sheet 1", 1280, 1024); //base | status_h->GetXaxis()->SetBinLabel(2,"CRC M"); | 
| 552 | Canv_report1->Range(0,0,100,100); | status_h->GetXaxis()->SetBinLabel(3,"Dsp M"); | 
| 553 | //tsf = (TSystemFile*)AcList->First(); | status_h->GetXaxis()->SetBinLabel(4,"Temp M"); | 
| 554 |  | status_h->GetXaxis()->SetBinLabel(5,"Reg M"); | 
| 555 | //sprintf(error,"File: %s ",tsf->GetName()); | status_h->GetXaxis()->SetBinLabel(6,"CRC Event M"); | 
| 556 | //printf("A3\n"); | status_h->GetXaxis()->SetBinLabel(7,"Headers E"); | 
| 557 | t=new TLatex(); | status_h->GetXaxis()->SetBinLabel(8,"CRC E"); | 
| 558 | t->SetTextFont(32); | status_h->GetXaxis()->SetBinLabel(9,"Dsp E"); | 
| 559 | t->SetTextColor(1); | status_h->GetXaxis()->SetBinLabel(10,"Temp E"); | 
| 560 | t->SetTextAlign(12); | status_h->GetXaxis()->SetBinLabel(11,"Reg E"); | 
| 561 | t->SetTextSize(0.015); | status_h->GetXaxis()->SetBinLabel(12,"CRC Event E"); | 
| 562 | //t->DrawLatex(2.,99.,error); | status_h->GetYaxis()->SetTitle("# of Errors"); | 
| 563 | t->SetTextSize(0.02); | status_h->SetMinimum(0); | 
| 564 | namn = "MAIN"; |  | 
| 565 | t->DrawLatex(82,99,namn); | Double_t *temp_gr[2][4]; | 
| 566 | t->SetTextColor(2); | for(Int_t i=0;i<2;i++) | 
| 567 | namn="EXTRA"; | for(Int_t j=0;j<4;j++) | 
| 568 | t->DrawLatex(89,99,namn); | temp_gr[i][j] = new Double_t[paramEvents+1]; | 
| 569 | t->SetTextColor(1); |  | 
| 570 | 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++) | 
| 571 | 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++) | 
| 572 | //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++) | 
| 573 | pd4 = new TPad("pd4","This is pad4",0.02,0.51,0.49,0.98,17); //upper left | temp_gr[i][j][k] = 0.; | 
| 574 | //pd5 = new TPad("pd5","This is pad5",0.51,0.25,0.98,0.49,17); //lower-upper right |  | 
| 575 | pd3 = new TPad("pd3","This is pad3",0.51,0.51,0.98,0.98,17); //upper right | Double_t *trigger_gr[2]; | 
| 576 |  | trigger_gr[0] = new Double_t[paramEvents+1]; | 
| 577 | Canv_report1->cd(); | trigger_gr[1] = new Double_t[paramEvents+1]; | 
| 578 | //pd1->Range(0,0,100,100); |  | 
| 579 | //pd2->Range(0,0,100,100); | Double_t *singles_gr[2][16]; | 
| 580 | //pd3->Range(0,0,100,100); | for(Int_t i=0;i<2;i++){ | 
| 581 | //pd4->Range(0,0,100,100); | for(Int_t j=0;j<16;j++){ | 
| 582 | //pd5->Range(0,0,100,100); | singles_gr[i][j] = new Double_t[paramEvents+1]; | 
| 583 | //pd6->Range(0,0,100,100); | } | 
| 584 | pd1->Draw(); | } | 
| 585 | pd2->Draw(); | for(Int_t i=0;i<2;i++){ | 
| 586 | pd3->Draw(); | for(Int_t j=0;j<16;j++){ | 
| 587 | pd4->Draw(); | for(Int_t k=0;k<(paramEvents+1);k++){ | 
| 588 | //pd5->Draw(); | singles_gr[i][j][k] = 0.; | 
| 589 | //pd6->Draw(); | } | 
| 590 |  | } | 
| 591 | pd3->cd(); //upper right | } | 
| 592 | if(head_m->GetMaximum()>head_e->GetMaximum()) |  | 
| 593 | head_m->SetMaximum(1.1*head_m->GetMaximum()); | Double_t *event_obt = new Double_t[paramEvents+1]; | 
| 594 | else |  | 
| 595 | head_m->SetMaximum(1.1*head_e->GetMaximum()); |  | 
| 596 | head_m->SetLineColor(1); | /**********************************************************************************/ | 
| 597 | 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(); |  | 
|  |  |  | 
| 598 |  |  | 
| 599 | //report sheet 3 | /*********************  MAIN LOOP  **********************/ | 
| 600 | //report sheet 1 |  | 
| 601 | Canv_report3 = new TCanvas("QL Report Sheet 3","QL Report Sheet 3", 1280, 1024); | //time1 = clock(); | 
| 602 | //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); | 
| 603 | Canv_report3->Range(0,0,100,100); |  | 
| 604 | //tsf = (TSystemFile*) AcList->First(); | //iterators used in the loop | 
| 605 | //sprintf(error,"File: %s ",tsf->GetName()); | Int_t card, ch, bin; | 
| 606 | //TLatex *t=new TLatex(); |  | 
| 607 |  | for (Int_t i = minevent; i < maxevent; i++){ | 
| 608 |  |  | 
| 609 |  | interval_cnt++; | 
| 610 |  |  | 
| 611 |  | tr->GetEntry(i); | 
| 612 |  | ph = eh->GetPscuHeader(); | 
| 613 |  | obt = ph->GetOrbitalTime(); | 
| 614 |  |  | 
| 615 |  | hitsCARD=hitsCAT=hitsCAS=0; | 
| 616 |  |  | 
| 617 |  | for(card=0;card<2;card++) | 
| 618 |  | { | 
| 619 |  | //proceed only if crc of event is ok | 
| 620 |  | //printf("CRC: %hx\n",ace->CRCcheck[card]); | 
| 621 |  | //printf("Hitmap: %hx\n\n",ace->hitmap[card]); | 
| 622 |  | if(ace->CRCcheck[card]==1) | 
| 623 |  | { | 
| 624 |  | //clock | 
| 625 |  | ac_clock_old[card] = ac_clock_new[card]; | 
| 626 |  | ac_clock_new[card] = ace->clock[card][1]*0xFFFF + ace->clock[card][0]; | 
| 627 |  | if(ac_clock_new[card] - ac_clock_old[card] < 0.) | 
| 628 |  | ac_clock_diff[card] = 0xFFFFFFFF+ac_clock_new[card]-ac_clock_old[card]; | 
| 629 |  | else | 
| 630 |  | ac_clock_diff[card] = ac_clock_new[card]-ac_clock_old[card]; | 
| 631 |  |  | 
| 632 |  | if(ac_clock_old[card] > 0. && 0.000000025*ac_clock_diff[card]<10.) | 
| 633 |  | time_between_trigg_h[card]->Fill( 0.000000025*ac_clock_diff[card] ); | 
| 634 |  |  | 
| 635 |  | //counters, singlesrate & shift reg content | 
| 636 |  | for(ch=0;ch<16;ch++) | 
| 637 |  | { | 
| 638 |  | counter_old[card][ch] = counter_new[card][ch]; | 
| 639 |  | counter_new[card][ch] = ace->counters[card][ch]; | 
| 640 |  | if(counter_new[card][ch] - counter_old[card][ch] < 0.) | 
| 641 |  | counter_diff[card][ch] = 0xFFFF + counter_new[card][ch] - counter_old[card][ch]; | 
| 642 |  | else | 
| 643 |  | counter_diff[card][ch] = counter_new[card][ch] - counter_old[card][ch]; | 
| 644 |  |  | 
| 645 |  | singles_gr[card][ch][paramEvent] += (Double_t)counter_diff[card][ch]; | 
| 646 |  |  | 
| 647 |  | for(bin = 0; bin < 16; bin++){ | 
| 648 |  | shiftreg_h[card][bin]->Fill(ch,ace->shift[card][ch] & 0x1<<bin); | 
| 649 |  | } | 
| 650 |  |  | 
| 651 |  | //hitmap | 
| 652 |  | if( (ace->hitmap[card] & (0x1<<ch)) > 0 ){ | 
| 653 |  | hitmap_h[card]->Fill(ch,1.); | 
| 654 |  | if(ch==0 || ch==4 || ch==8 || ch==12) | 
| 655 |  | hitsCARD++; | 
| 656 |  | else if(ch==1 || ch==5 || ch==9 || ch==13) | 
| 657 |  | hitsCAT++; | 
| 658 |  | else if(ch==2 || ch==6 || ch==10 || ch==14) | 
| 659 |  | hitsCAS++; | 
| 660 |  | } | 
| 661 |  |  | 
| 662 |  | } | 
| 663 |  |  | 
| 664 |  | //Status | 
| 665 |  | if((ace->header[card][0] != 0xACAC) || (ace->header[card][1] != ACheader[card])){ | 
| 666 |  | status_h->Fill(6.*card,1.); | 
| 667 |  | Err_type.push_back(6*card); | 
| 668 |  | Err_obt.push_back(ph->GetOrbitalTime()); | 
| 669 |  | Err_evt.push_back(i); | 
| 670 |  | } | 
| 671 |  | if((ace->status[card] & 0x8000) < 0x8000){ //crc | 
| 672 |  | status_h->Fill(1.+6.*card,1.); | 
| 673 |  | Err_type.push_back(1+6*card); | 
| 674 |  | Err_obt.push_back(ph->GetOrbitalTime()); | 
| 675 |  | Err_evt.push_back(i); | 
| 676 |  | } | 
| 677 |  | if((ace->status[card] & 0x6000) < 0x6000){ //dsp | 
| 678 |  | status_h->Fill(2.+6.*card,1.); | 
| 679 |  | Err_type.push_back(2+6*card); | 
| 680 |  | Err_obt.push_back(ph->GetOrbitalTime()); | 
| 681 |  | Err_evt.push_back(i); | 
| 682 |  | } | 
| 683 |  | if((ace->status[card] & 0x0E00) < 0x0E00){ //temp | 
| 684 |  | status_h->Fill(3.+6.*card,1.); | 
| 685 |  | Err_type.push_back(3+6*card); | 
| 686 |  | Err_obt.push_back(ph->GetOrbitalTime()); | 
| 687 |  | Err_evt.push_back(i); | 
| 688 |  | } | 
| 689 |  | if((ace->status[card] & 0x01FF) < 0x01FF){ //reg | 
| 690 |  | status_h->Fill(4.+6.*card,1.); | 
| 691 |  | Err_type.push_back(4+6*card); | 
| 692 |  | Err_obt.push_back(ph->GetOrbitalTime()); | 
| 693 |  | Err_evt.push_back(i); | 
| 694 |  | } | 
| 695 |  |  | 
| 696 |  | //temperature (left on cards) | 
| 697 |  | temp_gr[card][0][paramEvent] += ( ((ace->temp[card][0] & 0x00FF))*2.8 - 273. )/(Float_t)INTERVAL; | 
| 698 |  | temp_gr[card][1][paramEvent] += ( ((ace->temp[card][0] & 0xFF00)/256)*2.8 - 273. )/(Float_t)INTERVAL; | 
| 699 |  | temp_gr[card][2][paramEvent] += ( ((ace->temp[card][1] & 0x00FF))*2.8 - 273. )/(Float_t)INTERVAL; | 
| 700 |  | temp_gr[card][3][paramEvent] += ( ((ace->temp[card][1] & 0xFF00)/256)*2.8 - 273. )/(Float_t)INTERVAL; | 
| 701 |  |  | 
| 702 |  | }//if(crc check) | 
| 703 |  | else{ | 
| 704 |  | status_h->Fill(5.+6.*card,1.); //event crc | 
| 705 |  | Err_type.push_back(5+6*card); | 
| 706 |  | Err_obt.push_back(ph->GetOrbitalTime()); | 
| 707 |  | Err_evt.push_back(i); | 
| 708 |  | } | 
| 709 |  | }//for(card) | 
| 710 |  |  | 
| 711 |  | nmbhitpmtCARD_h->Fill(hitsCARD); | 
| 712 |  | nmbhitpmtCAS_h->Fill(hitsCAS); | 
| 713 |  | nmbhitpmtCAT_h->Fill(hitsCAT); | 
| 714 |  |  | 
| 715 |  |  | 
| 716 |  | if(interval_cnt==INTERVAL) | 
| 717 |  | { | 
| 718 |  | event_obt[paramEvent] = ph->GetOrbitalTime(); | 
| 719 |  |  | 
| 720 |  | for(card=0;card<2;card++) | 
| 721 |  | { | 
| 722 |  | ac_clock100_old[card] = ac_clock100_new[card]; | 
| 723 |  | ac_clock100_new[card] = (ace->clock[card][1])*0xFFFF + ace->clock[card][0]; | 
| 724 |  | if((ac_clock100_new[card]-ac_clock100_old[card]) < 0.) | 
| 725 |  | ac_clock100_diff[card] = 0xFFFFFFFF+ac_clock100_new[card]-ac_clock100_old[card]; | 
| 726 |  | else | 
| 727 |  | ac_clock100_diff[card] = ac_clock100_new[card]-ac_clock100_old[card]; | 
| 728 |  |  | 
| 729 |  | trigger_gr[card][paramEvent] = (Float_t)INTERVAL/(0.000000025*ac_clock100_diff[card]); | 
| 730 |  |  | 
| 731 |  | for(ch=0;ch<16;ch++) | 
| 732 |  | singles_gr[card][ch][paramEvent] = singles_gr[card][ch][paramEvent]/(Double_t)(0.000000025*ac_clock100_diff[card]); | 
| 733 |  |  | 
| 734 |  | }//for(card) | 
| 735 |  | interval_cnt=0; | 
| 736 |  | paramEvent++; | 
| 737 |  | }//if(interval_cnt)) | 
| 738 |  |  | 
| 739 |  | } //for(events) | 
| 740 |  |  | 
| 741 |  | //for(Int_t i=0;i<Err_type.size();i++) | 
| 742 |  | //printf("%d\t%f\t%d\n\n",Err_type.at(i),Err_obt.at(i),Err_evt.at(i)); | 
| 743 |  |  | 
| 744 |  | //Time2 = clock(); | 
| 745 |  | //printf("Loop time: %f\n",(Double_t) (time2 - time1) / (Double_t) CLOCKS_PER_SEC); | 
| 746 |  |  | 
| 747 |  | /******************************  PLOTTING  ***************************/ | 
| 748 |  |  | 
| 749 |  | TCanvas *sheet1 = new TCanvas("Sheet 1"); | 
| 750 |  | sheet1->Range(0,0,100,100); | 
| 751 |  | sheet1->Draw(); | 
| 752 |  | sheet1->cd(); | 
| 753 |  |  | 
| 754 |  | TLatex *t=new TLatex(); | 
| 755 | t->SetTextFont(32); | t->SetTextFont(32); | 
| 756 | t->SetTextColor(1); | t->SetTextColor(1); | 
| 757 | t->SetTextAlign(12); | t->SetTextAlign(12); | 
| 758 | t->SetTextSize(0.015); | t->SetTextSize(0.02); | 
| 759 | //t->DrawLatex(2.,99.,error); |  | 
| 760 | //char *namn; | TPad *pd1 = new TPad("pd1","This is pad1",0.02,0.02,0.49,0.49,17); //lower left | 
| 761 | //TLatex *t2 = new TLatex(); | TPad *pd2 = new TPad("pd2","This is pad2",0.51,0.02,0.98,0.49,17); //lower right | 
| 762 |  | TPad *pd4 = new TPad("pd4","This is pad4",0.02,0.51,0.49,0.98,17); //upper left | 
| 763 |  | TPad *pd3 = new TPad("pd3","This is pad3",0.51,0.51,0.98,0.98,17); //upper right | 
| 764 |  |  | 
| 765 |  |  | 
| 766 |  | pd4->Range(0,0,100,100); | 
| 767 |  | sheet1->cd(); | 
| 768 |  | pd1->Draw(); | 
| 769 |  | pd2->Draw(); | 
| 770 |  | pd3->Draw(); | 
| 771 |  | pd4->Draw(); | 
| 772 |  |  | 
| 773 |  | pd4->cd(); | 
| 774 |  | char namn3[30]; | 
| 775 |  | char namn4[40]; | 
| 776 |  | char namn5[30]; | 
| 777 |  | sprintf(namn3,"Anticounter Quicklook  v%.1f",VERSION); | 
| 778 |  | sprintf(namn4,"File: %s",fileName.Data()); | 
| 779 |  | sprintf(namn5,"Events: %d",nevents); | 
| 780 |  | t->SetTextSize(0.1); | 
| 781 |  | t->DrawLatex(5,90,namn3); | 
| 782 |  | t->SetTextSize(0.1); | 
| 783 |  | t->DrawLatex(20,50,namn4); | 
| 784 |  | t->DrawLatex(20,40,namn5); | 
| 785 |  |  | 
| 786 |  | t->SetTextSize(0.02); | 
| 787 |  |  | 
| 788 |  | pd3->cd(); | 
| 789 |  | status_h->SetLineColor(1); | 
| 790 |  | status_h->SetStats(kFALSE); | 
| 791 |  | status_h->Draw(); | 
| 792 |  |  | 
| 793 |  | pd1->cd(); | 
| 794 |  | TGraph *temperatureRIGHT_M_g = new TGraph(paramEvents,event_obt,temp_gr[0][0]); | 
| 795 |  | TGraph *temperatureACTEL_M_g = new TGraph(paramEvents,event_obt,temp_gr[0][1]); | 
| 796 |  | TGraph *temperatureLEFT_M_g = new TGraph(paramEvents,event_obt,temp_gr[0][2]); | 
| 797 |  | TGraph *temperatureDSP_M_g = new TGraph(paramEvents,event_obt,temp_gr[0][3]); | 
| 798 |  | temperatureRIGHT_M_g->SetMaximum(50.); | 
| 799 |  | temperatureRIGHT_M_g->SetMinimum(0.); | 
| 800 |  | temperatureRIGHT_M_g->SetTitle("Temperature MAIN"); | 
| 801 |  | temperatureRIGHT_M_g->GetXaxis()->SetTitle("Obt [ms]"); | 
| 802 |  | temperatureRIGHT_M_g->GetYaxis()->SetTitle("T [Celsius]"); | 
| 803 |  | temperatureRIGHT_M_g->SetMarkerColor(1); | 
| 804 |  | temperatureACTEL_M_g->SetMarkerColor(2); | 
| 805 |  | temperatureLEFT_M_g->SetMarkerColor(3); | 
| 806 |  | temperatureDSP_M_g->SetMarkerColor(4); | 
| 807 |  | temperatureRIGHT_M_g->SetLineColor(1); | 
| 808 |  | temperatureACTEL_M_g->SetLineColor(2); | 
| 809 |  | temperatureLEFT_M_g->SetLineColor(3); | 
| 810 |  | temperatureDSP_M_g->SetLineColor(4); | 
| 811 |  | temperatureRIGHT_M_g->Draw("AL"); | 
| 812 |  | temperatureACTEL_M_g->Draw("LSAME"); | 
| 813 |  | temperatureLEFT_M_g->Draw("LSAME"); | 
| 814 |  | temperatureDSP_M_g->Draw("LSAME"); | 
| 815 |  |  | 
| 816 |  | TLegend *legTempM = new TLegend(0.72,0.63,0.85,0.8); | 
| 817 |  | legTempM->AddEntry(temperatureRIGHT_M_g,"Right","P"); | 
| 818 |  | legTempM->AddEntry(temperatureACTEL_M_g,"Actel","P"); | 
| 819 |  | legTempM->AddEntry(temperatureLEFT_M_g,"Left","P"); | 
| 820 |  | legTempM->AddEntry(temperatureDSP_M_g,"Dsp","P"); | 
| 821 |  | legTempM->Draw(); | 
| 822 |  |  | 
| 823 |  | pd2->cd(); | 
| 824 |  | TGraph *temperatureRIGHT_E_g = new TGraph(paramEvents,event_obt,temp_gr[1][0]); | 
| 825 |  | TGraph *temperatureACTEL_E_g = new TGraph(paramEvents,event_obt,temp_gr[1][1]); | 
| 826 |  | TGraph *temperatureLEFT_E_g = new TGraph(paramEvents,event_obt,temp_gr[1][2]); | 
| 827 |  | TGraph *temperatureDSP_E_g = new TGraph(paramEvents,event_obt,temp_gr[1][3]); | 
| 828 |  | temperatureRIGHT_E_g->SetTitle("Temperature EXTRA"); | 
| 829 |  | temperatureRIGHT_E_g->GetXaxis()->SetTitle("Obt [ms]"); | 
| 830 |  | temperatureRIGHT_E_g->GetYaxis()->SetTitle("T [Celsius]"); | 
| 831 |  | temperatureRIGHT_E_g->SetMarkerColor(1); | 
| 832 |  | temperatureACTEL_E_g->SetMarkerColor(2); | 
| 833 |  | temperatureLEFT_E_g->SetMarkerColor(3); | 
| 834 |  | temperatureDSP_E_g->SetMarkerColor(4); | 
| 835 |  | temperatureRIGHT_E_g->SetLineColor(1); | 
| 836 |  | temperatureACTEL_E_g->SetLineColor(2); | 
| 837 |  | temperatureLEFT_E_g->SetLineColor(3); | 
| 838 |  | temperatureDSP_E_g->SetLineColor(4); | 
| 839 |  |  | 
| 840 |  |  | 
| 841 |  | temperatureRIGHT_E_g->SetMaximum(50.); | 
| 842 |  | temperatureRIGHT_E_g->SetMinimum(0.); | 
| 843 |  | temperatureRIGHT_E_g->Draw("AL"); | 
| 844 |  | temperatureACTEL_E_g->Draw("LSAME"); | 
| 845 |  | temperatureLEFT_E_g->Draw("LSAME"); | 
| 846 |  | temperatureDSP_E_g->Draw("LSAME"); | 
| 847 |  |  | 
| 848 |  | TLegend *legTempE = new TLegend(0.72,0.63,0.86,0.8); | 
| 849 |  | legTempE->AddEntry(temperatureRIGHT_E_g,"Right","L"); | 
| 850 |  | legTempE->AddEntry(temperatureACTEL_E_g,"Actel","L"); | 
| 851 |  | legTempE->AddEntry(temperatureLEFT_E_g,"Left","L"); | 
| 852 |  | legTempE->AddEntry(temperatureDSP_E_g,"Dsp","L"); | 
| 853 |  | legTempE->Draw(); | 
| 854 |  |  | 
| 855 |  | /************************/ | 
| 856 |  |  | 
| 857 |  | TCanvas *sheet2 = new TCanvas("Sheet 2"); | 
| 858 |  | sheet2->Range(0,0,100,100); | 
| 859 |  | sheet2->Draw(); | 
| 860 |  | sheet2->cd(); | 
| 861 |  |  | 
| 862 |  | TPad *pd21 = new TPad("pd21","This is pad1",0.02,0.02,0.49,0.49,17); //lower left | 
| 863 |  | //TPad *pd22 = new TPad("pd22","This is pad2",0.51,0.02,0.98,0.49,17); //lower right | 
| 864 |  | TPad *pd22_1 = new TPad("pd22_1","This is pad22_1",0.51,0.02,0.65,0.49,17); | 
| 865 |  | TPad *pd22_2 = new TPad("pd22_3","This is pad22_2",0.67,0.02,0.81,0.49,17); | 
| 866 |  | TPad *pd22_3 = new TPad("pd22_4","This is pad22_3",0.83,0.02,0.97,0.49,17); | 
| 867 |  |  | 
| 868 |  | TPad *pd24 = new TPad("pd24","This is pad4",0.02,0.51,0.49,0.98,17); //upper left | 
| 869 |  | TPad *pd23 = new TPad("pd23","This is pad3",0.51,0.51,0.98,0.98,17); //upper right | 
| 870 |  | sheet2->cd(); | 
| 871 |  | pd21->Draw(); | 
| 872 |  | pd22_1->Draw(); | 
| 873 |  | pd22_2->Draw(); | 
| 874 |  | pd22_3->Draw(); | 
| 875 |  | pd23->Draw(); | 
| 876 |  | pd24->Draw(); | 
| 877 |  |  | 
| 878 |  | t->SetTextColor(1); | 
| 879 |  | t->DrawLatex(82,99,cardname[0]); | 
| 880 |  | t->SetTextColor(2); | 
| 881 |  | t->DrawLatex(89,99,cardname[1]); | 
| 882 |  |  | 
| 883 |  | pd24->cd(); | 
| 884 |  | TGraph *triggM_gr = new TGraph(paramEvents,event_obt,trigger_gr[0]); | 
| 885 |  | TGraph *triggE_gr = new TGraph(paramEvents,event_obt,trigger_gr[1]); | 
| 886 |  | triggM_gr->SetTitle("Trigger Rate"); | 
| 887 |  | triggM_gr->GetXaxis()->SetTitle("Obt [ms]"); | 
| 888 |  | triggM_gr->GetYaxis()->SetTitle("f [Hz]"); | 
| 889 |  | triggM_gr->SetMarkerColor(1); | 
| 890 |  | triggE_gr->SetMarkerColor(2); | 
| 891 |  | triggM_gr->SetLineColor(1); | 
| 892 |  | triggE_gr->SetLineColor(2); | 
| 893 |  | triggM_gr->Draw("AL"); | 
| 894 |  | triggE_gr->Draw("LSAME"); | 
| 895 |  |  | 
| 896 |  | pd23->cd(); | 
| 897 |  | gPad->SetLogy(1); | 
| 898 |  | time_between_trigg_h[0]->GetXaxis()->SetTitle("Time [s]"); | 
| 899 |  | time_between_trigg_h[0]->SetLineColor(1); | 
| 900 |  | time_between_trigg_h[1]->SetLineColor(2); | 
| 901 |  | if(time_between_trigg_h[0]->GetMaximum() < time_between_trigg_h[1]->GetMaximum()) | 
| 902 |  | time_between_trigg_h[0]->SetMaximum(1.3*time_between_trigg_h[1]->GetMaximum()); | 
| 903 |  | //time_between_trigg_h[0]->SetStats(kFALSE); | 
| 904 |  | time_between_trigg_h[0]->Draw(); | 
| 905 |  | time_between_trigg_h[1]->SetStats(kFALSE); | 
| 906 |  | time_between_trigg_h[1]->Draw("SAME"); | 
| 907 |  |  | 
| 908 |  |  | 
| 909 |  | pd21->cd(); | 
| 910 |  | hitmap_h[0]->SetStats(kFALSE); | 
| 911 |  | hitmap_h[1]->SetStats(kFALSE); | 
| 912 |  | hitmap_h[0]->SetLineColor(1); | 
| 913 |  | if(hitmap_h[0]->GetMaximum() < hitmap_h[1]->GetMaximum()) | 
| 914 |  | hitmap_h[0]->SetMaximum(1.1*hitmap_h[1]->GetMaximum()); | 
| 915 |  | hitmap_h[0]->Draw(); | 
| 916 |  | hitmap_h[1]->SetLineColor(2); | 
| 917 |  | hitmap_h[1]->Draw("SAME"); | 
| 918 |  |  | 
| 919 |  |  | 
| 920 |  | pd22_1->cd(); | 
| 921 |  | gPad->SetLogy(1); | 
| 922 |  | nmbhitpmtCARD_h->SetTitle("CARD"); | 
| 923 |  | nmbhitpmtCARD_h->GetXaxis()->SetTitle("Nmb of hits"); | 
| 924 |  | nmbhitpmtCARD_h->GetYaxis()->SetTitle("Events"); | 
| 925 |  | nmbhitpmtCARD_h->SetStats(kFALSE); | 
| 926 |  | nmbhitpmtCARD_h->SetLineColor(1); | 
| 927 |  | nmbhitpmtCARD_h->Draw(); | 
| 928 |  |  | 
| 929 |  | pd22_2->cd(); | 
| 930 |  | gPad->SetLogy(1); | 
| 931 |  | nmbhitpmtCAT_h->SetTitle("CAT"); | 
| 932 |  | nmbhitpmtCAT_h->GetXaxis()->SetTitle("Nmb of hits"); | 
| 933 |  | nmbhitpmtCAT_h->GetYaxis()->SetTitle("Events"); | 
| 934 |  | nmbhitpmtCAT_h->SetStats(kFALSE); | 
| 935 |  | nmbhitpmtCAT_h->SetLineColor(1); | 
| 936 |  | nmbhitpmtCAT_h->Draw(); | 
| 937 |  |  | 
| 938 |  | pd22_3->cd(); | 
| 939 |  | gPad->SetLogy(1); | 
| 940 |  | nmbhitpmtCAS_h->SetTitle("CAS"); | 
| 941 |  | nmbhitpmtCAS_h->GetXaxis()->SetTitle("Nmb of hits"); | 
| 942 |  | nmbhitpmtCAS_h->GetYaxis()->SetTitle("Events"); | 
| 943 |  | nmbhitpmtCAS_h->SetStats(kFALSE); | 
| 944 |  | nmbhitpmtCAS_h->SetLineColor(1); | 
| 945 |  | nmbhitpmtCAS_h->Draw(); | 
| 946 |  |  | 
| 947 |  | /* | 
| 948 |  | if(nmbhitpmtCAT_h->GetMaximum() > nmbhitpmtCARD_h->GetMaximum()) | 
| 949 |  | { | 
| 950 |  | if(nmbhitpmtCAT_h->GetMaximum() > nmbhitpmtCAS_h->GetMaximum()) | 
| 951 |  | nmbhitpmtCARD_h->SetMaximum(1.2*nmbhitpmtCAT_h->GetMaximum()); | 
| 952 |  | else | 
| 953 |  | nmbhitpmtCARD_h->SetMaximum(1.2*nmbhitpmtCAS_h->GetMaximum()); | 
| 954 |  | } | 
| 955 |  | nmbhitpmtCARD_h->SetLineColor(1); | 
| 956 |  | nmbhitpmtCAT_h->SetLineColor(2); | 
| 957 |  | nmbhitpmtCAS_h->SetLineColor(3); | 
| 958 |  | nmbhitpmtCARD_h->SetMarkerStyle(20); | 
| 959 |  | nmbhitpmtCAT_h->SetMarkerStyle(21); | 
| 960 |  | nmbhitpmtCAS_h->SetMarkerStyle(22); | 
| 961 |  | nmbhitpmtCARD_h->Draw("P"); | 
| 962 |  | nmbhitpmtCAT_h->Draw("PSAME"); | 
| 963 |  | nmbhitpmtCAS_h->Draw("PSAME"); | 
| 964 |  |  | 
| 965 |  | TLegend *leghitpmt = new TLegend(0.72,0.63,0.86,0.8); | 
| 966 |  | leghitpmt->AddEntry(nmbhitpmtCARD_h,"CARD","P"); | 
| 967 |  | leghitpmt->AddEntry(nmbhitpmtCAT_h,"CAT","P"); | 
| 968 |  | leghitpmt->AddEntry(nmbhitpmtCAS_h,"CAS","P"); | 
| 969 |  | leghitpmt->Draw(); | 
| 970 |  | */ | 
| 971 |  |  | 
| 972 |  | /********** SHEET 3 *********/ | 
| 973 |  |  | 
| 974 |  | TCanvas *sheet3 = new TCanvas("Sheet 3"); | 
| 975 |  | //sheet2->Divide(4,4); | 
| 976 |  | sheet3->Draw(); | 
| 977 |  | sheet3->cd(); | 
| 978 |  |  | 
| 979 |  | sheet3->Range(0,0,100,100); | 
| 980 |  |  | 
| 981 | t->SetTextFont(32); | t->SetTextFont(32); | 
| 982 | t->SetTextColor(1); | t->SetTextColor(1); | 
| 983 | t->SetTextAlign(12); | t->SetTextAlign(12); | 
| 984 | t->SetTextSize(0.035); | t->SetTextSize(0.035); | 
| 985 |  | char *namn = "                                         "; | 
| 986 | namn="Singles Counters"; |  | 
| 987 |  | namn="Singles Rate"; | 
| 988 | t->DrawLatex(40.,95,namn); | t->DrawLatex(40.,95,namn); | 
| 989 | namn="CAS"; | namn="CAS"; | 
| 990 | t->DrawLatex(4.,95.,namn); | t->DrawLatex(4.,95.,namn); | 
| 993 | namn="CARD"; | namn="CARD"; | 
| 994 | t->DrawLatex(4.,34.,namn); | t->DrawLatex(4.,34.,namn); | 
| 995 |  |  | 
|  | t->SetTextFont(32); |  | 
|  | t->SetTextColor(1); |  | 
|  | t->SetTextAlign(12); |  | 
| 996 | t->SetTextSize(0.02); | t->SetTextSize(0.02); | 
| 997 | namn="MAIN"; | namn="MAIN"; | 
| 998 | t->DrawLatex(85,98,namn); | t->DrawLatex(85,98,namn); | 
| 999 | t->SetTextColor(2); | t->SetTextColor(2); | 
| 1000 | namn="EXTRA"; | namn="EXTRA"; | 
| 1001 | t->DrawLatex(85,95,namn); | t->DrawLatex(85,95,namn); | 
| 1002 | //TPad *pd1,*pd2,*pd3,*pd4,*pd5,*pd6,*pd7,*pd8,*pd9,*pd10,*pd11,*pd12; |  | 
| 1003 | 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}; | 
| 1004 | 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.}; | 
| 1005 | 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}; | 
| 1006 | 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}; | 
| 1007 | pd5 = new TPad("pd5","This is pad5",0.,0.37,0.25,0.62); | TPad *singles_Pads[12]; | 
| 1008 | pd6 = new TPad("pd6","This is pad6",0.25,0.37,.5,0.62); |  | 
| 1009 | pd7 = new TPad("pd7","This is pad7",0.5,0.37,0.75,0.62); | char singlesname[30]; | 
| 1010 | pd8 = new TPad("pd8","This is pad8",0.75,0.37,1.0,0.62); | for(Int_t ch=0;ch<12;ch++){ | 
| 1011 | pd9 = new TPad("pd9","This is pad9",0.0,0.06,0.25,0.31); | sprintf(singlesname,"Pad%d",ch+1); | 
| 1012 | 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]); | 
| 1013 | pd11 = new TPad("pd11","This is pad11",0.5,0.06,0.75,0.31); | singles_Pads[ch]->Draw(); | 
| 1014 | pd12 = new TPad("pd12","This is pad12",0.75,0.06,1.,0.31); | } | 
| 1015 | //pd13 = new TPad("pd13","This is pad13",0.,0.0,0.25,0.25); |  | 
| 1016 | //pd14 = new TPad("pd14","This is pad14",0.25,0.0,.5,0.25); | sheet3->cd(); | 
| 1017 | //pd15 = new TPad("pd15","This is pad15",0.5,0.0,0.75,0.25); | singles_gr[0][4][0]=0.; | 
| 1018 | //pd16 = new TPad("pd16","This is pad16",0.75,0.0,1.0,0.25); | TGraph *singlesrate_g[2][12]; | 
| 1019 | Canv_report3->cd(); | Int_t k; | 
| 1020 | //pd1->Range(0,0,100,100); | for(Int_t card=0;card<2;card++){ | 
| 1021 | //pd2->Range(0,0,100,100); | k=0; | 
| 1022 | //pd3->Range(0,0,100,100); | for(Int_t ch=0;ch<16;ch++){ | 
| 1023 | //pd4->Range(0,0,100,100); | if(ch!=3 && ch!=7 && ch!= 11 && ch!=15){ | 
| 1024 | //pd5->Range(0,0,100,100); | //printf("k %d ch %d\n",k,ch); | 
| 1025 | //pd6->Range(0,0,100,100); | singles_Pads[k]->cd(); | 
| 1026 | //pd7->Range(0,0,100,100); | singles_gr[card][det_map[k]][0]=0.0; | 
| 1027 | //pd8->Range(0,0,100,100); | singlesrate_g[card][k] = new TGraph(paramEvents,event_obt,singles_gr[card][det_map[k]]); | 
| 1028 | //pd9->Range(0,0,100,100); | singlesrate_g[card][k]->SetLineColor(card+1); | 
| 1029 | //pd10->Range(0,0,100,100); | singlesrate_g[card][k]->GetXaxis()->SetTitle("Obt [ms]"); | 
| 1030 | //pd11->Range(0,0,100,100); | singlesrate_g[card][k]->GetYaxis()->SetTitle("f [Hz]"); | 
| 1031 | //pd12->Range(0,0,100,100); | singlesrate_g[card][k]->SetTitle(detector[det_map[k]].Data()); | 
| 1032 | //pd13->Range(0,0,100,100); | if(card==0) | 
| 1033 | //pd14->Range(0,0,100,100); | singlesrate_g[card][k]->Draw("AL"); | 
| 1034 | //pd15->Range(0,0,100,100); | else | 
| 1035 | //pd16->Range(0,0,100,100); | singlesrate_g[card][k]->Draw("LSAME"); | 
| 1036 | pd1->Draw(); | k++; | 
| 1037 | pd2->Draw(); | } | 
| 1038 | pd3->Draw(); | } | 
| 1039 | pd4->Draw(); | } | 
| 1040 | pd5->Draw(); |  | 
| 1041 | pd6->Draw(); | /********** SHEET 4 *********/ | 
| 1042 | pd7->Draw(); |  | 
| 1043 | pd8->Draw(); | TCanvas *sheet4 = new TCanvas("Sheet 4"); | 
| 1044 | pd9->Draw(); | //sheet2->Divide(4,4); | 
| 1045 | pd10->Draw(); | sheet4->Draw(); | 
| 1046 | pd11->Draw(); | sheet4->cd(); | 
| 1047 | pd12->Draw(); |  | 
| 1048 | //pd13->Draw(); | sheet4->Range(0,0,100,100); | 
| 1049 | //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(); |  | 
| 1050 | t->SetTextFont(32); | t->SetTextFont(32); | 
| 1051 | t->SetTextColor(1); | t->SetTextColor(1); | 
| 1052 | t->SetTextAlign(12); | t->SetTextAlign(12); | 
| 1053 | t->SetTextSize(0.035); | t->SetTextSize(0.035); | 
| 1054 |  |  | 
| 1055 |  | namn="Shift Register Content"; | 
| 1056 |  | t->DrawLatex(40.,95,namn); | 
| 1057 | namn="CAS"; | namn="CAS"; | 
| 1058 | t->DrawLatex(4.,94.,namn); | t->DrawLatex(4.,95.,namn); | 
| 1059 | namn="CAT"; | namn="CAT"; | 
| 1060 | t->DrawLatex(4.,65.,namn); | t->DrawLatex(4.,65.,namn); | 
| 1061 | namn="CARD"; | namn="CARD"; | 
| 1062 | t->DrawLatex(4.,34.,namn); | t->DrawLatex(4.,34.,namn); | 
| 1063 | namn="Shift register content"; |  | 
|  | t->DrawLatex(39.,95,namn); |  | 
|  | t->SetTextFont(32); |  | 
|  | t->SetTextColor(1); |  | 
|  | t->SetTextAlign(12); |  | 
| 1064 | t->SetTextSize(0.02); | t->SetTextSize(0.02); | 
| 1065 | namn="MAIN"; | namn="MAIN"; | 
| 1066 | t->DrawLatex(85,98,namn); | t->DrawLatex(85,98,namn); | 
| 1068 | namn="EXTRA"; | namn="EXTRA"; | 
| 1069 | t->DrawLatex(85,95,namn); | t->DrawLatex(85,95,namn); | 
| 1070 |  |  | 
| 1071 | //TPad *pd1,*pd2,*pd3,*pd4,*pd5,*pd6,*pd7,*pd8,*pd9,*pd10,*pd11,*pd12; | TPad *shift_Pads[12]; | 
| 1072 | pd1 = new TPad("pd1","This is pad1",0.,0.68,0.25,.92); |  | 
| 1073 | pd2 = new TPad("pd2","This is pad2",0.25,0.68,0.5,.92); | for(Int_t ch=0;ch<12;ch++){ | 
| 1074 | pd3 = new TPad("pd3","This is pad3",0.5,0.68,0.75,.92); | sprintf(singlesname,"ShiftPad%d",ch+1); | 
| 1075 | 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]); | 
| 1076 | pd5 = new TPad("pd5","This is pad5",0.,0.37,0.25,0.62); | shift_Pads[ch]->Draw(); | 
| 1077 | pd6 = new TPad("pd6","This is pad6",0.25,0.37,.5,0.62); | } | 
| 1078 | pd7 = new TPad("pd7","This is pad7",0.5,0.37,0.75,0.62); |  | 
| 1079 | pd8 = new TPad("pd8","This is pad8",0.75,0.37,1.0,0.62); | sheet4->cd(); | 
| 1080 | pd9 = new TPad("pd9","This is pad9",0.0,0.06,0.25,0.31); | for(Int_t card=0;card<2;card++){ | 
| 1081 | pd10 = new TPad("pd10","This is pad10",0.25,0.06,.5,0.31); | k=0; | 
| 1082 | pd11 = new TPad("pd11","This is pad11",0.5,0.06,0.75,0.31); | for(Int_t ch=0;ch<16;ch++){ | 
| 1083 | pd12 = new TPad("pd12","This is pad12",0.75,0.06,1.,0.31); | if(ch!=3 && ch!=7 && ch!= 11 && ch!=15){ | 
| 1084 | //pd13 = new TPad("pd13","This is pad13",0.,0.0,0.25,0.25); | //printf("k %d ch %d\n",k,ch); | 
| 1085 | //pd14 = new TPad("pd14","This is pad14",0.25,0.0,.5,0.25); | shift_Pads[k]->cd(); | 
| 1086 | //pd15 = new TPad("pd15","This is pad15",0.5,0.0,0.75,0.25); | gPad->SetLogy(1); | 
| 1087 | //pd16 = new TPad("pd16","This is pad16",0.75,0.0,1.0,0.25); | shiftreg_h[card][det_map[k]]->SetStats(kFALSE); | 
| 1088 | Canv_report4->cd(); | shiftreg_h[card][det_map[k]]->SetLineColor(1+card); | 
| 1089 | //pd1->Range(0,0,100,100); | shiftreg_h[card][det_map[k]]->SetMinimum(0.); | 
| 1090 | pd1->SetLogy(1); | shiftreg_h[card][det_map[k]]->Scale(1./shiftreg_h[card][det_map[k]]->Integral()); | 
| 1091 | //pd2->Range(0,0,100,100); | if(card==0) | 
| 1092 | pd2->SetLogy(1); | shiftreg_h[card][det_map[k]]->Draw(); | 
| 1093 | //pd3->Range(0,0,100,100); | else | 
| 1094 | pd3->SetLogy(1); | shiftreg_h[card][det_map[k]]->Draw("SAME"); | 
| 1095 | // pd4->Range(0,0,100,100); | k++; | 
| 1096 | 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); |  | 
| 1097 | } | } | 
| 1098 |  | } | 
| 1099 |  |  | 
| 1100 |  | // Plot error report if any error occurs | 
| 1101 |  |  | 
| 1102 |  | //char *namn6 = "KKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK"; | 
| 1103 |  | int mposition = 80; | 
| 1104 |  | int eposition = 80; | 
| 1105 |  | char *mystring = "DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"; | 
| 1106 |  | TString *merr; | 
| 1107 |  | TBox *b1,*b2; | 
| 1108 |  |  | 
| 1109 | //Delete variables | TCanvas *sheetError; | 
|  | //delete Canv_report1,Canv_report2,Canv_report3,Canv_report4; |  | 
|  | //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; |  | 
| 1110 |  |  | 
| 1111 | return 0; | if(Err_type.size() > 0) | 
| 1112 |  | { | 
| 1113 |  | merr = new TString[12]; | 
| 1114 |  | merr[0]="Header"; | 
| 1115 |  | merr[1]="CRC"; | 
| 1116 |  | merr[2]="Dsp"; | 
| 1117 |  | merr[3]="Temp"; | 
| 1118 |  | merr[4]="Reg"; | 
| 1119 |  | merr[5]="Event CRC"; | 
| 1120 |  | merr[6]="Header"; | 
| 1121 |  | merr[7]="CRC"; | 
| 1122 |  | merr[8]="Dsp"; | 
| 1123 |  | merr[9]="Temp"; | 
| 1124 |  | merr[10]="Reg"; | 
| 1125 |  | merr[11]="Event CRC"; | 
| 1126 |  |  | 
| 1127 |  | sheetError = new TCanvas("Sheet Error","Sheet Error"); //base | 
| 1128 |  | sheetError->Range(0,0,100,100); | 
| 1129 |  | sheetError->Draw(); | 
| 1130 |  | b1 = new TBox(10,83.5,90,84.5); | 
| 1131 |  | b2 = new TBox(49.5,90,50.5,5); | 
| 1132 |  | b1->SetFillColor(1); | 
| 1133 |  | b2->SetFillColor(1); | 
| 1134 |  | b1->Draw(); | 
| 1135 |  | b2->Draw(); | 
| 1136 |  |  | 
| 1137 |  | t->SetTextFont(40); | 
| 1138 |  | t->SetTextColor(1); | 
| 1139 |  | t->SetTextAlign(12); | 
| 1140 |  | t->SetTextSize(0.04); | 
| 1141 |  | namn = "AntiCounter Error Report"; | 
| 1142 |  | t->DrawLatex(37,94,namn); | 
| 1143 |  | t->SetTextColor(1); | 
| 1144 |  | namn = "MAIN card"; | 
| 1145 |  | t->DrawLatex(15,87,namn); | 
| 1146 |  | t->SetTextColor(1); | 
| 1147 |  | namn = "EXTRA card"; | 
| 1148 |  | t->DrawLatex(65,87,namn); | 
| 1149 |  | t->SetTextSize(0.015); | 
| 1150 |  |  | 
| 1151 |  |  | 
| 1152 |  | //for(Int_t i=0;i<Err_type.size();i++) | 
| 1153 |  | UInt_t iter = 0; | 
| 1154 |  | while(iter<Err_type.size()) | 
| 1155 |  | { | 
| 1156 |  | mystring = Form("%s error obt %d \t event nmb %d",merr[Err_type.at(iter)].Data(),(int)Err_obt.at(iter),Err_evt.at(iter)); | 
| 1157 |  | t->SetTextColor(2); | 
| 1158 |  | if(Err_type.at(iter) < 7 && mposition>10){ | 
| 1159 |  | mposition -= 2; | 
| 1160 |  | t->DrawLatex(15,mposition,mystring); | 
| 1161 |  | } | 
| 1162 |  | else if(eposition>10){ | 
| 1163 |  | eposition -= 2; | 
| 1164 |  | t->DrawLatex(65,eposition,mystring); | 
| 1165 |  | } | 
| 1166 |  | iter++; | 
| 1167 |  | } | 
| 1168 |  | if(mposition<10) | 
| 1169 |  | t->DrawLatex(15,5,"More errors in run!"); | 
| 1170 |  | if(eposition<10) | 
| 1171 |  | t->DrawLatex(65,5,"More errors in run!"); | 
| 1172 |  |  | 
| 1173 |  | figsave = Form("%s/%s_AcQLOOK_Error.%s",outDir.Data(),fileName.Data(),format.Data()); | 
| 1174 |  | sheetError->SaveAs(figsave); | 
| 1175 |  | } | 
| 1176 |  |  | 
| 1177 |  | figsave = Form("%s/%s_AcQLOOK_Status.%s",outDir.Data(),fileName.Data(),format.Data()); | 
| 1178 |  | sheet1->SaveAs(figsave); | 
| 1179 |  |  | 
| 1180 |  | figsave = Form("%s/%s_AcQLOOK_Trigger.%s",outDir.Data(),fileName.Data(),format.Data()); | 
| 1181 |  | sheet2->SaveAs(figsave); | 
| 1182 |  |  | 
| 1183 |  | figsave = Form("%s/%s_AcQLOOK_Singles.%s",outDir.Data(),fileName.Data(),format.Data()); | 
| 1184 |  | sheet3->SaveAs(figsave); | 
| 1185 |  |  | 
| 1186 |  | figsave = Form("%s/%s_AcQLOOK_Shift.%s",outDir.Data(),fileName.Data(),format.Data()); | 
| 1187 |  | sheet4->SaveAs(figsave); | 
| 1188 |  |  | 
| 1189 |  | delete sheet1; | 
| 1190 |  | delete hitmap_h[0]; | 
| 1191 |  | delete hitmap_h[1]; | 
| 1192 |  |  | 
| 1193 |  | //stopTime = clock(); | 
| 1194 |  | //printf("Draw time: %f\n\n",(Double_t) (stopTime - time2) / (Double_t) CLOCKS_PER_SEC); | 
| 1195 |  | //printf("Exc time: %f\n",(Double_t) (stopTime-startTime) / (Double_t) CLOCKS_PER_SEC); | 
| 1196 |  |  | 
| 1197 |  | return 1; | 
| 1198 |  |  | 
| 1199 | } | } | 
| 1200 |  |  | 
| 1201 |  |  | 
| 1202 | int main(int argc, char* argv[]){ | int main(int argc, char* argv[]){ | 
| 1203 | TString outDir      = "."; | TString outDir      = "."; | 
| 1204 | TString format      = "jpg"; | TString format      = FORMAT; | 
| 1205 | int from            = 0; | int from            = 0; | 
| 1206 | int to              = 0; | int to              = 0; | 
| 1207 | int mode            = 0; | int mode            = 0; | 
| 1261 | } | } | 
| 1262 | } | } | 
| 1263 |  |  | 
|  |  |  | 
| 1264 | if (!strcmp(argv[i], "-to")) { | if (!strcmp(argv[i], "-to")) { | 
| 1265 | if (++i >= argc){ | if (++i >= argc){ | 
| 1266 | printf( "-to needs arguments. \n"); | printf( "-to needs arguments. \n"); | 
| 1270 | if (isdigit(*argv[i]) && (atoi(argv[i]) > 0)) { | if (isdigit(*argv[i]) && (atoi(argv[i]) > 0)) { | 
| 1271 | to = atoi(argv[i]); | to = atoi(argv[i]); | 
| 1272 | } else { | } else { | 
| 1273 | cerr << "-to needs a integer value. \n"; | //err << "-to needs a integer value. \n"; | 
| 1274 | cout << "Try '--help' for more information. \n"; | cout << "Try '--help' for more information. \n"; | 
| 1275 | exit(1); | exit(1); | 
| 1276 | } | } | 
| 1283 | exit(1); | exit(1); | 
| 1284 | } | } | 
| 1285 | if (isdigit(*argv[i]) && (atoi(argv[i]) > 0)) { | if (isdigit(*argv[i]) && (atoi(argv[i]) > 0)) { | 
| 1286 | to = atoi(argv[i]); | from = atoi(argv[i]); | 
| 1287 | } else { | } else { | 
| 1288 | cerr << "-from needs a integer value. \n"; | //cerr << "-from needs a integer value. \n"; | 
| 1289 | cout << "Try '--help' for more information. \n"; | cout << "Try '--help' for more information. \n"; | 
| 1290 | exit(1); | exit(1); | 
| 1291 | } | } | 
| 1292 | } | } | 
| 1293 |  |  | 
| 1294 | } | } | 
| 1295 | AcQLOOK(argv[1], from, to, outDir, format,mode); |  | 
| 1296 |  | if(mode==0) | 
| 1297 |  | AcQLOOKbasic(argv[1], from, to, outDir, format); | 
| 1298 |  | else if(mode==1) | 
| 1299 |  | AcQLOOKpro(argv[1], from, to, outDir, format); | 
| 1300 |  | else | 
| 1301 |  | printf("Wrong mode argument. Try --help for more information\n"); | 
| 1302 |  |  | 
| 1303 | } | } |