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/EventWritingAlgorithm.h
0003  * 
0004  *  @brief  Header file for the event writing algorithm class.
0005  * 
0006  *  $Log: $
0007  */
0008 #ifndef EVENT_WRITING_ALGORITHM_H
0009 #define EVENT_WRITING_ALGORITHM_H 1
0010 
0011 #include "Pandora/Algorithm.h"
0012 
0013 #include "Persistency/PandoraIO.h"
0014 
0015 namespace pandora {class FileWriter;}
0016 
0017 //------------------------------------------------------------------------------------------------------------------------------------------
0018 
0019 /**
0020  *  @brief  EventWritingAlgorithm class
0021  */
0022 class EventWritingAlgorithm : public pandora::Algorithm
0023 {
0024 public:
0025     /**
0026      *  @brief  Factory class for instantiating algorithm
0027      */
0028     class Factory : public pandora::AlgorithmFactory
0029     {
0030     public:
0031         pandora::Algorithm *CreateAlgorithm() const;
0032     };
0033 
0034     /**
0035      *  @brief  Default constructor
0036      */
0037     EventWritingAlgorithm();
0038 
0039     /**
0040      *  @brief  Destructor
0041      */
0042     ~EventWritingAlgorithm();
0043 
0044 protected:
0045     pandora::StatusCode Initialize();
0046     pandora::StatusCode Run();
0047     pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle);
0048 
0049     pandora::FileType       m_geometryFileType;             ///< The geometry file type
0050     pandora::FileType       m_eventFileType;                ///< The event file type
0051 
0052     bool                    m_shouldWriteGeometry;          ///< Whether to write geometry to a specified file
0053     std::string             m_geometryFileName;             ///< Name of the output geometry file
0054 
0055     bool                    m_shouldWriteEvents;            ///< Whether to write events to a specified file
0056     std::string             m_eventFileName;                ///< Name of the output event file
0057 
0058     bool                    m_shouldWriteMCRelationships;   ///< Whether to write mc relationship information to the events file
0059     bool                    m_shouldWriteTrackRelationships;///< Whether to write track relationship information to the events file
0060 
0061     bool                    m_shouldOverwriteEventFile;     ///< Whether to overwrite existing event file with specified name, or append
0062     bool                    m_shouldOverwriteGeometryFile;  ///< Whether to overwrite existing geometry file with specified name, or append
0063 
0064     pandora::FileWriter    *m_pEventFileWriter;             ///< Address of the event file writer
0065 };
0066 
0067 //------------------------------------------------------------------------------------------------------------------------------------------
0068 
0069 inline pandora::Algorithm *EventWritingAlgorithm::Factory::CreateAlgorithm() const
0070 {
0071     return new EventWritingAlgorithm();
0072 }
0073 
0074 #endif // #ifndef EVENT_WRITING_ALGORITHM_H