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

In This Package:

DbiCableSvc.h

Go to the documentation of this file.
00001 // DbiCableSvc  ---Head file is copied from DataModel/DataSvc/StaticCableSvc.h 
00013 // Called 'Dbi'CableSvc since it used DataBase Interface to access 
00014 // table in database. - Weili Zhong 2009/07/27 
00015 
00016 #ifndef DBIDATASVC_DBICABLESVC_H
00017 #define DBIDATASVC_DBICABLESVC_H
00018 
00019 #include "DataSvc/ICableSvc.h"
00020 #include "GaudiKernel/Service.h"
00021 
00022 class IMessageSvc;
00023 class DbiResultKey;
00024 class Context;
00025 class ServiceMode;
00026 
00027 class DbiCableSvc : public Service, 
00028                        virtual public ICableSvc
00029 {
00030  public:
00031     // Service interface
00032     DbiCableSvc(const std::string& name, ISvcLocator *svc);
00033     ~DbiCableSvc();
00034     virtual StatusCode initialize();
00035     virtual StatusCode finalize();
00036     virtual StatusCode queryInterface(const InterfaceID& riid, 
00037                                       void** ppvInterface);
00038 
00039     // ICableSvc interface
00040     /* Hardware Lists */
00041     const std::vector<DayaBay::HardwareId>& hardwareIds(const ServiceMode& svcMode);
00042     const std::vector<DayaBay::PmtHardwareId>& pmtHardwareIds(const ServiceMode& svcMode);
00043     const std::vector<DayaBay::RpcHardwareId>& rpcHardwareIds(const ServiceMode& svcMode);
00044     const std::vector<DayaBay::FeeHardwareId>& feeHardwareIds(const ServiceMode& svcMode);
00045     const std::vector<DayaBay::FecHardwareId>& fecHardwareIds(const ServiceMode& svcMode);
00046 
00047     /* Sensor Lists */
00048     const std::vector<DayaBay::DetectorSensor>& sensors(const ServiceMode& svcMode);
00049     const std::vector<DayaBay::AdPmtSensor>& adPmtSensors(const ServiceMode& svcMode);
00050     const std::vector<DayaBay::PoolPmtSensor>& poolPmtSensors(const ServiceMode& svcMode);
00051     const std::vector<DayaBay::RpcSensor>& rpcSensors(const ServiceMode& svcMode);
00052 
00053     /* Channel Lists */
00054     const std::vector<DayaBay::ElecChannelId>& elecChannelIds(const ServiceMode& svcMode);
00055     const std::vector<DayaBay::FeeChannelId>& feeChannelIds(const ServiceMode& svcMode);
00056     const std::vector<DayaBay::FecChannelId>& fecChannelIds(const ServiceMode& svcMode);
00057 
00058     /* PMT/RPC to Electronics connections ********************************/
00059 
00060     // Return the Electronics Channel ID connected to the given Detector Sensor
00061     DayaBay::ElecChannelId elecChannelId(const DayaBay::DetectorSensor& sensId,
00062                                          const ServiceMode& svcMode);
00063 
00064     // Return the Front-End Channel ID connected to the given AD PMT
00065     DayaBay::FeeChannelId feeChannelId(const DayaBay::AdPmtSensor& sensId,
00066                                        const ServiceMode& svcMode);
00067 
00068     // Return the Front-End Channel ID connected to the given Water Shield PMT
00069     DayaBay::FeeChannelId feeChannelId(const DayaBay::PoolPmtSensor& sensId,
00070                                        const ServiceMode& svcMode);
00071 
00072     // Return the FEC Channel ID connected to the given RPC strip
00073     DayaBay::FecChannelId fecChannelId(const DayaBay::RpcSensor& sensId,
00074                                        const ServiceMode& svcMode);
00075 
00076     /* Electronics to PMT/RPC connections ********************************/
00077 
00078     // Return the Detector Sensor connected to the given Electronics Channel ID 
00079     DayaBay::DetectorSensor sensor(const DayaBay::ElecChannelId& elecChannel,
00080                                    const ServiceMode& svcMode);
00081 
00082     // Return the AD PMT connected to the given Front-End Channel ID 
00083     DayaBay::AdPmtSensor adPmtSensor(const DayaBay::FeeChannelId& feeChannel,
00084                                      const ServiceMode& svcMode);
00085 
00086     // Return the Water Shield PMT connected to the given Front-End Channel ID 
00087     DayaBay::PoolPmtSensor poolPmtSensor(
00088                                        const DayaBay::FeeChannelId& feeChannel,
00089                                        const ServiceMode& svcMode);
00090 
00091     // Return the RPC strip connected to the given FEC Channel ID 
00092     DayaBay::RpcSensor rpcSensor(const DayaBay::FecChannelId& fecChannel,
00093                                  const ServiceMode& svcMode);
00094 
00095     /* Hardware IDs for the Detector Sensors ********************************/
00096 
00097     // Return the Hardware ID for the given Detector Sensor
00098     DayaBay::HardwareId hardwareId(const DayaBay::DetectorSensor& sensId,
00099                                    const ServiceMode& svcMode);
00100 
00101     // Return the PMT Hardware ID for the given AD PMT sensor
00102     DayaBay::PmtHardwareId pmtHardwareId(const DayaBay::AdPmtSensor& sensId,
00103                                          const ServiceMode& svcMode);
00104 
00105     // Return the PMT Hardware ID for the given Pool PMT sensor
00106     DayaBay::PmtHardwareId pmtHardwareId(const DayaBay::PoolPmtSensor& sensId,
00107                                          const ServiceMode& svcMode);
00108 
00109     // Return the RPC Hardware ID for the given RPC sensor
00110     DayaBay::RpcHardwareId rpcHardwareId(const DayaBay::RpcSensor& sensId,
00111                                          const ServiceMode& svcMode);
00112      
00113     /* Detector Sensors for the Hardware IDs ********************************/
00114 
00115     // Return the Detector Sensor for the given Hardware ID
00116     DayaBay::DetectorSensor sensor(const DayaBay::HardwareId& hardwareId,
00117                                    const ServiceMode& svcMode);
00118 
00119     // Return the sensor for the given PMT Hardware ID
00120     DayaBay::AdPmtSensor adPmtSensor(const DayaBay::PmtHardwareId& pmtId,
00121                                      const ServiceMode& svcMode);
00122 
00123     // Return the sensor for the given PMT Hardware ID
00124     DayaBay::PoolPmtSensor poolPmtSensor(const DayaBay::PmtHardwareId& pmtId,
00125                                          const ServiceMode& svcMode);
00126 
00127     // Return the sensor for the given RPC Hardware ID
00128     DayaBay::RpcSensor rpcSensor(const DayaBay::RpcHardwareId& rpcId,
00129                                  const ServiceMode& svcMode);
00130      
00131     /* Hardware IDs for the Electronics Channels ****************************/
00132 
00133     // Return the Hardware ID for the given Electronics Channel
00134     DayaBay::HardwareId hardwareId(const DayaBay::ElecChannelId& elecChannel,
00135                                    const ServiceMode& svcMode);
00136 
00137     // Return the FEE Board Hardware ID for the given FEE Channel
00138     DayaBay::FeeHardwareId feeHardwareId(
00139                                        const DayaBay::FeeChannelId& feeChannel,
00140                                        const ServiceMode& svcMode);
00141 
00142     // Return the FEC Board Hardware ID for the given FEC Channel
00143     DayaBay::FecHardwareId fecHardwareId(
00144                                        const DayaBay::FecChannelId& fecChannel,
00145                                        const ServiceMode& svcMode);
00146 
00147     /* Electronics Channels for the Hardware IDs ****************************/
00148 
00149     // Return the Electronics Channel for the given Hardware ID
00150     DayaBay::ElecChannelId elecChannelId(const DayaBay::HardwareId& hardwareId,
00151                                          const ServiceMode& svcMode);
00152 
00153     // Return the FEE Channel for the given FEE Board Hardware ID 
00154     DayaBay::FeeChannelId feeChannelId(
00155                                    const DayaBay::FeeHardwareId& feeHardwareId,
00156                                    const ServiceMode& svcMode);
00157 
00158     // Return the FEC Channel for the given FEC Board Hardware ID 
00159     DayaBay::FecChannelId fecChannelId(
00160                                    const DayaBay::FecHardwareId& fecHardwareId,
00161                                    const ServiceMode& svcMode);
00162 
00163  private:
00164     // Handle to MessageSvc for reporting errors
00165     IMessageSvc* msg;
00166 
00167     // Dbi reference to unknown or all site/detector
00168     static DayaBay::Detector s_unknownSiteDet;
00169     static DayaBay::Detector s_allSiteDet;
00170 
00171     // Lists of all Hardware IDs
00172     std::vector<DayaBay::HardwareId> m_hardwareIds;
00173     std::vector<DayaBay::PmtHardwareId> m_pmtHardwareIds;
00174     std::vector<DayaBay::RpcHardwareId> m_rpcHardwareIds;
00175     std::vector<DayaBay::FeeHardwareId> m_feeHardwareIds;
00176     std::vector<DayaBay::FecHardwareId> m_fecHardwareIds;
00177 
00178     // Lists of all Sensors
00179     std::vector<DayaBay::DetectorSensor> m_sensors;
00180     std::vector<DayaBay::AdPmtSensor> m_adPmtSensors;
00181     std::vector<DayaBay::PoolPmtSensor> m_poolPmtSensors;
00182     std::vector<DayaBay::RpcSensor> m_rpcSensors;
00183 
00184     // Lists of all Electronics Channels
00185     std::vector<DayaBay::ElecChannelId> m_elecChannelIds;
00186     std::vector<DayaBay::FeeChannelId> m_feeChannelIds;
00187     std::vector<DayaBay::FecChannelId> m_fecChannelIds;
00188 
00189     // Lists of Sensors by Site / Detector
00190     std::map<DayaBay::Detector,std::vector<DayaBay::DetectorSensor> > m_sensorsBySiteDet;
00191     std::map<DayaBay::Detector,std::vector<DayaBay::AdPmtSensor> > m_adPmtSensorsBySiteDet;
00192     std::map<DayaBay::Detector,std::vector<DayaBay::PoolPmtSensor> > m_poolPmtSensorsBySiteDet;
00193     std::map<DayaBay::Detector,std::vector<DayaBay::RpcSensor> > m_rpcSensorsBySiteDet;
00194 
00195     // Lists of Electronics Channels by Site / Detector
00196     std::map<DayaBay::Detector,std::vector<DayaBay::ElecChannelId> > m_elecChannelIdsBySiteDet;
00197     std::map<DayaBay::Detector,std::vector<DayaBay::FeeChannelId> > m_feeChannelIdsBySiteDet;
00198     std::map<DayaBay::Detector,std::vector<DayaBay::FecChannelId> > m_fecChannelIdsBySiteDet;
00199 
00200     // Map between Sensors and Electronics Channels
00201     std::map<DayaBay::DetectorSensor,DayaBay::ElecChannelId> m_channelBySensor;
00202     std::map<DayaBay::ElecChannelId,DayaBay::DetectorSensor> m_sensorByChannel;
00203 
00204     // Maps between PMT/RPC Hardware IDs and Sensors
00205     std::map<DayaBay::DetectorSensor,DayaBay::HardwareId> m_hardwareBySensor;
00206     std::map<DayaBay::HardwareId,DayaBay::DetectorSensor> m_sensorByHardware;
00207 
00208     // Maps between FEE/FEC Hardware IDs and Electronics Channels
00209     std::map<DayaBay::ElecChannelId,DayaBay::HardwareId> m_hardwareByChannel;
00210     std::map<DayaBay::HardwareId,DayaBay::ElecChannelId> m_channelByHardware;
00211 
00212     Context feeLastContext;             //cxs 2010-10-28
00213     const DbiResultKey* feeLastResult;  //cxs 2010-10-28
00214     inline virtual int readFeeTable(const ServiceMode&);//XiaoSu Chen 2010/10/28
00215 
00216 };
00217 
00218 #endif // DATASVC_DBICABLESVC_H
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:21:48 2011 for DbiDataSvc by doxygen 1.4.7