|
ATLAS Offline Software
|
#include <ParticleSortingTool.h>
|
| ParticleSortingTool (const std::string &type, const std::string &name, const IInterface *parent) |
| Constructor with parameters: More...
|
|
virtual | ~ParticleSortingTool () |
| Destructor: More...
|
|
virtual StatusCode | initialize () override |
| Athena algtool's initialize. More...
|
|
virtual StatusCode | finalize () override |
| Athena algtool's finalize. More...
|
|
virtual StatusCode | addBranches () const final override |
| Implement the method from the ISkimmingTool interface. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
|
StatusCode | doSort (xAOD::IParticleContainer *cont) const |
| Helper method that implements the call to the right sort function. More...
|
|
template<class CONTAINERTYPE > |
StatusCode | doSortConst (ConstDataVector< CONTAINERTYPE > *cont) const |
| Helper method to sort a ConstDataVector. More...
|
|
bool | comparePt (const xAOD::IParticle *partA, const xAOD::IParticle *partB) const |
| The method to compare the particle's pt. More...
|
|
bool | compareEta (const xAOD::IParticle *partA, const xAOD::IParticle *partB) const |
| The method to compare the particle's eta. More...
|
|
bool | comparePhi (const xAOD::IParticle *partA, const xAOD::IParticle *partB) const |
| The method to compare the particle's phi. More...
|
|
bool | compareMass (const xAOD::IParticle *partA, const xAOD::IParticle *partB) const |
| The method to compare the particle's mass. More...
|
|
bool | compareEnergy (const xAOD::IParticle *partA, const xAOD::IParticle *partB) const |
| The method to compare the particle's energy. More...
|
|
bool | compareRapidity (const xAOD::IParticle *partA, const xAOD::IParticle *partB) const |
| The method to compare the particle's rapidity. More...
|
|
bool | compareAuxData (const xAOD::IParticle *partA, const xAOD::IParticle *partB) const |
| The method to compare an auxdata member of the particle. More...
|
|
bool | compareDouble (double a, double b) const |
| Method to compare two doubles. More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &) |
| specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &) |
| specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
|
Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &) |
| specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
|
Definition at line 29 of file ParticleSortingTool.h.
◆ StoreGateSvc_t
◆ ParticleSortingTool()
ParticleSortingTool::ParticleSortingTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
Constructor with parameters:
Definition at line 34 of file ParticleSortingTool.cxx.
45 declareInterface< DerivationFramework::IAugmentationTool >(
this);
50 "The name of the output container (with SG::VIEW_ELEMENTS) with the sorted copy of input objects" );
53 "Define by what parameter to sort (default: 'pt'; allowed: 'pt', 'eta', 'phi', 'm', 'e', 'rapidity')" );
56 "Define if the container should be sorted in a descending order (default=true)" );
◆ ~ParticleSortingTool()
ParticleSortingTool::~ParticleSortingTool |
( |
| ) |
|
|
virtual |
◆ addBranches()
StatusCode ParticleSortingTool::addBranches |
( |
| ) |
const |
|
finaloverridevirtual |
Implement the method from the ISkimmingTool interface.
Implements DerivationFramework::IAugmentationTool.
Definition at line 139 of file ParticleSortingTool.cxx.
150 <<
"Trying to retrieve a non-const version of the 'InputContainer'...");
154 ATH_MSG_DEBUG(
"We couldn't retrieve a non-const version of the input container... try const.");
173 ATH_MSG_ERROR(
"Couln't find the provided intput container in store gate for later overwriting");
174 return StatusCode::FAILURE;
179 ATH_MSG_DEBUG(
"Got a non-empty 'OutputCollection' property. "
180 <<
"Trying to retrieve a const version of the 'InputContainer'...");
198 ATH_MSG_ERROR(
"Couln't find the provided intput container in store gate");
199 return StatusCode::FAILURE;
204 return StatusCode::SUCCESS;
◆ compareAuxData()
◆ compareDouble()
bool ParticleSortingTool::compareDouble |
( |
double |
a, |
|
|
double |
b |
|
) |
| const |
|
inlineprivate |
◆ compareEnergy()
The method to compare the particle's energy.
Definition at line 293 of file ParticleSortingTool.cxx.
296 const double a = partA->
e();
297 const double b = partB->
e();
◆ compareEta()
◆ compareMass()
The method to compare the particle's mass.
Definition at line 284 of file ParticleSortingTool.cxx.
287 const double a = partA->
m();
288 const double b = partB->
m();
◆ comparePhi()
◆ comparePt()
The method to compare the particle's pt.
Definition at line 257 of file ParticleSortingTool.cxx.
260 const double a = partA->
pt();
261 const double b = partB->
pt();
◆ compareRapidity()
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ doSort()
Helper method that implements the call to the right sort function.
Definition at line 209 of file ParticleSortingTool.cxx.
213 return StatusCode::FAILURE;
222 else if ( std::abs(
m_sortID) == 2 ) {
227 else if ( std::abs(
m_sortID) == 3 ) {
232 else if ( std::abs(
m_sortID) == 4 ) {
237 else if ( std::abs(
m_sortID) == 5 ) {
242 else if ( std::abs(
m_sortID) == 6 ) {
247 else if ( std::abs(
m_sortID) == 7 ) {
253 return StatusCode::SUCCESS;
◆ doSortConst()
template<class CONTAINERTYPE >
StatusCode ParticleSortingTool::doSortConst |
( |
ConstDataVector< CONTAINERTYPE > * |
cont | ) |
const |
|
private |
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ finalize()
StatusCode ParticleSortingTool::finalize |
( |
| ) |
|
|
overridevirtual |
◆ initialize()
StatusCode ParticleSortingTool::initialize |
( |
| ) |
|
|
overridevirtual |
Athena algtool's initialize.
Definition at line 69 of file ParticleSortingTool.cxx.
90 <<
" Assuming it's an auxdata member");
95 return StatusCode::SUCCESS;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
static const InterfaceID& DerivationFramework::IAugmentationTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
AlgTool interface methods.
Definition at line 31 of file IAugmentationTool.h.
31 {
return IID_IAugmentationTool; }
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_detStore
◆ m_evtStore
◆ m_inCollKey
StringProperty ParticleSortingTool::m_inCollKey |
|
private |
◆ m_nEventsProcessed
std::atomic<unsigned long> ParticleSortingTool::m_nEventsProcessed |
|
mutableprivate |
◆ m_outCollKey
StringProperty ParticleSortingTool::m_outCollKey |
|
private |
◆ m_sortDescending
BooleanProperty ParticleSortingTool::m_sortDescending |
|
private |
Define if the container should be sorted in a descending order (default=true)
Definition at line 111 of file ParticleSortingTool.h.
◆ m_sortID
int ParticleSortingTool::m_sortID |
|
private |
◆ m_sortVar
StringProperty ParticleSortingTool::m_sortVar |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
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.
StringProperty m_outCollKey
The name of the output container (with SG::VIEW_ELEMENTS) with the sorted copy of input objects.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
int m_sortID
Internal identifier for the type of sorting.
StringProperty m_sortVar
Define by what parameter to sort (default: 'pt')
virtual double rapidity() const =0
The true rapidity (y) of the particle.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
#define COPY_AND_SORT_CONTAINER(CONTAINERTYPE)
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.
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.
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
bool compareEta(const xAOD::IParticle *partA, const xAOD::IParticle *partB) const
The method to compare the particle's eta.
bool compareEnergy(const xAOD::IParticle *partA, const xAOD::IParticle *partB) const
The method to compare the particle's energy.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
BooleanProperty m_sortDescending
Define if the container should be sorted in a descending order (default=true)
virtual void renounce()=0
virtual double pt() const =0
The transverse momentum ( ) of the particle.
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
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.
void sort()
Sort the container.
virtual double eta() const =0
The pseudorapidity ( ) of the particle.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
StatusCode doSort(xAOD::IParticleContainer *cont) const
Helper method that implements the call to the right sort function.
virtual double phi() const =0
The azimuthal angle ( ) of the particle.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual double e() const =0
The total energy of the particle.
virtual double m() const =0
The invariant mass of the particle.
#define OVERWRITE_AND_SORT_CONTAINER(CONTAINERTYPE)