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/EventReadingAlgorithm.h
0003  * 
0004  *  @brief  Header file for the event reading algorithm class.
0005  * 
0006  *  $Log: $
0007  */
0008 #ifndef EVENT_READING_ALGORITHM_H
0009 #define EVENT_READING_ALGORITHM_H 1
0010 
0011 #include "Pandora/ExternallyConfiguredAlgorithm.h"
0012 
0013 #include "Pandora/PandoraInputTypes.h"
0014 
0015 #include "Persistency/PandoraIO.h"
0016 
0017 namespace pandora {class FileReader;}
0018 
0019 //------------------------------------------------------------------------------------------------------------------------------------------
0020 
0021 /**
0022  *  @brief  EventReadingAlgorithm class
0023  */
0024 class EventReadingAlgorithm : public pandora::ExternallyConfiguredAlgorithm
0025 {
0026 public:
0027     /**
0028      *  @brief  Factory class for instantiating algorithm
0029      */
0030     class Factory : public pandora::AlgorithmFactory
0031     {
0032     public:
0033         pandora::Algorithm *CreateAlgorithm() const;
0034     };
0035 
0036     /**
0037      *  @brief  Default constructor
0038      */
0039     EventReadingAlgorithm();
0040 
0041     /**
0042      *  @brief  Destructor
0043      */
0044     ~EventReadingAlgorithm();
0045 
0046     /**
0047      *  @brief  External event reading parameters class
0048      */
0049     class ExternalEventReadingParameters : public pandora::ExternalParameters
0050     {
0051     public:
0052         std::string             m_geometryFileName;             ///< Name of the file containing geometry information
0053         std::string             m_eventFileNameList;            ///< Colon-separated list of file names to be processed
0054         pandora::InputUInt      m_skipToEvent;                  ///< Index of first event to consider in input file
0055     };
0056 
0057 protected:
0058     pandora::StatusCode Initialize();
0059     pandora::StatusCode Run();
0060 
0061     /**
0062      *  @brief  Proceed to process next event file named in the input list
0063      */
0064     void MoveToNextEventFile();
0065 
0066     /**
0067      *  @brief  Replace the current event file reader with a new reader for the specified file
0068      *
0069      *  @param  fileName the file name
0070      */
0071     pandora::StatusCode ReplaceEventFileReader(const std::string &fileName);
0072 
0073     /**
0074      *  @brief  Analyze a provided file name to extract the file type/extension
0075      *
0076      *  @param  fileName the file name
0077      *
0078      *  @return the file type
0079      */
0080     pandora::FileType GetFileType(const std::string &fileName) const;
0081 
0082     pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
0083 
0084     std::string                 m_geometryFileName;             ///< Name of the file containing geometry information
0085     std::string                 m_eventFileName;                ///< Name of the current file containing event information
0086     pandora::StringVector       m_eventFileNameVector;          ///< Vector of file names to be processed
0087 
0088     unsigned int                m_skipToEvent;                  ///< Index of first event to consider in first input file
0089 
0090     pandora::FileReader        *m_pEventFileReader;             ///< Address of the event file reader
0091 };
0092 
0093 //------------------------------------------------------------------------------------------------------------------------------------------
0094 
0095 inline pandora::Algorithm *EventReadingAlgorithm::Factory::CreateAlgorithm() const
0096 {
0097     return new EventReadingAlgorithm();
0098 }
0099 
0100 #endif // #ifndef EVENT_READING_ALGORITHM_H