File indexing completed on 2026-09-27 09:20:25
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef PANDORA_PERSISTENCY_H
0009 #define PANDORA_PERSISTENCY_H 1
0010
0011 #include "Pandora/ObjectCreation.h"
0012 #include "Pandora/ObjectFactory.h"
0013 #include "Pandora/PandoraObjectFactories.h"
0014
0015 #include "Persistency/PandoraIO.h"
0016
0017 #include <string>
0018
0019 namespace pandora
0020 {
0021
0022
0023
0024
0025 class Persistency
0026 {
0027 public:
0028
0029
0030
0031
0032
0033
0034
0035 Persistency(const pandora::Pandora &pandora, const std::string &fileName);
0036
0037
0038
0039
0040 virtual ~Persistency();
0041
0042
0043
0044
0045
0046
0047 const std::string &GetFileName() const;
0048
0049
0050
0051
0052
0053
0054 FileType GetFileType() const;
0055
0056
0057
0058
0059
0060
0061 template <typename PARAMETERS, typename OBJECT>
0062 StatusCode SetFactory(ObjectFactory<PARAMETERS, OBJECT> *const pFactory);
0063
0064 protected:
0065
0066
0067
0068
0069
0070 template <typename PARAMETERS, typename OBJECT>
0071 void ReplaceCurrentFactory(ObjectFactory<PARAMETERS, OBJECT> *const pFactory);
0072
0073 const Pandora *const m_pPandora;
0074 std::string m_fileName;
0075 FileType m_fileType;
0076 ContainerId m_containerId;
0077
0078 ObjectFactory<object_creation::CaloHit::Parameters, object_creation::CaloHit::Object> *m_pCaloHitFactory;
0079 ObjectFactory<object_creation::Track::Parameters, object_creation::Track::Object> *m_pTrackFactory;
0080 ObjectFactory<object_creation::MCParticle::Parameters, object_creation::MCParticle::Object> *m_pMCParticleFactory;
0081 ObjectFactory<object_creation::Geometry::SubDetector::Parameters, object_creation::Geometry::SubDetector::Object> *m_pSubDetectorFactory;
0082 ObjectFactory<object_creation::Geometry::LArTPC::Parameters, object_creation::Geometry::LArTPC::Object> *m_pLArTPCFactory;
0083 ObjectFactory<object_creation::Geometry::LineGap::Parameters, object_creation::Geometry::LineGap::Object> *m_pLineGapFactory;
0084 ObjectFactory<object_creation::Geometry::BoxGap::Parameters, object_creation::Geometry::BoxGap::Object> *m_pBoxGapFactory;
0085 ObjectFactory<object_creation::Geometry::ConcentricGap::Parameters, object_creation::Geometry::ConcentricGap::Object> *m_pConcentricGapFactory;
0086 };
0087
0088
0089
0090 inline const std::string &Persistency::GetFileName() const
0091 {
0092 return m_fileName;
0093 }
0094
0095
0096
0097 inline FileType Persistency::GetFileType() const
0098 {
0099 return m_fileType;
0100 }
0101
0102 }
0103
0104 #endif