CMS 3D CMS Logo

SiStripDbParams Class Reference

Container class for database connection parameters. More...

#include <OnlineDB/SiStripConfigDb/interface/SiStripDbParams.h>

List of all members.

Public Types

typedef boost::iterator_range
< SiStripPartitions::const_iterator > 
const_iterator_range
typedef boost::iterator_range
< SiStripPartitions::iterator > 
iterator_range
typedef std::map< std::string,
SiStripPartition
SiStripPartitions

Public Member Functions

void addPartition (const SiStripPartition &)
void clearPartitions ()
void confdb (const std::string &user, const std::string &passwd, const std::string &path)
void confdb (const std::string &)
std::string confdb () const
std::vector< std::string > inputDcuInfoXmlFiles () const
std::vector< std::string > inputFecXmlFiles () const
std::vector< std::string > inputFedXmlFiles () const
std::vector< std::string > inputModuleXmlFiles () const
bool operator!= (const SiStripDbParams &) const
SiStripDbParamsoperator= (const SiStripDbParams &)
bool operator== (const SiStripDbParams &) const
std::string outputDcuInfoXml () const
std::string outputFecXml () const
std::string outputFedXml () const
std::string outputModuleXml () const
SiStripPartitions::iterator partition (std::string partition_name)
 Returns iterator to partition object.
SiStripPartitions::const_iterator partition (std::string partition_name) const
 Returns const iterator to partition object.
std::string partitionNames (const std::vector< std::string > &) const
 Construct string from (non-zero) partition names.
std::vector< std::string > partitionNames (std::string) const
 Extract (non-zero) partition names from string.
std::vector< std::string > partitionNames () const
 Extract (non-zero) partition names from partition objects.
iterator_range partitions ()
 Returns pair of iterators to partitions objects.
const_iterator_range partitions () const
 Returns pair of const iterators to partitions objects.
std::string passwd () const
std::string path () const
void print (std::stringstream &) const
void pset (const edm::ParameterSet &)
void reset ()
void sharedMemory (std::string)
std::string sharedMemory () const
 SiStripDbParams (const SiStripDbParams &)
 SiStripDbParams ()
std::string tnsAdmin () const
std::string user () const
void usingDb (bool)
bool usingDb () const
void usingDbCache (bool)
bool usingDbCache () const
 ~SiStripDbParams ()

Private Attributes

std::string confdb_
std::string outputDcuInfoXml_
std::string outputFecXml_
std::string outputFedXml_
std::string outputModuleXml_
SiStripPartitions partitions_
std::string passwd_
std::string path_
std::string sharedMemory_
std::string tnsAdmin_
std::string user_
bool usingDb_
bool usingDbCache_


Detailed Description

Container class for database connection parameters.

Author:
R.Bainbridge

Definition at line 27 of file SiStripDbParams.h.


Member Typedef Documentation

typedef boost::iterator_range<SiStripPartitions::const_iterator> SiStripDbParams::const_iterator_range

Definition at line 49 of file SiStripDbParams.h.

typedef boost::iterator_range<SiStripPartitions::iterator> SiStripDbParams::iterator_range

Definition at line 51 of file SiStripDbParams.h.

typedef std::map< std::string, SiStripPartition > SiStripDbParams::SiStripPartitions

Definition at line 47 of file SiStripDbParams.h.


Constructor & Destructor Documentation

SiStripDbParams::SiStripDbParams (  ) 

Definition at line 12 of file SiStripDbParams.cc.

00012                                  :
00013   usingDb_(false),
00014   confdb_(null_),
00015   user_(null_),
00016   passwd_(null_),
00017   path_(null_),
00018   usingDbCache_(false),
00019   sharedMemory_(""),
00020   tnsAdmin_(""),
00021   partitions_(),
00022   outputModuleXml_("/tmp/module.xml"),
00023   outputDcuInfoXml_("/tmp/dcuinfo.xml"),
00024   outputFecXml_("/tmp/fec.xml"),
00025   outputFedXml_("/tmp/fed.xml")
00026 {;}

SiStripDbParams::SiStripDbParams ( const SiStripDbParams input  ) 

Definition at line 30 of file SiStripDbParams.cc.

00030                                                                :
00031   usingDb_( input.usingDb() ),
00032   confdb_( input.confdb() ),
00033   user_( input.user() ),
00034   passwd_( input.passwd() ),
00035   path_( input.path() ),
00036   usingDbCache_( input.usingDbCache() ),
00037   sharedMemory_( input.sharedMemory() ),
00038   tnsAdmin_( input.tnsAdmin() ),
00039   partitions_( input.partitions().begin(), input.partitions().end() ),
00040   outputModuleXml_( input.outputModuleXml() ),
00041   outputDcuInfoXml_( input.outputDcuInfoXml() ),
00042   outputFecXml_( input.outputFecXml() ),
00043   outputFedXml_( input.outputFedXml() )
00044 {;}

SiStripDbParams::~SiStripDbParams (  ) 

Definition at line 101 of file SiStripDbParams.cc.

References reset().

00101                                   {
00102   reset();
00103 }


Member Function Documentation

void SiStripDbParams::addPartition ( const SiStripPartition in  ) 

Definition at line 126 of file SiStripDbParams.cc.

References SiStripPartition::defaultPartitionName_, iter, LogTrace, sistrip::mlConfigDb_, SiStripPartition::partitionName(), partitions_, and ss.

Referenced by pset(), SiStripConfigDb::usingDatabase(), and SiStripConfigDb::usingDatabaseCache().

00126                                                                {
00127 
00128   if ( in.partitionName() == "" ) {
00129     std::stringstream ss;
00130     ss << "[SiStripDbParams::" << __func__ << "]"
00131        << " Attempting to add partition with null name!";
00132     //edm::LogWarning(mlConfigDb_) << ss.str();
00133   }
00134 
00135   SiStripPartitions::const_iterator iter = partitions_.find( in.partitionName() );
00136   if ( iter == partitions_.end() ) { 
00137     partitions_[in.partitionName()] = in; 
00138     if ( in.partitionName() != SiStripPartition::defaultPartitionName_ ) {
00139       std::stringstream ss;
00140       ss << "[SiStripDbParams::" << __func__ << "]"
00141          << " Added new partition with name \"" 
00142          << in.partitionName() << "\"";
00143       //ss << std::endl << partitions_[in.partitionName()];
00144       ss << " (Currently have " 
00145          << partitions_.size()
00146          << " partitions in cache...)";
00147       LogTrace(mlConfigDb_) << ss.str();
00148     }
00149   } else {
00150     std::stringstream ss;
00151     ss << "[SiStripDbParams::" << __func__ << "]"
00152        << " Partition with name \""
00153        << in.partitionName()
00154        << "\" already found!"
00155        << " Not adding to cache...";
00156     edm::LogWarning(mlConfigDb_) << ss.str();
00157   }
00158 
00159 }

void SiStripDbParams::clearPartitions (  )  [inline]

Definition at line 191 of file SiStripDbParams.h.

References partitions_.

Referenced by SiStripConfigDb::usingDatabase().

00191 { partitions_.clear(); }

void SiStripDbParams::confdb ( const std::string &  user,
const std::string &  passwd,
const std::string &  path 
)

Definition at line 227 of file SiStripDbParams.cc.

References confdb_, sistrip::null_, passwd_, path_, and user_.

00229                                                       {
00230   if ( user != "" && passwd != "" && path != "" &&
00231        user != null_ && passwd != null_ && path != null_ ) {
00232     user_   = user;
00233     passwd_ = passwd;
00234     path_   = path;
00235   } else {
00236     user_   = null_;
00237     passwd_ = null_;
00238     path_   = null_;
00239   }
00240   confdb_ = user_ + "/" + passwd_ + "@" + path_;
00241 }

void SiStripDbParams::confdb ( const std::string &  confdb  ) 

Definition at line 209 of file SiStripDbParams.cc.

References confdb_, sistrip::null_, passwd_, path_, and user_.

00209                                                       {
00210   confdb_ = confdb;
00211   uint32_t ipass = confdb.find("/");
00212   uint32_t ipath = confdb.find("@");
00213   if ( ipass != std::string::npos && 
00214        ipath != std::string::npos ) {
00215     user_   = confdb.substr(0,ipass); 
00216     passwd_ = confdb.substr(ipass+1,ipath-ipass-1); 
00217     path_   = confdb.substr(ipath+1,confdb.size());
00218   } else {
00219     user_   = null_;
00220     passwd_ = null_;
00221     path_   = null_;
00222   }
00223 }

std::string SiStripDbParams::confdb (  )  const [inline]

Definition at line 173 of file SiStripDbParams.h.

References confdb_.

Referenced by operator=(), operator==(), pset(), reset(), and SiStripConfigDb::usingDatabase().

00173 { return confdb_; }

std::vector< std::string > SiStripDbParams::inputDcuInfoXmlFiles (  )  const

Definition at line 374 of file SiStripDbParams.cc.

References translate::files, and partitions_.

Referenced by SiStripConfigDb::getDcuDetIds().

00374                                                                  {
00375   std::vector<std::string> files;
00376   SiStripPartitions::const_iterator ii = partitions_.begin();
00377   SiStripPartitions::const_iterator jj = partitions_.end();
00378   for ( ; ii != jj; ++ii ) { files.insert( files.end(), ii->second.inputDcuInfoXml() ); }
00379   return files;
00380 }

std::vector< std::string > SiStripDbParams::inputFecXmlFiles (  )  const

Definition at line 384 of file SiStripDbParams.cc.

References translate::files, and partitions_.

Referenced by SiStripConfigDb::getDeviceDescriptions().

00384                                                              {
00385   std::vector<std::string> files;
00386   SiStripPartitions::const_iterator ii = partitions_.begin();
00387   SiStripPartitions::const_iterator jj = partitions_.end();
00388   for ( ; ii != jj; ++ii ) { files.insert( files.end(), ii->second.inputFecXml().begin(), ii->second.inputFecXml().end() ); }
00389   return files;
00390 }

std::vector< std::string > SiStripDbParams::inputFedXmlFiles (  )  const

Definition at line 394 of file SiStripDbParams.cc.

References translate::files, and partitions_.

Referenced by SiStripConfigDb::getFedDescriptions().

00394                                                              {
00395   std::vector<std::string> files;
00396   SiStripPartitions::const_iterator ii = partitions_.begin();
00397   SiStripPartitions::const_iterator jj = partitions_.end();
00398   for ( ; ii != jj; ++ii ) { files.insert( files.end(), ii->second.inputFedXml().begin(), ii->second.inputFedXml().end() ); }
00399   return files;
00400 }

std::vector< std::string > SiStripDbParams::inputModuleXmlFiles (  )  const

Definition at line 364 of file SiStripDbParams.cc.

References translate::files, and partitions_.

Referenced by SiStripConfigDb::getFedConnections().

00364                                                                 {
00365   std::vector<std::string> files;
00366   SiStripPartitions::const_iterator ii = partitions_.begin();
00367   SiStripPartitions::const_iterator jj = partitions_.end();
00368   for ( ; ii != jj; ++ii ) { files.insert( files.end(), ii->second.inputModuleXml() ); }
00369   return files;
00370 }

bool SiStripDbParams::operator!= ( const SiStripDbParams input  )  const

Definition at line 95 of file SiStripDbParams.cc.

00095                                                                       {
00096   return !( *this == input );
00097 }

SiStripDbParams & SiStripDbParams::operator= ( const SiStripDbParams input  ) 

Definition at line 48 of file SiStripDbParams.cc.

References confdb(), confdb_, outputDcuInfoXml(), outputDcuInfoXml_, outputFecXml(), outputFecXml_, outputFedXml(), outputFedXml_, outputModuleXml(), outputModuleXml_, partitions(), partitions_, passwd(), passwd_, path(), path_, sharedMemory(), sharedMemory_, tnsAdmin(), tnsAdmin_, user(), user_, usingDb(), usingDb_, usingDbCache(), and usingDbCache_.

00048                                                                            {
00049   usingDb_ = input.usingDb();
00050   confdb_ = input.confdb();
00051   user_ = input.user();
00052   passwd_ = input.passwd();
00053   path_ = input.path();
00054   confdb( confdb_ );
00055   usingDbCache_ = input.usingDbCache();
00056   sharedMemory_ = input.sharedMemory();
00057   tnsAdmin_ = input.tnsAdmin();
00058   partitions_.clear();
00059   partitions_ = SiStripPartitions( input.partitions().begin(), input.partitions().end() );
00060   outputModuleXml_ = input.outputModuleXml();
00061   outputDcuInfoXml_ = input.outputDcuInfoXml();
00062   outputFecXml_ = input.outputFecXml(); 
00063   outputFedXml_ = input.outputFedXml();
00064   return *this;
00065 }

bool SiStripDbParams::operator== ( const SiStripDbParams input  )  const

Definition at line 69 of file SiStripDbParams.cc.

References confdb(), confdb_, iter, outputDcuInfoXml(), outputDcuInfoXml_, outputFecXml(), outputFecXml_, outputFedXml(), outputFedXml_, outputModuleXml(), outputModuleXml_, partitions(), partitions_, passwd(), passwd_, path(), path_, sharedMemory(), sharedMemory_, tnsAdmin(), tnsAdmin_, user(), user_, usingDb(), usingDb_, usingDbCache(), and usingDbCache_.

00069                                                                       {
00070   if ( !( usingDb_ == input.usingDb() &&
00071           confdb_ == input.confdb() && 
00072           user_ == input.user() &&
00073           passwd_ == input.passwd() &&
00074           path_ == input.path() &&
00075           usingDbCache_ == input.usingDbCache() &&
00076           sharedMemory_ == input.sharedMemory() &&
00077           tnsAdmin_ == input.tnsAdmin() &&
00078           outputModuleXml_ == input.outputModuleXml() &&
00079           outputDcuInfoXml_ == input.outputDcuInfoXml() &&
00080           outputFecXml_ == input.outputFecXml() && 
00081           outputFedXml_ == input.outputFedXml() ) ) { return false; }
00082   if ( partitions_.size() != input.partitions().size() ) { return false; }
00083   SiStripPartitions::const_iterator ii = input.partitions().begin();
00084   SiStripPartitions::const_iterator jj = input.partitions().end();
00085   SiStripPartitions::const_iterator iter = partitions_.begin();
00086   for ( ; ii != jj; ++ii ) {
00087     if ( ii->first != iter->first || ii->second != iter->second ) { return false; }
00088     iter++;
00089   }
00090   return true;
00091 }

std::string SiStripDbParams::outputDcuInfoXml (  )  const [inline]

Definition at line 187 of file SiStripDbParams.h.

References outputDcuInfoXml_.

Referenced by operator=(), operator==(), and SiStripConfigDb::usingXmlFiles().

00187 { return outputDcuInfoXml_; }

std::string SiStripDbParams::outputFecXml (  )  const [inline]

Definition at line 188 of file SiStripDbParams.h.

References outputFecXml_.

Referenced by operator=(), operator==(), and SiStripConfigDb::usingXmlFiles().

00188 { return outputFecXml_; }

std::string SiStripDbParams::outputFedXml (  )  const [inline]

Definition at line 189 of file SiStripDbParams.h.

References outputFedXml_.

Referenced by operator=(), operator==(), and SiStripConfigDb::usingXmlFiles().

00189 { return outputFedXml_; }

std::string SiStripDbParams::outputModuleXml (  )  const [inline]

Definition at line 186 of file SiStripDbParams.h.

References outputModuleXml_.

Referenced by operator=(), operator==(), SiStripConfigDb::uploadFedConnections(), and SiStripConfigDb::usingXmlFiles().

00186 { return outputModuleXml_; }

SiStripDbParams::SiStripPartitions::iterator SiStripDbParams::partition ( std::string  partition_name  ) 

Returns iterator to partition object.

Definition at line 254 of file SiStripDbParams.cc.

References partitions().

00254                                                                                               {
00255   SiStripDbParams::SiStripPartitions::iterator ii = partitions().begin();
00256   SiStripDbParams::SiStripPartitions::iterator jj = partitions().end();
00257   for ( ; ii != jj; ++ii ) { if ( partition_name == ii->second.partitionName() ) { return ii; } }
00258   return partitions().end(); 
00259 }

SiStripDbParams::SiStripPartitions::const_iterator SiStripDbParams::partition ( std::string  partition_name  )  const

Returns const iterator to partition object.

Definition at line 245 of file SiStripDbParams.cc.

References partitions().

Referenced by SiStripConfigDb::runs().

00245                                                                                                           {
00246   SiStripDbParams::SiStripPartitions::const_iterator ii = partitions().begin();
00247   SiStripDbParams::SiStripPartitions::const_iterator jj = partitions().end();
00248   for ( ; ii != jj; ++ii ) { if ( partition_name == ii->second.partitionName() ) { return ii; } }
00249   return partitions().end(); 
00250 }

std::string SiStripDbParams::partitionNames ( const std::vector< std::string > &  partitions  )  const

Construct string from (non-zero) partition names.

Definition at line 295 of file SiStripDbParams.cc.

References first, and ss.

00295                                                                                         {
00296   std::stringstream ss;
00297   std::vector<std::string>::const_iterator ii = partitions.begin();
00298   std::vector<std::string>::const_iterator jj = partitions.end();
00299   bool first = true;
00300   for ( ; ii != jj; ++ii ) { 
00301     if ( !ii->empty() ) { 
00302       first ? ss << *ii : ss << ":" << *ii; 
00303       first = false;
00304     }
00305   }
00306   return ss.str();
00307 }

std::vector< std::string > SiStripDbParams::partitionNames ( std::string  input  )  const

Extract (non-zero) partition names from string.

Definition at line 284 of file SiStripDbParams.cc.

References partitions(), and ss.

00284                                                                             {
00285   std::istringstream ss(input);
00286   std::vector<std::string> partitions;
00287   std::string delimiter = ":";
00288   std::string token;
00289   while ( getline( ss, token, ':' ) ) { if ( !token.empty() ) { partitions.push_back(token); } }
00290   return partitions;
00291 }

std::vector< std::string > SiStripDbParams::partitionNames (  )  const

Extract (non-zero) partition names from partition objects.

Definition at line 263 of file SiStripDbParams.cc.

References find(), sistrip::mlConfigDb_, partitions(), and partitions_.

Referenced by SiStripConfigDb::usingDatabase().

00263                                                            {
00264   std::vector<std::string> partitions;
00265   SiStripPartitions::const_iterator ii = partitions_.begin();
00266   SiStripPartitions::const_iterator jj = partitions_.end();
00267   for ( ; ii != jj; ++ii ) { 
00268     if ( std::find( partitions.begin(), 
00269                     partitions.end(), 
00270                     ii->second.partitionName() ) == partitions.end() ) {
00271       if ( !ii->second.partitionName().empty() ) { partitions.push_back( ii->second.partitionName() ); }
00272     } else {
00273       edm::LogWarning(mlConfigDb_)
00274         << "[SiStripConfigDb::" << __func__ << "]"
00275         << " Partition " << ii->second.partitionName()
00276         << " already found! Not adding to vector...";
00277     }
00278   }
00279   return partitions;
00280 }

SiStripDbParams::iterator_range SiStripDbParams::partitions (  )  [inline]

Returns pair of iterators to partitions objects.

Definition at line 183 of file SiStripDbParams.h.

References partitions_.

00183                                                                  { return iterator_range( partitions_.begin(), 
00184                                                                                               partitions_.end() ); }

SiStripDbParams::const_iterator_range SiStripDbParams::partitions (  )  const [inline]

Returns pair of const iterators to partitions objects.

Definition at line 181 of file SiStripDbParams.h.

References partitions_.

Referenced by SiStripConfigDb::addDeviceDescriptions(), SiStripConfigDb::addFedConnections(), SiStripConfigDb::addFedDescriptions(), CommissioningHistosUsingDb::buildDetInfo(), SiStripConfigDb::clearDcuDetIds(), SiStripConfigDb::clearDeviceDescriptions(), SiStripConfigDb::clearFedConnections(), SiStripConfigDb::clearFedDescriptions(), FineDelayHistosUsingDb::create(), PedestalsHistosUsingDb::create(), FastFedCablingHistosUsingDb::create(), VpspScanHistosUsingDb::create(), CalibrationHistosUsingDb::create(), NoiseHistosUsingDb::create(), PedsOnlyHistosUsingDb::create(), LatencyHistosUsingDb::create(), ApvTimingHistosUsingDb::create(), OptoScanHistosUsingDb::create(), SiStripConfigDb::getDcuDetIds(), SiStripConfigDb::getDeviceDescriptions(), SiStripConfigDb::getFedConnections(), SiStripConfigDb::getFedDescriptions(), operator=(), operator==(), partition(), partitionNames(), pset(), SiStripConfigDb::runs(), CommissioningHistosUsingDb::uploadAnalyses(), FastFedCablingHistosUsingDb::uploadConfigurations(), SiStripConfigDb::uploadDeviceDescriptions(), SiStripConfigDb::uploadFedConnections(), SiStripConfigDb::uploadFedDescriptions(), SiStripConfigDb::usingDatabase(), and SiStripConfigDb::usingXmlFiles().

00181                                                                              { return const_iterator_range( partitions_.begin(), 
00182                                                                                                                 partitions_.end() ); }

std::string SiStripDbParams::passwd (  )  const [inline]

Definition at line 175 of file SiStripDbParams.h.

References passwd_.

Referenced by operator=(), operator==(), and SiStripConfigDb::usingDatabase().

00175 { return passwd_; }

std::string SiStripDbParams::path ( void   )  const [inline]

Definition at line 176 of file SiStripDbParams.h.

References path_.

Referenced by operator=(), operator==(), and SiStripConfigDb::usingDatabase().

00176 { return path_; }

void SiStripDbParams::print ( std::stringstream &  ss  )  const

Definition at line 311 of file SiStripDbParams.cc.

References confdb_, lat::endl(), outputDcuInfoXml_, outputFecXml_, outputFedXml_, outputModuleXml_, partitions_, sharedMemory_, usingDb_, and usingDbCache_.

Referenced by operator<<().

00311                                                        {
00312 
00313   ss << " Using database account     : " << std::boolalpha << usingDb_ << std::noboolalpha << std::endl;
00314   ss << " Using XML files            : " << std::boolalpha << !usingDb_ << std::noboolalpha << std::endl;
00315   ss << " Using database cache       : " << std::boolalpha << usingDbCache_ << std::noboolalpha << std::endl;
00316   if ( usingDbCache_ ) { 
00317     ss << " Shared memory name         : " << std::boolalpha << sharedMemory_ << std::noboolalpha << std::endl;
00318   }
00319 
00320   if ( !usingDbCache_ ) {
00321 
00322     if ( usingDb_ ) {
00323       ss << " Database account (ConfDb)  : " << confdb_ << std::endl;
00324     }
00325     
00326     ss << " Number of partitions       : " << partitions_.size();
00327     if ( partitions_.empty() ) { 
00328       if ( !usingDbCache_ ) { ss << " (Empty!)"; }
00329       else { ss << " (Using database cache!)"; }
00330     }
00331     ss << std::endl;
00332     
00333     uint16_t cntr = 0;
00334     SiStripPartitions::const_iterator ii = partitions_.begin();
00335     SiStripPartitions::const_iterator jj = partitions_.end();
00336     for ( ; ii != jj; ++ii ) { 
00337       cntr++;
00338       ss << " Partition #" << cntr << " (out of " << partitions_.size() << "):" << std::endl;
00339       ii->second.print( ss, usingDb_ ); 
00340     }
00341     
00342     if ( !usingDb_ ) {
00343       ss << " Output \"module.xml\" file   : " << outputModuleXml_ << std::endl
00344          << " Output \"dcuinfo.xml\" file  : " << outputDcuInfoXml_ << std::endl
00345          << " Output \"fec.xml\" file(s)   : " << outputFecXml_ << std::endl
00346          << " Output \"fed.xml\" file(s)   : " << outputFedXml_ << std::endl;
00347     }
00348 
00349   }
00350  
00351 }

void SiStripDbParams::pset ( const edm::ParameterSet cfg  ) 

Definition at line 163 of file SiStripDbParams.cc.

References addPartition(), confdb(), false, find(), edm::ParameterSet::getParameterNamesForType(), edm::ParameterSet::getUntrackedParameter(), names, outputDcuInfoXml_, outputFecXml_, outputFedXml_, outputModuleXml_, partitions(), partitions_, SiStripPartition::pset(), sharedMemory_, tmp, tnsAdmin_, usingDb_, and usingDbCache_.

Referenced by SiStripConfigDb::SiStripConfigDb().

00163                                                        {
00164 
00165   // "Common" configurables
00166   usingDb_      = cfg.getUntrackedParameter<bool>( "UsingDb", false ); 
00167   usingDbCache_ = cfg.getUntrackedParameter<bool>( "UsingDbCache", false ); 
00168   sharedMemory_ = cfg.getUntrackedParameter<std::string>( "SharedMemory", "" ); 
00169   tnsAdmin_     = cfg.getUntrackedParameter<std::string>( "TNS_ADMIN", "" );
00170   confdb( cfg.getUntrackedParameter<std::string>( "ConfDb", "") );
00171 
00172   // Check if top-level PSet (containing partition-level Psets) exists
00173   std::string partitions = "Partitions";
00174   std::vector<std::string> str = cfg.getParameterNamesForType<edm::ParameterSet>(false);
00175   std::vector<std::string>::const_iterator istr = std::find( str.begin(), str.end(), partitions );
00176   if ( istr != str.end() ) {
00177 
00178     // Retrieve top-level PSet containing partition-level Psets
00179     edm::ParameterSet psets = cfg.getUntrackedParameter<edm::ParameterSet>( partitions );
00180     
00181     // Extract names of partition-level PSets
00182     std::vector<std::string> names = psets.getParameterNamesForType<edm::ParameterSet>(false);
00183     
00184     // Iterator through PSets names, retrieve PSet for each partition and extract info
00185     std::vector<std::string>::iterator iname = names.begin();
00186     std::vector<std::string>::iterator jname = names.end();
00187     for ( ; iname != jname; ++iname ) {
00188       edm::ParameterSet pset = psets.getUntrackedParameter<edm::ParameterSet>( *iname );
00189       SiStripPartition tmp;
00190       tmp.pset( pset );
00191       addPartition( tmp );
00192     }
00193 
00194   }
00195   
00196   // Ensure at least one "default" partition
00197   if ( partitions_.empty() ) { addPartition( SiStripPartition() ); }
00198 
00199   // Set output XML files
00200   outputModuleXml_  = cfg.getUntrackedParameter<std::string>( "OutputModuleXml", "/tmp/module.xml" );
00201   outputDcuInfoXml_ = cfg.getUntrackedParameter<std::string>( "OutputDcuInfoXml", "/tmp/dcuinfo.xml" );
00202   outputFecXml_     = cfg.getUntrackedParameter<std::string>( "OutputFecXml", "/tmp/fec.xml" );
00203   outputFedXml_     = cfg.getUntrackedParameter<std::string>( "OutputFedXml", "/tmp/fed.xml" );
00204   
00205 }

void SiStripDbParams::reset ( void   ) 

Definition at line 107 of file SiStripDbParams.cc.

References confdb(), confdb_, sistrip::null_, outputDcuInfoXml_, outputFecXml_, outputFedXml_, outputModuleXml_, partitions_, passwd_, path_, sharedMemory_, tnsAdmin_, user_, usingDb_, and usingDbCache_.

Referenced by SiStripConfigDb::SiStripConfigDb(), SiStripConfigDb::usingDatabaseCache(), and ~SiStripDbParams().

00107                             {
00108   usingDb_      = false;
00109   confdb_       = null_;
00110   user_         = null_;
00111   passwd_       = null_;
00112   path_         = null_;
00113   usingDbCache_ = false;
00114   sharedMemory_ = "";
00115   tnsAdmin_     = "";
00116   partitions_.clear();
00117   confdb( confdb_ );
00118   outputModuleXml_  = "/tmp/module.xml";
00119   outputDcuInfoXml_ = "/tmp/dcuinfo.xml";
00120   outputFecXml_     = "/tmp/fec.xml";
00121   outputFedXml_     = "/tmp/fed.xml";
00122 }

void SiStripDbParams::sharedMemory ( std::string  name  )  [inline]

Definition at line 194 of file SiStripDbParams.h.

References sharedMemory_.

00194 { sharedMemory_ = name; }

std::string SiStripDbParams::sharedMemory (  )  const [inline]

Definition at line 178 of file SiStripDbParams.h.

References sharedMemory_.

Referenced by SiStripConfigDb::getDcuDetIds(), SiStripConfigDb::getDeviceDescriptions(), SiStripConfigDb::getFedConnections(), SiStripConfigDb::getFedDescriptions(), operator=(), operator==(), and SiStripConfigDb::usingDatabaseCache().

00178 { return sharedMemory_; }

std::string SiStripDbParams::tnsAdmin (  )  const [inline]

Definition at line 179 of file SiStripDbParams.h.

References tnsAdmin_.

Referenced by operator=(), operator==(), and SiStripConfigDb::usingDatabase().

00179 { return tnsAdmin_; }

std::string SiStripDbParams::user ( void   )  const [inline]

Definition at line 174 of file SiStripDbParams.h.

References user_.

Referenced by operator=(), operator==(), and SiStripConfigDb::usingDatabase().

00174 { return  user_; }

void SiStripDbParams::usingDb ( bool  using_db  )  [inline]

Definition at line 192 of file SiStripDbParams.h.

References usingDb_.

00192 { usingDb_ = using_db; }

bool SiStripDbParams::usingDb (  )  const [inline]

Definition at line 172 of file SiStripDbParams.h.

References usingDb_.

Referenced by SiStripConfigDb::getDcuDetIds(), SiStripConfigDb::getDeviceDescriptions(), SiStripConfigDb::getFedConnections(), SiStripConfigDb::getFedDescriptions(), SiStripConfigDb::openDbConnection(), operator=(), operator==(), SiStripConfigDb::uploadFedConnections(), SiStripConfigDb::usingDatabase(), SiStripConfigDb::usingDatabaseCache(), SiStripConfigDb::usingDb(), and SiStripConfigDb::usingXmlFiles().

00172 { return usingDb_; }

void SiStripDbParams::usingDbCache ( bool  using_cache  )  [inline]

Definition at line 193 of file SiStripDbParams.h.

References usingDbCache_.

00193 { usingDbCache_ = using_cache; }

bool SiStripDbParams::usingDbCache (  )  const [inline]

Definition at line 177 of file SiStripDbParams.h.

References usingDbCache_.

Referenced by SiStripConfigDb::getDcuDetIds(), SiStripConfigDb::getDeviceDescriptions(), SiStripConfigDb::getFedConnections(), SiStripConfigDb::getFedDescriptions(), SiStripConfigDb::getFedIds(), SiStripConfigDb::openDbConnection(), operator=(), operator==(), SiStripConfigDb::uploadDeviceDescriptions(), SiStripConfigDb::uploadFedConnections(), SiStripConfigDb::uploadFedDescriptions(), and SiStripConfigDb::usingDatabaseCache().

00177 { return usingDbCache_; }


Member Data Documentation

std::string SiStripDbParams::confdb_ [private]

Definition at line 144 of file SiStripDbParams.h.

Referenced by confdb(), operator=(), operator==(), print(), and reset().

std::string SiStripDbParams::outputDcuInfoXml_ [private]

Definition at line 162 of file SiStripDbParams.h.

Referenced by operator=(), operator==(), outputDcuInfoXml(), print(), pset(), and reset().

std::string SiStripDbParams::outputFecXml_ [private]

Definition at line 164 of file SiStripDbParams.h.

Referenced by operator=(), operator==(), outputFecXml(), print(), pset(), and reset().

std::string SiStripDbParams::outputFedXml_ [private]

Definition at line 166 of file SiStripDbParams.h.

Referenced by operator=(), operator==(), outputFedXml(), print(), pset(), and reset().

std::string SiStripDbParams::outputModuleXml_ [private]

Definition at line 160 of file SiStripDbParams.h.

Referenced by operator=(), operator==(), outputModuleXml(), print(), pset(), and reset().

SiStripPartitions SiStripDbParams::partitions_ [private]

Definition at line 158 of file SiStripDbParams.h.

Referenced by addPartition(), clearPartitions(), inputDcuInfoXmlFiles(), inputFecXmlFiles(), inputFedXmlFiles(), inputModuleXmlFiles(), operator=(), operator==(), partitionNames(), partitions(), print(), pset(), and reset().

std::string SiStripDbParams::passwd_ [private]

Definition at line 148 of file SiStripDbParams.h.

Referenced by confdb(), operator=(), operator==(), passwd(), and reset().

std::string SiStripDbParams::path_ [private]

Definition at line 150 of file SiStripDbParams.h.

Referenced by confdb(), operator=(), operator==(), path(), and reset().

std::string SiStripDbParams::sharedMemory_ [private]

Definition at line 154 of file SiStripDbParams.h.

Referenced by operator=(), operator==(), print(), pset(), reset(), and sharedMemory().

std::string SiStripDbParams::tnsAdmin_ [private]

Definition at line 156 of file SiStripDbParams.h.

Referenced by operator=(), operator==(), pset(), reset(), and tnsAdmin().

std::string SiStripDbParams::user_ [private]

Definition at line 146 of file SiStripDbParams.h.

Referenced by confdb(), operator=(), operator==(), reset(), and user().

bool SiStripDbParams::usingDb_ [private]

Definition at line 142 of file SiStripDbParams.h.

Referenced by operator=(), operator==(), print(), pset(), reset(), and usingDb().

bool SiStripDbParams::usingDbCache_ [private]

Definition at line 152 of file SiStripDbParams.h.

Referenced by operator=(), operator==(), print(), pset(), reset(), and usingDbCache().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:32:16 2009 for CMSSW by  doxygen 1.5.4