Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 
0002 #ifndef OnlineDB_SiStripConfigDb_SiStripPartition_h
0003 #define OnlineDB_SiStripConfigDb_SiStripPartition_h
0004 
0005 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
0006 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0007 #include <vector>
0008 #include <string>
0009 #include <ostream>
0010 #include <sstream>
0011 #include <cstdint>
0012 
0013 class SiStripConfigDb;
0014 class SiStripPartition;
0015 
0016 /** Debug printout for SiStripPartition class. */
0017 std::ostream& operator<<(std::ostream&, const SiStripPartition&);
0018 
0019 /** 
0020     @class SiStripPartition
0021     @brief Container class for database partition parameters. 
0022     @author R.Bainbridge
0023 */
0024 class SiStripPartition {
0025 public:
0026   SiStripPartition();
0027 
0028   SiStripPartition(std::string partition_name);
0029 
0030   SiStripPartition(const SiStripPartition&);
0031 
0032   SiStripPartition& operator=(const SiStripPartition&);
0033 
0034   bool operator==(const SiStripPartition&) const;
0035 
0036   bool operator!=(const SiStripPartition&) const;
0037 
0038   ~SiStripPartition();
0039 
0040   static const std::string defaultPartitionName_;
0041 
0042   typedef std::pair<uint32_t, uint32_t> Versions;
0043 
0044   void reset();
0045 
0046   void pset(const edm::ParameterSet&);
0047 
0048   void update(const SiStripConfigDb* const);
0049 
0050   void print(std::stringstream&, bool using_db = false) const;
0051 
0052   // partition, run and version information
0053 
0054   std::string partitionName() const;
0055 
0056   uint32_t runNumber() const;
0057 
0058   sistrip::RunType runType() const;
0059 
0060   bool forceVersions() const;
0061 
0062   bool forceCurrentState() const;
0063 
0064   // description versions
0065 
0066   Versions cabVersion() const;
0067 
0068   Versions fedVersion() const;
0069 
0070   Versions fecVersion() const;
0071 
0072   Versions dcuVersion() const;
0073 
0074   Versions psuVersion() const;
0075 
0076   //#ifdef USING_DATABASE_MASKING // define anyway, otherwise I get into a mess with includes
0077   Versions maskVersion() const;
0078   //#endif
0079 
0080   uint32_t globalAnalysisVersion() const;
0081 
0082   Versions runTableVersion() const;
0083 
0084   Versions fastCablingVersion() const;
0085 
0086   Versions apvTimingVersion() const;
0087 
0088   Versions optoScanVersion() const;
0089 
0090   Versions vpspScanVersion() const;
0091 
0092   Versions apvCalibVersion() const;
0093 
0094   Versions pedestalsVersion() const;
0095 
0096   Versions pedsFullNoiseVersion() const;
0097 
0098   Versions apvLatencyVersion() const;
0099 
0100   Versions fineDelayVersion() const;
0101 
0102   // input xml files
0103 
0104   std::string inputModuleXml() const;
0105 
0106   std::string inputDcuInfoXml() const;
0107 
0108   std::vector<std::string> inputFecXml() const;
0109 
0110   std::vector<std::string> inputFedXml() const;
0111 
0112   // setters
0113 
0114   void partitionName(std::string);
0115 
0116   void runNumber(uint32_t);
0117 
0118   void forceVersions(bool);
0119 
0120   void forceCurrentState(bool);
0121 
0122 private:
0123   Versions versions(const std::vector<uint32_t>&);
0124 
0125 private:
0126   std::string partitionName_;
0127 
0128   uint32_t runNumber_;
0129 
0130   sistrip::RunType runType_;
0131 
0132   bool forceVersions_;
0133 
0134   bool forceCurrentState_;
0135 
0136   // device description versions
0137 
0138   Versions cabVersion_;
0139 
0140   Versions fedVersion_;
0141 
0142   Versions fecVersion_;
0143 
0144   Versions dcuVersion_;
0145 
0146   Versions psuVersion_;
0147 
0148   //#ifdef USING_DATABASE_MASKING // define anyway, otherwise I get into a mess with includes
0149   Versions maskVersion_;
0150   //#endif
0151 
0152   // analysis description versions
0153 
0154   uint32_t globalAnalysisV_;
0155 
0156   Versions runTableVersion_;
0157 
0158   Versions fastCablingV_;
0159 
0160   Versions apvTimingV_;
0161 
0162   Versions optoScanV_;
0163 
0164   Versions vpspScanV_;
0165 
0166   Versions apvCalibV_;
0167 
0168   Versions pedestalsV_;
0169 
0170   Versions pedsFullNoiseV_;
0171 
0172   Versions apvLatencyV_;
0173 
0174   Versions fineDelayV_;
0175 
0176   // input xml files
0177 
0178   std::string inputModuleXml_;
0179 
0180   std::string inputDcuInfoXml_;
0181 
0182   std::vector<std::string> inputFecXml_;
0183 
0184   std::vector<std::string> inputFedXml_;
0185 };
0186 
0187 // ---------- Inline methods ----------
0188 
0189 inline std::string SiStripPartition::partitionName() const { return partitionName_; }
0190 inline uint32_t SiStripPartition::runNumber() const { return runNumber_; }
0191 inline sistrip::RunType SiStripPartition::runType() const { return runType_; }
0192 inline bool SiStripPartition::forceVersions() const { return forceVersions_; }
0193 inline bool SiStripPartition::forceCurrentState() const { return forceCurrentState_; }
0194 
0195 inline SiStripPartition::Versions SiStripPartition::cabVersion() const { return cabVersion_; }
0196 inline SiStripPartition::Versions SiStripPartition::fedVersion() const { return fedVersion_; }
0197 inline SiStripPartition::Versions SiStripPartition::fecVersion() const { return fecVersion_; }
0198 inline SiStripPartition::Versions SiStripPartition::dcuVersion() const { return dcuVersion_; }
0199 inline SiStripPartition::Versions SiStripPartition::psuVersion() const { return psuVersion_; }
0200 //#ifdef USING_DATABASE_MASKING // define anyway, otherwise I get into a mess with includes
0201 inline SiStripPartition::Versions SiStripPartition::maskVersion() const { return maskVersion_; }
0202 //#endif
0203 
0204 inline uint32_t SiStripPartition::globalAnalysisVersion() const { return globalAnalysisV_; }
0205 inline SiStripPartition::Versions SiStripPartition::runTableVersion() const { return runTableVersion_; }
0206 inline SiStripPartition::Versions SiStripPartition::fastCablingVersion() const { return fastCablingV_; }
0207 inline SiStripPartition::Versions SiStripPartition::apvTimingVersion() const { return apvTimingV_; }
0208 inline SiStripPartition::Versions SiStripPartition::optoScanVersion() const { return optoScanV_; }
0209 inline SiStripPartition::Versions SiStripPartition::vpspScanVersion() const { return vpspScanV_; }
0210 inline SiStripPartition::Versions SiStripPartition::apvCalibVersion() const { return apvCalibV_; }
0211 inline SiStripPartition::Versions SiStripPartition::pedestalsVersion() const { return pedestalsV_; }
0212 inline SiStripPartition::Versions SiStripPartition::pedsFullNoiseVersion() const { return pedsFullNoiseV_; }
0213 inline SiStripPartition::Versions SiStripPartition::apvLatencyVersion() const { return apvLatencyV_; }
0214 inline SiStripPartition::Versions SiStripPartition::fineDelayVersion() const { return fineDelayV_; }
0215 
0216 inline std::string SiStripPartition::inputModuleXml() const { return inputModuleXml_; }
0217 inline std::string SiStripPartition::inputDcuInfoXml() const { return inputDcuInfoXml_; }
0218 inline std::vector<std::string> SiStripPartition::inputFecXml() const { return inputFecXml_; }
0219 inline std::vector<std::string> SiStripPartition::inputFedXml() const { return inputFedXml_; }
0220 
0221 inline void SiStripPartition::partitionName(std::string name) { partitionName_ = name; }
0222 inline void SiStripPartition::runNumber(uint32_t run) { runNumber_ = run; }
0223 inline void SiStripPartition::forceVersions(bool force) { forceVersions_ = force; }
0224 inline void SiStripPartition::forceCurrentState(bool force) { forceCurrentState_ = force; }
0225 
0226 #endif  // OnlineDB_SiStripConfigDb_SiStripPartition_h