00001
00002
00003 #ifndef TOFCALISVC_H
00004 #define TOFCALISVC_H
00005
00006 #include <iostream>
00007 #include <ios>
00008 #include <vector>
00009
00010
00011
00012 #include "TofCaliSvc/BTofCal.h"
00013 #include "TofCaliSvc/BTofCommonCal.h"
00014 #include "TofCaliSvc/ETofCal.h"
00015 #include "TofCaliSvc/EtfCal.h"
00016 #include "TofCaliSvc/EtfBunchCal.h"
00017 #include "TofCaliSvc/TofInfoCal.h"
00018
00019 #include "GaudiKernel/Service.h"
00020 #include "GaudiKernel/IInterface.h"
00021 #include "GaudiKernel/Property.h"
00022 #include "TofCaliSvc/ITofCaliSvc.h"
00023 #include "GaudiKernel/IIncidentListener.h"
00024 #include "GaudiKernel/IDataProviderSvc.h"
00025
00026 class TofCaliSvc : public Service, virtual public ITofCaliSvc,virtual public IIncidentListener
00027 {
00028 public:
00029
00030 TofCaliSvc( const std::string& name, ISvcLocator* svcloc );
00031 ~TofCaliSvc();
00032
00033 virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvUnknown);
00034 virtual StatusCode initialize ( );
00035 virtual StatusCode finalize ( );
00036 void handle(const Incident&);
00037
00038
00039 BTofCal* BTof(unsigned int id) const;
00040 BTofCommonCal* BTofCommon() const;
00041 ETofCal* ETof(unsigned int id) const;
00042 EtfCal* EtfTof(unsigned int id) const;
00043 TofInfoCal* TofInfo() const;
00044
00045 const double BTDelay1(unsigned int id);
00046 const double BTDelay2(unsigned int id);
00047 const double ETDelay(unsigned int id);
00048 const double BTCorr1(double ADC,double zHit,unsigned int id);
00049 const double BTCorr2(double ADC,double zHit,unsigned int id);
00050 const double BTCorrOffset1(double zHit,unsigned int id,double t0);
00051 const double BTCorrOffset2(double zHit,unsigned int id,double t0);
00052 const double TOffset();
00053 const double BTime1(double ADC,double TDC,double zHit,unsigned int id,double t0);
00054 const double BTime2(double ADC,double TDC,double zHit,unsigned int id,double t0);
00055 const double ETime(double ADC,double TDC,double rHit,unsigned int id);
00056 const double EtfTime(double ADC1,double ADC2, double TDC1, double TDC2,unsigned int id, unsigned int strip, double t0);
00057 const double EtfTime1(double ADC,double TDC,double zHit,unsigned int id, unsigned int strip, double t0);
00058 const double EtfTime2(double ADC,double TDC,double zHit,unsigned int id, unsigned int strip, double t0);
00059 const double EtfTimeMC(double ADC1,double ADC2, double TDC1, double TDC2,unsigned int id, unsigned int strip, double t0);
00060 const double EtfTimeMC1(double ADC,double TDC,double zHit,unsigned int id, unsigned int strip, double t0);
00061 const double EtfTimeMC2(double ADC,double TDC,double zHit,unsigned int id, unsigned int strip, double t0);
00062 const double EtfTime(double tleft,double tright);
00063 const double EtfBunchP(int index);
00064 const double BTimeCounter(double tleft,double tright,double z,unsigned int id);
00065 const double BTimeCluster(double tlayer1,double tlayer2,double z1, double z2,unsigned int id1, unsigned int id2);
00066 const double BSigma1(double zHit, unsigned int id);
00067 const double BSigma2(double zHit, unsigned int id);
00068 const double BSigmaCounter(double zHit, unsigned int id);
00069 const double BSigmaCluster(double zHit1, double zHit2, unsigned int id1, unsigned int id2);
00070 const double ESigma(double rHit, unsigned int id);
00071 const double BPulseHeight1(double ADC, double zHit, double sint, unsigned int id);
00072 const double BPulseHeight2(double ADC, double zHit, double sint, unsigned int id);
00073 const double BPulseHeight(double ADC1, double ADC2, double zHit, double sint, unsigned int id);
00074 const double BPh(double ADC1, double ADC2, double zHit, unsigned int id);
00075 const double EPulseHeight(double ADC, double rHit, double cost, unsigned int id);
00076 const double EPh(double ADC, double rHit, unsigned int id);
00077 const double BVeff(unsigned int id);
00078 const double BAtten(unsigned int id);
00079 const double BGainForward(unsigned int id);
00080 const double BGainBackward(unsigned int id);
00081 const double getQ0(unsigned int id);
00082 const double EVeff(unsigned int id);
00083 const double EAtten(unsigned int id);
00084 const double EGain(unsigned int id);
00085 const double EtfVeff(unsigned int id, unsigned int strip);
00086 const double ZTDC(double tleft, double tright, unsigned int id);
00087 const double ZTDC1(double tright, unsigned int id, double z);
00088 const double ZTDC2(double tleft, unsigned int id, double z);
00089 const double ZADC(double qleft, double qright, unsigned int id);
00090 const double ZADC1(double qright, unsigned int id, double z);
00091 const double ZADC2(double qleft, unsigned int id, double z);
00092 const double EtfZTDC(double tleft, double tright, unsigned int id, unsigned int strip);
00093 const int RunBegin();
00094 const int RunEnd();
00095 const int Version();
00096 const int QCorr();
00097 const int QElec();
00098 const int MisLable();
00099 const int BrEast(unsigned int No);
00100 const int BrWest(unsigned int No);
00101 const int Endcap(unsigned int No);
00102 const int Etf(unsigned int No);
00103 void Dump();
00104
00105 private:
00106 StatusCode FillfromDatabase();
00107 bool m_hasbeeninitialized;
00108
00109 private:
00110 IDataProviderSvc* m_pCalibDataSvc;
00111 IntegerProperty m_run;
00112 std::vector<BTofCal*> fBTofCal;
00113 std::vector<ETofCal*> fETofCal;
00114 std::vector<EtfCal*> fEtfCal;
00115 std::vector<EtfBunchCal*> fEtfBunchCal;
00116 std::vector<BTofCommonCal*> fBTofCommonCal;
00117 std::vector<TofInfoCal*> fTofInfoCal;
00118
00119 };
00120 #endif