CASToR  1.0
Tomographic Reconstruction (PET/SPECT)
vEvent.cc
Go to the documentation of this file.
00001 
00002 /*
00003   Implementation of class vEvent
00004 
00005   - separators: X
00006   - doxygen: X
00007   - default initialization: X
00008   - CASTOR_DEBUG: none
00009   - CASTOR_VERBOSE: none
00010 */
00011 
00020 #include "vEvent.hh"
00021 #include "vDataFile.hh"
00022 #include "sOutputManager.hh"
00023 
00024 
00025 // =====================================================================
00026 // ---------------------------------------------------------------------
00027 // ---------------------------------------------------------------------
00028 // =====================================================================
00029 /*
00030   Constructor()
00031 */
00032 vEvent::vEvent()
00033 {
00034   m_timeInMs=0;
00035   m_nbLines=0;
00036   mp_ID1=NULL;
00037   mp_ID2=NULL;
00038   m_dataType = TYPE_UNKNOWN;
00039   m_dataMode = MODE_UNKNOWN;
00040   m_verbose=-1;
00041   m_eventValue = 0.;
00042 }
00043 
00044 
00045 
00046 // =====================================================================
00047 // ---------------------------------------------------------------------
00048 // ---------------------------------------------------------------------
00049 // =====================================================================
00050 /*
00051   Destructor()
00052 */
00053 vEvent::~vEvent() 
00054 {
00055   if(mp_ID1 != NULL) delete mp_ID1;
00056   if(mp_ID1 != NULL) delete mp_ID2;
00057 }
00058 
00059 
00060 
00061 // =====================================================================
00062 // ---------------------------------------------------------------------
00063 // ---------------------------------------------------------------------
00064 // =====================================================================
00065 /*
00066   \fn AllocateID()
00067   \brief Instantiate the mp_ID1 and mp_ID2 indices arrays
00068   \details This function instantiate the mp_ID1 and mp_ID2 indices arrays using the m_nbLines filed (assuming it has been initialized before,
00069            and call the AllocateSpecificData() function implemented in child classes
00070 */
00071 int vEvent::AllocateID() 
00072 {
00073   if(m_verbose >=3)
00074     Cout("vEvent::AllocateID()..." << endl);
00075     
00076   if (m_nbLines<1)
00077   {
00078     Cerr("*****vEvent::AllocateID() -> Error, number of lines has not been initialized (<1) !" << endl);
00079     return 1;
00080   }
00081   else
00082   {
00083     mp_ID1 = new uint32_t[m_nbLines];
00084     mp_ID2 = new uint32_t[m_nbLines];
00085   }
00086   
00087   // Call the pure virtual function implemented in child classes for the allocation of data specific to child classes
00088   if (AllocateSpecificData())
00089   {
00090     Cerr("*****vEvent::AllocateID() -> Error when trying to allocated specific data for the Event !" << endl);
00091     return 1;
00092   }
00093   
00094   return 0;
00095 }
 All Classes Files Functions Variables Typedefs Defines