Pixie16 Analysis Software Suite
Analysis code for processing of .ldf files
HighResTimingData.hpp
Go to the documentation of this file.
1 
6 #ifndef __HIGHRESTIMINGDATA_HPP__
7 #define __HIGHRESTIMINGDATA_HPP__
8 
9 #include "ChanEvent.hpp"
10 #include "Globals.hpp"
11 #include "Trace.hpp"
12 
15 public:
19  virtual ~HighResTimingData() {};
20 
24  trace_ = &chan->GetTrace();
25  highResTime_ = chan->GetHighResTime()*1e9;
26  pixieEnergy_ = chan->GetEnergy();
27 
28  snr_ =
29  20*log10(trace_->GetValue("maxval") /
30  trace_->GetValue("sigmaBaseline"));
31 
32  if(!std::isnan(trace_->GetValue("maxval")) &&
33  !std::isnan(trace_->GetValue("phase")) &&
34  !std::isnan(trace_->GetValue("tqdc")) &&
35  !std::isnan(trace_->GetValue("sigmaBaseline")) ) {
36  isValidData_ = true;
37  }else
38  isValidData_ = false;
39  };
40 
45  double CalcEnergy(const double &tof, const double &z0) {
46  return((0.5*Globals::get()->neutronMass()*
47  pow((z0/tof)/Globals::get()->speedOfLight(), 2)));
48  }
49 
51  bool GetIsValidData() const { return isValidData_; };
53  double GetAveBaseline() const { return trace_->GetValue("baseline"); };
55  double GetDiscrimination() const { return trace_->GetValue("discrim"); };
57  double GetHighResTime() const { return highResTime_; };
59  double GetMaximumPosition() const { return trace_->GetValue("maxpos"); }
61  double GetMaximumValue() const { return trace_->GetValue("maxval"); };
63  int GetNumAboveThresh() const { return trace_->GetValue("numAboveThresh");; };
65  double GetPhase() const { return trace_->GetValue("phase")*
66  (Globals::get()->clockInSeconds()*1e+9); };
68  double GetPixieEnergy() const { return(pixieEnergy_); };
70  double GetSignalToNoiseRatio() const { return snr_; };
72  double GetStdDevBaseline() const { return trace_->GetValue("sigmaBaseline"); };
74  Trace* GetTrace() const { return trace_; };
76  double GetTraceQdc() const { return trace_->GetValue("tqdc") /
79  double GetWalk() const { return trace_->GetValue("walk"); };
81  double GetWalkCorrectedTime() const
82  { return highResTime_ - trace_->GetValue("walk"); };
83 
86  void SetDataValid(const bool &val) { isValidData_ = val; };
87 
88 private:
89  Trace *trace_;
90 
91  bool isValidData_;
92  double highResTime_;
93  double snr_;
94  double pixieEnergy_;
95 };
96 
98 typedef std::map<TimingDefs::TimingIdentifier, HighResTimingData> TimingMap;
99 #endif // __HIGHRESTIMINGDATA_HPP__
double GetPhase() const
Definition: HighResTimingData.hpp:65
double qdcCompression() const
Definition: Globals.hpp:182
A channel event.
Definition: ChanEvent.hpp:23
double GetEnergy() const
Definition: ChanEvent.hpp:48
Trace * GetTrace() const
Definition: HighResTimingData.hpp:74
double GetAveBaseline() const
Definition: HighResTimingData.hpp:53
double GetMaximumPosition() const
Definition: HighResTimingData.hpp:59
A Class to define what a channel event is.
virtual ~HighResTimingData()
Definition: HighResTimingData.hpp:19
Class for holding information for high resolution timing.
Definition: HighResTimingData.hpp:14
double GetStdDevBaseline() const
Definition: HighResTimingData.hpp:72
static Globals * get()
double GetPixieEnergy() const
Definition: HighResTimingData.hpp:68
double GetWalk() const
Definition: HighResTimingData.hpp:79
HighResTimingData(ChanEvent *chan)
Definition: HighResTimingData.hpp:23
double GetHighResTime() const
Definition: ChanEvent.hpp:63
HighResTimingData()
Definition: HighResTimingData.hpp:17
bool isValidData_
Member variable "dataValid_".
Definition: HighResTimingData.hpp:91
double GetDiscrimination() const
Definition: HighResTimingData.hpp:55
Trace * trace_
the trace for the channel
Definition: HighResTimingData.hpp:86
double CalcEnergy(const double &tof, const double &z0)
Definition: HighResTimingData.hpp:45
constant parameters used in pixie16 analysis
double GetMaximumValue() const
Definition: HighResTimingData.hpp:61
double snr_
Member variable "snr_".
Definition: HighResTimingData.hpp:93
Store the information for a trace.
Definition: Trace.hpp:34
const Trace & GetTrace() const
Definition: ChanEvent.hpp:69
A simple class to store the traces.
double GetHighResTime() const
Definition: HighResTimingData.hpp:57
double pixieEnergy_
The energy from pixie.
Definition: HighResTimingData.hpp:94
double GetValue(std::string name) const
Definition: Trace.hpp:113
std::map< TimingDefs::TimingIdentifier, HighResTimingData > TimingMap
Definition: HighResTimingData.hpp:98
double GetTraceQdc() const
Definition: HighResTimingData.hpp:76
double clockInSeconds() const
Definition: Globals.hpp:150
void SetDataValid(const bool &val)
Definition: HighResTimingData.hpp:86
double GetWalkCorrectedTime() const
Definition: HighResTimingData.hpp:81
double GetSignalToNoiseRatio() const
Definition: HighResTimingData.hpp:70
double highResTime_
Member variable "highResTime_".
Definition: HighResTimingData.hpp:92
int GetNumAboveThresh() const
Definition: HighResTimingData.hpp:63
bool GetIsValidData() const
Definition: HighResTimingData.hpp:51