Rev 37 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 37 | Rev 40 | ||
---|---|---|---|
Line 91... | Line 91... | ||
91 | 91 | ||
92 | // ------------------------------------------------------------------------------ |
92 | // ------------------------------------------------------------------------------ |
93 | 93 | ||
94 | int analysisThreshold(char* dfile0="test", int dbg=0, double tdcCut=5.0) |
94 | int analysisThreshold(char* dfile0="test", int dbg=0, double tdcCut=5.0) |
95 | { |
95 | { |
96 | const double c_tdcOffset = |
96 | const double c_tdcOffset = 368*TDC_BIN; // ns |
97 | 97 | ||
98 | printf(" Data to root conversion program\nUsage:\nd2r(input file name <without.dat>, debug on/off, TDC cut +-[ns])\n\n"); |
98 | printf(" Data to root conversion program\nUsage:\nd2r(input file name <without.dat>, debug on/off, TDC cut +-[ns])\n\n"); |
99 | 99 | ||
100 | char fullname[256]; |
100 | char fullname[256]; |
101 | char sbuff[256]; |
101 | char sbuff[256]; |
Line 228... | Line 228... | ||
228 | //if (htdc) delete htdc; |
228 | //if (htdc) delete htdc; |
229 | //htdc = new TH2F("htdc",";TDC channel;SiPM channel",512,0,512,NCH,0,NCH); |
229 | //htdc = new TH2F("htdc",";TDC channel;SiPM channel",512,0,512,NCH,0,NCH); |
230 | h_correctedTDC = (TH3F*) gROOT->FindObject("h_correctedTDC"); |
230 | h_correctedTDC = (TH3F*) gROOT->FindObject("h_correctedTDC"); |
231 | if (h_correctedTDC) delete h_correctedTDC; |
231 | if (h_correctedTDC) delete h_correctedTDC; |
232 | nSteps = (run.thUp - run.thLow)/double(run.thStep) + 1; |
232 | nSteps = (run.thUp - run.thLow)/double(run.thStep) + 1; |
233 | if (dbg) printf("nSteps |
233 | if (dbg) printf("nSteps %f\n", nSteps); |
234 | h_correctedTDC = new TH3F("h_correctedTDC",";SiPM channel; ASD threshold [V]; t [ns]", |
234 | h_correctedTDC = new TH3F("h_correctedTDC",";SiPM channel; ASD threshold [V]; t [ns]", |
235 | NCH, |
235 | NCH, |
236 | -0.5, |
236 | -0.5, |
237 | NCH-0.5, |
237 | NCH-0.5, |
238 | nSteps, |
238 | nSteps, |
239 | (run.thLow - 0.5*run.thStep)/1000.0, |
239 | (run.thLow - 0.5*run.thStep)/1000.0, |
240 | (run.thUp + 0.5*run.thStep)/1000.0, |
240 | (run.thUp + 0.5*run.thStep)/1000.0, |
241 | 2*tdcCut |
241 | 2*tdcCut+1, |
242 | - |
242 | (-tdcCut - 0.5)*TDC_BIN, |
243 | tdcCut*TDC_BIN); |
243 | (tdcCut + 0.5)*TDC_BIN); |
244 | //TH1F* gsumV673A[NCH/16] = new TH1F(hn,hname,256,-0.5,255.5); |
244 | //TH1F* gsumV673A[NCH/16] = new TH1F(hn,hname,256,-0.5,255.5); |
245 | for(int i=0; i<NCH; i++) { |
245 | for(int i=0; i<NCH; i++) { |
246 | /* |
246 | /* |
247 | sprintf(hname, "htdcpos%d", i); |
247 | sprintf(hname, "htdcpos%d", i); |
248 | htdcpos[i] = (TH1F*)gROOT->FindObject(hname); |
248 | htdcpos[i] = (TH1F*)gROOT->FindObject(hname); |