KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
KVVarGlob1.cpp
1#include "KVVarGlob1.h"
2#include "TMath.h"
3#include "TString.h"
4#include "Riostream.h"
5#include "KVClassFactory.h"
6
8
9
10
22
23void KVVarGlob1::MakeClass(const Char_t* classname, const Char_t* classdesc, int type)
24{
25 //Creates skeleton '.h' and '.cpp' files for a new global variable class which
26 //inherits from this class. Give a name for the new class and a short description
27 //which will be used to document the class.
28 //
29 // By default the new class will be of type 1-body. A Fill(KVNucleus*) method
30 // will be generated which the user should complete.
31 // For a 2-body variable, call MakeClass with type = KVVarGlob::kTwoBody.
32 // A skeleton Fill2(KVNucleus*,KVNucleus*) method will be generated.
33 // For a N-body variable, call MakeClass with type = KVVarGlob::kNBody.
34 // A skeleton FillN(KVEvent*) method will be generated.
35
36 // basic class template
37 KVClassFactory cf(classname, classdesc, "KVVarGlob1", kTRUE);
38
39 KVString body;
40
41 // add 'init' method
44
45 // add 'Fill', 'Fill2', or 'FillN' method
47
48 // body of 'Fill', 'Fill2', or 'FillN' method
50
51 // add body of method
53
54 cf.GenerateCode();
55}
56
57
58
62
64{
65 // PRIVATE method used by MakeClass.
66 // body of 'Fill', 'Fill2', or 'FillN' method
67
69 switch (type) {
70 case kTwoBody:
71 body += "\n";
72 body += "Use the FillVar(v) method to increment the quantity of the global variable.\n";
73 body += "The value, v, is to be evaluated from the properties of the\n";
74 body += "two KVNucleus pointers passed as arguments.\n";
75 break;
76 case kNBody:
77 body += "\n";
78 body += "Use the FillVar(v) method to increment the quantity of the global variable.\n";
79 body += "The value, v, is to be evaluated from the properties of the\n";
80 body += "KVEvent pointer passed as argument.\n";
81 break;
82 default:
83 body += "\n";
84 body += "Use the FillVar(v) method to increment the quantity of the global variable.\n";
85 body += "The value, v, is to be evaluated from the properties of the \n";
86 body += "KVNucleus passed as argument. For example, to evaluate the sum of the charge\n";
87 body += "of all fragments, you may proceed as follows:\n";
88 body += "\n";
89 body += "FillVar(n->GetZ());\n";
90 }
91}
92
93
char Char_t
constexpr Bool_t 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 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 GenerateCode()
Generate header and implementation file for currently-defined class.
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition KVString.h:73
Abstract base class for global variables which calculate a single value.
Definition KVVarGlob1.h:14
static void FillMethodBody(KVString &body, int type)
static void AddInitMethod(KVClassFactory &cf, KVString &body)
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)
Definition KVVarGlob.cpp:87
ClassImp(TPyArg)