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

In This Package:

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

Generated on Fri May 16 2014 09:59:23 for DataSvc by doxygen 1.7.4