CMS 3D CMS Logo

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, SiStripPartitionSiStripPartitions
 
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 25 of file SiStripDbParams.h.

Member Typedef Documentation

◆ const_iterator_range

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

Definition at line 47 of file SiStripDbParams.h.

◆ iterator_range

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

Definition at line 49 of file SiStripDbParams.h.

◆ SiStripPartitions

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

Definition at line 43 of file SiStripDbParams.h.

◆ size_type

typedef SiStripPartitions::size_type SiStripDbParams::size_type

Definition at line 45 of file SiStripDbParams.h.

Constructor & Destructor Documentation

◆ SiStripDbParams() [1/2]

SiStripDbParams::SiStripDbParams ( )

Definition at line 11 of file SiStripDbParams.cc.

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  ;
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:22

◆ SiStripDbParams() [2/2]

SiStripDbParams::SiStripDbParams ( const SiStripDbParams input)

Definition at line 30 of file SiStripDbParams.cc.

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()),
40  outputModuleXml_(input.outputModuleXml()),
41  outputDcuInfoXml_(input.outputDcuInfoXml()),
42  outputFecXml_(input.outputFecXml()),
43  outputFedXml_(input.outputFedXml()) {
44  ;
45 }
std::string tnsAdmin_
std::string outputDcuInfoXml_
static std::string const input
Definition: EdmProvDump.cc:50
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_

◆ ~SiStripDbParams()

SiStripDbParams::~SiStripDbParams ( )

Definition at line 98 of file SiStripDbParams.cc.

References reset().

98 { reset(); }

Member Function Documentation

◆ addPartition()

void SiStripDbParams::addPartition ( const SiStripPartition in)

Definition at line 121 of file SiStripDbParams.cc.

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

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

121  {
122  if (in.partitionName().empty()) {
123  std::stringstream ss;
124  ss << "[SiStripDbParams::" << __func__ << "]"
125  << " Attempting to add partition with null name!";
126  //edm::LogWarning(mlConfigDb_) << ss.str();
127  }
128 
129  SiStripPartitions::const_iterator iter = partitions_.find(in.partitionName());
130  if (iter == partitions_.end()) {
131  partitions_[in.partitionName()] = in;
132  if (in.partitionName() != SiStripPartition::defaultPartitionName_) {
133  std::stringstream ss;
134  ss << "[SiStripDbParams::" << __func__ << "]"
135  << " Added new partition with name \"" << in.partitionName() << "\"";
136  //ss << std::endl << partitions_[in.partitionName()];
137  ss << " (Currently have " << partitions_.size() << " partitions in cache...)";
138  LogTrace(mlConfigDb_) << ss.str();
139  }
140  } else {
141  std::stringstream ss;
142  ss << "[SiStripDbParams::" << __func__ << "]"
143  << " Partition with name \"" << in.partitionName() << "\" already found!"
144  << " Not adding to cache...";
145  edm::LogWarning(mlConfigDb_) << ss.str();
146  }
147 }
static const std::string defaultPartitionName_
#define LogTrace(id)
static const char mlConfigDb_[]
Log< level::Warning, false > LogWarning
SiStripPartitions partitions_

◆ clearPartitions()

void SiStripDbParams::clearPartitions ( )
inline

Definition at line 192 of file SiStripDbParams.h.

References partitions_.

Referenced by SiStripConfigDb::usingDatabase().

192 { partitions_.clear(); }
SiStripPartitions partitions_

◆ confdb() [1/3]

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

Definition at line 170 of file SiStripDbParams.h.

References confdb_.

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

170 { return confdb_; }
std::string confdb_

◆ confdb() [2/3]

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

Definition at line 195 of file SiStripDbParams.cc.

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

195  {
196  confdb_ = confdb;
197  size_t ipass = confdb.find('/');
198  size_t ipath = confdb.find('@');
199  if (ipass != std::string::npos && ipath != std::string::npos) {
200  user_ = confdb.substr(0, ipass);
201  passwd_ = confdb.substr(ipass + 1, ipath - ipass - 1);
202  path_ = confdb.substr(ipath + 1, confdb.size());
203  } else {
204  user_ = null_;
205  passwd_ = null_;
206  path_ = null_;
207  }
208 }
Definition: confdb.py:1
std::string user_
std::string passwd_
std::string path_
std::string confdb() const
std::string confdb_
static const char null_[]
Definition: Constants.h:22

◆ confdb() [3/3]

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

Definition at line 212 of file SiStripDbParams.cc.

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

212  {
213  if (!user.empty() && !passwd.empty() && !path.empty() && user != null_ && passwd != null_ && path != null_) {
214  user_ = user;
215  passwd_ = passwd;
216  path_ = path;
217  } else {
218  user_ = null_;
219  passwd_ = null_;
220  path_ = null_;
221  }
222  confdb_ = user_ + "/" + passwd_ + "@" + path_;
223 }
std::string path() const
std::string passwd() const
std::string user() const
std::string user_
std::string passwd_
std::string path_
std::string confdb_
static const char null_[]
Definition: Constants.h:22

◆ inputDcuInfoXmlFiles()

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

Definition at line 368 of file SiStripDbParams.cc.

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

368  {
369  std::vector<std::string> files;
370  SiStripPartitions::const_iterator ii = partitions_.begin();
371  SiStripPartitions::const_iterator jj = partitions_.end();
372  for (; ii != jj; ++ii) {
373  files.insert(files.end(), ii->second.inputDcuInfoXml());
374  }
375  return files;
376 }
ii
Definition: cuy.py:589
SiStripPartitions partitions_

◆ inputFecXmlFiles()

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

Definition at line 380 of file SiStripDbParams.cc.

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

380  {
381  std::vector<std::string> files;
382  SiStripPartitions::const_iterator ii = partitions_.begin();
383  SiStripPartitions::const_iterator jj = partitions_.end();
384  for (; ii != jj; ++ii) {
385  files.insert(files.end(), ii->second.inputFecXml().begin(), ii->second.inputFecXml().end());
386  }
387  return files;
388 }
ii
Definition: cuy.py:589
SiStripPartitions partitions_

◆ inputFedXmlFiles()

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

Definition at line 392 of file SiStripDbParams.cc.

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

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

◆ inputModuleXmlFiles()

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

Definition at line 356 of file SiStripDbParams.cc.

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

356  {
357  std::vector<std::string> files;
358  SiStripPartitions::const_iterator ii = partitions_.begin();
359  SiStripPartitions::const_iterator jj = partitions_.end();
360  for (; ii != jj; ++ii) {
361  files.insert(files.end(), ii->second.inputModuleXml());
362  }
363  return files;
364 }
ii
Definition: cuy.py:589
SiStripPartitions partitions_

◆ operator!=()

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

Definition at line 94 of file SiStripDbParams.cc.

References input.

94 { return !(*this == input); }
static std::string const input
Definition: EdmProvDump.cc:50

◆ operator=()

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

Definition at line 49 of file SiStripDbParams.cc.

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

49  {
50  usingDb_ = input.usingDb();
51  confdb_ = input.confdb();
52  user_ = input.user();
53  passwd_ = input.passwd();
54  path_ = input.path();
55  confdb(confdb_);
56  usingDbCache_ = input.usingDbCache();
57  sharedMemory_ = input.sharedMemory();
58  tnsAdmin_ = input.tnsAdmin();
59  partitions_.clear();
60  partitions_ = SiStripPartitions(input.partitions().begin(), input.partitions().end());
61  outputModuleXml_ = input.outputModuleXml();
62  outputDcuInfoXml_ = input.outputDcuInfoXml();
63  outputFecXml_ = input.outputFecXml();
64  outputFedXml_ = input.outputFedXml();
65  return *this;
66 }
std::string tnsAdmin_
std::map< std::string, SiStripPartition > SiStripPartitions
std::string outputDcuInfoXml_
static std::string const input
Definition: EdmProvDump.cc:50
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_

◆ operator==()

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

Definition at line 70 of file SiStripDbParams.cc.

References confdb_, input, outputDcuInfoXml_, outputFecXml_, outputFedXml_, outputModuleXml_, partitions_, partitionsSize(), passwd_, path_, sharedMemory_, tnsAdmin_, user_, usingDb_, and usingDbCache_.

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

◆ outputDcuInfoXml()

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

Definition at line 188 of file SiStripDbParams.h.

References outputDcuInfoXml_.

Referenced by SiStripConfigDb::usingXmlFiles().

188 { return outputDcuInfoXml_; }
std::string outputDcuInfoXml_

◆ outputFecXml()

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

Definition at line 189 of file SiStripDbParams.h.

References outputFecXml_.

Referenced by SiStripConfigDb::usingXmlFiles().

189 { return outputFecXml_; }
std::string outputFecXml_

◆ outputFedXml()

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

Definition at line 190 of file SiStripDbParams.h.

References outputFedXml_.

Referenced by SiStripConfigDb::usingXmlFiles().

190 { return outputFedXml_; }
std::string outputFedXml_

◆ outputModuleXml()

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

Definition at line 187 of file SiStripDbParams.h.

References outputModuleXml_.

Referenced by SiStripConfigDb::usingXmlFiles().

187 { return outputModuleXml_; }
std::string outputModuleXml_

◆ partition() [1/2]

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

Returns const iterator to partition object.

Definition at line 227 of file SiStripDbParams.cc.

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

Referenced by SiStripConfigDb::runs().

227  {
228  SiStripDbParams::SiStripPartitions::const_iterator ii = partitions().begin();
229  SiStripDbParams::SiStripPartitions::const_iterator jj = partitions().end();
230  for (; ii != jj; ++ii) {
231  if (partition_name == ii->second.partitionName()) {
232  return ii;
233  }
234  }
235  return partitions().end();
236 }
const_iterator_range partitions() const
ii
Definition: cuy.py:589

◆ partition() [2/2]

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

Returns iterator to partition object.

Definition at line 240 of file SiStripDbParams.cc.

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

240  {
241  SiStripDbParams::SiStripPartitions::iterator ii = partitions().begin();
242  SiStripDbParams::SiStripPartitions::iterator jj = partitions().end();
243  for (; ii != jj; ++ii) {
244  if (partition_name == ii->second.partitionName()) {
245  return ii;
246  }
247  }
248  return partitions().end();
249 }
const_iterator_range partitions() const
ii
Definition: cuy.py:589

◆ partitionNames() [1/3]

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

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

Definition at line 253 of file SiStripDbParams.cc.

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

Referenced by SiStripConfigDb::usingDatabase().

253  {
254  std::vector<std::string> partitions;
255  SiStripPartitions::const_iterator ii = partitions_.begin();
256  SiStripPartitions::const_iterator jj = partitions_.end();
257  for (; ii != jj; ++ii) {
258  if (std::find(partitions.begin(), partitions.end(), ii->second.partitionName()) == partitions.end()) {
259  if (!ii->second.partitionName().empty()) {
260  partitions.push_back(ii->second.partitionName());
261  }
262  } else {
263  edm::LogWarning(mlConfigDb_) << "[SiStripConfigDb::" << __func__ << "]"
264  << " Partition " << ii->second.partitionName()
265  << " already found! Not adding to vector...";
266  }
267  }
268  return partitions;
269 }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
const_iterator_range partitions() const
static const char mlConfigDb_[]
ii
Definition: cuy.py:589
Log< level::Warning, false > LogWarning
SiStripPartitions partitions_

◆ partitionNames() [2/3]

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

Extract (non-zero) partition names from string.

Definition at line 273 of file SiStripDbParams.cc.

References makeHLTPrescaleTable::delimiter, input, partitions(), contentValuesCheck::ss, AlCaHLTBitMon_QueryRunRegistry::string, and unpackBuffers-CaloStage2::token.

273  {
274  std::istringstream ss(input);
275  std::vector<std::string> partitions;
276  std::string delimiter = ":";
278  while (getline(ss, token, ':')) {
279  if (!token.empty()) {
280  partitions.push_back(token);
281  }
282  }
283  return partitions;
284 }
const_iterator_range partitions() const
static std::string const input
Definition: EdmProvDump.cc:50

◆ partitionNames() [3/3]

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

Construct string from (non-zero) partition names.

Definition at line 288 of file SiStripDbParams.cc.

References dqmdumpme::first, cuy::ii, findQualityFiles::jj, partitions(), and contentValuesCheck::ss.

288  {
289  std::stringstream ss;
290  std::vector<std::string>::const_iterator ii = partitions.begin();
291  std::vector<std::string>::const_iterator jj = partitions.end();
292  bool first = true;
293  for (; ii != jj; ++ii) {
294  if (!ii->empty()) {
295  first ? ss << *ii : ss << ":" << *ii;
296  first = false;
297  }
298  }
299  return ss.str();
300 }
const_iterator_range partitions() const
ii
Definition: cuy.py:589

◆ partitions() [1/2]

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

◆ partitions() [2/2]

SiStripDbParams::iterator_range SiStripDbParams::partitions ( )
inline

Returns pair of iterators to partitions objects.

Definition at line 181 of file SiStripDbParams.h.

References partitions_.

181  {
182  return iterator_range(partitions_.begin(), partitions_.end());
183 }
boost::iterator_range< SiStripPartitions::iterator > iterator_range
SiStripPartitions partitions_

◆ partitionsSize()

SiStripDbParams::size_type SiStripDbParams::partitionsSize ( ) const
inline

Return the number of partitions.

Definition at line 185 of file SiStripDbParams.h.

References partitions_.

Referenced by operator==().

185 { return partitions_.size(); }
SiStripPartitions partitions_

◆ passwd()

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

Definition at line 172 of file SiStripDbParams.h.

References passwd_.

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

172 { return passwd_; }
std::string passwd_

◆ path()

std::string SiStripDbParams::path ( ) const
inline

Definition at line 173 of file SiStripDbParams.h.

References path_.

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

173 { return path_; }
std::string path_

◆ print()

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

Definition at line 304 of file SiStripDbParams.cc.

References cuy::ii, findQualityFiles::jj, outputDcuInfoXml_, outputFecXml_, outputFedXml_, outputModuleXml_, partitions_, path_, sharedMemory_, contentValuesCheck::ss, user_, usingDb_, and usingDbCache_.

304  {
305  ss << " Using database account : " << std::boolalpha << usingDb_ << std::noboolalpha << std::endl;
306  ss << " Using XML files : " << std::boolalpha << !usingDb_ << std::noboolalpha << std::endl;
307  ss << " Using database cache : " << std::boolalpha << usingDbCache_ << std::noboolalpha << std::endl;
308  if (usingDbCache_) {
309  ss << " Shared memory name : " << std::boolalpha << sharedMemory_ << std::noboolalpha << std::endl;
310  }
311 
312  if (!usingDbCache_) {
313  if (usingDb_) {
314  ss << " Database account (ConfDb) : " << user_ + "/******@" + path_ << std::endl;
315  }
316 
317  ss << " Number of partitions : " << partitions_.size();
318  if (partitions_.empty()) {
319  if (!usingDbCache_) {
320  ss << " (Empty!)";
321  } else {
322  ss << " (Using database cache!)";
323  }
324  }
325  ss << std::endl;
326 
327  uint16_t cntr = 0;
328  SiStripPartitions::const_iterator ii = partitions_.begin();
329  SiStripPartitions::const_iterator jj = partitions_.end();
330  for (; ii != jj; ++ii) {
331  cntr++;
332  ss << " Partition #" << cntr << " (out of " << partitions_.size() << "):" << std::endl;
333  ii->second.print(ss, usingDb_);
334  }
335 
336  if (!usingDb_) {
337  ss << " Output \"module.xml\" file : " << outputModuleXml_ << std::endl
338  << " Output \"dcuinfo.xml\" file : " << outputDcuInfoXml_ << std::endl
339  << " Output \"fec.xml\" file(s) : " << outputFecXml_ << std::endl
340  << " Output \"fed.xml\" file(s) : " << outputFedXml_ << std::endl;
341  }
342  }
343 }
std::string outputDcuInfoXml_
std::string outputFecXml_
std::string outputModuleXml_
std::string user_
std::string outputFedXml_
std::string sharedMemory_
std::string path_
ii
Definition: cuy.py:589
SiStripPartitions partitions_

◆ pset()

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

Definition at line 151 of file SiStripDbParams.cc.

References addPartition(), looper::cfg, confdb(), spr::find(), edm::ParameterSet::getParameterNamesForType(), edm::ParameterSet::getUntrackedParameter(), names, outputDcuInfoXml_, outputFecXml_, outputFedXml_, outputModuleXml_, partitions(), partitions_, sharedMemory_, str, AlCaHLTBitMon_QueryRunRegistry::string, createJobs::tmp, tnsAdmin_, usingDb_, and usingDbCache_.

Referenced by SiStripConfigDb::SiStripConfigDb().

151  {
152  // "Common" configurables
153  usingDb_ = cfg.getUntrackedParameter<bool>("UsingDb", false);
154  usingDbCache_ = cfg.getUntrackedParameter<bool>("UsingDbCache", false);
155  sharedMemory_ = cfg.getUntrackedParameter<std::string>("SharedMemory", "");
156  tnsAdmin_ = cfg.getUntrackedParameter<std::string>("TNS_ADMIN", "");
157  confdb(cfg.getUntrackedParameter<std::string>("ConfDb", ""));
158 
159  // Check if top-level PSet (containing partition-level Psets) exists
160  std::string partitions = "Partitions";
161  std::vector<std::string> str = cfg.getParameterNamesForType<edm::ParameterSet>(false);
162  std::vector<std::string>::const_iterator istr = std::find(str.begin(), str.end(), partitions);
163  if (istr != str.end()) {
164  // Retrieve top-level PSet containing partition-level Psets
165  edm::ParameterSet psets = cfg.getUntrackedParameter<edm::ParameterSet>(partitions);
166 
167  // Extract names of partition-level PSets
168  std::vector<std::string> names = psets.getParameterNamesForType<edm::ParameterSet>(false);
169 
170  // Iterator through PSets names, retrieve PSet for each partition and extract info
171  std::vector<std::string>::iterator iname = names.begin();
172  std::vector<std::string>::iterator jname = names.end();
173  for (; iname != jname; ++iname) {
176  tmp.pset(pset);
177  addPartition(tmp);
178  }
179  }
180 
181  // Ensure at least one "default" partition
182  if (partitions_.empty()) {
184  }
185 
186  // Set output XML files
187  outputModuleXml_ = cfg.getUntrackedParameter<std::string>("OutputModuleXml", "/tmp/module.xml");
188  outputDcuInfoXml_ = cfg.getUntrackedParameter<std::string>("OutputDcuInfoXml", "/tmp/dcuinfo.xml");
189  outputFecXml_ = cfg.getUntrackedParameter<std::string>("OutputFecXml", "/tmp/fec.xml");
190  outputFedXml_ = cfg.getUntrackedParameter<std::string>("OutputFedXml", "/tmp/fed.xml");
191 }
std::string tnsAdmin_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
const_iterator_range partitions() const
const std::string names[nVars_]
std::string outputDcuInfoXml_
T getUntrackedParameter(std::string const &, T const &) const
std::string outputFecXml_
std::string outputModuleXml_
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:180
std::string outputFedXml_
Container class for database partition parameters.
std::string sharedMemory_
std::string confdb() const
void pset(const edm::ParameterSet &)
void addPartition(const SiStripPartition &)
#define str(s)
tmp
align.sh
Definition: createJobs.py:716
SiStripPartitions partitions_

◆ reset()

void SiStripDbParams::reset ( void  )

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

102  {
103  usingDb_ = false;
104  confdb_ = null_;
105  user_ = null_;
106  passwd_ = null_;
107  path_ = null_;
108  usingDbCache_ = false;
109  sharedMemory_ = "";
110  tnsAdmin_ = "";
111  partitions_.clear();
112  confdb(confdb_);
113  outputModuleXml_ = "/tmp/module.xml";
114  outputDcuInfoXml_ = "/tmp/dcuinfo.xml";
115  outputFecXml_ = "/tmp/fec.xml";
116  outputFedXml_ = "/tmp/fed.xml";
117 }
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

◆ sharedMemory() [1/2]

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

Definition at line 175 of file SiStripDbParams.h.

References sharedMemory_.

Referenced by SiStripConfigDb::usingDatabaseCache().

175 { return sharedMemory_; }
std::string sharedMemory_

◆ sharedMemory() [2/2]

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

Definition at line 195 of file SiStripDbParams.h.

References Skims_PA_cff::name, and sharedMemory_.

195 { sharedMemory_ = name; }
std::string sharedMemory_

◆ tnsAdmin()

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

Definition at line 176 of file SiStripDbParams.h.

References tnsAdmin_.

Referenced by SiStripConfigDb::usingDatabase().

176 { return tnsAdmin_; }
std::string tnsAdmin_

◆ user()

std::string SiStripDbParams::user ( ) const
inline

Definition at line 171 of file SiStripDbParams.h.

References user_.

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

171 { return user_; }
std::string user_

◆ usingDb() [1/2]

bool SiStripDbParams::usingDb ( ) const
inline

◆ usingDb() [2/2]

void SiStripDbParams::usingDb ( bool  using_db)
inline

Definition at line 193 of file SiStripDbParams.h.

References usingDb_.

193 { usingDb_ = using_db; }

◆ usingDbCache() [1/2]

bool SiStripDbParams::usingDbCache ( ) const
inline

Definition at line 174 of file SiStripDbParams.h.

References usingDbCache_.

Referenced by SiStripConfigDb::openDbConnection(), and SiStripConfigDb::usingDatabaseCache().

174 { return usingDbCache_; }

◆ usingDbCache() [2/2]

void SiStripDbParams::usingDbCache ( bool  using_cache)
inline

Definition at line 194 of file SiStripDbParams.h.

References usingDbCache_.

194 { usingDbCache_ = using_cache; }

Member Data Documentation

◆ confdb_

std::string SiStripDbParams::confdb_
private

Definition at line 142 of file SiStripDbParams.h.

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

◆ outputDcuInfoXml_

std::string SiStripDbParams::outputDcuInfoXml_
private

Definition at line 160 of file SiStripDbParams.h.

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

◆ outputFecXml_

std::string SiStripDbParams::outputFecXml_
private

Definition at line 162 of file SiStripDbParams.h.

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

◆ outputFedXml_

std::string SiStripDbParams::outputFedXml_
private

Definition at line 164 of file SiStripDbParams.h.

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

◆ outputModuleXml_

std::string SiStripDbParams::outputModuleXml_
private

Definition at line 158 of file SiStripDbParams.h.

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

◆ partitions_

SiStripPartitions SiStripDbParams::partitions_
private

◆ passwd_

std::string SiStripDbParams::passwd_
private

Definition at line 146 of file SiStripDbParams.h.

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

◆ path_

std::string SiStripDbParams::path_
private

Definition at line 148 of file SiStripDbParams.h.

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

◆ sharedMemory_

std::string SiStripDbParams::sharedMemory_
private

Definition at line 152 of file SiStripDbParams.h.

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

◆ tnsAdmin_

std::string SiStripDbParams::tnsAdmin_
private

Definition at line 154 of file SiStripDbParams.h.

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

◆ user_

std::string SiStripDbParams::user_
private

Definition at line 144 of file SiStripDbParams.h.

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

◆ usingDb_

bool SiStripDbParams::usingDb_
private

Definition at line 140 of file SiStripDbParams.h.

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

◆ usingDbCache_

bool SiStripDbParams::usingDbCache_
private

Definition at line 150 of file SiStripDbParams.h.

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