CASToR  3.2
Tomographic Reconstruction (PET/SPECT/CT)
src/datafile/iEventHistoPET.cc
Go to the documentation of this file.
1 
9 #include "iEventHistoPET.hh"
10 #include "vDataFile.hh"
11 #include "sOutputManager.hh"
12 
13 // =====================================================================
14 // ---------------------------------------------------------------------
15 // ---------------------------------------------------------------------
16 // =====================================================================
17 
19 {
23  m_eventNbTOFBins = 1;
24  mp_eventValue = NULL;
25  mp_eventScatRate = NULL;
26  m_nbLines = 1;
27 }
28 
29 // =====================================================================
30 // ---------------------------------------------------------------------
31 // ---------------------------------------------------------------------
32 // =====================================================================
33 
35 {
36  if (mp_eventValue != NULL) free(mp_eventValue);
37  if (mp_eventScatRate != NULL) free(mp_eventScatRate);
38 }
39 
40 // =====================================================================
41 // ---------------------------------------------------------------------
42 // ---------------------------------------------------------------------
43 // =====================================================================
44 
46 {
48  // Check that the number of TOF bins is correct
49  if (m_eventNbTOFBins<1)
50  {
51  Cerr("***** iEventHistoPET::AllocateSpecificData() -> Number of TOF bins has not been initialized (<1) !");
52  return 1;
53  }
54  // Allocate values depending on the number of TOF bins
55  mp_eventValue = (FLTNB*)malloc(m_eventNbTOFBins*sizeof(FLTNB));
56  mp_eventScatRate = (FLTNB*)malloc(m_eventNbTOFBins*sizeof(FLTNB));
57  // Deault initialization
58  for(int tb=0 ; tb<m_eventNbTOFBins ; tb++)
59  {
60  mp_eventValue[tb] = 1.;
61  mp_eventScatRate[tb] = 0.;
62  }
63  // End
64  return 0;
65 }
66 
67 // =====================================================================
68 // ---------------------------------------------------------------------
69 // ---------------------------------------------------------------------
70 // =====================================================================
71 
73 {
76 }
77 
78 // =====================================================================
79 // ---------------------------------------------------------------------
80 // ---------------------------------------------------------------------
81 // =====================================================================
82 
84 {
86  Cout("iEventHistoPET::Describe() -> Display contents" << endl);
87  Cout("Time: " << m_timeInMs << " ms" << endl);
88  Cout("Number of lines: " << m_nbLines << endl);
89  for (uint16_t l=0; l<m_nbLines; l++) Cout(" --> ID1: " << mp_ID1[l] << " | ID2: " << mp_ID2[l] << endl);
90  Cout("Random rate: " << m_eventRdmRate << endl);
91  Cout("Normalization factor: " << m_eventNormFactor << endl);
92  Cout("ACF: " << m_atnCorrFactor << endl);
93  Cout("Number of TOF bins: " << m_eventNbTOFBins << endl);
94  for (uint16_t t=0; t<m_eventNbTOFBins; t++) Cout(" --> Event value: " << mp_eventValue[t] << " | Scatter rate: " << mp_eventScatRate[t] << endl);
95  for (int d=0; d<m_nbCustomINTData; d++) if (mp_customINTData != NULL) Cout(" --> Custom INT data "<<d+1<<"/"<<m_nbCustomINTData<< " : " << mp_customINTData[ d ] << endl);
96  for (int d=0; d<m_nbCustomFLTData; d++) if (mp_customFLTData != NULL) Cout(" --> Custom FLT data "<<d+1<<"/"<<m_nbCustomFLTData<< " : " << mp_customFLTData[ d ] << endl);
97  Cout(flush);
98 }
99 
100 // =====================================================================
101 // ---------------------------------------------------------------------
102 // ---------------------------------------------------------------------
103 // =====================================================================
~iEventHistoPET()
iEventHistoPET destructor.
void Describe()
This function can be used to get a description of the event printed out.
#define MODE_HISTOGRAM
int AllocateSpecificData()
Function allowing the allocation of specific data. Instantiate and initialize the mp_eventValue and...
#define Cerr(MESSAGE)
EVTFLTDATA * mp_customFLTData
iEventHistoPET()
iEventHistoPET constructor. Initialize the member variables to their default values.
EVTINTDATA * mp_customINTData
#define DEBUG_VERBOSE(IGNORED1, IGNORED2)
FLTNB GetAdditiveCorrections(int a_bin)
Inherit from vEvent. Main PET class for the Event objects.
#define Cout(MESSAGE)