CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/CondTools/DT/interface/DTHVStatusHandler.h

Go to the documentation of this file.
00001 #ifndef DTHVStatusHandler_H
00002 #define DTHVStatusHandler_H
00003 
00014 //----------------------
00015 // Base Class Headers --
00016 //----------------------
00017 #include "CondCore/PopCon/interface/PopConSourceHandler.h"
00018 
00019 //------------------------------------
00020 // Collaborating Class Declarations --
00021 //------------------------------------
00022 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00023 #include "CondCore/DBCommon/interface/DbConnection.h"
00024 #include "CondFormats/DTObjects/interface/DTHVStatus.h"
00025 #include <string>
00026 
00027 namespace coral {
00028   class TimeStamp;
00029 }
00030 #include "CondTools/DT/interface/DTHVAbstractCheck.h"
00031 
00032 //---------------
00033 // C++ Headers --
00034 //---------------
00035 
00036 
00037 //              ---------------------
00038 //              -- Class Interface --
00039 //              ---------------------
00040 
00041 class DTHVStatusHandler: public popcon::PopConSourceHandler<DTHVStatus> {
00042 
00043  public:
00044 
00047   DTHVStatusHandler( const edm::ParameterSet& ps );
00048 
00051   virtual ~DTHVStatusHandler();
00052 
00055 
00056   void getNewObjects();
00057   std::string id() const;
00058 
00059  private:
00060 
00061   typedef DTHVAbstractCheck::timedMeasurement timedMeasurement;
00062   typedef std::pair<int,float> channelValue;
00063 
00064   void checkNewData();
00065 
00066   void getChannelMap();
00067   void getLayerSplit();
00068   void getChannelSplit();
00069   void dumpHVAliases();
00070 
00071   void createSnapshot();
00072   int recoverSnapshot();
00073   cond::Time_t recoverLastTime();
00074   void   dumpSnapshot( const coral::TimeStamp& time );
00075   void updateHVStatus();
00076   int  checkForPeriod( cond::Time_t condSince,
00077                        cond::Time_t condUntil,
00078                        int& missingChannels,
00079                        bool copyOffline );
00080 
00081   void copyHVData();
00082   DTHVStatus* offlineList();
00083   void getLayerValues( int rawId, int type,
00084                        float& valueL, float& valueR,
00085                        float& valueS, float& valueC );
00086   void setChannelFlag( DTHVStatus* hv,
00087                        int whe, int sta, int sec, int qua, int lay, int l_p,
00088                        const DTHVAbstractCheck::flag& flag );
00089 
00090   int checkStatusChange( int type, float oldValue, float newValue );
00091   void filterData();
00092 
00093   static DTWireId layerId( int rawId, int l_p );
00094   static coral::TimeStamp coralTime( const  cond::Time_t&    time );
00095   static  cond::Time_t     condTime( const coral::TimeStamp& time );
00096   static  cond::Time_t     condTime( long long int           time );
00097 
00098   std::string dataTag;
00099   std::string onlineConnect;
00100   std::string utilConnect;
00101   std::string onlineAuthentication;
00102   std::string bufferConnect;
00103   DTHVStatus* lastStatus;
00104 
00105   int ySince;
00106   int mSince;
00107   int dSince;
00108   int hSince;
00109   int pSince;
00110   int sSince;
00111   int yUntil;
00112   int mUntil;
00113   int dUntil;
00114   int hUntil;
00115   int pUntil;
00116   int sUntil;
00117   bool dumpAtStart;
00118   bool dumpAtEnd;
00119   long long int bwdTime;
00120   long long int fwdTime;
00121   long long int minTime;
00122 
00123   std::map<int,timedMeasurement> snapshotValues;
00124   DTHVAbstractCheck* hvChecker;
00125 
00126   cond::Time_t procSince;
00127   cond::Time_t procUntil;
00128   cond::Time_t lastFound;
00129   cond::Time_t nextFound;
00130   cond::Time_t timeLimit;
00131   long long int lastStamp;
00132   int maxPayload;
00133 
00134   cond::DbConnection omds_conn;
00135   cond::DbConnection util_conn;
00136   cond::DbConnection buff_conn;
00137   cond::DbSession omds_session;
00138   cond::DbSession util_session;
00139   cond::DbSession buff_session;
00140 
00141   std::string mapVersion;
00142   std::string splitVersion;
00143   std::map<int,int> aliasMap;
00144   std::map<int,int> layerMap;
00145   std::map<int,int> laySplit;
00146   std::map< int, std::vector<int>* > channelSplit;
00147   std::vector< std::pair<DTHVStatus*, cond::Time_t> > tmpContainer;
00148   bool switchOff;
00149 
00150 };
00151 
00152 
00153 #endif // DTHVStatusHandler_H
00154 
00155 
00156 
00157 
00158 
00159