7 using namespace sistrip;
21 outputModuleXml_(
"/tmp/module.xml"),
22 outputDcuInfoXml_(
"/tmp/dcuinfo.xml"),
23 outputFecXml_(
"/tmp/fec.xml"),
24 outputFedXml_(
"/tmp/fed.xml")
30 usingDb_( input.usingDb() ),
31 confdb_( input.confdb() ),
32 user_( input.
user() ),
33 passwd_( input.passwd() ),
35 usingDbCache_( input.usingDbCache() ),
36 sharedMemory_( input.sharedMemory() ),
37 tnsAdmin_( input.tnsAdmin() ),
38 partitions_( input.partitions().
begin(), input.partitions().
end() ),
39 outputModuleXml_( input.outputModuleXml() ),
40 outputDcuInfoXml_( input.outputDcuInfoXml() ),
41 outputFecXml_( input.outputFecXml() ),
42 outputFedXml_( input.outputFedXml() )
96 return !( *
this ==
input );
129 std::stringstream
ss;
130 ss <<
"[SiStripDbParams::" << __func__ <<
"]"
131 <<
" Attempting to add partition with null name!";
139 std::stringstream
ss;
140 ss <<
"[SiStripDbParams::" << __func__ <<
"]"
141 <<
" Added new partition with name \""
144 ss <<
" (Currently have "
146 <<
" partitions in cache...)";
150 std::stringstream
ss;
151 ss <<
"[SiStripDbParams::" << __func__ <<
"]"
152 <<
" Partition with name \""
154 <<
"\" already found!"
155 <<
" Not adding to cache...";
175 std::vector<std::string>::const_iterator istr =
std::find( str.begin(), str.end(),
partitions );
176 if ( istr != str.end() ) {
185 std::vector<std::string>::iterator iname = names.begin();
186 std::vector<std::string>::iterator jname = names.end();
187 for ( ; iname != jname; ++iname ) {
211 size_t ipass = confdb.find(
"/");
212 size_t ipath = confdb.find(
"@");
213 if ( ipass != std::string::npos &&
214 ipath != std::string::npos ) {
215 user_ = confdb.substr(0,ipass);
216 passwd_ = confdb.substr(ipass+1,ipath-ipass-1);
217 path_ = confdb.substr(ipath+1,confdb.size());
230 if ( user !=
"" && passwd !=
"" && path !=
"" &&
246 SiStripDbParams::SiStripPartitions::const_iterator
ii =
partitions().begin();
247 SiStripDbParams::SiStripPartitions::const_iterator
jj =
partitions().end();
248 for ( ; ii !=
jj; ++
ii ) {
if ( partition_name == ii->second.partitionName() ) {
return ii; } }
255 SiStripDbParams::SiStripPartitions::iterator
ii =
partitions().begin();
256 SiStripDbParams::SiStripPartitions::iterator
jj =
partitions().end();
257 for ( ; ii !=
jj; ++
ii ) {
if ( partition_name == ii->second.partitionName() ) {
return ii; } }
267 for ( ; ii !=
jj; ++
ii ) {
270 ii->second.partitionName() ) == partitions.end() ) {
271 if ( !ii->second.partitionName().empty() ) { partitions.push_back( ii->second.partitionName() ); }
274 <<
"[SiStripConfigDb::" << __func__ <<
"]"
275 <<
" Partition " << ii->second.partitionName()
276 <<
" already found! Not adding to vector...";
285 std::istringstream
ss(input);
289 while ( getline( ss, token,
':' ) ) {
if ( !token.empty() ) { partitions.push_back(token); } }
296 std::stringstream
ss;
297 std::vector<std::string>::const_iterator
ii = partitions.begin();
298 std::vector<std::string>::const_iterator
jj = partitions.end();
300 for ( ; ii !=
jj; ++
ii ) {
301 if ( !ii->empty() ) {
302 first ? ss << *ii : ss <<
":" << *
ii;
313 ss <<
" Using database account : " << std::boolalpha <<
usingDb_ << std::noboolalpha << std::endl;
314 ss <<
" Using XML files : " << std::boolalpha << !
usingDb_ << std::noboolalpha << std::endl;
315 ss <<
" Using database cache : " << std::boolalpha <<
usingDbCache_ << std::noboolalpha << std::endl;
317 ss <<
" Shared memory name : " << std::boolalpha <<
sharedMemory_ << std::noboolalpha << std::endl;
323 ss <<
" Database account (ConfDb) : " <<
confdb_ << std::endl;
326 ss <<
" Number of partitions : " <<
partitions_.size();
329 else { ss <<
" (Using database cache!)"; }
336 for ( ; ii !=
jj; ++
ii ) {
338 ss <<
" Partition #" << cntr <<
" (out of " <<
partitions_.size() <<
"):" << std::endl;
345 <<
" Output \"fec.xml\" file(s) : " <<
outputFecXml_ << std::endl
346 <<
" Output \"fed.xml\" file(s) : " <<
outputFedXml_ << std::endl;
356 std::stringstream
ss;
365 std::vector<std::string>
files;
368 for ( ; ii !=
jj; ++
ii ) { files.insert( files.end(), ii->second.inputModuleXml() ); }
375 std::vector<std::string>
files;
378 for ( ; ii !=
jj; ++
ii ) { files.insert( files.end(), ii->second.inputDcuInfoXml() ); }
385 std::vector<std::string>
files;
388 for ( ; ii !=
jj; ++
ii ) { files.insert( files.end(), ii->second.inputFecXml().begin(), ii->second.inputFecXml().end() ); }
395 std::vector<std::string>
files;
398 for ( ; ii !=
jj; ++
ii ) { files.insert( files.end(), ii->second.inputFedXml().begin(), ii->second.inputFedXml().end() ); }
static std::string defaultPartitionName_
bool operator==(const SiStripDbParams &) const
void print(std::stringstream &) const
T getUntrackedParameter(std::string const &, T const &) const
std::string passwd() const
std::vector< std::string > inputFedXmlFiles() const
static const HistoName names[]
std::string partitionName() const
std::vector< std::string > inputDcuInfoXmlFiles() const
bool operator!=(const SiStripDbParams &) const
std::map< std::string, SiStripPartition > SiStripPartitions
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 &)
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
tuple path
else: Piece not in the list, fine.
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::vector< double > > tmp
std::vector< std::string > inputFecXmlFiles() const
void pset(const edm::ParameterSet &)
bool usingDbCache() const
volatile std::atomic< bool > shutdown_flag false
void addPartition(const SiStripPartition &)
std::string outputFecXml() const
SiStripPartitions partitions_
std::string outputDcuInfoXml() const
static const char null_[]