6 #include "KVNameValueList.h"
8 #include "KVParticleCondition.h"
252 Int_t fMaxNumBranches;
256 using EventSelector = std::function<bool(
const KVVarGlob*)>;
257 EventSelector fEventSelector;
259 FrameSetter fFrameSetter;
268 void SetNameIndex(
const Char_t* name,
Int_t index);
269 void ClearNameIndex()
274 int GetIndexAtListPosition(
int pos)
const
279 TString GetNameAtListPosition(
int pos)
const
285 static void FillMethodBody(
KVString& body,
int type);
291 virtual Double_t getvalue_void()
const
294 return getvalue_int(0);
335 :
KVBase(
"KVVarGlob",
"KVVarGlob"), nameList(
"IndexList",
"Correspondance variable name<->index")
340 :
KVBase(nom, nom), nameList(
"IndexList",
"Correspondance variable name<->index")
351 nameList.
Copy(vgobj.nameList);
352 vgobj.fIsInitialized = fIsInitialized;
353 vgobj.fFrame = fFrame;
354 fOptions.
Copy(vgobj.fOptions);
355 fParameters.
Copy(vgobj.fParameters);
356 fSelection.Copy(vgobj.fSelection);
358 vgobj.fValueType = fValueType;
359 vgobj.fMaxNumBranches = fMaxNumBranches;
360 vgobj.fNormalization = fNormalization;
362 vgobj.fEventSelector = fEventSelector;
363 vgobj.fFrameSetter = fFrameSetter;
397 if (!fIsInitialized) {
399 fIsInitialized =
kTRUE;
415 if (fSelection.Test(c_in_frame)) {
427 if (fSelection.Test(n1_in_frame) && fSelection.Test(n2_in_frame))
428 fill2(n1_in_frame, n2_in_frame);
451 return getvalue_void() / fNormalization;
461 return getvalue_char(
name) / fNormalization;
471 return getvalue_int(i) / fNormalization;
481 std::vector<Double_t> tmp;
556 if (Par ==
"Zmin" || Par ==
"Zmax" || Par ==
"Vmin" || Par ==
"Vmax")
557 Fatal(
"SetParameter",
"Particle selection for global variables must be defined using SetSelection(const KVParticleCondition&).\nUpdate the use of variable \"%s\" in your analysis.",
569 fNormalization = norm;
576 if (
TString(par) ==
"Normalization")
return (fNormalization != 1.0);
583 if (
TString(par) ==
"Normalization")
return fNormalization;
589 return fNormalization;
596 if (
TString(par) ==
"Normalization") fNormalization = 1.0;
633 operator double()
const
725 if (!fEventSelector)
return true;
726 bool result = fEventSelector(
this);
732 return (
bool)fEventSelector;
750 if (fFrameSetter) fFrameSetter(
e,
this);
755 return (
bool)fFrameSetter;
#define ClassDefOverride(name, id)
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t sel
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Base class for KaliVeda framework.
void Copy(TObject &) const override
Make a copy of this object.
Factory class for generating skeleton files for new classes.
Abstract base class container for multi-particle events.
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
KVNamedParameter * GetParameter(Int_t idx) const
return the parameter object with index idx
void Copy(TObject &nvl) const override
Int_t GetIntValue(const Char_t *name) const
Double_t GetDoubleValue(const Char_t *name) const
void SetValue(const Char_t *name, value_type value)
void RemoveParameter(const Char_t *name)
const Char_t * GetNameAt(Int_t idx) const
Int_t GetNpar() const
return the number of stored parameters
void Clear(Option_t *opt="") override
value_type GetValue(const Char_t *name) const
Bool_t HasParameter(const Char_t *name) const
TString GetTStringValue(const Char_t *name) const
Description of properties and kinematics of atomic nuclei.
Implement selections for KVNucleus objects.
KVParticle const * GetFrame(const Char_t *frame, Bool_t warn_and_return_null_if_unknown=kTRUE) const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Base class for all global variable implementations.
void SetOption(const Char_t *option, const Char_t *value)
KVVarGlob(const Char_t *nom)
Double_t GetValue(const Char_t *name) const
Double_t operator()(void) const
virtual void Calculate()=0
const KVNameValueList & GetValueNameList() const
virtual Int_t GetNumberOfValues() const
Double_t GetValue(void) const
void Print(Option_t *="") const override
Bool_t HasValue(const Char_t *name) const
Double_t AsDouble() const
void SetNewFrameDefinition(const FrameSetter &f)
Double_t GetValue(Int_t i) const
const TString & GetFrame() const
void SetMaxNumBranches(Int_t n)
Int_t GetNameIndex(const Char_t *name) const
void SetParameter(const Char_t *par, Double_t value)
static void MakeClass(const Char_t *classname, const Char_t *classdesc, int type=kOneBody)
virtual void SetNormalization(Double_t norm)
void UnsetOption(const Char_t *opt)
bool IsDefiningNewFrame() const
void Fill(const KVNucleus *c)
TString GetOptionString(const Char_t *opt) const
Double_t operator()(Int_t i) const
Bool_t IsOptionGiven(const Char_t *opt)
virtual void FillN(const KVEvent *)
void Copy(TObject &obj) const override
void AddSelection(const KVParticleCondition &sel)
Double_t operator()(const Char_t *name) const
Double_t GetParameter(const Char_t *par) const
void SetEventSelection(const EventSelector &f)
Int_t GetNumberOfBranches() const
bool IsSelectingEvents() const
void Fill2(const KVNucleus *n1, const KVNucleus *n2)
virtual Bool_t IsGlobalVariable() const
virtual TString GetValueName(Int_t i) const
virtual Char_t GetValueType(Int_t) const
void SetFrame(const Char_t *ref)
virtual std::vector< Double_t > GetValueVector(void) const
void SetSelection(const KVParticleCondition &sel)
void DefineNewFrame(KVEvent *e) const
Double_t GetNormalization() const
bool TestEventSelection() const
void SetDefineGroup(const KVString &groupname="")
Bool_t IsParameterSet(const Char_t *par)
void UnsetParameter(const Char_t *par)
const char * GetName() const override
void AbstractMethod(const char *method) const
virtual void Fatal(const char *method, const char *msgfmt,...) const
void(off) SmallVectorTemplateBase< T