Pixie16 Analysis Software Suite
Analysis code for processing of .ldf files
TimingCalibrator.hpp
Go to the documentation of this file.
1 
6 #ifndef __TIMINGCALIBRATOR_HPP__
7 #define __TIMINGCALIBRATOR_HPP__
8 
9 #include <vector>
10 #include <map>
11 #include <string>
12 
13 #include "Globals.hpp"
14 #include "Messenger.hpp"
15 
18 public:
23 
25  double GetLeftRightTimeOffset(void)const {return(lrtOffset_);};
28  double GetTofOffset(const unsigned int &a) const {
29  if(tofOffsets_.find(a) == tofOffsets_.end())
30  return(0.0);
31  return((*tofOffsets_.find(a)).second);
32  };
34  double GetXOffset(void) const {return(xOffset_);};
36  double GetZ0(void) const {return(z0_);};
38  double GetZOffset(void) const {return(zOffset_);};
39 
41  unsigned int GetNumTofOffsets(void) const {return(tofOffsets_.size());};
42 
45  void SetLeftRightTimeOffset(const double &a) {lrtOffset_ = a;};
49  void SetTofOffset(const unsigned int &a, const double &b)
50  {tofOffsets_.insert(std::make_pair(a,b));};
53  void SetXOffset(const double &a) {xOffset_ = a;};
56  void SetZ0(const double &a) {z0_ = a;};
59  void SetZOffset(const double &a) {zOffset_ = a;};
60 private:
61  double lrtOffset_;
62  double xOffset_;
63  double z0_;
64  double zOffset_;
65 
66  std::map<unsigned int, double> tofOffsets_;
67 
69  void SetDefaults(void) {
70  lrtOffset_ = xOffset_ = z0_ = zOffset_ = 0.0;
71  };
72 };
73 
79 public:
81  static TimingCalibrator* get();
82 
86 private:
91 
92  void ReadTimingCalXml();
93 
95  std::map <TimingDefs::TimingIdentifier, TimingCalibration> calibrations_;
97  bool isVerbose_;
98 };
99 #endif // __TIMINGCALIBRATOR_HPP__
TimingCalibration default_
A default (all zeroes) calibration to return if none present.
Definition: TimingCalibrator.hpp:96
void SetTofOffset(const unsigned int &a, const double &b)
Definition: TimingCalibrator.hpp:49
void SetXOffset(const double &a)
Definition: TimingCalibrator.hpp:53
std::map< TimingDefs::TimingIdentifier, TimingCalibration > calibrations_
map to hold the calibrations
Definition: TimingCalibrator.hpp:95
A class to hold the timing calibration for a detector.
Definition: TimingCalibrator.hpp:17
static TimingCalibrator * instance
static instance of the class
Definition: TimingCalibrator.hpp:90
double z0_
perpendicular distance between the bar and source
Definition: TimingCalibrator.hpp:63
void ReadTimingCalXml()
Reads in the calibrations in the XML config.
TimingCalibration()
Definition: TimingCalibrator.hpp:20
TimingCalibration GetCalibration(const TimingDefs::TimingIdentifier &id)
void SetLeftRightTimeOffset(const double &a)
Definition: TimingCalibrator.hpp:45
~TimingCalibration()
Definition: TimingCalibrator.hpp:22
bool isVerbose_
The setting of the verbosity of the Timing Calibrations.
Definition: TimingCalibrator.hpp:97
void SetDefaults(void)
Definition: TimingCalibrator.hpp:69
constant parameters used in pixie16 analysis
Class to handle time calibrations for bar type detectors - Singleton.
Definition: TimingCalibrator.hpp:78
void SetZOffset(const double &a)
Definition: TimingCalibrator.hpp:59
A class to handle messages and output them prettily.
double zOffset_
additional corrections to z0
Definition: TimingCalibrator.hpp:64
double GetTofOffset(const unsigned int &a) const
Definition: TimingCalibrator.hpp:28
double GetXOffset(void) const
Definition: TimingCalibrator.hpp:34
unsigned int GetNumTofOffsets(void) const
Definition: TimingCalibrator.hpp:41
std::map< unsigned int, double > tofOffsets_
A map holding all of the ToF offsets w.r.t. starts.
Definition: TimingCalibrator.hpp:66
std::pair< unsigned int, std::string > TimingIdentifier
Definition: Globals.hpp:62
TimingCalibrator & operator=(TimingCalibrator const &)
the copy constructor
Messenger m_
Instance of the Messenger class to output information.
Definition: TimingCalibrator.hpp:94
void SetZ0(const double &a)
Definition: TimingCalibrator.hpp:56
This class outputs nicely formatted messages during configuration loading.
Definition: Messenger.hpp:19
double lrtOffset_
left-right time offset
Definition: TimingCalibrator.hpp:59
double xOffset_
offset between the center of the bar and the source
Definition: TimingCalibrator.hpp:62
double GetZ0(void) const
Definition: TimingCalibrator.hpp:36
double GetLeftRightTimeOffset(void) const
Definition: TimingCalibrator.hpp:25
double GetZOffset(void) const
Definition: TimingCalibrator.hpp:38