File indexing completed on 2024-04-06 12:05:08
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef DATAFORMATS_SCALERS_DCSSTATUS_H
0009 #define DATAFORMATS_SCALERS_DCSSTATUS_H
0010
0011 #include "DataFormats/Scalers/interface/TimeSpec.h"
0012
0013 #include <ctime>
0014 #include <iosfwd>
0015 #include <vector>
0016 #include <string>
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028 class DcsStatus {
0029 public:
0030 static const int partitionList[];
0031 static const char* const partitionName[];
0032
0033 enum {
0034 EBp = 0,
0035 EBm = 1,
0036 EEp = 2,
0037 EEm = 3,
0038 HBHEa = 5,
0039 HBHEb = 6,
0040 HBHEc = 7,
0041 HF = 8,
0042 HO = 9,
0043 RPC = 12,
0044 DT0 = 13,
0045 DTp = 14,
0046 DTm = 15,
0047 CSCp = 16,
0048 CSCm = 17,
0049 CASTOR = 20,
0050 ZDC = 22,
0051 TIBTID = 24,
0052 TOB = 25,
0053 TECp = 26,
0054 TECm = 27,
0055 BPIX = 28,
0056 FPIX = 29,
0057 ESp = 30,
0058 ESm = 31,
0059 nPartitions = 25
0060 };
0061
0062 DcsStatus();
0063 DcsStatus(const unsigned char* rawData);
0064 virtual ~DcsStatus();
0065
0066
0067 std::string name() const { return "DcsStatus"; }
0068
0069
0070 bool empty() const { return false; }
0071
0072 unsigned int trigType() const { return (trigType_); }
0073 unsigned int eventID() const { return (eventID_); }
0074 unsigned int sourceID() const { return (sourceID_); }
0075 unsigned int bunchNumber() const { return (bunchNumber_); }
0076
0077 int version() const { return (version_); }
0078 timespec collectionTime() const { return (collectionTime_.get_timespec()); }
0079
0080 unsigned int ready() const { return (ready_); }
0081
0082 bool ready(int partitionNumber) const { return ((ready_ & (1 << partitionNumber)) != 0); }
0083
0084 float magnetCurrent() const { return (magnetCurrent_); }
0085 float magnetTemperature() const { return (magnetTemperature_); }
0086
0087
0088 int operator==(const DcsStatus& e) const { return false; }
0089
0090
0091 int operator!=(const DcsStatus& e) const { return false; }
0092
0093 protected:
0094 unsigned int trigType_;
0095 unsigned int eventID_;
0096 unsigned int sourceID_;
0097 unsigned int bunchNumber_;
0098
0099 int version_;
0100
0101 TimeSpec collectionTime_;
0102 unsigned int ready_;
0103 float magnetCurrent_;
0104 float magnetTemperature_;
0105 };
0106
0107
0108 std::ostream& operator<<(std::ostream& s, const DcsStatus& c);
0109
0110 typedef std::vector<DcsStatus> DcsStatusCollection;
0111
0112 #endif