Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
pandora::XmlFileWriter Class Reference

XmlFileWriter class. More...

#include "XmlFileWriter.h"

Inheritance diagram for pandora::XmlFileWriter:
Collaboration diagram for pandora::XmlFileWriter:

Public Member Functions

 XmlFileWriter (const pandora::Pandora &pandora, const std::string &fileName, const FileMode fileMode=APPEND)
 Constructor.
 
 ~XmlFileWriter ()
 Destructor.
 
template<typename T >
StatusCode WriteVariable (const std::string &xmlKey, const T &t)
 Write a variable to the file.
 
template<>
StatusCode WriteVariable (const std::string &xmlKey, const CartesianVector &t)
 
template<>
StatusCode WriteVariable (const std::string &xmlKey, const TrackState &t)
 
StatusCode WriteGeometry ()
 Write the current geometry information to the file.
 
StatusCode WriteEvent (const CaloHitList &caloHitList, const TrackList &trackList, const MCParticleList &mcParticleList, const bool writeMCRelationships=true, const bool writeTrackRelationships=true)
 Write the specified event components to the file.
 
const std::string & GetFileName () const
 Get the file name.
 
FileType GetFileType () const
 Get the file type.
 
template<typename PARAMETERS , typename OBJECT >
StatusCode SetFactory (ObjectFactory< PARAMETERS, OBJECT > *const pFactory)
 Set the factory to use for all instantiations and parameter persistence.
 
template<>
void ReplaceCurrentFactory (ObjectFactory< object_creation::CaloHit::Parameters, object_creation::CaloHit::Object > *const pFactory)
 
template<>
void ReplaceCurrentFactory (ObjectFactory< object_creation::Track::Parameters, object_creation::Track::Object > *const pFactory)
 
template<>
void ReplaceCurrentFactory (ObjectFactory< object_creation::MCParticle::Parameters, object_creation::MCParticle::Object > *const pFactory)
 
template<>
void ReplaceCurrentFactory (ObjectFactory< object_creation::Geometry::SubDetector::Parameters, object_creation::Geometry::SubDetector::Object > *const pFactory)
 
template<>
void ReplaceCurrentFactory (ObjectFactory< object_creation::Geometry::LArTPC::Parameters, object_creation::Geometry::LArTPC::Object > *const pFactory)
 
template<>
void ReplaceCurrentFactory (ObjectFactory< object_creation::Geometry::LineGap::Parameters, object_creation::Geometry::LineGap::Object > *const pFactory)
 
template<>
void ReplaceCurrentFactory (ObjectFactory< object_creation::Geometry::BoxGap::Parameters, object_creation::Geometry::BoxGap::Object > *const pFactory)
 
template<>
void ReplaceCurrentFactory (ObjectFactory< object_creation::Geometry::ConcentricGap::Parameters, object_creation::Geometry::ConcentricGap::Object > *const pFactory)
 

Protected Member Functions

template<typename PARAMETERS , typename OBJECT >
void ReplaceCurrentFactory (ObjectFactory< PARAMETERS, OBJECT > *const pFactory)
 Replace the current factory with the provided instance.
 

Protected Attributes

const Pandora *const m_pPandora
 Address of pandora instance to be used alongside the file writer.
 
std::string m_fileName
 The file name.
 
FileType m_fileType
 The file type.
 
ContainerId m_containerId
 The type of container currently being written to file.
 
ObjectFactory< object_creation::CaloHit::Parameters, object_creation::CaloHit::Object > * m_pCaloHitFactory
 Address of the calo hit factory.
 
ObjectFactory< object_creation::Track::Parameters, object_creation::Track::Object > * m_pTrackFactory
 Address of the track factory.
 
ObjectFactory< object_creation::MCParticle::Parameters, object_creation::MCParticle::Object > * m_pMCParticleFactory
 Address of the mc particle factory.
 
ObjectFactory< object_creation::Geometry::SubDetector::Parameters, object_creation::Geometry::SubDetector::Object > * m_pSubDetectorFactory
 Address of the sub detector factory.
 
ObjectFactory< object_creation::Geometry::LArTPC::Parameters, object_creation::Geometry::LArTPC::Object > * m_pLArTPCFactory
 Address of the lar tpc factory.
 
ObjectFactory< object_creation::Geometry::LineGap::Parameters, object_creation::Geometry::LineGap::Object > * m_pLineGapFactory
 Address of the line gap factory.
 
ObjectFactory< object_creation::Geometry::BoxGap::Parameters, object_creation::Geometry::BoxGap::Object > * m_pBoxGapFactory
 Address of the box gap factory.
 
ObjectFactory< object_creation::Geometry::ConcentricGap::Parameters, object_creation::Geometry::ConcentricGap::Object > * m_pConcentricGapFactory
 Address of the concentric gap factory.
 

Private Member Functions

StatusCode WriteHeader (const ContainerId containerId)
 Write the container header to the file.
 
StatusCode WriteFooter ()
 Write the container footer to the file.
 
StatusCode WriteSubDetector (const SubDetector *const pSubDetector)
 Write a sub detector to the file.
 
StatusCode WriteLArTPC (const LArTPC *const pLArTPC)
 Write a lar tpc to the file.
 
StatusCode WriteDetectorGap (const DetectorGap *const pDetectorGap)
 Write the detector gap parameters to the file.
 
StatusCode WriteCaloHit (const CaloHit *const pCaloHit)
 Write a calo hit to the current position in the file.
 
StatusCode WriteTrack (const Track *const pTrack)
 Write a track to the current position in the file.
 
StatusCode WriteMCParticle (const MCParticle *const pMCParticle)
 Write a mc particle to the current position in the file.
 
StatusCode WriteRelationship (const RelationshipId relationshipId, const void *address1, const void *address2, const float weight)
 Write a relationship between two objects with specified addresses.
 
StatusCode WriteSubDetectorList ()
 Write the sub detector parameters to the file.
 
StatusCode WriteLArTPCList ()
 Write the lar tpc parameters to the file.
 
StatusCode WriteDetectorGapList ()
 Write the detector gap parameters to the file.
 
StatusCode WriteTrackList (const TrackList &trackList)
 Write a track list to the current position in the file.
 
StatusCode WriteCaloHitList (const CaloHitList &caloHitList)
 Write a calo hit list to the current position in the file.
 
StatusCode WriteMCParticleList (const MCParticleList &mcParticleList)
 Write a mc particle list to the current position in the file.
 
StatusCode WriteCaloHitToMCParticleRelationships (const CaloHitList &caloHitList)
 Write calo hit to mc particle relationships for a specified calo hit list.
 
StatusCode WriteTrackToMCParticleRelationships (const TrackList &trackList)
 Write track to mc particle relationships for a specified track list.
 
StatusCode WriteMCParticleRelationships (const MCParticleList &mcParticleList)
 Write mc particle relationships for a specified mc particle list.
 
StatusCode WriteMCParticleRelationships (const MCParticle *const pMCParticle)
 Write a mc particle parent/daughter relationship to the current position in the file.
 
StatusCode WriteTrackRelationships (const TrackList &trackList)
 Write track relationships for a specified list of tracks.
 
StatusCode WriteTrackRelationships (const Track *const pTrack)
 Write a track sibling or parent/daughter relationship to the current position in the file.
 
StatusCode WriteCaloHitToMCParticleRelationship (const CaloHit *const pCaloHit)
 Write a calo hit to mc particle relationship to the current position in the file.
 
StatusCode WriteTrackToMCParticleRelationship (const Track *const pTrack)
 Write a track to mc particle relationship to the current position in the file.
 

Private Attributes

TiXmlDocumentm_pXmlDocument
 The xml document.
 
TiXmlElementm_pContainerXmlElement
 The container xml element.
 
TiXmlElementm_pCurrentXmlElement
 The current xml element.
 

Detailed Description

XmlFileWriter class.

Definition at line 26 of file XmlFileWriter.h.

Constructor & Destructor Documentation

◆ XmlFileWriter()

pandora::XmlFileWriter::XmlFileWriter ( const pandora::Pandora pandora,
const std::string &  fileName,
const FileMode  fileMode = APPEND 
)

Constructor.

Parameters
algorithmthe pandora instance to be used alongside the file writer
fileNamethe name of the output file
fileModethe mode for file writing

Definition at line 25 of file XmlFileWriter.cc.

Here is the call graph for this function:

◆ ~XmlFileWriter()

pandora::XmlFileWriter::~XmlFileWriter ( )

Destructor.

Definition at line 55 of file XmlFileWriter.cc.

Here is the call graph for this function:

Member Function Documentation

◆ GetFileName()

const std::string & pandora::Persistency::GetFileName ( ) const
inlineinherited

Get the file name.

Returns
the file name

Definition at line 90 of file Persistency.h.

◆ GetFileType()

FileType pandora::Persistency::GetFileType ( ) const
inlineinherited

Get the file type.

Returns
the file type

Definition at line 97 of file Persistency.h.

Here is the caller graph for this function:

◆ ReplaceCurrentFactory() [1/9]

template<>
void pandora::Persistency::ReplaceCurrentFactory ( ObjectFactory< object_creation::CaloHit::Parameters, object_creation::CaloHit::Object > *const  pFactory)
inherited

Definition at line 61 of file Persistency.cc.

◆ ReplaceCurrentFactory() [2/9]

template<>
void pandora::Persistency::ReplaceCurrentFactory ( ObjectFactory< object_creation::Geometry::BoxGap::Parameters, object_creation::Geometry::BoxGap::Object > *const  pFactory)
inherited

Definition at line 103 of file Persistency.cc.

◆ ReplaceCurrentFactory() [3/9]

template<>
void pandora::Persistency::ReplaceCurrentFactory ( ObjectFactory< object_creation::Geometry::ConcentricGap::Parameters, object_creation::Geometry::ConcentricGap::Object > *const  pFactory)
inherited

Definition at line 110 of file Persistency.cc.

◆ ReplaceCurrentFactory() [4/9]

template<>
void pandora::Persistency::ReplaceCurrentFactory ( ObjectFactory< object_creation::Geometry::LArTPC::Parameters, object_creation::Geometry::LArTPC::Object > *const  pFactory)
inherited

Definition at line 89 of file Persistency.cc.

◆ ReplaceCurrentFactory() [5/9]

template<>
void pandora::Persistency::ReplaceCurrentFactory ( ObjectFactory< object_creation::Geometry::LineGap::Parameters, object_creation::Geometry::LineGap::Object > *const  pFactory)
inherited

Definition at line 96 of file Persistency.cc.

◆ ReplaceCurrentFactory() [6/9]

template<>
void pandora::Persistency::ReplaceCurrentFactory ( ObjectFactory< object_creation::Geometry::SubDetector::Parameters, object_creation::Geometry::SubDetector::Object > *const  pFactory)
inherited

Definition at line 82 of file Persistency.cc.

◆ ReplaceCurrentFactory() [7/9]

template<>
void pandora::Persistency::ReplaceCurrentFactory ( ObjectFactory< object_creation::MCParticle::Parameters, object_creation::MCParticle::Object > *const  pFactory)
inherited

Definition at line 75 of file Persistency.cc.

◆ ReplaceCurrentFactory() [8/9]

template<>
void pandora::Persistency::ReplaceCurrentFactory ( ObjectFactory< object_creation::Track::Parameters, object_creation::Track::Object > *const  pFactory)
inherited

Definition at line 68 of file Persistency.cc.

◆ ReplaceCurrentFactory() [9/9]

template<typename PARAMETERS , typename OBJECT >
void pandora::Persistency::ReplaceCurrentFactory ( ObjectFactory< PARAMETERS, OBJECT > *const  pFactory)
protectedinherited

Replace the current factory with the provided instance.

Parameters
pFactoryaddress of the factory
Here is the caller graph for this function:

◆ SetFactory()

template<typename PARAMETERS , typename OBJECT >
template StatusCode pandora::Persistency::SetFactory ( ObjectFactory< PARAMETERS, OBJECT > *const  pFactory)
inherited

Set the factory to use for all instantiations and parameter persistence.

Parameters
pFactoryaddress of the factory

Definition at line 49 of file Persistency.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteCaloHit()

StatusCode pandora::XmlFileWriter::WriteCaloHit ( const CaloHit *const  pCaloHit)
privatevirtual

Write a calo hit to the current position in the file.

Parameters
pCaloHitaddress of the calo hit

Implements pandora::FileWriter.

Definition at line 240 of file XmlFileWriter.cc.

Here is the call graph for this function:

◆ WriteCaloHitList()

StatusCode pandora::FileWriter::WriteCaloHitList ( const CaloHitList caloHitList)
privateinherited

Write a calo hit list to the current position in the file.

Parameters
caloHitListthe calo hit list

Definition at line 138 of file FileWriter.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteCaloHitToMCParticleRelationship()

StatusCode pandora::FileWriter::WriteCaloHitToMCParticleRelationship ( const CaloHit *const  pCaloHit)
privateinherited

Write a calo hit to mc particle relationship to the current position in the file.

Parameters
pCaloHitaddress of the calo hit

Definition at line 210 of file FileWriter.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteCaloHitToMCParticleRelationships()

StatusCode pandora::FileWriter::WriteCaloHitToMCParticleRelationships ( const CaloHitList caloHitList)
privateinherited

Write calo hit to mc particle relationships for a specified calo hit list.

Parameters
caloHitListthe calo hit list

Definition at line 162 of file FileWriter.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteDetectorGap()

StatusCode pandora::XmlFileWriter::WriteDetectorGap ( const DetectorGap *const  pDetectorGap)
privatevirtual

Write the detector gap parameters to the file.

Parameters
pDetectorGapaddress of the detector gap

Implements pandora::FileWriter.

Definition at line 172 of file XmlFileWriter.cc.

Here is the call graph for this function:

◆ WriteDetectorGapList()

StatusCode pandora::FileWriter::WriteDetectorGapList ( )
privateinherited

Write the detector gap parameters to the file.

Definition at line 114 of file FileWriter.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteEvent()

StatusCode pandora::FileWriter::WriteEvent ( const CaloHitList caloHitList,
const TrackList trackList,
const MCParticleList mcParticleList,
const bool  writeMCRelationships = true,
const bool  writeTrackRelationships = true 
)
inherited

Write the specified event components to the file.

Parameters
caloHitListthe list of calo hits to write to the file
trackListthe list of tracks to write to the file
mcParticleListthe list of mc particles to write to the file
writeMCRelationshipswhether to write mc relationship information to the file
writeTrackRelationshipswhether to write track relationship information to the file

Definition at line 63 of file FileWriter.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteFooter()

StatusCode pandora::XmlFileWriter::WriteFooter ( )
privatevirtual

Write the container footer to the file.

Implements pandora::FileWriter.

Definition at line 76 of file XmlFileWriter.cc.

◆ WriteGeometry()

StatusCode pandora::FileWriter::WriteGeometry ( )
inherited

Write the current geometry information to the file.

Definition at line 45 of file FileWriter.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteHeader()

StatusCode pandora::XmlFileWriter::WriteHeader ( const ContainerId  containerId)
privatevirtual

Write the container header to the file.

Parameters
containerIdthe container id

Implements pandora::FileWriter.

Definition at line 63 of file XmlFileWriter.cc.

Here is the call graph for this function:

◆ WriteLArTPC()

StatusCode pandora::XmlFileWriter::WriteLArTPC ( const LArTPC *const  pLArTPC)
privatevirtual

Write a lar tpc to the file.

Parameters
pLArTPCaddress of the lar tpc

Implements pandora::FileWriter.

Definition at line 140 of file XmlFileWriter.cc.

Here is the call graph for this function:

◆ WriteLArTPCList()

StatusCode pandora::FileWriter::WriteLArTPCList ( )
privateinherited

Write the lar tpc parameters to the file.

Definition at line 102 of file FileWriter.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteMCParticle()

StatusCode pandora::XmlFileWriter::WriteMCParticle ( const MCParticle *const  pMCParticle)
privatevirtual

Write a mc particle to the current position in the file.

Parameters
pMCParticleaddress of the mc particle

Implements pandora::FileWriter.

Definition at line 310 of file XmlFileWriter.cc.

Here is the call graph for this function:

◆ WriteMCParticleList()

StatusCode pandora::FileWriter::WriteMCParticleList ( const MCParticleList mcParticleList)
privateinherited

Write a mc particle list to the current position in the file.

Parameters
mcParticleListthe mc particle list

Definition at line 150 of file FileWriter.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteMCParticleRelationships() [1/2]

StatusCode pandora::FileWriter::WriteMCParticleRelationships ( const MCParticle *const  pMCParticle)
privateinherited

Write a mc particle parent/daughter relationship to the current position in the file.

Parameters
pMCParticleaddress of the mc particle

Definition at line 254 of file FileWriter.cc.

Here is the call graph for this function:

◆ WriteMCParticleRelationships() [2/2]

StatusCode pandora::FileWriter::WriteMCParticleRelationships ( const MCParticleList mcParticleList)
privateinherited

Write mc particle relationships for a specified mc particle list.

Parameters
mcParticleListthe mc particle list

Definition at line 186 of file FileWriter.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteRelationship()

StatusCode pandora::XmlFileWriter::WriteRelationship ( const RelationshipId  relationshipId,
const void *  address1,
const void *  address2,
const float  weight 
)
privatevirtual

Write a relationship between two objects with specified addresses.

Parameters
relationshipIdthe relationship id
address1first address to write
address2second address to write

Implements pandora::FileWriter.

Definition at line 334 of file XmlFileWriter.cc.

Here is the call graph for this function:

◆ WriteSubDetector()

StatusCode pandora::XmlFileWriter::WriteSubDetector ( const SubDetector *const  pSubDetector)
privatevirtual

Write a sub detector to the file.

Parameters
pSubDetectoraddress of the sub detector

Implements pandora::FileWriter.

Definition at line 88 of file XmlFileWriter.cc.

Here is the call graph for this function:

◆ WriteSubDetectorList()

StatusCode pandora::FileWriter::WriteSubDetectorList ( )
privateinherited

Write the sub detector parameters to the file.

Definition at line 90 of file FileWriter.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteTrack()

StatusCode pandora::XmlFileWriter::WriteTrack ( const Track *const  pTrack)
privatevirtual

Write a track to the current position in the file.

Parameters
pTrackaddress of the track

Implements pandora::FileWriter.

Definition at line 278 of file XmlFileWriter.cc.

Here is the call graph for this function:

◆ WriteTrackList()

StatusCode pandora::FileWriter::WriteTrackList ( const TrackList trackList)
privateinherited

Write a track list to the current position in the file.

Parameters
trackListthe track list

Definition at line 126 of file FileWriter.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteTrackRelationships() [1/2]

StatusCode pandora::FileWriter::WriteTrackRelationships ( const Track *const  pTrack)
privateinherited

Write a track sibling or parent/daughter relationship to the current position in the file.

Parameters
pTrackaddress of the track

Definition at line 278 of file FileWriter.cc.

Here is the call graph for this function:

◆ WriteTrackRelationships() [2/2]

StatusCode pandora::FileWriter::WriteTrackRelationships ( const TrackList trackList)
privateinherited

Write track relationships for a specified list of tracks.

Parameters
trackListthe track list

Definition at line 198 of file FileWriter.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteTrackToMCParticleRelationship()

StatusCode pandora::FileWriter::WriteTrackToMCParticleRelationship ( const Track *const  pTrack)
privateinherited

Write a track to mc particle relationship to the current position in the file.

Parameters
pTrackaddress of the track

Definition at line 232 of file FileWriter.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteTrackToMCParticleRelationships()

StatusCode pandora::FileWriter::WriteTrackToMCParticleRelationships ( const TrackList trackList)
privateinherited

Write track to mc particle relationships for a specified track list.

Parameters
trackListthe track list

Definition at line 174 of file FileWriter.cc.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteVariable() [1/3]

template<>
StatusCode pandora::XmlFileWriter::WriteVariable ( const std::string &  xmlKey,
const CartesianVector t 
)
inline

Definition at line 83 of file XmlFileWriter.h.

Here is the call graph for this function:

◆ WriteVariable() [2/3]

template<typename T >
StatusCode pandora::XmlFileWriter::WriteVariable ( const std::string &  xmlKey,
const T &  t 
)
inline

Write a variable to the file.

Parameters
xmlKeythe xml key

Definition at line 70 of file XmlFileWriter.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ WriteVariable() [3/3]

template<>
StatusCode pandora::XmlFileWriter::WriteVariable ( const std::string &  xmlKey,
const TrackState t 
)
inline

Definition at line 89 of file XmlFileWriter.h.

Here is the call graph for this function:

Member Data Documentation

◆ m_containerId

ContainerId pandora::Persistency::m_containerId
protectedinherited

The type of container currently being written to file.

Definition at line 76 of file Persistency.h.

◆ m_fileName

std::string pandora::Persistency::m_fileName
protectedinherited

The file name.

Definition at line 74 of file Persistency.h.

◆ m_fileType

FileType pandora::Persistency::m_fileType
protectedinherited

The file type.

Definition at line 75 of file Persistency.h.

◆ m_pBoxGapFactory

Address of the box gap factory.

Definition at line 84 of file Persistency.h.

◆ m_pCaloHitFactory

ObjectFactory<object_creation::CaloHit::Parameters, object_creation::CaloHit::Object>* pandora::Persistency::m_pCaloHitFactory
protectedinherited

Address of the calo hit factory.

Definition at line 78 of file Persistency.h.

◆ m_pConcentricGapFactory

Address of the concentric gap factory.

Definition at line 85 of file Persistency.h.

◆ m_pContainerXmlElement

TiXmlElement* pandora::XmlFileWriter::m_pContainerXmlElement
private

The container xml element.

Definition at line 63 of file XmlFileWriter.h.

◆ m_pCurrentXmlElement

TiXmlElement* pandora::XmlFileWriter::m_pCurrentXmlElement
private

The current xml element.

Definition at line 64 of file XmlFileWriter.h.

◆ m_pLArTPCFactory

Address of the lar tpc factory.

Definition at line 82 of file Persistency.h.

◆ m_pLineGapFactory

Address of the line gap factory.

Definition at line 83 of file Persistency.h.

◆ m_pMCParticleFactory

ObjectFactory<object_creation::MCParticle::Parameters, object_creation::MCParticle::Object>* pandora::Persistency::m_pMCParticleFactory
protectedinherited

Address of the mc particle factory.

Definition at line 80 of file Persistency.h.

◆ m_pPandora

const Pandora* const pandora::Persistency::m_pPandora
protectedinherited

Address of pandora instance to be used alongside the file writer.

Definition at line 73 of file Persistency.h.

◆ m_pSubDetectorFactory

Address of the sub detector factory.

Definition at line 81 of file Persistency.h.

◆ m_pTrackFactory

ObjectFactory<object_creation::Track::Parameters, object_creation::Track::Object>* pandora::Persistency::m_pTrackFactory
protectedinherited

Address of the track factory.

Definition at line 79 of file Persistency.h.

◆ m_pXmlDocument

TiXmlDocument* pandora::XmlFileWriter::m_pXmlDocument
private

The xml document.

Definition at line 62 of file XmlFileWriter.h.


The documentation for this class was generated from the following files: