Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-27 09:20:25

0001 /**
0002  *  @file   PandoraSDK/include/Persistency/FileReader.h
0003  *
0004  *  @brief  Header file for the file reader class.
0005  *
0006  *  $Log: $
0007  */
0008 #ifndef PANDORA_FILE_READER_H
0009 #define PANDORA_FILE_READER_H 1
0010 
0011 #include "Pandora/StatusCodes.h"
0012 
0013 #include "Persistency/PandoraIO.h"
0014 #include "Persistency/Persistency.h"
0015 
0016 #include <string>
0017 
0018 namespace pandora
0019 {
0020 
0021 class Pandora;
0022 
0023 //------------------------------------------------------------------------------------------------------------------------------------------
0024 
0025 /**
0026  *  @brief  FileReader class
0027  */
0028 class FileReader : public Persistency
0029 {
0030 public:
0031     /**
0032      *  @brief  Constructor
0033      *
0034      *  @param  pandora the pandora instance to be used alongside the file reader
0035      *  @param  fileName the name of the file containing the pandora objects
0036      */
0037     FileReader(const pandora::Pandora &pandora, const std::string &fileName);
0038 
0039     /**
0040      *  @brief  Destructor
0041      */
0042     virtual ~FileReader();
0043 
0044     /**
0045      *  @brief  Read the global header information from the file
0046      */
0047     StatusCode ReadGlobalHeader();
0048 
0049     /**
0050      *  @brief  Read the current geometry information from the file
0051      */
0052     StatusCode ReadGeometry();
0053 
0054     /**
0055      *  @brief  Read an entire pandora event from the file, recreating the stored objects
0056      */
0057     StatusCode ReadEvent();
0058 
0059     /**
0060      *  @brief  Skip to global header container in the file
0061      */
0062     StatusCode GoToGlobalHeader();
0063 
0064     /**
0065      *  @brief  Skip to next geometry container in the file
0066      */
0067     StatusCode GoToNextGeometry();
0068 
0069     /**
0070      *  @brief  Skip to next event container in the file
0071      */
0072     StatusCode GoToNextEvent();
0073 
0074     /**
0075      *  @brief  Skip to a specified geometry number in the file
0076      *
0077      *  @param  geometryNumber the geometry number
0078      */
0079     virtual StatusCode GoToGeometry(const unsigned int geometryNumber) = 0;
0080 
0081     /**
0082      *  @brief  Skip to a specified event number in the file
0083      *
0084      *  @param  eventNumber the event number
0085      */
0086     virtual StatusCode GoToEvent(const unsigned int eventNumber) = 0;
0087 
0088 protected:
0089     /**
0090      *  @brief  Read the container header from the current position in the file, checking for properly written container
0091      */
0092     virtual StatusCode ReadHeader() = 0;
0093 
0094     /**
0095      *  @brief  Skip to next container in the file
0096      */
0097     virtual StatusCode GoToNextContainer() = 0;
0098 
0099     /**
0100      *  @brief  Get the id of the next container in the file without changing the current position in the file
0101      *
0102      *  @return The id of the next container in the file
0103      */
0104     virtual ContainerId GetNextContainerId() = 0;
0105 
0106     /**
0107      *  @brief  Read the next pandora global header component from the current position in the file, recreating the stored component
0108      */
0109     virtual StatusCode ReadNextGlobalHeaderComponent() = 0;
0110 
0111     /**
0112      *  @brief  Read the next pandora geometry component from the current position in the file, recreating the stored component
0113      */
0114     virtual StatusCode ReadNextGeometryComponent() = 0;
0115 
0116     /**
0117      *  @brief  Read the next pandora event component from the current position in the file, recreating the stored component
0118      */
0119     virtual StatusCode ReadNextEventComponent() = 0;
0120 
0121     unsigned int m_fileMajorVersion; ///< The major version of the input file
0122     unsigned int m_fileMinorVersion; ///< The minor version of the input file
0123 };
0124 
0125 } // namespace pandora
0126 
0127 #endif // #ifndef PANDORA_FILE_READER_H