RawDCMChan.h
Go to the documentation of this file.
1 #ifndef RAWDCMCHAN_H
2 #define RAWDCMCHAN_H
3 #include "DAQDataFormats/RawDAQData.h"
4 #include "DAQDataFormats/Macros.h"
5 #include "DAQDataFormats/BitFields.h"
6 
7 #include "DAQDataFormats/DataFormatFirst.inc"
8 #define CURRENT_CLASS RawDCMChan
9 #define CURRENT_FIELDS_SUB_NAMESPACE rawmillidcm
10 
11 //! Class to hold the data from the FEBs in correct formats
12  /*!
13  * The RawDCMChan class is for storing DCm ID information
14  * Currently, there is no versioning for this class
15  *
16  */
17 
18 namespace daqdataformats {
19 
20  static const uint32_t RAWDCMCHAN_SIZE = 1;
21 
23 
25  MASK_DiblockId = 0x00FF, // Diblock ID
26  MASK_DCMId = 0x1F00, // DCM ID
27  MASK_DetId = 0xE000, // Detector ID
28  MASK_GlobalDCMID = 0xFFFF // Global ID
29  };
30 
32  WORD_DiblockId = 0, // Diblock ID
33  WORD_DCMId = 0, // DCM ID
34  WORD_DetId = 0, // Detector ID
35  WORD_GlobalDCMID = 0 // Global ID
36  };
37 
38  DEFINE_SHIFT_FROM_MASK(DiblockId);
41  DEFINE_SHIFT_FROM_MASK(GlobalDCMID);
42 
43  }// end of rawmillidcm
44 
45  class RawDCMChan : public RawDAQData {
46 
47  public:
48 
49  // Constructors
50  RawDCMChan(); //! The default constructor
51  RawDCMChan(const RawDCMChan& copy_in); //! Deep copy constructor
52  RawDCMChan(const void* dcmchan_buffer); //! Shallow copy constructor
53  /// Destructor
54  ~RawDCMChan();
55 
56  using RawDAQData::print;
57  void print (std::ostream& os=std::cout) const;
58  uint32_t sizeofdata () const {return RAWDCMCHAN_SIZE;}
59 
60  IMPLEMENT_GET_AND_SET_NOVERSION(DiblockId, uint32_t);
61  IMPLEMENT_GET_AND_SET_NOVERSION(DCMId, uint32_t);
63  IMPLEMENT_GET_AND_SET_NOVERSION(GlobalDCMID, uint32_t);
64 
65  protected:
66  /// Read the RawDCMChan version is meaningless at this point, because we don't have versioning for it
67  version_t figureOutTheVersion(const void*) const {return 0;}
68 
69  bool setFunctionPointers() {return true;}
70 
71  };
72 
73 
74 } // END NAMESPCE daqdataformats
75 #endif /* RAWDCMCHAN_H */
void print(std::ostream &os=std::cout) const
Method for printing the content of the Buffer.
Definition: RawDAQData.cpp:500
static const uint32_t RAWDCMCHAN_SIZE
Definition: RawDCMChan.h:20
bool print
version_t figureOutTheVersion(const void *) const
Read the RawDCMChan version is meaningless at this point, because we don't have versioning for it...
Definition: RawDCMChan.h:67
OStream cout
Definition: OStream.cxx:6
int32_t version_t
Definition: RawDAQData.h:72
#define CURRENT_FIELDS_SUB_NAMESPACE
Definition: RawDCMChan.h:9
Class to hold the data from the FEBs in correct formats.
#define IMPLEMENT_GET_AND_SET_NOVERSION(FUNC, UNITS)
Definition: Macros.h:130
uint32_t sizeofdata() const
Definition: RawDCMChan.h:58