13 if ( ( !dbParams_.usingDbCache() && !deviceFactory(__func__) ) ||
14 ( dbParams_.usingDbCache() && !databaseCache(__func__) ) ) {
15 return dcuDetIds_.emptyRange();
20 if ( !dbParams_.usingDbCache() ) {
22 SiStripDbParams::SiStripPartitions::const_iterator iter = dbParams_.partitions().begin();
23 SiStripDbParams::SiStripPartitions::const_iterator jter = dbParams_.partitions().end();
24 for ( ; iter != jter; ++iter ) {
26 if ( partition ==
"" || partition == iter->second.partitionName() ) {
30 DcuDetIdsRange range = dcuDetIds_.find( iter->second.partitionName() );
31 if ( range == dcuDetIds_.emptyRange() ) {
33 deviceFactory(__func__)->addDetIdPartition( iter->second.partitionName(),
34 iter->second.dcuVersion().first,
35 iter->second.dcuVersion().second );
45 dcuDetIds_.loadNext( iter->second.partitionName(), dst );
69 <<
"[SiStripConfigDb::" << __func__ <<
"]" 70 <<
" NULL pointer to Dcu-DetId map!";
75 }
catch (... ) { handleException( __func__ ); }
81 if ( partition !=
"" ) {
82 range = dcuDetIds_.find( partition );
86 if ( !dcuDetIds_.empty() ) {
87 range =
DcuDetIdsRange( dcuDetIds_.find( dbParams_.partitions().begin()->second.partitionName() ).
begin(),
88 dcuDetIds_.find( (--(dbParams_.partitions().end()))->second.partitionName() ).
end() );
89 }
else { range = dcuDetIds_.emptyRange(); }
90 np = dcuDetIds_.size();
95 ss <<
"[SiStripConfigDb::" << __func__ <<
"]" 96 <<
" Found " << nc <<
" entries in DCU-DetId map";
97 if ( !dbParams_.usingDb() ) { ss <<
" in " << dbParams_.inputDcuInfoXmlFiles().size() <<
" 'module.xml' file(s)"; }
98 else {
if ( !dbParams_.usingDbCache() ) { ss <<
" in " << np <<
" database partition(s)"; }
99 else { ss <<
" from shared memory name '" << dbParams_.sharedMemory() <<
"'"; } }
111 ss <<
"[SiStripConfigDb::" << __func__ <<
"]" 112 <<
" Cannot add to local cache! This functionality not allowed!";
186 ss <<
"[SiStripConfigDb::" << __func__ <<
"]" 187 <<
" Cannot upload to database! This functionality not allowed!";
275 if ( dcuDetIds_.empty() ) {
277 ss <<
"[SiStripConfigDb::" << __func__ <<
"]" 278 <<
" Found no cached DCU-DetId map!";
285 if ( partition ==
"" ) { temporary_cache =
DcuDetIds(); }
287 SiStripDbParams::SiStripPartitions::const_iterator iter = dbParams_.partitions().begin();
288 SiStripDbParams::SiStripPartitions::const_iterator jter = dbParams_.partitions().end();
289 for ( ; iter != jter; ++iter ) {
290 if ( partition != iter->second.partitionName() ) {
291 DcuDetIdsRange range = dcuDetIds_.find( iter->second.partitionName() );
292 if ( range != dcuDetIds_.emptyRange() ) {
307 if ( partition ==
"" ) {
308 if ( !dcuDetIds_.empty() ) {
309 dcus =
DcuDetIdsRange( dcuDetIds_.find( dbParams_.partitions().begin()->second.partitionName() ).
begin(),
310 dcuDetIds_.find( (--(dbParams_.partitions().end()))->second.partitionName() ).
end() );
311 }
else { dcus = dcuDetIds_.emptyRange(); }
313 SiStripDbParams::SiStripPartitions::const_iterator iter = dbParams_.partitions().begin();
314 SiStripDbParams::SiStripPartitions::const_iterator jter = dbParams_.partitions().end();
315 for ( ; iter != jter; ++iter ) {
if ( partition == iter->second.partitionName() ) {
break; } }
316 dcus = dcuDetIds_.find( iter->second.partitionName() );
319 if ( dcus != dcuDetIds_.emptyRange() ) {
320 DcuDetIdsV::const_iterator ifed = dcus.begin();
321 DcuDetIdsV::const_iterator jfed = dcus.end();
322 for ( ; ifed != jfed; ++ifed ) {
if ( ifed->second ) {
delete ifed->second; } }
325 ss <<
"[SiStripConfigDb::" << __func__ <<
"]";
326 if ( partition ==
"" ) { ss <<
" Found no DCU-DetId map in local cache!"; }
327 else { ss <<
" Found no DCU-DetId map in local cache for partition \"" << partition <<
"\"!"; }
332 dcuDetIds_ = temporary_cache;
340 std::stringstream ss;
341 ss <<
"[SiStripConfigDb::" << __func__ <<
"]" 342 <<
" Contents of DcuDetIds container:" << std::endl;
343 ss <<
" Number of partitions: " << dcuDetIds_.size() << std::endl;
349 for ( ; idcu != jdcu; ++idcu ) {
352 if ( partition ==
"" || partition == idcu->first ) {
354 ss <<
" Partition number : " << cntr <<
" (out of " << dcuDetIds_.size() <<
")" << std::endl;
355 ss <<
" Partition name : \"" << idcu->first <<
"\"" << std::endl;
356 ss <<
" Size of DCU-DetId map : " << idcu->second.size() << std::endl;
370 DcuDetIdMap::const_iterator
ii = input.begin();
371 DcuDetIdMap::const_iterator
jj = input.end();
372 for ( ; ii !=
jj; ++
ii ) {
if ( ii->second ) { output.push_back( std::make_pair( ii->first,
new TkDcuInfo( *(ii->second) ) ) ); } }
379 DcuDetIdsV::const_iterator
ii = input.begin();
380 DcuDetIdsV::const_iterator
jj = input.end();
381 for ( ; ii !=
jj; ++
ii ) {
if ( ii->second ) { output[ii->first] =
new TkDcuInfo( *(ii->second) ); } }
388 DcuDetIdsV::const_iterator
ii = input.begin();
389 DcuDetIdsV::const_iterator
jj = input.end();
390 for ( ; ii !=
jj; ++
ii ) {
if ( ii->second ) { output.push_back( std::make_pair( ii->first,
new TkDcuInfo( *(ii->second) ) ) ); } }
396 DcuDetIdsV::const_iterator
end,
398 DcuDetIdsV::const_iterator iter =
begin;
399 DcuDetIdsV::const_iterator jter =
end;
400 for ( ; iter != jter; ++iter ) {
401 if ( iter->second && iter->second->getDcuHardId() == dcu_id ) {
return iter; }
409 DcuDetIdsV::iterator
end,
411 DcuDetIdsV::iterator iter =
begin;
412 DcuDetIdsV::iterator jter =
end;
413 for ( ; iter != jter; ++iter ) {
414 if ( iter->second && iter->second->getDcuHardId() == dcu_id ) {
return iter; }
void clone(const DcuDetIdMap &in, DcuDetIdsV &out) const
static const std::string defaultPartitionName_
DcuDetIds::range DcuDetIdsRange
void loadNext(K const &k, std::vector< T > const &v)
void uploadDcuDetIds(std::string partition="")
static std::string const input
static const char mlConfigDb_[]
static DcuDetIdsV::const_iterator findDcuDetId(DcuDetIdsV::const_iterator begin, DcuDetIdsV::const_iterator end, uint32_t dcu_id)
void printDcuDetIds(std::string partition="")
std::vector< DcuDetId > DcuDetIdsV
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Sgi::hash_map< unsigned long, TkDcuInfo * > DcuDetIdMap
void addDcuDetIds(std::string partition, DcuDetIdsV &)
void clearDcuDetIds(std::string partition="")
DcuDetIdsRange getDcuDetIds(std::string partition="")