Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 39 → Rev 40

/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;
}