7 using namespace sistrip;
21 outputModuleXml_(
"/tmp/module.xml"),
22 outputDcuInfoXml_(
"/tmp/dcuinfo.xml"),
23 outputFecXml_(
"/tmp/fec.xml"),
24 outputFedXml_(
"/tmp/fed.xml") {
31 : usingDb_(input.usingDb()),
32 confdb_(input.confdb()),
34 passwd_(input.passwd()),
36 usingDbCache_(input.usingDbCache()),
37 sharedMemory_(input.sharedMemory()),
38 tnsAdmin_(input.tnsAdmin()),
40 outputModuleXml_(input.outputModuleXml()),
41 outputDcuInfoXml_(input.outputDcuInfoXml()),
42 outputFecXml_(input.outputFecXml()),
43 outputFedXml_(input.outputFedXml()) {
123 std::stringstream
ss;
124 ss <<
"[SiStripDbParams::" << __func__ <<
"]"
125 <<
" Attempting to add partition with null name!";
133 std::stringstream
ss;
134 ss <<
"[SiStripDbParams::" << __func__ <<
"]"
135 <<
" Added new partition with name \"" << in.
partitionName() <<
"\"";
137 ss <<
" (Currently have " <<
partitions_.size() <<
" partitions in cache...)";
141 std::stringstream
ss;
142 ss <<
"[SiStripDbParams::" << __func__ <<
"]"
143 <<
" Partition with name \"" << in.
partitionName() <<
"\" already found!"
144 <<
" Not adding to cache...";
162 std::vector<std::string>::const_iterator istr =
std::find(str.begin(), str.end(),
partitions);
163 if (istr != str.end()) {
171 std::vector<std::string>::iterator iname = names.begin();
172 std::vector<std::string>::iterator jname = names.end();
173 for (; iname != jname; ++iname) {
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());
213 if (!user.empty() && !passwd.empty() && !path.empty() && user !=
null_ && passwd !=
null_ && path !=
null_) {
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()) {
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()) {
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());
264 <<
" Partition " << ii->second.partitionName()
265 <<
" already found! Not adding to vector...";
274 std::istringstream
ss(input);
278 while (getline(ss, token,
':')) {
279 if (!token.empty()) {
280 partitions.push_back(token);
289 std::stringstream
ss;
290 std::vector<std::string>::const_iterator
ii = partitions.begin();
291 std::vector<std::string>::const_iterator
jj = partitions.end();
293 for (; ii !=
jj; ++
ii) {
295 first ? ss << *ii : ss <<
":" << *
ii;
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;
309 ss <<
" Shared memory name : " << std::boolalpha <<
sharedMemory_ << std::noboolalpha << std::endl;
314 ss <<
" Database account (ConfDb) : " <<
user_ +
"/******@" +
path_ << std::endl;
317 ss <<
" Number of partitions : " <<
partitions_.size();
322 ss <<
" (Using database cache!)";
330 for (; ii !=
jj; ++
ii) {
332 ss <<
" Partition #" << cntr <<
" (out of " <<
partitions_.size() <<
"):" << std::endl;
339 <<
" Output \"fec.xml\" file(s) : " <<
outputFecXml_ << std::endl
340 <<
" Output \"fed.xml\" file(s) : " <<
outputFedXml_ << std::endl;
348 std::stringstream
ss;
357 std::vector<std::string>
files;
360 for (; ii !=
jj; ++
ii) {
361 files.insert(files.end(), ii->second.inputModuleXml());
369 std::vector<std::string>
files;
372 for (; ii !=
jj; ++
ii) {
373 files.insert(files.end(), ii->second.inputDcuInfoXml());
381 std::vector<std::string>
files;
384 for (; ii !=
jj; ++
ii) {
385 files.insert(files.end(), ii->second.inputFecXml().begin(), ii->second.inputFecXml().end());
393 std::vector<std::string>
files;
396 for (; ii !=
jj; ++
ii) {
397 files.insert(files.end(), ii->second.inputFedXml().begin(), ii->second.inputFedXml().end());
bool operator==(const SiStripDbParams &) const
void print(std::stringstream &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string passwd() const
static const std::string defaultPartitionName_
std::vector< std::string > inputFedXmlFiles() const
std::map< std::string, SiStripPartition > SiStripPartitions
std::string partitionName() const
std::vector< std::string > inputDcuInfoXmlFiles() const
bool operator!=(const SiStripDbParams &) const
std::ostream & operator<<(std::ostream &out, const ALILine &li)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
SiStripDbParams & operator=(const SiStripDbParams &)
const std::string names[nVars_]
std::string outputDcuInfoXml_
static std::string const input
static const char mlConfigDb_[]
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
const_iterator_range partitions() const
std::vector< std::string > partitionNames() const
std::string outputModuleXml() const
std::string outputFecXml_
size_type partitionsSize() const
void pset(const edm::ParameterSet &)
std::string outputModuleXml_
std::string tnsAdmin() const
std::string sharedMemory() const
std::string outputFedXml_
Container class for database partition parameters.
std::string sharedMemory_
std::vector< std::string > inputModuleXmlFiles() const
std::string confdb() const
Container class for database connection parameters.
std::string outputFedXml() const
SiStripPartitions::const_iterator partition(std::string partition_name) const
std::vector< std::string > inputFecXmlFiles() const
void pset(const edm::ParameterSet &)
bool usingDbCache() const
Log< level::Warning, false > LogWarning
void addPartition(const SiStripPartition &)
std::string outputFecXml() const
SiStripPartitions partitions_
std::string outputDcuInfoXml() const
static const char null_[]