Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:15:55

0001 /**
0002  *  @file   PandoraSDK/include/Objects/ParticleFlowObject.h
0003  * 
0004  *  @brief  Header file for the particle flow object class.
0005  * 
0006  *  $Log: $
0007  */
0008 #ifndef PANDORA_PARTICLE_FLOW_OBJECT_H
0009 #define PANDORA_PARTICLE_FLOW_OBJECT_H 1
0010 
0011 #include "Pandora/ObjectCreation.h"
0012 #include "Pandora/StatusCodes.h"
0013 
0014 namespace pandora
0015 {
0016 
0017 template<typename T> class AlgorithmObjectManager;
0018 template<typename T, typename S> class PandoraObjectFactory;
0019 
0020 //------------------------------------------------------------------------------------------------------------------------------------------
0021 
0022 /**
0023  *  @brief  ParticleFlowObject class
0024  */
0025 class ParticleFlowObject
0026 {
0027 public:
0028     /**
0029      *  @brief  Get the particle flow object id (PDG code)
0030      * 
0031      *  @return The particle flow object id
0032      */
0033     int GetParticleId() const;
0034 
0035     /**
0036      *  @brief  Get particle flow object charge
0037      * 
0038      *  @return The particle flow object charge
0039      */
0040     int GetCharge() const;
0041 
0042     /**
0043      *  @brief  Get particle flow object mass
0044      * 
0045      *  @return The particle flow object mass
0046      */
0047     float GetMass() const;
0048 
0049     /**
0050      *  @brief  Get the particle flow object energy
0051      * 
0052      *  @return The particle flow object energy
0053      */
0054     float GetEnergy() const;
0055 
0056     /**
0057      *  @brief  Get particle flow object momentum vector
0058      * 
0059      *  @return The particle flow object momentum vector
0060      */
0061     const CartesianVector &GetMomentum() const;
0062 
0063     /**
0064      *  @brief  Get the track list
0065      * 
0066      *  @return The track list
0067      */
0068     const TrackList &GetTrackList() const;
0069 
0070     /**
0071      *  @brief  Get the cluster list
0072      * 
0073      *  @return The cluster list
0074      */
0075     const ClusterList &GetClusterList() const;
0076 
0077     /**
0078      *  @brief  Get the vertex list
0079      * 
0080      *  @return The vertex list
0081      */
0082     const VertexList &GetVertexList() const;
0083 
0084     /**
0085      *  @brief  Get track address list
0086      * 
0087      *  @return The track address list
0088      */
0089     TrackAddressList GetTrackAddressList() const;
0090 
0091     /**
0092      *  @brief  Get the cluster address list
0093      * 
0094      *  @return The cluster address list
0095      */
0096     ClusterAddressList GetClusterAddressList() const;
0097 
0098     /**
0099      *  @brief  Get the number of tracks in the particle flow object
0100      * 
0101      *  @return The number of tracks in the particle flow object
0102      */
0103     unsigned int GetNTracks() const;
0104 
0105     /**
0106      *  @brief  Get the number of clusters in the particle flow object
0107      * 
0108      *  @return The number of clusters in the particle flow object
0109      */
0110     unsigned int GetNClusters() const;
0111 
0112     /**
0113      *  @brief  Get the parent pfo list
0114      * 
0115      *  @return The parent pfo list
0116      */
0117     const PfoList &GetParentPfoList() const;
0118 
0119     /**
0120      *  @brief  Get the daughter pfo list
0121      * 
0122      *  @return The daughter pfo list
0123      */
0124     const PfoList &GetDaughterPfoList() const;
0125 
0126     /**
0127      *  @brief  Get the number of parent pfos
0128      * 
0129      *  @return The number of parent pfos
0130      */
0131     unsigned int GetNParentPfos() const;
0132 
0133     /**
0134      *  @brief  Get the number of daughter pfos
0135      * 
0136      *  @return The number of daughter pfos
0137      */
0138     unsigned int GetNDaughterPfos() const;
0139 
0140     /**
0141      *  @brief  Get the map from registered property name to floating point property value
0142      * 
0143      *  @return The properties map
0144      */
0145     const PropertiesMap &GetPropertiesMap() const;
0146 
0147 protected:
0148     /**
0149      *  @brief  Constructor
0150      * 
0151      *  @param  parameters the particle flow object parameters
0152      */
0153     ParticleFlowObject(const object_creation::ParticleFlowObject::Parameters &parameters);
0154 
0155     /**
0156      *  @brief  Destructor
0157      */
0158     virtual ~ParticleFlowObject();
0159 
0160     /**
0161      *  @brief  Alter particle flow object metadata parameters
0162      * 
0163      *  @param  metaData the new particle flow object metadata (all fields now optional)
0164      */
0165     StatusCode AlterMetadata(const object_creation::ParticleFlowObject::Metadata &metadata);
0166 
0167     /**
0168      *  @brief  Add an object to the particle flow object
0169      *
0170      *  @param  pT address of the object to add
0171      */
0172     template <typename T>
0173     StatusCode AddToPfo(const T *const pT);
0174 
0175     /**
0176      *  @brief  Remove an object from the particle flow object
0177      *
0178      *  @param  pT address of the object to remove
0179      */
0180     template <typename T>
0181     StatusCode RemoveFromPfo(const T *const pT);
0182 
0183     /**
0184      *  @brief  Add a parent pfo to the parent pfo list
0185      * 
0186      *  @param  pPfo the address of the parent pfo
0187      */
0188     StatusCode AddParent(const ParticleFlowObject *const pPfo);
0189 
0190     /**
0191      *  @brief  Add a daughter pfo to the daughter pfo list
0192      * 
0193      *  @param  pPfo the address of the daughter pfo
0194      */
0195     StatusCode AddDaughter(const ParticleFlowObject *const pPfo);
0196 
0197     /**
0198      *  @brief  Remove a parent pfo from the parent pfo list
0199      * 
0200      *  @param  pPfo the address of the parent pfo
0201      */
0202     StatusCode RemoveParent(const ParticleFlowObject *const pPfo);
0203 
0204     /**
0205      *  @brief  Remove a daughter pfo from the daughter pfo list
0206      * 
0207      *  @param  pPfo the address of the daughter pfo
0208      */
0209     StatusCode RemoveDaughter(const ParticleFlowObject *const pPfo);
0210 
0211     /**
0212      *  @brief  Update the properties map
0213      * 
0214      *  @param  metaData the new particle flow object metadata
0215      */
0216     StatusCode UpdatePropertiesMap(const object_creation::ParticleFlowObject::Metadata &metadata);
0217 
0218     int                     m_particleId;               ///< The particle flow object id (PDG code)
0219     int                     m_charge;                   ///< The particle flow object charge
0220     float                   m_mass;                     ///< The particle flow object mass
0221     float                   m_energy;                   ///< The particle flow object energy
0222     CartesianVector         m_momentum;                 ///< The particle flow object momentum
0223     TrackList               m_trackList;                ///< The track list
0224     ClusterList             m_clusterList;              ///< The cluster list
0225     VertexList              m_vertexList;               ///< The vertex list
0226     PfoList                 m_parentPfoList;            ///< The list of parent pfos
0227     PfoList                 m_daughterPfoList;          ///< The list of daughter pfos
0228     PropertiesMap           m_propertiesMap;            ///< The map from registered property name to floating point property value
0229 
0230     friend class ParticleFlowObjectManager;
0231     friend class AlgorithmObjectManager<ParticleFlowObject>;
0232     friend class PandoraObjectFactory<object_creation::ParticleFlowObject::Parameters, object_creation::ParticleFlowObject::Object>;
0233 };
0234 
0235 typedef ParticleFlowObject Pfo;                         ///< The ParticleFlowObject to Pfo typedef
0236 
0237 //------------------------------------------------------------------------------------------------------------------------------------------
0238 
0239 inline int ParticleFlowObject::GetParticleId() const
0240 {
0241     return m_particleId;
0242 }
0243 
0244 //------------------------------------------------------------------------------------------------------------------------------------------
0245 
0246 inline int ParticleFlowObject::GetCharge() const
0247 {
0248     return m_charge;
0249 }
0250 
0251 //------------------------------------------------------------------------------------------------------------------------------------------
0252 
0253 inline float ParticleFlowObject::GetMass() const
0254 {
0255     return m_mass;
0256 }
0257 
0258 //------------------------------------------------------------------------------------------------------------------------------------------
0259 
0260 inline float ParticleFlowObject::GetEnergy() const
0261 {
0262     return m_energy;
0263 }
0264 
0265 //------------------------------------------------------------------------------------------------------------------------------------------
0266 
0267 inline const CartesianVector &ParticleFlowObject::GetMomentum() const
0268 {
0269     return m_momentum;
0270 }
0271 
0272 //------------------------------------------------------------------------------------------------------------------------------------------
0273 
0274 inline const TrackList &ParticleFlowObject::GetTrackList() const
0275 {
0276     return m_trackList;
0277 }
0278 
0279 //------------------------------------------------------------------------------------------------------------------------------------------
0280 
0281 inline const ClusterList &ParticleFlowObject::GetClusterList() const
0282 {
0283     return m_clusterList;
0284 }
0285 
0286 //------------------------------------------------------------------------------------------------------------------------------------------
0287 
0288 inline const VertexList &ParticleFlowObject::GetVertexList() const
0289 {
0290     return m_vertexList;
0291 }
0292 
0293 //------------------------------------------------------------------------------------------------------------------------------------------
0294 
0295 inline unsigned int ParticleFlowObject::GetNTracks() const
0296 {
0297     return m_trackList.size();
0298 }
0299 
0300 //------------------------------------------------------------------------------------------------------------------------------------------
0301 
0302 inline unsigned int ParticleFlowObject::GetNClusters() const
0303 {
0304     return m_clusterList.size();
0305 }
0306 
0307 //------------------------------------------------------------------------------------------------------------------------------------------
0308 
0309 inline const PfoList &ParticleFlowObject::GetParentPfoList() const
0310 {
0311     return m_parentPfoList;
0312 }
0313 
0314 //------------------------------------------------------------------------------------------------------------------------------------------
0315 
0316 inline const PfoList &ParticleFlowObject::GetDaughterPfoList() const
0317 {
0318     return m_daughterPfoList;
0319 }
0320 
0321 //------------------------------------------------------------------------------------------------------------------------------------------
0322 
0323 inline unsigned int ParticleFlowObject::GetNParentPfos() const
0324 {
0325     return m_parentPfoList.size();
0326 }
0327 
0328 //------------------------------------------------------------------------------------------------------------------------------------------
0329 
0330 inline unsigned int ParticleFlowObject::GetNDaughterPfos() const
0331 {
0332     return m_daughterPfoList.size();
0333 }
0334 
0335 //------------------------------------------------------------------------------------------------------------------------------------------
0336 
0337 inline const PropertiesMap &ParticleFlowObject::GetPropertiesMap() const
0338 {
0339     return m_propertiesMap;
0340 }
0341 
0342 } // namespace pandora
0343 
0344 #endif // #ifndef PANDORA_PARTICLE_FLOW_OBJECT_H