RawNanoSliceV2.h
Go to the documentation of this file.
1 #ifndef RAWNANOSLICEV2_H
2 #define RAWNANOSLICEV2_H
3 #include "DAQDataFormats/RawNanoSliceV1.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 CURRENT_CLASS_VERSION 2
16 #define CURRENT_FIELDS_SUB_NAMESPACE rawnano
17 #include "DAQDataFormats/DataFormatLast.inc"
18 
19 namespace daqdataformats {
20 
21  namespace VERSION_NAMESPACE {
23 
24  static const uint32_t RAWNANOSLICE_SIZE = 6;
25 
28  };// end of NanoSliceMASKS
29 
31  MASK_Value2 = 0x0000FFFF
32  };// end of NanoSliceMASKS
33 
34  DEFINE_SHIFT_FROM_MASK(Value2);
35  } // end of namespace rawnano
36 
37  //! Class to hold the data from the FEBs in correct formats
38  /*!
39  The RawNanoSlice class is designed to mimic the format of the actual data
40  block that the NOvA Front End6
41  Boards (FEBS) produce when they detect a signal
42  above the zero suppression threshold.
43 
44  The class supports general initialization with or with out data blocks as
45  well as copyin style initialization for use with STL containers.
46 
47  Pack and unpack methods for the data rely on two types of structured data
48  blocks that are provided in association with the class.
49 
50  The NanoSliceBlock structure breaks the raw data block out into its related
51  high and low half words to give the headers, time stamps and pulseheight information
52 
53  The NanoSliceHeader structure further breaks out the header blocks into the
54  individual data information parts.
55  */
56 
57  class RawNanoSlice: public PREVIOUS_VERSION_CLASS_NAME {
58 
59  public:
60 
61  // Constructors
62  RawNanoSlice (const version_t );
63  RawNanoSlice (const NanoSlice&);
64  RawNanoSlice (const RawNanoSlice&);
65  /// Destructor
66  ~RawNanoSlice();
67 
68  /// Initialization of the Data members
69  void init();
70  void initWithData(const NanoSlice&);
71  uint32_t sizeofdata () const { return version2::rawnano::RAWNANOSLICE_SIZE;}
72 
73  //using PREVIOUS_VERSION_CLASS_NAME::print;
74  void print(std::ostream& os=std::cout) const;
75 
76  /// Set method for all parameters of the NanoSlice
77  bool setParameters (const NanoSlice&);
78 
79  uint32_t getValue1() const {GENERATE_FUNCTION_IS_NOT_ALLOWED; return 0;}
80  bool setValue1(const uint32_t) {return GENERATE_FUNCTION_IS_NOT_ALLOWED;}
81 
82  INIT_FIRST(getValue, const, uint32_t, const uint32_t);
83  INIT_FIRST(setValue, , bool , const uint32_t, const uint32_t);
84 
85  protected:
86 
87  /// Returns pointer to the word, also mask and shift
88  uint32_t* getWordPointer(const uint32_t sample_number, uint32_t& mask, uint32_t& shift) const;
89 
90 
91 
92  };// end of RawNanoSlice
93 
94 
95 }} // END NAMESPCE daqdataformats
96 #endif /* RAWNANOSLICEV1_H */
#define GENERATE_FUNCTION_IS_NOT_ALLOWED
calling functionIsNotAllowed
Definition: RawDAQData.h:21
#define VERSION_NAMESPACE
#define INIT_FIRST(FUNC, CONSTNESS, OUTPUT_UNITS,...)
Definition: Macros.h:239
Data structure for holding all the nanoslice data of interest.
#define CURRENT_FIELDS_SUB_NAMESPACE
bool print
OStream cout
Definition: OStream.cxx:6
Class to hold the data from the FEBs in correct formats.
int32_t version_t
Definition: RawDAQData.h:72
Class to hold the data from the FEBs in correct formats.