2 #include "KVClassFactory.h"
16 void KVVarGlob::init(
void)
26 fParameters.
SetName(
"Parameters");
65 KVVarGlob::AddInitMethod(cf, body);
66 KVVarGlob::AddExtraInitMethodComment(cf, body);
67 KVVarGlob::ImplementInitMethod(cf, body,
type);
70 KVVarGlob::AddFillMethod(cf,
type);
73 KVVarGlob::FillMethodBody(body,
type);
76 KVVarGlob::AddFillMethodBody(cf, body,
type);
87 void KVVarGlob::FillMethodBody(
KVString& body,
int type)
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");
223 void KVVarGlob::SetNameIndex(
const Char_t* name,
Int_t index)
243 "No link between \"%s\" and the index %d: the name already exists.",
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 ");
298 if (fFrame !=
"") printf(
"%s", fFrame.
Data());
299 else printf(
"default");
302 printf(
"- List of options:\n");
306 printf(
"- List of parameters:\n");
309 if (fSelection.IsSet()) {
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()));
340 fDefineGroupFromSelection =
kTRUE;
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
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)
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
void Clear(Option_t *opt="") override
Bool_t HasParameter(const Char_t *name) const
void Print(Option_t *opt="") const override
A generic named parameter storing values of different types.
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)
virtual Int_t GetNumberOfValues() const
Double_t GetValue(void) const
void Print(Option_t *="") const override
Int_t GetNameIndex(const Char_t *name) const
static void MakeClass(const Char_t *classname, const Char_t *classdesc, int type=kOneBody)
Int_t GetNumberOfBranches() const
void SetDefineGroup(const KVString &groupname="")
const char * GetName() const override
virtual void SetName(const char *name)
virtual const char * ClassName() const
const char * Data() const
void Warning(UserClass p, const char *location, const char *va_(fmt),...)