Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:11:32

0001 
0002 #ifndef DQM_SiStripCommissioningClients_CommissioningHistosUsingDb_H
0003 #define DQM_SiStripCommissioningClients_CommissioningHistosUsingDb_H
0004 
0005 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0006 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
0007 #include "DQM/SiStripCommissioningClients/interface/CommissioningHistograms.h"
0008 #include "OnlineDB/SiStripConfigDb/interface/SiStripConfigDb.h"
0009 #include "boost/range/iterator_range.hpp"
0010 #include <string>
0011 #include <map>
0012 #include <cstdint>
0013 
0014 class SiStripConfigDb;
0015 class SiStripFedCabling;
0016 class TrackerTopology;
0017 
0018 class CommissioningHistosUsingDb : public virtual CommissioningHistograms {
0019   // ---------- public interface ----------
0020 
0021 public:
0022   CommissioningHistosUsingDb(SiStripConfigDb* const,
0023                              edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken,
0024                              sistrip::RunType = sistrip::UNDEFINED_RUN_TYPE);
0025 
0026   ~CommissioningHistosUsingDb() override;
0027 
0028   void configure(const edm::ParameterSet&, const edm::EventSetup&) override;
0029 
0030   void uploadToConfigDb();
0031 
0032   bool doUploadAnal() const;
0033 
0034   bool doUploadConf() const;
0035 
0036   void doUploadAnal(bool);
0037 
0038   void doUploadConf(bool);
0039 
0040   // ---------- protected methods ----------
0041 
0042 protected:
0043   void buildDetInfo();
0044 
0045   virtual void addDcuDetIds();
0046 
0047   virtual void uploadConfigurations() { ; }
0048 
0049   void uploadAnalyses();
0050 
0051   virtual void createAnalyses(SiStripConfigDb::AnalysisDescriptionsV&);
0052 
0053   virtual void create(SiStripConfigDb::AnalysisDescriptionsV&, Analysis) { ; }
0054 
0055   SiStripConfigDb* const db() const;
0056 
0057   SiStripFedCabling* const cabling() const;
0058 
0059   class DetInfo {
0060   public:
0061     uint32_t dcuId_;
0062     uint32_t detId_;
0063     uint16_t pairs_;
0064     DetInfo() : dcuId_(sistrip::invalid32_), detId_(sistrip::invalid32_), pairs_(sistrip::invalid_) { ; }
0065   };
0066 
0067   std::pair<std::string, DetInfo> detInfo(const SiStripFecKey&);
0068 
0069   bool deviceIsPresent(const SiStripFecKey&);
0070 
0071   // ---------- private member data ----------
0072 
0073 private:
0074   CommissioningHistosUsingDb();
0075 
0076   sistrip::RunType runType_;
0077 
0078   SiStripConfigDb* db_;
0079 
0080   SiStripFedCabling* cabling_;
0081 
0082   typedef std::map<uint32_t, DetInfo> DetInfos;
0083 
0084   std::map<std::string, DetInfos> detInfo_;
0085 
0086   bool uploadAnal_;
0087 
0088   bool uploadConf_;
0089 
0090   edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> tTopoToken_;
0091 };
0092 
0093 inline void CommissioningHistosUsingDb::doUploadConf(bool upload) { uploadConf_ = upload; }
0094 inline void CommissioningHistosUsingDb::doUploadAnal(bool upload) { uploadAnal_ = upload; }
0095 
0096 inline bool CommissioningHistosUsingDb::doUploadAnal() const { return uploadAnal_; }
0097 inline bool CommissioningHistosUsingDb::doUploadConf() const { return uploadConf_; }
0098 
0099 inline SiStripConfigDb* const CommissioningHistosUsingDb::db() const { return db_; }
0100 inline SiStripFedCabling* const CommissioningHistosUsingDb::cabling() const { return cabling_; }
0101 
0102 #endif  // DQM_SiStripCommissioningClients_CommissioningHistosUsingDb_H