12 const char *calibrationroot = getenv(
"CALIBRATIONROOT");
16 full_path =
std::string(calibrationroot) +
"/TPC/Mapping/PadPlane/";
20 calibrationroot = getenv(
"TPCCALIB");
38 std::cout <<
"reading " << full_path_r1 <<
" failed" << std::endl;
43 std::cout <<
"reading " << full_path_r2 <<
" failed" << std::endl;
48 std::cout <<
"reading " << full_path_r3 <<
" failed" << std::endl;
56 if (!infile.is_open())
58 std::cout <<
"Could not open file: "<< fileName << std::endl;
64 getline(infile, line);
67 int abs_pad = INT_MAX;
78 int FEE_Chan = INT_MAX;
87 while (getline(infile, line))
90 std::stringstream ss(line);
116 getline(ss, next,
',');
119 abs_pad = std::stoul(next);
123 Radius = stoul(next);
129 else if (index == 11)
131 FEE_Chan = stoul(next);
133 else if (index == 17)
137 else if (index == 18)
144 if (section_offset == 1)
148 if (section_offset == 2)
157 x.
layer = Radius + section_offset * 16 + 7;
163 unsigned int key = 256 * (FEE) + FEE_Chan;
170 unsigned int TpcMap::getLayer(
const unsigned int FEE,
const unsigned int FEEChannel,
const unsigned int )
const
172 if (FEE >= 26 || FEEChannel > 255)
176 unsigned int key = 256 * FEE + FEEChannel;
178 std::map<unsigned int, struct tpc_map>::const_iterator itr =
tmap.find(key);
179 if (itr ==
tmap.end())
183 return itr->second.layer;
186 unsigned int TpcMap::getPad(
const unsigned int FEE,
const unsigned int FEEChannel,
const unsigned int )
const
188 if (FEE >= 26 || FEEChannel > 255)
192 unsigned int key = 256 * FEE + FEEChannel;
194 std::map<unsigned int, struct tpc_map>::const_iterator itr =
tmap.find(key);
195 if (itr ==
tmap.end())
199 return itr->second.padnr;
202 double TpcMap::getR(
const unsigned int FEE,
const unsigned int FEEChannel,
const unsigned int )
const
204 if (FEE >= 26 || FEEChannel > 255)
208 unsigned int key = 256 * FEE + FEEChannel;
210 std::map<unsigned int, struct tpc_map>::const_iterator itr =
tmap.find(key);
211 if (itr ==
tmap.end())
215 return itr->second.PadR;
218 double TpcMap::getPhi(
const unsigned int FEE,
const unsigned int FEEChannel,
const unsigned int )
const
220 if (FEE > 25 || FEEChannel > 255)
224 unsigned int key = 256 * FEE + FEEChannel;
226 std::map<unsigned int, struct tpc_map>::const_iterator itr =
tmap.find(key);
227 if (itr ==
tmap.end())
231 return itr->second.PadPhi;