CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/CondFormats/CSCObjects/interface/CSCDQM_DCSData.h

Go to the documentation of this file.
00001 /*
00002  * =====================================================================================
00003  *
00004  *       Filename:  CSCDQM_DCSData.h
00005  *
00006  *    Description:  CSCDQM DCS Objects
00007  *
00008  *        Version:  1.0
00009  *        Created:  05/04/2009 11:20:18 AM
00010  *       Revision:  none
00011  *       Compiler:  gcc
00012  *
00013  *         Author:  Valdas Rapsevicius (VR), valdas.rapsevicius@cern.ch
00014  *        Company:  CERN, CH
00015  *
00016  * =====================================================================================
00017  */
00018 
00019 #ifndef CSCDQM_DCSDATA_H
00020 #define CSCDQM_DCSDATA_H
00021 
00022 #include <vector>
00023 
00024 #include "CondFormats/CSCObjects/interface/CSCDQM_DCSBase.h"
00025 
00026 namespace cscdqm {
00027 
00031   struct TempMeasType {
00032         
00033     DCSAddressType adr;
00034     DCSBoardType   board;
00035     unsigned short boardId;
00036     int            value;
00037 
00038     friend std::ostream& operator<<(std::ostream& out, const TempMeasType& m) {
00039       std::ostringstream os;
00040       os << m.adr << " ";
00041       os << DCSBoardUtility(m.board);
00042       if (m.board == CFEB) {
00043         os << m.boardId;
00044       }
00045       os << " temp = " << m.value << "oC";
00046       return out << os.str();
00047     }
00048 
00049     TempMeasType& operator=(const TempMeasType& m) {
00050       adr = m.adr;
00051       board = m.board;
00052       boardId = m.boardId;
00053       value = m.value;
00054       return *this;
00055     }
00056 
00057   };
00058 
00062   struct HVVMeasType {
00063         
00064     DCSAddressType adr;
00065     unsigned int   position;
00066     int            value;
00067 
00068     friend std::ostream& operator<<(std::ostream& out, const HVVMeasType& m) {
00069       std::ostringstream os;
00070       os << m.adr << " ";
00071       os << "position:" << m.position;
00072       os << " V = " << m.value << "V";
00073       return out << os.str();
00074     }
00075 
00076     HVVMeasType& operator=(const HVVMeasType& m) {
00077       adr = m.adr;
00078       position = m.position;
00079       value = m.value;
00080       return *this;
00081     }
00082 
00083   };
00084 
00088   struct LVVMeasType {
00089         
00090     DCSAddressType adr;
00091     DCSBoardType   board;
00092     unsigned int   boardId;
00093     float          nominal_v;
00094 
00095     friend std::ostream& operator<<(std::ostream& out, const LVVMeasType& m) {
00096       std::ostringstream os;
00097       os << m.adr << " ";
00098       os << DCSBoardUtility(m.board);
00099       if (m.board == CFEB) {
00100         os << m.boardId;
00101       }
00102       os << " " << m.nominal_v << "V";
00103       return out << os.str();
00104     }
00105 
00106     LVVMeasType& operator=(const LVVMeasType& m) {
00107       adr = m.adr;
00108       board = m.board;
00109       boardId = m.boardId;
00110       nominal_v = m.nominal_v;
00111       return *this;
00112     }
00113 
00114   };
00115 
00119   struct LVIMeasType {
00120         
00121     DCSAddressType adr;
00122     DCSBoardType   board;
00123     unsigned int   boardId;
00124     float          nominal_v;
00125     float          value;
00126 
00127     friend std::ostream& operator<<(std::ostream& out, const LVIMeasType& m) {
00128       std::ostringstream os;
00129       os << m.adr << " ";
00130       os << DCSBoardUtility(m.board);
00131       if (m.board == CFEB) {
00132         os << m.boardId;
00133       }
00134       os << " " << m.nominal_v << "V";
00135       os << " " << m.value << "A";
00136       return out << os.str();
00137     }
00138 
00139     LVIMeasType& operator=(const LVIMeasType& m) {
00140       adr = m.adr;
00141       board = m.board;
00142       boardId = m.boardId;
00143       nominal_v = m.nominal_v;
00144       value = m.value;
00145       return *this;
00146     }
00147 
00148   };
00149 
00154   class DCSData {
00155 
00156     public:
00157 
00158       DCSData();
00159       virtual ~DCSData();
00160 
00162       std::vector<TempMeasType> temp_meas;
00163 
00165       std::vector<HVVMeasType>  hvv_meas;
00166 
00168       std::vector<LVVMeasType>  lvv_meas;
00169 
00171       std::vector<LVIMeasType>  lvi_meas;
00172 
00174       int  temp_mode;
00175 
00177       int  hvv_mode;
00178 
00180       bool lvv_mode;
00181 
00183       float lvi_mode;
00184 
00186       TimeType iov;
00187   
00189       TimeType last_change;
00190 
00191       DCSData& operator=(const DCSData& m) {
00192         iov = m.iov;
00193         last_change = m.last_change;
00194         temp_meas = m.temp_meas;
00195         hvv_meas = m.hvv_meas;
00196         lvv_meas = m.lvv_meas;
00197         lvi_meas = m.lvi_meas;
00198         temp_mode = m.temp_mode;
00199         hvv_mode = m.hvv_mode;
00200         lvv_mode = m.lvv_mode;
00201         lvi_mode = m.lvi_mode;
00202         return *this;
00203       }
00204 
00205   };
00206 
00207 }
00208 
00209 #endif
00210