Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:38

0001 /*X
0002  *  File: DataFormats/Scalers/interface/DcsStatus.h   (W.Badgett)
0003  *
0004  *  The online computed DcsStatus flag values
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 /*! \file DcsStatus.h
0019  * \Header file for online DcsStatus value
0020  * 
0021  * \author: William Badgett
0022  *
0023  */
0024 
0025 /// \class DcsStatus.h
0026 /// \brief Persistable copy of online DcsStatus flag values
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   /// name method
0067   std::string name() const { return "DcsStatus"; }
0068 
0069   /// empty method (= false)
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   /// equality operator
0088   int operator==(const DcsStatus& e) const { return false; }
0089 
0090   /// inequality operator
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 /// Pretty-print operator for DcsStatus
0108 std::ostream& operator<<(std::ostream& s, const DcsStatus& c);
0109 
0110 typedef std::vector<DcsStatus> DcsStatusCollection;
0111 
0112 #endif