219 if (iterations.empty()) {
220 std::stringstream msg;
221 msg <<
"L1Parameters: 0 track finder iterations were found. Please, define at least one iteration";
222 throw std::logic_error(msg.str());
225 std::string names =
"";
226 for (
const auto& iter : iterations) {
228 names += iter.GetName() +
" ";
232 std::stringstream msg;
233 msg <<
"L1Parameters: some parameters are out of range for the following iterations: " << names;
234 throw std::logic_error(msg.str());
237 int nTrackFromTripletIterations = std::count_if(iterations.begin(), iterations.end(),
238 [=](
const auto& it) { return it.GetTrackFromTripletsFlag(); });
239 if (nTrackFromTripletIterations > 1) {
240 std::stringstream msg;
241 msg <<
"L1Parameters: found " << nTrackFromTripletIterations
242 <<
" iterations with GetTrackFromTripletsFlag() == true:\n";
243 for (
const auto& iter : iterations) {
244 if (iter.GetTrackFromTripletsFlag()) {
245 msg <<
'\t' <<
"- " << iter.GetName() <<
'\n';
248 msg <<
"Only the one iteration can have GetTrackFromTripletsFlag() == true, and this iteration should be ";
249 msg <<
"the last one";
250 throw std::logic_error(msg.str());
253 if (nTrackFromTripletIterations == 1 && !(iterations.end() - 1)->GetTrackFromTripletsFlag()) {
254 std::stringstream msg;
255 msg <<
"L1Parameters: iteration with GetTrackFromTripletsFlag() == true is not the last in a sequence. ";
256 msg <<
"The GetTrackFromTripletsFlag() value in the iterations sequence: \n";
257 for (
const auto& iter : iterations) {
258 msg <<
'\t' <<
"- " << std::setw(15) << std::setfill(
' ') << iter.GetName() <<
' ';
259 msg << std::setw(6) << std::setfill(
' ') << iter.GetTrackFromTripletsFlag() <<
'\n';
261 throw std::logic_error(msg.str());
265 LOG(info) <<
"Consistency test for L1 parameters object... \033[1;32mpassed\033[0m";
284 std::stringstream msg{};
289 constexpr char indentCh =
'\t';
290 std::string indent(indentLevel, indentCh);
293 auto ClrFlg = [&](
bool flag) {
return (flag ? clrs::GN : clrs::RD); };
295 msg <<
" ----- CA parameters list -----\n";
296 msg << indent << clrs::CLb <<
"COMPILE TIME CONSTANTS:\n" << clrs::CL;
302 msg << indent << clrs::CLb <<
"GEOMETRY:\n" << clrs::CL;
303 msg << indent << indentCh << clrs::CLb <<
"NUMBER OF STATIONS:\n" << clrs::CL;
304 msg << indent << indentCh << indentCh <<
"Number of stations (Geometry): ";
310 msg << indent << indentCh << indentCh <<
"Number of stations (Active): ";
315 msg <<
'\n' << indent << indentCh << indentCh << clrs::CL <<
"Geometry station indices: ";
316 for (
int iStGeo = 0; iStGeo < this->GetNstationsGeometry(); ++iStGeo) {
317 bool isActive =
fSetup.GeoToActStationId(iStGeo) != -1;
318 msg << ClrFlg(isActive) << setw(3) << iStGeo <<
' ';
320 msg <<
'\n' << indent << indentCh << indentCh << clrs::CL <<
"Local station indices: ";
321 for (
int iStGeo = 0; iStGeo < this->GetNstationsGeometry(); ++iStGeo) {
322 bool isActive =
fSetup.GeoToActStationId(iStGeo) != -1;
323 auto [detId, locId] =
fSetup.GeoToLocStationId(iStGeo);
324 msg << ClrFlg(isActive) << setw(3) << locId <<
' ';
326 msg <<
'\n' << indent << indentCh << indentCh << clrs::CL <<
"Detector indices: ";
327 for (
int iStGeo = 0; iStGeo < this->GetNstationsGeometry(); ++iStGeo) {
328 bool isActive =
fSetup.GeoToActStationId(iStGeo) != -1;
329 auto [detId, locId] =
fSetup.GeoToLocStationId(iStGeo);
330 msg << ClrFlg(isActive) << setw(3) << static_cast<int>(detId) <<
' ';
332 msg <<
'\n' << indent << indentCh << indentCh << clrs::CL <<
"Active station indices: ";
333 for (
int iStGeo = 0; iStGeo < this->GetNstationsGeometry(); ++iStGeo) {
334 int iStAct =
fSetup.GeoToActStationId(iStGeo);
335 msg << ClrFlg(iStAct != -1) << setw(3) << iStAct <<
' ';
337 msg << clrs::CL <<
'\n';
339 if (
fConfig.DevUseParSearchWindows()) {
340 msg << indent <<
"DOUBLET SEARCH WINDOWS:\n";
341 for (
int iSt = 1; iSt <
fSetup.GetNofActStations(); ++iSt) {
343 const auto& iter =
fConfig.GetIteration(iIter);
344 for (
int gap = 0; gap <= iter.GetMaxStationGap(); gap++) {
345 msg << indent <<
"- station: " << iSt <<
", iteration: " << iIter <<
", gap: " << gap <<
'\n';
346 msg <<
fSwMaps.DoubletSw(iIter, iSt, gap).ToString() <<
'\n';
350 msg << indent <<
"TRIPLET SEARCH WINDOWS:\n";
351 for (
int iSt = 1; iSt <
fSetup.GetNofActStations(); ++iSt) {
353 const auto& iter =
fConfig.GetIteration(iIter);
354 for (
int gapL = 0; gapL <= iter.GetMaxStationGap(); gapL++) {
355 for (
int gapM = 0; gapM <= iter.GetMaxStationGap(); gapM++) {
356 msg << indent <<
"- station: " << iSt <<
", iteration: " << iIter <<
", gapL: " << gapL
357 <<
", gapM: " << gapM <<
'\n';
358 msg <<
fSwMaps.TripletSw(iIter, iSt, gapL, gapM).ToString() <<
'\n';
366 msg <<
fConfig.ToString(indentLevel) <<
'\n';