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

In This Package:

ICalibDataSvc.h
Go to the documentation of this file.
00001 /*
00002  *  ICalibDataSvc.h
00003  *
00004  *  Interface for Calibration Data
00005  *
00006  *  Created by Dan Dwyer on 2008/09/26
00007  */
00008 
00009 #ifndef DATASVC_ICALIBDATASVC_H
00010 #define DATASVC_ICALIBDATASVC_H
00011 
00012 #include "GaudiKernel/IInterface.h"
00013 #include "Conventions/Detectors.h"
00014 #include "Conventions/Electronics.h"
00015 #include "Context/ServiceMode.h"
00016 #include "math.h"
00017 #include <vector>
00018 
00019 namespace DayaBay {
00020 
00021   // Calibration Data for one PMT
00022   class PmtCalibData {
00023   public:
00024     enum Status_t {
00025       kUnknown       = 0x00,
00026       kGood          = 0x01,
00027       kBadEfficiency = 0x02,
00028       kBadTiming     = 0x04,
00029       kBadGain       = 0x08,      
00030       kBadGainWidth  = 0x10,
00031       kBadPedestal   = 0x20
00032     };
00033     PmtCalibData(){m_status=kUnknown; m_speHigh=0.; m_sigmaSpeHigh=0.; 
00034       m_speLow=0.; m_timeOffset=0.; m_timeSpread=0.; m_efficiency=0.; 
00035       m_prePulseProb=0.; m_afterPulseProb=0.; m_darkRate=0.;}
00036     ~PmtCalibData(){;}
00037   public:
00038     DayaBay::DetectorSensor m_pmtId;  // PMT Sensor ID number
00039     Status_t m_status;       // Status check on the PMT
00040     double m_speHigh;        // Single photoelectron mean ADC value (high gain)
00041     double m_sigmaSpeHigh;   // Single p.e. 1-sigma peak width (high gain)
00042     double m_speLow;         // ADC per P.E. ratio for low gain ADC channel
00043     double m_timeOffset;     // Relative transit time offset
00044     double m_timeSpread;     // Transit time spread
00045     double m_efficiency;     // Relative efficiency
00046     double m_prePulseProb;   // Probability of prepulsing
00047     double m_afterPulseProb; // Probability of afterpulsing
00048     double m_darkRate;       // Dark Rate
00049   };
00050 
00051   // Calibration Data for pedestal bias (jpochoa)
00052   class PedBiasCalibData {
00053   public:
00054     enum Status_t {
00055       kUnknown       = 0x00,
00056       kGood          = 0x01,
00057     };
00058     struct GausLine { 
00059       double amp, mean, sigma, offset, b, m;
00060     };
00061     struct Line {
00062       double b,m;
00063     };
00064     PedBiasCalibData(){m_status=kUnknown;m_amp.b=0;m_amp.m=0;m_mean.amp=0;m_mean.mean=0;m_mean.sigma=0;m_mean.offset=0;m_mean.b=0;m_mean.m=0;m_sigma.amp=0;m_sigma.mean=0;m_sigma.sigma=0;m_sigma.offset=0;m_sigma.b=0;m_sigma.m=0;m_a0.b=0;m_a0.m=0;m_a1.b=0;m_a1.m=0;m_a2.b=0;m_a2.m=0;m_a3.b=0;m_a3.m=0;}
00065     ~PedBiasCalibData(){;}
00066   public:
00067     DayaBay::DetectorSensor m_pmtId;  // PMT Sensor ID number
00068     Status_t m_status;       // Status check on the PMT
00069     GausLine m_mean, m_sigma;
00070     Line m_amp, m_a0, m_a1, m_a2, m_a3; 
00071       
00072   };
00073 
00074   // PMT Calibration Data for high-gain (jpochoa)
00075   class HighGainCalibData {
00076   public:
00077     enum Status_t {
00078       kUnknown       = 0x00,
00079       kGood          = 0x01,
00080     };
00081     HighGainCalibData(){m_status=kUnknown; m_speHigh=0; m_speHighError=0; m_sigmaSpeHigh=0; m_speHighFitQual=0;}
00082     ~HighGainCalibData(){;}
00083   public:
00084     DayaBay::DetectorSensor m_pmtId;  // PMT Sensor ID number
00085     Status_t m_status;       // Status check on the PMT
00086     double m_speHigh;
00087     double m_speHighError;
00088     double m_sigmaSpeHigh;
00089     double m_speHighFitQual;
00090   };
00091 
00092   // PMT Calibration Data for fine-gain (jpochoa)
00093   // Note: is same as above, but with FeeChannelId rather than DetectorSensor. See trac #1196
00094   class FineGainCalibData {
00095   public:
00096     enum Status_t {
00097       kUnknown       = 0x00,
00098       kGood          = 0x01,
00099       kBad           = 0x02
00100     };
00101     FineGainCalibData(){m_status=kUnknown; m_speHigh=0; m_speHighError=0; m_sigmaSpeHigh=0; m_speHighFitQual=0;}
00102     ~FineGainCalibData(){;}
00103   public:
00104     DayaBay::FeeChannelId m_channelId;  // FEE channel ID of channel connected to PMT 
00105     Status_t m_status;       // Status check on the PMT
00106     double m_speHigh;
00107     double m_speHighError;
00108     double m_sigmaSpeHigh;
00109     double m_speHighFitQual;
00110   };
00111 
00112   // PMT Calibration Data for timing (jpochoa)
00113   class TimingCalibData {
00114   public:
00115     enum Status_t {
00116       kUnknown       = 0x00,
00117       kGood          = 0x01,
00118       kBad           = 0x02
00119     };
00120     TimingCalibData(){m_status=kUnknown; m_par0=0; m_par1=0; m_par2=0; m_par3=0; m_par4=0; m_par5=0; m_fitqual=0;}
00121     double fullCorrection(float charge){     
00122       if(charge>0)
00123         return m_par0+m_par1*exp(-m_par2*charge)+m_par3*exp(-m_par4*charge)+m_par5*log(charge);
00124       else return m_par0;
00125     }
00126     ~TimingCalibData(){;}
00127   public:
00128     DayaBay::FeeChannelId m_channelId;  // PMT Sensor ID number
00129     Status_t m_status;       // Status check on the PMT
00130     double m_par0;
00131     double m_par1;
00132     double m_par2;
00133     double m_par3;
00134     double m_par4;
00135     double m_par5;
00136     double m_fitqual;
00137   };
00138 
00139   // FEE Channel Coarse-Fine Gain Conversion (jpochoa)
00140   class GainConvCalibData {
00141   public:
00142     enum Status_t {
00143       kUnknown       = 0x00,
00144       kGood          = 0x01,
00145     };
00146     struct Line {
00147       double slope,uncert;
00148     };
00149     GainConvCalibData(){m_status=kUnknown; m_fineCoarseRatio=0; m_fineCoarseRatioErr=0;}
00150     ~GainConvCalibData(){;}
00151   public:
00152     DayaBay::FeeChannelId m_channelId;  // PMT Sensor ID number
00153     Status_t m_status;       // Status check on the Fee Channel 
00154     double m_fineCoarseRatio;
00155     double m_fineCoarseRatioErr;
00156     Line m_frline,m_crline; 
00157   };
00158   
00159   //  Calibration Data for one RPC strip
00160   class RpcCalibData {
00161   public:
00162     enum Status_t {
00163       kUnknown      = 0x00,
00164       kGood         = 0x01
00165     };
00166     RpcCalibData(){m_status=kUnknown; m_gain=0.; m_sigmaGain=0.; 
00167       m_timeOffset=0.; m_timeSpread=0.; m_efficiency=0.; m_noiseRate=0.;}
00168     ~RpcCalibData(){;}
00169   public:
00170     DayaBay::RpcSensor m_rpcId;      // RPC Sensor ID number
00171     Status_t m_status;      // RPC strip status
00172     double m_gain;          // Relative gain of rpc strip
00173     double m_sigmaGain;     // 1-sigma variation in pulse size
00174     double m_timeOffset;    // Relative time offset
00175     double m_timeSpread;    // Time spread
00176     double m_efficiency;    // Relative efficiency
00177     double m_noiseRate;     // Single pulse noise rate
00178   };
00179 
00180   // Calibration data for one Front-end electronics channel
00181   class FeeCalibData {
00182   public:
00183     enum Status_t {
00184       kUnknown      = 0x00,
00185       kGood         = 0x01
00186     };
00187     FeeCalibData(){m_status = kUnknown; m_adcThresholdHigh=0.; 
00188       m_adcThresholdLow=0.; m_adcBaselineHigh=0.; m_adcBaselineLow=0.;}
00189     ~FeeCalibData(){;}
00190   public:
00191     DayaBay::FeeChannelId m_channelId;  // Electronics channel ID number
00192     Status_t m_status;         // Channel status
00193     double m_adcThresholdHigh; // Channel threshold, as measured in ~ADC counts
00194     double m_adcThresholdLow;  // Channel threshold, as measured in ~ADC counts
00195     double m_adcBaselineHigh;  // Measured high-gain baseline ADC value
00196     double m_adcBaselineLow;   // Measured low-gain baseline ADC value
00197   };
00198 
00199   // Calibration data for one RPC Front-end electronics channel
00200   class FecCalibData {
00201   public:
00202     enum Status_t {
00203       kUnknown      = 0x00,
00204       kGood         = 0x01
00205     };
00206     FecCalibData(){m_status = kUnknown;}
00207     ~FecCalibData(){;}
00208   public:
00209     DayaBay::FecChannelId m_channelId;  // Electronics channel ID number
00210     Status_t m_status;         // Channel status
00211   };
00212     
00213   // Energy Scale Calibration Points from Calibration Sources (littlejo)
00214   class SrcEnergyData {
00215   public:
00216     enum Status_t {
00217       kUnknown       = 0x00,
00218       kGood          = 0x01,
00219     };
00220     SrcEnergyData(){m_status=kUnknown; m_sourcePeakType=0; m_xSrcPosition=0; m_ySrcPosition=0; m_zSrcPosition=0; m_pePeak=0; m_pePeakUnc=0; m_pePeakFitQuality=0;}
00221     ~SrcEnergyData(){;}
00222   public:
00223     Status_t m_status;    // Status check on the calibration delpoyment
00224     int m_sourcePeakType;  // Source peak type DayaBay::Calibration::SourceType::SourcePeakType_t
00225     double m_xSrcPosition;
00226     double m_ySrcPosition;
00227     double m_zSrcPosition;
00228     double m_pePeak;
00229     double m_pePeakUnc;
00230     double m_pePeakFitQuality;
00231   };
00232 
00233 }
00234 
00235 // Declaration of the interface ID
00236 static const InterfaceID IID_ICalibDataSvc("ICalibDataSvc",1,0);
00237 
00238 class ICalibDataSvc : virtual public IInterface
00239 {
00240  public:
00241   // Retrieve interface ID
00242   static const InterfaceID& interfaceID(){
00243     return IID_ICalibDataSvc;
00244   }
00245 
00246   // Return the PMT Calibration data
00247   virtual const DayaBay::PmtCalibData* pmtCalibData(
00248                                            const DayaBay::DetectorSensor& pmtId,
00249                                            const ServiceMode& svcMode)= 0;
00250 
00251   // Return the PedBias Calibration data
00252   virtual const DayaBay::PedBiasCalibData* pedBiasCalibData(
00253                                            const DayaBay::DetectorSensor& pmtId,
00254                                            const ServiceMode& svcMode)= 0;
00255 
00256   // Return the HighGain Calibration data
00257   virtual const DayaBay::HighGainCalibData* highGainCalibData(
00258                                            const DayaBay::DetectorSensor& pmtId,
00259                                            const ServiceMode& svcMode)= 0;
00260 
00261   //The timing classes are now superseded by DybKernel/IPmtCalibSvc.h
00262   // Return the Timing Calibration data
00263   //virtual const DayaBay::TimingCalibData* timingCalibData(
00264   //                               const DayaBay::DetectorSensor& pmtId,
00265   //                               const ServiceMode& svcMode)= 0;
00266 
00267   // Return the Timing Calibration data
00268   //virtual const DayaBay::GainConvCalibData* gainConvCalibData(
00269   //                                       const DayaBay::FeeChannelId& channelId,
00270   //                                       const ServiceMode& svcMode)= 0;
00271 
00272   // Return the RPC Calibration data
00273   virtual const DayaBay::RpcCalibData* rpcCalibData(
00274                                            const DayaBay::RpcSensor& rpcId,
00275                                            const ServiceMode& svcMode)= 0;
00276 
00277   // Return the FEE Calibration data
00278   virtual const DayaBay::FeeCalibData* feeCalibData(
00279                                          const DayaBay::FeeChannelId& channelId,
00280                                          const ServiceMode& svcMode)= 0;
00281 
00282   // Return the FEC Calibration data
00283   virtual const DayaBay::FecCalibData* fecCalibData(
00284                                          const DayaBay::FecChannelId& channelId,
00285                                          const ServiceMode& svcMode)= 0;
00286 
00287   // Return the Calibration Source energy values for a given runNumber
00288   virtual const DayaBay::SrcEnergyData* srcEnergyData( int type,
00289                                                       const ServiceMode& svcMode)= 0;
00290 
00291   // Return the array of Calibration data by detector
00292   virtual const std::vector<DayaBay::PmtCalibData>& pmtCalibList(
00293                                            const DayaBay::Detector& detectorId,
00294                                            const ServiceMode& svcMode)= 0;
00295 
00296   // Return the array of PedBias data by detector
00297   virtual const std::vector<DayaBay::PedBiasCalibData>& pedBiasCalibList(
00298                                            const DayaBay::Detector& detectorId,
00299                                            const ServiceMode& svcMode)= 0;
00300 
00301   // Return the array of HighGain data by detector
00302   virtual const std::vector<DayaBay::HighGainCalibData>& highGainCalibList(
00303                                            const DayaBay::Detector& detectorId,
00304                                            const ServiceMode& svcMode)= 0;
00305 
00306   // Return the array of Timing data by detector
00307   //virtual const std::vector<DayaBay::TimingCalibData>& timingCalibList(
00308   //                                        const DayaBay::Detector& detectorId,
00309   //                                       const ServiceMode& svcMode)= 0;
00310 
00311   // Return the array of Timing data by detector
00312   //virtual const std::vector<DayaBay::GainConvCalibData>& gainConvCalibList(
00313   //                                         const DayaBay::Detector& detectorId,
00314   //                                       const ServiceMode& svcMode)= 0;
00315 
00316   // Return the array of Calibration data by detector
00317   virtual const std::vector<DayaBay::RpcCalibData>& rpcCalibList(
00318                                            const DayaBay::Detector& detectorId,
00319                                            const ServiceMode& svcMode)= 0;
00320 
00321   // Return the array of Calibration data by detector
00322   virtual const std::vector<DayaBay::FeeCalibData>& feeCalibList(
00323                                            const DayaBay::Detector& detectorId,
00324                                            const ServiceMode& svcMode)= 0;
00325 
00326   // Return the array of Calibration data by detector
00327   virtual const std::vector<DayaBay::FecCalibData>& fecCalibList(
00328                                            const DayaBay::Detector& detectorId,
00329                                            const ServiceMode& svcMode)= 0;
00330 
00331   // Return the array of HighGain data by detector
00332   virtual const std::vector<DayaBay::SrcEnergyData>& srcEnergyList(
00333                                                                    const ServiceMode& svcMode)= 0;
00334 
00335 };
00336 
00337 #endif  // DATASVC_ICALIBDATASVC_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