00001 #ifndef TOFCALIBFIT_H 00002 #define TOFCALIBFIT_H 00003 00004 #include "tofcalgsec/TofDataSet.h" 00005 #include "CLHEP/Matrix/Vector.h" 00006 #include "TH1F.h" 00007 #include "TCanvas.h" 00008 00009 using namespace std; 00010 using namespace CLHEP; 00011 00012 const double zbegin = -115.0; 00013 const double zend = 115.0; 00014 const double barrelRadius = 87.05; 00015 00016 const double rbegin = 53.5; 00017 const double rend = 80.5; 00018 00019 const int nBarrelCommon = 4; // number of calib_barrel_common.txt 00020 00021 class TofCalibFit{ 00022 public: 00023 TofCalibFit( bool isbarrel, const int npar ); 00024 ~TofCalibFit(); 00025 00026 public: 00027 const string& name() const { return m_name; } 00028 virtual void calculate( RecordSet*& data, unsigned int icounter ) = 0; 00029 00030 void fillTxt( const char* file ); 00031 void fillRoot( const char* file ); 00032 00033 public: 00034 HepVector tcorrelation() { return X; } 00035 void setTCorrelation( HepVector tc ) { m_tcorrelation = tc; } 00036 00037 protected: 00038 int m_npar; 00039 00040 unsigned int nKind; 00041 unsigned int nBinPerCounter; 00042 00043 unsigned int nHistPerCounter; 00044 unsigned int nCanvasPerCounter; 00045 std::vector<unsigned int> nGraphPerCanvasPerCounter; 00046 unsigned int nHistogram; 00047 unsigned int nCanvas; 00048 std::vector<unsigned int> nGraphPerCanvas; 00049 00050 string m_name; 00051 HepVector X; 00052 00053 std::vector<TH1F*> m_histograms; 00054 std::vector<TH1F*> m_graphs; 00055 std::vector<HepVector> m_result; 00056 00057 std::vector<string> CanvasPerCounterName; 00058 std::vector<string> CanvasName; 00059 00060 HepVector m_tcorrelation; 00061 00062 private: 00063 unsigned int nCounter; 00064 }; 00065 00066 #endif