#include <StaticCableSvc.h>
Inheritance diagram for StaticCableSvc:
Definition at line 21 of file StaticCableSvc.h.
StaticCableSvc::StaticCableSvc | ( | const std::string & | name, | |
ISvcLocator * | svc | |||
) |
Definition at line 16 of file StaticCableSvc.cc.
00017 : Service(name,svc) 00018 , m_first(true) 00019 { 00020 msg = 0; 00023 declareProperty("FeeCableMap",m_feeCableFileName="", 00024 "Filename for loading the FEE cabling map."); 00026 declareProperty("FecCableMap",m_fecCableFileName="", 00027 "Filename for loading the FEC cabling map"); 00028 }
StaticCableSvc::~StaticCableSvc | ( | ) |
StatusCode StaticCableSvc::initialize | ( | ) | [virtual] |
Reimplemented from Service.
Definition at line 34 of file StaticCableSvc.cc.
00035 { 00036 this->Service::initialize(); 00037 00038 return StatusCode::SUCCESS; 00039 }
StatusCode StaticCableSvc::finalize | ( | ) | [virtual] |
Reimplemented from Service.
Definition at line 222 of file StaticCableSvc.cc.
00223 { 00224 return this->Service::finalize(); 00225 }
StatusCode StaticCableSvc::queryInterface | ( | const InterfaceID & | riid, | |
void ** | ppvInterface | |||
) | [virtual] |
Reimplemented from Service.
Definition at line 227 of file StaticCableSvc.cc.
00229 { 00230 StatusCode sc = StatusCode::FAILURE; 00231 if (ppvInterface) { 00232 *ppvInterface = 0; 00233 00234 if (ICableSvc::interfaceID().versionMatch(riid)) { 00235 *ppvInterface = static_cast<ICableSvc*>(this); 00236 sc = StatusCode::SUCCESS; 00237 addRef(); 00238 } 00239 else sc = Service::queryInterface( riid, ppvInterface ); 00240 } 00241 return sc; 00242 }
const std::vector< DayaBay::HardwareId > & StaticCableSvc::hardwareIds | ( | const ServiceMode & | svcMode | ) | [virtual] |
Implements ICableSvc.
Definition at line 244 of file StaticCableSvc.cc.
00245 { 00246 if( m_first ) initMap(svcMode); 00247 return m_hardwareIds; 00248 }
const std::vector< DayaBay::PmtHardwareId > & StaticCableSvc::pmtHardwareIds | ( | const ServiceMode & | svcMode | ) | [virtual] |
Implements ICableSvc.
Definition at line 250 of file StaticCableSvc.cc.
00251 { 00252 if( m_first ) initMap(svcMode); 00253 return m_pmtHardwareIds; 00254 }
const std::vector< DayaBay::RpcHardwareId > & StaticCableSvc::rpcHardwareIds | ( | const ServiceMode & | svcMode | ) | [virtual] |
Implements ICableSvc.
Definition at line 256 of file StaticCableSvc.cc.
00257 { 00258 if( m_first ) initMap(svcMode); 00259 return m_rpcHardwareIds; 00260 }
const std::vector< DayaBay::FeeHardwareId > & StaticCableSvc::feeHardwareIds | ( | const ServiceMode & | svcMode | ) | [virtual] |
Implements ICableSvc.
Definition at line 262 of file StaticCableSvc.cc.
00263 { 00264 if( m_first ) initMap(svcMode); 00265 return m_feeHardwareIds; 00266 }
const std::vector< DayaBay::FecHardwareId > & StaticCableSvc::fecHardwareIds | ( | const ServiceMode & | svcMode | ) | [virtual] |
Implements ICableSvc.
Definition at line 268 of file StaticCableSvc.cc.
00269 { 00270 if( m_first ) initMap(svcMode); 00271 return m_fecHardwareIds; 00272 }
const std::vector< DayaBay::DetectorSensor > & StaticCableSvc::sensors | ( | const ServiceMode & | svcMode | ) | [virtual] |
Implements ICableSvc.
Definition at line 274 of file StaticCableSvc.cc.
00275 { 00276 MsgStream log(msgSvc(), "StaticCableSvc"); 00277 00278 if( m_first ) initMap(svcMode); 00279 DayaBay::Detector siteDetId(svcMode.context().GetSite(), 00280 svcMode.context().GetDetId()); 00281 std::map<DayaBay::Detector,std::vector<DayaBay::DetectorSensor> >::iterator iter; 00282 iter = m_sensorsBySiteDet.find(siteDetId); 00283 if( iter != m_sensorsBySiteDet.end() ){ 00284 // Found site / det 00285 00286 const std::vector<DayaBay::DetectorSensor>& detSensors = iter->second; 00287 for (size_t idet = 0; idet < detSensors.size(); ++idet) { 00288 DayaBay::DetectorSensor detSens = detSensors[idet]; 00289 if (detSens.isAD() ) { 00290 DayaBay::AdPmtSensor pmtid(detSens.fullPackedData()); 00291 if (pmtid.bogus()) { 00292 log << MSG::WARNING << "bogus AD PMT id: " << pmtid << endreq; 00293 } 00294 } 00295 else { 00296 DayaBay::PoolPmtSensor pmtid(detSens.fullPackedData()); 00297 if (pmtid.bogus()) { 00298 log << MSG::WARNING << "bogus Pool PMT id: " << pmtid << endreq; 00299 } 00300 } 00301 } 00302 00303 return iter->second; 00304 } 00305 std::ostringstream msgStr; 00306 msgStr << "sensors(): No sensors for site / detector ID: " << siteDetId; 00307 msg->reportMessage("StaticCableSvc",MSG::WARNING,msgStr.str()); 00308 return m_sensorsBySiteDet[s_unknownSiteDet]; 00309 }
const std::vector< DayaBay::AdPmtSensor > & StaticCableSvc::adPmtSensors | ( | const ServiceMode & | svcMode | ) | [virtual] |
Implements ICableSvc.
Definition at line 311 of file StaticCableSvc.cc.
00312 { 00314 if( m_first ) initMap(svcMode); 00315 DayaBay::Detector siteDetId(svcMode.context().GetSite(), 00316 svcMode.context().GetDetId()); 00317 std::map<DayaBay::Detector,std::vector<DayaBay::AdPmtSensor> >::iterator iter; 00318 iter = m_adPmtSensorsBySiteDet.find(siteDetId); 00319 if( iter != m_adPmtSensorsBySiteDet.end() ){ 00320 // Found site / det 00321 return iter->second; 00322 } 00323 std::ostringstream msgStr; 00324 msgStr << "adPmtSensors(): No sensors for site / detector ID: " << siteDetId; 00325 msg->reportMessage("StaticCableSvc",MSG::WARNING,msgStr.str()); 00326 return m_adPmtSensorsBySiteDet[s_unknownSiteDet]; 00327 }
const std::vector< DayaBay::PoolPmtSensor > & StaticCableSvc::poolPmtSensors | ( | const ServiceMode & | svcMode | ) | [virtual] |
Implements ICableSvc.
Definition at line 329 of file StaticCableSvc.cc.
00330 { 00332 if( m_first ) initMap(svcMode); 00333 DayaBay::Detector siteDetId(svcMode.context().GetSite(), 00334 svcMode.context().GetDetId()); 00335 std::map<DayaBay::Detector,std::vector<DayaBay::PoolPmtSensor> >::iterator iter; 00336 iter = m_poolPmtSensorsBySiteDet.find(siteDetId); 00337 if( iter != m_poolPmtSensorsBySiteDet.end() ){ 00338 // Found site / det 00339 return iter->second; 00340 } 00341 std::ostringstream msgStr; 00342 msgStr << "poolPmtSensors(): No sensors for site / detector ID: "<< siteDetId; 00343 msg->reportMessage("StaticCableSvc",MSG::WARNING,msgStr.str()); 00344 return m_poolPmtSensorsBySiteDet[s_unknownSiteDet]; 00345 }
const std::vector< DayaBay::RpcSensor > & StaticCableSvc::rpcSensors | ( | const ServiceMode & | svcMode | ) | [virtual] |
Implements ICableSvc.
Definition at line 347 of file StaticCableSvc.cc.
00348 { 00349 if( m_first ) initMap(svcMode); 00350 DayaBay::Detector siteDetId(svcMode.context().GetSite(), 00351 svcMode.context().GetDetId()); 00352 std::map<DayaBay::Detector,std::vector<DayaBay::RpcSensor> >::iterator iter; 00353 iter = m_rpcSensorsBySiteDet.find(siteDetId); 00354 if( iter != m_rpcSensorsBySiteDet.end() ){ 00355 // Found site / det 00356 return iter->second; 00357 } 00358 std::ostringstream msgStr; 00359 msgStr << "rpcSensors(): No sensors for site / detector ID: "<< siteDetId; 00360 msg->reportMessage("StaticCableSvc",MSG::WARNING,msgStr.str()); 00361 return m_rpcSensorsBySiteDet[s_unknownSiteDet]; 00362 }
const std::vector< DayaBay::ElecChannelId > & StaticCableSvc::elecChannelIds | ( | const ServiceMode & | svcMode | ) | [virtual] |
Implements ICableSvc.
Definition at line 364 of file StaticCableSvc.cc.
00365 { 00366 if( m_first ) initMap(svcMode); 00367 DayaBay::Detector siteDetId(svcMode.context().GetSite(), 00368 svcMode.context().GetDetId()); 00369 std::map<DayaBay::Detector,std::vector<DayaBay::ElecChannelId> >::iterator iter; 00370 iter = m_elecChannelIdsBySiteDet.find(siteDetId); 00371 if( iter != m_elecChannelIdsBySiteDet.end() ){ 00372 // Found site / det 00373 return iter->second; 00374 } 00375 std::ostringstream msgStr; 00376 msgStr << "elecChannelIds(): No sensors for site / detector ID: "<< siteDetId; 00377 msg->reportMessage("StaticCableSvc",MSG::WARNING,msgStr.str()); 00378 return m_elecChannelIdsBySiteDet[s_unknownSiteDet]; 00379 }
const std::vector< DayaBay::FeeChannelId > & StaticCableSvc::feeChannelIds | ( | const ServiceMode & | svcMode | ) | [virtual] |
Implements ICableSvc.
Definition at line 381 of file StaticCableSvc.cc.
00382 { 00383 if( m_first ) initMap(svcMode); 00384 DayaBay::Detector siteDetId(svcMode.context().GetSite(), 00385 svcMode.context().GetDetId()); 00386 std::map<DayaBay::Detector,std::vector<DayaBay::FeeChannelId> >::iterator iter; 00387 iter = m_feeChannelIdsBySiteDet.find(siteDetId); 00388 if( iter != m_feeChannelIdsBySiteDet.end() ){ 00389 // Found site / det 00390 return iter->second; 00391 } 00392 std::ostringstream msgStr; 00393 msgStr << "feeChannelIds(): No sensors for site / detector ID: " << siteDetId; 00394 msg->reportMessage("StaticCableSvc",MSG::WARNING,msgStr.str()); 00395 return m_feeChannelIdsBySiteDet[s_unknownSiteDet]; 00396 }
const std::vector< DayaBay::FecChannelId > & StaticCableSvc::fecChannelIds | ( | const ServiceMode & | svcMode | ) | [virtual] |
Implements ICableSvc.
Definition at line 398 of file StaticCableSvc.cc.
00399 { 00400 if( m_first ) initMap(svcMode); 00401 DayaBay::Detector siteDetId(svcMode.context().GetSite(), 00402 svcMode.context().GetDetId()); 00403 std::map<DayaBay::Detector,std::vector<DayaBay::FecChannelId> >::iterator iter; 00404 iter = m_fecChannelIdsBySiteDet.find(siteDetId); 00405 if( iter != m_fecChannelIdsBySiteDet.end() ){ 00406 // Found site / det 00407 return iter->second; 00408 } 00409 std::ostringstream msgStr; 00410 msgStr << "fecChannelIds(): No sensors for site / detector ID: " << siteDetId; 00411 msg->reportMessage("StaticCableSvc",MSG::WARNING,msgStr.str()); 00412 return m_fecChannelIdsBySiteDet[s_unknownSiteDet]; 00413 }
DayaBay::ElecChannelId StaticCableSvc::elecChannelId | ( | const DayaBay::DetectorSensor & | sensId, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 415 of file StaticCableSvc.cc.
00418 { 00419 if( m_first ) initMap(svcMode); 00420 std::map<DayaBay::DetectorSensor,DayaBay::ElecChannelId>::iterator iter; 00421 iter = m_channelBySensor.find(sensId); 00422 if( iter != m_channelBySensor.end() ){ 00423 // Found channel 00424 return iter->second; 00425 } 00426 std::ostringstream msgStr; 00427 msgStr << "elecChannelId(): No electronics channel for sensor ID: " << sensId; 00428 msg->reportMessage("StaticCableSvc",MSG::WARNING,msgStr.str()); 00429 return DayaBay::ElecChannelId(0); 00430 }
DayaBay::FeeChannelId StaticCableSvc::feeChannelId | ( | const DayaBay::AdPmtSensor & | sensId, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 432 of file StaticCableSvc.cc.
00435 { 00436 if( m_first ) initMap(svcMode); 00437 return DayaBay::FeeChannelId(elecChannelId(sensId,svcMode).fullPackedData()); 00438 }
DayaBay::FeeChannelId StaticCableSvc::feeChannelId | ( | const DayaBay::PoolPmtSensor & | sensId, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 440 of file StaticCableSvc.cc.
00443 { 00444 if( m_first ) initMap(svcMode); 00445 return DayaBay::FeeChannelId(elecChannelId(sensId,svcMode).fullPackedData()); 00446 }
DayaBay::FecChannelId StaticCableSvc::fecChannelId | ( | const DayaBay::RpcSensor & | sensId, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 448 of file StaticCableSvc.cc.
00451 { 00452 if( m_first ) initMap(svcMode); 00453 return DayaBay::FecChannelId(elecChannelId(sensId,svcMode).fullPackedData()); 00454 }
DayaBay::DetectorSensor StaticCableSvc::sensor | ( | const DayaBay::ElecChannelId & | elecChannel, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 456 of file StaticCableSvc.cc.
00459 { 00460 if( m_first ) initMap(svcMode); 00461 std::map<DayaBay::ElecChannelId,DayaBay::DetectorSensor>::iterator iter; 00462 iter = m_sensorByChannel.find(elecChannel); 00463 if( iter != m_sensorByChannel.end() ){ 00464 // Found sensor 00465 return iter->second; 00466 } 00467 std::ostringstream msgStr; 00468 msgStr << "elecChannelId(): No sensor ID for electronics channel: " 00469 << elecChannel; 00470 msg->reportMessage("StaticCableSvc",MSG::WARNING,msgStr.str()); 00471 return DayaBay::DetectorSensor(0); 00472 }
DayaBay::AdPmtSensor StaticCableSvc::adPmtSensor | ( | const DayaBay::FeeChannelId & | feeChannel, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 474 of file StaticCableSvc.cc.
00477 { 00478 if( m_first ) initMap(svcMode); 00479 return DayaBay::AdPmtSensor(sensor(feeChannel,svcMode).fullPackedData()); 00480 }
DayaBay::PoolPmtSensor StaticCableSvc::poolPmtSensor | ( | const DayaBay::FeeChannelId & | feeChannel, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 482 of file StaticCableSvc.cc.
00485 { 00486 if( m_first ) initMap(svcMode); 00487 return DayaBay::PoolPmtSensor(sensor(feeChannel,svcMode).fullPackedData()); 00488 }
DayaBay::RpcSensor StaticCableSvc::rpcSensor | ( | const DayaBay::FecChannelId & | fecChannel, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 490 of file StaticCableSvc.cc.
00493 { 00494 if( m_first ) initMap(svcMode); 00495 return DayaBay::RpcSensor(sensor(fecChannel,svcMode).fullPackedData()); 00496 }
DayaBay::HardwareId StaticCableSvc::hardwareId | ( | const DayaBay::DetectorSensor & | sensId, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 498 of file StaticCableSvc.cc.
00501 { 00502 if( m_first ) initMap(svcMode); 00503 std::map<DayaBay::DetectorSensor,DayaBay::HardwareId>::iterator iter; 00504 iter = m_hardwareBySensor.find(sensId); 00505 if( iter != m_hardwareBySensor.end() ){ 00506 // Found hardware 00507 return iter->second; 00508 } 00509 std::ostringstream msgStr; 00510 msgStr << "hardwareId(): No hardware ID for sensor ID: " << sensId; 00511 msg->reportMessage("StaticCableSvc",MSG::WARNING,msgStr.str()); 00512 return DayaBay::HardwareId(0); 00513 }
DayaBay::PmtHardwareId StaticCableSvc::pmtHardwareId | ( | const DayaBay::AdPmtSensor & | sensId, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 515 of file StaticCableSvc.cc.
00518 { 00519 if( m_first ) initMap(svcMode); 00520 return DayaBay::PmtHardwareId(hardwareId(sensId,svcMode).fullPackedData()); 00521 }
DayaBay::PmtHardwareId StaticCableSvc::pmtHardwareId | ( | const DayaBay::PoolPmtSensor & | sensId, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 523 of file StaticCableSvc.cc.
00526 { 00527 if( m_first ) initMap(svcMode); 00528 return DayaBay::PmtHardwareId(hardwareId(sensId,svcMode).fullPackedData()); 00529 }
DayaBay::RpcHardwareId StaticCableSvc::rpcHardwareId | ( | const DayaBay::RpcSensor & | sensId, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 531 of file StaticCableSvc.cc.
00534 { 00535 if( m_first ) initMap(svcMode); 00536 return DayaBay::RpcHardwareId(hardwareId(sensId,svcMode).fullPackedData()); 00537 }
DayaBay::DetectorSensor StaticCableSvc::sensor | ( | const DayaBay::HardwareId & | hardwareId, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 539 of file StaticCableSvc.cc.
00542 { 00543 if( m_first ) initMap(svcMode); 00544 std::map<DayaBay::HardwareId,DayaBay::DetectorSensor>::iterator iter; 00545 iter = m_sensorByHardware.find(hardwareId); 00546 if( iter != m_sensorByHardware.end() ){ 00547 // Found sensor 00548 return iter->second; 00549 } 00550 std::ostringstream msgStr; 00551 msgStr << "sensor(): No sensor for hardware ID: " << hardwareId; 00552 msg->reportMessage("StaticCableSvc",MSG::WARNING,msgStr.str()); 00553 return DayaBay::DetectorSensor(0); 00554 }
DayaBay::AdPmtSensor StaticCableSvc::adPmtSensor | ( | const DayaBay::PmtHardwareId & | pmtId, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 556 of file StaticCableSvc.cc.
00559 { 00560 if( m_first ) initMap(svcMode); 00561 return DayaBay::AdPmtSensor(sensor(pmtId,svcMode).fullPackedData()); 00562 }
DayaBay::PoolPmtSensor StaticCableSvc::poolPmtSensor | ( | const DayaBay::PmtHardwareId & | pmtId, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 564 of file StaticCableSvc.cc.
00567 { 00568 if( m_first ) initMap(svcMode); 00569 return DayaBay::PoolPmtSensor(sensor(pmtId,svcMode).fullPackedData()); 00570 }
DayaBay::RpcSensor StaticCableSvc::rpcSensor | ( | const DayaBay::RpcHardwareId & | rpcId, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 572 of file StaticCableSvc.cc.
00575 { 00576 if( m_first ) initMap(svcMode); 00577 return DayaBay::RpcSensor(sensor(rpcId, svcMode).fullPackedData()); 00578 }
DayaBay::HardwareId StaticCableSvc::hardwareId | ( | const DayaBay::ElecChannelId & | elecChannel, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 580 of file StaticCableSvc.cc.
00583 { 00584 if( m_first ) initMap(svcMode); 00585 std::map<DayaBay::ElecChannelId,DayaBay::HardwareId>::iterator iter; 00586 iter = m_hardwareByChannel.find(elecChannel); 00587 if( iter != m_hardwareByChannel.end() ){ 00588 // Found hardware 00589 return iter->second; 00590 } 00591 std::ostringstream msgStr; 00592 msgStr << "hardwareId(): No hardware ID for electronics channel: " 00593 << elecChannel; 00594 msg->reportMessage("StaticCableSvc",MSG::WARNING,msgStr.str()); 00595 return DayaBay::HardwareId(0); 00596 }
DayaBay::FeeHardwareId StaticCableSvc::feeHardwareId | ( | const DayaBay::FeeChannelId & | feeChannel, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 598 of file StaticCableSvc.cc.
00601 { 00602 if( m_first ) initMap(svcMode); 00603 return DayaBay::FeeHardwareId(hardwareId(feeChannel,svcMode).fullPackedData()); 00604 }
DayaBay::FecHardwareId StaticCableSvc::fecHardwareId | ( | const DayaBay::FecChannelId & | fecChannel, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 606 of file StaticCableSvc.cc.
00609 { 00610 if( m_first ) initMap(svcMode); 00611 return DayaBay::FecHardwareId(hardwareId(fecChannel,svcMode).fullPackedData()); 00612 }
DayaBay::ElecChannelId StaticCableSvc::elecChannelId | ( | const DayaBay::HardwareId & | hardwareId, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 614 of file StaticCableSvc.cc.
00617 { 00618 if( m_first ) initMap(svcMode); 00619 std::map<DayaBay::HardwareId,DayaBay::ElecChannelId>::iterator iter; 00620 iter = m_channelByHardware.find(hardwareId); 00621 if( iter != m_channelByHardware.end() ){ 00622 // Found channel 00623 return iter->second; 00624 } 00625 std::ostringstream msgStr; 00626 msgStr << "elecChannelId(): No electronics channel for hardware ID: " 00627 << hardwareId; 00628 msg->reportMessage("StaticCableSvc",MSG::WARNING,msgStr.str()); 00629 return DayaBay::ElecChannelId(0); 00630 }
DayaBay::FeeChannelId StaticCableSvc::feeChannelId | ( | const DayaBay::FeeHardwareId & | feeHardwareId, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 632 of file StaticCableSvc.cc.
00635 { 00636 if( m_first ) initMap(svcMode); 00637 return DayaBay::FeeChannelId(elecChannelId(feeHardwareId,svcMode).fullPackedData()); 00638 }
DayaBay::FecChannelId StaticCableSvc::fecChannelId | ( | const DayaBay::FecHardwareId & | fecHardwareId, | |
const ServiceMode & | svcMode | |||
) | [virtual] |
Implements ICableSvc.
Definition at line 640 of file StaticCableSvc.cc.
00643 { 00644 if( m_first ) initMap(svcMode); 00645 return DayaBay::FecChannelId(elecChannelId(fecHardwareId,svcMode).fullPackedData()); 00646 }
StatusCode StaticCableSvc::initMap | ( | const ServiceMode & | svcMode | ) | [private] |
Here the real CableMap file will be loaded.
Master CableMap file. In case no FeeCableMap file specified, it will try to find one from there.
Not implemented yet !!!
Definition at line 42 of file StaticCableSvc.cc.
00043 { 00044 // Prepare the message service for reporting 00045 msg = msgSvc(); 00046 if( !msg ){ 00047 return StatusCode::FAILURE; 00048 } 00049 MsgStream log(msgSvc(), "StaticCableSvc"); 00050 00051 if(m_feeCableFileName=="") { 00052 msg->reportMessage("StaticCableSvc",MSG::INFO, 00053 "No FeeCableMap file specified. Loading one based on Master.CableMap.txt"); 00054 00057 std::string MasterCableMapFile = "Master.CableMap.txt"; 00058 std::string Path = getenv ("DATASVCROOT"); 00059 std::ifstream m_masterCableMap( (Path+"/share/"+MasterCableMapFile).c_str() ); 00060 00061 if( !m_masterCableMap.is_open() ){ 00062 msg->reportMessage("StaticCableSvc",MSG::ERROR,"Fail to open Master.CableMap.txt"); 00063 return StatusCode::FAILURE; 00064 } 00065 00066 int StartRun,EndRun; 00067 int Sites; 00068 int SimFlag, StartTimeSec, StartTimeNanoSec, EndTimeSec, EndTimeNanoSec; 00069 std::string MapFile; 00070 00071 std::string line; 00072 00073 while( std::getline( m_masterCableMap, line ) ){ 00074 std::stringstream streamLine(line); 00075 if( streamLine.peek() == '#' ){ 00076 continue; 00077 } 00078 streamLine >>StartRun >>EndRun >>Sites 00079 >>SimFlag >>StartTimeSec>> StartTimeNanoSec >>EndTimeSec >>EndTimeNanoSec 00080 >>MapFile; 00081 00082 ContextRange CRange( Sites, SimFlag, 00083 TimeStamp( StartTimeSec, StartTimeNanoSec ), 00084 TimeStamp( EndTimeSec, EndTimeNanoSec ) ); 00085 00086 const Context &cont = svcMode.context(); 00087 00088 /* 00089 std::cout<< "Searching: "<<cont.GetSite()<<" "<<cont.GetSimFlag()<<std::endl; 00090 std::cout<< cont.GetTimeStamp().AsString()<<std::endl; 00091 std::cout<<"Start: "<<TimeStamp( StartTimeSec, StartTimeNanoSec ).AsString()<<std::endl; 00092 std::cout<<"End: "<<TimeStamp( EndTimeSec, EndTimeNanoSec ).AsString()<<std::endl; 00093 */ 00094 00095 if( CRange.IsCompatible( cont ) ) { 00096 m_feeCableFileName = Path + "/share/" + MapFile; 00097 } 00098 00099 } 00100 00101 } 00102 00103 if(m_fecCableFileName=="") { 00105 } 00106 00107 00108 if(m_feeCableFileName!=""){ 00109 00110 msg->reportMessage("StaticCableSvc",MSG::INFO,("FeeCableMap: "+m_feeCableFileName).c_str()); 00111 00112 std::ifstream input( m_feeCableFileName.c_str() ); 00113 if( !input.is_open() ){ 00114 std::ostringstream msgStr; 00115 msgStr << "Failed to open input file: " << m_feeCableFileName; 00116 msg->reportMessage("StaticCableSvc",MSG::ERROR,msgStr.str()); 00117 return StatusCode::FAILURE; 00118 } 00119 int site, detectorId, feeBoard, feeBoardSerial, feeConnector; 00120 int adPmtRing, adPmtColumn, poolPmtWallNumber, poolPmtWallSpot; 00121 int poolPmtInwardFacing, pmtHardwareType, pmtSerialNumber; 00122 std::string line; 00123 while( std::getline(input,line) ){ 00124 std::stringstream streamLine(line); 00125 if( streamLine.peek() == '#' ){ 00126 continue; 00127 } 00128 streamLine >> site >> detectorId >> feeBoard >> feeBoardSerial 00129 >> feeConnector >> adPmtRing >> adPmtColumn 00130 >> poolPmtWallNumber >> poolPmtWallSpot 00131 >> poolPmtInwardFacing >> pmtHardwareType 00132 >> pmtSerialNumber; 00133 DayaBay::FeeChannelId feeChannel(feeBoard, feeConnector, 00134 (Site::Site_t)site, 00135 (DetectorId::DetectorId_t)detectorId); 00136 DayaBay::FeeHardwareId feeHardware(feeBoardSerial, feeConnector); 00137 DayaBay::PmtHardwareId pmtHardware(pmtSerialNumber, 00138 (DayaBay::Hardware::Hardware_t)pmtHardwareType); 00139 // Make map by site / detector 00140 DayaBay::Detector siteId((Site::Site_t)site, DetectorId::kAll); 00141 DayaBay::Detector detector((Site::Site_t)site, 00142 (DetectorId::DetectorId_t)detectorId); 00143 m_elecChannelIdsBySiteDet[s_allSiteDet].push_back(feeChannel); 00144 m_elecChannelIdsBySiteDet[siteId].push_back(feeChannel); 00145 m_elecChannelIdsBySiteDet[detector].push_back(feeChannel); 00146 m_feeChannelIdsBySiteDet[s_allSiteDet].push_back(feeChannel); 00147 m_feeChannelIdsBySiteDet[siteId].push_back(feeChannel); 00148 m_feeChannelIdsBySiteDet[detector].push_back(feeChannel); 00149 // Make hardware connections 00150 m_channelByHardware[feeHardware] = feeChannel; 00151 m_hardwareByChannel[feeChannel] = feeHardware; 00152 00153 // Make PMT connections 00154 int sensorId = 0; 00155 if( adPmtColumn!=0 ){ 00156 // AD PMT 00157 DayaBay::AdPmtSensor pmtId(adPmtRing, adPmtColumn, 00158 (Site::Site_t)site, 00159 (DetectorId::DetectorId_t)detectorId); 00160 sensorId = pmtId.fullPackedData(); 00161 }else if( poolPmtWallNumber!=0 ){ 00162 // Pool PMT 00163 DayaBay::PoolPmtSensor pmtId(poolPmtWallNumber, poolPmtWallSpot, 00164 poolPmtInwardFacing, 00165 (Site::Site_t)site, 00166 (DetectorId::DetectorId_t)detectorId); 00167 sensorId = pmtId.fullPackedData(); 00168 } 00169 if( sensorId == 0 ){ 00170 // Unconnected FEE channel 00171 continue; 00172 } 00173 DayaBay::DetectorSensor sensor(sensorId); 00174 00175 m_sensorsBySiteDet[s_allSiteDet].push_back(sensor); 00176 m_sensorsBySiteDet[siteId].push_back(sensor); 00177 m_sensorsBySiteDet[detector].push_back(sensor); 00178 m_channelBySensor[sensor] = feeChannel; 00179 m_sensorByChannel[feeChannel] = sensor; 00180 m_hardwareBySensor[sensor] = pmtHardware; 00181 m_sensorByHardware[pmtHardware] = sensor; 00182 if(sensor.detectorId() == DetectorId::kIWS 00183 || sensor.detectorId() == DetectorId::kOWS){ 00184 DayaBay::PoolPmtSensor poolPmt(sensorId); 00185 if (poolPmt.bogus()) { 00186 log << "Warning: got bogus Pool PMT ID: " << poolPmt 00187 << " while parsing line:\"" << line << "\"" 00188 << endreq; 00189 } 00190 m_poolPmtSensorsBySiteDet[s_allSiteDet].push_back(poolPmt); 00191 m_poolPmtSensorsBySiteDet[siteId].push_back(poolPmt); 00192 m_poolPmtSensorsBySiteDet[detector].push_back(poolPmt); 00193 }else{ 00194 DayaBay::AdPmtSensor adPmt(sensorId); 00195 if (adPmt.bogus()) { 00196 log << "Warning: got bogus AD PMT ID: " << adPmt 00197 << " while parsing line:\"" << line << "\"" 00198 << endreq; 00199 } 00200 m_adPmtSensorsBySiteDet[s_allSiteDet].push_back(adPmt); 00201 m_adPmtSensorsBySiteDet[siteId].push_back(adPmt); 00202 m_adPmtSensorsBySiteDet[detector].push_back(adPmt); 00203 } 00204 } 00205 } 00206 00207 if(m_fecCableFileName!=""){ 00208 00209 msg->reportMessage("StaticCableSvc",MSG::INFO,("FecCableMap: "+m_fecCableFileName).c_str()); 00210 00211 std::ostringstream msgStr; 00212 msgStr << "FEC Cable mapping not yet implemented! " << m_fecCableFileName; 00213 msg->reportMessage("StaticCableSvc",MSG::ERROR,msgStr.str()); 00214 return StatusCode::FAILURE; 00215 } 00216 00217 m_first = false; 00218 00219 return StatusCode::SUCCESS; 00220 }
static const InterfaceID& ICableSvc::interfaceID | ( | ) | [inline, static, inherited] |
Reimplemented from IInterface.
Definition at line 28 of file ICableSvc.h.
00028 { 00029 return IID_ICableSvc; 00030 }
IMessageSvc* StaticCableSvc::msg [private] |
Definition at line 159 of file StaticCableSvc.h.
DayaBay::Detector StaticCableSvc::s_unknownSiteDet [static, private] |
Initial value:
Definition at line 162 of file StaticCableSvc.h.
DayaBay::Detector StaticCableSvc::s_allSiteDet [static, private] |
Initial value:
Definition at line 163 of file StaticCableSvc.h.
std::string StaticCableSvc::m_feeCableFileName [private] |
Definition at line 166 of file StaticCableSvc.h.
std::string StaticCableSvc::m_fecCableFileName [private] |
Definition at line 169 of file StaticCableSvc.h.
bool StaticCableSvc::m_first [private] |
std::vector<DayaBay::HardwareId> StaticCableSvc::m_hardwareIds [private] |
Definition at line 178 of file StaticCableSvc.h.
std::vector<DayaBay::PmtHardwareId> StaticCableSvc::m_pmtHardwareIds [private] |
Definition at line 179 of file StaticCableSvc.h.
std::vector<DayaBay::RpcHardwareId> StaticCableSvc::m_rpcHardwareIds [private] |
Definition at line 180 of file StaticCableSvc.h.
std::vector<DayaBay::FeeHardwareId> StaticCableSvc::m_feeHardwareIds [private] |
Definition at line 181 of file StaticCableSvc.h.
std::vector<DayaBay::FecHardwareId> StaticCableSvc::m_fecHardwareIds [private] |
Definition at line 182 of file StaticCableSvc.h.
std::vector<DayaBay::DetectorSensor> StaticCableSvc::m_sensors [private] |
Definition at line 185 of file StaticCableSvc.h.
std::vector<DayaBay::AdPmtSensor> StaticCableSvc::m_adPmtSensors [private] |
Definition at line 186 of file StaticCableSvc.h.
std::vector<DayaBay::PoolPmtSensor> StaticCableSvc::m_poolPmtSensors [private] |
Definition at line 187 of file StaticCableSvc.h.
std::vector<DayaBay::RpcSensor> StaticCableSvc::m_rpcSensors [private] |
Definition at line 188 of file StaticCableSvc.h.
std::vector<DayaBay::ElecChannelId> StaticCableSvc::m_elecChannelIds [private] |
Definition at line 191 of file StaticCableSvc.h.
std::vector<DayaBay::FeeChannelId> StaticCableSvc::m_feeChannelIds [private] |
Definition at line 192 of file StaticCableSvc.h.
std::vector<DayaBay::FecChannelId> StaticCableSvc::m_fecChannelIds [private] |
Definition at line 193 of file StaticCableSvc.h.
std::map<DayaBay::Detector,std::vector<DayaBay::DetectorSensor> > StaticCableSvc::m_sensorsBySiteDet [private] |
Definition at line 196 of file StaticCableSvc.h.
std::map<DayaBay::Detector,std::vector<DayaBay::AdPmtSensor> > StaticCableSvc::m_adPmtSensorsBySiteDet [private] |
Definition at line 197 of file StaticCableSvc.h.
std::map<DayaBay::Detector,std::vector<DayaBay::PoolPmtSensor> > StaticCableSvc::m_poolPmtSensorsBySiteDet [private] |
Definition at line 198 of file StaticCableSvc.h.
std::map<DayaBay::Detector,std::vector<DayaBay::RpcSensor> > StaticCableSvc::m_rpcSensorsBySiteDet [private] |
Definition at line 199 of file StaticCableSvc.h.
std::map<DayaBay::Detector,std::vector<DayaBay::ElecChannelId> > StaticCableSvc::m_elecChannelIdsBySiteDet [private] |
Definition at line 202 of file StaticCableSvc.h.
std::map<DayaBay::Detector,std::vector<DayaBay::FeeChannelId> > StaticCableSvc::m_feeChannelIdsBySiteDet [private] |
Definition at line 203 of file StaticCableSvc.h.
std::map<DayaBay::Detector,std::vector<DayaBay::FecChannelId> > StaticCableSvc::m_fecChannelIdsBySiteDet [private] |
Definition at line 204 of file StaticCableSvc.h.
std::map<DayaBay::DetectorSensor,DayaBay::ElecChannelId> StaticCableSvc::m_channelBySensor [private] |
Definition at line 207 of file StaticCableSvc.h.
std::map<DayaBay::ElecChannelId,DayaBay::DetectorSensor> StaticCableSvc::m_sensorByChannel [private] |
Definition at line 208 of file StaticCableSvc.h.
Definition at line 211 of file StaticCableSvc.h.
Definition at line 212 of file StaticCableSvc.h.
Definition at line 215 of file StaticCableSvc.h.
Definition at line 216 of file StaticCableSvc.h.