33 TIter it_sig(&det->GetListOfDetectorSignals());
38 fSignals.push_back(ds);
51 SetTitle(
Form(
"Signal calculated as %s for detector %s", _expr.Data(), det->GetName()));
85 _expr.
Begin(
"+-*/()");
86 bool multidetexpr =
false;
87 bool explicit_det_reference =
false;
89 while (!_expr.
End()) {
93 explicit_det_reference =
true;
96 auto det_label = t.
Next();
100 Error(
"KVDetectorSignalExpression(const Char_t*,const KVString&,const KVSeqCollection*)",
101 "Use of reference to unknown detector with label %s in expression %s",
102 det_label.Data(), _expr.
Data());
106 auto sig_name = t.
Next();
107 auto dsig = _det->GetDetectorSignal(sig_name);
108 KVString det_sig_ref =
Form(
"%s::%s", det_label.Data(), sig_name.Data());
111 Error(
"KVDetectorSignalExpression(const Char_t*,const KVString&,const KVSeqCollection*)",
112 "Use of reference to undefined signal %s for detector %s in expression %s : will evaluate as 0",
113 sig_name.Data(), _det->GetName(), _expr.
Data());
124 if (det && (_det != det)) multidetexpr =
true;
128 if (!explicit_det_reference) {
130 Error(
"KVDetectorSignalExpression(const Char_t*,const KVString&,const KVSeqCollection*)",
131 "Expression %s must contain explicit references to detector labels",
163 for (
int i = 0; i < nsigs; ++i) {
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
char * Form(const char *fmt,...)
void SetLabel(const Char_t *lab)
Signal output from a mathematical combination of other signals.
Double_t GetValue(const KVNameValueList ¶ms="") const
std::unique_ptr< TFormula > fFormula
std::vector< KVDetectorSignal * > fSignals
KVDetectorSignalExpression(const Char_t *type, const KVString &_expr, KVDetector *det)
Base class for output signal data produced by a detector.
virtual Bool_t IsRaw() const
void SetDetector(const KVDetector *d)
Base class for detector geometry description.
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
KaliVeda extensions to ROOT collection classes.
virtual TObject * FindObjectByLabel(const Char_t *) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Begin(TString delim) const
KVString Next(Bool_t strip_whitespace=kFALSE) const
virtual const char * GetName() const
virtual void SetTitle(const char *title="")
virtual void Error(const char *method, const char *msgfmt,...) const
int CompareTo(const char *cs, ECaseCompare cmp=kExact) const
const char * Data() const
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TString & ReplaceAll(const char *s1, const char *s2)