Pandora
Pandora source code navigator
Loading...
Searching...
No Matches
pandora::FileWriter Class Referenceabstract

FileWriter class. More...

#include "FileWriter.h"

Inheritance diagram for pandora::FileWriter:
Collaboration diagram for pandora::FileWriter:

Public Member Functions

 FileWriter (const pandora::Pandora &pandora, const std::string &fileName)
 Constructor.
 
virtual ~FileWriter ()
 Destructor.
 
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

virtual StatusCode WriteHeader (const ContainerId containerId)=0
 Write the container header to the file.
 
virtual StatusCode WriteFooter ()=0
 Write the container footer to the file.
 
virtual StatusCode WriteSubDetector (const SubDetector *const pSubDetector)=0
 Write a sub detector to the file.
 
virtual StatusCode WriteLArTPC (const LArTPC *const pLArTPC)=0
 Write a lar tpc to the file.
 
virtual StatusCode WriteDetectorGap (const DetectorGap *const pDetectorGap)=0
 Write the detector gap parameters to the file.
 
virtual StatusCode WriteCaloHit (const CaloHit *const pCaloHit)=0
 Write a calo hit to the current position in the file.
 
virtual StatusCode WriteTrack (const Track *const pTrack)=0
 Write a track to the current position in the file.
 
virtual StatusCode WriteMCParticle (const MCParticle *const pMCParticle)=0
 Write a mc particle to the current position in the file.
 
virtual StatusCode WriteRelationship (const RelationshipId relationshipId, const void *address1, const void *address2, const float weight=1.f)=0
 Write a relationship between two objects with specified addresses.
 
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 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 WriteTrackRelationships (const TrackList &trackList)
 Write track relationships for a specified list of tracks.
 
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.
 
StatusCode WriteMCParticleRelationships (const MCParticle *const pMCParticle)
 Write a mc particle parent/daughter relationship to the current position in the file.
 
StatusCode WriteTrackRelationships (const Track *const pTrack)
 Write a track sibling or parent/daughter relationship to the current position in the file.
 

Detailed Description

FileWriter class.

Definition at line 28 of file FileWriter.h.

Constructor & Destructor Documentation

◆ FileWriter()

pandora::FileWriter::FileWriter ( const pandora::Pandora pandora,
const std::string &  fileName 
)

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 32 of file FileWriter.cc.

◆ ~FileWriter()

pandora::FileWriter::~FileWriter ( )
virtual

Destructor.

Definition at line 39 of file FileWriter.cc.

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()

virtual StatusCode pandora::FileWriter::WriteCaloHit ( const CaloHit *const  pCaloHit)
protectedpure virtual

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

Parameters
pCaloHitaddress of the calo hit

Implemented in pandora::BinaryFileWriter, and pandora::XmlFileWriter.

Here is the caller graph for this function:

◆ WriteCaloHitList()

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

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)
private

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)
private

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()

virtual StatusCode pandora::FileWriter::WriteDetectorGap ( const DetectorGap *const  pDetectorGap)
protectedpure virtual

Write the detector gap parameters to the file.

Parameters
pDetectorGapaddress of the detector gap

Implemented in pandora::BinaryFileWriter, and pandora::XmlFileWriter.

Here is the caller graph for this function:

◆ WriteDetectorGapList()

StatusCode pandora::FileWriter::WriteDetectorGapList ( )
private

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 
)

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()

virtual StatusCode pandora::FileWriter::WriteFooter ( )
protectedpure virtual

Write the container footer to the file.

Implemented in pandora::BinaryFileWriter, and pandora::XmlFileWriter.

Here is the caller graph for this function:

◆ WriteGeometry()

StatusCode pandora::FileWriter::WriteGeometry ( )

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()

virtual StatusCode pandora::FileWriter::WriteHeader ( const ContainerId  containerId)
protectedpure virtual

Write the container header to the file.

Parameters
containerIdthe container id

Implemented in pandora::BinaryFileWriter, and pandora::XmlFileWriter.

Here is the caller graph for this function:

◆ WriteLArTPC()

virtual StatusCode pandora::FileWriter::WriteLArTPC ( const LArTPC *const  pLArTPC)
protectedpure virtual

Write a lar tpc to the file.

Parameters
pLArTPCaddress of the lar tpc

Implemented in pandora::BinaryFileWriter, and pandora::XmlFileWriter.

Here is the caller graph for this function:

◆ WriteLArTPCList()

StatusCode pandora::FileWriter::WriteLArTPCList ( )
private

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()

virtual StatusCode pandora::FileWriter::WriteMCParticle ( const MCParticle *const  pMCParticle)
protectedpure virtual

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

Parameters
pMCParticleaddress of the mc particle

Implemented in pandora::BinaryFileWriter, and pandora::XmlFileWriter.

Here is the caller graph for this function:

◆ WriteMCParticleList()

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

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)
private

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)
private

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()

virtual StatusCode pandora::FileWriter::WriteRelationship ( const RelationshipId  relationshipId,
const void *  address1,
const void *  address2,
const float  weight = 1.f 
)
protectedpure virtual

Write a relationship between two objects with specified addresses.

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

Implemented in pandora::BinaryFileWriter, and pandora::XmlFileWriter.

Here is the caller graph for this function:

◆ WriteSubDetector()

virtual StatusCode pandora::FileWriter::WriteSubDetector ( const SubDetector *const  pSubDetector)
protectedpure virtual

Write a sub detector to the file.

Parameters
pSubDetectoraddress of the sub detector

Implemented in pandora::BinaryFileWriter, and pandora::XmlFileWriter.

Here is the caller graph for this function:

◆ WriteSubDetectorList()

StatusCode pandora::FileWriter::WriteSubDetectorList ( )
private

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()

virtual StatusCode pandora::FileWriter::WriteTrack ( const Track *const  pTrack)
protectedpure virtual

Write a track to the current position in the file.

Parameters
pTrackaddress of the track

Implemented in pandora::BinaryFileWriter, and pandora::XmlFileWriter.

Here is the caller graph for this function:

◆ WriteTrackList()

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

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)
private

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)
private

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)
private

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)
private

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:

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_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.


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