ATLAS Offline Software
ParticleSortingAlg.h
Go to the documentation of this file.
1 
3 /*
4  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // ParticleSortingAlg.h
8 // Header file for class ParticleSortingAlg
9 // Author: Karsten Koeneke <karsten.koeneke@cern.ch>
11 #ifndef EVENTUTILS_PARTICLESORTINGALG_H
12 #define EVENTUTILS_PARTICLESORTINGALG_H 1
13 
14 // FrameWork includes
15 #include "Gaudi/Interfaces/IOptionsSvc.h"
16 #include "GaudiKernel/ToolHandle.h"
17 #include "GaudiKernel/ServiceHandle.h"
19 
20 // STL includes
21 #include <string>
22 
23 // Forward declarations
25  class IAugmentationTool;
26 }
27 
29  : public ::AthAlgorithm
30 {
31 
33  // Public methods:
35  public:
36 
37  // Copy constructor:
38 
40  ParticleSortingAlg( const std::string& name, ISvcLocator* pSvcLocator );
41 
43  virtual ~ParticleSortingAlg();
44 
46  virtual StatusCode initialize() override;
47 
49  virtual StatusCode execute() override;
50 
52  virtual StatusCode finalize() override;
53 
54 
55 private:
56  // The update handlers
57 
59  void setupInputContainer( Gaudi::Details::PropertyBase& /*prop*/ );
60 
62  void setupOutputContainer( Gaudi::Details::PropertyBase& /*prop*/ );
63 
65  void setupSortVar( Gaudi::Details::PropertyBase& /*prop*/ );
66 
68  void setupSortDescending( Gaudi::Details::PropertyBase& /*prop*/ );
69 
70 
71 
73  // Private data:
75  private:
79 
81  ToolHandle<DerivationFramework::IAugmentationTool> m_tool;
82 
84  StringProperty m_inCollKey;
85 
88 
89 
91  StringProperty m_outCollKey;
92 
95 
96 
98  StringProperty m_sortVar;
99 
102 
103 
105  BooleanProperty m_sortDescending;
106 
109 
110 
112  unsigned long m_nEventsProcessed;
113 
114 };
115 
116 
117 
119 // Inline methods:
121 
123 inline void ParticleSortingAlg::setupInputContainer( Gaudi::Details::PropertyBase& /*prop*/ ) {
124  m_setInCollKey = true;
125  return;
126 }
127 
129 inline void ParticleSortingAlg::setupOutputContainer( Gaudi::Details::PropertyBase& /*prop*/ ) {
130  m_setOutCollKey = true;
131  return;
132 }
133 
135 inline void ParticleSortingAlg::setupSortVar( Gaudi::Details::PropertyBase& /*prop*/ )
136 {
137  m_setSortVar = true;
138  return;
139 }
140 
142 inline void ParticleSortingAlg::setupSortDescending( Gaudi::Details::PropertyBase& /*prop*/ )
143 {
144  m_setSortDescending = true;
145  return;
146 }
147 
148 
149 #endif //> !EVENTUTILS_PARTICLESORTINGALG_H
ParticleSortingAlg::setupSortVar
void setupSortVar(Gaudi::Details::PropertyBase &)
This internal method will realize if a user sets the 'SortVariable' property.
Definition: ParticleSortingAlg.h:135
ParticleSortingAlg::m_inCollKey
StringProperty m_inCollKey
Input container name.
Definition: ParticleSortingAlg.h:84
ParticleSortingAlg::ParticleSortingAlg
ParticleSortingAlg(const std::string &name, ISvcLocator *pSvcLocator)
Constructor with parameters:
Definition: ParticleSortingAlg.cxx:25
ParticleSortingAlg
Definition: ParticleSortingAlg.h:30
ParticleSortingAlg::initialize
virtual StatusCode initialize() override
Athena algorithm's initalize hook.
Definition: ParticleSortingAlg.cxx:71
ParticleSortingAlg::m_outCollKey
StringProperty m_outCollKey
The name of the output container (with SG::VIEW_ELEMENTS) with the sorted copy of input objects.
Definition: ParticleSortingAlg.h:91
ParticleSortingAlg::execute
virtual StatusCode execute() override
Athena algorithm's execute hook.
Definition: ParticleSortingAlg.cxx:145
DerivationFramework::IAugmentationTool
Definition: IAugmentationTool.h:24
AthAlgorithm.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ParticleSortingAlg::m_setSortVar
bool m_setSortVar
This boolean is true if the user sets the 'SortVariable' property.
Definition: ParticleSortingAlg.h:101
ParticleSortingAlg::m_jos
ServiceHandle< Gaudi::Interfaces::IOptionsSvc > m_jos
The job options service (will be used to forward this algs properties to the private tool)
Definition: ParticleSortingAlg.h:78
ParticleSortingAlg::m_sortDescending
BooleanProperty m_sortDescending
Define if the container should be sorted in a descending order (default=true)
Definition: ParticleSortingAlg.h:105
ParticleSortingAlg::m_setOutCollKey
bool m_setOutCollKey
This boolean is true if the user sets the 'OutputContainer' property.
Definition: ParticleSortingAlg.h:94
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
ParticleSortingAlg::m_nEventsProcessed
unsigned long m_nEventsProcessed
Internal event counter.
Definition: ParticleSortingAlg.h:112
ParticleSortingAlg::m_sortVar
StringProperty m_sortVar
Define by what parameter to sort (default: 'pt')
Definition: ParticleSortingAlg.h:98
AthAlgorithm
Definition: AthAlgorithm.h:47
ParticleSortingAlg::setupSortDescending
void setupSortDescending(Gaudi::Details::PropertyBase &)
This internal method will realize if a user sets the 'SortDeceding' property.
Definition: ParticleSortingAlg.h:142
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ParticleSortingAlg::m_setInCollKey
bool m_setInCollKey
This boolean is true if the user sets the 'InputContainer' property.
Definition: ParticleSortingAlg.h:87
ParticleSortingAlg::setupInputContainer
void setupInputContainer(Gaudi::Details::PropertyBase &)
This internal method will realize if a user sets the 'InputContainer' property.
Definition: ParticleSortingAlg.h:123
ParticleSortingAlg::m_tool
ToolHandle< DerivationFramework::IAugmentationTool > m_tool
The ToolHandle to the private ParticleSortingTool.
Definition: ParticleSortingAlg.h:81
ParticleSortingAlg::m_setSortDescending
bool m_setSortDescending
This boolean is true if the user sets the 'SortDescending' property.
Definition: ParticleSortingAlg.h:108
ParticleSortingAlg::setupOutputContainer
void setupOutputContainer(Gaudi::Details::PropertyBase &)
This internal method will realize if a user sets the 'OutputContainer' property.
Definition: ParticleSortingAlg.h:129
ParticleSortingAlg::finalize
virtual StatusCode finalize() override
Athena algorithm's finalize hook.
Definition: ParticleSortingAlg.cxx:132
ParticleSortingAlg::~ParticleSortingAlg
virtual ~ParticleSortingAlg()
Destructor:
Definition: ParticleSortingAlg.cxx:64
ServiceHandle< Gaudi::Interfaces::IOptionsSvc >