CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/DataFormats/L1GlobalTrigger/interface/L1TcsWord.h

Go to the documentation of this file.
00001 #ifndef L1GlobalTrigger_L1TcsWord_h
00002 #define L1GlobalTrigger_L1TcsWord_h
00003 
00020 // system include files
00021 #include <iosfwd>
00022 
00023 // user include files
00024 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetupFwd.h"
00025 #include "DataFormats/L1GlobalTrigger/interface/L1GlobalTriggerReadoutSetup.h"
00026 #include "FWCore/Utilities/interface/typedefs.h"
00027 
00028 // forward declarations
00029 
00030 // class declaration
00031 class L1TcsWord
00032 {
00033 
00034 public:
00035 
00037     L1TcsWord();    // empty constructor, all members set to zero;
00038 
00040     L1TcsWord(
00041         cms_uint16_t boardIdValue,
00042         cms_uint16_t bxNrValue,
00043         cms_uint16_t daqNrValue,
00044         cms_uint16_t triggerTypeValue,
00045         cms_uint16_t statusValue,
00046         cms_uint16_t luminositySegmentNrValue,
00047         cms_uint32_t partRunNrValue,
00048         cms_uint32_t assignedPartitionsValue,
00049         cms_uint32_t partTrigNrValue,
00050         cms_uint32_t eventNrValue,
00051         cms_uint64_t orbitNrValue );
00052 
00053 
00055     virtual ~L1TcsWord();
00056 
00058     bool operator==(const L1TcsWord&) const;
00059 
00061     bool operator!=(const L1TcsWord&) const;
00062 
00063 public:
00064 
00066 
00068     inline const cms_uint16_t boardId() const
00069     {
00070         return m_boardId;
00071     }
00072 
00074     void setBoardId(const cms_uint16_t boardIdValue)
00075     {
00076         m_boardId = boardIdValue;
00077     }
00078 
00080     void setBoardId(const cms_uint64_t& word64);
00081 
00084     void setBoardIdWord64(cms_uint64_t& word64, int iWord);
00085 
00086 
00087 
00089     inline const cms_uint16_t bxNr() const
00090     {
00091         return m_bxNr;
00092     }
00093 
00094     void setBxNr(const cms_uint16_t bxNrValue)
00095     {
00096         m_bxNr = bxNrValue;
00097     }
00098 
00100     void setBxNr(const cms_uint64_t& word64);
00101 
00104     void setBxNrWord64(cms_uint64_t& word64, int iWord);
00105 
00106 
00107 
00109     inline const cms_uint16_t daqNr() const
00110     {
00111         return m_daqNr;
00112     }
00113 
00114     void setDaqNr(const cms_uint16_t daqNrValue)
00115     {
00116         m_daqNr = daqNrValue;
00117     }
00118 
00120     void setDaqNr(const cms_uint64_t& word64);
00121 
00124     void setDaqNrWord64(cms_uint64_t& word64, int iWord);
00125 
00126 
00127 
00129     inline const cms_uint16_t triggerType() const
00130     {
00131         return m_triggerType;
00132     }
00133 
00134     void setTriggerType(const cms_uint16_t triggerTypeValue)
00135     {
00136         m_triggerType = triggerTypeValue;
00137     }
00138 
00140     void setTriggerType(const cms_uint64_t& word64);
00141 
00144     void setTriggerTypeWord64(cms_uint64_t& word64, int iWord);
00145 
00146 
00147 
00149     inline const cms_uint16_t status() const
00150     {
00151         return m_status;
00152     }
00153 
00154     void setStatus(const cms_uint16_t statusValue)
00155     {
00156         m_status = statusValue;
00157     }
00158 
00160     void setStatus(const cms_uint64_t& word64);
00161 
00164     void setStatusWord64(cms_uint64_t& word64, int iWord);
00165 
00166 
00168     inline const cms_uint16_t luminositySegmentNr() const
00169     {
00170         return m_luminositySegmentNr;
00171     }
00172 
00173     void setLuminositySegmentNr(const cms_uint16_t luminositySegmentNrValue)
00174     {
00175         m_luminositySegmentNr = luminositySegmentNrValue;
00176     }
00177 
00179     void setLuminositySegmentNr(const cms_uint64_t& word64);
00180 
00183     void setLuminositySegmentNrWord64(cms_uint64_t& word64, int iWord);
00184 
00185 
00186 
00188     inline const cms_uint32_t partRunNr() const
00189     {
00190         return m_partRunNr;
00191     }
00192 
00193     void setPartRunNr(const cms_uint32_t partRunNrValue)
00194     {
00195         m_partRunNr = partRunNrValue;
00196     }
00197 
00199     void setPartRunNr(const cms_uint64_t& word64);
00200 
00203     void setPartRunNrWord64(cms_uint64_t& word64, int iWord);
00204 
00205 
00206 
00208     inline const cms_uint32_t assignedPartitions() const
00209     {
00210         return m_assignedPartitions;
00211     }
00212 
00213     void setAssignedPartitions(const cms_uint32_t assignedPartitionsValue)
00214     {
00215         m_assignedPartitions = assignedPartitionsValue;
00216     }
00217 
00219     void setAssignedPartitions(const cms_uint64_t& word64);
00220 
00223     void setAssignedPartitionsWord64(cms_uint64_t& word64, int iWord);
00224 
00225 
00226 
00228     inline const cms_uint32_t partTrigNr() const
00229     {
00230         return m_partTrigNr;
00231     }
00232 
00233     void setPartTrigNr(const cms_uint32_t partTrigNrValue)
00234     {
00235         m_partTrigNr = partTrigNrValue;
00236     }
00237 
00239     void setPartTrigNr(const cms_uint64_t& word64);
00240 
00243     void setPartTrigNrWord64(cms_uint64_t& word64, int iWord);
00244 
00245 
00246 
00248     inline const cms_uint32_t eventNr() const
00249     {
00250         return m_eventNr;
00251     }
00252 
00253     void setEventNr(const cms_uint32_t eventNrValue)
00254     {
00255         m_eventNr = eventNrValue;
00256     }
00257 
00259     void setEventNr(const cms_uint64_t& word64);
00260 
00263     void setEventNrWord64(cms_uint64_t& word64, int iWord);
00264 
00265 
00266 
00268     inline const cms_uint64_t orbitNr() const
00269     {
00270         return m_orbitNr;
00271     }
00272 
00273     void setOrbitNr(const cms_uint64_t orbitNrValue)
00274     {
00275         m_orbitNr = orbitNrValue;
00276     }
00277 
00279     void setOrbitNrFrom(const cms_uint64_t& word64);
00280 
00283     void setOrbitNrWord64(cms_uint64_t& word64, int iWord);
00284 
00285 
00287     inline const unsigned int getSize() const
00288     {
00289         int unitLengthBits = L1GlobalTriggerReadoutSetup::UnitLength;
00290 
00291         return BlockSize*unitLengthBits;
00292     }
00293 
00294 public:
00295 
00297     void reset();
00298 
00300     void print(std::ostream& myCout) const;
00301 
00304     void unpack(const unsigned char* tcsPtr);
00305 
00306 
00307 
00308 private:
00309 
00310     // block description in the raw GT record
00311 
00312     // block size in 64bits words (BlockSize * 64 bits)
00313     static const int BlockSize;
00314 
00315     // word 0
00316 
00317     // index of the word in the TCS block containig the variable
00318     static const int BoardIdWord;
00319     static const int BxNrWord;
00320     static const int DaqNrWord;
00321     static const int TriggerTypeWord;
00322     static const int StatusWord;
00323     static const int LuminositySegmentNrWord;
00324 
00325     // mask to get the 64-bit-value from the corresponding word in the TCS block
00326     static const cms_uint64_t BoardIdMask;
00327     static const cms_uint64_t BxNrMask;
00328     static const cms_uint64_t DaqNrMask;
00329     static const cms_uint64_t TriggerTypeMask;
00330     static const cms_uint64_t StatusMask;
00331     static const cms_uint64_t LuminositySegmentNrMask;
00332 
00333     // shift to the right to get the value from the "64-bit-value"
00334     static const int BoardIdShift;
00335     static const int BxNrShift;
00336     static const int DaqNrShift;
00337     static const int TriggerTypeShift;
00338     static const int StatusShift;
00339     static const int LuminositySegmentNrShift;
00340 
00341     // word 1
00342 
00343     static const int PartRunNrWord;
00344     static const int AssignedPartitionsWord;
00345 
00346     static const cms_uint64_t PartRunNrMask;
00347     static const cms_uint64_t AssignedPartitionsMask;
00348 
00349     static const int PartRunNrShift;
00350     static const int AssignedPartitionsShift;
00351 
00352     // word 2
00353 
00354     static const int PartTrigNrWord;
00355     static const int EventNrWord;
00356 
00357     static const cms_uint64_t PartTrigNrMask;
00358     static const cms_uint64_t EventNrMask;
00359 
00360     static const int PartTrigNrShift;
00361     static const int EventNrShift;
00362 
00363     // word 3
00364 
00365     static const int OrbitNrWord;
00366 
00367     static const cms_uint64_t OrbitNrMask;
00368 
00369     static const int OrbitNrShift;
00370 
00371 
00372     // word 4
00373 
00374     // empty
00375 
00376 
00377 
00378 private:
00379 
00381     cms_uint16_t m_boardId;
00382 
00384     cms_uint16_t m_bxNr;
00385 
00387     cms_uint16_t m_daqNr;
00388 
00390     cms_uint16_t m_triggerType;
00391 
00393     cms_uint16_t m_status;
00394 
00396     cms_uint16_t m_luminositySegmentNr;
00397 
00398     //
00399 
00401     cms_uint32_t m_partRunNr;
00402 
00406     cms_uint32_t m_assignedPartitions;
00407 
00408     //
00409 
00412     cms_uint32_t m_partTrigNr;
00413 
00415     cms_uint32_t m_eventNr;
00416 
00417     //
00418 
00420     cms_uint64_t m_orbitNr;
00421 
00422     //
00423     // empty word
00424 
00425 };
00426 
00427 #endif /*L1GlobalTrigger_L1TcsWord_h*/