CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
SiStripDbParams Class Reference

Container class for database connection parameters. More...

#include <SiStripDbParams.h>

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
 
typedef
SiStripPartitions::size_type 
size_type
 

Public Member Functions

void addPartition (const SiStripPartition &)
 
void clearPartitions ()
 
std::string confdb () const
 
void confdb (const std::string &)
 
void confdb (const std::string &user, const std::string &passwd, const std::string &path)
 
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::const_iterator partition (std::string partition_name) const
 
SiStripPartitions::iterator partition (std::string partition_name)
 
std::vector< std::string > partitionNames () const
 
std::vector< std::string > partitionNames (std::string) const
 
std::string partitionNames (const std::vector< std::string > &) const
 
const_iterator_range partitions () const
 
iterator_range partitions ()
 
size_type partitionsSize () const
 
std::string passwd () const
 
std::string path () const
 
void print (std::stringstream &) const
 
void pset (const edm::ParameterSet &)
 
void reset ()
 
std::string sharedMemory () const
 
void sharedMemory (std::string)
 
 SiStripDbParams ()
 
 SiStripDbParams (const SiStripDbParams &)
 
std::string tnsAdmin () const
 
std::string user () const
 
bool usingDb () const
 
void usingDb (bool)
 
bool usingDbCache () const
 
void usingDbCache (bool)
 
 ~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 26 of file SiStripDbParams.h.

Member Typedef Documentation

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

Definition at line 50 of file SiStripDbParams.h.

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

Definition at line 52 of file SiStripDbParams.h.

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

Definition at line 46 of file SiStripDbParams.h.

typedef SiStripPartitions::size_type SiStripDbParams::size_type

Definition at line 48 of file SiStripDbParams.h.

Constructor & Destructor Documentation

SiStripDbParams::SiStripDbParams ( )

Definition at line 11 of file SiStripDbParams.cc.

11  :
12  usingDb_(false),
13  confdb_(null_),
14  user_(null_),
15  passwd_(null_),
16  path_(null_),
17  usingDbCache_(false),
18  sharedMemory_(""),
19  tnsAdmin_(""),
20  partitions_(),
21  outputModuleXml_("/tmp/module.xml"),
22  outputDcuInfoXml_("/tmp/dcuinfo.xml"),
23  outputFecXml_("/tmp/fec.xml"),
24  outputFedXml_("/tmp/fed.xml")
25 {;}
std::string tnsAdmin_
std::string outputDcuInfoXml_
std::string outputFecXml_
std::string outputModuleXml_
std::string user_
std::string outputFedXml_
std::string passwd_
std::string sharedMemory_
std::string path_
std::string confdb_
SiStripPartitions partitions_
static const char null_[]
Definition: Constants.h:22
SiStripDbParams::SiStripDbParams ( const SiStripDbParams input)

Definition at line 29 of file SiStripDbParams.cc.

29  :
30  usingDb_( input.usingDb() ),
31  confdb_( input.confdb() ),
32  user_( input.user() ),
33  passwd_( input.passwd() ),
34  path_( input.path() ),
35  usingDbCache_( input.usingDbCache() ),
36  sharedMemory_( input.sharedMemory() ),
37  tnsAdmin_( input.tnsAdmin() ),
38  partitions_( input.partitions().begin(), input.partitions().end() ),
41  outputFecXml_( input.outputFecXml() ),
42  outputFedXml_( input.outputFedXml() )
43 {;}
std::string passwd() const
std::string tnsAdmin_
bool usingDb() const
std::string outputDcuInfoXml_
const_iterator_range partitions() const
std::string outputModuleXml() const
std::string outputFecXml_
std::string outputModuleXml_
std::string user_
std::string tnsAdmin() const
std::string sharedMemory() const
std::string outputFedXml_
std::string passwd_
std::string sharedMemory_
std::string user() const
std::string path_
std::string confdb() const
std::string outputFedXml() const
std::string path() const
std::string confdb_
bool usingDbCache() const
std::string outputFecXml() const
SiStripPartitions partitions_
std::string outputDcuInfoXml() const
SiStripDbParams::~SiStripDbParams ( )

Definition at line 101 of file SiStripDbParams.cc.

References reset().

101  {
102  reset();
103 }

Member Function Documentation

void SiStripDbParams::addPartition ( const SiStripPartition in)

Definition at line 126 of file SiStripDbParams.cc.

References SiStripPartition::defaultPartitionName_, recoMuon::in, LogTrace, sistrip::mlConfigDb_, SiStripPartition::partitionName(), partitions_, and contentValuesCheck::ss.

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

126  {
127 
128  if ( in.partitionName() == "" ) {
129  std::stringstream ss;
130  ss << "[SiStripDbParams::" << __func__ << "]"
131  << " Attempting to add partition with null name!";
132  //edm::LogWarning(mlConfigDb_) << ss.str();
133  }
134 
135  SiStripPartitions::const_iterator iter = partitions_.find( in.partitionName() );
136  if ( iter == partitions_.end() ) {
137  partitions_[in.partitionName()] = in;
139  std::stringstream ss;
140  ss << "[SiStripDbParams::" << __func__ << "]"
141  << " Added new partition with name \""
142  << in.partitionName() << "\"";
143  //ss << std::endl << partitions_[in.partitionName()];
144  ss << " (Currently have "
145  << partitions_.size()
146  << " partitions in cache...)";
147  LogTrace(mlConfigDb_) << ss.str();
148  }
149  } else {
150  std::stringstream ss;
151  ss << "[SiStripDbParams::" << __func__ << "]"
152  << " Partition with name \""
153  << in.partitionName()
154  << "\" already found!"
155  << " Not adding to cache...";
156  edm::LogWarning(mlConfigDb_) << ss.str();
157  }
158 
159 }
static const std::string defaultPartitionName_
std::string partitionName() const
static const char mlConfigDb_[]
#define LogTrace(id)
SiStripPartitions partitions_
void SiStripDbParams::clearPartitions ( )
inline

Definition at line 197 of file SiStripDbParams.h.

References partitions_.

Referenced by SiStripConfigDb::usingDatabase().

197 { partitions_.clear(); }
SiStripPartitions partitions_
std::string SiStripDbParams::confdb ( ) const
inline

Definition at line 177 of file SiStripDbParams.h.

References confdb_.

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

177 { return confdb_; }
std::string confdb_
void SiStripDbParams::confdb ( const std::string &  confdb)

Definition at line 209 of file SiStripDbParams.cc.

References confdb(), confdb_, sistrip::null_, passwd_, path_, and user_.

209  {
210  confdb_ = confdb;
211  size_t ipass = confdb.find("/");
212  size_t ipath = confdb.find("@");
213  if ( ipass != std::string::npos &&
214  ipath != std::string::npos ) {
215  user_ = confdb.substr(0,ipass);
216  passwd_ = confdb.substr(ipass+1,ipath-ipass-1);
217  path_ = confdb.substr(ipath+1,confdb.size());
218  } else {
219  user_ = null_;
220  passwd_ = null_;
221  path_ = null_;
222  }
223 }
std::string user_
std::string passwd_
std::string path_
std::string confdb() const
std::string confdb_
static const char null_[]
Definition: Constants.h:22
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(), passwd_, path(), path_, user(), and user_.

229  {
230  if ( user != "" && passwd != "" && path != "" &&
231  user != null_ && passwd != null_ && path != null_ ) {
232  user_ = user;
233  passwd_ = passwd;
234  path_ = path;
235  } else {
236  user_ = null_;
237  passwd_ = null_;
238  path_ = null_;
239  }
240  confdb_ = user_ + "/" + passwd_ + "@" + path_;
241 }
std::string passwd() const
std::string user_
std::string passwd_
std::string user() const
std::string path_
std::string path() const
std::string confdb_
static const char null_[]
Definition: Constants.h:22
std::vector< std::string > SiStripDbParams::inputDcuInfoXmlFiles ( ) const

Definition at line 374 of file SiStripDbParams.cc.

References MainPageGenerator::files, cuy::ii, findQualityFiles::jj, and partitions_.

374  {
375  std::vector<std::string> files;
376  SiStripPartitions::const_iterator ii = partitions_.begin();
377  SiStripPartitions::const_iterator jj = partitions_.end();
378  for ( ; ii != jj; ++ii ) { files.insert( files.end(), ii->second.inputDcuInfoXml() ); }
379  return files;
380 }
int ii
Definition: cuy.py:588
SiStripPartitions partitions_
std::vector< std::string > SiStripDbParams::inputFecXmlFiles ( ) const

Definition at line 384 of file SiStripDbParams.cc.

References MainPageGenerator::files, cuy::ii, findQualityFiles::jj, and partitions_.

384  {
385  std::vector<std::string> files;
386  SiStripPartitions::const_iterator ii = partitions_.begin();
387  SiStripPartitions::const_iterator jj = partitions_.end();
388  for ( ; ii != jj; ++ii ) { files.insert( files.end(), ii->second.inputFecXml().begin(), ii->second.inputFecXml().end() ); }
389  return files;
390 }
int ii
Definition: cuy.py:588
SiStripPartitions partitions_
std::vector< std::string > SiStripDbParams::inputFedXmlFiles ( ) const

Definition at line 394 of file SiStripDbParams.cc.

References MainPageGenerator::files, cuy::ii, findQualityFiles::jj, and partitions_.

394  {
395  std::vector<std::string> files;
396  SiStripPartitions::const_iterator ii = partitions_.begin();
397  SiStripPartitions::const_iterator jj = partitions_.end();
398  for ( ; ii != jj; ++ii ) { files.insert( files.end(), ii->second.inputFedXml().begin(), ii->second.inputFedXml().end() ); }
399  return files;
400 }
int ii
Definition: cuy.py:588
SiStripPartitions partitions_
std::vector< std::string > SiStripDbParams::inputModuleXmlFiles ( ) const

Definition at line 364 of file SiStripDbParams.cc.

References MainPageGenerator::files, cuy::ii, findQualityFiles::jj, and partitions_.

364  {
365  std::vector<std::string> files;
366  SiStripPartitions::const_iterator ii = partitions_.begin();
367  SiStripPartitions::const_iterator jj = partitions_.end();
368  for ( ; ii != jj; ++ii ) { files.insert( files.end(), ii->second.inputModuleXml() ); }
369  return files;
370 }
int ii
Definition: cuy.py:588
SiStripPartitions partitions_
bool SiStripDbParams::operator!= ( const SiStripDbParams input) const

Definition at line 95 of file SiStripDbParams.cc.

References input.

95  {
96  return !( *this == input );
97 }
static std::string const input
Definition: EdmProvDump.cc:44
SiStripDbParams & SiStripDbParams::operator= ( const SiStripDbParams input)

Definition at line 47 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_.

47  {
48  usingDb_ = input.usingDb();
49  confdb_ = input.confdb();
50  user_ = input.user();
51  passwd_ = input.passwd();
52  path_ = input.path();
53  confdb( confdb_ );
54  usingDbCache_ = input.usingDbCache();
55  sharedMemory_ = input.sharedMemory();
56  tnsAdmin_ = input.tnsAdmin();
57  partitions_.clear();
58  partitions_ = SiStripPartitions( input.partitions().begin(), input.partitions().end() );
61  outputFecXml_ = input.outputFecXml();
62  outputFedXml_ = input.outputFedXml();
63  return *this;
64 }
std::string passwd() const
std::string tnsAdmin_
std::map< std::string, SiStripPartition > SiStripPartitions
bool usingDb() const
std::string outputDcuInfoXml_
const_iterator_range partitions() const
std::string outputModuleXml() const
std::string outputFecXml_
std::string outputModuleXml_
std::string user_
std::string tnsAdmin() const
std::string sharedMemory() const
std::string outputFedXml_
std::string passwd_
std::string sharedMemory_
std::string user() const
std::string path_
std::string confdb() const
std::string outputFedXml() const
std::string path() const
std::string confdb_
bool usingDbCache() const
std::string outputFecXml() const
SiStripPartitions partitions_
std::string outputDcuInfoXml() const
bool SiStripDbParams::operator== ( const SiStripDbParams input) const

Definition at line 68 of file SiStripDbParams.cc.

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

68  {
69  if ( !( usingDb_ == input.usingDb() &&
70  confdb_ == input.confdb() &&
71  user_ == input.user() &&
72  passwd_ == input.passwd() &&
73  path_ == input.path() &&
74  usingDbCache_ == input.usingDbCache() &&
75  sharedMemory_ == input.sharedMemory() &&
76  tnsAdmin_ == input.tnsAdmin() &&
77  outputModuleXml_ == input.outputModuleXml() &&
79  outputFecXml_ == input.outputFecXml() &&
80  outputFedXml_ == input.outputFedXml() ) ) { return false; }
81  if ( partitionsSize() != input.partitionsSize() ) { return false; }
82 // SiStripPartitions::const_iterator ii = input.partitions().begin();
83 // SiStripPartitions::const_iterator jj = input.partitions().end();
84 // SiStripPartitions::const_iterator iter = partitions_.begin();
85 // for ( ; ii != jj; ++ii ) {
86 // if ( ii->first != iter->first || ii->second != iter->second ) { return false; }
87 // iter++;
88 // }
89 // return true;
90  return partitions_ == input.partitions_;
91 }
std::string passwd() const
std::string tnsAdmin_
bool usingDb() const
std::string outputDcuInfoXml_
std::string outputModuleXml() const
std::string outputFecXml_
size_type partitionsSize() const
std::string outputModuleXml_
std::string user_
std::string tnsAdmin() const
std::string sharedMemory() const
std::string outputFedXml_
std::string passwd_
std::string sharedMemory_
std::string user() const
std::string path_
std::string confdb() const
std::string outputFedXml() const
std::string path() const
std::string confdb_
bool usingDbCache() const
std::string outputFecXml() const
SiStripPartitions partitions_
std::string outputDcuInfoXml() const
std::string SiStripDbParams::outputDcuInfoXml ( ) const
inline

Definition at line 193 of file SiStripDbParams.h.

References outputDcuInfoXml_.

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

193 { return outputDcuInfoXml_; }
std::string outputDcuInfoXml_
std::string SiStripDbParams::outputFecXml ( ) const
inline

Definition at line 194 of file SiStripDbParams.h.

References outputFecXml_.

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

194 { return outputFecXml_; }
std::string outputFecXml_
std::string SiStripDbParams::outputFedXml ( ) const
inline

Definition at line 195 of file SiStripDbParams.h.

References outputFedXml_.

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

195 { return outputFedXml_; }
std::string outputFedXml_
std::string SiStripDbParams::outputModuleXml ( ) const
inline

Definition at line 192 of file SiStripDbParams.h.

References outputModuleXml_.

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

192 { return outputModuleXml_; }
std::string outputModuleXml_
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 cuy::ii, findQualityFiles::jj, and partitions().

Referenced by SiStripConfigDb::runs().

245  {
246  SiStripDbParams::SiStripPartitions::const_iterator ii = partitions().begin();
247  SiStripDbParams::SiStripPartitions::const_iterator jj = partitions().end();
248  for ( ; ii != jj; ++ii ) { if ( partition_name == ii->second.partitionName() ) { return ii; } }
249  return partitions().end();
250 }
int ii
Definition: cuy.py:588
const_iterator_range partitions() const
SiStripDbParams::SiStripPartitions::iterator SiStripDbParams::partition ( std::string  partition_name)

Returns iterator to partition object.

Definition at line 254 of file SiStripDbParams.cc.

References cuy::ii, findQualityFiles::jj, and partitions().

254  {
255  SiStripDbParams::SiStripPartitions::iterator ii = partitions().begin();
256  SiStripDbParams::SiStripPartitions::iterator jj = partitions().end();
257  for ( ; ii != jj; ++ii ) { if ( partition_name == ii->second.partitionName() ) { return ii; } }
258  return partitions().end();
259 }
int ii
Definition: cuy.py:588
const_iterator_range partitions() const
std::vector< std::string > SiStripDbParams::partitionNames ( ) const

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

Definition at line 263 of file SiStripDbParams.cc.

References spr::find(), cuy::ii, findQualityFiles::jj, sistrip::mlConfigDb_, partitions(), and partitions_.

Referenced by SiStripConfigDb::usingDatabase().

263  {
264  std::vector<std::string> partitions;
265  SiStripPartitions::const_iterator ii = partitions_.begin();
266  SiStripPartitions::const_iterator jj = partitions_.end();
267  for ( ; ii != jj; ++ii ) {
268  if ( std::find( partitions.begin(),
269  partitions.end(),
270  ii->second.partitionName() ) == partitions.end() ) {
271  if ( !ii->second.partitionName().empty() ) { partitions.push_back( ii->second.partitionName() ); }
272  } else {
274  << "[SiStripConfigDb::" << __func__ << "]"
275  << " Partition " << ii->second.partitionName()
276  << " already found! Not adding to vector...";
277  }
278  }
279  return partitions;
280 }
int ii
Definition: cuy.py:588
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
static const char mlConfigDb_[]
const_iterator_range partitions() const
SiStripPartitions partitions_
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(), contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, and unpackBuffers-CaloStage2::token.

284  {
285  std::istringstream ss(input);
286  std::vector<std::string> partitions;
287  std::string delimiter = ":";
289  while ( getline( ss, token, ':' ) ) { if ( !token.empty() ) { partitions.push_back(token); } }
290  return partitions;
291 }
static std::string const input
Definition: EdmProvDump.cc:44
const_iterator_range partitions() const
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 plotBeamSpotDB::first, cuy::ii, findQualityFiles::jj, and contentValuesCheck::ss.

295  {
296  std::stringstream ss;
297  std::vector<std::string>::const_iterator ii = partitions.begin();
298  std::vector<std::string>::const_iterator jj = partitions.end();
299  bool first = true;
300  for ( ; ii != jj; ++ii ) {
301  if ( !ii->empty() ) {
302  first ? ss << *ii : ss << ":" << *ii;
303  first = false;
304  }
305  }
306  return ss.str();
307 }
int ii
Definition: cuy.py:588
const_iterator_range partitions() const
SiStripDbParams::const_iterator_range SiStripDbParams::partitions ( ) const
inline
SiStripDbParams::iterator_range SiStripDbParams::partitions ( )
inline

Returns pair of iterators to partitions objects.

Definition at line 187 of file SiStripDbParams.h.

References partitions_.

187  { return iterator_range( partitions_.begin(),
188  partitions_.end() ); }
boost::iterator_range< SiStripPartitions::iterator > iterator_range
SiStripPartitions partitions_
SiStripDbParams::size_type SiStripDbParams::partitionsSize ( ) const
inline

Return the number of partitions.

Definition at line 190 of file SiStripDbParams.h.

References partitions_.

Referenced by operator==().

190 { return partitions_.size(); }
SiStripPartitions partitions_
std::string SiStripDbParams::passwd ( ) const
inline

Definition at line 179 of file SiStripDbParams.h.

References passwd_.

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

179 { return passwd_; }
std::string passwd_
std::string SiStripDbParams::path ( ) const
inline

Definition at line 180 of file SiStripDbParams.h.

References path_.

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

180 { return path_; }
std::string path_
void SiStripDbParams::print ( std::stringstream &  ss) const

Definition at line 311 of file SiStripDbParams.cc.

References confdb_, cuy::ii, findQualityFiles::jj, outputDcuInfoXml_, outputFecXml_, outputFedXml_, outputModuleXml_, partitions_, sharedMemory_, usingDb_, and usingDbCache_.

Referenced by operator<<().

311  {
312 
313  ss << " Using database account : " << std::boolalpha << usingDb_ << std::noboolalpha << std::endl;
314  ss << " Using XML files : " << std::boolalpha << !usingDb_ << std::noboolalpha << std::endl;
315  ss << " Using database cache : " << std::boolalpha << usingDbCache_ << std::noboolalpha << std::endl;
316  if ( usingDbCache_ ) {
317  ss << " Shared memory name : " << std::boolalpha << sharedMemory_ << std::noboolalpha << std::endl;
318  }
319 
320  if ( !usingDbCache_ ) {
321 
322  if ( usingDb_ ) {
323  ss << " Database account (ConfDb) : " << confdb_ << std::endl;
324  }
325 
326  ss << " Number of partitions : " << partitions_.size();
327  if ( partitions_.empty() ) {
328  if ( !usingDbCache_ ) { ss << " (Empty!)"; }
329  else { ss << " (Using database cache!)"; }
330  }
331  ss << std::endl;
332 
333  uint16_t cntr = 0;
334  SiStripPartitions::const_iterator ii = partitions_.begin();
335  SiStripPartitions::const_iterator jj = partitions_.end();
336  for ( ; ii != jj; ++ii ) {
337  cntr++;
338  ss << " Partition #" << cntr << " (out of " << partitions_.size() << "):" << std::endl;
339  ii->second.print( ss, usingDb_ );
340  }
341 
342  if ( !usingDb_ ) {
343  ss << " Output \"module.xml\" file : " << outputModuleXml_ << std::endl
344  << " Output \"dcuinfo.xml\" file : " << outputDcuInfoXml_ << std::endl
345  << " Output \"fec.xml\" file(s) : " << outputFecXml_ << std::endl
346  << " Output \"fed.xml\" file(s) : " << outputFedXml_ << std::endl;
347  }
348 
349  }
350 
351 }
int ii
Definition: cuy.py:588
std::string outputDcuInfoXml_
std::string outputFecXml_
std::string outputModuleXml_
std::string outputFedXml_
std::string sharedMemory_
std::string confdb_
SiStripPartitions partitions_
void SiStripDbParams::pset ( const edm::ParameterSet cfg)

Definition at line 163 of file SiStripDbParams.cc.

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

Referenced by SiStripConfigDb::SiStripConfigDb().

163  {
164 
165  // "Common" configurables
166  usingDb_ = cfg.getUntrackedParameter<bool>( "UsingDb", false );
167  usingDbCache_ = cfg.getUntrackedParameter<bool>( "UsingDbCache", false );
168  sharedMemory_ = cfg.getUntrackedParameter<std::string>( "SharedMemory", "" );
169  tnsAdmin_ = cfg.getUntrackedParameter<std::string>( "TNS_ADMIN", "" );
170  confdb( cfg.getUntrackedParameter<std::string>( "ConfDb", "") );
171 
172  // Check if top-level PSet (containing partition-level Psets) exists
173  std::string partitions = "Partitions";
174  std::vector<std::string> str = cfg.getParameterNamesForType<edm::ParameterSet>(false);
175  std::vector<std::string>::const_iterator istr = std::find( str.begin(), str.end(), partitions );
176  if ( istr != str.end() ) {
177 
178  // Retrieve top-level PSet containing partition-level Psets
180 
181  // Extract names of partition-level PSets
182  std::vector<std::string> names = psets.getParameterNamesForType<edm::ParameterSet>(false);
183 
184  // Iterator through PSets names, retrieve PSet for each partition and extract info
185  std::vector<std::string>::iterator iname = names.begin();
186  std::vector<std::string>::iterator jname = names.end();
187  for ( ; iname != jname; ++iname ) {
190  tmp.pset( pset );
191  addPartition( tmp );
192  }
193 
194  }
195 
196  // Ensure at least one "default" partition
197  if ( partitions_.empty() ) { addPartition( SiStripPartition() ); }
198 
199  // Set output XML files
200  outputModuleXml_ = cfg.getUntrackedParameter<std::string>( "OutputModuleXml", "/tmp/module.xml" );
201  outputDcuInfoXml_ = cfg.getUntrackedParameter<std::string>( "OutputDcuInfoXml", "/tmp/dcuinfo.xml" );
202  outputFecXml_ = cfg.getUntrackedParameter<std::string>( "OutputFecXml", "/tmp/fec.xml" );
203  outputFedXml_ = cfg.getUntrackedParameter<std::string>( "OutputFedXml", "/tmp/fed.xml" );
204 
205 }
T getUntrackedParameter(std::string const &, T const &) const
std::string tnsAdmin_
static const HistoName names[]
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::string outputDcuInfoXml_
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:194
const_iterator_range partitions() const
std::string outputFecXml_
void pset(const edm::ParameterSet &)
std::string outputModuleXml_
std::string outputFedXml_
Container class for database partition parameters.
std::string sharedMemory_
std::string confdb() const
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
void pset(const edm::ParameterSet &)
volatile std::atomic< bool > shutdown_flag false
void addPartition(const SiStripPartition &)
SiStripPartitions partitions_
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().

107  {
108  usingDb_ = false;
109  confdb_ = null_;
110  user_ = null_;
111  passwd_ = null_;
112  path_ = null_;
113  usingDbCache_ = false;
114  sharedMemory_ = "";
115  tnsAdmin_ = "";
116  partitions_.clear();
117  confdb( confdb_ );
118  outputModuleXml_ = "/tmp/module.xml";
119  outputDcuInfoXml_ = "/tmp/dcuinfo.xml";
120  outputFecXml_ = "/tmp/fec.xml";
121  outputFedXml_ = "/tmp/fed.xml";
122 }
std::string tnsAdmin_
std::string outputDcuInfoXml_
std::string outputFecXml_
std::string outputModuleXml_
std::string user_
std::string outputFedXml_
std::string passwd_
std::string sharedMemory_
std::string path_
std::string confdb() const
std::string confdb_
SiStripPartitions partitions_
static const char null_[]
Definition: Constants.h:22
std::string SiStripDbParams::sharedMemory ( ) const
inline

Definition at line 182 of file SiStripDbParams.h.

References sharedMemory_.

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

182 { return sharedMemory_; }
std::string sharedMemory_
void SiStripDbParams::sharedMemory ( std::string  name)
inline
std::string SiStripDbParams::tnsAdmin ( ) const
inline

Definition at line 183 of file SiStripDbParams.h.

References tnsAdmin_.

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

183 { return tnsAdmin_; }
std::string tnsAdmin_
std::string SiStripDbParams::user ( ) const
inline

Definition at line 178 of file SiStripDbParams.h.

References user_.

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

178 { return user_; }
std::string user_
bool SiStripDbParams::usingDb ( ) const
inline
void SiStripDbParams::usingDb ( bool  using_db)
inline

Definition at line 198 of file SiStripDbParams.h.

References usingDb_.

198 { usingDb_ = using_db; }
bool SiStripDbParams::usingDbCache ( ) const
inline
void SiStripDbParams::usingDbCache ( bool  using_cache)
inline

Definition at line 199 of file SiStripDbParams.h.

References usingDbCache_.

199 { usingDbCache_ = using_cache; }

Member Data Documentation

std::string SiStripDbParams::confdb_
private

Definition at line 148 of file SiStripDbParams.h.

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

std::string SiStripDbParams::outputDcuInfoXml_
private

Definition at line 166 of file SiStripDbParams.h.

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

std::string SiStripDbParams::outputFecXml_
private

Definition at line 168 of file SiStripDbParams.h.

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

std::string SiStripDbParams::outputFedXml_
private

Definition at line 170 of file SiStripDbParams.h.

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

std::string SiStripDbParams::outputModuleXml_
private

Definition at line 164 of file SiStripDbParams.h.

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

SiStripPartitions SiStripDbParams::partitions_
private
std::string SiStripDbParams::passwd_
private

Definition at line 152 of file SiStripDbParams.h.

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

std::string SiStripDbParams::path_
private
std::string SiStripDbParams::sharedMemory_
private

Definition at line 158 of file SiStripDbParams.h.

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

std::string SiStripDbParams::tnsAdmin_
private

Definition at line 160 of file SiStripDbParams.h.

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

std::string SiStripDbParams::user_
private

Definition at line 150 of file SiStripDbParams.h.

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

bool SiStripDbParams::usingDb_
private

Definition at line 146 of file SiStripDbParams.h.

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

bool SiStripDbParams::usingDbCache_
private

Definition at line 156 of file SiStripDbParams.h.

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