Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:35:55

0001 // Class for EMTF DAQ readout
0002 
0003 #ifndef __l1t_EMTF_output_h__
0004 #define __l1t_EMTF_output_h__
0005 
0006 #include <vector>
0007 
0008 #include "EMTF/AMC13Header.h"
0009 #include "EMTF/MTF7Header.h"
0010 #include "EMTF/EventHeader.h"
0011 #include "EMTF/Counters.h"
0012 #include "EMTF/ME.h"
0013 #include "EMTF/RPC.h"
0014 #include "EMTF/GEM.h"
0015 #include "EMTF/SP.h"
0016 #include "EMTF/EventTrailer.h"
0017 #include "EMTF/MTF7Trailer.h"
0018 #include "EMTF/AMC13Trailer.h"
0019 #include <cstdint>
0020 
0021 // All comments below apply equally to classes in EMTF/ directory - AWB 28.01.16
0022 
0023 namespace l1t {
0024   class EMTFDaqOut {
0025   public:
0026     explicit EMTFDaqOut(uint64_t dataword);  // What does this do? - AWB 28.01.16
0027 
0028     // Empty constructor - should we include classes and collections? - AWB 28.01.16
0029     EMTFDaqOut()
0030         : hasAMC13Header(false),
0031           hasMTF7Header(false),
0032           hasEventHeader(false),
0033           hasCounters(false),
0034           numME(0),
0035           numRPC(0),
0036           numGEM(0),
0037           numSP(0),
0038           hasEventTrailer(false),
0039           hasMTF7Trailer(false),
0040           hasAMC13Trailer(false),
0041           format_errors(0),
0042           dataword(-99) {}
0043 
0044     /* // Fill constructor - should we included a copy constructor for classes and collections (vectors)? - AWB 28.01.16 */
0045     /* EMTFDaqOut(emtf::AMC13Header class_AMC13Header, emtf::SPCollection coll_SPCollection) : */
0046     /*   AMC13Header(class_AMC13Header), SPCollection(coll_SPCollection), format_errors(0), dataword(-99) */
0047     /*   {}; */
0048 
0049     virtual ~EMTFDaqOut() {}
0050 
0051     void set_AMC13Header(emtf::AMC13Header bits) {
0052       AMC13Header = bits;
0053       hasAMC13Header = true;
0054     }
0055     void set_MTF7Header(emtf::MTF7Header bits) {
0056       MTF7Header = bits;
0057       hasMTF7Header = true;
0058     }
0059     void set_EventHeader(emtf::EventHeader bits) {
0060       EventHeader = bits;
0061       hasEventHeader = true;
0062     }
0063     void set_Counters(emtf::Counters bits) {
0064       Counters = bits;
0065       hasCounters = true;
0066     }
0067     void set_MECollection(emtf::MECollection bits) {
0068       MECollection = bits;
0069       numME = MECollection.size();
0070     }
0071     void push_ME(emtf::ME bits) {
0072       MECollection.push_back(bits);
0073       numME += 1;
0074     }
0075     void set_RPCCollection(emtf::RPCCollection bits) {
0076       RPCCollection = bits;
0077       numRPC = RPCCollection.size();
0078     }
0079     void push_RPC(emtf::RPC bits) {
0080       RPCCollection.push_back(bits);
0081       numRPC += 1;
0082     }
0083     void set_GEMCollection(emtf::GEMCollection bits) {
0084       GEMCollection = bits;
0085       numGEM = GEMCollection.size();
0086     }
0087     void push_GEM(emtf::GEM bits) {
0088       GEMCollection.push_back(bits);
0089       numGEM += 1;
0090     }
0091     void set_SPCollection(emtf::SPCollection bits) {
0092       SPCollection = bits;
0093       numSP = SPCollection.size();
0094     }
0095     void push_SP(emtf::SP bits) {
0096       SPCollection.push_back(bits);
0097       numSP += 1;
0098     }
0099     void set_EventTrailer(emtf::EventTrailer bits) {
0100       EventTrailer = bits;
0101       hasEventTrailer = true;
0102     }
0103     void set_MTF7Trailer(emtf::MTF7Trailer bits) {
0104       MTF7Trailer = bits;
0105       hasMTF7Trailer = true;
0106     }
0107     void set_AMC13Trailer(emtf::AMC13Trailer bits) {
0108       AMC13Trailer = bits;
0109       hasAMC13Trailer = true;
0110     }
0111     void add_format_error() { format_errors += 1; }
0112     void set_dataword(uint64_t bits) { dataword = bits; }
0113 
0114     bool HasAMC13Header() const { return hasAMC13Header; }
0115     bool HasMTF7Header() const { return hasMTF7Header; }
0116     bool HasEventHeader() const { return hasEventHeader; }
0117     bool HasCounters() const { return hasCounters; }
0118     int NumSP() const { return numSP; }
0119     int NumRPC() const { return numRPC; }
0120     int NumME() const { return numME; }
0121     int NumGEM() const { return numGEM; }
0122     bool HasAMC13Trailer() const { return hasAMC13Trailer; }
0123     bool HasMTF7Trailer() const { return hasMTF7Trailer; }
0124     bool HasEventTrailer() const { return hasEventTrailer; }
0125     emtf::AMC13Header GetAMC13Header() const { return AMC13Header; }
0126     emtf::MTF7Header GetMTF7Header() const { return MTF7Header; }
0127     emtf::EventHeader GetEventHeader() const { return EventHeader; }
0128     emtf::Counters GetCounters() const { return Counters; }
0129     emtf::MECollection GetMECollection() const { return MECollection; }
0130     emtf::RPCCollection GetRPCCollection() const { return RPCCollection; }
0131     emtf::GEMCollection GetGEMCollection() const { return GEMCollection; }
0132     emtf::SPCollection GetSPCollection() const { return SPCollection; }
0133     emtf::EventTrailer GetEventTrailer() const { return EventTrailer; }
0134     emtf::MTF7Trailer GetMTF7Trailer() const { return MTF7Trailer; }
0135     emtf::AMC13Trailer GetAMC13Trailer() const { return AMC13Trailer; }
0136     const emtf::AMC13Header* PtrAMC13Header() const { return &AMC13Header; }
0137     const emtf::MTF7Header* PtrMTF7Header() const { return &MTF7Header; }
0138     const emtf::EventHeader* PtrEventHeader() const { return &EventHeader; }
0139     const emtf::Counters* PtrCounters() const { return &Counters; }
0140     const emtf::MECollection* PtrMECollection() const { return &MECollection; }
0141     const emtf::RPCCollection* PtrRPCCollection() const { return &RPCCollection; }
0142     const emtf::GEMCollection* PtrGEMCollection() const { return &GEMCollection; }
0143     const emtf::SPCollection* PtrSPCollection() const { return &SPCollection; }
0144     const emtf::EventTrailer* PtrEventTrailer() const { return &EventTrailer; }
0145     const emtf::MTF7Trailer* PtrMTF7Trailer() const { return &MTF7Trailer; }
0146     const emtf::AMC13Trailer* PtrAMC13Trailer() const { return &AMC13Trailer; }
0147     int Format_Errors() const { return format_errors; }
0148     uint64_t Dataword() const { return dataword; }
0149 
0150   private:
0151     bool hasAMC13Header;
0152     bool hasMTF7Header;
0153     bool hasEventHeader;
0154     bool hasCounters;
0155     int numME;
0156     int numRPC;
0157     int numGEM;
0158     int numSP;
0159     bool hasEventTrailer;
0160     bool hasMTF7Trailer;
0161     bool hasAMC13Trailer;
0162     emtf::AMC13Header AMC13Header;
0163     emtf::MTF7Header MTF7Header;
0164     emtf::EventHeader EventHeader;
0165     emtf::Counters Counters;
0166     emtf::MECollection MECollection;
0167     emtf::RPCCollection RPCCollection;
0168     emtf::GEMCollection GEMCollection;
0169     emtf::SPCollection SPCollection;
0170     emtf::EventTrailer EventTrailer;
0171     emtf::MTF7Trailer MTF7Trailer;
0172     emtf::AMC13Trailer AMC13Trailer;
0173     int format_errors;
0174     uint64_t dataword;  // Should this be more or fewer bits? - AWB 28.01.16
0175 
0176   };  // End class EMTFDaqOut
0177 
0178   // Define a vector of EMTFDaqOut
0179   typedef std::vector<EMTFDaqOut> EMTFDaqOutCollection;
0180 
0181 }  // End namespace l1t
0182 
0183 #endif /* define __l1t_EMTF_output_h__ */