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 
17 
18 #include <vector>
19 
20 typedef std::pair<int, DTROBHeaderWord> DTROBHeader;
21 typedef std::pair<int, DTTDCMeasurementWord> DTTDCData;
22 typedef std::pair<int, DTTDCErrorWord> DTTDCError;
23 typedef std::pair<DTLocalTriggerDataWord, int> DTSectorCollectorData;
24 
25 class DTROS25Data {
26 
27 public:
28 
30  DTROS25Data(int ROSId = 0): theROSId(ROSId) {}
31 
32 
34  virtual ~DTROS25Data() {}
35 
37  inline void setROSId(const int & ID) { theROSId = ID; }
38 
39  inline void addROSHeader( const DTROSHeaderWord & word) { theROSHeader = DTROSHeaderWord(word) ; }
40  inline void addROSTrailer( const DTROSTrailerWord & word) { theROSTrailer = DTROSTrailerWord(word) ; }
41  inline void addROSError( const DTROSErrorWord & word) { theROSErrors.push_back(word); }
42  inline void addROSDebug( const DTROSDebugWord & word) { theROSDebugs.push_back(word); }
43  inline void addROBHeader( const DTROBHeader & robHeader) { theROBHeaders.push_back(robHeader); } // IJ
44  inline void addROBTrailer( const DTROBTrailerWord & word) { theROBTrailers.push_back(word); }
45  inline void addTDCMeasurement( const DTTDCMeasurementWord & word) { theTDCMeasurements.push_back(word); }
46  inline void addTDCData( const DTTDCData & tdcData) { theTDCData.push_back(tdcData); }
47  inline void addTDCError( const DTTDCError & tdcError) { theTDCError.push_back(tdcError); }
48  inline void addSCData ( const DTSectorCollectorData & scData) { theSCData.push_back(scData); }
49  inline void addSCHeader( const DTLocalTriggerHeaderWord &scHeader) { theSCHeader = scHeader; }
50  inline void addSCPrivHeader( const DTLocalTriggerSectorCollectorHeaderWord& scPrivHeader) { theSCPrivateHeader = scPrivHeader; }
51  inline void addSCPrivSubHeader( const DTLocalTriggerSectorCollectorSubHeaderWord& scPrivSubHeader) { theSCPrivateSubHeader = scPrivSubHeader; }
52  inline void addSCTrailer( const DTLocalTriggerTrailerWord& scTrailer) { theSCTrailer = scTrailer; }
53 
55  inline int getROSID() const { return theROSId; }
56 
57  inline const DTROSTrailerWord & getROSTrailer() const {return theROSTrailer;}
58  inline const DTROSHeaderWord & getROSHeader() const {return theROSHeader;}
59  inline const std::vector<DTROSErrorWord>& getROSErrors() const {return theROSErrors;}
60  inline const std::vector<DTROSDebugWord>& getROSDebugs() const {return theROSDebugs;}
61  inline const std::vector<DTROBHeader>& getROBHeaders() const {return theROBHeaders;}
62  inline const std::vector<DTROBTrailerWord>& getROBTrailers() const {return theROBTrailers;}
63  inline const std::vector<DTTDCMeasurementWord>& getTDCMeasurements() const {return theTDCMeasurements;}
64  inline const std::vector<DTTDCData>& getTDCData() const {return theTDCData;}
65  inline const std::vector<DTTDCError>& getTDCError() const {return theTDCError;}
66  inline const std::vector<DTSectorCollectorData>& getSCData() const {return theSCData;}
67  inline const DTLocalTriggerHeaderWord& getSCHeader() const {return theSCHeader;}
69  inline const DTLocalTriggerTrailerWord& getSCTrailer() const {return theSCTrailer;}
71 
72  inline void clean() {
73  theROSHeader = 0;
74  theROSTrailer = 0;
75  theROSErrors.clear();
76  theROSDebugs.clear();
77  theROBHeaders.clear();
78  theROBTrailers.clear();
79  theTDCMeasurements.clear();
80  theTDCData.clear();
81  theTDCError.clear();
82  theSCData.clear();
83  }
84 
85 
86 private:
87 
88  int theROSId;
89 
92  std::vector<DTROSErrorWord> theROSErrors;
93  std::vector<DTROSDebugWord> theROSDebugs;
94  std::vector<DTROBHeader> theROBHeaders;
95  std::vector<DTROBTrailerWord> theROBTrailers;
96  std::vector<DTTDCMeasurementWord> theTDCMeasurements;
97  std::vector<DTTDCData> theTDCData;
98  std::vector<DTTDCError> theTDCError;
99  std::vector<DTSectorCollectorData> theSCData;
104 
105 
106 
107 };
108 
109 
110 class DTDDUData {
111 
112 public:
113 
115  DTDDUData(const FEDHeader & dduHeader, const FEDTrailer & dduTrailer):
116  theDDUHeader(dduHeader),
117  theDDUTrailer(dduTrailer),
119  {}
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 fedt_struct* theTrailer(reinterpret_cast<const fedt_t*>(trailer));
136  if(((theTrailer->conscheck & 0x00000004) >> 2) == 1) {
137  crcErrorBitSet = true;
138  }
139  crcErrorBitSet = false;
140  }
141 
143  inline const FEDHeader & getDDUHeader() const {return theDDUHeader;}
144  inline const FEDTrailer & getDDUTrailer() const {return theDDUTrailer;}
145  inline const std::vector<DTDDUFirstStatusWord> & getFirstStatusWord() const {
146  return theROSStatusWords;}
148  return theDDUStatusWord;}
149  inline bool crcErrorBit() const {
150  return crcErrorBitSet;
151  }
152 
153 private:
154 
157  std::vector<DTDDUFirstStatusWord> theROSStatusWords;
160 
161 };
162 
163 
164 #endif
std::vector< DTSectorCollectorData > theSCData
Definition: DTControlData.h:99
const std::vector< DTROBHeader > & getROBHeaders() const
Definition: DTControlData.h:61
void addSCData(const DTSectorCollectorData &scData)
Definition: DTControlData.h:48
void addDDUStatusWord(const DTDDUSecondStatusWord &word)
DTLocalTriggerTrailerWord theSCTrailer
int getROSID() const
Getters ////////////////////////.
Definition: DTControlData.h:55
std::vector< DTROBHeader > theROBHeaders
Definition: DTControlData.h:94
void clean()
Definition: DTControlData.h:72
void addROSStatusWord(const DTDDUFirstStatusWord &word)
const std::vector< DTTDCData > & getTDCData() const
Definition: DTControlData.h:64
virtual ~DTROS25Data()
Destructor.
Definition: DTControlData.h:34
const DTLocalTriggerSectorCollectorHeaderWord & getSCPrivHeader() const
Definition: DTControlData.h:68
uint32_t ID
Definition: Definitions.h:26
std::pair< int, DTROBHeaderWord > DTROBHeader
Definition: DTControlData.h:20
void addROBHeader(const DTROBHeader &robHeader)
Definition: DTControlData.h:43
virtual ~DTDDUData()
Destructor.
void addSCPrivHeader(const DTLocalTriggerSectorCollectorHeaderWord &scPrivHeader)
Definition: DTControlData.h:50
void addSCTrailer(const DTLocalTriggerTrailerWord &scTrailer)
Definition: DTControlData.h:52
std::vector< DTROBTrailerWord > theROBTrailers
Definition: DTControlData.h:95
bool crcErrorBitSet
unsigned int conscheck
Definition: fed_trailer.h:32
void addTDCMeasurement(const DTTDCMeasurementWord &word)
Definition: DTControlData.h:45
DTROS25Data(int ROSId=0)
Constructors.
Definition: DTControlData.h:30
const DTLocalTriggerTrailerWord & getSCTrailer() const
Definition: DTControlData.h:69
const std::vector< DTROSDebugWord > & getROSDebugs() const
Definition: DTControlData.h:60
const std::vector< DTSectorCollectorData > & getSCData() const
Definition: DTControlData.h:66
FEDHeader theDDUHeader
const std::vector< DTDDUFirstStatusWord > & getFirstStatusWord() const
std::pair< int, DTTDCErrorWord > DTTDCError
Definition: DTControlData.h:22
void addTDCError(const DTTDCError &tdcError)
Definition: DTControlData.h:47
void addSCPrivSubHeader(const DTLocalTriggerSectorCollectorSubHeaderWord &scPrivSubHeader)
Definition: DTControlData.h:51
const DTROSTrailerWord & getROSTrailer() const
Definition: DTControlData.h:57
const DTROSHeaderWord & getROSHeader() const
Definition: DTControlData.h:58
std::vector< DTTDCError > theTDCError
Definition: DTControlData.h:98
FEDTrailer theDDUTrailer
std::pair< DTLocalTriggerDataWord, int > DTSectorCollectorData
Definition: DTControlData.h:23
void setROSId(const int &ID)
Setters ///////////////////////.
Definition: DTControlData.h:37
void addDDUHeader(const FEDHeader &word)
Setters.
DTLocalTriggerSectorCollectorHeaderWord theSCPrivateHeader
void addDDUTrailer(const FEDTrailer &word)
DTROSHeaderWord theROSHeader
Definition: DTControlData.h:90
bool crcErrorBit() const
void checkCRCBit(const unsigned char *trailer)
std::vector< DTROSErrorWord > theROSErrors
Definition: DTControlData.h:92
const FEDTrailer & getDDUTrailer() const
DTDDUSecondStatusWord theDDUStatusWord
DTROSTrailerWord theROSTrailer
Definition: DTControlData.h:91
std::vector< DTDDUFirstStatusWord > theROSStatusWords
const FEDHeader & getDDUHeader() const
Getters.
void addROBTrailer(const DTROBTrailerWord &word)
Definition: DTControlData.h:44
const std::vector< DTROBTrailerWord > & getROBTrailers() const
Definition: DTControlData.h:62
std::vector< DTTDCMeasurementWord > theTDCMeasurements
Definition: DTControlData.h:96
void addROSHeader(const DTROSHeaderWord &word)
Definition: DTControlData.h:39
void addROSError(const DTROSErrorWord &word)
Definition: DTControlData.h:41
DTDDUData(const FEDHeader &dduHeader, const FEDTrailer &dduTrailer)
Constructor.
const DTLocalTriggerHeaderWord & getSCHeader() const
Definition: DTControlData.h:67
const std::vector< DTTDCMeasurementWord > & getTDCMeasurements() const
Definition: DTControlData.h:63
const std::vector< DTROSErrorWord > & getROSErrors() const
Definition: DTControlData.h:59
void addROSTrailer(const DTROSTrailerWord &word)
Definition: DTControlData.h:40
std::vector< DTTDCData > theTDCData
Definition: DTControlData.h:97
std::pair< int, DTTDCMeasurementWord > DTTDCData
Definition: DTControlData.h:21
void addSCHeader(const DTLocalTriggerHeaderWord &scHeader)
Definition: DTControlData.h:49
std::vector< DTROSDebugWord > theROSDebugs
Definition: DTControlData.h:93
DTLocalTriggerSectorCollectorSubHeaderWord theSCPrivateSubHeader
void addROSDebug(const DTROSDebugWord &word)
Definition: DTControlData.h:42
const std::vector< DTTDCError > & getTDCError() const
Definition: DTControlData.h:65
const DTDDUSecondStatusWord & getSecondStatusWord() const
void addTDCData(const DTTDCData &tdcData)
Definition: DTControlData.h:46
DTLocalTriggerHeaderWord theSCHeader
const DTLocalTriggerSectorCollectorSubHeaderWord & getSCPrivSubHeader() const
Definition: DTControlData.h:70