8 using namespace sistrip;
22 outputModuleXml_(
"/tmp/module.xml"),
23 outputDcuInfoXml_(
"/tmp/dcuinfo.xml"),
24 outputFecXml_(
"/tmp/fec.xml"),
25 outputFedXml_(
"/tmp/fed.xml")
31 usingDb_( input.usingDb() ),
32 confdb_( input.confdb() ),
33 user_( input.
user() ),
34 passwd_( input.passwd() ),
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() )
97 return !( *
this ==
input );
130 std::stringstream ss;
131 ss <<
"[SiStripDbParams::" << __func__ <<
"]"
132 <<
" Attempting to add partition with null name!";
140 std::stringstream ss;
141 ss <<
"[SiStripDbParams::" << __func__ <<
"]"
142 <<
" Added new partition with name \""
145 ss <<
" (Currently have "
147 <<
" partitions in cache...)";
151 std::stringstream ss;
152 ss <<
"[SiStripDbParams::" << __func__ <<
"]"
153 <<
" Partition with name \""
155 <<
"\" already found!"
156 <<
" Not adding to cache...";
176 std::vector<std::string>::const_iterator istr =
std::find( str.begin(), str.end(),
partitions );
177 if ( istr != str.end() ) {
186 std::vector<std::string>::iterator iname = names.begin();
187 std::vector<std::string>::iterator jname = names.end();
188 for ( ; iname != jname; ++iname ) {
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());
229 const std::string& passwd,
230 const std::string&
path ) {
231 if ( user !=
"" && passwd !=
"" && path !=
"" &&
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; } }
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; } }
266 SiStripPartitions::const_iterator ii =
partitions_.begin();
268 for ( ; ii !=
jj; ++ii ) {
271 ii->second.partitionName() ) == partitions.end() ) {
272 if ( !ii->second.partitionName().empty() ) { partitions.push_back( ii->second.partitionName() ); }
275 <<
"[SiStripConfigDb::" << __func__ <<
"]"
276 <<
" Partition " << ii->second.partitionName()
277 <<
" already found! Not adding to vector...";
286 std::istringstream ss(input);
288 std::string delimiter =
":";
290 while ( getline( ss, token,
':' ) ) {
if ( !token.empty() ) { partitions.push_back(token); } }
297 std::stringstream ss;
298 std::vector<std::string>::const_iterator ii = partitions.begin();
299 std::vector<std::string>::const_iterator
jj = partitions.end();
301 for ( ; ii !=
jj; ++ii ) {
302 if ( !ii->empty() ) {
303 first ? ss << *ii : ss <<
":" << *ii;
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;
318 ss <<
" Shared memory name : " << std::boolalpha <<
sharedMemory_ << std::noboolalpha << std::endl;
324 ss <<
" Database account (ConfDb) : " <<
confdb_ << std::endl;
327 ss <<
" Number of partitions : " <<
partitions_.size();
330 else { ss <<
" (Using database cache!)"; }
335 SiStripPartitions::const_iterator ii =
partitions_.begin();
337 for ( ; ii !=
jj; ++ii ) {
339 ss <<
" Partition #" << cntr <<
" (out of " <<
partitions_.size() <<
"):" << std::endl;
346 <<
" Output \"fec.xml\" file(s) : " <<
outputFecXml_ << std::endl
347 <<
" Output \"fed.xml\" file(s) : " <<
outputFedXml_ << std::endl;
357 std::stringstream ss;
366 std::vector<std::string>
files;
367 SiStripPartitions::const_iterator ii =
partitions_.begin();
369 for ( ; ii !=
jj; ++ii ) { files.insert( files.end(), ii->second.inputModuleXml() ); }
376 std::vector<std::string>
files;
377 SiStripPartitions::const_iterator ii =
partitions_.begin();
379 for ( ; ii !=
jj; ++ii ) { files.insert( files.end(), ii->second.inputDcuInfoXml() ); }
386 std::vector<std::string>
files;
387 SiStripPartitions::const_iterator ii =
partitions_.begin();
389 for ( ; ii !=
jj; ++ii ) { files.insert( files.end(), ii->second.inputFecXml().begin(), ii->second.inputFecXml().end() ); }
396 std::vector<std::string>
files;
397 SiStripPartitions::const_iterator ii =
partitions_.begin();
399 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
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 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::vector< double > > tmp
std::vector< std::string > inputFecXmlFiles() const
void pset(const edm::ParameterSet &)
bool usingDbCache() const
void addPartition(const SiStripPartition &)
std::string outputFecXml() const
static const HistoName names[]
SiStripPartitions partitions_
std::string outputDcuInfoXml() const
static const char null_[]