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

BinaryFileReader class. More...

#include "BinaryFileReader.h"

Inheritance diagram for pandora::BinaryFileReader:
Collaboration diagram for pandora::BinaryFileReader:

Public Member Functions

 BinaryFileReader (const pandora::Pandora &pandora, const std::string &fileName)
 Constructor.
 
 ~BinaryFileReader ()
 Destructor.
 
template<typename T >
StatusCode ReadVariable (T &t)
 Read a variable from the file.
 
template<>
StatusCode ReadVariable (std::string &t)
 
template<>
StatusCode ReadVariable (CartesianVector &t)
 
template<>
StatusCode ReadVariable (TrackState &t)
 
StatusCode ReadGeometry ()
 Read the current geometry information from the file.
 
StatusCode ReadEvent ()
 Read an entire pandora event from the file, recreating the stored objects.
 
StatusCode GoToNextGeometry ()
 Skip to next geometry container in the file.
 
StatusCode GoToNextEvent ()
 Skip to next event container in 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 ReadHeader ()
 Read the container header from the current position in the file, checking for properly written container.
 
StatusCode GoToNextContainer ()
 Skip to next container in the file.
 
ContainerId GetNextContainerId ()
 Get the id of the next container in the file without changing the current position in the file.
 
StatusCode GoToGeometry (const unsigned int geometryNumber)
 Skip to a specified geometry number in the file.
 
StatusCode GoToEvent (const unsigned int eventNumber)
 Skip to a specified event number in the file.
 
StatusCode ReadNextGeometryComponent ()
 Read the next pandora geometry component from the current position in the file, recreating the stored component.
 
StatusCode ReadNextEventComponent ()
 Read the next pandora event component from the current position in the file, recreating the stored component.
 
StatusCode ReadSubDetector (bool checkComponentId=true)
 Read a sub detector from the current position in the file.
 
StatusCode ReadLArTPC (bool checkComponentId=true)
 Read a lar tpc from the current position in the file.
 
StatusCode ReadLineGap (bool checkComponentId=true)
 Read a line gap from the current position in the file.
 
StatusCode ReadBoxGap (bool checkComponentId=true)
 Read a box gap from the current position in the file.
 
StatusCode ReadConcentricGap (bool checkComponentId=true)
 Read a concentric gap from the current position in the file.
 
StatusCode ReadCaloHit (bool checkComponentId=true)
 Read a calo hit from the current position in the file, recreating the stored object.
 
StatusCode ReadTrack (bool checkComponentId=true)
 Read a track from the current position in the file, recreating the stored object.
 
StatusCode ReadMCParticle (bool checkComponentId=true)
 Read a mc particle from the current position in the file, recreating the stored object.
 
StatusCode ReadRelationship (bool checkComponentId=true)
 Read a relationship from the current position in the file, recreating the stored relationship.
 

Private Attributes

std::ifstream::pos_type m_containerPosition
 Position of start of the current event/geometry container object in file.
 
std::ifstream::pos_type m_containerSize
 Size of the current event/geometry container object in the file.
 
std::ifstream m_fileStream
 The stream class to read from the file.
 

Detailed Description

BinaryFileReader class.

Definition at line 26 of file BinaryFileReader.h.

Constructor & Destructor Documentation

◆ BinaryFileReader()

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

Constructor.

Parameters
pandorathe pandora instance to be used alongside the file reader
fileNamethe name of the file containing the pandora objects

Definition at line 19 of file BinaryFileReader.cc.

◆ ~BinaryFileReader()

pandora::BinaryFileReader::~BinaryFileReader ( )

Destructor.

Definition at line 33 of file BinaryFileReader.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:

◆ GetNextContainerId()

ContainerId pandora::BinaryFileReader::GetNextContainerId ( )
privatevirtual

Get the id of the next container in the file without changing the current position in the file.

Returns
The id of the next container in the file

Implements pandora::FileReader.

Definition at line 77 of file BinaryFileReader.cc.

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

◆ GoToEvent()

StatusCode pandora::BinaryFileReader::GoToEvent ( const unsigned int  eventNumber)
privatevirtual

Skip to a specified event number in the file.

Parameters
eventNumberthe event number

Implements pandora::FileReader.

Definition at line 125 of file BinaryFileReader.cc.

Here is the call graph for this function:

◆ GoToGeometry()

StatusCode pandora::BinaryFileReader::GoToGeometry ( const unsigned int  geometryNumber)
privatevirtual

Skip to a specified geometry number in the file.

Parameters
geometryNumberthe geometry number

Implements pandora::FileReader.

Definition at line 103 of file BinaryFileReader.cc.

Here is the call graph for this function:

◆ GoToNextContainer()

StatusCode pandora::BinaryFileReader::GoToNextContainer ( )
privatevirtual

Skip to next container in the file.

Implements pandora::FileReader.

Definition at line 64 of file BinaryFileReader.cc.

Here is the call graph for this function:

◆ GoToNextEvent()

StatusCode pandora::FileReader::GoToNextEvent ( )
inherited

Skip to next event container in the file.

Definition at line 97 of file FileReader.cc.

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

◆ GoToNextGeometry()

StatusCode pandora::FileReader::GoToNextGeometry ( )
inherited

Skip to next geometry container in the file.

Definition at line 84 of file FileReader.cc.

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

◆ ReadBoxGap()

StatusCode pandora::BinaryFileReader::ReadBoxGap ( bool  checkComponentId = true)
private

Read a box gap from the current position in the file.

Parameters
checkComponentIdwhether to check the component id before deserializing

Definition at line 434 of file BinaryFileReader.cc.

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

◆ ReadCaloHit()

StatusCode pandora::BinaryFileReader::ReadCaloHit ( bool  checkComponentId = true)
private

Read a calo hit from the current position in the file, recreating the stored object.

Parameters
checkComponentIdwhether to check the component id before deserializing

Definition at line 540 of file BinaryFileReader.cc.

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

◆ ReadConcentricGap()

StatusCode pandora::BinaryFileReader::ReadConcentricGap ( bool  checkComponentId = true)
private

Read a concentric gap from the current position in the file.

Parameters
checkComponentIdwhether to check the component id before deserializing

Definition at line 481 of file BinaryFileReader.cc.

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

◆ ReadEvent()

StatusCode pandora::FileReader::ReadEvent ( )
inherited

Read an entire pandora event from the file, recreating the stored objects.

Definition at line 58 of file FileReader.cc.

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

◆ ReadGeometry()

StatusCode pandora::FileReader::ReadGeometry ( )
inherited

Read the current geometry information from the file.

Definition at line 29 of file FileReader.cc.

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

◆ ReadHeader()

StatusCode pandora::BinaryFileReader::ReadHeader ( )
privatevirtual

Read the container header from the current position in the file, checking for properly written container.

Implements pandora::FileReader.

Definition at line 40 of file BinaryFileReader.cc.

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

◆ ReadLArTPC()

StatusCode pandora::BinaryFileReader::ReadLArTPC ( bool  checkComponentId = true)
private

Read a lar tpc from the current position in the file.

Parameters
checkComponentIdwhether to check the component id before deserializing

Definition at line 303 of file BinaryFileReader.cc.

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

◆ ReadLineGap()

StatusCode pandora::BinaryFileReader::ReadLineGap ( bool  checkComponentId = true)
private

Read a line gap from the current position in the file.

Parameters
checkComponentIdwhether to check the component id before deserializing

Definition at line 384 of file BinaryFileReader.cc.

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

◆ ReadMCParticle()

StatusCode pandora::BinaryFileReader::ReadMCParticle ( bool  checkComponentId = true)
private

Read a mc particle from the current position in the file, recreating the stored object.

Parameters
checkComponentIdwhether to check the component id before deserializing

Definition at line 715 of file BinaryFileReader.cc.

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

◆ ReadNextEventComponent()

StatusCode pandora::BinaryFileReader::ReadNextEventComponent ( )
privatevirtual

Read the next pandora event component from the current position in the file, recreating the stored component.

Implements pandora::FileReader.

Definition at line 182 of file BinaryFileReader.cc.

Here is the call graph for this function:

◆ ReadNextGeometryComponent()

StatusCode pandora::BinaryFileReader::ReadNextGeometryComponent ( )
privatevirtual

Read the next pandora geometry component from the current position in the file, recreating the stored component.

Implements pandora::FileReader.

Definition at line 147 of file BinaryFileReader.cc.

Here is the call graph for this function:

◆ ReadRelationship()

StatusCode pandora::BinaryFileReader::ReadRelationship ( bool  checkComponentId = true)
private

Read a relationship from the current position in the file, recreating the stored relationship.

Parameters
checkComponentIdwhether to check the component id before deserializing

Definition at line 771 of file BinaryFileReader.cc.

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

◆ ReadSubDetector()

StatusCode pandora::BinaryFileReader::ReadSubDetector ( bool  checkComponentId = true)
private

Read a sub detector from the current position in the file.

Parameters
checkComponentIdwhether to check the component id before deserializing

Definition at line 215 of file BinaryFileReader.cc.

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

◆ ReadTrack()

StatusCode pandora::BinaryFileReader::ReadTrack ( bool  checkComponentId = true)
private

Read a track from the current position in the file, recreating the stored object.

Parameters
checkComponentIdwhether to check the component id before deserializing

Definition at line 635 of file BinaryFileReader.cc.

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

◆ ReadVariable() [1/4]

template<>
StatusCode pandora::BinaryFileReader::ReadVariable ( CartesianVector t)
inline

Definition at line 164 of file BinaryFileReader.h.

Here is the call graph for this function:

◆ ReadVariable() [2/4]

template<>
StatusCode pandora::BinaryFileReader::ReadVariable ( std::string &  t)
inline

Definition at line 143 of file BinaryFileReader.h.

Here is the call graph for this function:

◆ ReadVariable() [3/4]

template<typename T >
StatusCode pandora::BinaryFileReader::ReadVariable ( T &  t)
inline

Read a variable from the file.

Definition at line 128 of file BinaryFileReader.h.

Here is the caller graph for this function:

◆ ReadVariable() [4/4]

template<>
StatusCode pandora::BinaryFileReader::ReadVariable ( TrackState t)
inline

Definition at line 176 of file BinaryFileReader.h.

Here is the call 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:

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_containerPosition

std::ifstream::pos_type pandora::BinaryFileReader::m_containerPosition
private

Position of start of the current event/geometry container object in file.

Definition at line 120 of file BinaryFileReader.h.

◆ m_containerSize

std::ifstream::pos_type pandora::BinaryFileReader::m_containerSize
private

Size of the current event/geometry container object in the file.

Definition at line 121 of file BinaryFileReader.h.

◆ m_fileName

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

The file name.

Definition at line 74 of file Persistency.h.

◆ m_fileStream

std::ifstream pandora::BinaryFileReader::m_fileStream
private

The stream class to read from the file.

Definition at line 122 of file BinaryFileReader.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: