Skip to content
Snippets Groups Projects
Commit 7f8ebf01 authored by Matthew Joseph Basso's avatar Matthew Joseph Basso
Browse files

abs -> std::abs

parent 7ba384a0
No related branches found
No related tags found
No related merge requests found
...@@ -29,10 +29,6 @@ ...@@ -29,10 +29,6 @@
#include "xAODCaloEvent/CaloClusterContainer.h" #include "xAODCaloEvent/CaloClusterContainer.h"
#include "AthContainers/ConstDataVector.h" #include "AthContainers/ConstDataVector.h"
// STL includes
#include <vector>
#include <string>
// Constructors // Constructors
//////////////// ////////////////
ParticleSortingTool::ParticleSortingTool( const std::string& type, ParticleSortingTool::ParticleSortingTool( const std::string& type,
...@@ -220,37 +216,37 @@ StatusCode ParticleSortingTool::doSort( xAOD::IParticleContainer* cont ) const ...@@ -220,37 +216,37 @@ StatusCode ParticleSortingTool::doSort( xAOD::IParticleContainer* cont ) const
} }
// Actually do the sorting, using a C++11 lambda function construct // Actually do the sorting, using a C++11 lambda function construct
// to be able to use the member function here // to be able to use the member function here
if ( abs(m_sortID) == 1 ) { if ( std::abs(m_sortID) == 1 ) {
cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) { cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) {
return this->comparePt(a,b); return this->comparePt(a,b);
} ); } );
} }
else if ( abs(m_sortID) == 2 ) { else if ( std::abs(m_sortID) == 2 ) {
cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) { cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) {
return this->compareEta(a,b); return this->compareEta(a,b);
} ); } );
} }
else if ( abs(m_sortID) == 3 ) { else if ( std::abs(m_sortID) == 3 ) {
cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) { cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) {
return this->comparePhi(a,b); return this->comparePhi(a,b);
} ); } );
} }
else if ( abs(m_sortID) == 4 ) { else if ( std::abs(m_sortID) == 4 ) {
cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) { cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) {
return this->compareMass(a,b); return this->compareMass(a,b);
} ); } );
} }
else if ( abs(m_sortID) == 5 ) { else if ( std::abs(m_sortID) == 5 ) {
cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) { cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) {
return this->compareEnergy(a,b); return this->compareEnergy(a,b);
} ); } );
} }
else if ( abs(m_sortID) == 6 ) { else if ( std::abs(m_sortID) == 6 ) {
cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) { cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) {
return this->compareRapidity(a,b); return this->compareRapidity(a,b);
} ); } );
} }
else if ( abs(m_sortID) == 7 ) { else if ( std::abs(m_sortID) == 7 ) {
cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) { cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) {
return this->compareAuxData(a,b); return this->compareAuxData(a,b);
} ); } );
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
// STL includes // STL includes
#include <vector> #include <vector>
#include <string> #include <string>
#include <cmath>
class ParticleSortingTool class ParticleSortingTool
: virtual public ::DerivationFramework::IAugmentationTool, : virtual public ::DerivationFramework::IAugmentationTool,
...@@ -138,37 +139,37 @@ StatusCode ParticleSortingTool::doSortConst( ConstDataVector<CONTAINERTYPE>* con ...@@ -138,37 +139,37 @@ StatusCode ParticleSortingTool::doSortConst( ConstDataVector<CONTAINERTYPE>* con
} }
// Actually do the sorting, using a C++11 lambda function construct // Actually do the sorting, using a C++11 lambda function construct
// to be able to use the member function here // to be able to use the member function here
if ( abs(m_sortID) == 1 ) { if ( std::abs(m_sortID) == 1 ) {
cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) { cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) {
return this->comparePt(a,b); return this->comparePt(a,b);
} ); } );
} }
else if ( abs(m_sortID) == 2 ) { else if ( std::abs(m_sortID) == 2 ) {
cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) { cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) {
return this->compareEta(a,b); return this->compareEta(a,b);
} ); } );
} }
else if ( abs(m_sortID) == 3 ) { else if ( std::abs(m_sortID) == 3 ) {
cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) { cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) {
return this->comparePhi(a,b); return this->comparePhi(a,b);
} ); } );
} }
else if ( abs(m_sortID) == 4 ) { else if ( std::abs(m_sortID) == 4 ) {
cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) { cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) {
return this->compareMass(a,b); return this->compareMass(a,b);
} ); } );
} }
else if ( abs(m_sortID) == 5 ) { else if ( std::abs(m_sortID) == 5 ) {
cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) { cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) {
return this->compareEnergy(a,b); return this->compareEnergy(a,b);
} ); } );
} }
else if ( abs(m_sortID) == 6 ) { else if ( std::abs(m_sortID) == 6 ) {
cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) { cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) {
return this->compareRapidity(a,b); return this->compareRapidity(a,b);
} ); } );
} }
else if ( abs(m_sortID) == 7 ) { else if ( std::abs(m_sortID) == 7 ) {
cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) { cont->sort( [this](const xAOD::IParticle* a, const xAOD::IParticle* b) {
return this->compareAuxData(a,b); return this->compareAuxData(a,b);
} ); } );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment