KaliVeda  1.13/01
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 
22 {
23  // Returns the value of the calibrated signal using the current value of the input
24  // signal* and the current parameters of the calibration
25  //
26  // Any additional parameters required by the calibration can be passed as a
27  // comma-separated list of `parameter=value` pairs
28  //
29  // In case a problem occurs with the calculation [in case of an inverted calibration function],
30  // InversionFailure() will return kTRUE.
31  //
32  // *if a parameter `INPUT` is given, its value is used instead of the input signal.
33 
34  fInversionFail = false;
35  double result;
36  if (params.HasParameter("INPUT"))
37  result = fCalibrator->Compute(params.GetDoubleValue("INPUT"), params);
38  else
39  result = fCalibrator->Compute(fInputSignal->GetValue(params), params);
40  fInversionFail = fCalibrator->InversionFailure();
41  return result;
42 }
43 
44 
45 
57 
58 Double_t KVCalibratedSignal::GetInverseValue(Double_t out_val, const TString& in_sig, const KVNameValueList& params) const
59 {
60  // Returns the value of the input signal "in_sig" for a given value of this signal,
61  // using the inverse calibration function.
62  //
63  // Note that "in_sig" may not be the name/type of the direct input signal for this signal,
64  // in which case the chain of signals/calibrators is followed back to the required signal.
65  //
66  // In case a problem occurs with the calculation, InversionFailure() will return kTRUE.
67  //
68  // Any additional parameters required by the calibration can be passed as a
69  // comma-separated list of 'parameter=value' pairs
70 
71  if (in_sig == GetName()) return out_val;
72  return fInputSignal->GetInverseValue(fCalibrator->Invert(out_val, params), in_sig, params);
73 }
74 
75 
76 //____________________________________________________________________________//
77 
78 
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
KVString GetValue(KVString &l, char c)
Definition: KVTGID.cpp:800
double Double_t
Output signal from detector obtained by calibration.
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:190
virtual Double_t GetInverseValue(Double_t out_val, const TString &in_sig, const KVNameValueList &params="") const
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
virtual const char * GetName() const