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
DTDDUData::crcErrorBit
bool crcErrorBit() const
Definition: DTControlData.h:130
DTDDUFirstStatusWord
Definition: DTDDUWords.h:638
DTROS25Data::getSCPrivSubHeader
const DTLocalTriggerSectorCollectorSubHeaderWord & getSCPrivSubHeader() const
Definition: DTControlData.h:68
DTROS25Data::addTDCData
void addTDCData(const DTTDCData &tdcData)
Definition: DTControlData.h:40
DTLocalTriggerSectorCollectorHeaderWord
Definition: DTDDUWords.h:712
DTLocalTriggerSectorCollectorSubHeaderWord
Definition: DTDDUWords.h:743
DTTDCMeasurementWord
Definition: DTDDUWords.h:475
DTROS25Data::theROSDebugs
std::vector< DTROSDebugWord > theROSDebugs
Definition: DTControlData.h:91
DTROS25Data::theSCHeader
DTLocalTriggerHeaderWord theSCHeader
Definition: DTControlData.h:98
DTROS25Data::~DTROS25Data
virtual ~DTROS25Data()
Destructor.
Definition: DTControlData.h:28
funct::false
false
Definition: Factorize.h:34
DTROS25Data::getROSTrailer
const DTROSTrailerWord & getROSTrailer() const
Definition: DTControlData.h:55
DTDDUData::~DTDDUData
virtual ~DTDDUData()
Destructor.
Definition: DTControlData.h:113
DTDDUWords.h
DTROSHeaderWord
Definition: DTDDUWords.h:201
DTROS25Data::theROSId
int theROSId
Definition: DTControlData.h:86
DTROSErrorWord
Definition: DTDDUWords.h:266
DTDDUData::crcErrorBitSet
bool crcErrorBitSet
Definition: DTControlData.h:140
DTLocalTriggerTrailerWord
Definition: DTDDUWords.h:573
DTROBHeader
std::pair< int, DTROBHeaderWord > DTROBHeader
Definition: DTControlData.h:17
DTROS25Data::addROBHeader
void addROBHeader(const DTROBHeader &robHeader)
Definition: DTControlData.h:37
DTROS25Data::clean
void clean()
Definition: DTControlData.h:70
DTROS25Data::getTDCMeasurements
const std::vector< DTTDCMeasurementWord > & getTDCMeasurements() const
Definition: DTControlData.h:61
DTDDUData::getFirstStatusWord
const std::vector< DTDDUFirstStatusWord > & getFirstStatusWord() const
Definition: DTControlData.h:128
DTROS25Data::getROBTrailers
const std::vector< DTROBTrailerWord > & getROBTrailers() const
Definition: DTControlData.h:60
DTDDUData::getDDUTrailer
const FEDTrailer & getDDUTrailer() const
Definition: DTControlData.h:127
DTDDUCollection
std::vector< DTDDUData > DTDDUCollection
Definition: DTControlData.h:144
word
uint64_t word
Definition: CTPPSTotemDataFormatter.cc:29
DTROS25Data::getROBHeaders
const std::vector< DTROBHeader > & getROBHeaders() const
Definition: DTControlData.h:59
DTROS25Data::DTROS25Data
DTROS25Data(int ROSId=0)
Constructors.
Definition: DTControlData.h:25
DTDDUData::checkCRCBit
void checkCRCBit(const unsigned char *trailer)
Definition: DTControlData.h:120
DTROS25Data::addSCTrailer
void addSCTrailer(const DTLocalTriggerTrailerWord &scTrailer)
Definition: DTControlData.h:50
DTDDUData::theDDUHeader
FEDHeader theDDUHeader
Definition: DTControlData.h:136
DTROS25Data::theROBTrailers
std::vector< DTROBTrailerWord > theROBTrailers
Definition: DTControlData.h:93
DTLocalTriggerHeaderWord
Definition: DTDDUWords.h:543
DTROS25Data::addTDCMeasurement
void addTDCMeasurement(const DTTDCMeasurementWord &word)
Definition: DTControlData.h:39
DTROS25Data::theTDCError
std::vector< DTTDCError > theTDCError
Definition: DTControlData.h:96
DTDDUData::DTDDUData
DTDDUData()
Definition: DTControlData.h:110
DTROS25Data::getSCTrailer
const DTLocalTriggerTrailerWord & getSCTrailer() const
Definition: DTControlData.h:67
DTROS25Data::addSCPrivHeader
void addSCPrivHeader(const DTLocalTriggerSectorCollectorHeaderWord &scPrivHeader)
Definition: DTControlData.h:44
DTROS25Data::getTDCData
const std::vector< DTTDCData > & getTDCData() const
Definition: DTControlData.h:62
DTROS25Collection
std::vector< std::vector< DTROS25Data > > DTROS25Collection
Definition: DTControlData.h:143
DTROS25Data::setROSId
void setROSId(const int &ID)
Setters ///////////////////////.
Definition: DTControlData.h:31
DTROS25Data::getROSDebugs
const std::vector< DTROSDebugWord > & getROSDebugs() const
Definition: DTControlData.h:58
DTTDCError
std::pair< int, DTTDCErrorWord > DTTDCError
Definition: DTControlData.h:19
DTROS25Data::theROSTrailer
DTROSTrailerWord theROSTrailer
Definition: DTControlData.h:89
FEDTrailer
Definition: FEDTrailer.h:14
align::ID
uint32_t ID
Definition: Definitions.h:24
DTDDUData::addDDUStatusWord
void addDDUStatusWord(const DTDDUSecondStatusWord &word)
Definition: DTControlData.h:119
DTROS25Data::getROSErrors
const std::vector< DTROSErrorWord > & getROSErrors() const
Definition: DTControlData.h:57
DTROS25Data::getTDCError
const std::vector< DTTDCError > & getTDCError() const
Definition: DTControlData.h:63
DTROS25Data::theTDCMeasurements
std::vector< DTTDCMeasurementWord > theTDCMeasurements
Definition: DTControlData.h:94
DTROS25Data::addROSHeader
void addROSHeader(const DTROSHeaderWord &word)
Definition: DTControlData.h:33
DTROS25Data::getSCPrivHeader
const DTLocalTriggerSectorCollectorHeaderWord & getSCPrivHeader() const
Definition: DTControlData.h:66
DTROS25Data::addTDCError
void addTDCError(const DTTDCError &tdcError)
Definition: DTControlData.h:41
DTDDUData::addDDUTrailer
void addDDUTrailer(const FEDTrailer &word)
Definition: DTControlData.h:117
DTROS25Data::addSCPrivSubHeader
void addSCPrivSubHeader(const DTLocalTriggerSectorCollectorSubHeaderWord &scPrivSubHeader)
Definition: DTControlData.h:47
DTDDUData::clean
void clean()
Definition: DTControlData.h:133
DTDDUData::theDDUTrailer
FEDTrailer theDDUTrailer
Definition: DTControlData.h:137
DTROBTrailerWord
Definition: DTDDUWords.h:373
DTROS25Data::addROBTrailer
void addROBTrailer(const DTROBTrailerWord &word)
Definition: DTControlData.h:38
FEDTrailer::crcModified
bool crcModified() const
True if the CRC value has been modified by the S-link sender card.
Definition: FEDTrailer.cc:23
DTSectorCollectorData
std::pair< DTLocalTriggerDataWord, int > DTSectorCollectorData
Definition: DTControlData.h:20
DTDDUData::addDDUHeader
void addDDUHeader(const FEDHeader &word)
Setters.
Definition: DTControlData.h:116
DTROS25Data::theROSErrors
std::vector< DTROSErrorWord > theROSErrors
Definition: DTControlData.h:90
DTDDUSecondStatusWord
Definition: DTDDUWords.h:670
DTROS25Data::theTDCData
std::vector< DTTDCData > theTDCData
Definition: DTControlData.h:95
DTROS25Data::theSCPrivateHeader
DTLocalTriggerSectorCollectorHeaderWord theSCPrivateHeader
Definition: DTControlData.h:99
DTTDCData
std::pair< int, DTTDCMeasurementWord > DTTDCData
Definition: DTControlData.h:18
DTROS25Data::theROSHeader
DTROSHeaderWord theROSHeader
Definition: DTControlData.h:88
DTROS25Data::addROSError
void addROSError(const DTROSErrorWord &word)
Definition: DTControlData.h:35
DTDDUData::DTDDUData
DTDDUData(const FEDHeader &dduHeader, const FEDTrailer &dduTrailer)
Constructor.
Definition: DTControlData.h:107
DTDDUData::theROSStatusWords
std::vector< DTDDUFirstStatusWord > theROSStatusWords
Definition: DTControlData.h:138
DTDDUData
Definition: DTControlData.h:104
DTROS25Data::getSCData
const std::vector< DTSectorCollectorData > & getSCData() const
Definition: DTControlData.h:64
DTROSDebugWord
Definition: DTDDUWords.h:298
DTDDUData::getDDUHeader
const FEDHeader & getDDUHeader() const
Getters.
Definition: DTControlData.h:126
DTROS25Data::addSCHeader
void addSCHeader(const DTLocalTriggerHeaderWord &scHeader)
Definition: DTControlData.h:43
DTDDUData::theDDUStatusWord
DTDDUSecondStatusWord theDDUStatusWord
Definition: DTControlData.h:139
DTROS25Data::theSCData
std::vector< DTSectorCollectorData > theSCData
Definition: DTControlData.h:97
DTROS25Data
Definition: DTControlData.h:22
DTROS25Data::getROSHeader
const DTROSHeaderWord & getROSHeader() const
Definition: DTControlData.h:56
DTROS25Data::theSCTrailer
DTLocalTriggerTrailerWord theSCTrailer
Definition: DTControlData.h:100
FEDHeader
Definition: FEDHeader.h:14
FEDHeader.h
DTROS25Data::theSCPrivateSubHeader
DTLocalTriggerSectorCollectorSubHeaderWord theSCPrivateSubHeader
Definition: DTControlData.h:101
DTROS25Data::theROBHeaders
std::vector< DTROBHeader > theROBHeaders
Definition: DTControlData.h:92
DTROS25Data::addROSDebug
void addROSDebug(const DTROSDebugWord &word)
Definition: DTControlData.h:36
DTROSTrailerWord
Definition: DTDDUWords.h:234
DTROS25Data::getSCHeader
const DTLocalTriggerHeaderWord & getSCHeader() const
Definition: DTControlData.h:65
DTROS25Data::addROSTrailer
void addROSTrailer(const DTROSTrailerWord &word)
Definition: DTControlData.h:34
DTDDUData::addROSStatusWord
void addROSStatusWord(const DTDDUFirstStatusWord &word)
Definition: DTControlData.h:118
DTROS25Data::addSCData
void addSCData(const DTSectorCollectorData &scData)
Definition: DTControlData.h:42
DTROS25Data::getROSID
int getROSID() const
Getters ////////////////////////.
Definition: DTControlData.h:53
DTDDUData::getSecondStatusWord
const DTDDUSecondStatusWord & getSecondStatusWord() const
Definition: DTControlData.h:129
FEDTrailer.h