KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVCalibratedSignal.cpp
Go to the documentation of this file.
1 //Created by KVClassFactory on Thu Jun 13 09:49:14 2019
2 //Author: John Frankland,,,
3 
4 #include "KVCalibratedSignal.h"
5 
7 
8 
9 
19 {
20  // Returns the value of the calibrated signal using the current value of the input
21  // signal* and the current parameters of the calibration
22  //
23  // Any additional parameters required by the calibration can be passed as a
24  // comma-separated list of `parameter=value` pairs
25  //
26  // *if a parameter `INPUT` is given, its value is used instead of the input signal.
27 
28  fInversionFail = false;
29  double result;
30  if (params.HasParameter("INPUT"))
31  result = fCalibrator->Compute(params.GetDoubleValue("INPUT"), params);
32  else
33  result = fCalibrator->Compute(fInputSignal->GetValue(params), params);
34  fInversionFail = fCalibrator->InversionFailure();
35  return result;
36 }
37 
38 
39 
49 
50 Double_t KVCalibratedSignal::GetInverseValue(Double_t out_val, const TString& in_sig, const KVNameValueList& params) const
51 {
52  // Returns the value of the input signal "in_sig" for a given value of this signal,
53  // using the inverse calibration function.
54  //
55  // Note that "in_sig" may not be the name/type of the direct input signal for this signal,
56  // in which case the chain of signals/calibrators is followed back to the required signal.
57  //
58  // Any additional parameters required by the calibration can be passed as a
59  // comma-separated list of 'parameter=value' pairs
60 
61  if (in_sig == GetName()) return out_val;
62  return fInputSignal->GetInverseValue(fCalibrator->Invert(out_val, params), in_sig, params);
63 }
64 
65 
66 //____________________________________________________________________________//
67 
68 
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
KVString GetValue(KVString &l, char c)
Definition: KVTGID.cpp:800
double Double_t
Calibrated output from detector.
KVCalibrator * fCalibrator
calibrator used to transform input signal
KVDetectorSignal * fInputSignal
signal which is used as input to generate calibrated signal
Double_t GetInverseValue(Double_t out_val, const TString &in_sig, const KVNameValueList &params="") const
virtual Double_t Invert(Double_t x, const KVNameValueList &) const
Definition: KVCalibrator.h:167
virtual Double_t GetInverseValue(Double_t out_val, const TString &in_sig, const KVNameValueList &="") const
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
virtual const char * GetName() const