|
|
|||
File indexing completed on 2026-09-27 08:38:02
0001 /** 0002 * @file PandoraSDK/include/Api/PandoraApi.h 0003 * 0004 * @brief Header file for the pandora api class. 0005 * 0006 * $Log: $ 0007 */ 0008 #ifndef PANDORA_API_H 0009 #define PANDORA_API_H 1 0010 0011 #include "Pandora/ObjectCreation.h" 0012 #include "Pandora/Pandora.h" 0013 #include "Pandora/PandoraObjectFactories.h" 0014 0015 namespace pandora 0016 { 0017 class AlgorithmFactory; 0018 class AlgorithmToolFactory; 0019 } // namespace pandora 0020 0021 //------------------------------------------------------------------------------------------------------------------------------------------ 0022 0023 /** 0024 * @brief PandoraApi class 0025 */ 0026 class PandoraApi 0027 { 0028 public: 0029 /* Map object creation into PandoraApi */ 0030 typedef object_creation::CaloHit CaloHit; 0031 typedef object_creation::MCParticle MCParticle; 0032 typedef object_creation::Track Track; 0033 0034 /** 0035 * @brief Geometry class 0036 */ 0037 class Geometry 0038 { 0039 public: 0040 typedef object_creation::Geometry::LayerParameters LayerParameters; 0041 typedef object_creation::Geometry::SubDetector SubDetector; 0042 typedef object_creation::Geometry::LArTPC LArTPC; 0043 typedef object_creation::Geometry::LineGap LineGap; 0044 typedef object_creation::Geometry::BoxGap BoxGap; 0045 typedef object_creation::Geometry::ConcentricGap ConcentricGap; 0046 }; 0047 0048 /** 0049 * @brief Process an event 0050 * 0051 * @param pandora the pandora instance to process event 0052 */ 0053 static pandora::StatusCode ProcessEvent(const pandora::Pandora &pandora); 0054 0055 /** 0056 * @brief Set the event information of the Pandora instance 0057 * 0058 * @param pandora the pandora instance 0059 * @param run the run number 0060 * @param subrun the subrun number 0061 * @param event the event number 0062 */ 0063 static pandora::StatusCode SetEventInformation( 0064 const pandora::Pandora &pandora, const unsigned int run, const unsigned int subrun, const unsigned int event); 0065 0066 /** 0067 * @brief Get an event context object 0068 * 0069 * @param pandora the pandora instance to get the event context object from 0070 * @param key the key associated with the desired event context object 0071 * 0072 * @return the address of the event context object 0073 */ 0074 static const pandora::EventContextObject *GetEventContextObject(const pandora::Pandora &pandora, const std::string &key); 0075 0076 /** 0077 * @brief Read pandora settings 0078 * 0079 * @param pandora the pandora instance to run the algorithms initialize 0080 * @param xmlFileName the name of the xml file containing the settings 0081 */ 0082 static pandora::StatusCode ReadSettings(const pandora::Pandora &pandora, const std::string &xmlFileName); 0083 0084 /** 0085 * @brief Register an algorithm factory with pandora 0086 * 0087 * @param pandora the pandora instance to register the algorithm factory with 0088 * @param algorithmType the type of algorithm that the factory will create 0089 * @param pAlgorithmFactory the address of an algorithm factory instance 0090 */ 0091 static pandora::StatusCode RegisterAlgorithmFactory( 0092 const pandora::Pandora &pandora, const std::string &algorithmType, pandora::AlgorithmFactory *const pAlgorithmFactory); 0093 0094 /** 0095 * @brief Register an algorithm tool factory with pandora 0096 * 0097 * @param pandora the pandora instance to register the algorithm tool factory with 0098 * @param algorithmTool Type the type of algorithm tool that the factory will create 0099 * @param pAlgorithmToolFactory the address of an algorithm tool factory instance 0100 */ 0101 static pandora::StatusCode RegisterAlgorithmToolFactory( 0102 const pandora::Pandora &pandora, const std::string &algorithmToolType, pandora::AlgorithmToolFactory *const pAlgorithmToolFactory); 0103 0104 /** 0105 * @brief Set parent-daughter mc particle relationship 0106 * 0107 * @param pandora the pandora instance to register the relationship with 0108 * @param pParentAddress address of parent mc particle in the user framework 0109 * @param pDaughterAddress address of daughter mc particle in the user framework 0110 */ 0111 static pandora::StatusCode SetMCParentDaughterRelationship( 0112 const pandora::Pandora &pandora, const void *const pParentAddress, const void *const pDaughterAddress); 0113 0114 /** 0115 * @brief Set parent-daughter track relationship 0116 * 0117 * @param pandora the pandora instance to register the relationship with 0118 * @param pParentAddress address of parent track in the user framework 0119 * @param pDaughterAddress address of daughter track in the user framework 0120 */ 0121 static pandora::StatusCode SetTrackParentDaughterRelationship( 0122 const pandora::Pandora &pandora, const void *const pParentAddress, const void *const pDaughterAddress); 0123 0124 /** 0125 * @brief Set sibling track relationship 0126 * 0127 * @param pandora the pandora instance to register the relationship with 0128 * @param pFirstSiblingAddress address of first sibling track in the user framework 0129 * @param pSecondSiblingAddress address of second sibling track in the user framework 0130 */ 0131 static pandora::StatusCode SetTrackSiblingRelationship( 0132 const pandora::Pandora &pandora, const void *const pFirstSiblingAddress, const void *const pSecondSiblingAddress); 0133 0134 /** 0135 * @brief Set calo hit to mc particle relationship 0136 * 0137 * @param pandora the pandora instance to register the relationship with 0138 * @param pCaloHitParentAddress address of calo hit in the user framework 0139 * @param pMCParticleParentAddress address of mc particle in the user framework 0140 * @param mcParticleWeight weighting to assign to the mc particle 0141 */ 0142 static pandora::StatusCode SetCaloHitToMCParticleRelationship(const pandora::Pandora &pandora, const void *const pCaloHitParentAddress, 0143 const void *const pMCParticleParentAddress, const float mcParticleWeight = 1); 0144 0145 /** 0146 * @brief Set track to mc particle relationship 0147 * 0148 * @param pandora the pandora instance to register the relationship with 0149 * @param pTrackParentAddress address of track in the user framework 0150 * @param pMCParticleParentAddress address of mc particle in the user framework 0151 * @param mcParticleWeight weighting to assign to the mc particle 0152 */ 0153 static pandora::StatusCode SetTrackToMCParticleRelationship(const pandora::Pandora &pandora, const void *const pTrackParentAddress, 0154 const void *const pMCParticleParentAddress, const float mcParticleWeight = 1); 0155 0156 /** 0157 * @brief Get the current pfo list 0158 * 0159 * @param pandora the pandora instance to get the objects from 0160 * @param pPfoList to receive the address of the particle flow objects 0161 */ 0162 static pandora::StatusCode GetCurrentPfoList(const pandora::Pandora &pandora, const pandora::PfoList *&pPfoList); 0163 0164 /** 0165 * @brief Get a named pfo list 0166 * 0167 * @param pandora the pandora instance to get the objects from 0168 * @param pfoListName the name of the pfo list 0169 * @param pPfoList to receive the address of the pfo list 0170 */ 0171 static pandora::StatusCode GetPfoList(const pandora::Pandora &pandora, const std::string &pfoListName, const pandora::PfoList *&pPfoList); 0172 0173 /** 0174 * @brief Set the external parameters associated with an algorithm instance of a specific type. It is enforced that there 0175 * be only a single instance of an externally-configured algorithm, per algorithm type, per Pandora instance 0176 * 0177 * @param pandora the pandora instance 0178 * @param algorithmType the algorithm type 0179 * @param pExternalParameters the address of the external parameters instance 0180 */ 0181 static pandora::StatusCode SetExternalParameters( 0182 const pandora::Pandora &pandora, const std::string &algorithmType, pandora::ExternalParameters *const pExternalParameters); 0183 0184 /** 0185 * @brief Set the granularity level to be associated with a specified hit type 0186 * 0187 * @param pandora the pandora instance to register the hit type to granularity relationship 0188 * @param hitType the specified hit type 0189 * @param granularity the specified granularity 0190 */ 0191 static pandora::StatusCode SetHitTypeGranularity(const pandora::Pandora &pandora, const pandora::HitType hitType, const pandora::Granularity granularity); 0192 0193 /** 0194 * @brief Set the bfield plugin used by pandora 0195 * 0196 * @param pandora the pandora instance to register the bfield plugin with 0197 * @param pBFieldPlugin address of the bfield plugin (will pass ownership to pandora) 0198 */ 0199 static pandora::StatusCode SetBFieldPlugin(const pandora::Pandora &pandora, pandora::BFieldPlugin *const pBFieldPlugin); 0200 0201 /** 0202 * @brief Set the lar transformation plugin used by pandora 0203 * 0204 * @param pandora the pandora instance to register the lar transformation plugin with 0205 * @param pLArTransformationPlugin address of the lar transformation plugin (will pass ownership to pandora) 0206 */ 0207 static pandora::StatusCode SetLArTransformationPlugin(const pandora::Pandora &pandora, pandora::LArTransformationPlugin *const pLArTransformationPlugin); 0208 0209 /** 0210 * @brief Set the pseudo layer plugin used by pandora 0211 * 0212 * @param pandora the pandora instance to register the pseudo layer plugin with 0213 * @param pPseudoLayerPlugin address of the pseudo layer plugin (will pass ownership to pandora) 0214 */ 0215 static pandora::StatusCode SetPseudoLayerPlugin(const pandora::Pandora &pandora, pandora::PseudoLayerPlugin *const pPseudoLayerPlugin); 0216 0217 /** 0218 * @brief Set the shower profile plugin used by pandora 0219 * 0220 * @param pandora the pandora instance to register the shower profile plugin with 0221 * @param pPseudoLayerPlugin address of the pseudo layer plugin (will pass ownership to pandora) 0222 */ 0223 static pandora::StatusCode SetShowerProfilePlugin(const pandora::Pandora &pandora, pandora::ShowerProfilePlugin *const pShowerProfilePlugin); 0224 0225 /** 0226 * @brief Register an energy correction plugin 0227 * 0228 * @param pandora the pandora instance with which to register the energy correction plugin 0229 * @param name the name/label associated with the energy correction plugin 0230 * @param energyCorrectionType the energy correction type 0231 * @param pEnergyCorrectionPlugin address of the energy correction plugin (will pass ownership to pandora) 0232 */ 0233 static pandora::StatusCode RegisterEnergyCorrectionPlugin(const pandora::Pandora &pandora, const std::string &name, 0234 const pandora::EnergyCorrectionType energyCorrectionType, pandora::EnergyCorrectionPlugin *const pEnergyCorrectionPlugin); 0235 0236 /** 0237 * @brief Register a particle id plugin 0238 * 0239 * @param pandora the pandora instance with which to register the particle id plugin 0240 * @param functionName the name/label associated with the particle id plugin 0241 * @param pParticleIdPlugin address of the particle id plugin (will pass ownership to pandora) 0242 */ 0243 static pandora::StatusCode RegisterParticleIdPlugin( 0244 const pandora::Pandora &pandora, const std::string &name, pandora::ParticleIdPlugin *const pParticleIdPlugin); 0245 0246 /** 0247 * @brief Reset pandora to process another event 0248 * 0249 * @param pandora the pandora instance to reset 0250 */ 0251 static pandora::StatusCode Reset(const pandora::Pandora &pandora); 0252 }; 0253 0254 #endif // #ifndef PANDORA_API_H
| [ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
|
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |
|