Rev 291 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 291 | Rev 299 | ||
---|---|---|---|
Line 144... | Line 144... | ||
144 | 144 | ||
145 | 145 | ||
146 | //histograms |
146 | //histograms |
147 | char hname[256], htitle[256]; |
147 | char hname[256], htitle[256]; |
148 | double adc,tdc; |
148 | double adc,tdc; |
149 | TH1F *hadc[NCH], *hadc_cut |
149 | TH1F *hadc[NCH], *hadc_cut[NCH]; |
150 | TH1F *htdc[NCH], *htdc_cut |
150 | TH1F *htdc[NCH], *htdc_cut[NCH], *hctdc[NCH]; |
151 | TH2F *h2d[NCH], *hcor[NCH]; |
- | |
152 | TH2F * |
151 | TH2F *hcor[NCH]; |
153 | TH2F *hdiffcor_low[NCH][NCH]; |
- | |
154 | TH2F *hdiffcor_hi[NCH][NCH]; |
- | |
155 | TH2F *hadccor; |
- | |
156 | TH2F *htdccor; |
- | |
157 | TH2F *hcoradctdc0, *hcoradctdc1, hcoradctdc01, hcoradctdc11; |
- | |
158 | TH1F *htesttdc1, *htesttdc2; |
- | |
159 | TTree *ftt; |
- | |
160 | - | ||
161 | TH1F *htdcdiff, * |
152 | TH1F *htdcdiff, *htdcdiff_cut; |
162 | 153 | ||
163 | double ref_cut_1_lo = qdcmi; |
154 | double ref_cut_1_lo = qdcmi; |
164 | double ref_cut_1_hi = qdcma; |
155 | double ref_cut_1_hi = qdcma; |
165 | double ref_cut_2_lo = tdcmi; |
156 | double ref_cut_2_lo = tdcmi; |
166 | double ref_cut_2_hi = tdcma; |
157 | double ref_cut_2_hi = tdcma; |
167 | - | ||
168 | //kobayashi |
- | |
169 | double t_adc0, t_tdc0, t_adc1, t_tdc1, t_ctdc; |
- | |
170 | 158 | ||
171 | //data buffer |
159 | //data buffer |
172 | char readbuf[READBUFFERLENGTH]; |
160 | char readbuf[READBUFFERLENGTH]; |
173 | runrec = (RUNREC *) readbuf; |
161 | runrec = (RUNREC *) readbuf; |
174 | endrec = (ENDREC *) readbuf; |
162 | endrec = (ENDREC *) readbuf; |
Line 265... | Line 253... | ||
265 | 253 | ||
266 | //~ break; |
254 | //~ break; |
267 | } |
255 | } |
268 | 256 | ||
269 | //create histograms |
257 | //create histograms |
270 | - | ||
271 | sprintf(hname, "htdcdiff"); |
- | |
272 | htdcdiff = (TH1F*)gROOT->FindObject(hname); |
- | |
273 | if(htdcdiff) delete htdcdiff; |
- | |
274 | htdcdiff = new TH1F(hname, hname, 4096, -2048.5*TDC_BIN, 2047.5*TDC_BIN); |
- | |
275 | //~ htdcdiff = new TH1F(hname, hname, 4096, -0.5*TDC_BIN, 4095.5*TDC_BIN); |
- | |
276 | - | ||
277 | sprintf(hname, "htdcdiff_cut"); |
- | |
278 | htdcdiff_cut = (TH1F*)gROOT->FindObject(hname); |
- | |
279 | if(htdcdiff_cut) delete htdcdiff_cut; |
- | |
280 | //~ htdcdiff_cut = new TH1F(hname, hname, 4096, -2048.5*TDC_BIN, 2047.5*TDC_BIN); |
- | |
281 | htdcdiff_cut = new TH1F(hname, hname, 4096, -2048.5*TDC_BIN, 2047.5*TDC_BIN); |
- | |
282 | //kobayashi |
- | |
283 | //~ htdcdiff_cut = new TH1F(hname, hname, 4096, -0.5*TDC_BIN, 4095.5*TDC_BIN); |
- | |
284 | - | ||
285 | sprintf(hname, "htdcdiff_cut_2"); |
- | |
286 | htdcdiff_cut_2 = (TH1F*)gROOT->FindObject(hname); |
- | |
287 | if(htdcdiff_cut_2) delete htdcdiff_cut_2; |
- | |
288 | htdcdiff_cut_2 = new TH1F(hname, hname, 4096, -2048.5*TDC_BIN, 2047.5*TDC_BIN); |
- | |
289 | //~ htdcdiff_cut_2 = new TH1F(hname, hname, 4096, -0.5*TDC_BIN, 4095.5*TDC_BIN); |
- | |
290 | - | ||
291 | sprintf(hname, "hadccor"); |
- | |
292 | hadccor = (TH2F*)gROOT->FindObject(hname); |
- | |
293 | if(hadccor) delete hadccor; |
- | |
294 | //~ hadccor = new TH2F(hname, hname, 256, 0, 4096, 256, 0, 4096); |
- | |
295 | hadccor = new TH2F(hname, hname, 256, 0, 4096, 256, -32768.5*TDC_BIN, 32767.5*TDC_BIN); |
- | |
296 | - | ||
297 | sprintf(hname, "htdccor"); |
- | |
298 | htdccor = (TH2F*)gROOT->FindObject(hname); |
- | |
299 | if(htdccor) delete hadccor; |
- | |
300 | //~ htdccor = new TH2F(hname, hname, 512, 0, 1024*TDC_BIN, 512, 0, 1024*TDC_BIN); |
- | |
301 | htdccor = new TH2F(hname, hname, 512, 1024*TDC_BIN, 2048*TDC_BIN, 512, 1024*TDC_BIN, 2048*TDC_BIN); |
- | |
302 | //~ htdccor = new TH2F(hname, hname, 512, 0, 2048*TDC_BIN, 512, 0, 2048*TDC_BIN); |
- | |
303 | //~ htdccor = new TH2F(hname, hname, 11*20+1, 15.985, 27.035, 3*40+1, 15.990,19.015); |
- | |
304 | //~ htdccor = new TH2F(hname, hname, 512, 0, 2047.5*TDC_BIN, 3*40+1, 15.990,19.015); |
- | |
305 | - | ||
306 | //kobayashi |
- | |
307 | sprintf(hname, "hcoradctdc0"); |
- | |
308 | hcoradctdc0 = (TH2F*)gROOT->FindObject(hname); |
- | |
309 | hcoradctdc0 = new TH2F(hname,hname,2000,0,2000,800,-10,10); |
- | |
310 | sprintf(hname, "hcoradctdc1"); |
- | |
311 | hcoradctdc1 = (TH2F*)gROOT->FindObject(hname); |
- | |
312 | hcoradctdc1 = new TH2F(hname,hname,2000,0,2000,800,-10,10); |
- | |
313 | ftt = (TTree*)gROOT->FindObject("ftt"); |
- | |
314 | if(ftt) delete ftt; |
- | |
315 | ftt = new TTree("ftt","ftt"); |
- | |
316 | ftt->Branch("t_adc0",&t_adc0,"t_adc0/D"); |
- | |
317 | ftt->Branch("t_adc1",&t_adc1,"t_adc1/D"); |
- | |
318 | ftt->Branch("t_tdc0",&t_tdc0,"t_tdc0/D"); |
- | |
319 | ftt->Branch("t_tdc1",&t_tdc1,"t_tdc1/D"); |
- | |
320 | ftt->Branch("t_ctdc",&t_ctdc,"t_ctdc/D"); |
- | |
321 | #ifdef testpulse |
- | |
322 | sprintf(hname, "htesttdc1"); |
- | |
323 | htesttdc1 = (TH1F*)gROOT->FindObject(hname); |
- | |
324 | if(htesttdc1) delete htesttdc1; |
- | |
325 | htesttdc1 = new TH1F(hname, hname, 65536, -0.5*TDC_BIN, 65535.5*TDC_BIN); |
- | |
326 | sprintf(hname, "htesttdc2"); |
- | |
327 | htesttdc2 = (TH1F*)gROOT->FindObject(hname); |
- | |
328 | if(htesttdc2) delete htesttdc2; |
- | |
329 | htesttdc2 = new TH1F(hname, hname, 65536, -0.5*TDC_BIN, 65535.5*TDC_BIN); |
- | |
330 | #endif |
- | |
331 | - | ||
332 |
|
258 | for(int i=0; i<ANALYSE_CH; i++) { |
333 | sprintf(hname, "hadc%d", i); |
259 | sprintf(hname, "hadc%d", i); |
334 | hadc[i] = (TH1F*)gROOT->FindObject(hname); |
260 | hadc[i] = (TH1F*)gROOT->FindObject(hname); |
335 | if(hadc[i]) delete hadc[i]; |
261 | if(hadc[i]) delete hadc[i]; |
336 | hadc[i] = new TH1F(hname, hname, 4096, -0.5, 4095.5); |
262 | hadc[i] = new TH1F(hname, hname, 4096, -0.5, 4095.5); |
337 | 263 | ||
338 | sprintf(hname, "hadc_cut%d", i); |
264 | sprintf(hname, "hadc_cut%d", i); |
339 | hadc_cut[i] = (TH1F*)gROOT->FindObject(hname); |
265 | hadc_cut[i] = (TH1F*)gROOT->FindObject(hname); |
340 | if(hadc_cut[i]) delete hadc_cut[i]; |
266 | if(hadc_cut[i]) delete hadc_cut[i]; |
341 | hadc_cut[i] = new TH1F(hname, hname, 4096, -0.5, 4095.5); |
267 | hadc_cut[i] = new TH1F(hname, hname, 4096, -0.5, 4095.5); |
342 | - | ||
343 | sprintf(hname, "hadc_cut_2%d", i); |
- | |
344 | hadc_cut_2[i] = (TH1F*)gROOT->FindObject(hname); |
- | |
345 | if(hadc_cut_2[i]) delete hadc_cut_2[i]; |
- | |
346 | hadc_cut_2[i] = new TH1F(hname, hname, 4096, -0.5, 4095.5); |
- | |
347 | 268 | ||
348 | sprintf(hname, "htdc%d", i); |
269 | sprintf(hname, "htdc%d", i); |
349 | htdc[i] = (TH1F*)gROOT->FindObject(hname); |
270 | htdc[i] = (TH1F*)gROOT->FindObject(hname); |
350 | if(htdc[i]) delete htdc[i]; |
271 | if(htdc[i]) delete htdc[i]; |
351 | //~ htdc[i] = new TH1F(hname, hname, 4096, -2048.5*TDC_BIN, 2047.5*TDC_BIN); |
- | |
352 | //~ htdc[i] = new TH1F(hname, hname, 4096, -0.5*TDC_BIN, 4095.5*TDC_BIN); //original |
- | |
353 | //~ htdc[i] = new TH1F(hname, hname, 65536/2, -0.5*TDC_BIN, 65535.5*TDC_BIN); //koba |
- | |
354 | //~ htdc[i] = new TH1F(hname, hname, 65536/2, -32768.5*TDC_BIN, 32767.5*TDC_BIN); //koba |
- | |
355 | htdc[i] = new TH1F(hname, hname, 65536, -32768.5*TDC_BIN, 32767.5*TDC_BIN); |
272 | htdc[i] = new TH1F(hname, hname, 65536, -32768.5*TDC_BIN, 32767.5*TDC_BIN); |
356 | //~ htdc[i] = new TH1F(hname, hname, 65536, -0.5*TDC_BIN, 65535.5*TDC_BIN); |
273 | //~ htdc[i] = new TH1F(hname, hname, 65536, -0.5*TDC_BIN, 65535.5*TDC_BIN); |
357 | 274 | ||
358 | sprintf(hname, "htdc_cut%d", i); |
275 | sprintf(hname, "htdc_cut%d", i); |
359 | htdc_cut[i] = (TH1F*)gROOT->FindObject(hname); |
276 | htdc_cut[i] = (TH1F*)gROOT->FindObject(hname); |
360 | if(htdc_cut[i]) delete htdc_cut[i]; |
277 | if(htdc_cut[i]) delete htdc_cut[i]; |
361 | //~ htdc_cut[i] = new TH1F(hname, hname, 4096, -2048.5*TDC_BIN, 2047.5*TDC_BIN); |
- | |
362 | //~ htdc_cut[i] = new TH1F(hname, hname, 4096, -0.5*TDC_BIN, 4095.5*TDC_BIN);//original |
- | |
363 | //~ htdc_cut[i] = new TH1F(hname, hname, 65536/2, -0.5*TDC_BIN, 65535.5*TDC_BIN); //koba |
- | |
364 | htdc_cut[i] = new TH1F(hname, hname, 65536/2, -32768.5*TDC_BIN, 32767.5*TDC_BIN); //koba |
- | |
365 |
|
278 | htdc_cut[i] = new TH1F(hname, hname, 65536, -32768.5*TDC_BIN, 32767.5*TDC_BIN); |
366 | - | ||
367 | sprintf(hname, "htdc_cut_2%d", i); |
- | |
368 | htdc_cut_2[i] = (TH1F*)gROOT->FindObject(hname); |
- | |
369 | if(htdc_cut_2[i]) delete htdc_cut_2[i]; |
- | |
370 | //~ htdc_cut_2[i] = new TH1F(hname, hname, 4096, -2048.5*TDC_BIN, 2047.5*TDC_BIN); |
- | |
371 | //~ htdc_cut_2[i] = new TH1F(hname, hname, 4096, -0.5*TDC_BIN, 4095.5*TDC_BIN);//original |
- | |
372 |
|
279 | //~ htdc_cut[i] = new TH1F(hname, hname, 65536, -0.5*TDC_BIN, 65535.5*TDC_BIN); |
373 | 280 | ||
374 | sprintf(hname, "hctdc%d", i); |
281 | sprintf(hname, "hctdc%d", i); |
375 | hctdc[i] = (TH1F*)gROOT->FindObject(hname); |
282 | hctdc[i] = (TH1F*)gROOT->FindObject(hname); |
376 | if(hctdc[i]) delete hctdc[i]; |
283 | if(hctdc[i]) delete hctdc[i]; |
377 | //~ hctdc[i] = new TH1F(hname, hname, 4096, -2048.5*TDC_BIN, 2047.5*TDC_BIN); |
- | |
378 | //~ hctdc[i] = new TH1F(hname, hname, 65536/2, -32768.5*TDC_BIN, 32767.5*TDC_BIN); |
- | |
379 | hctdc[i] = new TH1F(hname, hname, 65536, -32768.5*TDC_BIN, 32767.5*TDC_BIN); |
284 | hctdc[i] = new TH1F(hname, hname, 65536, -32768.5*TDC_BIN, 32767.5*TDC_BIN); |
380 | - | ||
381 | sprintf(hname, "h2d%d", i); |
- | |
382 | h2d[i] = (TH2F*)gROOT->FindObject(hname); |
- | |
383 | if(h2d[i]) delete h2d[i]; |
- | |
384 |
|
285 | //~ hctdc[i] = new TH1F(hname, hname, 65536, -0.5*TDC_BIN, 65535.5*TDC_BIN); |
385 | run.ny, (run.y0-0.5*run.dy)*MIKRO_BIN, (run.y0+(run.ny-0.5)*run.dy)*MIKRO_BIN); |
- | |
386 | 286 | ||
387 | sprintf(hname, "hcor%d", i); |
287 | sprintf(hname, "hcor%d", i); |
388 | hcor[i] = (TH2F*)gROOT->FindObject(hname); |
288 | hcor[i] = (TH2F*)gROOT->FindObject(hname); |
389 | if(hcor[i]) delete hcor[i]; |
289 | if(hcor[i]) delete hcor[i]; |
390 | //~ hcor[i] = new TH2F(hname, hname, |
290 | //~ hcor[i] = new TH2F(hname, hname, 512, 0-0.5, 1024-0.5, 160, -1.5-(TDC_BIN/2), 2.5-(TDC_BIN/2)); |
391 |
|
291 | hcor[i] = new TH2F(hname, hname, 512, 0-0.5, 4096-0.5, (100/TDC_BIN)/8, -50-(TDC_BIN/2), 50-(TDC_BIN/2)); |
392 | //~ hcor[i] = new TH2F(hname, hname, |
292 | //~ hcor[i] = new TH2F(hname, hname, 512, 0-0.5, 4096-0.5, 256, -32768.5*TDC_BIN, 32767.5*TDC_BIN); |
393 | hcor |
293 | //~ hcor[i] = new TH2F(hname, hname, 512, 0-0.5, 4096-0.5, 256, -0.5*TDC_BIN, 65535.5*TDC_BIN); |
394 | - | ||
395 | - | ||
396 | for(int j=0; j<ANALYSE_CH; j++) { |
- | |
397 | sprintf(hname, "hdiffcor_%d_%d",i,j); |
- | |
398 | sprintf(htitle, "ch.%d - ch.%d",i,j); |
- | |
399 | hdiffcor[i][j] = (TH2F*)gROOT->FindObject(hname); |
- | |
400 | if(hdiffcor[i][j]) delete hdiffcor[i][j]; |
- | |
401 | hdiffcor[i][j] = new TH2F(hname, htitle, 256, 0-0.5, 1024-0.5, 128, -6.4-(TDC_BIN/2), 6.4-(TDC_BIN/2)); |
- | |
402 | - | ||
403 | sprintf(hname, "hdiffcor_low_%d_%d",i,j); |
- | |
404 | sprintf(htitle, "ch.%d - ch.%d",i,j); |
- | |
405 | hdiffcor_low[i][j] = (TH2F*)gROOT->FindObject(hname); |
- | |
406 | if(hdiffcor_low[i][j]) delete hdiffcor_low[i][j]; |
- | |
407 | hdiffcor_low[i][j] = new TH2F(hname, htitle, 256, 0-0.5, 512-0.5, 128, -6.4-(TDC_BIN/2), 6.4-(TDC_BIN/2)); |
- | |
408 | - | ||
409 | sprintf(hname, "hdiffcor_hi_%d_%d",i,j); |
- | |
410 | sprintf(htitle, "ch.%d - ch.%d",i,j); |
- | |
411 | hdiffcor_hi[i][j] = (TH2F*)gROOT->FindObject(hname); |
- | |
412 | if(hdiffcor_hi[i][j]) delete hdiffcor_hi[i][j]; |
- | |
413 | hdiffcor_hi[i][j] = new TH2F(hname, htitle, 256, 0-0.5, 2048-0.5, 128, -6.4-(TDC_BIN/2), 6.4-(TDC_BIN/2)); |
- | |
414 | } |
- | |
415 | } |
294 | } |
- | 295 | ||
- | 296 | sprintf(hname, "htdcdiff"); |
|
- | 297 | htdcdiff = (TH1F*)gROOT->FindObject(hname); |
|
- | 298 | if(htdcdiff) delete htdcdiff; |
|
- | 299 | htdcdiff = new TH1F(hname, hname, 4096, -2048.5*TDC_BIN, 2047.5*TDC_BIN); |
|
- | 300 | ||
- | 301 | sprintf(hname, "htdcdiff_cut"); |
|
- | 302 | htdcdiff_cut = (TH1F*)gROOT->FindObject(hname); |
|
- | 303 | if(htdcdiff_cut) delete htdcdiff_cut; |
|
- | 304 | htdcdiff_cut = new TH1F(hname, hname, 4096, -2048.5*TDC_BIN, 2047.5*TDC_BIN); |
|
- | 305 | ||
416 | 306 | ||
417 | break; |
307 | break; |
418 | 308 | ||
419 | case POSREC_ID: |
309 | case POSREC_ID: |
420 | #ifdef USE_ZLIB |
310 | #ifdef USE_ZLIB |
421 | gzread(dfp, (voidp)&readbuf[2*ulsize], (rec_len-2*ulsize)); |
311 | gzread(dfp, (voidp)&readbuf[2*ulsize], (rec_len-2*ulsize)); |
422 | #else |
312 | #else |
Line 431... | Line 321... | ||
431 | printf("ix = %d, x = %d, xset = %d\n", posrec->ix, posrec->x, posrec->xset); |
321 | printf("ix = %d, x = %d, xset = %d\n", posrec->ix, posrec->x, posrec->xset); |
432 | printf("iy = %d, y = %d, yset = %d\n", posrec->iy, posrec->y, posrec->yset); |
322 | printf("iy = %d, y = %d, yset = %d\n", posrec->iy, posrec->y, posrec->yset); |
433 | } else printf(" [%d,%d] %d, %d\n", pos.ix, pos.iy, pos.xset, pos.yset); |
323 | } else printf(" [%d,%d] %d, %d\n", pos.ix, pos.iy, pos.xset, pos.yset); |
434 | 324 | ||
435 | break; |
325 | break; |
436 | 326 | ||
437 | case EVTREC_ID: |
327 | case EVTREC_ID: |
438 | #ifdef USE_ZLIB |
328 | #ifdef USE_ZLIB |
439 | gzread(dfp, (voidp)&readbuf[2*ulsize], (rec_len-2*ulsize)); |
329 | gzread(dfp, (voidp)&readbuf[2*ulsize], (rec_len-2*ulsize)); |
440 | #else |
330 | #else |
441 | fread( (void*)&readbuf[2*ulsize], (rec_len-2*ulsize), 1, dfp); |
331 | fread( (void*)&readbuf[2*ulsize], (rec_len-2*ulsize), 1, dfp); |
Line 465... | Line 355... | ||
465 | tdc_noise_cut = 5.0; |
355 | tdc_noise_cut = 5.0; |
466 | //~ adc_cor_min = 200.0; |
356 | //~ adc_cor_min = 200.0; |
467 | 357 | ||
468 | for(int i=0; i<ANALYSE_CH; i++) { |
358 | for(int i=0; i<ANALYSE_CH; i++) { |
469 | tdc=((double)evtrec->data[i])*TDC_BIN + tdcoffset[i]; |
359 | tdc=((double)evtrec->data[i])*TDC_BIN + tdcoffset[i]; |
470 | //~ tdc=((double)evtrec->data[i])*TDC_BIN; |
- | |
471 | 360 | ||
472 | adc=(double)evtrec->data[i+NCH]; |
361 | adc=(double)evtrec->data[i+NCH]; |
473 | //~ if(i==15) printf("aaaaaaaaaaa15 norma %f\n",tdc); |
- | |
474 | tdca[i]=tdc; |
362 | tdca[i]=tdc; |
475 | adca[i]=adc; |
363 | adca[i]=adc; |
476 | - | ||
477 | //~ if(ceve < 100) { |
- | |
478 | //~ printf("[%3d] tdc[%2d] = %lf | adc[%2d] = %lf\n", ceve, i, tdc, i, adc); |
- | |
479 | //~ } |
- | |
480 | } |
364 | } |
481 | for(int i=0; i<ANALYSE_CH; i++) { |
365 | for(int i=0; i<ANALYSE_CH; i++) { |
- | 366 | //~ if(0 < adca[i]) |
|
482 |
|
367 | hadc[i]->Fill(adca[i]); |
483 | //~ if( (qdcmi < adca[i]) && (adca[i] < qdcma) ) |
368 | //~ if( (qdcmi < adca[i]) && (adca[i] < qdcma) ) |
484 |
|
369 | //~ if(0 < tdca[i]) htdc[i]->Fill(tdca[i]-tdca[TRIGGER_CH]); |
485 | //~ if(0 < tdca[i]) |
370 | //~ if(0 < tdca[i]) |
- | 371 | htdc[i]->Fill(tdca[i]-tdca[TRIGGER_CH]); |
|
- | 372 | //~ hcor[i]->Fill(adca[i],tdca[i]); |
|
486 | hcor[i]->Fill(adca[i],tdca[i]-tdca[TRIGGER_CH]); |
373 | hcor[i]->Fill(adca[i],tdca[i]-tdca[TRIGGER_CH]); |
487 | 374 | ||
488 | if(adca[i] > corpar[i][2]) { |
375 | if(adca[i] > corpar[i][2]) { |
489 | ctdca[i] = tdca[i]-tdca[TRIGGER_CH] - (corpar[i][0] + corpar[i][1]/TMath::Sqrt(adca[i] - corpar[i][2])); |
376 | ctdca[i] = tdca[i]-tdca[TRIGGER_CH] - (corpar[i][0] + corpar[i][1]/TMath::Sqrt(adca[i] - corpar[i][2])); |
490 | } else { |
377 | } else { |
491 | ctdca[i] = -999.9*(i+1); |
378 | ctdca[i] = -999.9*(i+1); |
492 | } |
379 | } |
493 | //~ if(tdc_noise_cut < tdca[i]) |
380 | //~ if(tdc_noise_cut < tdca[i]) |
494 |
|
381 | //~ double adc_max_cut = 1000; |
495 |
|
382 | //~ if(adca[i] < adc_max_cut) |
496 | hctdc[i]->Fill( ctdca[i] ); |
383 | hctdc[i]->Fill( ctdca[i] ); |
497 | 384 | ||
498 | //~ if(dbg && (i<4) && (1 < tdca[0] && (1 < tdca[1]))) printf("tdca[%d] = %lf | tdca[TRG] = %lf | ctdca[i] = %lf | adca[i] = %lf\n", i, tdca[i],tdca[TRIGGER_CH],ctdca[i],adca[i]); |
385 | //~ if(dbg && (i<4) && (1 < tdca[0] && (1 < tdca[1]))) printf("tdca[%d] = %lf | tdca[TRG] = %lf | ctdca[i] = %lf | adca[i] = %lf\n", i, tdca[i],tdca[TRIGGER_CH],ctdca[i],adca[i]); |
499 | if(dbg && (i<4) ) printf("[%4d] tdca[%d] = %lf | tdca[TRG] = %lf | ctdca[i] = %lf | adca[i] = %lf\n", ceve, i, tdca[i],tdca[TRIGGER_CH],ctdca[i],adca[i]); |
386 | if(dbg && (i<4) ) printf("[%4d] tdca[%d] = %lf | tdca[TRG] = %lf | ctdca[i] = %lf | adca[i] = %lf\n", ceve, i, tdca[i],tdca[TRIGGER_CH],ctdca[i],adca[i]); |
500 | - | ||
501 | if( (qdcmi < adca[i]) && (adca[i] < qdcma) && (tdcmi < tdca[i]) && (tdca[i] < tdcma)) { |
- | |
502 | h2d[i]->Fill(pos.xset*MIKRO_BIN, pos.yset*MIKRO_BIN); |
- | |
503 | } |
- | |
504 | } |
387 | } |
505 | 388 | ||
506 | //~ printf("aaaaaaaaaaa15 %f\n",((double)evtrec->data[15])); printf("aaaaaaaaaaa15 %f\n",((double)evtrec->data[15])*TDC_BIN); |
- | |
507 | //~ printf("aaaaaaaaaaa30 %d\n",evtrec->data[30]); |
- | |
508 | //~ printf("aaaaaaaaaaa31 %d\n",evtrec->data[31]); |
- | |
509 | //~ printf("aaaaaaaaaaa15 %f\n",tdca[15]); |
- | |
510 | //~ printf("aaaaaaaaaaa30 %d\n",tdca[30]); |
- | |
511 | //~ printf("aaaaaaaaaaa31 %d\n",tdca[31]); |
- | |
512 | //~ |
- | |
513 | //kobayashi |
- | |
514 | ctdcdiff = ctdca[MPPC_2_CH] - ctdca[MPPC_1_CH] +deltaT_ctdcdiff; |
- | |
515 | tdcdiff = tdca[MPPC_2_CH] - tdca[MPPC_1_CH]; |
- | |
516 | t_ctdc = ctdcdiff; |
- | |
517 | t_tdc0=tdca[0]; |
- | |
518 | t_tdc1=tdca[1]; |
- | |
519 | t_adc0=adca[15]; |
- | |
520 | t_adc1=adca[1]; |
- | |
521 | - | ||
522 | hcoradctdc0->Fill(adca[0],ctdcdiff); |
- | |
523 | hcoradctdc1->Fill(adca[1],ctdcdiff); |
- | |
524 | ftt->Fill(); |
- | |
525 | #ifdef testpulse |
- | |
526 | htesttdc1->Fill(tdca[16]-tdca[14]); |
- | |
527 | htesttdc2->Fill(tdca[14]-tdca[15]); |
- | |
528 | #endif |
- | |
529 | 389 | ||
530 | //cut za timing: |
390 | //cut za timing: |
531 | #define CUT_1_CONDITION ( (qdcmi < adca[MPPC_1_CH]) && (adca[MPPC_1_CH] < qdcma) && (tdcmi < adca[MPPC_2_CH]) && (adca[MPPC_2_CH] < tdcma) ) |
391 | #define CUT_1_CONDITION ( (qdcmi < adca[MPPC_1_CH]) && (adca[MPPC_1_CH] < qdcma) && (tdcmi < adca[MPPC_2_CH]) && (adca[MPPC_2_CH] < tdcma) ) |
532 | //~ // cut za meritev efficiency: |
392 | //~ // cut za meritev efficiency: |
533 | //~ #define CUT_1_CONDITION ( (qdcmi < adca[MPPC_1_CH]) && (adca[MPPC_1_CH] < qdcma) ) |
393 | //~ #define CUT_1_CONDITION ( (qdcmi < adca[MPPC_1_CH]) && (adca[MPPC_1_CH] < qdcma) ) |
Line 555... | Line 415... | ||
555 | 415 | ||
556 | if( CUT_1_CONDITION ) { |
416 | if( CUT_1_CONDITION ) { |
557 | htdcdiff_cut->Fill(ctdcdiff); |
417 | htdcdiff_cut->Fill(ctdcdiff); |
558 | //~ htdcdiff_cut->Fill(tdcdiff); |
418 | //~ htdcdiff_cut->Fill(tdcdiff); |
559 | } |
419 | } |
560 | if( CUT_2_CONDITION ) { |
- | |
561 | htdcdiff_cut_2->Fill(ctdcdiff); |
- | |
562 | } |
- | |
563 | } |
420 | } |
564 | 421 | ||
565 | for(int i=0; i<ANALYSE_CH; i++) { |
422 | for(int i=0; i<ANALYSE_CH; i++) { |
566 | 423 | ||
567 | //~ if( CUT_1_CONDITION ) { |
424 | //~ if( CUT_1_CONDITION ) { |
568 | //~ if( ( (qdcmi < adca[REF_CH]) && (adca[REF_CH] < qdcma) ) ) { |
425 | //~ if( ( (qdcmi < adca[REF_CH]) && (adca[REF_CH] < qdcma) ) ) { |
569 | //~ if( ( (-2 < ctdca[0]) && (ctdca[0] < 2) ) ) { |
426 | //~ if( ( (-2 < ctdca[0]) && (ctdca[0] < 2) ) ) { |
570 | //~ htdc_cut[i]->Fill(tdca[i]-tdca[31]); |
427 | //~ htdc_cut[i]->Fill(tdca[i]-tdca[31]); |
571 | //~ htdc_cut[i]->Fill(ctdca[i]); |
428 | //~ htdc_cut[i]->Fill(ctdca[i]); |
572 | //~ hadc_cut[i]->Fill(adca[i]); |
429 | //~ hadc_cut[i]->Fill(adca[i]); |
573 | //~ } |
430 | //~ } |
574 | if( (qdcmi < adca[i]) && (adca[i] < qdcma) && (adca[i] > corpar[i][2]) ) |
431 | if( (qdcmi < adca[i]) && (adca[i] < qdcma) && (adca[i] > corpar[i][2]) ) |
575 | htdc_cut[i]->Fill(ctdca[i]); |
432 | htdc_cut[i]->Fill(ctdca[i]); |
576 | if( (tdcmi < ctdca[i]) && (ctdca[i] < tdcma) ) |
433 | if( (tdcmi < ctdca[i]) && (ctdca[i] < tdcma) ) |
577 | hadc_cut[i]->Fill(adca[i]); |
434 | hadc_cut[i]->Fill(adca[i]); |
578 | - | ||
579 | if( CUT_2_CONDITION ) { |
- | |
580 | htdc_cut_2[i]->Fill(tdca[i]); |
- | |
581 | hadc_cut_2[i]->Fill(adca[i]); |
- | |
582 | hadc_cut_2[i]->Fill(adca[i]); |
- | |
583 | } |
- | |
584 | } |
- | |
585 | - | ||
586 | //~ hadccor->Fill(adca[REF_CH], adca[MPPC_1_CH]); |
- | |
587 | hadccor->Fill(adca[REF_CH], tdca[8]-tdca[31]); |
- | |
588 | - | ||
589 | htdccor->Fill(tdca[MPPC_1_CH], tdca[MPPC_2_CH]); |
- | |
590 | - | ||
591 | - | ||
592 | // --------------- corelation plots for time-walk correction --------------- |
- | |
593 | - | ||
594 | if( (tdc_noise_cut<tdca[MPPC_1_CH]) && (tdc_noise_cut<tdca[MPPC_2_CH]) && (adc_cor_min<adca[MPPC_2_CH]) ) { |
- | |
595 | hdiffcor[MPPC_1_CH][MPPC_2_CH]->Fill(adca[MPPC_1_CH],tdca[MPPC_1_CH]-ctdca[MPPC_2_CH]); |
- | |
596 | - | ||
597 | hdiffcor_low[MPPC_1_CH][MPPC_2_CH]->Fill(adca[MPPC_1_CH],tdca[MPPC_1_CH]-ctdca[MPPC_2_CH]); |
- | |
598 | hdiffcor_hi[MPPC_1_CH][MPPC_2_CH]->Fill(adca[MPPC_1_CH],tdca[MPPC_1_CH]-ctdca[MPPC_2_CH]); |
- | |
599 | } |
- | |
600 | - | ||
601 | if( (tdc_noise_cut<tdca[MPPC_2_CH]) && (tdc_noise_cut<tdca[MPPC_1_CH]) && (adc_cor_min<adca[MPPC_1_CH]) ) { |
- | |
602 | hdiffcor[MPPC_2_CH][MPPC_1_CH]->Fill(adca[MPPC_2_CH],tdca[MPPC_2_CH]-ctdca[MPPC_1_CH]); |
- | |
603 | - | ||
604 | hdiffcor_low[MPPC_2_CH][MPPC_1_CH]->Fill(adca[MPPC_2_CH],tdca[MPPC_2_CH]-ctdca[MPPC_1_CH]); |
- | |
605 | hdiffcor_hi[MPPC_2_CH][MPPC_1_CH]->Fill(adca[MPPC_2_CH],tdca[MPPC_2_CH]-ctdca[MPPC_1_CH]); |
- | |
606 | } |
435 | } |
607 | 436 | ||
608 | // events ------------------------------------------------------------------------------------------ |
437 | // events ------------------------------------------------------------------------------------------ |
609 | 438 | ||
610 | break; |
439 | break; |
Line 671... | Line 500... | ||
671 | if(dfp) fclose(dfp); |
500 | if(dfp) fclose(dfp); |
672 | #endif |
501 | #endif |
673 | 502 | ||
674 | if(dbg) return 1; |
503 | if(dbg) return 1; |
675 | if(rootfile) { |
504 | if(rootfile) { |
676 | #ifdef testpulse |
- | |
677 | printf("<<< EASIROC Disc : %f [ps]\n", htesttdc1->GetRMS()*1000); |
- | |
678 | printf("<<< TEST Disc : %f [ps]\n", htesttdc2->GetRMS()*1000); |
- | |
679 | #endif |
- | |
680 | ftt->Write(); |
- | |
681 | rootfile->Write(); |
505 | rootfile->Write(); |
682 | //cout<<"maximum x value = " << htdcdiff->GetXaxis()->GetBinCenter( htdcdiff->GetMaximumBin()) <<endl; |
506 | //cout<<"maximum x value = " << htdcdiff->GetXaxis()->GetBinCenter( htdcdiff->GetMaximumBin()) <<endl; |
683 | printf("Saved to %s\n", fnameroot); |
507 | printf("Saved to %s\n", fnameroot); |
684 | rootfile->Close(); |
508 | rootfile->Close(); |
685 | } |
509 | } |