CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/DataFormats/Scalers/interface/DcsStatus.h

Go to the documentation of this file.
00001 /*X
00002  *  File: DataFormats/Scalers/interface/DcsStatus.h   (W.Badgett)
00003  *
00004  *  The online computed DcsStatus flag values
00005  *
00006  */
00007 
00008 #ifndef DATAFORMATS_SCALERS_DCSSTATUS_H
00009 #define DATAFORMATS_SCALERS_DCSSTATUS_H
00010 
00011 #include "DataFormats/Scalers/interface/TimeSpec.h"
00012 
00013 #include <ctime>
00014 #include <iosfwd>
00015 #include <vector>
00016 #include <string>
00017 
00025 
00026 
00027 
00028 class DcsStatus
00029 {
00030  public:
00031 
00032   static const int partitionList[];
00033   static const char * partitionName[];
00034 
00035   enum
00036   {
00037     EBp         =     0,
00038     EBm         =     1,
00039     EEp         =     2,
00040     EEm         =     3,
00041     HBHEa       =     5,
00042     HBHEb       =     6,
00043     HBHEc       =     7,
00044     HF          =     8,
00045     HO          =     9,
00046     RPC         =    12,
00047     DT0         =    13,
00048     DTp         =    14,
00049     DTm         =    15,
00050     CSCp        =    16,
00051     CSCm        =    17,
00052     CASTOR      =    20,
00053     ZDC         =    22,
00054     TIBTID      =    24,
00055     TOB         =    25,
00056     TECp        =    26,
00057     TECm        =    27,
00058     BPIX        =    28,
00059     FPIX        =    29,
00060     ESp         =    30,
00061     ESm         =    31,
00062     nPartitions =    25
00063   };
00064 
00065 
00066   DcsStatus();
00067   DcsStatus(const unsigned char * rawData);
00068   virtual ~DcsStatus();
00069 
00071   std::string name() const { return "DcsStatus"; }
00072 
00074   bool empty() const { return false; }
00075 
00076   unsigned int trigType() const            { return(trigType_);}
00077   unsigned int eventID() const             { return(eventID_);}
00078   unsigned int sourceID() const            { return(sourceID_);}
00079   unsigned int bunchNumber() const         { return(bunchNumber_);}
00080 
00081   int version() const                      { return(version_);}
00082   timespec collectionTime() const          { return(collectionTime_.get_timespec());}
00083 
00084   unsigned int ready()  const              { return(ready_);}
00085 
00086   bool ready(int partitionNumber) const 
00087   { return(  (ready_ & ( 1 << partitionNumber )) != 0 );}
00088 
00089   float magnetCurrent() const     { return(magnetCurrent_);}
00090   float magnetTemperature() const { return(magnetTemperature_);}
00091 
00093   int operator==(const DcsStatus& e) const { return false; }
00094 
00096   int operator!=(const DcsStatus& e) const { return false; }
00097 
00098 protected:
00099 
00100   unsigned int trigType_;
00101   unsigned int eventID_;
00102   unsigned int sourceID_;
00103   unsigned int bunchNumber_;
00104 
00105   int version_;
00106 
00107   TimeSpec collectionTime_;
00108   unsigned int ready_;
00109   float magnetCurrent_;
00110   float magnetTemperature_;
00111 };
00112 
00114 std::ostream& operator<<(std::ostream& s, const DcsStatus& c);
00115 
00116 typedef std::vector<DcsStatus> DcsStatusCollection;
00117 
00118 #endif