00001 #ifndef GainVoltPmtParameters_H_INCLUDED
00002 #define GainVoltPmtParameters_H_INCLUDED
00003 #include <Stiostream.h>
00004 #include <vector>
00005 using std::vector;
00006 #include "PowerLawFit.h"
00007 #include "PmtIdentifier.h"
00008
00013 class GainVoltPmtParameters
00014 {
00015 public:
00016 GainVoltPmtParameters();
00017 GainVoltPmtParameters(double refVoltage, double gains[5]);
00018 GainVoltPmtParameters(int n, double volts[], double gains[]);
00019 GainVoltPmtParameters(const GainVoltPmtParameters¶meters);
00020 ~GainVoltPmtParameters();
00021 GainVoltPmtParameters & operator=(const GainVoltPmtParameters¶meters);
00022
00024 void set(double refVolt, double gains[5]);
00026 void set(int n, double volts[], double gains[]);
00027
00029 friend ostream& operator<<(ostream& os, GainVoltPmtParameters& object);
00031 friend istream& operator>>(istream& is, GainVoltPmtParameters& object);
00033 void fit();
00035 double getMultConstant() const;
00037 double getExponent() const;
00039 double getGain(double voltage) const;
00041 double getVoltage(double gain) const;
00043 int getNPoints() const;
00045 void print();
00047 PmtIdentifier & getPmtIdentifier();
00048
00051 static void setDefaults(double multCoefficient, double exponent);
00052
00055 bool isValid() const;
00056
00057 static int ioMode;
00058 protected:
00059 PmtIdentifier _id;
00061 double _a;
00063 double _b;
00065 map<double,double> _data;
00067 PowerLawFit<double> _fit;
00068
00078 static double _defaultA;
00079 static double _defaultB;
00080
00081 };
00082
00083
00084 #endif