RawNanoSlice.h
Go to the documentation of this file.
1 #ifndef RAWNANOSLICE_H
2 #define RAWNANOSLICE_H
3 #include "DAQDataFormats/RawNanoSliceV4.h"
4 
5 /// It is requred to
6 /// 1. include DAQDataFormats/DataFormatFirst.inc
7 /// 2. define CURRENT_CLASS
8 /// 3. define CURRENT_CLASS_VERSION for version of the class
9 /// OR define LAST_CLASS_VERSION for the main structure of the class
10 /// 4. (optional) define CURRENT_FIELDS_SUB_NAMESPACE
11 /// 5. include DAQDataFormats/DataFormatLast.inc
12 /// before the declaration of the DataFormat version class in the header.
13 #include "DAQDataFormats/DataFormatFirst.inc"
14 #define CURRENT_CLASS RawNanoSlice
15 #define LAST_CLASS_VERSION 4
16 #define CURRENT_FIELDS_SUB_NAMESPACE rawnano
17 #include "DAQDataFormats/DataFormatLast.inc"
18 
19 
20  //! Class to hold the data from the FEBs in correct formats
21  /*!
22  The RawNanoSlice class is designed to mimic the format of the actual data
23  block that the NOvA Front End6
24  Boards (FEBS) produce when they detect a signal
25  above the zero suppression threshold.
26 
27  The class supports general initialization with or with out data blocks as
28  well as copyin style initialization for use with STL containers.
29 
30  Pack and unpack methods for the data rely on two types of structured data
31  blocks that are provided in association with the class.
32 
33  The NanoSliceBlock structure breaks the raw data block out into its related
34  high and low half words to give the headers, time stamps and pulseheight information
35 
36  The NanoSliceHeader structure further breaks out the header blocks into the
37  individual data information parts.
38  */
39 
40 namespace daqdataformats {
41 
42  class RawNanoSlice: public PREVIOUS_VERSION_CLASS_NAME {
43 
44  public:
45  // Constructors
47  RawNanoSlice (const NanoSlice&); //! Constructor with Data initialization
48  RawNanoSlice (const RawNanoSlice& copy_in); //! Deep copy constructor
49  RawNanoSlice (const void* nanoslice_buffer, const version_t version = rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION ); //! Shallow copy constructor
50  /// Destructor
51  ~RawNanoSlice();
52 
55 
56  /// Get the NanoSlice header pointer
57  daqdataformats::RawNanoSliceHeader* getHeader() const {return _Header;}
58 
59  IMPLEMENT_GET_AND_SET_MAIN(PulseHeight, uint32_t);
60  IMPLEMENT_GET_AND_SET_MAIN(TimeStamp , uint32_t);
61  IMPLEMENT_GET_MAIN (Reserved , uint32_t);
62  IMPLEMENT_GET_AND_SET_MAIN(Value1, uint32_t);
63 
66  IMPLEMENT_FUNCTION_RETURNING_FUNCTION_POINTER_0PAR(checkReservedForCafe, const, bool)
67 
68 
69  IMPLEMENT_FUNCTION_RETURNING_FUNCTION_POINTER_1PAR(getValue, const, uint32_t, const uint32_t)
70  IMPLEMENT_FUNCTION_RETURNING_FUNCTION_POINTER_2PAR(setValue, , bool , const uint32_t, const uint32_t)
71 
73 
74  private:
75  IMPLEMENT_SET_MAIN(Reserved, uint32_t);
76 
77  void initWithDataInternal();
78  bool setFunctionPointers();
79 
80  private:
81  /// Pointer to Nano parameters
82  /// used in init when using Constructor with Data initialization only.
83  /// After that this variable is irrelevant
85 
86 
87  };// end of RawNanoSlice
88 
89 
90 } // END NAMESPCE daqdataformats
91 #endif /* RAWNANOSLICE_H */
IMPLEMENT_MAIN_STANDARD IMPLEMENT_MAIN_setBufferSource daqdataformats::RawNanoSliceHeader * getHeader() const
Get the NanoSlice header pointer.
Definition: RawNanoSlice.h:57
IMPLEMENT_GET_MAIN(Reserved, uint32_t)
#define IMPLEMENT_MAIN_STANDARD
Definition: Macros.h:230
#define IMPLEMENT_MAIN_setBufferSource
Definition: Macros.h:228
Data structure for holding all the nanoslice data of interest.
RawNanoSlice(const version_t version=nanosliceheader::RAWNANOSLICE_DEFAULT_VERSION)
After this constructor the buffer pointer is set to the internal source.
#define IMPLEMENT_FUNCTION_RETURNING_FUNCTION_POINTER_0PAR(FUNC, CONSTNESS, OUTPUT)
Definition: Macros.h:181
#define IMPLEMENT_FUNCTION_RETURNING_FUNCTION_POINTER_1PAR(FUNC, CONSTNESS, OUTPUT, INP1)
Definition: Macros.h:183
IMPLEMENT_SET_MAIN(Reserved, uint32_t)
#define IMPLEMENT_FUNCTION_RETURNING_FUNCTION_POINTER_2PAR(FUNC, CONSTNESS, OUTPUT, INP1, INP2)
Definition: Macros.h:185
IMPLEMENT_GET_AND_SET_MAIN(PulseHeight, uint32_t)
const XML_Char * version
Definition: expat.h:187
#define IMPLEMENT_FIGUREOUT_VERSION_STATIC(CLASS)
This should be in the header.
Definition: Macros.h:295
int32_t version_t
Definition: RawDAQData.h:72
static const version_t DAQDATAFORMAT_UNKNOWN_VERSION
Definition: RawDAQData.h:81
Class to hold the data from the FEBs in correct formats.
#define IMPLEMENT_VOID_RETURNING_FUNCTION_POINTER_1PAR(FUNC, CONSTNESS, INP1)
Definition: Macros.h:196