00001 #ifndef NPTGAINTESTRESULT_H 00002 #define NPTGAINTESTRESULT_H 00003 00004 #include "TestResult.h" 00005 #include "FitObject.h" 00006 #include "Sct/RangedVector.h" 00007 00008 #include <boost/utility.hpp> 00009 #include <boost/scoped_ptr.hpp> 00010 #include <boost/shared_ptr.hpp> 00011 #include <memory> 00012 00013 #include <TF1.h> 00014 #include <TGraph.h> 00015 00016 using std::auto_ptr; 00017 using boost::scoped_ptr; 00018 using boost::shared_ptr; 00019 00020 namespace SctData { 00021 00022 class ResponseCurve; 00023 class CalChargeVariable; 00024 class ThresholdVariable; 00025 00030 class NPtGainTestResultData { 00031 public: 00032 NPtGainTestResultData() throw() : gain(0), noise(0), offset(0) {} 00033 shared_ptr<ResponseCurve> rc; 00034 shared_ptr<TGraph> graph; 00035 double gain; 00036 double noise; 00037 double offset; 00038 }; 00039 00040 00046 class NPtGainTestResult : public TestResult { 00047 public: 00048 NPtGainTestResult() throw(); 00049 00050 ~NPtGainTestResult() throw(); 00051 00056 NPtGainTestResult(unsigned int runNumber, const string& moduleName, 00057 const CalChargeVariable& testVariable, const ThresholdVariable& scanVariable) throw(); 00058 00059 //Override 00060 virtual string getClassName() const throw(); 00061 00065 const ResponseCurve& getResponseCurve() const throw(); 00066 00067 void setChannelDataSize(unsigned int i) throw(); 00068 void setChipDataSize(unsigned int i) throw(); 00069 00076 const NPtGainTestResultData& getChipData(unsigned int chip) const throw(LogicError); 00077 NPtGainTestResultData& getChipData(unsigned int chip) throw(LogicError); 00078 00085 const NPtGainTestResultData& getChannelData(unsigned int channel) const throw (LogicError); 00086 NPtGainTestResultData& getChannelData(unsigned int channel) throw (LogicError); 00087 00089 unsigned int getNChipData() const throw() { 00090 return chipData.size(); 00091 } 00092 00094 unsigned int getNChannelData() const throw() { 00095 return channelData.size(); 00096 } 00097 00102 double getSpecialScanPointValue() const throw(LogicError) { 00103 return getTestPointAt(specialScanIndex); 00104 } 00105 00106 unsigned int getSpecialScanIndex() const throw() { 00107 return specialScanIndex; 00108 } 00109 00115 void setSpecialScanPointValue(double pointValue) throw(LogicError); 00116 00117 private: 00118 //Data 00119 unsigned int specialScanIndex; 00120 RangedVector <NPtGainTestResultData> chipData; 00121 RangedVector <NPtGainTestResultData> channelData ; 00122 }; 00123 00124 00125 inline const NPtGainTestResultData& NPtGainTestResult::getChipData(unsigned int chip) const throw(LogicError) { 00126 return chipData[chip]; 00127 } 00128 00129 inline NPtGainTestResultData& NPtGainTestResult::getChipData(unsigned int chip) throw(LogicError) { 00130 return chipData[chip]; 00131 } 00132 00133 inline const NPtGainTestResultData& NPtGainTestResult::getChannelData(unsigned int channel) const throw(LogicError) { 00134 return channelData[channel]; 00135 } 00136 00137 inline NPtGainTestResultData& NPtGainTestResult::getChannelData(unsigned int channel) throw(LogicError) { 00138 return channelData[channel]; 00139 } 00140 } 00141 #endif //#ifndef NPTGAINTESTRESULT_H