KaliVeda
Toolkit for HIC analysis
KVDetectorSignalTrace.h
1 #pragma once
2 
3 #include "TGraph.h"
4 #include "KVDetectorSignal.h"
5 #include <optional>
6 
19 {
22 
23  public:
25  : KVDetectorSignal("SignalTrace",det)
26  {}
27 
28  template<typename TraceData>
29  void SetTrace(const std::vector<TraceData>& trace, double time_resolution)
30  {
33 
34  int i=0;
35  fTimeResolution=time_resolution;
36  fTrace.Expand(trace.size());
37  for(auto d : trace){
38  fTrace.SetPoint(i,i*time_resolution,(double)d);
39  ++i;
40  }
41  }
42 
43  Double_t GetValue(const KVNameValueList& params = "") const override
44  {
46  return IsFired();
47  }
48 
50  {
51  return fTrace;
52  }
53 
55  {
57  return fTimeResolution;
58  }
59 
61 };
#define d(i)
double Double_t
#define ClassDefOverride(name, id)
Detector signal waveform.
KVDetectorSignalTrace(const KVDetector *det)
void SetTrace(const std::vector< TraceData > &trace, double time_resolution)
Double_t GetValue(const KVNameValueList &params="") const override
Double_t GetTimeResolution() const
Base class for output signal data produced by a detector.
virtual Bool_t IsFired() const
Base class for detector geometry description, interface to energy-loss calculations.
Definition: KVDetector.h:160
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
virtual void SetPoint(Int_t i, Double_t x, Double_t y)
virtual void Expand(Int_t newsize)