Main Page   Modules   Namespace List   Class Hierarchy   Data Structures   File List   Namespace Members   Data Fields   Globals   Related Pages  

NoiseOccupancyTestResult.cpp

Go to the documentation of this file.
00001 #include "NoiseOccupancyTestResult.h"
00002 #include "RawScanResult.h"
00003 #include "ThresholdVariable.h"
00004 #include "NullVariable.h"
00005 #include "Sct/SctParameters.h"
00006 
00007 #include <TF1.h>
00008 #include <TGraph.h>
00009 #include <TGraphAsymmErrors.h>
00010 
00011 #include <iostream>
00012 
00013 using namespace std;
00014 
00015 namespace SctData {
00016     
00017     NoiseOccupancyTestResult::NoiseOccupancyTestResult() throw() :
00018     chipResult("NoiseOccupancyTestResult::chipResult")
00019     {
00020     chipResult.resize(nChipModule);
00021     }
00022     
00023     
00024     NoiseOccupancyTestResult::NoiseOccupancyTestResult(const unsigned runNumber, const string& moduleName, const ThresholdVariable& scanVariable) throw() :
00025     TestResult(runNumber, moduleName, NullVariable::instance(), scanVariable), 
00026     chipResult("NoiseOccupancyTestResult::chipResult")
00027     {
00028     chipResult.resize(nChipModule);
00029     }
00030     
00031     NoiseOccupancyTestResult::~NoiseOccupancyTestResult() throw() {
00032     }
00033     
00034     string NoiseOccupancyTestResult::getClassName() const throw() {
00035     return "SctData::NoiseOccupancyTestResult";
00036     }
00037     
00038     void NoiseOccupancyTestResult::addScan(const unsigned scanNumber, const double testPoint) throw (LogicError) {
00039     if (data.size() != 0) throw InvariantViolatedError("NoiseOccupancyTestResult::addScan - can only contain 1 scan", __FILE__, __LINE__);
00040     TestResult::addScan(scanNumber, testPoint);
00041     }
00042     
00043     
00047     double ChipNOResult::getNoise() const throw() {
00048     if (!fit.get()) return 0.;
00049     return 6250.*sqrt(-1/(2*fit->GetParameter(1)));
00050     //return 6250.*sqrt(1/(2*fit->GetParameter(1)));
00051     }
00052     
00053     ChipNOResult& ChipNOResult::operator=(const ChipNOResult& copyme) throw(){
00054     mean=copyme.mean; rms=copyme.rms; 
00055     fit=copyme.fit; graph=copyme.graph;
00056     return *this;
00057     }
00058     
00059     double lnerfc(double* x, double* par) {
00060     return par[0] + log(TMath::Erfc(sqrt(par[1]*x[0])));
00061     }
00062     
00063     
00064     auto_ptr<TF1> NoiseOccupancyTestResult::createFitFunction() throw() {
00065     return auto_ptr<TF1> (new TF1("fitfn", "pol1", 0.3, 2)) ;
00066     //return auto_ptr<TF1> (new TF1("fitfn", "[0]-[1]*x-1./2.*log(x)", 0.5, 2)) ;
00067     //return auto_ptr<TF1> (new TF1("fitfn", "[0]+[1]*x-1./2.*log(x)+log(1.-[1]/(2.*pow(x,1.5)))", 0.5, 2)) ;
00068     //auto_ptr<TF1> f(new TF1("fitfn", lnerfc, 0.5, 2, 2)) ;
00069     //f->SetParameter(0, 1);
00070     //f->SetParameter(1, 1);
00071     //return f;
00072     }
00073     
00074 }
00075 

Generated on Mon Dec 15 19:36:09 2003 for SCT DAQ/DCS Software by doxygen1.3-rc3