 |
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>
102 StringProperty
m_inCollKey{
this,
"InputContainer",
"",
"Input container name" };
105 StringProperty
m_outCollKey{
this,
"OutputContainer",
"",
"The name of the output container (with SG::VIEW_ELEMENTS) with the sorted copy of input objects" };
108 StringProperty
m_sortVar{
this,
"SortVariable",
"pt",
"Define by what parameter to sort (default: 'pt'; allowed: 'pt', 'eta', 'phi', 'm', 'e', 'rapidity')" };
111 BooleanProperty
m_sortDescending{
this,
"SortDescending",
true,
"Define if the container should be sorted in a descending order (default=true)" };
129 template<
class CONTAINERTYPE>
134 return StatusCode::FAILURE;
143 else if ( std::abs(
m_sortID) == 2 ) {
148 else if ( std::abs(
m_sortID) == 3 ) {
153 else if ( std::abs(
m_sortID) == 4 ) {
158 else if ( std::abs(
m_sortID) == 5 ) {
163 else if ( std::abs(
m_sortID) == 6 ) {
168 else if ( std::abs(
m_sortID) == 7 ) {
174 return StatusCode::SUCCESS;
179 #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.