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