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

In This Package:

DbiCalibDataSvc.h
Go to the documentation of this file.
00001 /*
00002  *  DbiCalibDataSvc
00003  *
00004  *  Provides a static table of PMT / RPC calibration data
00005  *
00006  *  Created by Dan Dwyer on 2008/09/26
00007  *  Modified for DBI access by Weili Zhong 2009/7/4
00008  *  Modified for adding FEE access by XiaosSu Chen 2010/2/1
00009  *  Modified to include PedBias, HighGain, Timing and GainConv access by J. Pedro Ochoa 2011/5/22-2011/7/08
00010  * Now that this is superseded by DybSvc/DybMetaDataSvc, I disabled the timing service so it wouldn't conflict with the one in the other package (jpochoa, August 2012)
00011  */
00012 
00013 #ifndef DBIDATASVC_DBICALIBDATASVC_H
00014 #define DBIDATASVC_DBICALIBDATASVC_H
00015 
00016 #include "DataSvc/ICalibDataSvc.h"
00017 #include "GaudiKernel/Service.h"
00018 #include <string>
00019 
00020 class DbiResultKey;
00021 class Context;
00022 class ServiceMode;
00023 class DbiCalibDataSvc : public Service,
00024                          virtual public ICalibDataSvc
00025 {
00026  public:
00027   // Service interface implementation
00028   DbiCalibDataSvc(const std::string& name, ISvcLocator *svc);
00029   ~DbiCalibDataSvc();
00030   virtual StatusCode initialize();
00031   virtual StatusCode finalize();
00032   virtual StatusCode queryInterface(const InterfaceID& riid, 
00033                                     void** ppvInterface);
00034 
00035   // ICalibDataSvc interface implementation
00036   // Return the PMT Calibration data
00037   const DayaBay::PmtCalibData* pmtCalibData(
00038                                        const DayaBay::DetectorSensor& pmtId,
00039                                        const ServiceMode& svcMode);
00040 
00041   // Return the PMT Calibration data
00042   const DayaBay::PedBiasCalibData* pedBiasCalibData(
00043                                        const DayaBay::DetectorSensor& pmtId,
00044                                        const ServiceMode& svcMode);
00045 
00046   // Return the high-gain PMT Calibration data
00047   const DayaBay::HighGainCalibData* highGainCalibData(
00048                                        const DayaBay::DetectorSensor& pmtId,
00049                                        const ServiceMode& svcMode);
00050 
00051   // Return the PMT timing Calibration data
00052   //const DayaBay::TimingCalibData* timingCalibData(
00053   //                           const DayaBay::DetectorSensor& pmtId,
00054   //                           const ServiceMode& svcMode);
00055 
00056   // Return the FEE gain conversion calibration data
00057   //const DayaBay::GainConvCalibData* gainConvCalibData(
00058   //                                   const DayaBay::FeeChannelId& channelId,
00059   //                                   const ServiceMode& svcMode);
00060 
00061   // Return the RPC Calibration data
00062   const DayaBay::RpcCalibData* rpcCalibData(const DayaBay::RpcSensor& rpcId,
00063                                         const ServiceMode& svcMode);
00064 
00065   // Return the FEE Calibration data
00066   const DayaBay::FeeCalibData* feeCalibData(
00067                                          const DayaBay::FeeChannelId& channelId,
00068                                          const ServiceMode& svcMode);
00069 
00070   // Return the FEC Calibration data
00071   const DayaBay::FecCalibData* fecCalibData(
00072                                          const DayaBay::FecChannelId& channelId,
00073                                          const ServiceMode& svcMode);
00074 
00075   // Return the Energy Calibration Peaks of Calibration Sources
00076   const DayaBay::SrcEnergyData* srcEnergyData( int type,
00077                                               const ServiceMode& svcMode);
00078 
00079   // Return the array of PMT Calibration data by detector
00080   const std::vector<DayaBay::PmtCalibData>& pmtCalibList(
00081                                            const DayaBay::Detector& detectorId,
00082                                            const ServiceMode& svcMode);
00083 
00084   // Return the array of PedBias Calibration data by detector
00085   const std::vector<DayaBay::PedBiasCalibData>& pedBiasCalibList(
00086                                            const DayaBay::Detector& detectorId,
00087                                            const ServiceMode& svcMode);
00088 
00089   // Return the array of HighGain Calibration data by detector
00090   const std::vector<DayaBay::HighGainCalibData>& highGainCalibList(
00091                                            const DayaBay::Detector& detectorId,
00092                                            const ServiceMode& svcMode);
00093 
00094   // Return the array of Timing Calibration data by detector
00095   //const std::vector<DayaBay::TimingCalibData>& timingCalibList(
00096   //                                       const DayaBay::Detector& detectorId,
00097   //                               const ServiceMode& svcMode);
00098 
00099   // Return the array of GainConv Calibration data by detector
00100   //const std::vector<DayaBay::GainConvCalibData>& gainConvCalibList(
00101   //                                         const DayaBay::Detector& detectorId,
00102   //                                       const ServiceMode& svcMode);
00103 
00104   // Return the array of RPC Calibration data by detector
00105   const std::vector<DayaBay::RpcCalibData>& rpcCalibList(
00106                                            const DayaBay::Detector& detectorId,
00107                                            const ServiceMode& svcMode);
00108 
00109   // Return the array of Calibration data by detector
00110   const std::vector<DayaBay::FeeCalibData>& feeCalibList(
00111                                            const DayaBay::Detector& detectorId,
00112                                            const ServiceMode& svcMode);
00113 
00114   // Return the array of Calibration data by detector
00115   const std::vector<DayaBay::FecCalibData>& fecCalibList(
00116                                            const DayaBay::Detector& detectorId,
00117                                            const ServiceMode& svcMode);
00118 
00119   // Return the array of SrcEnergy Calibration data by detector
00120   const std::vector<DayaBay::SrcEnergyData>& srcEnergyList(
00121                                                            const ServiceMode& svcMode);
00122 
00123  private:
00124   // Lists of PMT/RPC and channel data by detector
00125   std::map<DayaBay::Detector, std::vector<DayaBay::PmtCalibData> > m_pmtData;
00126   std::map<DayaBay::Detector, std::vector<DayaBay::PedBiasCalibData> > m_pedBiasData;
00127   std::map<DayaBay::Detector, std::vector<DayaBay::HighGainCalibData> > m_highGainData;
00128   //std::map<DayaBay::Detector, std::vector<DayaBay::TimingCalibData> > m_timingData;
00129   //std::map<DayaBay::Detector, std::vector<DayaBay::GainConvCalibData> > m_gainConvData;
00130   std::map<DayaBay::Detector, std::vector<DayaBay::RpcCalibData> > m_rpcData;
00131   std::map<DayaBay::Detector, std::vector<DayaBay::FeeCalibData> > m_feeData;
00132   std::map<DayaBay::Detector, std::vector<DayaBay::FecCalibData> > m_fecData;
00133   std::map<DayaBay::Detector, std::vector<DayaBay::SrcEnergyData> > m_srcEnergyData;
00134 
00135   // Lookup map by Sensor ID
00136   std::map<DayaBay::DetectorSensor, DayaBay::PmtCalibData> m_pmtDataBySensor;
00137   std::map<DayaBay::DetectorSensor, DayaBay::PedBiasCalibData> m_pedBiasDataBySensor;
00138   std::map<DayaBay::DetectorSensor, DayaBay::HighGainCalibData> m_highGainDataBySensor;
00139   //std::map<DayaBay::DetectorSensor, DayaBay::TimingCalibData> m_timingDataBySensor;
00140   std::map<DayaBay::RpcSensor, DayaBay::RpcCalibData> m_rpcDataBySensor;
00141   // Lookup map by Channel ID
00142   //std::map<DayaBay::FeeChannelId, DayaBay::GainConvCalibData> m_gainConvDataByChannel;
00143   std::map<DayaBay::FeeChannelId, DayaBay::FeeCalibData> m_feeDataByChannel;
00144   std::map<DayaBay::FecChannelId, DayaBay::FecCalibData> m_fecDataByChannel;
00145 
00146   // Property: Which cable map to use?
00147   std::string m_cableSvcName;
00148 // protected:
00149   Context feeLastContext;
00150   Context fecLastContext;
00151   Context pmtLastContext;
00152   Context pmtPedBiasLastContext;
00153   Context pmtHighGainLastContext;
00154   //Context pmtTimingLastContext;
00155   //Context feeGainConvLastContext;
00156   Context srcEnergyLastContext;
00157   //virtual int getContext();
00158   const DbiResultKey* feeLastResult;
00159   const DbiResultKey* fecLastResult;
00160   const DbiResultKey* pmtLastResult; 
00161   const DbiResultKey* pmtPedBiasLastResult;
00162   const DbiResultKey* pmtHighGainLastResult;
00163   //const DbiResultKey* pmtTimingLastResult;
00164   //const DbiResultKey* feeGainConvLastResult;
00165   const DbiResultKey* srcEnergyLastResult;
00166   inline virtual int readCalibPmtTable(const ServiceMode&);
00167   inline virtual int readCalibPmtPedBiasTable(const ServiceMode&);
00168   inline virtual int readCalibPmtHighGainTable(const ServiceMode&);
00169   //inline virtual int readCalibPmtTimingTable(const ServiceMode&);
00170   //inline virtual int readCalibFeeGainConvTable(const ServiceMode&);
00171   inline virtual int readCalibFeeTable(const ServiceMode&);
00172   inline virtual int readCalibSrcEnergyTable(const ServiceMode&);
00173 //  virtual int writeCalibFeeTable(CalibFeeSpec*);
00174 
00175 };
00176 
00177 #endif  // DBIDATASVC_DBICALIBDATASVC_H
| 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