|
ATLAS Offline Software
|
Go to the documentation of this file.
11 #ifndef EVENTUTILS_PARTICLESORTINGTOOL_H
12 #define EVENTUTILS_PARTICLESORTINGTOOL_H 1
43 const std::string&
name,
44 const IInterface*
parent );
68 template<
class CONTAINERTYPE>
130 template<
class CONTAINERTYPE>
135 return StatusCode::FAILURE;
144 else if ( std::abs(
m_sortID) == 2 ) {
149 else if ( std::abs(
m_sortID) == 3 ) {
154 else if ( std::abs(
m_sortID) == 4 ) {
159 else if ( std::abs(
m_sortID) == 5 ) {
164 else if ( std::abs(
m_sortID) == 6 ) {
169 else if ( std::abs(
m_sortID) == 7 ) {
175 return StatusCode::SUCCESS;
180 #endif //> !EVENTUTILS_PARTICLESORTINGTOOL_H
virtual StatusCode addBranches() const final override
Implement the method from the ISkimmingTool interface.
virtual ~ParticleSortingTool()
Destructor:
bool compareMass(const xAOD::IParticle *partA, const xAOD::IParticle *partB) const
The method to compare the particle's mass.
bool compareAuxData(const xAOD::IParticle *partA, const xAOD::IParticle *partB) const
The method to compare an auxdata member of the particle.
DataVector adapter that acts like it holds const pointers.
StringProperty m_outCollKey
The name of the output container (with SG::VIEW_ELEMENTS) with the sorted copy of input objects.
int m_sortID
Internal identifier for the type of sorting.
StringProperty m_sortVar
Define by what parameter to sort (default: 'pt')
StatusCode doSortConst(ConstDataVector< CONTAINERTYPE > *cont) const
Helper method to sort a ConstDataVector.
bool comparePt(const xAOD::IParticle *partA, const xAOD::IParticle *partB) const
The method to compare the particle's pt.
std::atomic< unsigned long > m_nEventsProcessed
Internal event counter.
Class providing the definition of the 4-vector interface.
bool compareRapidity(const xAOD::IParticle *partA, const xAOD::IParticle *partB) const
The method to compare the particle's rapidity.
virtual StatusCode initialize() override
Athena algtool's initialize.
bool greater(double a, double b)
Compare two FP numbers, working around x87 precision issues.
bool comparePhi(const xAOD::IParticle *partA, const xAOD::IParticle *partB) const
The method to compare the particle's phi.
bool compareEta(const xAOD::IParticle *partA, const xAOD::IParticle *partB) const
The method to compare the particle's eta.
ParticleSortingTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
::StatusCode StatusCode
StatusCode definition for legacy code.
Workaround x86 precision issues for FP inequality comparisons.
bool compareEnergy(const xAOD::IParticle *partA, const xAOD::IParticle *partB) const
The method to compare the particle's energy.
BooleanProperty m_sortDescending
Define if the container should be sorted in a descending order (default=true)
StringProperty m_inCollKey
Input container name.
bool less(double a, double b)
Compare two FP numbers, working around x87 precision issues.
bool compareDouble(double a, double b) const
Method to compare two doubles.
DataVector adapter that acts like it holds const pointers.
StatusCode doSort(xAOD::IParticleContainer *cont) const
Helper method that implements the call to the right sort function.
virtual StatusCode finalize() override
Athena algtool's finalize.