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 DTRawToDigi_DTControlData_h
2 #define DTRawToDigi_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 
30 
32  virtual ~DTROS25Data() {}
33 
35  inline void setROSId(const int & ID) { theROSId = ID; }
36 
37  inline void addROSHeader( const DTROSHeaderWord & word) { theROSHeader = DTROSHeaderWord(word) ; }
38  inline void addROSTrailer( const DTROSTrailerWord & word) { theROSTrailer = DTROSTrailerWord(word) ; }
39  inline void addROSError( const DTROSErrorWord & word) { theROSErrors.push_back(word); }
40  inline void addROSDebug( const DTROSDebugWord & word) { theROSDebugs.push_back(word); }
41  inline void addROBHeader( const DTROBHeader & robHeader) { theROBHeaders.push_back(robHeader); } // IJ
42  inline void addROBTrailer( const DTROBTrailerWord & word) { theROBTrailers.push_back(word); }
43  inline void addTDCMeasurement( const DTTDCMeasurementWord & word) { theTDCMeasurements.push_back(word); }
44  inline void addTDCData( const DTTDCData & tdcData) { theTDCData.push_back(tdcData); }
45  inline void addTDCError( const DTTDCError & tdcError) { theTDCError.push_back(tdcError); }
46  inline void addSCData ( const DTSectorCollectorData & scData) { theSCData.push_back(scData); }
47  inline void addSCHeader( const DTLocalTriggerHeaderWord &scHeader) { theSCHeader = scHeader; }
48  inline void addSCPrivHeader( const DTLocalTriggerSectorCollectorHeaderWord& scPrivHeader) { theSCPrivateHeader = scPrivHeader; }
49  inline void addSCPrivSubHeader( const DTLocalTriggerSectorCollectorSubHeaderWord& scPrivSubHeader) { theSCPrivateSubHeader = scPrivSubHeader; }
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  }
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 };
106 
107 
108 class DTDDUData {
109 
110 public:
111 
113  DTDDUData(const FEDHeader & dduHeader, const FEDTrailer & dduTrailer):
114  theDDUHeader(dduHeader),
115  theDDUTrailer(dduTrailer),
117  {}
118 
119 
121  virtual ~DTDDUData() {}
122 
124  inline void addDDUHeader( const FEDHeader & word) { theDDUHeader = word; }
125  inline void addDDUTrailer( const FEDTrailer & word) { theDDUTrailer = word; }
126  inline void addROSStatusWord( const DTDDUFirstStatusWord & word) {
127  theROSStatusWords.push_back(word);
128  }
129  inline void addDDUStatusWord( const DTDDUSecondStatusWord & word) {
130  theDDUStatusWord = word;
131  }
132  inline void checkCRCBit(const unsigned char* trailer) {
133  const fedt_struct* theTrailer(reinterpret_cast<const fedt_t*>(trailer));
134  if(((theTrailer->conscheck & 0x00000004) >> 2) == 1) {
135  crcErrorBitSet = true;
136  }
137  crcErrorBitSet = false;
138  }
139 
141  inline const FEDHeader & getDDUHeader() const {return theDDUHeader;}
142  inline const FEDTrailer & getDDUTrailer() const {return theDDUTrailer;}
143  inline const std::vector<DTDDUFirstStatusWord> & getFirstStatusWord() const {
144  return theROSStatusWords;}
146  return theDDUStatusWord;}
147  inline bool crcErrorBit() const {
148  return crcErrorBitSet;
149  }
150 
151 private:
152 
155  std::vector<DTDDUFirstStatusWord> theROSStatusWords;
158 
159 };
160 
161 
162 #endif
std::vector< DTSectorCollectorData > theSCData
Definition: DTControlData.h:97
const std::vector< DTROBHeader > & getROBHeaders() const
Definition: DTControlData.h:59
void addSCData(const DTSectorCollectorData &scData)
Definition: DTControlData.h:46
void addDDUStatusWord(const DTDDUSecondStatusWord &word)
DTLocalTriggerTrailerWord theSCTrailer
int getROSID() const
Getters ////////////////////////.
Definition: DTControlData.h:53
std::vector< DTROBHeader > theROBHeaders
Definition: DTControlData.h:92
void clean()
Definition: DTControlData.h:70
void addROSStatusWord(const DTDDUFirstStatusWord &word)
const std::vector< DTTDCData > & getTDCData() const
Definition: DTControlData.h:62
virtual ~DTROS25Data()
Destructor.
Definition: DTControlData.h:32
const DTLocalTriggerSectorCollectorHeaderWord & getSCPrivHeader() const
Definition: DTControlData.h:66
uint32_t ID
Definition: Definitions.h:26
std::pair< int, DTROBHeaderWord > DTROBHeader
Definition: DTControlData.h:18
void addROBHeader(const DTROBHeader &robHeader)
Definition: DTControlData.h:41
virtual ~DTDDUData()
Destructor.
void addSCPrivHeader(const DTLocalTriggerSectorCollectorHeaderWord &scPrivHeader)
Definition: DTControlData.h:48
void addSCTrailer(const DTLocalTriggerTrailerWord &scTrailer)
Definition: DTControlData.h:50
std::vector< DTROBTrailerWord > theROBTrailers
Definition: DTControlData.h:93
bool crcErrorBitSet
unsigned int conscheck
Definition: fed_trailer.h:32
void addTDCMeasurement(const DTTDCMeasurementWord &word)
Definition: DTControlData.h:43
DTROS25Data(int ROSId=0)
Constructors.
Definition: DTControlData.h:28
const DTLocalTriggerTrailerWord & getSCTrailer() const
Definition: DTControlData.h:67
const std::vector< DTROSDebugWord > & getROSDebugs() const
Definition: DTControlData.h:58
const std::vector< DTSectorCollectorData > & getSCData() const
Definition: DTControlData.h:64
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:45
void addSCPrivSubHeader(const DTLocalTriggerSectorCollectorSubHeaderWord &scPrivSubHeader)
Definition: DTControlData.h:49
const DTROSTrailerWord & getROSTrailer() const
Definition: DTControlData.h:55
const DTROSHeaderWord & getROSHeader() const
Definition: DTControlData.h:56
std::vector< DTTDCError > theTDCError
Definition: DTControlData.h:96
FEDTrailer theDDUTrailer
std::pair< DTLocalTriggerDataWord, int > DTSectorCollectorData
Definition: DTControlData.h:21
void setROSId(const int &ID)
Setters ///////////////////////.
Definition: DTControlData.h:35
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 addROBTrailer(const DTROBTrailerWord &word)
Definition: DTControlData.h:42
const std::vector< DTROBTrailerWord > & getROBTrailers() const
Definition: DTControlData.h:60
std::vector< DTTDCMeasurementWord > theTDCMeasurements
Definition: DTControlData.h:94
void addROSHeader(const DTROSHeaderWord &word)
Definition: DTControlData.h:37
void addROSError(const DTROSErrorWord &word)
Definition: DTControlData.h:39
DTDDUData(const FEDHeader &dduHeader, const FEDTrailer &dduTrailer)
Constructor.
const DTLocalTriggerHeaderWord & getSCHeader() const
Definition: DTControlData.h:65
const std::vector< DTTDCMeasurementWord > & getTDCMeasurements() const
Definition: DTControlData.h:61
const std::vector< DTROSErrorWord > & getROSErrors() const
Definition: DTControlData.h:57
void addROSTrailer(const DTROSTrailerWord &word)
Definition: DTControlData.h:38
std::vector< DTTDCData > theTDCData
Definition: DTControlData.h:95
std::pair< int, DTTDCMeasurementWord > DTTDCData
Definition: DTControlData.h:19
void addSCHeader(const DTLocalTriggerHeaderWord &scHeader)
Definition: DTControlData.h:47
std::vector< DTROSDebugWord > theROSDebugs
Definition: DTControlData.h:91
volatile std::atomic< bool > shutdown_flag false
DTLocalTriggerSectorCollectorSubHeaderWord theSCPrivateSubHeader
void addROSDebug(const DTROSDebugWord &word)
Definition: DTControlData.h:40
const std::vector< DTTDCError > & getTDCError() const
Definition: DTControlData.h:63
const DTDDUSecondStatusWord & getSecondStatusWord() const
void addTDCData(const DTTDCData &tdcData)
Definition: DTControlData.h:44
DTLocalTriggerHeaderWord theSCHeader
Definition: DTControlData.h:98
const DTLocalTriggerSectorCollectorSubHeaderWord & getSCPrivSubHeader() const
Definition: DTControlData.h:68