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 00120 shared_ptr<TGraph> getOffsetGraph() const; 00124 shared_ptr<TGraph> getNoiseGraph() const; 00128 shared_ptr<TGraph> getGainGraph() const; 00129 00130 RangedVector <float> noiseSlope; 00131 RangedVector <float> offsetSlope; 00132 RangedVector <float> gainSlope; 00133 private: 00134 //Data 00135 unsigned int specialScanIndex; 00136 RangedVector <NPtGainTestResultData> chipData; 00137 RangedVector <NPtGainTestResultData> channelData ; 00138 }; 00139 00140 00141 inline const NPtGainTestResultData& NPtGainTestResult::getChipData(unsigned int chip) const throw(LogicError) { 00142 return chipData[chip]; 00143 } 00144 00145 inline NPtGainTestResultData& NPtGainTestResult::getChipData(unsigned int chip) throw(LogicError) { 00146 return chipData[chip]; 00147 } 00148 00149 inline const NPtGainTestResultData& NPtGainTestResult::getChannelData(unsigned int channel) const throw(LogicError) { 00150 return channelData[channel]; 00151 } 00152 00153 inline NPtGainTestResultData& NPtGainTestResult::getChannelData(unsigned int channel) throw(LogicError) { 00154 return channelData[channel]; 00155 } 00156 } 00157 #endif //#ifndef NPTGAINTESTRESULT_H