Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
PandoraApiImpl.cc
Go to the documentation of this file.
1
9#include "Api/PandoraApi.h"
10#include "Api/PandoraApiImpl.h"
11
16#include "Managers/MCManager.h"
21
24#include "Pandora/Pandora.h"
26
29
30namespace pandora
31{
32
33template <>
36{
37 const MCParticle *pMCParticle(nullptr);
38 return m_pPandora->m_pMCManager->Create(parameters, pMCParticle, factory);
39}
40
41template <>
44{
45 const Track *pTrack(nullptr);
46 return m_pPandora->m_pTrackManager->Create(parameters, pTrack, factory);
47}
48
49template <>
52{
53 const CaloHit *pCaloHit(nullptr);
54 return m_pPandora->m_pCaloHitManager->Create(parameters, pCaloHit, factory);
55}
56
57template <>
63
64template <>
70
71template <>
77
78template <>
84
85template <>
91
92template <typename PARAMETERS, typename OBJECT>
93StatusCode PandoraApiImpl::Create(const PARAMETERS &/*parameters*/, const ObjectFactory<PARAMETERS, OBJECT> &/*factory*/) const
94{
95 return STATUS_CODE_NOT_ALLOWED;
96}
97
98//------------------------------------------------------------------------------------------------------------------------------------------
99
104
105//------------------------------------------------------------------------------------------------------------------------------------------
106
107StatusCode PandoraApiImpl::ReadSettings(const std::string &xmlFileName) const
108{
109 return m_pPandora->ReadSettings(xmlFileName);
110}
111
112//------------------------------------------------------------------------------------------------------------------------------------------
113
114StatusCode PandoraApiImpl::RegisterAlgorithmFactory(const std::string &algorithmType, AlgorithmFactory *const pAlgorithmFactory) const
115{
116 return m_pPandora->m_pAlgorithmManager->RegisterAlgorithmFactory(algorithmType, pAlgorithmFactory);
117}
118
119//------------------------------------------------------------------------------------------------------------------------------------------
120
121StatusCode PandoraApiImpl::RegisterAlgorithmToolFactory(const std::string &algorithmToolType, AlgorithmToolFactory *const pAlgorithmToolFactory) const
122{
123 return m_pPandora->m_pAlgorithmManager->RegisterAlgorithmToolFactory(algorithmToolType, pAlgorithmToolFactory);
124}
125
126//------------------------------------------------------------------------------------------------------------------------------------------
127
128StatusCode PandoraApiImpl::SetMCParentDaughterRelationship(const void *const pParentAddress, const void *const pDaughterAddress) const
129{
130 return m_pPandora->m_pMCManager->SetMCParentDaughterRelationship(pParentAddress, pDaughterAddress);
131}
132
133//------------------------------------------------------------------------------------------------------------------------------------------
134
135StatusCode PandoraApiImpl::SetTrackParentDaughterRelationship(const void *const pParentAddress, const void *const pDaughterAddress) const
136{
137 return m_pPandora->m_pTrackManager->SetTrackParentDaughterRelationship(pParentAddress, pDaughterAddress);
138}
139
140//------------------------------------------------------------------------------------------------------------------------------------------
141
142StatusCode PandoraApiImpl::SetTrackSiblingRelationship(const void *const pFirstSiblingAddress, const void *const pSecondSiblingAddress) const
143{
144 return m_pPandora->m_pTrackManager->SetTrackSiblingRelationship(pFirstSiblingAddress, pSecondSiblingAddress);
145}
146
147//------------------------------------------------------------------------------------------------------------------------------------------
148
149StatusCode PandoraApiImpl::SetCaloHitToMCParticleRelationship(const void *const pCaloHitParentAddress, const void *const pMCParticleParentAddress,
150 const float mcParticleWeight) const
151{
152 return m_pPandora->m_pMCManager->SetCaloHitToMCParticleRelationship(pCaloHitParentAddress, pMCParticleParentAddress, mcParticleWeight);
153}
154
155//------------------------------------------------------------------------------------------------------------------------------------------
156
157StatusCode PandoraApiImpl::SetTrackToMCParticleRelationship(const void *const pTrackParentAddress, const void *const pMCParticleParentAddress,
158 const float mcParticleWeight) const
159{
160 return m_pPandora->m_pMCManager->SetTrackToMCParticleRelationship(pTrackParentAddress, pMCParticleParentAddress, mcParticleWeight);
161}
162
163//------------------------------------------------------------------------------------------------------------------------------------------
164
165StatusCode PandoraApiImpl::GetCurrentPfoList(const PfoList *&pPfoList, std::string &pfoListName) const
166{
167 return m_pPandora->m_pPfoManager->GetCurrentList(pPfoList, pfoListName);
168}
169
170//------------------------------------------------------------------------------------------------------------------------------------------
171
172StatusCode PandoraApiImpl::GetPfoList(const std::string &pfoListName, const PfoList *&pPfoList) const
173{
174 return m_pPandora->m_pPfoManager->GetList(pfoListName, pPfoList);
175}
176
177//------------------------------------------------------------------------------------------------------------------------------------------
178
180{
181 return m_pPandora->m_pGeometryManager->SetHitTypeGranularity(hitType, granularity);
182}
183
184//------------------------------------------------------------------------------------------------------------------------------------------
185
187{
188 return m_pPandora->m_pPluginManager->SetBFieldPlugin(pBFieldPlugin);
189}
190
191//------------------------------------------------------------------------------------------------------------------------------------------
192
194{
195 return m_pPandora->m_pPluginManager->SetLArTransformationPlugin(pLArTransformationPlugin);
196}
197
198//------------------------------------------------------------------------------------------------------------------------------------------
199
201{
202 return m_pPandora->m_pPluginManager->SetPseudoLayerPlugin(pPseudoLayerPlugin);
203}
204
205//------------------------------------------------------------------------------------------------------------------------------------------
206
208{
209 return m_pPandora->m_pPluginManager->SetShowerProfilePlugin(pShowerProfilePlugin);
210}
211
212//------------------------------------------------------------------------------------------------------------------------------------------
213
214StatusCode PandoraApiImpl::RegisterEnergyCorrectionPlugin(const std::string &name, const EnergyCorrectionType energyCorrectionType,
215 EnergyCorrectionPlugin *const pEnergyCorrectionPlugin) const
216{
217 return m_pPandora->m_pPluginManager->m_pEnergyCorrections->RegisterPlugin(name, energyCorrectionType, pEnergyCorrectionPlugin);
218}
219
220//------------------------------------------------------------------------------------------------------------------------------------------
221
222StatusCode PandoraApiImpl::RegisterParticleIdPlugin(const std::string &name, ParticleIdPlugin *const pParticleIdPlugin) const
223{
224 return m_pPandora->m_pPluginManager->m_pParticleId->RegisterPlugin(name, pParticleIdPlugin);
225}
226
227//------------------------------------------------------------------------------------------------------------------------------------------
228
233
234//------------------------------------------------------------------------------------------------------------------------------------------
235
237 m_pPandora(pPandora)
238{
239}
240
241//------------------------------------------------------------------------------------------------------------------------------------------
242//------------------------------------------------------------------------------------------------------------------------------------------
243
247
248} // namespace pandora
Header file for the algorithm manager class.
Header file for the calo hit manager class.
Header file for the cluster manager class.
Header file for the calo hit plugin class.
Header file for the externally configured algorithm class.
Header file for the geometry manager class.
Header file for the mc particle manager class.
Header file for pandora object creation classes.
Header file for the pandora class.
Header file for the pandora api class.
Header file for the pandora api implementation class.
Header file for the pandora settings class.
Header file for the particle flow object manager class.
Header file for the particle id plugin class.
Header file for the pandora plugin manager class.
Header file for the track manager class.
Header file for the vertex manager class.
Factory class for instantiating algorithms.
Definition Algorithm.h:39
StatusCode RegisterAlgorithmToolFactory(const std::string &algorithmToolType, AlgorithmToolFactory *const pAlgorithmToolFactory)
Register an algorithm tool factory.
StatusCode RegisterAlgorithmFactory(const std::string &algorithmType, AlgorithmFactory *const pAlgorithmFactory)
Register an algorithm factory.
Factory class for instantiating algorithm tools.
BFieldPlugin class.
CaloHit class.
Definition CaloHit.h:26
StatusCode Create(const object_creation::CaloHit::Parameters &parameters, const CaloHit *&pCaloHit, const ObjectFactory< object_creation::CaloHit::Parameters, object_creation::CaloHit::Object > &factory)
Create calo hit.
EnergyCorrectionPlugin class.
StatusCode RegisterPlugin(const std::string &pluginName, const EnergyCorrectionType energyCorrectionType, EnergyCorrectionPlugin *const pEnergyCorrectionPlugin)
Register an energy correction plugin.
StatusCode SetHitTypeGranularity(const HitType hitType, const Granularity granularity)
Set the granularity level to be associated with a specified hit type.
StatusCode CreateSubDetector(const object_creation::Geometry::SubDetector::Parameters &parameters, const ObjectFactory< object_creation::Geometry::SubDetector::Parameters, object_creation::Geometry::SubDetector::Object > &factory)
Create sub detector.
StatusCode CreateGap(const PARAMETERS &parameters, const ObjectFactory< PARAMETERS, OBJECT > &factory)
Create gap.
StatusCode CreateLArTPC(const object_creation::Geometry::LArTPC::Parameters &parameters, const ObjectFactory< object_creation::Geometry::LArTPC::Parameters, object_creation::Geometry::LArTPC::Object > &factory)
Create lar tpc.
LArTransformationPlugin class.
StatusCode SetMCParentDaughterRelationship(const Uid parentUid, const Uid daughterUid)
Set mc particle relationship.
Definition MCManager.cc:83
StatusCode Create(const object_creation::MCParticle::Parameters &parameters, const MCParticle *&pMCParticle, const ObjectFactory< object_creation::MCParticle::Parameters, object_creation::MCParticle::Object > &factory)
Create a mc particle.
Definition MCManager.cc:40
StatusCode SetTrackToMCParticleRelationship(const Uid trackUid, const Uid mcParticleUid, const float mcParticleWeight)
Set track to mc particle relationship.
Definition MCManager.h:181
StatusCode SetCaloHitToMCParticleRelationship(const Uid caloHitUid, const Uid mcParticleUid, const float mcParticleWeight)
Set calo hit to mc particle relationship.
Definition MCManager.h:174
MCParticle class.
Definition MCParticle.h:26
virtual StatusCode GetCurrentList(const ObjectList *&pObjectList, std::string &listName) const
Get the current list.
Definition Manager.cc:48
virtual StatusCode GetList(const std::string &listName, const ObjectList *&pObjectList) const
Get a list.
Definition Manager.cc:34
ObjectFactory class responsible for extended pandora object creation.
StatusCode GetCurrentPfoList(const PfoList *&pPfoList, std::string &pfoListName) const
Get the current pfo list.
StatusCode ResetEvent() const
Reset pandora to process another event.
StatusCode RegisterAlgorithmToolFactory(const std::string &algorithmToolType, AlgorithmToolFactory *const pAlgorithmToolFactory) const
Register an algorithm tool factory with pandora.
StatusCode SetShowerProfilePlugin(ShowerProfilePlugin *const pShowerProfilePlugin) const
Set the shower profile plugin used by pandora.
Pandora * m_pPandora
The pandora object to provide an interface to.
StatusCode SetTrackSiblingRelationship(const void *const pFirstSiblingAddress, const void *const pSecondSiblingAddress) const
Set sibling track relationship.
StatusCode SetLArTransformationPlugin(LArTransformationPlugin *const pLArTransformationPlugin) const
Set the lar transformation plugin used by pandora.
StatusCode SetCaloHitToMCParticleRelationship(const void *const pCaloHitParentAddress, const void *const pMCParticleParentAddress, const float mcParticleWeight) const
Set calo hit to mc particle relationship.
StatusCode SetBFieldPlugin(BFieldPlugin *const pBFieldPlugin) const
Set the bfield plugin used by pandora.
StatusCode RegisterParticleIdPlugin(const std::string &name, ParticleIdPlugin *const pParticleIdPlugin) const
Register a particle id plugin.
StatusCode SetHitTypeGranularity(const HitType hitType, const Granularity granularity) const
Set the granularity level to be associated with a specified hit type.
StatusCode RegisterEnergyCorrectionPlugin(const std::string &name, const EnergyCorrectionType energyCorrectionType, EnergyCorrectionPlugin *const pEnergyCorrectionPlugin) const
Register an energy correction plugin.
StatusCode Create(const PARAMETERS &parameters, const ObjectFactory< PARAMETERS, OBJECT > &factory) const
Create an object for pandora.
StatusCode RegisterAlgorithmFactory(const std::string &algorithmType, AlgorithmFactory *const pAlgorithmFactory) const
Register an algorithm factory with pandora.
StatusCode GetPfoList(const std::string &pfoListName, const PfoList *&pPfoList) const
Get a named pfo list.
StatusCode SetPseudoLayerPlugin(PseudoLayerPlugin *const pPseudoLayerPlugin) const
Set the pseudo layer plugin used by pandora.
StatusCode SetTrackToMCParticleRelationship(const void *const pTrackParentAddress, const void *const pMCParticleParentAddress, const float mcParticleWeight) const
Set track to mc particle relationship.
StatusCode ProcessEvent() const
Process event.
StatusCode ReadSettings(const std::string &xmlFileName) const
Read pandora settings.
StatusCode SetTrackParentDaughterRelationship(const void *const pParentAddress, const void *const pDaughterAddress) const
Set parent-daughter track relationship.
StatusCode SetMCParentDaughterRelationship(const void *const pParentAddress, const void *const pDaughterAddress) const
Set parent-daughter mc particle relationship.
PandoraApiImpl(Pandora *const pPandora)
Constructor.
Pandora class.
Definition Pandora.h:40
MCManager * m_pMCManager
The MC manager.
Definition Pandora.h:123
StatusCode ProcessEvent()
Process event, calling event prepare event function, then running the algorithms.
Definition Pandora.cc:111
TrackManager * m_pTrackManager
The track manager.
Definition Pandora.h:126
CaloHitManager * m_pCaloHitManager
The hit manager.
Definition Pandora.h:120
AlgorithmManager * m_pAlgorithmManager
The algorithm manager.
Definition Pandora.h:119
PluginManager * m_pPluginManager
The pandora plugin manager.
Definition Pandora.h:125
GeometryManager * m_pGeometryManager
The geometry manager.
Definition Pandora.h:122
StatusCode ResetEvent()
Reset event, calling manager reset functions and any registered reset functions.
Definition Pandora.cc:126
ParticleFlowObjectManager * m_pPfoManager
The particle flow object manager.
Definition Pandora.h:124
StatusCode ReadSettings(const std::string &xmlFileName)
Read pandora settings.
Definition Pandora.cc:133
StatusCode RegisterPlugin(const std::string &pluginName, ParticleIdPlugin *const pParticleIdPlugin)
Register a particle id plugin.
ParticleIdPlugin class.
StatusCode SetShowerProfilePlugin(ShowerProfilePlugin *const pShowerProfilePlugin)
Set the shower profile plugin.
StatusCode SetPseudoLayerPlugin(PseudoLayerPlugin *const pPseudoLayerPlugin)
Set the pseudo layer plugin.
EnergyCorrections * m_pEnergyCorrections
The energy corrections.
StatusCode SetLArTransformationPlugin(LArTransformationPlugin *const pLArTransformationPlugin)
Set the lar transformation plugin.
ParticleId * m_pParticleId
The particle id.
StatusCode SetBFieldPlugin(BFieldPlugin *const pBFieldPlugin)
Set the bfield plugin.
PseudoLayerPlugin class.
ShowerProfilePlugin class.
Track class.
Definition Track.h:26
StatusCode SetTrackParentDaughterRelationship(const Uid parentUid, const Uid daughterUid)
Set a track parent-daughter relationship.
StatusCode SetTrackSiblingRelationship(const Uid firstSiblingUid, const Uid secondSiblingUid)
Set a track sibling relationship.
StatusCode Create(const object_creation::Track::Parameters &parameters, const Track *&pTrack, const ObjectFactory< object_creation::Track::Parameters, object_creation::Track::Object > &factory)
Create track.
HitType
Calorimeter hit type enum.
Granularity
Granularity enum.
EnergyCorrectionType
Energy correction type enum.
StatusCode
The StatusCode enum.
MANAGED_CONTAINER< const ParticleFlowObject * > PfoList