/sipmScan/src/analysisThreshold.cpp |
---|
93,7 → 93,7 |
int analysisThreshold(char* dfile0="test", int dbg=0, double tdcCut=5.0) |
{ |
const double c_tdcOffset = 1; // ns |
const double c_tdcOffset = 368*TDC_BIN; // ns |
printf(" Data to root conversion program\nUsage:\nd2r(input file name <without.dat>, debug on/off, TDC cut +-[ns])\n\n"); |
230,7 → 230,7 |
h_correctedTDC = (TH3F*) gROOT->FindObject("h_correctedTDC"); |
if (h_correctedTDC) delete h_correctedTDC; |
nSteps = (run.thUp - run.thLow)/double(run.thStep) + 1; |
if (dbg) printf("nSteps %d\n", nSteps); |
if (dbg) printf("nSteps %f\n", nSteps); |
h_correctedTDC = new TH3F("h_correctedTDC",";SiPM channel; ASD threshold [V]; t [ns]", |
NCH, |
-0.5, |
238,9 → 238,9 |
nSteps, |
(run.thLow - 0.5*run.thStep)/1000.0, |
(run.thUp + 0.5*run.thStep)/1000.0, |
2*tdcCut*TDC_BIN, |
-tdcCut*TDC_BIN, |
tdcCut*TDC_BIN); |
2*tdcCut+1, |
(-tdcCut - 0.5)*TDC_BIN, |
(tdcCut + 0.5)*TDC_BIN); |
//TH1F* gsumV673A[NCH/16] = new TH1F(hn,hname,256,-0.5,255.5); |
for(int i=0; i<NCH; i++) { |
/* |
/sipmScan/src/analysisBias.cpp |
---|
103,7 → 103,7 |
int analysisBias(char* dfile0="test", int dbg=0, double tdcCut=5.0) |
{ |
const double c_tdcOffset = 1; // ns |
const double c_tdcOffset = 368*TDC_BIN; // ns |
printf(" Data to root conversion program\nUsage:\nd2r(input file name <without.dat>, debug on/off, TDC cut +-[ns])\n\n"); |
240,20 → 240,7 |
//htdc = (TH2F*) gROOT->FindObject(hname); |
//if (htdc) delete htdc; |
//htdc = new TH2F("htdc",";TDC channel;SiPM channel",512,0,512,NCH,0,NCH); |
h_correctedTDC = (TH3F*) gROOT->FindObject("h_correctedTDC"); |
if (h_correctedTDC) delete h_correctedTDC; |
nSteps = (run.thUp - run.thLow)/double(run.thStep) + 1; |
if (dbg) printf("nSteps %d\n", nSteps); |
h_correctedTDC = new TH3F("h_correctedTDC",";SiPM channel; ASD threshold [V]; t [ns]", |
NCH, |
-0.5, |
NCH-0.5, |
nSteps, |
(run.thLow - 0.5*run.thStep)/1000.0, |
(run.thUp + 0.5*run.thStep)/1000.0, |
2*tdcCut*TDC_BIN, |
-tdcCut*TDC_BIN, |
tdcCut*TDC_BIN); |
//TH1F* gsumV673A[NCH/16] = new TH1F(hn,hname,256,-0.5,255.5); |
for(int i=0; i<NCH; i++) { |
/* |
296,6 → 283,22 |
} |
nBiasSteps = (run.biasUp - run.biasLow)/double(run.biasStep) + 1; |
h_correctedTDC = (TH3F*) gROOT->FindObject("h_correctedTDC"); |
if (h_correctedTDC) delete h_correctedTDC; |
nSteps = (run.thUp - run.thLow)/double(run.thStep) + 1; |
if (dbg) printf("nSteps %d\n", nSteps); |
h_correctedTDC = new TH3F("h_correctedTDC",";SiPM channel; ASD threshold [V]; t [ns]", |
NCH, |
-0.5, |
NCH-0.5, |
nBiasSteps, |
(run.biasLow - 0.5*run.biasStep)/1000.0, |
(run.biasUp + 0.5*run.biasStep)/1000.0, |
2*tdcCut+1, |
-tdcCut*TDC_BIN - 0.5*TDC_BIN, |
tdcCut*TDC_BIN + 0.5*TDC_BIN); |
h_bias = (TH2F*) gROOT->FindObject("h_bias"); |
if (h_bias) delete h_bias; |
h_bias = new TH2F("h_bias",";Channel; Bias [V]", 64, -0.5, 63.5, |
392,7 → 395,7 |
double tdcmax = tdcOffset[channel] + tdcCut; |
double time = data*TDC_BIN - tdcOffset[channel]; |
if(time >= -tdcCut and time <= tdcCut) { |
h_correctedTDC->Fill(channel, thr.threshold/1000.0, time); |
h_correctedTDC->Fill(channel, bias.bias/1000.0, time); |
hnhitsx[channel]->Fill((pos.xset - OFFSETX) * MIKRO_BIN); |
hnhitsy[channel]->Fill((pos.yset - OFFSETY) * MIKRO_BIN); |
h2d[channel]->Fill((pos.xset - OFFSETX) * MIKRO_BIN, (pos.yset - OFFSETY) * MIKRO_BIN); |
497,7 → 500,7 |
int position(int x, int y, int channel) |
{ |
int flag = 0; |
if ( (x > (padCenter[channel][0] - 5000)) and (x < (padCenter[channel][0] + 5000)) and |
(y > (padCenter[channel][1] - 5000)) and (y < (padCenter[channel][1] + 5000)) ) flag = 1; |
if ( (x > (padCenter[channel][0] - 5040)) and (x < (padCenter[channel][0] + 5040)) and |
(y > (padCenter[channel][1] - 5040)) and (y < (padCenter[channel][1] + 5040)) ) flag = 1; |
return flag; |
} |
/sipmScan/src/RTUtil.cpp |
---|
1,4 → 1,6 |
//########################################################################################## |
#include "TGaxis.h" |
void RTSetStyle(TStyle *style) |
{ |
style->SetStatBorderSize(1); |
14,16 → 16,20 |
style->SetMarkerStyle(kFullDotLarge); |
//style->SetMarkerSize(7); |
style->SetOptStat("e"); |
style->SetOptFit(1); |
style->SetPadTopMargin(0.15); |
style->SetPadBottomMargin(0.15); |
style->SetPadLeftMargin(0.15); |
style->SetPadRightMargin(0.15); |
style->SetPadTopMargin(0.12); |
style->SetPadBottomMargin(0.12); |
style->SetPadLeftMargin(0.12); |
style->SetPadRightMargin(0.12); |
style->SetTitleOffset(1.3, "y"); |
gStyle->SetPalette(1, 0); |
style->SetPalette(1, 0); |
//gStyle->SetPaperSize(TStyle::kA4); |
style->SetPaperSize(TStyle::kA4); |
TGaxis::SetMaxDigits(4); |
} |
//########################################################################################## |
RTCanvas::RTCanvas() |
/sipmScan/src/analysisScan.cpp |
---|
30,8 → 30,8 |
#define NCH 64 |
#define TDC_BIN 1.0416 // 1 TDC bin in ns |
#define MIKRO_BIN 0.49609/1000. //1 mikro step in mm; stage MM3MF |
#define OFFSETX 4800 // Right edge of SiPM+Lightguide |
#define OFFSETY 3400 // Lower edge of SiPM+Lightguide |
#define OFFSETX 15400 // Right edge of SiPM+Lightguide |
#define OFFSETY 6400 // Lower edge of SiPM+Lightguide |
#define RUNREC_ID 1 |
#define ENDREC_ID 2 |
103,7 → 103,7 |
//Chanel information |
double tdcOffset[NCH]; |
sprintf(fullname, "d2r.ini"); |
sprintf(fullname, "sipmScan.ini"); |
if( (fp=fopen(fullname, "rt")) == NULL ) |
printf("Cannot open pad centers file %s !!!\n", fullname); |
else { |
374,9 → 374,9 |
hnhitsx[channel]->Fill((pos.xset - OFFSETX) * MIKRO_BIN); |
hnhitsy[channel]->Fill((pos.yset - OFFSETY) * MIKRO_BIN); |
//h_threshold->Fill(channel, thr.threshold); |
if (position(pos.xset-OFFSETX, pos.yset-OFFSETY, channel)) { |
//if (position(pos.xset-OFFSETX, pos.yset-OFFSETY, channel)) { |
h2d[channel]->Fill((pos.xset - OFFSETX) * MIKRO_BIN, (pos.yset - OFFSETY) * MIKRO_BIN); |
} |
//} |
} |
//gV673A->Fill(data,channel); |
//gsumV673A[channel/16]->Fill(data); |