CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 25 of file SiStripDbParams.h.

Member Typedef Documentation

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

Definition at line 47 of file SiStripDbParams.h.

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

Definition at line 49 of file SiStripDbParams.h.

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

Definition at line 43 of file SiStripDbParams.h.

typedef SiStripPartitions::size_type SiStripDbParams::size_type

Definition at line 45 of file SiStripDbParams.h.

Constructor & Destructor Documentation

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::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()),
42  outputFecXml_(input.outputFecXml()),
43  outputFedXml_(input.outputFedXml()) {
44  ;
45 }
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 98 of file SiStripDbParams.cc.

References reset().

98 { reset(); }

Member Function Documentation

void SiStripDbParams::addPartition ( const SiStripPartition in)

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

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;
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_
std::string partitionName() const
#define LogTrace(id)
static const char mlConfigDb_[]
Log< level::Warning, false > LogWarning
SiStripPartitions partitions_
void SiStripDbParams::clearPartitions ( )
inline

Definition at line 192 of file SiStripDbParams.h.

References partitions_.

Referenced by SiStripConfigDb::usingDatabase().

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

Definition at line 170 of file SiStripDbParams.h.

References confdb_.

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

170 { return confdb_; }
std::string confdb_
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 }
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 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 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 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 }
int ii
Definition: cuy.py:589
SiStripPartitions partitions_
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 }
int ii
Definition: cuy.py:589
SiStripPartitions partitions_
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 }
int ii
Definition: cuy.py:589
SiStripPartitions partitions_
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 }
int ii
Definition: cuy.py:589
SiStripPartitions partitions_
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:47
SiStripDbParams & SiStripDbParams::operator= ( const SiStripDbParams input)

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

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());
63  outputFecXml_ = input.outputFecXml();
64  outputFedXml_ = input.outputFedXml();
65  return *this;
66 }
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 70 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_.

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() &&
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 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 188 of file SiStripDbParams.h.

References outputDcuInfoXml_.

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

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

Definition at line 189 of file SiStripDbParams.h.

References outputFecXml_.

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

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

Definition at line 190 of file SiStripDbParams.h.

References outputFedXml_.

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

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

Definition at line 187 of file SiStripDbParams.h.

References outputModuleXml_.

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

187 { 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 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 }
int ii
Definition: cuy.py:589
const_iterator_range partitions() const
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 }
int ii
Definition: cuy.py:589
const_iterator_range partitions() const
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 }
int ii
Definition: cuy.py:589
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
static const char mlConfigDb_[]
const_iterator_range partitions() const
Log< level::Warning, false > LogWarning
SiStripPartitions partitions_
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 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 }
static std::string const input
Definition: EdmProvDump.cc:47
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 288 of file SiStripDbParams.cc.

References first, cuy::ii, findQualityFiles::jj, 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 }
int ii
Definition: cuy.py:589
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 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_
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_
std::string SiStripDbParams::passwd ( ) const
inline

Definition at line 172 of file SiStripDbParams.h.

References passwd_.

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

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

Definition at line 173 of file SiStripDbParams.h.

References path_.

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

173 { return path_; }
std::string path_
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_, user_, usingDb_, and usingDbCache_.

Referenced by operator<<().

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 }
int ii
Definition: cuy.py:589
std::string outputDcuInfoXml_
std::string outputFecXml_
std::string outputModuleXml_
std::string user_
std::string outputFedXml_
std::string sharedMemory_
std::string path_
SiStripPartitions partitions_
void SiStripDbParams::pset ( const edm::ParameterSet cfg)

Definition at line 151 of file SiStripDbParams.cc.

References addPartition(), confdb(), spr::find(), edm::ParameterSet::getParameterNamesForType(), edm::ParameterSet::getUntrackedParameter(), names, outputDcuInfoXml_, outputFecXml_, outputFedXml_, outputModuleXml_, partitions(), partitions_, SiStripPartition::pset(), 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
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 }
T getUntrackedParameter(std::string const &, T const &) const
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 std::string names[nVars_]
std::string outputDcuInfoXml_
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:179
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
void pset(const edm::ParameterSet &)
void addPartition(const SiStripPartition &)
#define str(s)
tmp
align.sh
Definition: createJobs.py:716
SiStripPartitions partitions_
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
std::string SiStripDbParams::sharedMemory ( ) const
inline

Definition at line 175 of file SiStripDbParams.h.

References sharedMemory_.

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

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

Definition at line 176 of file SiStripDbParams.h.

References tnsAdmin_.

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

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

Definition at line 171 of file SiStripDbParams.h.

References user_.

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

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

Definition at line 193 of file SiStripDbParams.h.

References usingDb_.

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

Definition at line 194 of file SiStripDbParams.h.

References usingDbCache_.

194 { usingDbCache_ = using_cache; }

Member Data Documentation

std::string SiStripDbParams::confdb_
private

Definition at line 142 of file SiStripDbParams.h.

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

std::string SiStripDbParams::outputDcuInfoXml_
private

Definition at line 160 of file SiStripDbParams.h.

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

std::string SiStripDbParams::outputFecXml_
private

Definition at line 162 of file SiStripDbParams.h.

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

std::string SiStripDbParams::outputFedXml_
private

Definition at line 164 of file SiStripDbParams.h.

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

std::string SiStripDbParams::outputModuleXml_
private

Definition at line 158 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 146 of file SiStripDbParams.h.

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

std::string SiStripDbParams::path_
private

Definition at line 148 of file SiStripDbParams.h.

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

std::string SiStripDbParams::sharedMemory_
private

Definition at line 152 of file SiStripDbParams.h.

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

std::string SiStripDbParams::tnsAdmin_
private

Definition at line 154 of file SiStripDbParams.h.

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

std::string SiStripDbParams::user_
private

Definition at line 144 of file SiStripDbParams.h.

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

bool SiStripDbParams::usingDb_
private

Definition at line 140 of file SiStripDbParams.h.

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

bool SiStripDbParams::usingDbCache_
private

Definition at line 150 of file SiStripDbParams.h.

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