CASToR  1.1
Tomographic Reconstruction (PET/SPECT)
 All Classes Files Functions Variables Typedefs Macros Groups Pages
iEventHistoPET.cc
Go to the documentation of this file.
1 
2 /*
3  Implementation of class iEventHistoPET
4 
5  - separators: X
6  - doxygen: X
7  - default initialization: X
8  - CASTOR_DEBUG: none
9  - CASTOR_VERBOSE: none
10 */
11 
12 
21 #include "iEventHistoPET.hh"
22 #include "vDataFile.hh" // DATA_MODE/ DATA_TYPE macros
23 #include "sOutputManager.hh" // Cout()/Cerr()
24 
25 
26 // =====================================================================
27 // ---------------------------------------------------------------------
28 // ---------------------------------------------------------------------
29 // =====================================================================
30 /*
31  Constructor()
32 */
34 {
37  m_eventNbTOFBins = 1;
38  mp_eventValue =NULL;
39  mp_eventScatRate =NULL;
40  m_nbLines = 1;
41 }
42 
43 
44 // =====================================================================
45 // ---------------------------------------------------------------------
46 // ---------------------------------------------------------------------
47 // =====================================================================
48 /*
49  Destructor()
50 */
52 {
53  if(mp_eventValue != NULL) delete mp_eventValue;
54  if(mp_eventScatRate != NULL) delete mp_eventScatRate;
55 }
56 
57 
58 
59 // =====================================================================
60 // ---------------------------------------------------------------------
61 // ---------------------------------------------------------------------
62 // =====================================================================
63 /*
64  \fn virtual int AllocateSpecificData()
65  \brief Function allowing the allocation of specific data.
66  Instantiate and initialize the mp_eventValue and mp_eventScatIntensity arrays depending of the number of TOF bins
67  \return 0 is success, positive value otherwise
68 */
70 {
71  if(m_eventNbTOFBins<1)
72  {
73  Cerr("*****iEventHistoPET::AllocateSpecificData() -> Error, number of TOF bins has not been initialized (<1) !");
74  return 1;
75  }
76 
79 
80  for(int tb=0 ; tb<m_eventNbTOFBins ; tb++)
81  {
82  mp_eventValue[tb] = 1.;
83  mp_eventScatRate[tb] = 0.;
84  }
85 
86  return 0;
87 }
88 
89 
90 
91 // =====================================================================
92 // ---------------------------------------------------------------------
93 // ---------------------------------------------------------------------
94 // =====================================================================
95 /*
96  \fn virtual FLTNB GetAdditiveCorrections()
97  \return the sum of additive correction terms, summed for the given TOF bins
98 */
100 {
102 }
103 
104 
105 
106 // =====================================================================
107 // ---------------------------------------------------------------------
108 // ---------------------------------------------------------------------
109 // =====================================================================
110 /*
111  \fn virtual void Describe()
112  \brief This function can be used to get a description of the event printed out
113 */
115 {
116  Cout("---------------------- iEventHistoPET::Describe() --------------------------" << endl);
117  Cout("sizeof(FLTNB): " << sizeof(FLTNB) << endl);
118  // From vEvent
119  // uint32_t m_timeInMs; /*!< Timestamp of the event in ms. Default value =0 */
120  Cout("Time: " << m_timeInMs << " ms" << endl);
121  // uint16_t m_nbLines; /*!< Number of lines in the event. Default value =0 */
122  Cout("Number of lines: " << m_nbLines << endl);
123  // uint32_t* mp_ID1; /*!< Pointer containing the indice(s) of the 1st ID of the Event. Default value =NULL */
124  // uint32_t* mp_ID2; /*!< Pointer containing the indice(s) of the 2nd ID of the Event. Default value =0 */
125  for (uint16_t l=0; l<m_nbLines; l++) Cout(" --> ID1: " << mp_ID1[l] << " | ID2: " << mp_ID2[l] << endl);
126  // From iEventPET
127  // FLTNB m_eventRdmRate; /*!< Correction term for randoms rate (unit: s-1). Default value =0.0 */
128  Cout("Random rate: " << m_eventRdmRate << endl);
129  // FLTNB m_eventNormFactor; /*!< Normalization term. Default value =1.0 */
130  Cout("Normalization factor: " << m_eventNormFactor << endl);
131  // FLTNB m_atnCorrFactor; /*!< Correction term for attenuation. Default value =1.0 */
132  Cout("ACF: " << m_atnCorrFactor << endl);
133  // From iEventHistoPET
134  // uint16_t m_eventNbTOFBins; /*!< Number of TOF bins in the Event. Default value =1 */
135  Cout("Number of TOF bins: " << m_eventNbTOFBins << endl);
136  // FLTNB* mp_eventValue; /*!< Pointer containing the amount of data in each potential TOF bin. Default value =1.0 */
137  // FLTNB* mp_eventScatRate; /*!< Pointer containing the scatter correction term (as a rate in s-1) for each potential TOF bin. Default value =0.0 */
138  for (uint16_t t=0; t<m_eventNbTOFBins; t++) Cout(" --> Event value: " << mp_eventValue[t] << " | Scatter rate: " << mp_eventScatRate[t] << endl);
139  Cout("----------------------------------------------------------------------------" << endl);
140  Cout(flush);
141 }
~iEventHistoPET()
iEventHistoPET destructor.
void Describe()
This function can be used to get a description of the event printed out.
#define MODE_HISTOGRAM
Definition: vDataFile.hh:36
#define TYPE_PET
Definition: vDataFile.hh:51
int AllocateSpecificData()
Function allowing the allocation of specific data. Instantiate and initialize the mp_eventValue and...
#define FLTNB
Definition: gVariables.hh:55
uint32_t * mp_ID2
Definition: vEvent.hh:192
FLTNB m_eventRdmRate
Definition: iEventPET.hh:139
FLTNB m_eventNormFactor
Definition: iEventPET.hh:140
int m_dataType
Definition: vEvent.hh:194
iEventHistoPET()
iEventHistoPET constructor. Initialize the member variables to their default values.
Declaration of class iEventHistoPET.
#define Cerr(MESSAGE)
uint32_t * mp_ID1
Definition: vEvent.hh:191
FLTNB * mp_eventScatRate
Declaration of class vDataFile.
FLTNB m_atnCorrFactor
Definition: iEventPET.hh:141
uint16_t m_eventNbTOFBins
FLTNB GetAdditiveCorrections(int a_bin)
Inherit from vEvent. Main PET class for the Event objects.
Definition: iEventPET.hh:22
int m_dataMode
Definition: vEvent.hh:195
Declaration of class sOutputManager.
#define Cout(MESSAGE)
uint16_t m_nbLines
Definition: vEvent.hh:190
uint32_t m_timeInMs
Definition: vEvent.hh:189