Pixie16 Analysis Software Suite
Analysis code for processing of .ldf files
Calibrator.hpp
Go to the documentation of this file.
1 
6 #ifndef __CALIBRATOR_HPP__
7 #define __CALIBRATOR_HPP__
8 
9 #include <vector>
10 #include <map>
11 #include <string>
12 
13 #include "Identifier.hpp"
14 
19  cal_raw,
20  cal_off,
21  cal_linear,
22  cal_quadratic,
23  cal_cubic,
24  cal_polynomial,
25  cal_hyplin,
26  cal_exp,
27 };
28 
33  double min;
34  double max;
35  std::vector<double> parameters;
36 };
37 
44 class Calibrator {
45 public:
47  Calibrator() {};
50 
59  void AddChannel(const Identifier& chanID, const std::string model,
60  double min, double max,
61  const std::vector<double>& par);
62 
66  double GetCalEnergy(const Identifier& chanID, double raw) const;
67 
68 private:
72  std::map<Identifier, std::vector<CalibrationParams> > channels_;
73 
77  double ModelRaw(double raw) const;
78 
81  double ModelOff() const;
82 
89  double ModelLinear(const std::vector<double>& par, double raw) const;
90 
97  double ModelQuadratic(const std::vector<double>& par, double raw) const;
98 
105  double ModelCubic(const std::vector<double>& par, double raw) const;
106 
117  double ModelPolynomial(const std::vector<double>& par, double raw) const;
118 
126  double ModelHypLin(const std::vector<double>& par, double raw) const;
127 
133  double ModelExp(const std::vector<double>& par, double raw) const;
134 };
135 #endif
Calibrator()
Definition: Calibrator.hpp:47
std::map< Identifier, std::vector< CalibrationParams > > channels_
Definition: Calibrator.hpp:72
std::vector< double > parameters
coefficients for calibration eqn.
Definition: Calibrator.hpp:35
double min
Minimum of range for calibration.
Definition: Calibrator.hpp:33
double ModelQuadratic(const std::vector< double > &par, double raw) const
~Calibrator()
Definition: Calibrator.hpp:49
double ModelOff() const
void AddChannel(const Identifier &chanID, const std::string model, double min, double max, const std::vector< double > &par)
CalibrationModel model
Calibration model to use.
Definition: Calibrator.hpp:32
Defines identifying information for channels.
double ModelRaw(double raw) const
double max
Maximum of range for calibration.
Definition: Calibrator.hpp:34
double ModelExp(const std::vector< double > &par, double raw) const
double GetCalEnergy(const Identifier &chanID, double raw) const
double ModelLinear(const std::vector< double > &par, double raw) const
double ModelPolynomial(const std::vector< double > &par, double raw) const
double ModelCubic(const std::vector< double > &par, double raw) const
This structure holds walk calibration model identfier, range of calibration and vector of parameters ...
Definition: Calibrator.hpp:31
double ModelHypLin(const std::vector< double > &par, double raw) const
Class to handle energy calibrations.
Definition: Calibrator.hpp:44
CalibrationModel
Definition: Calibrator.hpp:18
Channel identification.
Definition: Identifier.hpp:23