StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
GainVoltPmtParameters.h
1 #ifndef GainVoltPmtParameters_H_INCLUDED
2 #define GainVoltPmtParameters_H_INCLUDED
3 #include <Stiostream.h>
4 #include <vector>
5 using std::vector;
6 #include "PowerLawFit.h"
7 #include "PmtIdentifier.h"
8 
14 {
15 public:
17  GainVoltPmtParameters(double refVoltage, double gains[5]);
18  GainVoltPmtParameters(int n, double volts[], double gains[]);
21  GainVoltPmtParameters & operator=(const GainVoltPmtParameters&parameters);
22 
24  void set(double refVolt, double gains[5]);
26  void set(int n, double volts[], double gains[]);
27 
29  friend ostream& operator<<(ostream& os, GainVoltPmtParameters& object);
31  friend istream& operator>>(istream& is, GainVoltPmtParameters& object);
33  void fit();
35  double getMultConstant() const;
37  double getExponent() const;
39  double getGain(double voltage) const;
41  double getVoltage(double gain) const;
43  int getNPoints() const;
45  void print();
48 
51  static void setDefaults(double multCoefficient, double exponent);
52 
55  bool isValid() const;
56 
57  static int ioMode;
58 protected:
59  PmtIdentifier _id;
61  double _a;
63  double _b;
65  map<double,double> _data;
68 
78  static double _defaultA;
79  static double _defaultB;
80 
81 };
82 
83 
84 #endif
static void setDefaults(double multCoefficient, double exponent)
double _a
multiplicative coefficient
friend ostream & operator<<(ostream &os, GainVoltPmtParameters &object)
Write obbject to ostream.
double getExponent() const
Get exponent of the power law.
map< double, double > _data
HV/Gain data.
int getNPoints() const
Get the number of data points available and used for this PMT.
double getGain(double voltage) const
Get the gain obtained if the given voltage is applied.
PowerLawFit< double > _fit
Transient Fit Object.
friend istream & operator>>(istream &is, GainVoltPmtParameters &object)
Read object from istream.
PmtIdentifier & getPmtIdentifier()
Get the PMT identifier.
void set(double refVolt, double gains[5])
Set the voltages and gains.
void print()
Print the information of this PMT.
bool isValid() const
Determine whether the input data are valid.
double getMultConstant() const
Get multiplicative constant.
double getVoltage(double gain) const
Get the voltage need to obtain the given relative gain.