CMS 3D CMS Logo

EMTFDaqOut.h
Go to the documentation of this file.
1 // Class for EMTF DAQ readout
2 
3 #ifndef __l1t_EMTF_output_h__
4 #define __l1t_EMTF_output_h__
5 
6 #include <vector>
7 
8 #include "EMTF/AMC13Header.h"
9 #include "EMTF/MTF7Header.h"
10 #include "EMTF/EventHeader.h"
11 #include "EMTF/Counters.h"
12 #include "EMTF/ME.h"
13 #include "EMTF/RPC.h"
14 #include "EMTF/GEM.h"
15 #include "EMTF/SP.h"
16 #include "EMTF/EventTrailer.h"
17 #include "EMTF/MTF7Trailer.h"
18 #include "EMTF/AMC13Trailer.h"
19 #include <cstdint>
20 
21 // All comments below apply equally to classes in EMTF/ directory - AWB 28.01.16
22 
23 namespace l1t {
24  class EMTFDaqOut {
25  public:
26  explicit EMTFDaqOut(uint64_t dataword); // What does this do? - AWB 28.01.16
27 
28  // Empty constructor - should we include classes and collections? - AWB 28.01.16
34  numME(0),
35  numRPC(0),
36  numGEM(0),
37  numSP(0),
41  format_errors(0),
42  dataword(-99){};
43 
44  /* // Fill constructor - should we included a copy constructor for classes and collections (vectors)? - AWB 28.01.16 */
45  /* EMTFDaqOut(emtf::AMC13Header class_AMC13Header, emtf::SPCollection coll_SPCollection) : */
46  /* AMC13Header(class_AMC13Header), SPCollection(coll_SPCollection), format_errors(0), dataword(-99) */
47  /* {}; */
48 
49  virtual ~EMTFDaqOut(){};
50 
52  AMC13Header = bits;
53  hasAMC13Header = true;
54  }
56  MTF7Header = bits;
57  hasMTF7Header = true;
58  }
60  EventHeader = bits;
61  hasEventHeader = true;
62  }
64  Counters = bits;
65  hasCounters = true;
66  }
69  numME = MECollection.size();
70  }
72  MECollection.push_back(bits);
73  numME += 1;
74  }
77  numRPC = RPCCollection.size();
78  }
80  RPCCollection.push_back(bits);
81  numRPC += 1;
82  }
85  numGEM = GEMCollection.size();
86  }
88  GEMCollection.push_back(bits);
89  numGEM += 1;
90  }
93  numSP = SPCollection.size();
94  }
96  SPCollection.push_back(bits);
97  numSP += 1;
98  }
100  EventTrailer = bits;
101  hasEventTrailer = true;
102  }
104  MTF7Trailer = bits;
105  hasMTF7Trailer = true;
106  }
108  AMC13Trailer = bits;
109  hasAMC13Trailer = true;
110  }
113 
114  bool HasAMC13Header() const { return hasAMC13Header; }
115  bool HasMTF7Header() const { return hasMTF7Header; }
116  bool HasEventHeader() const { return hasEventHeader; }
117  bool HasCounters() const { return hasCounters; }
118  int NumSP() const { return numSP; }
119  int NumRPC() const { return numRPC; }
120  int NumME() const { return numME; }
121  int NumGEM() const { return numGEM; }
122  bool HasAMC13Trailer() const { return hasAMC13Trailer; }
123  bool HasMTF7Trailer() const { return hasMTF7Trailer; }
124  bool HasEventTrailer() const { return hasEventTrailer; }
128  emtf::Counters GetCounters() const { return Counters; }
136  const emtf::AMC13Header* PtrAMC13Header() const { return &AMC13Header; }
137  const emtf::MTF7Header* PtrMTF7Header() const { return &MTF7Header; }
138  const emtf::EventHeader* PtrEventHeader() const { return &EventHeader; }
139  const emtf::Counters* PtrCounters() const { return &Counters; }
140  const emtf::MECollection* PtrMECollection() const { return &MECollection; }
143  const emtf::SPCollection* PtrSPCollection() const { return &SPCollection; }
144  const emtf::EventTrailer* PtrEventTrailer() const { return &EventTrailer; }
145  const emtf::MTF7Trailer* PtrMTF7Trailer() const { return &MTF7Trailer; }
146  const emtf::AMC13Trailer* PtrAMC13Trailer() const { return &AMC13Trailer; }
147  int Format_Errors() const { return format_errors; }
148  uint64_t Dataword() const { return dataword; }
149 
150  private:
155  int numME;
156  int numRPC;
157  int numGEM;
158  int numSP;
174  uint64_t dataword; // Should this be more or fewer bits? - AWB 28.01.16
175 
176  }; // End class EMTFDaqOut
177 
178  // Define a vector of EMTFDaqOut
179  typedef std::vector<EMTFDaqOut> EMTFDaqOutCollection;
180 
181 } // End namespace l1t
182 
183 #endif /* define __l1t_EMTF_output_h__ */
bool HasEventHeader() const
Definition: EMTFDaqOut.h:116
void set_AMC13Header(emtf::AMC13Header bits)
Definition: EMTFDaqOut.h:51
emtf::Counters GetCounters() const
Definition: EMTFDaqOut.h:128
uint64_t Dataword() const
Definition: EMTFDaqOut.h:148
void set_Counters(emtf::Counters bits)
Definition: EMTFDaqOut.h:63
int Format_Errors() const
Definition: EMTFDaqOut.h:147
emtf::MECollection GetMECollection() const
Definition: EMTFDaqOut.h:129
const emtf::SPCollection * PtrSPCollection() const
Definition: EMTFDaqOut.h:143
bool HasAMC13Header() const
Definition: EMTFDaqOut.h:114
void set_RPCCollection(emtf::RPCCollection bits)
Definition: EMTFDaqOut.h:75
const emtf::GEMCollection * PtrGEMCollection() const
Definition: EMTFDaqOut.h:142
void set_MECollection(emtf::MECollection bits)
Definition: EMTFDaqOut.h:67
constexpr uint32_t bits
Definition: gpuClustering.h:25
void set_MTF7Trailer(emtf::MTF7Trailer bits)
Definition: EMTFDaqOut.h:103
bool hasAMC13Trailer
Definition: EMTFDaqOut.h:161
const emtf::Counters * PtrCounters() const
Definition: EMTFDaqOut.h:139
delete x;
Definition: CaloConfig.h:22
void set_EventHeader(emtf::EventHeader bits)
Definition: EMTFDaqOut.h:59
emtf::AMC13Header AMC13Header
Definition: EMTFDaqOut.h:162
const emtf::AMC13Header * PtrAMC13Header() const
Definition: EMTFDaqOut.h:136
emtf::EventTrailer GetEventTrailer() const
Definition: EMTFDaqOut.h:133
emtf::MTF7Trailer MTF7Trailer
Definition: EMTFDaqOut.h:171
bool HasAMC13Trailer() const
Definition: EMTFDaqOut.h:122
emtf::MECollection MECollection
Definition: EMTFDaqOut.h:166
const emtf::MTF7Trailer * PtrMTF7Trailer() const
Definition: EMTFDaqOut.h:145
bool hasEventTrailer
Definition: EMTFDaqOut.h:159
bool HasEventTrailer() const
Definition: EMTFDaqOut.h:124
void add_format_error()
Definition: EMTFDaqOut.h:111
emtf::MTF7Header MTF7Header
Definition: EMTFDaqOut.h:163
std::vector< RPC > RPCCollection
Definition: RPC.h:70
emtf::AMC13Trailer GetAMC13Trailer() const
Definition: EMTFDaqOut.h:135
std::vector< ME > MECollection
Definition: ME.h:162
std::vector< EMTFDaqOut > EMTFDaqOutCollection
Definition: EMTFDaqOut.h:179
emtf::AMC13Trailer AMC13Trailer
Definition: EMTFDaqOut.h:172
void push_SP(emtf::SP bits)
Definition: EMTFDaqOut.h:95
int NumRPC() const
Definition: EMTFDaqOut.h:119
emtf::Counters Counters
Definition: EMTFDaqOut.h:165
emtf::AMC13Header GetAMC13Header() const
Definition: EMTFDaqOut.h:125
int NumGEM() const
Definition: EMTFDaqOut.h:121
const emtf::EventHeader * PtrEventHeader() const
Definition: EMTFDaqOut.h:138
void push_ME(emtf::ME bits)
Definition: EMTFDaqOut.h:71
bool HasMTF7Trailer() const
Definition: EMTFDaqOut.h:123
int NumSP() const
Definition: EMTFDaqOut.h:118
bool HasMTF7Header() const
Definition: EMTFDaqOut.h:115
emtf::EventHeader EventHeader
Definition: EMTFDaqOut.h:164
unsigned long long uint64_t
Definition: Time.h:13
void set_GEMCollection(emtf::GEMCollection bits)
Definition: EMTFDaqOut.h:83
emtf::SPCollection SPCollection
Definition: EMTFDaqOut.h:169
uint64_t dataword
Definition: EMTFDaqOut.h:174
void set_EventTrailer(emtf::EventTrailer bits)
Definition: EMTFDaqOut.h:99
void set_dataword(uint64_t bits)
Definition: EMTFDaqOut.h:112
emtf::EventTrailer EventTrailer
Definition: EMTFDaqOut.h:170
std::vector< GEM > GEMCollection
Definition: GEM.h:81
const emtf::RPCCollection * PtrRPCCollection() const
Definition: EMTFDaqOut.h:141
int NumME() const
Definition: EMTFDaqOut.h:120
virtual ~EMTFDaqOut()
Definition: EMTFDaqOut.h:49
void push_GEM(emtf::GEM bits)
Definition: EMTFDaqOut.h:87
void set_AMC13Trailer(emtf::AMC13Trailer bits)
Definition: EMTFDaqOut.h:107
void push_RPC(emtf::RPC bits)
Definition: EMTFDaqOut.h:79
const emtf::MECollection * PtrMECollection() const
Definition: EMTFDaqOut.h:140
emtf::RPCCollection GetRPCCollection() const
Definition: EMTFDaqOut.h:130
emtf::GEMCollection GetGEMCollection() const
Definition: EMTFDaqOut.h:131
const emtf::EventTrailer * PtrEventTrailer() const
Definition: EMTFDaqOut.h:144
bool HasCounters() const
Definition: EMTFDaqOut.h:117
emtf::SPCollection GetSPCollection() const
Definition: EMTFDaqOut.h:132
emtf::GEMCollection GEMCollection
Definition: EMTFDaqOut.h:168
emtf::EventHeader GetEventHeader() const
Definition: EMTFDaqOut.h:127
std::vector< SP > SPCollection
Definition: SP.h:162
emtf::MTF7Trailer GetMTF7Trailer() const
Definition: EMTFDaqOut.h:134
const emtf::MTF7Header * PtrMTF7Header() const
Definition: EMTFDaqOut.h:137
emtf::MTF7Header GetMTF7Header() const
Definition: EMTFDaqOut.h:126
void set_SPCollection(emtf::SPCollection bits)
Definition: EMTFDaqOut.h:91
const emtf::AMC13Trailer * PtrAMC13Trailer() const
Definition: EMTFDaqOut.h:146
void set_MTF7Header(emtf::MTF7Header bits)
Definition: EMTFDaqOut.h:55
emtf::RPCCollection RPCCollection
Definition: EMTFDaqOut.h:167