Subversion Repositories f9daq

Rev

Rev 35 | Rev 40 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 35 Rev 37
Line 89... Line 89...
89
 
89
 
90
int position(int, int, int);
90
int position(int, int, int);
91
 
91
 
92
// ------------------------------------------------------------------------------
92
// ------------------------------------------------------------------------------
93
 
93
 
94
int d2r(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 = 1; // ns
96
  const double c_tdcOffset = 1; // 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
 
Line 367... Line 367...
367
                  if (dbg) printf("ch: %d tdc: %d\n", channel, data);
367
                  if (dbg) printf("ch: %d tdc: %d\n", channel, data);
368
                  if (dbg) nt->Fill(channel, pos.ix, pos.iy, data);
368
                  if (dbg) nt->Fill(channel, pos.ix, pos.iy, data);
369
                  double tdcmin = tdcOffset[channel] - tdcCut;
369
                  double tdcmin = tdcOffset[channel] - tdcCut;
370
                  double tdcmax = tdcOffset[channel] + tdcCut;
370
                  double tdcmax = tdcOffset[channel] + tdcCut;
371
                  double time = data*TDC_BIN - tdcOffset[channel];
371
                  double time = data*TDC_BIN - tdcOffset[channel];
372
                  if(time >= -tdcCut and time <= tdcCut) {
372
                  if((time >= -tdcCut) && (time <= tdcCut)) {
373
                    h_correctedTDC->Fill(channel, thr.threshold/1000.0, time);
373
                    h_correctedTDC->Fill(channel, thr.threshold/1000.0, time);
374
                    hnhitsx[channel]->Fill((pos.xset - OFFSETX) * MIKRO_BIN);
374
                    hnhitsx[channel]->Fill((pos.xset - OFFSETX) * MIKRO_BIN);
375
                    hnhitsy[channel]->Fill((pos.yset - OFFSETY) * MIKRO_BIN);
375
                    hnhitsy[channel]->Fill((pos.yset - OFFSETY) * MIKRO_BIN);
376
                    h2d[channel]->Fill((pos.xset - OFFSETX) * MIKRO_BIN, (pos.yset - OFFSETY) * MIKRO_BIN);
376
                    h2d[channel]->Fill((pos.xset - OFFSETX) * MIKRO_BIN, (pos.yset - OFFSETY) * MIKRO_BIN);
377
 
377
 
Line 464... Line 464...
464
}
464
}
465
 
465
 
466
int position(int x, int y, int channel)
466
int position(int x, int y, int channel)
467
{
467
{
468
  int flag = 0;
468
  int flag = 0;
469
  if ( (x > (padCenter[channel][0] - 5000)) and (x < (padCenter[channel][0] + 5000)) and
469
  if ( (x > (padCenter[channel][0] - 5000)) && (x < (padCenter[channel][0] + 5000)) &&
470
      (y > (padCenter[channel][1] - 5000)) and (y < (padCenter[channel][1] + 5000)) ) flag = 1;
470
      (y > (padCenter[channel][1] - 5000)) && (y < (padCenter[channel][1] + 5000)) ) flag = 1;
471
  return flag;
471
  return flag;
472
}
472
}