CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
AMC13Header.h
Go to the documentation of this file.
1 /* -*- C++ -*- */
2 #ifndef AMC13Header_H_included
3 #define AMC13Header_H_included
4 
5 #include <stdint.h>
6 
7 namespace hcal {
12  class AMC13Header {
13  public:
15  inline int sourceId() const { return int(cdfHeader>>8)&0xFFF; }
17  inline int bunchId() const { return int(cdfHeader>>20)&0xFFF; }
19  inline int l1aNumber() const { return int((cdfHeader>>32) & 0x00FFFFFF); }
21  inline int CDFEventType() const { return ( int(cdfHeader>>56) & 0x0F ); }
23  inline unsigned int orbitNumber() const { return (unsigned int)((amc13Header>>4)&0xFFFFFFFFu); }
25  inline int NAMC() const { return int((amc13Header>>52)&0xF); }
27  inline int AMC13FormatVersion() const { return int((amc13Header>>60)&0xF); }
28 
29  // Per-AMC items
31  inline uint16_t AMCId(int i) const { return uint16_t(modulesHeaders[i]&0xFFFF); }
33  inline int AMCSlot(int i) const { return int((modulesHeaders[i]>>16)&0xF); }
35  inline int AMCBlockNumber(int i) const { return int((modulesHeaders[i]>>20)&0xFF); }
37  inline int AMCSize(int i) const { return int((modulesHeaders[i]>>32)&0xFFFFFF); }
39  inline bool AMCMore(int i) const { return ((modulesHeaders[i]>>61)&0x1)!=0; }
41  inline bool AMCSegmented(int i) const { return ((modulesHeaders[i]>>60)&0x1)!=0; }
43  inline bool AMCLengthOk(int i) const { return ((modulesHeaders[i]>>62)&0x1)!=0; }
45  inline bool AMCCRCOk(int i) const { return ((modulesHeaders[i]>>56)&0x1)!=0; }
47  inline bool AMCDataPresent(int i) const { return ((modulesHeaders[i]>>58)&0x1)!=0; }
49  inline bool AMCDataValid(int i) const { return ((modulesHeaders[i]>>57)&0x1)!=0; }
51  inline bool AMCEnabled(int i) const { return ((modulesHeaders[i]>>59)&0x1)!=0; }
52 
54  const uint64_t* AMCPayload(int i) const;
55 
56 
57  private:
61  };
62 }
63 
64 #endif // AMC13Header_H_included
int i
Definition: DBlmapReader.cc:9
int CDFEventType() const
Definition: AMC13Header.h:21
uint64_t modulesHeaders[12]
Definition: AMC13Header.h:60
int l1aNumber() const
Definition: AMC13Header.h:19
int AMCSize(int i) const
Definition: AMC13Header.h:37
int bunchId() const
Definition: AMC13Header.h:17
bool AMCDataPresent(int i) const
Definition: AMC13Header.h:47
unsigned int orbitNumber() const
Definition: AMC13Header.h:23
unsigned long long uint64_t
Definition: Time.h:15
int sourceId() const
Definition: AMC13Header.h:15
bool AMCMore(int i) const
Definition: AMC13Header.h:39
int AMC13FormatVersion() const
Definition: AMC13Header.h:27
uint64_t amc13Header
Definition: AMC13Header.h:59
bool AMCSegmented(int i) const
Definition: AMC13Header.h:41
int NAMC() const
Definition: AMC13Header.h:25
int AMCSlot(int i) const
Definition: AMC13Header.h:33
const uint64_t * AMCPayload(int i) const
Definition: AMC13Header.cc:4
int AMCBlockNumber(int i) const
Definition: AMC13Header.h:35
bool AMCCRCOk(int i) const
Definition: AMC13Header.h:45
uint64_t cdfHeader
Definition: AMC13Header.h:58
bool AMCEnabled(int i) const
Definition: AMC13Header.h:51
bool AMCDataValid(int i) const
Definition: AMC13Header.h:49
uint16_t AMCId(int i) const
Definition: AMC13Header.h:31
bool AMCLengthOk(int i) const
Definition: AMC13Header.h:43