CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
vEvent.cc
Go to the documentation of this file.
1 
2 /*
3  Implementation of class vEvent
4 
5  - separators: X
6  - doxygen: X
7  - default initialization: X
8  - CASTOR_DEBUG: none
9  - CASTOR_VERBOSE: none
10 */
11 
20 #include "vEvent.hh"
21 #include "vDataFile.hh"
22 #include "sOutputManager.hh"
23 
24 
25 // =====================================================================
26 // ---------------------------------------------------------------------
27 // ---------------------------------------------------------------------
28 // =====================================================================
29 /*
30  Constructor()
31 */
33 {
34  m_timeInMs=0;
35  m_nbLines=0;
36  mp_ID1=NULL;
37  mp_ID2=NULL;
40  m_verbose=-1;
41  m_eventValue = 0.;
42 }
43 
44 
45 
46 // =====================================================================
47 // ---------------------------------------------------------------------
48 // ---------------------------------------------------------------------
49 // =====================================================================
50 /*
51  Destructor()
52 */
54 {
55  if(mp_ID1 != NULL) delete mp_ID1;
56  if(mp_ID1 != NULL) delete mp_ID2;
57 }
58 
59 
60 
61 // =====================================================================
62 // ---------------------------------------------------------------------
63 // ---------------------------------------------------------------------
64 // =====================================================================
65 /*
66  \fn AllocateID()
67  \brief Instantiate the mp_ID1 and mp_ID2 indices arrays
68  \details This function instantiate the mp_ID1 and mp_ID2 indices arrays using the m_nbLines filed (assuming it has been initialized before,
69  and call the AllocateSpecificData() function implemented in child classes
70 */
72 {
73  if(m_verbose >=3)
74  Cout("vEvent::AllocateID()..." << endl);
75 
76  if (m_nbLines<1)
77  {
78  Cerr("*****vEvent::AllocateID() -> Error, number of lines has not been initialized (<1) !" << endl);
79  return 1;
80  }
81  else
82  {
83  mp_ID1 = new uint32_t[m_nbLines];
84  mp_ID2 = new uint32_t[m_nbLines];
85  }
86 
87  // Call the pure virtual function implemented in child classes for the allocation of data specific to child classes
89  {
90  Cerr("*****vEvent::AllocateID() -> Error when trying to allocated specific data for the Event !" << endl);
91  return 1;
92  }
93 
94  return 0;
95 }
#define TYPE_UNKNOWN
Definition: vDataFile.hh:49
int m_verbose
Definition: vEvent.hh:196
uint32_t * mp_ID2
Definition: vEvent.hh:192
int m_dataType
Definition: vEvent.hh:194
#define Cerr(MESSAGE)
uint32_t * mp_ID1
Definition: vEvent.hh:191
Declaration of class vDataFile.
FLTNB m_eventValue
Definition: vEvent.hh:193
Declaration of class vEvent.
vEvent()
vEvent constructor. Initialize the member variables to their default values.
Definition: vEvent.cc:32
int AllocateID()
Instantiate the mp_ID1 and mp_ID2 indices arrays.
Definition: vEvent.cc:71
int m_dataMode
Definition: vEvent.hh:195
virtual int AllocateSpecificData()=0
Pure virtual function implemented in the child classes, dedicated to the allocation of specific data ...
Declaration of class sOutputManager.
#define MODE_UNKNOWN
Definition: vDataFile.hh:32
#define Cout(MESSAGE)
uint16_t m_nbLines
Definition: vEvent.hh:190
uint32_t m_timeInMs
Definition: vEvent.hh:189
virtual ~vEvent()
vEvent destructor
Definition: vEvent.cc:53