Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add state to Warning #2572

Merged
merged 1 commit into from Feb 21, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 17 additions & 13 deletions TrackingTools/TrajectoryState/src/BasicTrajectoryState.cc
Expand Up @@ -201,19 +201,23 @@ void BasicTrajectoryState::notValid() {
}

namespace {
void verifyLocalErr(LocalTrajectoryError const & err ) {
if unlikely(!err.posDef())
edm::LogWarning("BasicTrajectoryState") << "local error not pos-def\n"
<< err.matrix();
void verifyLocalErr(LocalTrajectoryError const & err, const FreeTrajectoryState & state ) {
if unlikely(!err.posDef())
edm::LogWarning("BasicTrajectoryState") << "local error not pos-def\n"
<< err.matrix()
<< "\npos/mom/mf " << state.position() << ' ' << state.momentum()
<< ' ' << state.parameters().magneticFieldInTesla();
}
void verifyCurvErr(CurvilinearTrajectoryError const & err ) {
if unlikely(!err.posDef())
edm::LogWarning("BasicTrajectoryState") << "curv error not pos-def\n"
<< err.matrix();
void verifyCurvErr(CurvilinearTrajectoryError const & err, const FreeTrajectoryState & state ) {
if unlikely(!err.posDef())
edm::LogWarning("BasicTrajectoryState") << "curv error not pos-def\n"
<< err.matrix()
<< "\npos/mom/mf " << state.position() << ' ' << state.momentum()
<< ' ' << state.parameters().magneticFieldInTesla();
}

}


void BasicTrajectoryState::missingError(char const * where) const{
std::stringstream form;
form<<"BasicTrajectoryState: attempt to access errors when none available "
Expand All @@ -239,8 +243,8 @@ void BasicTrajectoryState::checkCurvilinError() const {

theFreeState.setCurvilinearError( cov );

verifyLocalErr(theLocalError);
verifyCurvErr(cov);
verifyLocalErr(theLocalError,theFreeState);
verifyCurvErr(cov,theFreeState);
}


Expand Down Expand Up @@ -274,8 +278,8 @@ BasicTrajectoryState::createLocalErrorFromCurvilinearError() const {
// cout<<"Clocal via curvilinear error"<<endl;
theLocalError = LocalTrajectoryError(cov);

verifyCurvErr(theFreeState.curvilinearError());
verifyLocalErr(theLocalError);
verifyCurvErr(theFreeState.curvilinearError(),theFreeState);
verifyLocalErr(theLocalError,theFreeState);

}

Expand Down