12 const char *calibrationroot = getenv(
"CALIBRATIONROOT");
16 full_path =
std::string(calibrationroot) +
"/TPC/Mapping/PadPlane/";
29 std::cout <<
"reading " << full_path_r1 <<
" failed" << std::endl;
34 std::cout <<
"reading " << full_path_r2 <<
" failed" << std::endl;
39 std::cout <<
"reading " << full_path_r3 <<
" failed" << std::endl;
47 if (!infile.is_open())
49 std::cout <<
"Could not open file: "<< fileName << std::endl;
55 getline(infile, line);
58 int abs_pad = INT_MAX;
69 int FEE_Chan = INT_MAX;
78 while (getline(infile, line))
81 std::stringstream ss(line);
107 getline(ss, next,
',');
110 abs_pad = std::stoul(next);
114 Radius = stoul(next);
120 else if (index == 11)
122 FEE_Chan = stoul(next);
124 else if (index == 17)
128 else if (index == 18)
135 if (section_offset == 1)
139 if (section_offset == 2)
148 x.
layer = Radius + section_offset * 16 + 7;
154 unsigned int key = 256 * (FEE) + FEE_Chan;
161 unsigned int TPCMap::getLayer(
const unsigned int FEE,
const unsigned int FEEChannel,
const unsigned int )
const
163 if (FEE >= 26 || FEEChannel > 255)
167 unsigned int key = 256 * FEE + FEEChannel;
169 std::map<unsigned int, struct tpc_map>::const_iterator itr =
tmap.find(key);
170 if (itr ==
tmap.end())
174 return itr->second.layer;
177 unsigned int TPCMap::getPad(
const unsigned int FEE,
const unsigned int FEEChannel,
const unsigned int )
const
179 if (FEE >= 26 || FEEChannel > 255)
183 unsigned int key = 256 * FEE + FEEChannel;
185 std::map<unsigned int, struct tpc_map>::const_iterator itr =
tmap.find(key);
186 if (itr ==
tmap.end())
190 return itr->second.padnr;
193 double TPCMap::getR(
const unsigned int FEE,
const unsigned int FEEChannel,
const unsigned int )
const
195 if (FEE >= 26 || FEEChannel > 255)
199 unsigned int key = 256 * FEE + FEEChannel;
201 std::map<unsigned int, struct tpc_map>::const_iterator itr =
tmap.find(key);
202 if (itr ==
tmap.end())
206 return itr->second.PadR;
209 double TPCMap::getPhi(
const unsigned int FEE,
const unsigned int FEEChannel,
const unsigned int )
const
211 if (FEE > 25 || FEEChannel > 255)
215 unsigned int key = 256 * FEE + FEEChannel;
217 std::map<unsigned int, struct tpc_map>::const_iterator itr =
tmap.find(key);
218 if (itr ==
tmap.end())
222 return itr->second.PadPhi;