CMS 3D CMS Logo

DTControlData.h
Go to the documentation of this file.
1 #ifndef DTDigi_DTControlData_h
2 #define DTDigi_DTControlData_h
3 
14 
15 #include <vector>
16 
17 typedef std::pair<int, DTROBHeaderWord> DTROBHeader;
18 typedef std::pair<int, DTTDCMeasurementWord> DTTDCData;
19 typedef std::pair<int, DTTDCErrorWord> DTTDCError;
20 typedef std::pair<DTLocalTriggerDataWord, int> DTSectorCollectorData;
21 
22 class DTROS25Data {
23 public:
25  DTROS25Data(int ROSId = 0) : theROSId(ROSId) {}
26 
28  virtual ~DTROS25Data() {}
29 
31  inline void setROSId(const int& ID) { theROSId = ID; }
32 
35  inline void addROSError(const DTROSErrorWord& word) { theROSErrors.push_back(word); }
36  inline void addROSDebug(const DTROSDebugWord& word) { theROSDebugs.push_back(word); }
37  inline void addROBHeader(const DTROBHeader& robHeader) { theROBHeaders.push_back(robHeader); } // IJ
38  inline void addROBTrailer(const DTROBTrailerWord& word) { theROBTrailers.push_back(word); }
40  inline void addTDCData(const DTTDCData& tdcData) { theTDCData.push_back(tdcData); }
41  inline void addTDCError(const DTTDCError& tdcError) { theTDCError.push_back(tdcError); }
42  inline void addSCData(const DTSectorCollectorData& scData) { theSCData.push_back(scData); }
43  inline void addSCHeader(const DTLocalTriggerHeaderWord& scHeader) { theSCHeader = scHeader; }
44  inline void addSCPrivHeader(const DTLocalTriggerSectorCollectorHeaderWord& scPrivHeader) {
45  theSCPrivateHeader = scPrivHeader;
46  }
47  inline void addSCPrivSubHeader(const DTLocalTriggerSectorCollectorSubHeaderWord& scPrivSubHeader) {
48  theSCPrivateSubHeader = scPrivSubHeader;
49  }
50  inline void addSCTrailer(const DTLocalTriggerTrailerWord& scTrailer) { theSCTrailer = scTrailer; }
51 
53  inline int getROSID() const { return theROSId; }
54 
55  inline const DTROSTrailerWord& getROSTrailer() const { return theROSTrailer; }
56  inline const DTROSHeaderWord& getROSHeader() const { return theROSHeader; }
57  inline const std::vector<DTROSErrorWord>& getROSErrors() const { return theROSErrors; }
58  inline const std::vector<DTROSDebugWord>& getROSDebugs() const { return theROSDebugs; }
59  inline const std::vector<DTROBHeader>& getROBHeaders() const { return theROBHeaders; }
60  inline const std::vector<DTROBTrailerWord>& getROBTrailers() const { return theROBTrailers; }
61  inline const std::vector<DTTDCMeasurementWord>& getTDCMeasurements() const { return theTDCMeasurements; }
62  inline const std::vector<DTTDCData>& getTDCData() const { return theTDCData; }
63  inline const std::vector<DTTDCError>& getTDCError() const { return theTDCError; }
64  inline const std::vector<DTSectorCollectorData>& getSCData() const { return theSCData; }
65  inline const DTLocalTriggerHeaderWord& getSCHeader() const { return theSCHeader; }
67  inline const DTLocalTriggerTrailerWord& getSCTrailer() const { return theSCTrailer; }
69 
70  inline void clean() {
71  theROSHeader = 0;
72  theROSTrailer = 0;
73  theROSErrors.clear();
74  theROSDebugs.clear();
75  theROBHeaders.clear();
76  theROBTrailers.clear();
77  theTDCMeasurements.clear();
78  theTDCData.clear();
79  theTDCError.clear();
80  theSCData.clear();
81  theSCHeader = 0;
82  theSCTrailer = 0;
83  }
84 
85 private:
86  int theROSId;
87 
90  std::vector<DTROSErrorWord> theROSErrors;
91  std::vector<DTROSDebugWord> theROSDebugs;
92  std::vector<DTROBHeader> theROBHeaders;
93  std::vector<DTROBTrailerWord> theROBTrailers;
94  std::vector<DTTDCMeasurementWord> theTDCMeasurements;
95  std::vector<DTTDCData> theTDCData;
96  std::vector<DTTDCError> theTDCError;
97  std::vector<DTSectorCollectorData> theSCData;
102 };
103 
104 class DTDDUData {
105 public:
107  DTDDUData(const FEDHeader& dduHeader, const FEDTrailer& dduTrailer)
108  : theDDUHeader(dduHeader), theDDUTrailer(dduTrailer), crcErrorBitSet(false) {}
109 
111 
113  virtual ~DTDDUData() {}
114 
116  inline void addDDUHeader(const FEDHeader& word) { theDDUHeader = word; }
117  inline void addDDUTrailer(const FEDTrailer& word) { theDDUTrailer = word; }
120  inline void checkCRCBit(const unsigned char* trailer) {
121  const FEDTrailer fedTrailer(trailer);
122  crcErrorBitSet = fedTrailer.crcModified();
123  }
124 
126  inline const FEDHeader& getDDUHeader() const { return theDDUHeader; }
127  inline const FEDTrailer& getDDUTrailer() const { return theDDUTrailer; }
128  inline const std::vector<DTDDUFirstStatusWord>& getFirstStatusWord() const { return theROSStatusWords; }
130  inline bool crcErrorBit() const { return crcErrorBitSet; }
131 
132  // FIXME: check whether the other variables should also be reset in the clean() method
133  inline void clean() { theROSStatusWords.clear(); }
134 
135 private:
138  std::vector<DTDDUFirstStatusWord> theROSStatusWords;
141 };
142 
143 typedef std::vector<std::vector<DTROS25Data> > DTROS25Collection;
144 typedef std::vector<DTDDUData> DTDDUCollection;
145 
146 #endif
std::vector< DTSectorCollectorData > theSCData
Definition: DTControlData.h:97
const DTROSHeaderWord & getROSHeader() const
Definition: DTControlData.h:56
const DTROSTrailerWord & getROSTrailer() const
Definition: DTControlData.h:55
void addSCData(const DTSectorCollectorData &scData)
Definition: DTControlData.h:42
int getROSID() const
Getters ////////////////////////.
Definition: DTControlData.h:53
void addDDUStatusWord(const DTDDUSecondStatusWord &word)
DTLocalTriggerTrailerWord theSCTrailer
std::vector< DTROBHeader > theROBHeaders
Definition: DTControlData.h:92
void clean()
Definition: DTControlData.h:70
void addROSStatusWord(const DTDDUFirstStatusWord &word)
virtual ~DTROS25Data()
Destructor.
Definition: DTControlData.h:28
uint32_t ID
Definition: Definitions.h:24
std::pair< int, DTROBHeaderWord > DTROBHeader
Definition: DTControlData.h:17
void addROBHeader(const DTROBHeader &robHeader)
Definition: DTControlData.h:37
virtual ~DTDDUData()
Destructor.
std::vector< DTDDUData > DTDDUCollection
void addSCPrivHeader(const DTLocalTriggerSectorCollectorHeaderWord &scPrivHeader)
Definition: DTControlData.h:44
const std::vector< DTTDCData > & getTDCData() const
Definition: DTControlData.h:62
void addSCTrailer(const DTLocalTriggerTrailerWord &scTrailer)
Definition: DTControlData.h:50
std::vector< std::vector< DTROS25Data > > DTROS25Collection
std::vector< DTROBTrailerWord > theROBTrailers
Definition: DTControlData.h:93
bool crcErrorBit() const
bool crcErrorBitSet
const std::vector< DTROBTrailerWord > & getROBTrailers() const
Definition: DTControlData.h:60
void addTDCMeasurement(const DTTDCMeasurementWord &word)
Definition: DTControlData.h:39
const std::vector< DTROBHeader > & getROBHeaders() const
Definition: DTControlData.h:59
DTROS25Data(int ROSId=0)
Constructors.
Definition: DTControlData.h:25
bool crcModified() const
True if the CRC value has been modified by the S-link sender card.
Definition: FEDTrailer.cc:23
const DTLocalTriggerTrailerWord & getSCTrailer() const
Definition: DTControlData.h:67
uint64_t word
const std::vector< DTROSErrorWord > & getROSErrors() const
Definition: DTControlData.h:57
const std::vector< DTTDCMeasurementWord > & getTDCMeasurements() const
Definition: DTControlData.h:61
const std::vector< DTROSDebugWord > & getROSDebugs() const
Definition: DTControlData.h:58
FEDHeader theDDUHeader
std::pair< int, DTTDCErrorWord > DTTDCError
Definition: DTControlData.h:19
const DTLocalTriggerSectorCollectorHeaderWord & getSCPrivHeader() const
Definition: DTControlData.h:66
void addTDCError(const DTTDCError &tdcError)
Definition: DTControlData.h:41
void addSCPrivSubHeader(const DTLocalTriggerSectorCollectorSubHeaderWord &scPrivSubHeader)
Definition: DTControlData.h:47
std::vector< DTTDCError > theTDCError
Definition: DTControlData.h:96
FEDTrailer theDDUTrailer
std::pair< DTLocalTriggerDataWord, int > DTSectorCollectorData
Definition: DTControlData.h:20
void setROSId(const int &ID)
Setters ///////////////////////.
Definition: DTControlData.h:31
void addDDUHeader(const FEDHeader &word)
Setters.
DTLocalTriggerSectorCollectorHeaderWord theSCPrivateHeader
Definition: DTControlData.h:99
void addDDUTrailer(const FEDTrailer &word)
DTROSHeaderWord theROSHeader
Definition: DTControlData.h:88
void checkCRCBit(const unsigned char *trailer)
std::vector< DTROSDebugWord > theROSDebugs
Definition: DTControlData.h:91
const std::vector< DTTDCError > & getTDCError() const
Definition: DTControlData.h:63
DTDDUSecondStatusWord theDDUStatusWord
std::vector< DTROSErrorWord > theROSErrors
Definition: DTControlData.h:90
DTROSTrailerWord theROSTrailer
Definition: DTControlData.h:89
std::vector< DTDDUFirstStatusWord > theROSStatusWords
const FEDHeader & getDDUHeader() const
Getters.
void clean()
void addROBTrailer(const DTROBTrailerWord &word)
Definition: DTControlData.h:38
const std::vector< DTSectorCollectorData > & getSCData() const
Definition: DTControlData.h:64
void addROSHeader(const DTROSHeaderWord &word)
Definition: DTControlData.h:33
void addROSError(const DTROSErrorWord &word)
Definition: DTControlData.h:35
DTDDUData(const FEDHeader &dduHeader, const FEDTrailer &dduTrailer)
Constructor.
const DTLocalTriggerHeaderWord & getSCHeader() const
Definition: DTControlData.h:65
void addROSTrailer(const DTROSTrailerWord &word)
Definition: DTControlData.h:34
std::vector< DTTDCData > theTDCData
Definition: DTControlData.h:95
std::pair< int, DTTDCMeasurementWord > DTTDCData
Definition: DTControlData.h:18
void addSCHeader(const DTLocalTriggerHeaderWord &scHeader)
Definition: DTControlData.h:43
DTLocalTriggerSectorCollectorSubHeaderWord theSCPrivateSubHeader
void addROSDebug(const DTROSDebugWord &word)
Definition: DTControlData.h:36
const FEDTrailer & getDDUTrailer() const
const DTDDUSecondStatusWord & getSecondStatusWord() const
const std::vector< DTDDUFirstStatusWord > & getFirstStatusWord() const
const DTLocalTriggerSectorCollectorSubHeaderWord & getSCPrivSubHeader() const
Definition: DTControlData.h:68
void addTDCData(const DTTDCData &tdcData)
Definition: DTControlData.h:40
std::vector< DTTDCMeasurementWord > theTDCMeasurements
Definition: DTControlData.h:94
DTLocalTriggerHeaderWord theSCHeader
Definition: DTControlData.h:98