6 nCellX_(ncellx),nCellY_(ncelly),cellW_(cellw),cellH_(cellh),pitchX_(pitchx),pitchY_(pitchy),fToFResolution_(res),detPosition_(pos) {
12 double x1 = 0.,
x2 = 0.;
34 cellRow_.push_back(std::pair<double,double>(y1,y2));
41 cellColumn_.push_back(std::pair<double,double>(x1,x2));
46 if (cellid==0)
return;
48 std::vector<double>* tofs = &(
theToFInfo.find(cellid)->second);
49 int ntof = tofs->size();
52 if (fabs(tofs->at(i)-tof)*oneOverRes<3) {
53 tofs->at(i)=(tofs->at(i)+tof)/2.;
54 nADC_.at(cellid).at(i)++;
60 nADC_[cellid].push_back(1);
67 unsigned int start_idx=0;
68 unsigned int end_idx=
cellRow_.size();
75 for(i=start_idx;i<end_idx;i++) {
78 if (i>=end_idx)
return 0;
80 return 100*y_idx+x_idx;
84 if (cell_id==0)
return false;
86 unsigned int y_idx=
int(cell_id*0.01);
87 unsigned int x_idx=cell_id-y_idx*100;
bool get_CellCenter(int cell_id, double &x, double &y)
int findCellId(double x, double y)
void AddHit(double x, double y, double tof)
std::vector< std::pair< double, double > > cellRow_
CTPPSToFDetector(int ncellx, int ncelly, std::vector< double > &cellw, double cellh, double pitchx, double pitchy, double pos, int res)
std::vector< double > cellW_
std::map< int, std::vector< int > > nADC_
std::vector< std::pair< double, double > > cellColumn_
std::map< int, std::vector< double > > theToFInfo