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 
24 public:
25 
27  DTROS25Data(int ROSId = 0): theROSId(ROSId) {}
28 
30  virtual ~DTROS25Data() {}
31 
33  inline void setROSId(const int & ID) { theROSId = ID; }
34 
35  inline void addROSHeader( const DTROSHeaderWord & word) { theROSHeader = DTROSHeaderWord(word) ; }
36  inline void addROSTrailer( const DTROSTrailerWord & word) { theROSTrailer = DTROSTrailerWord(word) ; }
37  inline void addROSError( const DTROSErrorWord & word) { theROSErrors.push_back(word); }
38  inline void addROSDebug( const DTROSDebugWord & word) { theROSDebugs.push_back(word); }
39  inline void addROBHeader( const DTROBHeader & robHeader) { theROBHeaders.push_back(robHeader); } // IJ
40  inline void addROBTrailer( const DTROBTrailerWord & word) { theROBTrailers.push_back(word); }
41  inline void addTDCMeasurement( const DTTDCMeasurementWord & word) { theTDCMeasurements.push_back(word); }
42  inline void addTDCData( const DTTDCData & tdcData) { theTDCData.push_back(tdcData); }
43  inline void addTDCError( const DTTDCError & tdcError) { theTDCError.push_back(tdcError); }
44  inline void addSCData ( const DTSectorCollectorData & scData) { theSCData.push_back(scData); }
45  inline void addSCHeader( const DTLocalTriggerHeaderWord &scHeader) { theSCHeader = scHeader; }
46  inline void addSCPrivHeader( const DTLocalTriggerSectorCollectorHeaderWord& scPrivHeader) { theSCPrivateHeader = scPrivHeader; }
47  inline void addSCPrivSubHeader( const DTLocalTriggerSectorCollectorSubHeaderWord& scPrivSubHeader) { theSCPrivateSubHeader = scPrivSubHeader; }
48  inline void addSCTrailer( const DTLocalTriggerTrailerWord& scTrailer) { theSCTrailer = scTrailer; }
49 
51  inline int getROSID() const { return theROSId; }
52 
53  inline const DTROSTrailerWord & getROSTrailer() const {return theROSTrailer;}
54  inline const DTROSHeaderWord & getROSHeader() const {return theROSHeader;}
55  inline const std::vector<DTROSErrorWord>& getROSErrors() const {return theROSErrors;}
56  inline const std::vector<DTROSDebugWord>& getROSDebugs() const {return theROSDebugs;}
57  inline const std::vector<DTROBHeader>& getROBHeaders() const {return theROBHeaders;}
58  inline const std::vector<DTROBTrailerWord>& getROBTrailers() const {return theROBTrailers;}
59  inline const std::vector<DTTDCMeasurementWord>& getTDCMeasurements() const {return theTDCMeasurements;}
60  inline const std::vector<DTTDCData>& getTDCData() const {return theTDCData;}
61  inline const std::vector<DTTDCError>& getTDCError() const {return theTDCError;}
62  inline const std::vector<DTSectorCollectorData>& getSCData() const {return theSCData;}
63  inline const DTLocalTriggerHeaderWord& getSCHeader() const {return theSCHeader;}
65  inline const DTLocalTriggerTrailerWord& getSCTrailer() const {return theSCTrailer;}
67 
68  inline void clean() {
69  theROSHeader = 0;
70  theROSTrailer = 0;
71  theROSErrors.clear();
72  theROSDebugs.clear();
73  theROBHeaders.clear();
74  theROBTrailers.clear();
75  theTDCMeasurements.clear();
76  theTDCData.clear();
77  theTDCError.clear();
78  theSCData.clear();
79  theSCHeader = 0;
80  theSCTrailer = 0;
81  }
82 
83 
84 private:
85 
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 
105 class DTDDUData {
106 
107 public:
108 
110  DTDDUData(const FEDHeader & dduHeader, const FEDTrailer & dduTrailer):
111  theDDUHeader(dduHeader),
112  theDDUTrailer(dduTrailer),
113  crcErrorBitSet(false)
114  {}
115 
117  theDDUHeader(nullptr),
118  theDDUTrailer(nullptr),
119  crcErrorBitSet(false)
120  {}
121 
123  virtual ~DTDDUData() {}
124 
126  inline void addDDUHeader( const FEDHeader & word) { theDDUHeader = word; }
127  inline void addDDUTrailer( const FEDTrailer & word) { theDDUTrailer = word; }
128  inline void addROSStatusWord( const DTDDUFirstStatusWord & word) {
129  theROSStatusWords.push_back(word);
130  }
131  inline void addDDUStatusWord( const DTDDUSecondStatusWord & word) {
132  theDDUStatusWord = word;
133  }
134  inline void checkCRCBit(const unsigned char* trailer) {
135  const FEDTrailer fedTrailer(trailer);
136  crcErrorBitSet = fedTrailer.crcModified();
137  }
138 
140  inline const FEDHeader & getDDUHeader() const {return theDDUHeader;}
141  inline const FEDTrailer & getDDUTrailer() const {return theDDUTrailer;}
142  inline const std::vector<DTDDUFirstStatusWord> & getFirstStatusWord() const {
143  return theROSStatusWords;}
145  return theDDUStatusWord;}
146  inline bool crcErrorBit() const {
147  return crcErrorBitSet;
148  }
149 
150  // FIXME: check whether the other variables should also be reset in the clean() method
151  inline void clean() {
152  theROSStatusWords.clear();
153  }
154 
155 
156 private:
157 
160  std::vector<DTDDUFirstStatusWord> theROSStatusWords;
163 
164 };
165 
166 typedef std::vector<std::vector<DTROS25Data> > DTROS25Collection;
167 typedef std::vector<DTDDUData> DTDDUCollection;
168 
169 #endif
std::vector< DTSectorCollectorData > theSCData
Definition: DTControlData.h:97
const std::vector< DTROBHeader > & getROBHeaders() const
Definition: DTControlData.h:57
void addSCData(const DTSectorCollectorData &scData)
Definition: DTControlData.h:44
void addDDUStatusWord(const DTDDUSecondStatusWord &word)
DTLocalTriggerTrailerWord theSCTrailer
int getROSID() const
Getters ////////////////////////.
Definition: DTControlData.h:51
std::vector< DTROBHeader > theROBHeaders
Definition: DTControlData.h:92
void clean()
Definition: DTControlData.h:68
void addROSStatusWord(const DTDDUFirstStatusWord &word)
const std::vector< DTTDCData > & getTDCData() const
Definition: DTControlData.h:60
virtual ~DTROS25Data()
Destructor.
Definition: DTControlData.h:30
const DTLocalTriggerSectorCollectorHeaderWord & getSCPrivHeader() const
Definition: DTControlData.h:64
uint32_t ID
Definition: Definitions.h:26
std::pair< int, DTROBHeaderWord > DTROBHeader
Definition: DTControlData.h:17
#define nullptr
void addROBHeader(const DTROBHeader &robHeader)
Definition: DTControlData.h:39
virtual ~DTDDUData()
Destructor.
std::vector< DTDDUData > DTDDUCollection
void addSCPrivHeader(const DTLocalTriggerSectorCollectorHeaderWord &scPrivHeader)
Definition: DTControlData.h:46
void addSCTrailer(const DTLocalTriggerTrailerWord &scTrailer)
Definition: DTControlData.h:48
bool crcModified() const
True if the CRC value has been modified by the S-link sender card.
Definition: FEDTrailer.cc:42
std::vector< std::vector< DTROS25Data > > DTROS25Collection
std::vector< DTROBTrailerWord > theROBTrailers
Definition: DTControlData.h:93
bool crcErrorBitSet
void addTDCMeasurement(const DTTDCMeasurementWord &word)
Definition: DTControlData.h:41
DTROS25Data(int ROSId=0)
Constructors.
Definition: DTControlData.h:27
const DTLocalTriggerTrailerWord & getSCTrailer() const
Definition: DTControlData.h:65
const std::vector< DTROSDebugWord > & getROSDebugs() const
Definition: DTControlData.h:56
const std::vector< DTSectorCollectorData > & getSCData() const
Definition: DTControlData.h:62
FEDHeader theDDUHeader
const std::vector< DTDDUFirstStatusWord > & getFirstStatusWord() const
std::pair< int, DTTDCErrorWord > DTTDCError
Definition: DTControlData.h:19
void addTDCError(const DTTDCError &tdcError)
Definition: DTControlData.h:43
void addSCPrivSubHeader(const DTLocalTriggerSectorCollectorSubHeaderWord &scPrivSubHeader)
Definition: DTControlData.h:47
const DTROSTrailerWord & getROSTrailer() const
Definition: DTControlData.h:53
const DTROSHeaderWord & getROSHeader() const
Definition: DTControlData.h:54
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:33
void addDDUHeader(const FEDHeader &word)
Setters.
DTLocalTriggerSectorCollectorHeaderWord theSCPrivateHeader
Definition: DTControlData.h:99
void addDDUTrailer(const FEDTrailer &word)
DTROSHeaderWord theROSHeader
Definition: DTControlData.h:88
bool crcErrorBit() const
void checkCRCBit(const unsigned char *trailer)
std::vector< DTROSErrorWord > theROSErrors
Definition: DTControlData.h:90
const FEDTrailer & getDDUTrailer() const
DTDDUSecondStatusWord theDDUStatusWord
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:40
const std::vector< DTROBTrailerWord > & getROBTrailers() const
Definition: DTControlData.h:58
std::vector< DTTDCMeasurementWord > theTDCMeasurements
Definition: DTControlData.h:94
void addROSHeader(const DTROSHeaderWord &word)
Definition: DTControlData.h:35
void addROSError(const DTROSErrorWord &word)
Definition: DTControlData.h:37
DTDDUData(const FEDHeader &dduHeader, const FEDTrailer &dduTrailer)
Constructor.
const DTLocalTriggerHeaderWord & getSCHeader() const
Definition: DTControlData.h:63
const std::vector< DTTDCMeasurementWord > & getTDCMeasurements() const
Definition: DTControlData.h:59
const std::vector< DTROSErrorWord > & getROSErrors() const
Definition: DTControlData.h:55
void addROSTrailer(const DTROSTrailerWord &word)
Definition: DTControlData.h:36
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:45
std::vector< DTROSDebugWord > theROSDebugs
Definition: DTControlData.h:91
DTLocalTriggerSectorCollectorSubHeaderWord theSCPrivateSubHeader
void addROSDebug(const DTROSDebugWord &word)
Definition: DTControlData.h:38
const std::vector< DTTDCError > & getTDCError() const
Definition: DTControlData.h:61
const DTDDUSecondStatusWord & getSecondStatusWord() const
void addTDCData(const DTTDCData &tdcData)
Definition: DTControlData.h:42
DTLocalTriggerHeaderWord theSCHeader
Definition: DTControlData.h:98
const DTLocalTriggerSectorCollectorSubHeaderWord & getSCPrivSubHeader() const
Definition: DTControlData.h:66