00001 #include "NPtGainTestResult.h"
00002 #include "ModuleDefect.h"
00003 #include "ResponseCurve.h"
00004 #include "FitScanResult.h"
00005 #include "CalChargeVariable.h"
00006 #include "ThresholdVariable.h"
00007 #include "Sct/SctParameters.h"
00008
00009 #include <sstream>
00010
00011
00012 #include <TF1.h>
00013 #include <TH2.h>
00014 #include <TGraph.h>
00015
00016 using namespace std;
00017
00018 namespace SctData {
00019
00020 NPtGainTestResult::NPtGainTestResult() throw() : chipData("NPtGainTestResult::ChipData"), channelData("NPtGainTestResult::ChannelData") {
00021 chipData.resize(nChipModule);
00022 channelData.resize(nChannelModule);
00023 }
00024
00025 NPtGainTestResult::NPtGainTestResult(unsigned int runNumber, const string & moduleName,
00026 const CalChargeVariable& testVariable, const ThresholdVariable& scanVariable) throw()
00027 : TestResult(runNumber, moduleName, testVariable, scanVariable), specialScanIndex(0),
00028 chipData("NPtGainTestResult::ChipData"), channelData("NPtGainTestResult::ChannelData") {
00029 chipData.resize(nChipModule);
00030 channelData.resize(nChannelModule);
00031 }
00032
00033 NPtGainTestResult::~NPtGainTestResult() throw() {
00034
00035 }
00036
00037 string NPtGainTestResult::getClassName() const throw() {
00038 return "SctData::NPtGainTestResult";
00039 }
00040
00041 void NPtGainTestResult::setSpecialScanPointValue(double pointValue) throw(LogicError) {
00042 for (unsigned int i=0; i<data.size(); ++i) {
00043 if (fabs(data[i].testPoint - pointValue) < 10e-6) {
00044 specialScanIndex = i;
00045 return;
00046 }
00047 }
00048
00049 ostringstream text;
00050 text << "TestResult::setSpecialPoint cannot be set to " << pointValue;
00051 throw InvalidArgumentError( text.str(), __FILE__, __LINE__ );
00052 }
00053
00054 void NPtGainTestResult::setChannelDataSize(unsigned int i) throw() {
00055 channelData.resize(i);
00056 }
00057
00058 void NPtGainTestResult::setChipDataSize(unsigned int i) throw() {
00059 chipData.resize(i);
00060 }
00061 }