CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/OnlineDB/SiStripConfigDb/interface/SiStripPartition.h

Go to the documentation of this file.
00001 // Last commit: $Id: SiStripPartition.h,v 1.11 2009/04/06 12:36:45 lowette Exp $
00002 
00003 #ifndef OnlineDB_SiStripConfigDb_SiStripPartition_h
00004 #define OnlineDB_SiStripConfigDb_SiStripPartition_h
00005 
00006 #include "DataFormats/SiStripCommon/interface/SiStripConstants.h"
00007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00008 #include "boost/cstdint.hpp"
00009 #include <vector>
00010 #include <string>
00011 #include <ostream>
00012 #include <sstream>
00013 
00014 class SiStripConfigDb;
00015 class SiStripPartition;
00016 
00018 std::ostream& operator<< ( std::ostream&, const SiStripPartition& );
00019 
00025 class SiStripPartition { 
00026   
00027  public:
00028 
00029   SiStripPartition();
00030     
00031   SiStripPartition( std::string partition_name );
00032 
00033   SiStripPartition( const SiStripPartition& );
00034 
00035   SiStripPartition& operator= ( const SiStripPartition& );
00036   
00037   bool operator== ( const SiStripPartition& ) const;
00038   
00039   bool operator!= ( const SiStripPartition& ) const;
00040   
00041   ~SiStripPartition();
00042 
00043   static std::string defaultPartitionName_;
00044 
00045   typedef std::pair<uint32_t,uint32_t> Versions; 
00046 
00047   void reset(); 
00048   
00049   void pset( const edm::ParameterSet& );
00050   
00051   void update( const SiStripConfigDb* const );
00052   
00053   void print( std::stringstream&, bool using_db = false ) const; 
00054   
00055   // partition, run and version information
00056   
00057   std::string partitionName() const; 
00058   
00059   uint32_t runNumber() const;
00060   
00061   sistrip::RunType runType() const;
00062   
00063   bool forceVersions() const;
00064 
00065   bool forceCurrentState() const;
00066 
00067   // description versions
00068   
00069   Versions cabVersion() const;
00070 
00071   Versions fedVersion() const;
00072 
00073   Versions fecVersion() const;
00074 
00075   Versions dcuVersion() const;
00076 
00077   Versions psuVersion() const;
00078 
00079 //#ifdef USING_DATABASE_MASKING // define anyway, otherwise I get into a mess with includes
00080   Versions maskVersion() const;
00081 //#endif
00082 
00083   uint32_t globalAnalysisVersion() const;
00084 
00085   Versions runTableVersion() const;
00086 
00087   Versions fastCablingVersion() const;
00088 
00089   Versions apvTimingVersion() const;
00090 
00091   Versions optoScanVersion() const;
00092 
00093   Versions vpspScanVersion() const;
00094 
00095   Versions apvCalibVersion() const;
00096 
00097   Versions pedestalsVersion() const;
00098 
00099   Versions apvLatencyVersion() const;
00100 
00101   Versions fineDelayVersion() const;
00102 
00103   // input xml files
00104 
00105   std::string inputModuleXml() const;
00106 
00107   std::string inputDcuInfoXml() const;
00108 
00109   std::vector<std::string> inputFecXml() const;
00110 
00111   std::vector<std::string> inputFedXml() const;
00112 
00113   // setters
00114   
00115   void partitionName( std::string ); 
00116   
00117   void runNumber( uint32_t );
00118   
00119   void forceVersions( bool );
00120 
00121   void forceCurrentState( bool );
00122 
00123  private:
00124   
00125   Versions versions( std::vector<uint32_t> );
00126 
00127  private:
00128 
00129   std::string partitionName_; 
00130   
00131   uint32_t runNumber_;
00132   
00133   sistrip::RunType runType_;
00134 
00135   bool forceVersions_;
00136 
00137   bool forceCurrentState_;
00138   
00139   // device description versions
00140   
00141   Versions cabVersion_;
00142 
00143   Versions fedVersion_;
00144 
00145   Versions fecVersion_;
00146 
00147   Versions dcuVersion_;
00148 
00149   Versions psuVersion_;
00150 
00151 //#ifdef USING_DATABASE_MASKING // define anyway, otherwise I get into a mess with includes
00152   Versions maskVersion_;
00153 //#endif
00154 
00155   // analysis description versions
00156 
00157   uint32_t globalAnalysisV_;
00158 
00159   Versions runTableVersion_;
00160 
00161   Versions fastCablingV_;
00162   
00163   Versions apvTimingV_;
00164 
00165   Versions optoScanV_;
00166 
00167   Versions vpspScanV_;
00168 
00169   Versions apvCalibV_;
00170 
00171   Versions pedestalsV_;
00172 
00173   Versions apvLatencyV_;
00174 
00175   Versions fineDelayV_;
00176 
00177   // input xml files
00178 
00179   std::string inputModuleXml_;
00180 
00181   std::string inputDcuInfoXml_;
00182 
00183   std::vector<std::string> inputFecXml_;
00184 
00185   std::vector<std::string> inputFedXml_;
00186 
00187 };
00188 
00189 // ---------- Inline methods ----------
00190 
00191 inline std::string SiStripPartition::partitionName() const { return partitionName_; } 
00192 inline uint32_t SiStripPartition::runNumber() const { return runNumber_; }
00193 inline sistrip::RunType SiStripPartition::runType() const { return runType_; }
00194 inline bool SiStripPartition::forceVersions() const { return forceVersions_; }
00195 inline bool SiStripPartition::forceCurrentState() const { return forceCurrentState_; }
00196 
00197 inline SiStripPartition::Versions SiStripPartition::cabVersion() const { return cabVersion_; }
00198 inline SiStripPartition::Versions SiStripPartition::fedVersion() const { return fedVersion_; }
00199 inline SiStripPartition::Versions SiStripPartition::fecVersion() const { return fecVersion_; }
00200 inline SiStripPartition::Versions SiStripPartition::dcuVersion() const { return dcuVersion_; }
00201 inline SiStripPartition::Versions SiStripPartition::psuVersion() const { return psuVersion_; }
00202 //#ifdef USING_DATABASE_MASKING // define anyway, otherwise I get into a mess with includes
00203 inline SiStripPartition::Versions SiStripPartition::maskVersion() const { return maskVersion_; }
00204 //#endif
00205 
00206 inline uint32_t SiStripPartition::globalAnalysisVersion() const { return globalAnalysisV_; } 
00207 inline SiStripPartition::Versions SiStripPartition::runTableVersion() const { return runTableVersion_; }
00208 inline SiStripPartition::Versions SiStripPartition::fastCablingVersion() const { return fastCablingV_; }
00209 inline SiStripPartition::Versions SiStripPartition::apvTimingVersion() const { return apvTimingV_; }
00210 inline SiStripPartition::Versions SiStripPartition::optoScanVersion() const { return optoScanV_; }
00211 inline SiStripPartition::Versions SiStripPartition::vpspScanVersion() const { return vpspScanV_; }
00212 inline SiStripPartition::Versions SiStripPartition::apvCalibVersion() const { return apvCalibV_; }
00213 inline SiStripPartition::Versions SiStripPartition::pedestalsVersion() const { return pedestalsV_; }
00214 inline SiStripPartition::Versions SiStripPartition::apvLatencyVersion() const { return apvLatencyV_; }
00215 inline SiStripPartition::Versions SiStripPartition::fineDelayVersion() const { return fineDelayV_; }
00216 
00217 inline std::string SiStripPartition::inputModuleXml() const { return inputModuleXml_; }
00218 inline std::string SiStripPartition::inputDcuInfoXml() const { return inputDcuInfoXml_; }
00219 inline std::vector<std::string> SiStripPartition::inputFecXml() const { return inputFecXml_; }
00220 inline std::vector<std::string> SiStripPartition::inputFedXml() const { return inputFedXml_; }
00221 
00222 inline void SiStripPartition::partitionName( std::string name ) { partitionName_ = name ; } 
00223 inline void SiStripPartition::runNumber( uint32_t run ) { runNumber_ = run; }
00224 inline void SiStripPartition::forceVersions( bool force ) { forceVersions_ = force; }
00225 inline void SiStripPartition::forceCurrentState( bool force ) { forceCurrentState_ = force; }
00226 
00227 #endif // OnlineDB_SiStripConfigDb_SiStripPartition_h