2#include "KVClassFactory.h"
25 fOptions.SetName(
"Options");
26 fParameters.SetName(
"Parameters");
93 body =
"Calculation of contribution to 2-body global variable of pair (n1,n2) of nuclei.\n";
94 body +=
"NOTE: this method will be called once for each distinct pair of nuclei in the event\n";
95 body +=
"including pairs of identical nuclei (n1 = n2).\n";
96 body +=
"If you want to calculate a global variable using only each non-identical pair,\n";
97 body +=
"then make sure in your implementation that you check n1!=n2\n";
100 body =
"Calculation of contribution to N-body global variable of particles in event e.\n";
103 body =
"Calculation of contribution to 1-body global variable of nucleus n\n";
115 body =
" fType = KVVarGlob::kTwoBody; // this is a 2-body variable\n";
118 body =
" fType = KVVarGlob::kNBody; // this is a N-body variable\n";
121 body =
" fType = KVVarGlob::kOneBody; // this is a 1-body variable\n";
133 body +=
"You should also (if your variable calculates several different quantities)\n";
134 body +=
"set up a correspondance between named values and index number\n";
135 body +=
"using method SetNameIndex(const Char_t*,Int_t)\n";
136 body +=
"in order for GetValue(const Char_t*) to work correctly.\n";
137 body +=
"The index numbers should be the same as in your getvalue_int(Int_t) method.\n";
153 body =
"Private initialisation method called by all constructors.\n";
154 body +=
"All member initialisations should be done here.\n";
170 cf.
AddMethod(
"fill2",
"void",
"protected");
180 cf.
AddMethod(
"fill",
"void",
"protected");
242 Warning(
"SetNameIndex(const Char_t *name,Int_t index)",
243 "No link between \"%s\" and the index %d: the name already exists.",
264 Warning(
"GetNameIndex(const Char_t *name)",
265 "The parameter \"%s\" does not exist fot the Class %s.\n 0 returned.",
282 printf(
"One-body variable]\n");
285 printf(
"Two-body variable]\n");
288 printf(
"N-body variable]\n");
291 printf(
"Variable type unknown!]\n");
294 printf(
"- Multi-valued variable:\n");
296 printf(
"- Single-valued variable:\n");
297 printf(
"- Kinematics calculated in ");
299 else printf(
"default");
302 printf(
"- List of options:\n");
306 printf(
"- List of parameters:\n");
310 printf(
"- Particle selection criteria:\n");
315 printf(
"- Available values:\n");
316 printf(
" IND. NAME VALUE\n");
319 printf(
" %d %s %f\n",
np->GetInt(),
np->GetName(),
GetValue(
np->GetName()));
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 np
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
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 Atom_t Atom_t Time_t type
virtual void Clear(Option_t *opt="")
Clear object properties : name, type/title, number, label.
Factory class for generating skeleton files for new classes.
void AddMethodComment(const Char_t *method_name, const KVString &comment)
Set the comments for method 'method_name' added to the class using AddMethod.
void GenerateCode()
Generate header and implementation file for currently-defined class.
void AddHeaderIncludeFile(const Char_t *filename)
void AddMethodBody(const Char_t *method_name, const KVString &body)
void AddMethodArgument(const Char_t *method_name, const Char_t *argument_type, const Char_t *argument_name="", const Char_t *default_value="")
KVClassMethod * AddMethod(const Char_t *name, const Char_t *return_type, const Char_t *access="public", Bool_t isVirtual=kFALSE, Bool_t isConst=kFALSE)
virtual void Print(Option_t *opt="") const
KVNamedParameter * GetParameter(Int_t idx) const
return the parameter object with index idx
Int_t GetIntValue(const Char_t *name) const
void SetValue(const Char_t *name, value_type value)
Int_t GetNpar() const
return the number of stored parameters
Bool_t HasParameter(const Char_t *name) const
A generic named parameter storing values of different types.
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Print(Option_t *opt="") const
Base class for all global variable implementations.
void SetOption(const Char_t *option, const Char_t *value)
static void AddInitMethod(KVClassFactory &cf, KVString &body)
void Print(Option_t *="") const
Bool_t fDefineGroupFromSelection
virtual Int_t GetNumberOfValues() const
Double_t GetValue(void) const
KVString fFrame
(optional) name of reference frame used for kinematics
KVNameValueList fOptions
list of options
void SetNameIndex(const Char_t *name, Int_t index)
Int_t GetNameIndex(const Char_t *name) const
static void MakeClass(const Char_t *classname, const Char_t *classdesc, int type=kOneBody)
static void AddFillMethodBody(KVClassFactory &cf, KVString &body, int type)
static void ImplementInitMethod(KVClassFactory &cf, KVString &body, int type)
static void AddFillMethod(KVClassFactory &cf, int type)
static void FillMethodBody(KVString &body, int type)
KVNameValueList nameList
correspondence between variable name and index
Int_t GetNumberOfBranches() const
KVParticleCondition fSelection
(optional) condition used to select particles
KVNameValueList fParameters
list of parameters
static void AddExtraInitMethodComment(KVClassFactory &cf, KVString &body)
Int_t fType
type of variable global; = kOneBody, kTwoBody or kNBody
void SetDefineGroup(const KVString &groupname="")
const char * GetName() const override
virtual const char * ClassName() const
virtual void Warning(const char *method, const char *msgfmt,...) const
const char * Data() const