| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

DbiCableSvc Class Reference

#include <DbiCableSvc.h>

Inheritance diagram for DbiCableSvc:

[legend]
Collaboration diagram for DbiCableSvc:
[legend]
List of all members.

Public Types

 SUCCESS
 NO_INTERFACE
 VERSMISMATCH
 LAST_ERROR
enum  Status
 SUCCESS
 NO_INTERFACE
 VERSMISMATCH
 LAST_ERROR

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)
virtual unsigned long addRef ()
virtual unsigned long release ()
virtual const std::string & name () const
virtual const InterfaceIDtype () const
virtual StatusCode configure ()
virtual StatusCode start ()
virtual StatusCode stop ()
virtual StatusCode terminate ()
virtual Gaudi::StateMachine::State FSMState () const
virtual Gaudi::StateMachine::State targetFSMState () const
virtual StatusCode reinitialize ()
virtual StatusCode restart ()
virtual StatusCode sysInitialize ()
virtual StatusCode sysStart ()
virtual StatusCode sysStop ()
virtual StatusCode sysFinalize ()
virtual StatusCode sysReinitialize ()
virtual StatusCode sysRestart ()
virtual StatusCode setProperty (const Property &p)
virtual StatusCode setProperty (const std::string &s)
virtual StatusCode setProperty (const std::string &n, const std::string &v)
StatusCode setProperty (const std::string &name, const TYPE &value)
virtual StatusCode getProperty (Property *p) const
virtual const PropertygetProperty (const std::string &name) const
virtual StatusCode getProperty (const std::string &n, std::string &v) const
virtual const std::vector<
Property * > & 
getProperties () const
ISvcLocatorserviceLocator () const
IMessageSvcmsgSvc ()
IMessageSvcmsgSvc () const
IMessageSvcmessageService ()
IMessageSvcmessageService () const
StatusCode setProperties ()
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
IAuditorSvcauditorSvc () const
virtual unsigned long addRef ()=0
virtual unsigned long release ()=0

Static Public Member Functions

static const InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()

Public Attributes

 SUCCESS
 NO_INTERFACE
 VERSMISMATCH
 LAST_ERROR

Protected Member Functions

int outputLevel () const

Protected Attributes

IntegerProperty m_outputLevel
Gaudi::StateMachine::State m_state
Gaudi::StateMachine::State m_targetState
IMessageSvcm_messageSvc

Private Member Functions

virtual int readFeeTable (const ServiceMode &)

Private Attributes

IMessageSvcmsg
std::vector< DayaBay::HardwareIdm_hardwareIds
std::vector< DayaBay::PmtHardwareIdm_pmtHardwareIds
std::vector< DayaBay::RpcHardwareIdm_rpcHardwareIds
std::vector< DayaBay::FeeHardwareIdm_feeHardwareIds
std::vector< DayaBay::FecHardwareIdm_fecHardwareIds
std::vector< DayaBay::DetectorSensorm_sensors
std::vector< DayaBay::AdPmtSensorm_adPmtSensors
std::vector< DayaBay::PoolPmtSensorm_poolPmtSensors
std::vector< DayaBay::RpcSensorm_rpcSensors
std::vector< DayaBay::ElecChannelIdm_elecChannelIds
std::vector< DayaBay::FeeChannelIdm_feeChannelIds
std::vector< DayaBay::FecChannelIdm_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

Friends

friend class ServiceManager

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.

00032     : Service(name,svc)
00033 {
00034 }

DbiCableSvc::~DbiCableSvc (  ) 

Definition at line 36 of file DbiCableSvc.cc.

00037 {
00038 }


Member Function Documentation

StatusCode DbiCableSvc::initialize (  )  [virtual]

Reimplemented from Service.

Definition at line 40 of file DbiCableSvc.cc.

00041 {
00042     this->Service::initialize();
00043 
00044     // Prepare the message service for reporting
00045 /*  IMessageSvc* msg = msgSvc();//cxs 2010-12-7
00046     if( !msg ){    
00047       return StatusCode::FAILURE;
00048     }
00049 */
00050     MsgStream msg(msgSvc(),name());
00051     feeLastResult = 0;   //cxs 2010-10-28.
00052     return StatusCode::SUCCESS;
00053 }

StatusCode DbiCableSvc::finalize (  )  [virtual]

Reimplemented from Service.

Definition at line 55 of file DbiCableSvc.cc.

00056 {
00057     return this->Service::finalize();
00058 }

StatusCode DbiCableSvc::queryInterface ( const InterfaceID riid,
void **  ppvInterface 
) [virtual]

Reimplemented from Service.

Definition at line 60 of file DbiCableSvc.cc.

00062 {
00063     StatusCode sc = StatusCode::FAILURE;
00064     if (ppvInterface) {
00065         *ppvInterface = 0;
00066     
00067         if (ICableSvc::interfaceID().versionMatch(riid)) {
00068             *ppvInterface = static_cast<ICableSvc*>(this);
00069             sc = StatusCode::SUCCESS;
00070             addRef();
00071         }
00072         else sc = Service::queryInterface( riid, ppvInterface );    
00073     }
00074     return sc;
00075 }

const std::vector< DayaBay::HardwareId > & DbiCableSvc::hardwareIds ( const ServiceMode svcMode  )  [virtual]

Implements ICableSvc.

Definition at line 77 of file DbiCableSvc.cc.

00078 {
00079   readFeeTable(serviceMode);
00080   return m_hardwareIds;
00081 }

const std::vector< DayaBay::PmtHardwareId > & DbiCableSvc::pmtHardwareIds ( const ServiceMode svcMode  )  [virtual]

Implements ICableSvc.

Definition at line 83 of file DbiCableSvc.cc.

00084 {
00085   readFeeTable(serviceMode);
00086   return m_pmtHardwareIds;
00087 }

const std::vector< DayaBay::RpcHardwareId > & DbiCableSvc::rpcHardwareIds ( const ServiceMode svcMode  )  [virtual]

Implements ICableSvc.

Definition at line 89 of file DbiCableSvc.cc.

00090 {
00091   readFeeTable(serviceMode);
00092   return m_rpcHardwareIds;
00093 }

const std::vector< DayaBay::FeeHardwareId > & DbiCableSvc::feeHardwareIds ( const ServiceMode svcMode  )  [virtual]

Implements ICableSvc.

Definition at line 95 of file DbiCableSvc.cc.

00096 {
00097   readFeeTable(serviceMode);
00098   return m_feeHardwareIds;
00099 }

const std::vector< DayaBay::FecHardwareId > & DbiCableSvc::fecHardwareIds ( const ServiceMode svcMode  )  [virtual]

Implements ICableSvc.

Definition at line 101 of file DbiCableSvc.cc.

00102 {
00103   readFeeTable(serviceMode);
00104   return m_fecHardwareIds;
00105 }

const std::vector< DayaBay::DetectorSensor > & DbiCableSvc::sensors ( const ServiceMode svcMode  )  [virtual]

Implements ICableSvc.

Definition at line 107 of file DbiCableSvc.cc.

00108 {
00109   readFeeTable(svcMode);
00110   DayaBay::Detector siteDetId(svcMode.context().GetSite(), 
00111                               svcMode.context().GetDetId());
00112   std::map<DayaBay::Detector,std::vector<DayaBay::DetectorSensor> >::iterator iter;
00113   iter = m_sensorsBySiteDet.find(siteDetId);
00114   if( iter != m_sensorsBySiteDet.end() ){
00115     // Found site / det
00116     return iter->second;
00117   }
00118   std::ostringstream msgStr;
00119 /*msgStr << "sensors(): No sensors for site / detector ID: " << siteDetId; //cxs 2010-12-8
00120   msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
00121 */
00122   return m_sensorsBySiteDet[s_unknownSiteDet];
00123 }

const std::vector< DayaBay::AdPmtSensor > & DbiCableSvc::adPmtSensors ( const ServiceMode svcMode  )  [virtual]

Implements ICableSvc.

Definition at line 125 of file DbiCableSvc.cc.

00126 {
00127   readFeeTable(svcMode);
00128   DayaBay::Detector siteDetId(svcMode.context().GetSite(), 
00129                               svcMode.context().GetDetId());
00130   std::map<DayaBay::Detector,std::vector<DayaBay::AdPmtSensor> >::iterator iter;
00131   iter = m_adPmtSensorsBySiteDet.find(siteDetId);
00132   if( iter != m_adPmtSensorsBySiteDet.end() ){
00133     // Found site / det
00134     return iter->second;
00135   }
00136   std::ostringstream msgStr;
00137 /*msgStr << "adPmtSensors(): No sensors for site / detector ID: " << siteDetId; //cxs 2010-12-8
00138   msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
00139 */
00140   return m_adPmtSensorsBySiteDet[s_unknownSiteDet];
00141 }

const std::vector< DayaBay::PoolPmtSensor > & DbiCableSvc::poolPmtSensors ( const ServiceMode svcMode  )  [virtual]

Implements ICableSvc.

Definition at line 143 of file DbiCableSvc.cc.

00144 {
00145   readFeeTable(svcMode);
00146   DayaBay::Detector siteDetId(svcMode.context().GetSite(), 
00147                               svcMode.context().GetDetId());
00148   std::map<DayaBay::Detector,std::vector<DayaBay::PoolPmtSensor> >::iterator iter;
00149   iter = m_poolPmtSensorsBySiteDet.find(siteDetId);
00150   if( iter != m_poolPmtSensorsBySiteDet.end() ){
00151     // Found site / det
00152     return iter->second;
00153   }
00154   std::ostringstream msgStr;
00155 /*msgStr << "poolPmtSensors(): No sensors for site / detector ID: "<< siteDetId;//cxs 2010-12-8
00156   msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
00157 */
00158   return m_poolPmtSensorsBySiteDet[s_unknownSiteDet];
00159 }

const std::vector< DayaBay::RpcSensor > & DbiCableSvc::rpcSensors ( const ServiceMode svcMode  )  [virtual]

Implements ICableSvc.

Definition at line 161 of file DbiCableSvc.cc.

00162 {
00163   readFeeTable(svcMode);
00164   DayaBay::Detector siteDetId(svcMode.context().GetSite(), 
00165                               svcMode.context().GetDetId());
00166   std::map<DayaBay::Detector,std::vector<DayaBay::RpcSensor> >::iterator iter;
00167   iter = m_rpcSensorsBySiteDet.find(siteDetId);
00168   if( iter != m_rpcSensorsBySiteDet.end() ){
00169     // Found site / det
00170     return iter->second;
00171   }
00172   std::ostringstream msgStr;
00173 /*msgStr << "rpcSensors(): No sensors for site / detector ID: "<< siteDetId;//cxs 2010-12-8
00174   msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
00175 */
00176   return m_rpcSensorsBySiteDet[s_unknownSiteDet];
00177 }

const std::vector< DayaBay::ElecChannelId > & DbiCableSvc::elecChannelIds ( const ServiceMode svcMode  )  [virtual]

Implements ICableSvc.

Definition at line 179 of file DbiCableSvc.cc.

00180 {
00181   readFeeTable(svcMode);
00182   DayaBay::Detector siteDetId(svcMode.context().GetSite(), 
00183                               svcMode.context().GetDetId());
00184   std::map<DayaBay::Detector,std::vector<DayaBay::ElecChannelId> >::iterator iter;
00185   iter = m_elecChannelIdsBySiteDet.find(siteDetId);
00186   if( iter != m_elecChannelIdsBySiteDet.end() ){
00187     // Found site / det
00188     return iter->second;
00189   }
00190   std::ostringstream msgStr;
00191 /*msgStr << "elecChannelIds(): No sensors for site / detector ID: "<< siteDetId; //cxs 2010-12-8
00192   msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
00193 */
00194   return m_elecChannelIdsBySiteDet[s_unknownSiteDet];
00195 }

const std::vector< DayaBay::FeeChannelId > & DbiCableSvc::feeChannelIds ( const ServiceMode svcMode  )  [virtual]

Implements ICableSvc.

Definition at line 197 of file DbiCableSvc.cc.

00198 {
00199   readFeeTable(svcMode);
00200   DayaBay::Detector siteDetId(svcMode.context().GetSite(), 
00201                               svcMode.context().GetDetId());
00202   std::map<DayaBay::Detector,std::vector<DayaBay::FeeChannelId> >::iterator iter;
00203   iter = m_feeChannelIdsBySiteDet.find(siteDetId);
00204   if( iter != m_feeChannelIdsBySiteDet.end() ){
00205     // Found site / det
00206     return iter->second;
00207   }
00208   std::ostringstream msgStr;
00209 /*msgStr << "feeChannelIds(): No sensors for site / detector ID: " << siteDetId; //cxs 2010-12-8
00210   msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
00211 */
00212   return m_feeChannelIdsBySiteDet[s_unknownSiteDet];
00213 }

const std::vector< DayaBay::FecChannelId > & DbiCableSvc::fecChannelIds ( const ServiceMode svcMode  )  [virtual]

Implements ICableSvc.

Definition at line 215 of file DbiCableSvc.cc.

00216 {
00217   DayaBay::Detector siteDetId(svcMode.context().GetSite(), 
00218                               svcMode.context().GetDetId());
00219   std::map<DayaBay::Detector,std::vector<DayaBay::FecChannelId> >::iterator iter;
00220   iter = m_fecChannelIdsBySiteDet.find(siteDetId);
00221   if( iter != m_fecChannelIdsBySiteDet.end() ){
00222     // Found site / det
00223     return iter->second;
00224   }
00225   std::ostringstream msgStr;
00226 /*msgStr << "fecChannelIds(): No sensors for site / detector ID: " << siteDetId; //cxs 2010-12-8
00227   msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
00228 */
00229   return m_fecChannelIdsBySiteDet[s_unknownSiteDet];
00230 }

DayaBay::ElecChannelId DbiCableSvc::elecChannelId ( const DayaBay::DetectorSensor sensId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 232 of file DbiCableSvc.cc.

00235 {
00236   readFeeTable(svcMode);
00237   std::map<DayaBay::DetectorSensor,DayaBay::ElecChannelId>::iterator iter;
00238   iter = m_channelBySensor.find(sensId);
00239   if( iter != m_channelBySensor.end() ){
00240     // Found channel
00241     return iter->second;
00242   }
00243   std::ostringstream msgStr;
00244 /*msgStr << "elecChannelId(): No electronics channel for sensor ID: " << sensId; //cxs 2010-12-8
00245   msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
00246 */
00247   return DayaBay::ElecChannelId(0);
00248 }

DayaBay::FeeChannelId DbiCableSvc::feeChannelId ( const DayaBay::AdPmtSensor sensId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 250 of file DbiCableSvc.cc.

00253 {
00254   readFeeTable(svcMode);
00255   return DayaBay::FeeChannelId(elecChannelId(sensId,svcMode).fullPackedData());
00256 }

DayaBay::FeeChannelId DbiCableSvc::feeChannelId ( const DayaBay::PoolPmtSensor sensId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 258 of file DbiCableSvc.cc.

00261 {
00262   readFeeTable(svcMode);
00263   return DayaBay::FeeChannelId(elecChannelId(sensId,svcMode).fullPackedData());
00264 }

DayaBay::FecChannelId DbiCableSvc::fecChannelId ( const DayaBay::RpcSensor sensId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 266 of file DbiCableSvc.cc.

00269 {
00270   return DayaBay::FecChannelId(elecChannelId(sensId,svcMode).fullPackedData());
00271 }

DayaBay::DetectorSensor DbiCableSvc::sensor ( const DayaBay::ElecChannelId elecChannel,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 273 of file DbiCableSvc.cc.

00276 {
00277   readFeeTable(svcMode);
00278   std::map<DayaBay::ElecChannelId,DayaBay::DetectorSensor>::iterator iter;
00279   iter = m_sensorByChannel.find(elecChannel);
00280   if( iter != m_sensorByChannel.end() ){
00281     // Found sensor
00282     return iter->second;
00283   }
00284   std::ostringstream msgStr;
00285 /*msgStr << "elecChannelId(): No sensor ID for electronics channel: " //cxs 2010-12-8
00286          << elecChannel;
00287   msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
00288 */
00289   return DayaBay::DetectorSensor(0);
00290 }

DayaBay::AdPmtSensor DbiCableSvc::adPmtSensor ( const DayaBay::FeeChannelId feeChannel,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 292 of file DbiCableSvc.cc.

00295 {
00296   return DayaBay::AdPmtSensor(sensor(feeChannel,svcMode).fullPackedData());
00297 }

DayaBay::PoolPmtSensor DbiCableSvc::poolPmtSensor ( const DayaBay::FeeChannelId feeChannel,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 299 of file DbiCableSvc.cc.

00302 {
00303   return DayaBay::PoolPmtSensor(sensor(feeChannel,svcMode).fullPackedData());
00304 }

DayaBay::RpcSensor DbiCableSvc::rpcSensor ( const DayaBay::FecChannelId fecChannel,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 306 of file DbiCableSvc.cc.

00309 {
00310   return DayaBay::RpcSensor(sensor(fecChannel,svcMode).fullPackedData());
00311 }

DayaBay::HardwareId DbiCableSvc::hardwareId ( const DayaBay::DetectorSensor sensId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 313 of file DbiCableSvc.cc.

00316 {
00317   readFeeTable(svcMode);
00318   std::map<DayaBay::DetectorSensor,DayaBay::HardwareId>::iterator iter;
00319   iter = m_hardwareBySensor.find(sensId);
00320   if( iter != m_hardwareBySensor.end() ){
00321     // Found hardware
00322     return iter->second;
00323   }
00324   std::ostringstream msgStr;
00325 /*msgStr << "hardwareId(): No hardware ID for sensor ID: " << sensId; //cxs 2010-12-8
00326   msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
00327 */
00328   return DayaBay::HardwareId(0);
00329 }

DayaBay::PmtHardwareId DbiCableSvc::pmtHardwareId ( const DayaBay::AdPmtSensor sensId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 331 of file DbiCableSvc.cc.

00334 {
00335   readFeeTable(svcMode);
00336   return DayaBay::PmtHardwareId(hardwareId(sensId,svcMode).fullPackedData());
00337 }

DayaBay::PmtHardwareId DbiCableSvc::pmtHardwareId ( const DayaBay::PoolPmtSensor sensId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 339 of file DbiCableSvc.cc.

00342 {
00343   readFeeTable(svcMode);
00344   return DayaBay::PmtHardwareId(hardwareId(sensId,svcMode).fullPackedData());
00345 }

DayaBay::RpcHardwareId DbiCableSvc::rpcHardwareId ( const DayaBay::RpcSensor sensId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 347 of file DbiCableSvc.cc.

00350 {
00351   readFeeTable(svcMode);
00352   return DayaBay::RpcHardwareId(hardwareId(sensId,svcMode).fullPackedData());
00353 }

DayaBay::DetectorSensor DbiCableSvc::sensor ( const DayaBay::HardwareId hardwareId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 355 of file DbiCableSvc.cc.

00358 {
00359   readFeeTable(svcMode);
00360   std::map<DayaBay::HardwareId,DayaBay::DetectorSensor>::iterator iter;
00361   iter = m_sensorByHardware.find(hardwareId);
00362   if( iter != m_sensorByHardware.end() ){
00363     // Found sensor
00364     return iter->second;
00365   }
00366   std::ostringstream msgStr;
00367 /*msgStr << "sensor(): No sensor for hardware ID: " << hardwareId; //cxs 2010-12-8
00368   msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
00369 */
00370   return DayaBay::DetectorSensor(0);
00371 }

DayaBay::AdPmtSensor DbiCableSvc::adPmtSensor ( const DayaBay::PmtHardwareId pmtId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 373 of file DbiCableSvc.cc.

00376 {
00377   return DayaBay::AdPmtSensor(sensor(pmtId,svcMode).fullPackedData());
00378 }

DayaBay::PoolPmtSensor DbiCableSvc::poolPmtSensor ( const DayaBay::PmtHardwareId pmtId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 380 of file DbiCableSvc.cc.

00383 {
00384   return DayaBay::PoolPmtSensor(sensor(pmtId,svcMode).fullPackedData());
00385 }

DayaBay::RpcSensor DbiCableSvc::rpcSensor ( const DayaBay::RpcHardwareId rpcId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 387 of file DbiCableSvc.cc.

00390 {
00391   return DayaBay::RpcSensor(sensor(rpcId, svcMode).fullPackedData());
00392 }

DayaBay::HardwareId DbiCableSvc::hardwareId ( const DayaBay::ElecChannelId elecChannel,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 394 of file DbiCableSvc.cc.

00397 {
00398   readFeeTable(svcMode);
00399   std::map<DayaBay::ElecChannelId,DayaBay::HardwareId>::iterator iter;
00400   iter = m_hardwareByChannel.find(elecChannel);
00401   if( iter != m_hardwareByChannel.end() ){
00402     // Found hardware
00403     return iter->second;
00404   }
00405   std::ostringstream msgStr;
00406 /*msgStr << "hardwareId(): No hardware ID for electronics channel: " //cxs 2010-12-8
00407          << elecChannel;
00408   msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
00409 */
00410   return DayaBay::HardwareId(0);
00411 }

DayaBay::FeeHardwareId DbiCableSvc::feeHardwareId ( const DayaBay::FeeChannelId feeChannel,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 413 of file DbiCableSvc.cc.

00416 {
00417   readFeeTable(svcMode);
00418   return DayaBay::FeeHardwareId(hardwareId(feeChannel,svcMode).fullPackedData());
00419 }

DayaBay::FecHardwareId DbiCableSvc::fecHardwareId ( const DayaBay::FecChannelId fecChannel,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 421 of file DbiCableSvc.cc.

00424 {
00425   return DayaBay::FecHardwareId(hardwareId(fecChannel,svcMode).fullPackedData());
00426 }

DayaBay::ElecChannelId DbiCableSvc::elecChannelId ( const DayaBay::HardwareId hardwareId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 428 of file DbiCableSvc.cc.

00431 {
00432   readFeeTable(svcMode);
00433   std::map<DayaBay::HardwareId,DayaBay::ElecChannelId>::iterator iter;
00434   iter = m_channelByHardware.find(hardwareId);
00435   if( iter != m_channelByHardware.end() ){
00436     // Found channel
00437     return iter->second;
00438   }
00439   std::ostringstream msgStr;
00440 /*msgStr << "elecChannelId(): No electronics channel for hardware ID: " 
00441          << hardwareId;
00442   msg->reportMessage("DbiCableSvc",MSG::WARNING,msgStr.str());
00443 */
00444   return DayaBay::ElecChannelId(0);
00445 }

DayaBay::FeeChannelId DbiCableSvc::feeChannelId ( const DayaBay::FeeHardwareId feeHardwareId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 447 of file DbiCableSvc.cc.

00450 {
00451   readFeeTable(svcMode);
00452   return DayaBay::FeeChannelId(elecChannelId(feeHardwareId,svcMode).fullPackedData());
00453 }

DayaBay::FecChannelId DbiCableSvc::fecChannelId ( const DayaBay::FecHardwareId fecHardwareId,
const ServiceMode svcMode 
) [virtual]

Implements ICableSvc.

Definition at line 455 of file DbiCableSvc.cc.

00458 {
00459   return DayaBay::FecChannelId(elecChannelId(fecHardwareId,svcMode).fullPackedData());
00460 }

int DbiCableSvc::readFeeTable ( const ServiceMode  )  [inline, private, virtual]

Definition at line 463 of file DbiCableSvc.cc.

00463                                                                   {  //XiaoSu Chen 2010/10/28
00464   if(serviceMode.context() == feeLastContext){  
00465     return 2;    
00466   }
00467   feeLastContext = serviceMode.context();      
00468 
00469   DbiResultPtr<GFeeCableMap> pr("FeeCableMap",feeLastContext,feeLastContext.GetDetId());
00470   const DbiResultKey* thisResult= pr.GetKey(); 
00471   if(feeLastResult == 0){                      
00472     feeLastResult = thisResult;
00473   }else if(thisResult->IsEqualTo(feeLastResult))
00474   {
00475     return 2;
00476   }else{
00477     feeLastResult = thisResult;
00478   }
00479   m_elecChannelIdsBySiteDet.clear();
00480   m_feeChannelIdsBySiteDet.clear();
00481   m_channelByHardware.clear();
00482   m_hardwareByChannel.clear();
00483   m_sensorsBySiteDet.clear();
00484   m_channelBySensor.clear();
00485   m_sensorByChannel.clear();
00486   m_hardwareBySensor.clear();
00487   m_sensorByHardware.clear();
00488   m_poolPmtSensorsBySiteDet.clear();
00489   m_adPmtSensorsBySiteDet.clear();
00490   unsigned int numRows = pr.GetNumRows();
00491   std::cout << "Database rows = " << numRows << std::endl;
00492   const GFeeCableMap* row ;
00493   for (unsigned int idx=0; idx < numRows; idx++) {
00494         row = pr.GetRowByIndex(idx);
00495         int sensorId = row->GetSensorId().fullPackedData();
00496         DayaBay::FeeChannelId feeChannel(row->GetFeeChannelId());
00497         DayaBay::FeeHardwareId feeHardware(row->GetFeeHardwareId());
00498         DayaBay::PmtHardwareId pmtHardware(row->GetPmtHardwareId());
00499         // Make map by site / detector
00500         DayaBay::Detector siteId(feeChannel.site(), DetectorId::kAll);
00501         DayaBay::Detector detector(feeChannel.site(), feeChannel.detectorId());
00502         m_elecChannelIdsBySiteDet[s_allSiteDet].push_back(feeChannel);
00503         m_elecChannelIdsBySiteDet[siteId].push_back(feeChannel);
00504         m_elecChannelIdsBySiteDet[detector].push_back(feeChannel);
00505         m_feeChannelIdsBySiteDet[s_allSiteDet].push_back(feeChannel);
00506         m_feeChannelIdsBySiteDet[siteId].push_back(feeChannel);
00507         m_feeChannelIdsBySiteDet[detector].push_back(feeChannel);
00508         // Make hardware connections
00509         m_channelByHardware[feeHardware] = feeChannel;
00510         m_hardwareByChannel[feeChannel] = feeHardware;
00511 
00512         // Make PMT connections
00513         if( sensorId == 0 ){
00514           // Unconnected FEE channel
00515           continue;
00516         }
00517         DayaBay::DetectorSensor sensor(sensorId);
00518         m_sensorsBySiteDet[s_allSiteDet].push_back(sensor);
00519         m_sensorsBySiteDet[siteId].push_back(sensor);
00520         m_sensorsBySiteDet[detector].push_back(sensor);
00521         m_channelBySensor[sensor] = feeChannel;
00522         m_sensorByChannel[feeChannel] = sensor;
00523         m_hardwareBySensor[sensor] = pmtHardware;
00524         m_sensorByHardware[pmtHardware] = sensor;
00525         if(sensor.detectorId() == DetectorId::kIWS
00526            || sensor.detectorId() == DetectorId::kOWS){
00527           DayaBay::PoolPmtSensor poolPmt(sensorId);
00528           m_poolPmtSensorsBySiteDet[s_allSiteDet].push_back(poolPmt);
00529           m_poolPmtSensorsBySiteDet[siteId].push_back(poolPmt);
00530           m_poolPmtSensorsBySiteDet[detector].push_back(poolPmt);
00531         }else{
00532           DayaBay::AdPmtSensor adPmt(sensorId);
00533           m_adPmtSensorsBySiteDet[s_allSiteDet].push_back(adPmt);
00534           m_adPmtSensorsBySiteDet[siteId].push_back(adPmt);
00535           m_adPmtSensorsBySiteDet[detector].push_back(adPmt);
00536         }
00537   }
00538 }


Member Data Documentation

IMessageSvc* DbiCableSvc::msg [private]

Definition at line 165 of file DbiCableSvc.h.

DayaBay::Detector DbiCableSvc::s_unknownSiteDet [static, private]

Initial value:

Definition at line 168 of file DbiCableSvc.h.

DayaBay::Detector DbiCableSvc::s_allSiteDet [static, private]

Initial value:

Definition at line 169 of file DbiCableSvc.h.

std::vector<DayaBay::HardwareId> DbiCableSvc::m_hardwareIds [private]

Definition at line 172 of file DbiCableSvc.h.

std::vector<DayaBay::PmtHardwareId> DbiCableSvc::m_pmtHardwareIds [private]

Definition at line 173 of file DbiCableSvc.h.

std::vector<DayaBay::RpcHardwareId> DbiCableSvc::m_rpcHardwareIds [private]

Definition at line 174 of file DbiCableSvc.h.

std::vector<DayaBay::FeeHardwareId> DbiCableSvc::m_feeHardwareIds [private]

Definition at line 175 of file DbiCableSvc.h.

std::vector<DayaBay::FecHardwareId> DbiCableSvc::m_fecHardwareIds [private]

Definition at line 176 of file DbiCableSvc.h.

std::vector<DayaBay::DetectorSensor> DbiCableSvc::m_sensors [private]

Definition at line 179 of file DbiCableSvc.h.

std::vector<DayaBay::AdPmtSensor> DbiCableSvc::m_adPmtSensors [private]

Definition at line 180 of file DbiCableSvc.h.

std::vector<DayaBay::PoolPmtSensor> DbiCableSvc::m_poolPmtSensors [private]

Definition at line 181 of file DbiCableSvc.h.

std::vector<DayaBay::RpcSensor> DbiCableSvc::m_rpcSensors [private]

Definition at line 182 of file DbiCableSvc.h.

std::vector<DayaBay::ElecChannelId> DbiCableSvc::m_elecChannelIds [private]

Definition at line 185 of file DbiCableSvc.h.

std::vector<DayaBay::FeeChannelId> DbiCableSvc::m_feeChannelIds [private]

Definition at line 186 of file DbiCableSvc.h.

std::vector<DayaBay::FecChannelId> DbiCableSvc::m_fecChannelIds [private]

Definition at line 187 of file DbiCableSvc.h.

std::map<DayaBay::Detector,std::vector<DayaBay::DetectorSensor> > DbiCableSvc::m_sensorsBySiteDet [private]

Definition at line 190 of file DbiCableSvc.h.

std::map<DayaBay::Detector,std::vector<DayaBay::AdPmtSensor> > DbiCableSvc::m_adPmtSensorsBySiteDet [private]

Definition at line 191 of file DbiCableSvc.h.

std::map<DayaBay::Detector,std::vector<DayaBay::PoolPmtSensor> > DbiCableSvc::m_poolPmtSensorsBySiteDet [private]

Definition at line 192 of file DbiCableSvc.h.

std::map<DayaBay::Detector,std::vector<DayaBay::RpcSensor> > DbiCableSvc::m_rpcSensorsBySiteDet [private]

Definition at line 193 of file DbiCableSvc.h.

std::map<DayaBay::Detector,std::vector<DayaBay::ElecChannelId> > DbiCableSvc::m_elecChannelIdsBySiteDet [private]

Definition at line 196 of file DbiCableSvc.h.

std::map<DayaBay::Detector,std::vector<DayaBay::FeeChannelId> > DbiCableSvc::m_feeChannelIdsBySiteDet [private]

Definition at line 197 of file DbiCableSvc.h.

std::map<DayaBay::Detector,std::vector<DayaBay::FecChannelId> > DbiCableSvc::m_fecChannelIdsBySiteDet [private]

Definition at line 198 of file DbiCableSvc.h.

std::map<DayaBay::DetectorSensor,DayaBay::ElecChannelId> DbiCableSvc::m_channelBySensor [private]

Definition at line 201 of file DbiCableSvc.h.

std::map<DayaBay::ElecChannelId,DayaBay::DetectorSensor> DbiCableSvc::m_sensorByChannel [private]

Definition at line 202 of file DbiCableSvc.h.

std::map<DayaBay::DetectorSensor,DayaBay::HardwareId> DbiCableSvc::m_hardwareBySensor [private]

Definition at line 205 of file DbiCableSvc.h.

std::map<DayaBay::HardwareId,DayaBay::DetectorSensor> DbiCableSvc::m_sensorByHardware [private]

Definition at line 206 of file DbiCableSvc.h.

std::map<DayaBay::ElecChannelId,DayaBay::HardwareId> DbiCableSvc::m_hardwareByChannel [private]

Definition at line 209 of file DbiCableSvc.h.

std::map<DayaBay::HardwareId,DayaBay::ElecChannelId> DbiCableSvc::m_channelByHardware [private]

Definition at line 210 of file DbiCableSvc.h.

Context DbiCableSvc::feeLastContext [private]

Definition at line 212 of file DbiCableSvc.h.

const DbiResultKey* DbiCableSvc::feeLastResult [private]

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 Mon Apr 11 20:21:49 2011 for DbiDataSvc by doxygen 1.4.7