CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DTControlData.h
Go to the documentation of this file.
1 #ifndef DTDigi_DTControlData_h
2 #define DTDigi_DTControlData_h
3 
15 
16 #include <vector>
17 
18 typedef std::pair<int, DTROBHeaderWord> DTROBHeader;
19 typedef std::pair<int, DTTDCMeasurementWord> DTTDCData;
20 typedef std::pair<int, DTTDCErrorWord> DTTDCError;
21 typedef std::pair<DTLocalTriggerDataWord, int> DTSectorCollectorData;
22 
23 class DTROS25Data {
24 
25 public:
26 
28  DTROS25Data(int ROSId = 0): theROSId(ROSId) {}
29 
31  virtual ~DTROS25Data() {}
32 
34  inline void setROSId(const int & ID) { theROSId = ID; }
35 
36  inline void addROSHeader( const DTROSHeaderWord & word) { theROSHeader = DTROSHeaderWord(word) ; }
37  inline void addROSTrailer( const DTROSTrailerWord & word) { theROSTrailer = DTROSTrailerWord(word) ; }
38  inline void addROSError( const DTROSErrorWord & word) { theROSErrors.push_back(word); }
39  inline void addROSDebug( const DTROSDebugWord & word) { theROSDebugs.push_back(word); }
40  inline void addROBHeader( const DTROBHeader & robHeader) { theROBHeaders.push_back(robHeader); } // IJ
41  inline void addROBTrailer( const DTROBTrailerWord & word) { theROBTrailers.push_back(word); }
42  inline void addTDCMeasurement( const DTTDCMeasurementWord & word) { theTDCMeasurements.push_back(word); }
43  inline void addTDCData( const DTTDCData & tdcData) { theTDCData.push_back(tdcData); }
44  inline void addTDCError( const DTTDCError & tdcError) { theTDCError.push_back(tdcError); }
45  inline void addSCData ( const DTSectorCollectorData & scData) { theSCData.push_back(scData); }
46  inline void addSCHeader( const DTLocalTriggerHeaderWord &scHeader) { theSCHeader = scHeader; }
47  inline void addSCPrivHeader( const DTLocalTriggerSectorCollectorHeaderWord& scPrivHeader) { theSCPrivateHeader = scPrivHeader; }
48  inline void addSCPrivSubHeader( const DTLocalTriggerSectorCollectorSubHeaderWord& scPrivSubHeader) { theSCPrivateSubHeader = scPrivSubHeader; }
49  inline void addSCTrailer( const DTLocalTriggerTrailerWord& scTrailer) { theSCTrailer = scTrailer; }
50 
52  inline int getROSID() const { return theROSId; }
53 
54  inline const DTROSTrailerWord & getROSTrailer() const {return theROSTrailer;}
55  inline const DTROSHeaderWord & getROSHeader() const {return theROSHeader;}
56  inline const std::vector<DTROSErrorWord>& getROSErrors() const {return theROSErrors;}
57  inline const std::vector<DTROSDebugWord>& getROSDebugs() const {return theROSDebugs;}
58  inline const std::vector<DTROBHeader>& getROBHeaders() const {return theROBHeaders;}
59  inline const std::vector<DTROBTrailerWord>& getROBTrailers() const {return theROBTrailers;}
60  inline const std::vector<DTTDCMeasurementWord>& getTDCMeasurements() const {return theTDCMeasurements;}
61  inline const std::vector<DTTDCData>& getTDCData() const {return theTDCData;}
62  inline const std::vector<DTTDCError>& getTDCError() const {return theTDCError;}
63  inline const std::vector<DTSectorCollectorData>& getSCData() const {return theSCData;}
64  inline const DTLocalTriggerHeaderWord& getSCHeader() const {return theSCHeader;}
66  inline const DTLocalTriggerTrailerWord& getSCTrailer() const {return theSCTrailer;}
68 
69  inline void clean() {
70  theROSHeader = 0;
71  theROSTrailer = 0;
72  theROSErrors.clear();
73  theROSDebugs.clear();
74  theROBHeaders.clear();
75  theROBTrailers.clear();
76  theTDCMeasurements.clear();
77  theTDCData.clear();
78  theTDCError.clear();
79  theSCData.clear();
80  theSCHeader = 0;
81  theSCTrailer = 0;
82  }
83 
84 
85 private:
86 
87  int theROSId;
88 
91  std::vector<DTROSErrorWord> theROSErrors;
92  std::vector<DTROSDebugWord> theROSDebugs;
93  std::vector<DTROBHeader> theROBHeaders;
94  std::vector<DTROBTrailerWord> theROBTrailers;
95  std::vector<DTTDCMeasurementWord> theTDCMeasurements;
96  std::vector<DTTDCData> theTDCData;
97  std::vector<DTTDCError> theTDCError;
98  std::vector<DTSectorCollectorData> theSCData;
103 };
104 
105 
106 class DTDDUData {
107 
108 public:
109 
111  DTDDUData(const FEDHeader & dduHeader, const FEDTrailer & dduTrailer):
112  theDDUHeader(dduHeader),
113  theDDUTrailer(dduTrailer),
115  {}
116 
118  theDDUHeader(0),
119  theDDUTrailer(0),
121  {}
122 
124  virtual ~DTDDUData() {}
125 
127  inline void addDDUHeader( const FEDHeader & word) { theDDUHeader = word; }
128  inline void addDDUTrailer( const FEDTrailer & word) { theDDUTrailer = word; }
129  inline void addROSStatusWord( const DTDDUFirstStatusWord & word) {
130  theROSStatusWords.push_back(word);
131  }
132  inline void addDDUStatusWord( const DTDDUSecondStatusWord & word) {
133  theDDUStatusWord = word;
134  }
135  inline void checkCRCBit(const unsigned char* trailer) {
136  const fedt_struct* theTrailer(reinterpret_cast<const fedt_t*>(trailer));
137  if(((theTrailer->conscheck & 0x00000004) >> 2) == 1) {
138  crcErrorBitSet = true;
139  }
140  crcErrorBitSet = false;
141  }
142 
144  inline const FEDHeader & getDDUHeader() const {return theDDUHeader;}
145  inline const FEDTrailer & getDDUTrailer() const {return theDDUTrailer;}
146  inline const std::vector<DTDDUFirstStatusWord> & getFirstStatusWord() const {
147  return theROSStatusWords;}
149  return theDDUStatusWord;}
150  inline bool crcErrorBit() const {
151  return crcErrorBitSet;
152  }
153 
154  // FIXME: check whether the other variables should also be reset in the clean() method
155  inline void clean() {
156  theROSStatusWords.clear();
157  }
158 
159 
160 private:
161 
164  std::vector<DTDDUFirstStatusWord> theROSStatusWords;
167 
168 };
169 
170 typedef std::vector<std::vector<DTROS25Data> > DTROS25Collection;
171 typedef std::vector<DTDDUData> DTDDUCollection;
172 
173 #endif
std::vector< DTSectorCollectorData > theSCData
Definition: DTControlData.h:98
const std::vector< DTROBHeader > & getROBHeaders() const
Definition: DTControlData.h:58
void addSCData(const DTSectorCollectorData &scData)
Definition: DTControlData.h:45
void addDDUStatusWord(const DTDDUSecondStatusWord &word)
DTLocalTriggerTrailerWord theSCTrailer
int getROSID() const
Getters ////////////////////////.
Definition: DTControlData.h:52
std::vector< DTROBHeader > theROBHeaders
Definition: DTControlData.h:93
void clean()
Definition: DTControlData.h:69
void addROSStatusWord(const DTDDUFirstStatusWord &word)
const std::vector< DTTDCData > & getTDCData() const
Definition: DTControlData.h:61
virtual ~DTROS25Data()
Destructor.
Definition: DTControlData.h:31
const DTLocalTriggerSectorCollectorHeaderWord & getSCPrivHeader() const
Definition: DTControlData.h:65
uint32_t ID
Definition: Definitions.h:26
std::pair< int, DTROBHeaderWord > DTROBHeader
Definition: DTControlData.h:18
void addROBHeader(const DTROBHeader &robHeader)
Definition: DTControlData.h:40
virtual ~DTDDUData()
Destructor.
std::vector< DTDDUData > DTDDUCollection
void addSCPrivHeader(const DTLocalTriggerSectorCollectorHeaderWord &scPrivHeader)
Definition: DTControlData.h:47
void addSCTrailer(const DTLocalTriggerTrailerWord &scTrailer)
Definition: DTControlData.h:49
std::vector< std::vector< DTROS25Data > > DTROS25Collection
std::vector< DTROBTrailerWord > theROBTrailers
Definition: DTControlData.h:94
bool crcErrorBitSet
unsigned int conscheck
Definition: fed_trailer.h:32
void addTDCMeasurement(const DTTDCMeasurementWord &word)
Definition: DTControlData.h:42
DTROS25Data(int ROSId=0)
Constructors.
Definition: DTControlData.h:28
const DTLocalTriggerTrailerWord & getSCTrailer() const
Definition: DTControlData.h:66
const std::vector< DTROSDebugWord > & getROSDebugs() const
Definition: DTControlData.h:57
const std::vector< DTSectorCollectorData > & getSCData() const
Definition: DTControlData.h:63
FEDHeader theDDUHeader
const std::vector< DTDDUFirstStatusWord > & getFirstStatusWord() const
std::pair< int, DTTDCErrorWord > DTTDCError
Definition: DTControlData.h:20
void addTDCError(const DTTDCError &tdcError)
Definition: DTControlData.h:44
void addSCPrivSubHeader(const DTLocalTriggerSectorCollectorSubHeaderWord &scPrivSubHeader)
Definition: DTControlData.h:48
const DTROSTrailerWord & getROSTrailer() const
Definition: DTControlData.h:54
const DTROSHeaderWord & getROSHeader() const
Definition: DTControlData.h:55
std::vector< DTTDCError > theTDCError
Definition: DTControlData.h:97
FEDTrailer theDDUTrailer
std::pair< DTLocalTriggerDataWord, int > DTSectorCollectorData
Definition: DTControlData.h:21
void setROSId(const int &ID)
Setters ///////////////////////.
Definition: DTControlData.h:34
void addDDUHeader(const FEDHeader &word)
Setters.
DTLocalTriggerSectorCollectorHeaderWord theSCPrivateHeader
void addDDUTrailer(const FEDTrailer &word)
DTROSHeaderWord theROSHeader
Definition: DTControlData.h:89
bool crcErrorBit() const
void checkCRCBit(const unsigned char *trailer)
std::vector< DTROSErrorWord > theROSErrors
Definition: DTControlData.h:91
const FEDTrailer & getDDUTrailer() const
DTDDUSecondStatusWord theDDUStatusWord
DTROSTrailerWord theROSTrailer
Definition: DTControlData.h:90
std::vector< DTDDUFirstStatusWord > theROSStatusWords
const FEDHeader & getDDUHeader() const
Getters.
void clean()
void addROBTrailer(const DTROBTrailerWord &word)
Definition: DTControlData.h:41
const std::vector< DTROBTrailerWord > & getROBTrailers() const
Definition: DTControlData.h:59
std::vector< DTTDCMeasurementWord > theTDCMeasurements
Definition: DTControlData.h:95
void addROSHeader(const DTROSHeaderWord &word)
Definition: DTControlData.h:36
void addROSError(const DTROSErrorWord &word)
Definition: DTControlData.h:38
DTDDUData(const FEDHeader &dduHeader, const FEDTrailer &dduTrailer)
Constructor.
const DTLocalTriggerHeaderWord & getSCHeader() const
Definition: DTControlData.h:64
const std::vector< DTTDCMeasurementWord > & getTDCMeasurements() const
Definition: DTControlData.h:60
const std::vector< DTROSErrorWord > & getROSErrors() const
Definition: DTControlData.h:56
void addROSTrailer(const DTROSTrailerWord &word)
Definition: DTControlData.h:37
std::vector< DTTDCData > theTDCData
Definition: DTControlData.h:96
std::pair< int, DTTDCMeasurementWord > DTTDCData
Definition: DTControlData.h:19
void addSCHeader(const DTLocalTriggerHeaderWord &scHeader)
Definition: DTControlData.h:46
std::vector< DTROSDebugWord > theROSDebugs
Definition: DTControlData.h:92
volatile std::atomic< bool > shutdown_flag false
DTLocalTriggerSectorCollectorSubHeaderWord theSCPrivateSubHeader
void addROSDebug(const DTROSDebugWord &word)
Definition: DTControlData.h:39
const std::vector< DTTDCError > & getTDCError() const
Definition: DTControlData.h:62
const DTDDUSecondStatusWord & getSecondStatusWord() const
void addTDCData(const DTTDCData &tdcData)
Definition: DTControlData.h:43
DTLocalTriggerHeaderWord theSCHeader
Definition: DTControlData.h:99
const DTLocalTriggerSectorCollectorSubHeaderWord & getSCPrivSubHeader() const
Definition: DTControlData.h:67