Back to home page

EIC code displayed by LXR

 
 

    


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

0001 /**
0002  *  @file   PandoraSDK/include/Pandora/PandoraIO.h
0003  *
0004  *  @brief  Header file for pandora io structures.
0005  *
0006  *  $Log: $
0007  */
0008 #ifndef PANDORA_IO_H
0009 #define PANDORA_IO_H 1
0010 
0011 #include <string>
0012 
0013 namespace pandora
0014 {
0015 
0016 const std::string PANDORA_FILE_HASH("pandora"); ///< Look for hash each event to check integrity
0017 
0018 //------------------------------------------------------------------------------------------------------------------------------------------
0019 
0020 /**
0021  *  @brief  The container identification enum
0022  */
0023 enum ContainerId
0024 {
0025     EVENT_CONTAINER,
0026     GEOMETRY_CONTAINER,
0027     HEADER_CONTAINER,
0028     UNKNOWN_CONTAINER
0029 };
0030 
0031 //------------------------------------------------------------------------------------------------------------------------------------------
0032 
0033 /**
0034  *  @brief  The component identification enum
0035  */
0036 enum ComponentId
0037 {
0038     CALO_HIT_COMPONENT,
0039     TRACK_COMPONENT,
0040     MC_PARTICLE_COMPONENT,
0041     RELATIONSHIP_COMPONENT,
0042     EVENT_END_COMPONENT,
0043     SUB_DETECTOR_COMPONENT,
0044     LINE_GAP_COMPONENT,
0045     BOX_GAP_COMPONENT,
0046     CONCENTRIC_GAP_COMPONENT,
0047     GEOMETRY_END_COMPONENT,
0048     LAR_TPC_COMPONENT,
0049     EVENT_INFO_COMPONENT,
0050     VERSION_COMPONENT,
0051     HEADER_END_COMPONENT,
0052     UNKNOWN_COMPONENT
0053 };
0054 
0055 //------------------------------------------------------------------------------------------------------------------------------------------
0056 
0057 /**
0058  *  @brief  The relationship identification enum
0059  */
0060 enum RelationshipId
0061 {
0062     CALO_HIT_TO_MC_RELATIONSHIP,
0063     TRACK_TO_MC_RELATIONSHIP,
0064     MC_PARENT_DAUGHTER_RELATIONSHIP,
0065     TRACK_PARENT_DAUGHTER_RELATIONSHIP,
0066     TRACK_SIBLING_RELATIONSHIP,
0067     UNKNOWN_RELATIONSHIP
0068 };
0069 
0070 //------------------------------------------------------------------------------------------------------------------------------------------
0071 
0072 /**
0073  *  @brief  The file type enum
0074  */
0075 enum FileType
0076 {
0077     BINARY,
0078     XML,
0079     UNKNOWN_FILE_TYPE
0080 };
0081 
0082 //------------------------------------------------------------------------------------------------------------------------------------------
0083 
0084 /**
0085  *  @brief  The file mode enum
0086  */
0087 enum FileMode
0088 {
0089     APPEND,
0090     OVERWRITE,
0091     UNKNOWN_MODE
0092 };
0093 
0094 //------------------------------------------------------------------------------------------------------------------------------------------
0095 //------------------------------------------------------------------------------------------------------------------------------------------
0096 
0097 /**
0098  *  @brief  Stop processing exception class
0099  */
0100 class StopProcessingException
0101 {
0102 public:
0103     /**
0104      *  @brief  Constructor
0105      *
0106      *  @param  description the description of the context under which exception was raised
0107      */
0108     StopProcessingException(const std::string &description);
0109 
0110     /**
0111      *  @brief  Copy constructor
0112      *
0113      *  @param  rhs the instance to copy
0114      */
0115     StopProcessingException(const StopProcessingException &rhs);
0116 
0117     /**
0118      *  @brief  Destructor
0119      */
0120     ~StopProcessingException();
0121 
0122     /**
0123      *  @brief  Get the description of the context under which exception was raised
0124      *
0125      *  @return the description
0126      */
0127     const std::string &GetDescription() const;
0128 
0129 private:
0130     const std::string m_description; ///< Description of the context under which exception was raised
0131 };
0132 
0133 //------------------------------------------------------------------------------------------------------------------------------------------
0134 
0135 inline StopProcessingException::StopProcessingException(const std::string &description) :
0136     m_description(description)
0137 {
0138 }
0139 
0140 //------------------------------------------------------------------------------------------------------------------------------------------
0141 
0142 inline StopProcessingException::StopProcessingException(const StopProcessingException &rhs) :
0143     m_description(rhs.GetDescription())
0144 {
0145 }
0146 
0147 //------------------------------------------------------------------------------------------------------------------------------------------
0148 
0149 inline StopProcessingException::~StopProcessingException()
0150 {
0151 }
0152 
0153 //------------------------------------------------------------------------------------------------------------------------------------------
0154 
0155 inline const std::string &StopProcessingException::GetDescription() const
0156 {
0157     return m_description;
0158 }
0159 
0160 } // namespace pandora
0161 
0162 #endif // #ifndef PANDORA_IO_H