/search.css" rel="stylesheet" type="text/css"/> /search.js">
00001 /* 00002 * Spallation.h 00003 * 00004 * Generate energy calibration constant from Spallation 00005 * 00006 * 00007 * 00008 * yuzy@ihep.ac.cn 2011.05.14 00009 */ 00010 00011 #ifndef Spallation_H 00012 #define Spallation_H 00013 #include "Context/TimeStamp.h" 00014 #include "CalibEnergy/IEnergyCalibTool.h" 00015 #include "GaudiAlg/GaudiTool.h" 00016 #include "Conventions/Electronics.h" 00017 #include "Conventions/Detectors.h" 00018 #include "Context/Context.h" 00019 #include <fstream> 00020 #include <string> 00021 #include <vector> 00022 00023 using namespace std; 00024 00025 class IStatisticsSvc; 00026 class ICableSvc; 00027 class ICalibDataSvc; 00028 class IPmtGeomInfoSvc; 00029 00030 00031 class Spallation : public GaudiTool, virtual public IEnergyCalibTool 00032 { 00033 public: 00034 Spallation(const std::string& type, 00035 const std::string& name, 00036 const IInterface* parent); 00037 00038 virtual ~Spallation(); 00039 00040 virtual StatusCode initialize(); 00041 virtual StatusCode finalize(); 00042 00044 00047 virtual StatusCode process(const DayaBay::CalibReadoutHeader& calibReadout,int st, int acu, int zpo); 00048 00052 virtual StatusCode calibrate(float TimeInterval,int, int, int,int); 00053 00054 private: 00056 bool hasStats(const DayaBay::Detector& detector); 00058 StatusCode prepareStats(const Context& context); 00059 00060 // Format path to detector statistics 00061 std::string getOutPath(const DayaBay::Detector& detector); 00062 std::string getInPath(const DayaBay::Detector& detector); 00063 00064 00065 00066 // Tdc cut 00067 bool GoodTdc(int Tdc) 00068 { 00069 if(Tdc>m_tdclow&&Tdc<m_tdchigh) return true; 00070 else return false; 00071 }; 00072 00073 private: 00074 00075 // Property CableSvcName - Name of the cable service 00076 std::string m_cableSvcName; 00077 00078 // Property FilePath - File path of registered histograms 00079 std::string m_outfilepath; 00080 std::string m_infilepath; 00081 00082 std::string m_pmtGeomSvcName; 00083 00084 // Pmt Geometry Information Service 00085 IPmtGeomInfoSvc* m_pmtGeomSvc; 00086 00087 // CableSvc 00088 ICableSvc *m_cableSvc; 00089 00090 // IStatisticsSvc 00091 IStatisticsSvc *m_statsSvc; 00092 00093 // Cached list of processed detectors 00094 std::vector<DayaBay::Detector> m_processedDetectors; 00095 00096 // text output 00097 //ofstream m_textFile; 00098 //string m_textFileName; 00099 // properties of tdc range 00100 int m_tdclow; 00101 int m_tdchigh; 00102 TimeStamp m_vetoMuonTime; 00103 TimeStamp m_AD1MuonTime; 00104 TimeStamp m_AD2MuonTime; 00105 TimeStamp m_AD3MuonTime; 00106 TimeStamp m_AD4MuonTime; 00107 double m_AD1MuonCharge; 00108 double m_AD2MuonCharge; 00109 double m_AD3MuonCharge; 00110 double m_AD4MuonCharge; 00111 int m_MuonCut; 00112 int m_TimeLow; 00113 int m_TimeHigh; 00114 bool first; 00115 float m_ratio; 00116 }; 00117 00118 #endif // Spallation_H