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 27 of file SiStripDbParams.h.

Member Typedef Documentation

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

Definition at line 51 of file SiStripDbParams.h.

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

Definition at line 53 of file SiStripDbParams.h.

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

Definition at line 47 of file SiStripDbParams.h.

typedef SiStripPartitions::size_type SiStripDbParams::size_type

Definition at line 49 of file SiStripDbParams.h.

Constructor & Destructor Documentation

SiStripDbParams::SiStripDbParams ( )

Definition at line 12 of file SiStripDbParams.cc.

12  :
13  usingDb_(false),
14  confdb_(null_),
15  user_(null_),
16  passwd_(null_),
17  path_(null_),
18  usingDbCache_(false),
19  sharedMemory_(""),
20  tnsAdmin_(""),
21  partitions_(),
22  outputModuleXml_("/tmp/module.xml"),
23  outputDcuInfoXml_("/tmp/dcuinfo.xml"),
24  outputFecXml_("/tmp/fec.xml"),
25  outputFedXml_("/tmp/fed.xml")
26 {;}
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:23
SiStripDbParams::SiStripDbParams ( const SiStripDbParams input)

Definition at line 30 of file SiStripDbParams.cc.

30  :
31  usingDb_( input.usingDb() ),
32  confdb_( input.confdb() ),
33  user_( input.user() ),
34  passwd_( input.passwd() ),
35  path_( input.path() ),
36  usingDbCache_( input.usingDbCache() ),
37  sharedMemory_( input.sharedMemory() ),
38  tnsAdmin_( input.tnsAdmin() ),
39  partitions_( input.partitions().begin(), input.partitions().end() ),
42  outputFecXml_( input.outputFecXml() ),
43  outputFedXml_( input.outputFedXml() )
44 {;}
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 102 of file SiStripDbParams.cc.

References reset().

102  {
103  reset();
104 }

Member Function Documentation

void SiStripDbParams::addPartition ( const SiStripPartition in)

Definition at line 127 of file SiStripDbParams.cc.

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

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

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

Definition at line 198 of file SiStripDbParams.h.

References partitions_.

Referenced by SiStripConfigDb::usingDatabase().

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

Definition at line 178 of file SiStripDbParams.h.

References confdb_.

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

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

Definition at line 210 of file SiStripDbParams.cc.

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

210  {
211  confdb_ = confdb;
212  size_t ipass = confdb.find("/");
213  size_t ipath = confdb.find("@");
214  if ( ipass != std::string::npos &&
215  ipath != std::string::npos ) {
216  user_ = confdb.substr(0,ipass);
217  passwd_ = confdb.substr(ipass+1,ipath-ipass-1);
218  path_ = confdb.substr(ipath+1,confdb.size());
219  } else {
220  user_ = null_;
221  passwd_ = null_;
222  path_ = null_;
223  }
224 }
std::string user_
std::string passwd_
std::string path_
std::string confdb() const
std::string confdb_
static const char null_[]
Definition: Constants.h:23
void SiStripDbParams::confdb ( const std::string &  user,
const std::string &  passwd,
const std::string &  path 
)

Definition at line 228 of file SiStripDbParams.cc.

References confdb_, sistrip::null_, passwd(), passwd_, path(), path_, user(), and user_.

230  {
231  if ( user != "" && passwd != "" && path != "" &&
232  user != null_ && passwd != null_ && path != null_ ) {
233  user_ = user;
234  passwd_ = passwd;
235  path_ = path;
236  } else {
237  user_ = null_;
238  passwd_ = null_;
239  path_ = null_;
240  }
241  confdb_ = user_ + "/" + passwd_ + "@" + path_;
242 }
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:23
std::vector< std::string > SiStripDbParams::inputDcuInfoXmlFiles ( ) const

Definition at line 375 of file SiStripDbParams.cc.

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

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

Definition at line 385 of file SiStripDbParams.cc.

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

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

Definition at line 395 of file SiStripDbParams.cc.

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

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

Definition at line 365 of file SiStripDbParams.cc.

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

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

Definition at line 96 of file SiStripDbParams.cc.

References LaserDQM_cfg::input.

96  {
97  return !( *this == input );
98 }
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_.

48  {
49  usingDb_ = input.usingDb();
50  confdb_ = input.confdb();
51  user_ = input.user();
52  passwd_ = input.passwd();
53  path_ = input.path();
54  confdb( confdb_ );
55  usingDbCache_ = input.usingDbCache();
56  sharedMemory_ = input.sharedMemory();
57  tnsAdmin_ = input.tnsAdmin();
58  partitions_.clear();
59  partitions_ = SiStripPartitions( input.partitions().begin(), input.partitions().end() );
62  outputFecXml_ = input.outputFecXml();
63  outputFedXml_ = input.outputFedXml();
64  return *this;
65 }
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 69 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_.

69  {
70  if ( !( usingDb_ == input.usingDb() &&
71  confdb_ == input.confdb() &&
72  user_ == input.user() &&
73  passwd_ == input.passwd() &&
74  path_ == input.path() &&
75  usingDbCache_ == input.usingDbCache() &&
76  sharedMemory_ == input.sharedMemory() &&
77  tnsAdmin_ == input.tnsAdmin() &&
78  outputModuleXml_ == input.outputModuleXml() &&
80  outputFecXml_ == input.outputFecXml() &&
81  outputFedXml_ == input.outputFedXml() ) ) { return false; }
82  if ( partitionsSize() != input.partitionsSize() ) { return false; }
83 // SiStripPartitions::const_iterator ii = input.partitions().begin();
84 // SiStripPartitions::const_iterator jj = input.partitions().end();
85 // SiStripPartitions::const_iterator iter = partitions_.begin();
86 // for ( ; ii != jj; ++ii ) {
87 // if ( ii->first != iter->first || ii->second != iter->second ) { return false; }
88 // iter++;
89 // }
90 // return true;
91  return partitions_ == input.partitions_;
92 }
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 194 of file SiStripDbParams.h.

References outputDcuInfoXml_.

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

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

Definition at line 195 of file SiStripDbParams.h.

References outputFecXml_.

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

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

Definition at line 196 of file SiStripDbParams.h.

References outputFedXml_.

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

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

Definition at line 193 of file SiStripDbParams.h.

References outputModuleXml_.

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

193 { 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 246 of file SiStripDbParams.cc.

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

Referenced by SiStripConfigDb::runs().

246  {
247  SiStripDbParams::SiStripPartitions::const_iterator ii = partitions().begin();
248  SiStripDbParams::SiStripPartitions::const_iterator jj = partitions().end();
249  for ( ; ii != jj; ++ii ) { if ( partition_name == ii->second.partitionName() ) { return ii; } }
250  return partitions().end();
251 }
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 255 of file SiStripDbParams.cc.

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

255  {
256  SiStripDbParams::SiStripPartitions::iterator ii = partitions().begin();
257  SiStripDbParams::SiStripPartitions::iterator jj = partitions().end();
258  for ( ; ii != jj; ++ii ) { if ( partition_name == ii->second.partitionName() ) { return ii; } }
259  return partitions().end();
260 }
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 264 of file SiStripDbParams.cc.

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

Referenced by SiStripConfigDb::usingDatabase().

264  {
265  std::vector<std::string> partitions;
266  SiStripPartitions::const_iterator ii = partitions_.begin();
267  SiStripPartitions::const_iterator jj = partitions_.end();
268  for ( ; ii != jj; ++ii ) {
269  if ( std::find( partitions.begin(),
270  partitions.end(),
271  ii->second.partitionName() ) == partitions.end() ) {
272  if ( !ii->second.partitionName().empty() ) { partitions.push_back( ii->second.partitionName() ); }
273  } else {
275  << "[SiStripConfigDb::" << __func__ << "]"
276  << " Partition " << ii->second.partitionName()
277  << " already found! Not adding to vector...";
278  }
279  }
280  return partitions;
281 }
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 285 of file SiStripDbParams.cc.

References partitions(), and AlCaHLTBitMon_QueryRunRegistry::string.

285  {
286  std::istringstream ss(input);
287  std::vector<std::string> partitions;
288  std::string delimiter = ":";
289  std::string token;
290  while ( getline( ss, token, ':' ) ) { if ( !token.empty() ) { partitions.push_back(token); } }
291  return partitions;
292 }
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 296 of file SiStripDbParams.cc.

References first, cuy::ii, and findQualityFiles::jj.

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

Returns pair of iterators to partitions objects.

Definition at line 188 of file SiStripDbParams.h.

References partitions_.

188  { return iterator_range( partitions_.begin(),
189  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 191 of file SiStripDbParams.h.

References partitions_.

Referenced by operator==().

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

Definition at line 180 of file SiStripDbParams.h.

References passwd_.

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

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

Definition at line 181 of file SiStripDbParams.h.

References path_.

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

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

Definition at line 312 of file SiStripDbParams.cc.

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

Referenced by operator<<().

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

References addPartition(), confdb(), funct::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().

164  {
165 
166  // "Common" configurables
167  usingDb_ = cfg.getUntrackedParameter<bool>( "UsingDb", false );
168  usingDbCache_ = cfg.getUntrackedParameter<bool>( "UsingDbCache", false );
169  sharedMemory_ = cfg.getUntrackedParameter<std::string>( "SharedMemory", "" );
170  tnsAdmin_ = cfg.getUntrackedParameter<std::string>( "TNS_ADMIN", "" );
171  confdb( cfg.getUntrackedParameter<std::string>( "ConfDb", "") );
172 
173  // Check if top-level PSet (containing partition-level Psets) exists
174  std::string partitions = "Partitions";
175  std::vector<std::string> str = cfg.getParameterNamesForType<edm::ParameterSet>(false);
176  std::vector<std::string>::const_iterator istr = std::find( str.begin(), str.end(), partitions );
177  if ( istr != str.end() ) {
178 
179  // Retrieve top-level PSet containing partition-level Psets
181 
182  // Extract names of partition-level PSets
183  std::vector<std::string> names = psets.getParameterNamesForType<edm::ParameterSet>(false);
184 
185  // Iterator through PSets names, retrieve PSet for each partition and extract info
186  std::vector<std::string>::iterator iname = names.begin();
187  std::vector<std::string>::iterator jname = names.end();
188  for ( ; iname != jname; ++iname ) {
191  tmp.pset( pset );
192  addPartition( tmp );
193  }
194 
195  }
196 
197  // Ensure at least one "default" partition
198  if ( partitions_.empty() ) { addPartition( SiStripPartition() ); }
199 
200  // Set output XML files
201  outputModuleXml_ = cfg.getUntrackedParameter<std::string>( "OutputModuleXml", "/tmp/module.xml" );
202  outputDcuInfoXml_ = cfg.getUntrackedParameter<std::string>( "OutputDcuInfoXml", "/tmp/dcuinfo.xml" );
203  outputFecXml_ = cfg.getUntrackedParameter<std::string>( "OutputFecXml", "/tmp/fec.xml" );
204  outputFedXml_ = cfg.getUntrackedParameter<std::string>( "OutputFedXml", "/tmp/fed.xml" );
205 
206 }
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:195
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 &)
void addPartition(const SiStripPartition &)
SiStripPartitions partitions_
void SiStripDbParams::reset ( void  )

Definition at line 108 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().

108  {
109  usingDb_ = false;
110  confdb_ = null_;
111  user_ = null_;
112  passwd_ = null_;
113  path_ = null_;
114  usingDbCache_ = false;
115  sharedMemory_ = "";
116  tnsAdmin_ = "";
117  partitions_.clear();
118  confdb( confdb_ );
119  outputModuleXml_ = "/tmp/module.xml";
120  outputDcuInfoXml_ = "/tmp/dcuinfo.xml";
121  outputFecXml_ = "/tmp/fec.xml";
122  outputFedXml_ = "/tmp/fed.xml";
123 }
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:23
std::string SiStripDbParams::sharedMemory ( ) const
inline

Definition at line 183 of file SiStripDbParams.h.

References sharedMemory_.

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

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

Definition at line 184 of file SiStripDbParams.h.

References tnsAdmin_.

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

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

Definition at line 179 of file SiStripDbParams.h.

References user_.

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

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

Definition at line 199 of file SiStripDbParams.h.

References usingDb_.

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

Definition at line 200 of file SiStripDbParams.h.

References usingDbCache_.

200 { usingDbCache_ = using_cache; }

Member Data Documentation

std::string SiStripDbParams::confdb_
private

Definition at line 149 of file SiStripDbParams.h.

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

std::string SiStripDbParams::outputDcuInfoXml_
private

Definition at line 167 of file SiStripDbParams.h.

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

std::string SiStripDbParams::outputFecXml_
private

Definition at line 169 of file SiStripDbParams.h.

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

std::string SiStripDbParams::outputFedXml_
private

Definition at line 171 of file SiStripDbParams.h.

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

std::string SiStripDbParams::outputModuleXml_
private

Definition at line 165 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 153 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 159 of file SiStripDbParams.h.

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

std::string SiStripDbParams::tnsAdmin_
private

Definition at line 161 of file SiStripDbParams.h.

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

std::string SiStripDbParams::user_
private

Definition at line 151 of file SiStripDbParams.h.

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

bool SiStripDbParams::usingDb_
private

Definition at line 147 of file SiStripDbParams.h.

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

bool SiStripDbParams::usingDbCache_
private

Definition at line 157 of file SiStripDbParams.h.

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