00001 // Last commit: $Id: CommissioningHistosUsingDb.h,v 1.16 2010/04/21 14:26:07 dstrom Exp $ 00002 00003 #ifndef DQM_SiStripCommissioningClients_CommissioningHistosUsingDb_H 00004 #define DQM_SiStripCommissioningClients_CommissioningHistosUsingDb_H 00005 00006 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h" 00007 #include "DQM/SiStripCommissioningClients/interface/CommissioningHistograms.h" 00008 #include "OnlineDB/SiStripConfigDb/interface/SiStripConfigDb.h" 00009 #include "boost/range/iterator_range.hpp" 00010 #include <boost/cstdint.hpp> 00011 #include <string> 00012 #include <map> 00013 00014 class SiStripConfigDb; 00015 class SiStripFedCabling; 00016 00017 class CommissioningHistosUsingDb : public virtual CommissioningHistograms { 00018 00019 // ---------- public interface ---------- 00020 00021 public: 00022 00023 CommissioningHistosUsingDb( SiStripConfigDb* const, 00024 sistrip::RunType = sistrip::UNDEFINED_RUN_TYPE ); 00025 00026 virtual ~CommissioningHistosUsingDb(); 00027 00028 void uploadToConfigDb(); 00029 00030 bool doUploadAnal() const; 00031 00032 bool doUploadConf() const; 00033 00034 void doUploadAnal( bool ); 00035 00036 void doUploadConf( bool ); 00037 00038 // ---------- protected methods ---------- 00039 00040 protected: 00041 00042 void buildDetInfo(); 00043 00044 virtual void addDcuDetIds(); 00045 00046 virtual void uploadConfigurations() {;} 00047 00048 void uploadAnalyses(); 00049 00050 virtual void createAnalyses( SiStripConfigDb::AnalysisDescriptionsV& ); 00051 00052 virtual void create( SiStripConfigDb::AnalysisDescriptionsV&, Analysis ) {;} 00053 00054 SiStripConfigDb* const db() const; 00055 00056 SiStripFedCabling* const cabling() const; 00057 00058 class DetInfo { 00059 public: 00060 uint32_t dcuId_; 00061 uint32_t detId_; 00062 uint16_t pairs_; 00063 DetInfo() : 00064 dcuId_(sistrip::invalid32_), 00065 detId_(sistrip::invalid32_), 00066 pairs_(sistrip::invalid_) {;} 00067 }; 00068 00069 std::pair<std::string,DetInfo> detInfo( const SiStripFecKey& ); 00070 00071 bool deviceIsPresent( const SiStripFecKey& ); 00072 00073 // ---------- private member data ---------- 00074 00075 private: 00076 00077 CommissioningHistosUsingDb(); 00078 00079 sistrip::RunType runType_; 00080 00081 SiStripConfigDb* db_; 00082 00083 SiStripFedCabling* cabling_; 00084 00085 typedef std::map<uint32_t,DetInfo> DetInfos; 00086 00087 std::map<std::string,DetInfos> detInfo_; 00088 00089 bool uploadAnal_; 00090 00091 bool uploadConf_; 00092 00093 }; 00094 00095 inline void CommissioningHistosUsingDb::doUploadConf( bool upload ) { uploadConf_ = upload; } 00096 inline void CommissioningHistosUsingDb::doUploadAnal( bool upload ) { uploadAnal_ = upload; } 00097 00098 inline bool CommissioningHistosUsingDb::doUploadAnal() const { return uploadAnal_; } 00099 inline bool CommissioningHistosUsingDb::doUploadConf() const { return uploadConf_; } 00100 00101 inline SiStripConfigDb* const CommissioningHistosUsingDb::db() const { return db_; } 00102 inline SiStripFedCabling* const CommissioningHistosUsingDb::cabling() const { return cabling_; } 00103 00104 #endif // DQM_SiStripCommissioningClients_CommissioningHistosUsingDb_H