From 418c8e83dc052ee0e5e599aa6de6ffff61bb6174 Mon Sep 17 00:00:00 2001 From: Jan Kaspar Date: Mon, 21 Sep 2020 12:29:55 +0200 Subject: [PATCH] Exception and log-message topics unified to PPS. --- Alignment/PPSTrackBased/interface/AlignmentGeometry.h | 2 +- Alignment/PPSTrackBased/plugins/PPSFastLocalSimulation.cc | 2 +- Alignment/PPSTrackBased/plugins/PPSModifySingularModes.cc | 2 +- .../PPSTrackBased/plugins/PPSStraightTrackAligner.cc | 4 ++-- Alignment/PPSTrackBased/src/AlignmentGeometry.cc | 2 +- Alignment/PPSTrackBased/src/AlignmentTask.cc | 4 ++-- Alignment/PPSTrackBased/src/JanAlignmentAlgorithm.cc | 2 +- Alignment/PPSTrackBased/src/StraightTrackAlignment.cc | 8 ++++---- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Alignment/PPSTrackBased/interface/AlignmentGeometry.h b/Alignment/PPSTrackBased/interface/AlignmentGeometry.h index bc9bfcef49a26..7db7d674a5f53 100644 --- a/Alignment/PPSTrackBased/interface/AlignmentGeometry.h +++ b/Alignment/PPSTrackBased/interface/AlignmentGeometry.h @@ -48,7 +48,7 @@ struct DetGeometry { auto it = directionData.find(idx); if (it == directionData.end()) - throw cms::Exception("DetGeometry") << "direction index " << idx << " not in the mapping."; + throw cms::Exception("PPS") << "direction index " << idx << " not in the mapping."; return it->second; } diff --git a/Alignment/PPSTrackBased/plugins/PPSFastLocalSimulation.cc b/Alignment/PPSTrackBased/plugins/PPSFastLocalSimulation.cc index 5eb6f7c2d2b21..982a29ffcac11 100644 --- a/Alignment/PPSTrackBased/plugins/PPSFastLocalSimulation.cc +++ b/Alignment/PPSTrackBased/plugins/PPSFastLocalSimulation.cc @@ -134,7 +134,7 @@ PPSFastLocalSimulation::Distribution::Distribution(const edm::ParameterSet &ps) else if (!typeName.compare("gauss-limit")) type_ = dtGaussLimit; else - throw cms::Exception("PPSFastLocalSimulation") << "Unknown distribution type `" << typeName << "'."; + throw cms::Exception("PPS") << "Unknown distribution type `" << typeName << "'."; x_mean_ = ps.getParameter("x_mean"); x_width_ = ps.getParameter("x_width"); diff --git a/Alignment/PPSTrackBased/plugins/PPSModifySingularModes.cc b/Alignment/PPSTrackBased/plugins/PPSModifySingularModes.cc index 210b6f6762093..638d4398b290b 100644 --- a/Alignment/PPSTrackBased/plugins/PPSModifySingularModes.cc +++ b/Alignment/PPSTrackBased/plugins/PPSModifySingularModes.cc @@ -68,7 +68,7 @@ void PPSModifySingularModes::beginRun(edm::Run const&, edm::EventSetup const& es // validate config parameters if (z1 == z2) - throw cms::Exception("PPSModifySingularModes") << "z1 equals z2"; + throw cms::Exception("PPS") << "z1 equals z2"; // calculate slopes and intercepts const double a_x = (de_x2 - de_x1) / (z2 - z1), b_x = de_x1 - a_x * z1; diff --git a/Alignment/PPSTrackBased/plugins/PPSStraightTrackAligner.cc b/Alignment/PPSTrackBased/plugins/PPSStraightTrackAligner.cc index f2c6be829ff12..b362ceaa7efe8 100644 --- a/Alignment/PPSTrackBased/plugins/PPSStraightTrackAligner.cc +++ b/Alignment/PPSTrackBased/plugins/PPSStraightTrackAligner.cc @@ -99,7 +99,7 @@ void PPSStraightTrackAligner::analyze(const edm::Event &event, const edm::EventS if (geometryWatcher_.check(es)) { if (worker_initialized_) - throw cms::Exception("PPSStraightTrackAligner::analyze") << + throw cms::Exception("PPS") << "PPSStraightTrackAligner can't cope with changing geometry - change in event " << event.id() << endl; } @@ -158,7 +158,7 @@ void PPSStraightTrackAligner::endJob() if (worker_initialized_) worker_.finish(); else - throw cms::Exception("PPSStraightTrackAligner::endJob") << + throw cms::Exception("PPS") << "worker not initialized." << endl; } diff --git a/Alignment/PPSTrackBased/src/AlignmentGeometry.cc b/Alignment/PPSTrackBased/src/AlignmentGeometry.cc index 841c83ca182e2..1ef9a864e6791 100644 --- a/Alignment/PPSTrackBased/src/AlignmentGeometry.cc +++ b/Alignment/PPSTrackBased/src/AlignmentGeometry.cc @@ -18,7 +18,7 @@ const DetGeometry& AlignmentGeometry::get(unsigned int id) const { auto it = sensorGeometry.find(id); if (it == sensorGeometry.end()) - throw cms::Exception("AlignmentGeometry") << "No geometry available for sensor " << id << "."; + throw cms::Exception("PPS") << "No geometry available for sensor " << id << "."; return it->second; } diff --git a/Alignment/PPSTrackBased/src/AlignmentTask.cc b/Alignment/PPSTrackBased/src/AlignmentTask.cc index 4bdbdcbd36bcb..0e1b114041bf6 100644 --- a/Alignment/PPSTrackBased/src/AlignmentTask.cc +++ b/Alignment/PPSTrackBased/src/AlignmentTask.cc @@ -216,7 +216,7 @@ string AlignmentTask::quantityClassTag(QuantityClass qc) const case qcRotZ: return "RotZ"; } - throw cms::Exception("AlignmentTask::QuantityClassTag") << "Unknown quantity class " << qc << "."; + throw cms::Exception("PPS") << "Unknown quantity class " << qc << "."; } //---------------------------------------------------------------------------------------------------- @@ -255,7 +255,7 @@ void AlignmentTask::buildFixedDetectorsConstraints(vector & vector values(classSettings.getParameter< vector >("values")); if (ids.size() != values.size()) - throw cms::Exception("AlignmentTask::BuildFixedDetectorsConstraints") << + throw cms::Exception("PPS") << "Different number of constraint ids and values for " << tag << "."; // determine number of constraints diff --git a/Alignment/PPSTrackBased/src/JanAlignmentAlgorithm.cc b/Alignment/PPSTrackBased/src/JanAlignmentAlgorithm.cc index 95962b7c9794c..307ee85181073 100644 --- a/Alignment/PPSTrackBased/src/JanAlignmentAlgorithm.cc +++ b/Alignment/PPSTrackBased/src/JanAlignmentAlgorithm.cc @@ -611,7 +611,7 @@ unsigned int JanAlignmentAlgorithm::solve(const std::vector // stop if CS is singular if (singularModeCount > 0 && stopOnSingularModes) { - LogProblem("PPS") << "\n>> JanAlignmentAlgorithm::Solve > ERROR: There are " << singularModeCount << " singular modes in CS matrix. Stopping."; + LogError("PPS") << "\n>> JanAlignmentAlgorithm::Solve > ERROR: There are " << singularModeCount << " singular modes in CS matrix. Stopping."; return 1; } diff --git a/Alignment/PPSTrackBased/src/StraightTrackAlignment.cc b/Alignment/PPSTrackBased/src/StraightTrackAlignment.cc index d5ad359dd76f8..4bd44cbf80c9c 100644 --- a/Alignment/PPSTrackBased/src/StraightTrackAlignment.cc +++ b/Alignment/PPSTrackBased/src/StraightTrackAlignment.cc @@ -173,7 +173,7 @@ StraightTrackAlignment::StraightTrackAlignment(const ParameterSet& ps) : if (a) algorithms.push_back(a); else - throw cms::Exception("StraightTrackAlignment") << "Unknown alignment algorithm `" << alNames[i] << "'."; + throw cms::Exception("PPS") << "Unknown alignment algorithm `" << alNames[i] << "'."; } // get constraints type @@ -182,7 +182,7 @@ StraightTrackAlignment::StraightTrackAlignment(const ParameterSet& ps) : else if (ct.compare("standard") == 0) constraintsType = ctStandard; else - throw cms::Exception("StraightTrackAlignment") << "Unknown constraints type `" << ct << "'."; + throw cms::Exception("PPS") << "Unknown constraints type `" << ct << "'."; // parse additional accepted RP sets string aars_str = ps.getParameter("additionalAcceptedRPSets"); @@ -807,7 +807,7 @@ void StraightTrackAlignment::finish() unsigned int rf = algorithm->solve(constraints, results.back(), dir); if (rf) - throw cms::Exception("StraightTrackAlignment") << "The Solve method of `" << algorithm->getName() + throw cms::Exception("PPS") << "The Solve method of `" << algorithm->getName() << "' algorithm has failed (return value " << rf << ")."; } @@ -1058,7 +1058,7 @@ void StraightTrackAlignment::saveDiagnostics() const TFile *df = new TFile(diagnosticsFile.c_str(), "recreate"); if (df->IsZombie()) - throw cms::Exception("StraightTrackAlignment::SaveDiagnostics") << "Cannot open file `" << + throw cms::Exception("PPS") << "Cannot open file `" << diagnosticsFile << "' for writing."; if (buildDiagnosticPlots)