/search.css" rel="stylesheet" type="text/css"/> /search.js">
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
DbiCableSvc Class Reference

#include <DbiCableSvc.h>

Inheritance diagram for DbiCableSvc:
Inheritance graph
[legend]
Collaboration diagram for DbiCableSvc:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DbiCableSvc (const std::string &name, ISvcLocator *svc)
 ~DbiCableSvc ()
virtual StatusCode initialize ()
virtual StatusCode finalize ()
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
const std::vector
< DayaBay::HardwareId > & 
hardwareIds (const ServiceMode &svcMode)
const std::vector
< DayaBay::PmtHardwareId > & 
pmtHardwareIds (const ServiceMode &svcMode)
const std::vector
< DayaBay::RpcHardwareId > & 
rpcHardwareIds (const ServiceMode &svcMode)
const std::vector
< DayaBay::FeeHardwareId > & 
feeHardwareIds (const ServiceMode &svcMode)
const std::vector
< DayaBay::FecHardwareId > & 
fecHardwareIds (const ServiceMode &svcMode)
const std::vector
< DayaBay::DetectorSensor > & 
sensors (const ServiceMode &svcMode)
const std::vector
< DayaBay::AdPmtSensor > & 
adPmtSensors (const ServiceMode &svcMode)
const std::vector
< DayaBay::PoolPmtSensor > & 
poolPmtSensors (const ServiceMode &svcMode)
const std::vector
< DayaBay::RpcSensor > & 
rpcSensors (const ServiceMode &svcMode)
const std::vector
< DayaBay::ElecChannelId > & 
elecChannelIds (const ServiceMode &svcMode)
const std::vector
< DayaBay::FeeChannelId > & 
feeChannelIds (const ServiceMode &svcMode)
const std::vector
< DayaBay::FecChannelId > & 
fecChannelIds (const ServiceMode &svcMode)
DayaBay::ElecChannelId elecChannelId (const DayaBay::DetectorSensor &sensId, const ServiceMode &svcMode)
DayaBay::FeeChannelId feeChannelId (const DayaBay::AdPmtSensor &sensId, const ServiceMode &svcMode)
DayaBay::FeeChannelId feeChannelId (const DayaBay::PoolPmtSensor &sensId, const ServiceMode &svcMode)
DayaBay::FecChannelId fecChannelId (const DayaBay::RpcSensor &sensId, const ServiceMode &svcMode)
DayaBay::DetectorSensor sensor (const DayaBay::ElecChannelId &elecChannel, const ServiceMode &svcMode)
DayaBay::AdPmtSensor adPmtSensor (const DayaBay::FeeChannelId &feeChannel, const ServiceMode &svcMode)
DayaBay::PoolPmtSensor poolPmtSensor (const DayaBay::FeeChannelId &feeChannel, const ServiceMode &svcMode)
DayaBay::RpcSensor rpcSensor (const DayaBay::FecChannelId &fecChannel, const ServiceMode &svcMode)
DayaBay::HardwareId hardwareId (const DayaBay::DetectorSensor &sensId, const ServiceMode &svcMode)
DayaBay::PmtHardwareId pmtHardwareId (const DayaBay::AdPmtSensor &sensId, const ServiceMode &svcMode)
DayaBay::PmtHardwareId pmtHardwareId (const DayaBay::PoolPmtSensor &sensId, const ServiceMode &svcMode)
DayaBay::RpcHardwareId rpcHardwareId (const DayaBay::RpcSensor &sensId, const ServiceMode &svcMode)
DayaBay::DetectorSensor sensor (const DayaBay::HardwareId &hardwareId, const ServiceMode &svcMode)
DayaBay::AdPmtSensor adPmtSensor (const DayaBay::PmtHardwareId &pmtId, const ServiceMode &svcMode)
DayaBay::PoolPmtSensor poolPmtSensor (const DayaBay::PmtHardwareId &pmtId, const ServiceMode &svcMode)
DayaBay::RpcSensor rpcSensor (const DayaBay::RpcHardwareId &rpcId, const ServiceMode &svcMode)
DayaBay::HardwareId hardwareId (const DayaBay::ElecChannelId &elecChannel, const ServiceMode &svcMode)
DayaBay::FeeHardwareId feeHardwareId (const DayaBay::FeeChannelId &feeChannel, const ServiceMode &svcMode)
DayaBay::FecHardwareId fecHardwareId (const DayaBay::FecChannelId &fecChannel, const ServiceMode &svcMode)
DayaBay::ElecChannelId elecChannelId (const DayaBay::HardwareId &hardwareId, const ServiceMode &svcMode)
DayaBay::FeeChannelId feeChannelId (const DayaBay::FeeHardwareId &feeHardwareId, const ServiceMode &svcMode)
DayaBay::FecChannelId fecChannelId (const DayaBay::FecHardwareId &fecHardwareId, const ServiceMode &svcMode)

Static Public Member Functions

static const InterfaceID & interfaceID ()

Private Member Functions

void readFeeTable (const ServiceMode &)

Private Attributes

IMessageSvc * msg
std::vector< DayaBay::HardwareIdm_hardwareIds
std::vector
< DayaBay::PmtHardwareId
m_pmtHardwareIds
std::vector
< DayaBay::RpcHardwareId
m_rpcHardwareIds
std::vector
< DayaBay::FeeHardwareId
m_feeHardwareIds
std::vector
< DayaBay::FecHardwareId
m_fecHardwareIds
std::vector
< DayaBay::DetectorSensor
m_sensors
std::vector< DayaBay::AdPmtSensorm_adPmtSensors
std::vector
< DayaBay::PoolPmtSensor
m_poolPmtSensors
std::vector< DayaBay::RpcSensorm_rpcSensors
std::vector
< DayaBay::ElecChannelId
m_elecChannelIds
std::vector
< DayaBay::FeeChannelId
m_feeChannelIds
std::vector
< DayaBay::FecChannelId
m_fecChannelIds
std::map< DayaBay::Detector,
std::vector
< DayaBay::DetectorSensor > > 
m_sensorsBySiteDet
std::map< DayaBay::Detector,
std::vector
< DayaBay::AdPmtSensor > > 
m_adPmtSensorsBySiteDet
std::map< DayaBay::Detector,
std::vector
< DayaBay::PoolPmtSensor > > 
m_poolPmtSensorsBySiteDet
std::map< DayaBay::Detector,
std::vector
< DayaBay::RpcSensor > > 
m_rpcSensorsBySiteDet
std::map< DayaBay::Detector,
std::vector
< DayaBay::ElecChannelId > > 
m_elecChannelIdsBySiteDet
std::map< DayaBay::Detector,
std::vector
< DayaBay::FeeChannelId > > 
m_feeChannelIdsBySiteDet
std::map< DayaBay::Detector,
std::vector
< DayaBay::FecChannelId > > 
m_fecChannelIdsBySiteDet
std::map
< DayaBay::DetectorSensor,
DayaBay::ElecChannelId
m_channelBySensor
std::map
< DayaBay::ElecChannelId,
DayaBay::DetectorSensor
m_sensorByChannel
std::map
< DayaBay::DetectorSensor,
DayaBay::HardwareId
m_hardwareBySensor
std::map< DayaBay::HardwareId,
DayaBay::DetectorSensor
m_sensorByHardware
std::map
< DayaBay::ElecChannelId,
DayaBay::HardwareId
m_hardwareByChannel
std::map< DayaBay::HardwareId,
DayaBay::ElecChannelId
m_channelByHardware
Context feeLastContext
const DbiResultKeyfeeLastResult

Static Private Attributes

static DayaBay::Detector s_unknownSiteDet
static DayaBay::Detector s_allSiteDet

Detailed Description

Definition at line 27 of file DbiCableSvc.h.


Constructor & Destructor Documentation

DbiCableSvc::DbiCableSvc ( const std::string &  name,
ISvcLocator *  svc 
)

Definition at line 31 of file DbiCableSvc.cc.

    : Service(name,svc)
{
}
DbiCableSvc::~DbiCableSvc ( )

Definition at line 36 of file DbiCableSvc.cc.

{
}

Member Function Documentation

StatusCode DbiCableSvc::initialize ( ) [virtual]

Definition at line 40 of file DbiCableSvc.cc.

{
    this->Service::initialize();

    // Prepare the message service for reporting
/*  IMessageSvc* msg = msgSvc();//cxs 2010-12-7
    if( !msg ){    
      return StatusCode::FAILURE;
    }
*/
    MsgStream msg(msgSvc(),name());
    feeLastResult = 0;   //cxs 2010-10-28.
    return StatusCode::SUCCESS;
}
StatusCode DbiCableSvc::finalize ( ) [virtual]

Definition at line 55 of file DbiCableSvc.cc.

{
    return this->Service::finalize();
}
StatusCode DbiCableSvc::queryInterface ( const InterfaceID &  riid,
void **  ppvInterface 
) [virtual]

Definition at line 60 of file DbiCableSvc.cc.

{
    StatusCode sc = StatusCode::FAILURE;
    if (ppvInterface) {
        *ppvInterface = 0;
    
        if (ICableSvc::interfaceID().versionMatch(riid)) {
            *ppvInterface = static_cast<ICableSvc*>(this);
            sc = StatusCode::SUCCESS;
            addRef();
        }
        else sc = Service::queryInterface( riid, ppvInterface );    
    }
    return sc;
}
const std::vector< DayaBay::HardwareId > & DbiCableSvc::hardwareIds ( const ServiceMode svcMode) [virtual]

Implements ICableSvc.

Definition at line 77 of file DbiCableSvc.cc.

{
  readFeeTable(serviceMode);
  return m_hardwareIds;
}
const std::vector< DayaBay::PmtHardwareId > & DbiCableSvc::pmtHardwareIds ( const ServiceMode svcMode) [virtual]

Implements ICableSvc.

Definition at line 83 of file DbiCableSvc.cc.

{
  readFeeTable(serviceMode);
  return m_pmtHardwareIds;
}
const std::vector< DayaBay::RpcHardwareId > & DbiCableSvc::rpcHardwareIds ( const ServiceMode svcMode) [virtual]

Implements ICableSvc.

Definition at line 89 of file DbiCableSvc.cc.

{
  readFeeTable(serviceMode);
  return m_rpcHardwareIds;
}
const std::vector< DayaBay::FeeHardwareId > & DbiCableSvc::feeHardwareIds ( const ServiceMode svcMode) [virtual]

Implements ICableSvc.

Definition at line 95 of file DbiCableSvc.cc.

{
  readFeeTable(serviceMode);
  return m_feeHardwareIds;
}
const std::vector< DayaBay::FecHardwareId > & DbiCableSvc::fecHardwareIds ( const ServiceMode svcMode) [virtual]

Implements ICableSvc.

Definition at line 101 of file DbiCableSvc.cc.

{
  readFeeTable(serviceMode);
  return m_fecHardwareIds;
}
const std::vector< DayaBay::DetectorSensor > & DbiCableSvc::sensors ( const ServiceMode svcMode) [virtual]

Implements ICableSvc.

Definition at line 107 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  DayaBay::Detector siteDetId(svcMode.context().GetSite(), 
                              svcMode.context().GetDetId());
  std::map<DayaBay::Detector,std::vector<DayaBay::DetectorSensor> >::iterator iter;
  iter = m_sensorsBySiteDet.find(siteDetId);
  if( iter != m_sensorsBySiteDet.end() ){
    // Found site / det
    return iter->second;
  }
  std::ostringstream msgStr;
/*msgStr << "sensors(): No sensors for site / detector ID: " << siteDetId; //cxs 2010-12-8
  msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
*/
  return m_sensorsBySiteDet[s_unknownSiteDet];
}
const std::vector< DayaBay::AdPmtSensor > & DbiCableSvc::adPmtSensors ( const ServiceMode svcMode) [virtual]

Implements ICableSvc.

Definition at line 125 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  DayaBay::Detector siteDetId(svcMode.context().GetSite(), 
                              svcMode.context().GetDetId());
  std::map<DayaBay::Detector,std::vector<DayaBay::AdPmtSensor> >::iterator iter;
  iter = m_adPmtSensorsBySiteDet.find(siteDetId);
  if( iter != m_adPmtSensorsBySiteDet.end() ){
    // Found site / det
    return iter->second;
  }
  std::ostringstream msgStr;
/*msgStr << "adPmtSensors(): No sensors for site / detector ID: " << siteDetId; //cxs 2010-12-8
  msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
*/
  return m_adPmtSensorsBySiteDet[s_unknownSiteDet];
}
const std::vector< DayaBay::PoolPmtSensor > & DbiCableSvc::poolPmtSensors ( const ServiceMode svcMode) [virtual]

Implements ICableSvc.

Definition at line 143 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  DayaBay::Detector siteDetId(svcMode.context().GetSite(), 
                              svcMode.context().GetDetId());
  std::map<DayaBay::Detector,std::vector<DayaBay::PoolPmtSensor> >::iterator iter;
  iter = m_poolPmtSensorsBySiteDet.find(siteDetId);
  if( iter != m_poolPmtSensorsBySiteDet.end() ){
    // Found site / det
    return iter->second;
  }
  std::ostringstream msgStr;
/*msgStr << "poolPmtSensors(): No sensors for site / detector ID: "<< siteDetId;//cxs 2010-12-8
  msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
*/
  return m_poolPmtSensorsBySiteDet[s_unknownSiteDet];
}
const std::vector< DayaBay::RpcSensor > & DbiCableSvc::rpcSensors ( const ServiceMode svcMode) [virtual]

Implements ICableSvc.

Definition at line 161 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  DayaBay::Detector siteDetId(svcMode.context().GetSite(), 
                              svcMode.context().GetDetId());
  std::map<DayaBay::Detector,std::vector<DayaBay::RpcSensor> >::iterator iter;
  iter = m_rpcSensorsBySiteDet.find(siteDetId);
  if( iter != m_rpcSensorsBySiteDet.end() ){
    // Found site / det
    return iter->second;
  }
  std::ostringstream msgStr;
/*msgStr << "rpcSensors(): No sensors for site / detector ID: "<< siteDetId;//cxs 2010-12-8
  msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
*/
  return m_rpcSensorsBySiteDet[s_unknownSiteDet];
}
const std::vector< DayaBay::ElecChannelId > & DbiCableSvc::elecChannelIds ( const ServiceMode svcMode) [virtual]

Implements ICableSvc.

Definition at line 179 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  DayaBay::Detector siteDetId(svcMode.context().GetSite(), 
                              svcMode.context().GetDetId());
  std::map<DayaBay::Detector,std::vector<DayaBay::ElecChannelId> >::iterator iter;
  iter = m_elecChannelIdsBySiteDet.find(siteDetId);
  if( iter != m_elecChannelIdsBySiteDet.end() ){
    // Found site / det
    return iter->second;
  }
  std::ostringstream msgStr;
/*msgStr << "elecChannelIds(): No sensors for site / detector ID: "<< siteDetId; //cxs 2010-12-8
  msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
*/
  return m_elecChannelIdsBySiteDet[s_unknownSiteDet];
}
const std::vector< DayaBay::FeeChannelId > & DbiCableSvc::feeChannelIds ( const ServiceMode svcMode) [virtual]

Implements ICableSvc.

Definition at line 197 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  DayaBay::Detector siteDetId(svcMode.context().GetSite(), 
                              svcMode.context().GetDetId());
  std::map<DayaBay::Detector,std::vector<DayaBay::FeeChannelId> >::iterator iter;
  iter = m_feeChannelIdsBySiteDet.find(siteDetId);
  if( iter != m_feeChannelIdsBySiteDet.end() ){
    // Found site / det
    return iter->second;
  }
  std::ostringstream msgStr;
/*msgStr << "feeChannelIds(): No sensors for site / detector ID: " << siteDetId; //cxs 2010-12-8
  msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
*/
  return m_feeChannelIdsBySiteDet[s_unknownSiteDet];
}
const std::vector< DayaBay::FecChannelId > & DbiCableSvc::fecChannelIds ( const ServiceMode svcMode) [virtual]

Implements ICableSvc.

Definition at line 215 of file DbiCableSvc.cc.

{
  DayaBay::Detector siteDetId(svcMode.context().GetSite(), 
                              svcMode.context().GetDetId());
  std::map<DayaBay::Detector,std::vector<DayaBay::FecChannelId> >::iterator iter;
  iter = m_fecChannelIdsBySiteDet.find(siteDetId);
  if( iter != m_fecChannelIdsBySiteDet.end() ){
    // Found site / det
    return iter->second;
  }
  std::ostringstream msgStr;
/*msgStr << "fecChannelIds(): No sensors for site / detector ID: " << siteDetId; //cxs 2010-12-8
  msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
*/
  return m_fecChannelIdsBySiteDet[s_unknownSiteDet];
}
DayaBay::ElecChannelId DbiCableSvc::elecChannelId ( const DayaBay::DetectorSensor sensId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 232 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  std::map<DayaBay::DetectorSensor,DayaBay::ElecChannelId>::iterator iter;
  iter = m_channelBySensor.find(sensId);
  if( iter != m_channelBySensor.end() ){
    // Found channel
    return iter->second;
  }
  std::ostringstream msgStr;
/*msgStr << "elecChannelId(): No electronics channel for sensor ID: " << sensId; //cxs 2010-12-8
  msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
*/
  return DayaBay::ElecChannelId(0);
}
DayaBay::FeeChannelId DbiCableSvc::feeChannelId ( const DayaBay::AdPmtSensor sensId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 250 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  return DayaBay::FeeChannelId(elecChannelId(sensId,svcMode).fullPackedData());
}
DayaBay::FeeChannelId DbiCableSvc::feeChannelId ( const DayaBay::PoolPmtSensor sensId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 258 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  return DayaBay::FeeChannelId(elecChannelId(sensId,svcMode).fullPackedData());
}
DayaBay::FecChannelId DbiCableSvc::fecChannelId ( const DayaBay::RpcSensor sensId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 266 of file DbiCableSvc.cc.

{
  return DayaBay::FecChannelId(elecChannelId(sensId,svcMode).fullPackedData());
}
DayaBay::DetectorSensor DbiCableSvc::sensor ( const DayaBay::ElecChannelId elecChannel,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 273 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  std::map<DayaBay::ElecChannelId,DayaBay::DetectorSensor>::iterator iter;
  iter = m_sensorByChannel.find(elecChannel);
  if( iter != m_sensorByChannel.end() ){
    // Found sensor
    return iter->second;
  }
  std::ostringstream msgStr;
/*msgStr << "elecChannelId(): No sensor ID for electronics channel: " //cxs 2010-12-8
         << elecChannel;
  msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
*/
  return DayaBay::DetectorSensor(0);
}
DayaBay::AdPmtSensor DbiCableSvc::adPmtSensor ( const DayaBay::FeeChannelId feeChannel,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 292 of file DbiCableSvc.cc.

{
  return DayaBay::AdPmtSensor(sensor(feeChannel,svcMode).fullPackedData());
}
DayaBay::PoolPmtSensor DbiCableSvc::poolPmtSensor ( const DayaBay::FeeChannelId feeChannel,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 299 of file DbiCableSvc.cc.

{
  return DayaBay::PoolPmtSensor(sensor(feeChannel,svcMode).fullPackedData());
}
DayaBay::RpcSensor DbiCableSvc::rpcSensor ( const DayaBay::FecChannelId fecChannel,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 306 of file DbiCableSvc.cc.

{
  return DayaBay::RpcSensor(sensor(fecChannel,svcMode).fullPackedData());
}
DayaBay::HardwareId DbiCableSvc::hardwareId ( const DayaBay::DetectorSensor sensId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 313 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  std::map<DayaBay::DetectorSensor,DayaBay::HardwareId>::iterator iter;
  iter = m_hardwareBySensor.find(sensId);
  if( iter != m_hardwareBySensor.end() ){
    // Found hardware
    return iter->second;
  }
  std::ostringstream msgStr;
/*msgStr << "hardwareId(): No hardware ID for sensor ID: " << sensId; //cxs 2010-12-8
  msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
*/
  return DayaBay::HardwareId(0);
}
DayaBay::PmtHardwareId DbiCableSvc::pmtHardwareId ( const DayaBay::AdPmtSensor sensId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 331 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  return DayaBay::PmtHardwareId(hardwareId(sensId,svcMode).fullPackedData());
}
DayaBay::PmtHardwareId DbiCableSvc::pmtHardwareId ( const DayaBay::PoolPmtSensor sensId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 339 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  return DayaBay::PmtHardwareId(hardwareId(sensId,svcMode).fullPackedData());
}
DayaBay::RpcHardwareId DbiCableSvc::rpcHardwareId ( const DayaBay::RpcSensor sensId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 347 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  return DayaBay::RpcHardwareId(hardwareId(sensId,svcMode).fullPackedData());
}
DayaBay::DetectorSensor DbiCableSvc::sensor ( const DayaBay::HardwareId hardwareId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 355 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  std::map<DayaBay::HardwareId,DayaBay::DetectorSensor>::iterator iter;
  iter = m_sensorByHardware.find(hardwareId);
  if( iter != m_sensorByHardware.end() ){
    // Found sensor
    return iter->second;
  }
  std::ostringstream msgStr;
/*msgStr << "sensor(): No sensor for hardware ID: " << hardwareId; //cxs 2010-12-8
  msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
*/
  return DayaBay::DetectorSensor(0);
}
DayaBay::AdPmtSensor DbiCableSvc::adPmtSensor ( const DayaBay::PmtHardwareId pmtId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 373 of file DbiCableSvc.cc.

{
  return DayaBay::AdPmtSensor(sensor(pmtId,svcMode).fullPackedData());
}
DayaBay::PoolPmtSensor DbiCableSvc::poolPmtSensor ( const DayaBay::PmtHardwareId pmtId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 380 of file DbiCableSvc.cc.

{
  return DayaBay::PoolPmtSensor(sensor(pmtId,svcMode).fullPackedData());
}
DayaBay::RpcSensor DbiCableSvc::rpcSensor ( const DayaBay::RpcHardwareId rpcId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 387 of file DbiCableSvc.cc.

{
  return DayaBay::RpcSensor(sensor(rpcId, svcMode).fullPackedData());
}
DayaBay::HardwareId DbiCableSvc::hardwareId ( const DayaBay::ElecChannelId elecChannel,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 394 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  std::map<DayaBay::ElecChannelId,DayaBay::HardwareId>::iterator iter;
  iter = m_hardwareByChannel.find(elecChannel);
  if( iter != m_hardwareByChannel.end() ){
    // Found hardware
    return iter->second;
  }
  std::ostringstream msgStr;
/*msgStr << "hardwareId(): No hardware ID for electronics channel: " //cxs 2010-12-8
         << elecChannel;
  msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
*/
  return DayaBay::HardwareId(0);
}
DayaBay::FeeHardwareId DbiCableSvc::feeHardwareId ( const DayaBay::FeeChannelId feeChannel,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 413 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  return DayaBay::FeeHardwareId(hardwareId(feeChannel,svcMode).fullPackedData());
}
DayaBay::FecHardwareId DbiCableSvc::fecHardwareId ( const DayaBay::FecChannelId fecChannel,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 421 of file DbiCableSvc.cc.

{
  return DayaBay::FecHardwareId(hardwareId(fecChannel,svcMode).fullPackedData());
}
DayaBay::ElecChannelId DbiCableSvc::elecChannelId ( const DayaBay::HardwareId hardwareId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 428 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  std::map<DayaBay::HardwareId,DayaBay::ElecChannelId>::iterator iter;
  iter = m_channelByHardware.find(hardwareId);
  if( iter != m_channelByHardware.end() ){
    // Found channel
    return iter->second;
  }
  std::ostringstream msgStr;
/*msgStr << "elecChannelId(): No electronics channel for hardware ID: " 
         << hardwareId;
  msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
*/
  return DayaBay::ElecChannelId(0);
}
DayaBay::FeeChannelId DbiCableSvc::feeChannelId ( const DayaBay::FeeHardwareId feeHardwareId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 447 of file DbiCableSvc.cc.

{
  readFeeTable(svcMode);
  return DayaBay::FeeChannelId(elecChannelId(feeHardwareId,svcMode).fullPackedData());
}
DayaBay::FecChannelId DbiCableSvc::fecChannelId ( const DayaBay::FecHardwareId fecHardwareId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 455 of file DbiCableSvc.cc.

{
  return DayaBay::FecChannelId(elecChannelId(fecHardwareId,svcMode).fullPackedData());
}
void DbiCableSvc::readFeeTable ( const ServiceMode serviceMode) [private]

Definition at line 463 of file DbiCableSvc.cc.

{
  if(serviceMode.context() == feeLastContext){  
    return;
  }
  feeLastContext = serviceMode.context();      

  DbiResultPtr<GFeeCableMap> pr("FeeCableMap",feeLastContext,feeLastContext.GetDetId());
  const DbiResultKey* thisResult= pr.GetKey(); 
  if(feeLastResult == 0){                      
    feeLastResult = thisResult;
  }
  else if(thisResult->IsEqualTo(feeLastResult)) {
    return;
  }
  else {
    feeLastResult = thisResult;
  }
  m_elecChannelIdsBySiteDet.clear();
  m_feeChannelIdsBySiteDet.clear();
  m_channelByHardware.clear();
  m_hardwareByChannel.clear();
  m_sensorsBySiteDet.clear();
  m_channelBySensor.clear();
  m_sensorByChannel.clear();
  m_hardwareBySensor.clear();
  m_sensorByHardware.clear();
  m_poolPmtSensorsBySiteDet.clear();
  m_adPmtSensorsBySiteDet.clear();
  unsigned int numRows = pr.GetNumRows();
  std::cout << "Database rows = " << numRows << std::endl;
  const GFeeCableMap* row ;
  for (unsigned int idx=0; idx < numRows; idx++) {
    row = pr.GetRowByIndex(idx);
    int sensorId = row->GetSensorId().fullPackedData();
    DayaBay::FeeChannelId feeChannel(row->GetFeeChannelId());
    DayaBay::FeeHardwareId feeHardware(row->GetFeeHardwareId());
    DayaBay::PmtHardwareId pmtHardware(row->GetPmtHardwareId());
    // Make map by site / detector
    DayaBay::Detector siteId(feeChannel.site(), DetectorId::kAll);
    DayaBay::Detector detector(feeChannel.site(), feeChannel.detectorId());
    m_elecChannelIdsBySiteDet[s_allSiteDet].push_back(feeChannel);
    m_elecChannelIdsBySiteDet[siteId].push_back(feeChannel);
    m_elecChannelIdsBySiteDet[detector].push_back(feeChannel);
    m_feeChannelIdsBySiteDet[s_allSiteDet].push_back(feeChannel);
    m_feeChannelIdsBySiteDet[siteId].push_back(feeChannel);
    m_feeChannelIdsBySiteDet[detector].push_back(feeChannel);
    // Make hardware connections
    m_channelByHardware[feeHardware] = feeChannel;
    m_hardwareByChannel[feeChannel] = feeHardware;

    // Make PMT connections
    if( sensorId == 0 ){
      // Unconnected FEE channel
      continue;
    }
    DayaBay::DetectorSensor sensor(sensorId);
    m_sensorsBySiteDet[s_allSiteDet].push_back(sensor);
    m_sensorsBySiteDet[siteId].push_back(sensor);
    m_sensorsBySiteDet[detector].push_back(sensor);
    m_channelBySensor[sensor] = feeChannel;
    m_sensorByChannel[feeChannel] = sensor;
    m_hardwareBySensor[sensor] = pmtHardware;
    m_sensorByHardware[pmtHardware] = sensor;
    if(sensor.detectorId() == DetectorId::kIWS
       || sensor.detectorId() == DetectorId::kOWS){
      DayaBay::PoolPmtSensor poolPmt(sensorId);
      m_poolPmtSensorsBySiteDet[s_allSiteDet].push_back(poolPmt);
      m_poolPmtSensorsBySiteDet[siteId].push_back(poolPmt);
      m_poolPmtSensorsBySiteDet[detector].push_back(poolPmt);
    }
    else{
      DayaBay::AdPmtSensor adPmt(sensorId);
      m_adPmtSensorsBySiteDet[s_allSiteDet].push_back(adPmt);
      m_adPmtSensorsBySiteDet[siteId].push_back(adPmt);
      m_adPmtSensorsBySiteDet[detector].push_back(adPmt);
    }
  }
}

Member Data Documentation

IMessageSvc* DbiCableSvc::msg [private]

Definition at line 165 of file DbiCableSvc.h.

Initial value:

Definition at line 168 of file DbiCableSvc.h.

Initial value:

Definition at line 169 of file DbiCableSvc.h.

Definition at line 172 of file DbiCableSvc.h.

Definition at line 173 of file DbiCableSvc.h.

Definition at line 174 of file DbiCableSvc.h.

Definition at line 175 of file DbiCableSvc.h.

Definition at line 176 of file DbiCableSvc.h.

Definition at line 179 of file DbiCableSvc.h.

Definition at line 180 of file DbiCableSvc.h.

Definition at line 181 of file DbiCableSvc.h.

Definition at line 182 of file DbiCableSvc.h.

Definition at line 185 of file DbiCableSvc.h.

Definition at line 186 of file DbiCableSvc.h.

Definition at line 187 of file DbiCableSvc.h.

Definition at line 190 of file DbiCableSvc.h.

Definition at line 191 of file DbiCableSvc.h.

Definition at line 192 of file DbiCableSvc.h.

Definition at line 193 of file DbiCableSvc.h.

Definition at line 196 of file DbiCableSvc.h.

Definition at line 197 of file DbiCableSvc.h.

Definition at line 198 of file DbiCableSvc.h.

Definition at line 201 of file DbiCableSvc.h.

Definition at line 202 of file DbiCableSvc.h.

Definition at line 205 of file DbiCableSvc.h.

Definition at line 206 of file DbiCableSvc.h.

Definition at line 209 of file DbiCableSvc.h.

Definition at line 210 of file DbiCableSvc.h.

Definition at line 212 of file DbiCableSvc.h.

Definition at line 213 of file DbiCableSvc.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Fri May 16 2014 09:59:43 for DbiDataSvc by doxygen 1.7.4