Skip to content

Commit

Permalink
Exception and log-message topics unified to PPS.
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-kaspar committed Sep 21, 2020
1 parent 35d5b33 commit 418c8e8
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Alignment/PPSTrackBased/interface/AlignmentGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion Alignment/PPSTrackBased/plugins/PPSFastLocalSimulation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<double>("x_mean");
x_width_ = ps.getParameter<double>("x_width");
Expand Down
2 changes: 1 addition & 1 deletion Alignment/PPSTrackBased/plugins/PPSModifySingularModes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Alignment/PPSTrackBased/plugins/PPSStraightTrackAligner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion Alignment/PPSTrackBased/src/AlignmentGeometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions Alignment/PPSTrackBased/src/AlignmentTask.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 << ".";
}

//----------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -255,7 +255,7 @@ void AlignmentTask::buildFixedDetectorsConstraints(vector<AlignmentConstraint> &
vector<double> values(classSettings.getParameter< vector<double> >("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
Expand Down
2 changes: 1 addition & 1 deletion Alignment/PPSTrackBased/src/JanAlignmentAlgorithm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ unsigned int JanAlignmentAlgorithm::solve(const std::vector<AlignmentConstraint>
// 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;
}

Expand Down
8 changes: 4 additions & 4 deletions Alignment/PPSTrackBased/src/StraightTrackAlignment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<string>("additionalAcceptedRPSets");
Expand Down Expand Up @@ -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 << ").";
}

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 418c8e8

Please sign in to comment.