(UNKNOWN PRODUCT) » INCLUDE » PBatch

class PBatch: public TObject

 Batch commands for particle and value operations

 This class allows for particle operations for
 analysing angles, masses, or making boost and
 rotations of TLorentzVectors/PParticles

 It is used for the PProjector to make histograms
 _inside_ the event loop without the need of an
 analysis macro

 The syntax is inspired by C++, but only a few
 rules of C++ have been implemented. Furthermore, the syntax
 has been simplified to make it more readable, and an interface
 to the particle input (and maybe to the database in a later step)
 has been foreseen

 As usual we have assignments, operators, functions and methods
 Each operation can be seperated by a semicolon (;)

 A simple case is outlined in the following command
 _x = [p,1]->M();
 This means that the double _x (which is automatically constructed)
 is assigned to the mass of the particle [p,1]
 Particle in brackets are the only allowed use without instantiantion
 as they are (hopefully) filled by the input. The additional number
 can be used for ordering information

 + and - operation
 This adds/subtracts PParticles or doubles:
 pp = [p,1] + [p,2];
 ...nothing else then the pp composite
 _x = pp->M();
 gives the invariant mass of the pp pair
 CAVEAT: Do _not_ use object name which are
 already assigned to particles in the data base, e.g.
 pi0=[pi0] is not allowed, use _pi0=[pi0] instead

 Brackets: Objects can be nested:
 _x = ([p,1] + [p,2])->M();
 ...makes the same as the 2 lines above

 Build-in methods:
 M()              : Invariant mass of the object
 M2()             : Invariant mass^2 of the object
 Boost(obj)       : Boost into rest frame of "obj"
   Example:
   pp = p1->Boost([p,1] + [p,2]);
   ...boost p1 in the rest frame of [p,1]+[p,2]
 Rot(obj)         : Rotate object such that obj
                    would point to z-Direction
 Angle(obj)       : Opening angle between obj
 Theta()          : Theta of momentum
 Print()          : Dump 4momentum or double

 In addition, all browsable methods of the class PParticle
 can be used (functions without arguments)

 Example:
 obj->Px();

 Build-in functions:
 cos()
 fabs()

 In addition, the TFormula syntax can be used

 Example:
 val_new = (val + 1.2);
 val = (val * TMath::Pi());

 Conditions:
 if(arg)          : Interrupts the current chain if arg == 0

 A very complex example: Look for the helicity distribution
 of the e+e- pair in the eta Dalitz decay
 _eta=[eta]; _ep=[e+]; _em=[e-];
 _eta->Boost([p + p]); _em->Boost([p + p]); _ep->Boost([p + p]);
 _ep->Rot(_eta); _em->Rot(_eta); _eta->Rot(_eta) ;
 _ep->Boost(_eta); _em->Boost(_eta); dil=_ep+_em;
 _ep->Rot(dil); _em->Rot(dil); dil->Rot(dil); _ep->Boost(dil); _em->Boost(dil) ;
 s1= _ep->Theta(); _x = cos(s1)


                    Author: I. Froehlich
                    Written: 14.02.2008
                    Revised:


Function Members (Methods)

public:
virtual~PBatch()
voidTObject::AbstractMethod(const char* method) const
Bool_tAddCommand(const char* command)
Bool_tAddCommand(char command, int key_a, int key1, int key2, int key3 = -1, int key4 = -1, int key5 = -1)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
virtual voidTObject::Copy(TObject& object) const
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
Bool_tExecute(const char* command)
Int_tExecute(Int_t command_pos = 0, Int_t retval = kFALSE)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
Int_tExecuteLastLine()
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Int_tGetBranch()
PParticle*GetCurrentParticle()
Int_tGetCurrentPosition()
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
Int_tGetElsePosition()
virtual const char*TObject::GetIconName() const
virtual const char*TObject::GetName() const
Int_tGetNewBatch()
Int_tGetNewBulk()
Int_tGetNewCommand()
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
Int_tGetOldCommand()
virtual Option_t*TObject::GetOption() const
virtual const char*TObject::GetTitle() const
TTree*GetTree()
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
Int_tIsReadonly()
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
PBatch&operator=(const PBatch&)
PBatch&operator=(PBatch&&)
virtual voidTObject::Paint(Option_t* option = "")
PBatch()
PBatch(PBatch&&)
PBatch(const PBatch&)
virtual voidTObject::Pop()
virtual voidPrint(const Option_t* delme = __null) const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidReplaceAll(TString* op, const char* oldstring, const char* newstring)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetKeysBranches(Int_t* my_key_branches)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetPosition(Int_t my_num_batch, Int_t my_num_bulk)
voidSetSizeBranches(Int_t* my_size_branches)
voidSetToolObject(TH1* Histo1)
voidSetToolObject(TH2* Histo2)
voidSetToolObject(TH3* Histo3)
voidSetToolObject(TGraph* Graph)
voidSetToolObject(TGraph2D* Graph2D)
voidSetToolObject(FILE* f)
voidSetToolObjectTmp(FILE* f)
voidSetTree(TTree* my_tree)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetVarList(char* my_x)
virtual voidShowMembers(TMemberInspector& insp) const
Int_tStatus()
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidTObject::MakeZombie()
private:
voidAddSpacePlaceholder(char* command)
Bool_tCheckAndSplit(char* arg, char delim, int* key1, int* key2)
Int_tCheckObjectType(Int_t key)
Int_tCrackMethodArgs(char* name)
Int_tEvalPFormula(char* command)
Bool_tGetArguments(const char* a, char* name, char** function, char** arg1, char** arg2)
Int_tGetDelimPosition(char* arg, char delim, Int_t* yes = __null)
Int_tGetKey(char* name, int fl, int makeflag)
Int_tGetMethodHandle(char* name, Int_t flag = 0)
voidRemoveSpacePlaceholder(char* command)

Data Members

public:
static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TObject::EStatusBitsTObject::kHasUUID
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TObject::(anonymous)TObject::kSingleKey
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
private:
Int_targ1
Int_targ2
Int_targ3
Int_targ4
Int_tbatch_histogram_param
Int_tbatch_models_param
Int_tbatch_particle_param
Int_tbatch_update_param
Int_tbatch_value_param
Int_tcommand_pointer
PParticle*current_particleFor push command
Int_tcurrent_position
char*echo_string[1000]
Int_telse_position
Int_terror_flag[1000]
Int_teval_err_dumped
TGraph*fGraph
TGraph2D*fGraph2D
TH1*fHisto1
TH2*fHisto2
TH3*fHisto3
FILE*file
Int_tflag_command_int[1000]=0: PParticle, =1: PUtilsRengine
Int_tis_readonly
Int_t*key_branches
Int_tlast_command_pointer
Int_tlocnum_batchPosition in the projector & reaction loop
Int_tlocnum_branchcurrent branch number
Int_tlocnum_bulkPosition in the projector & reaction loop
Int_tlocnum_commandPosition in the projector & reaction loop
Int_tlocnum_old_commandPosition in the projector & reaction loop
charlst_command[1000]
Int_tlst_command_int[1000]
PFormula*lst_form[1000]
Int_tlst_key[10][1000]
Int_tlst_key_a[1000]
Int_tlst_options_counter[1000]
char*method_name[100]
Int_tmethod_pointer
TMethodCall*methods[100]
Int_tmethods_arg_flags[4][100]
Int_tmethods_flags[100]
Int_tnum_batchPosition in the projector & reaction loop
Int_tnum_batch_param
Int_tnum_bulkPosition in the projector & reaction loop
Int_tnum_bulk_param
Int_tnum_command_param
PValuespdummy
Int_tpid_param
Double_t**readline_args[1000]
char*readline_format_string[1000]
intreadline_num_args[1000]
char*readline_string[1000]
Int_t*size_branches
TH1D**slicesx
TH1D**slicesy
static Int_tstack_num_batch[20]
static Int_tstack_num_bulk[20]
static Int_tstack_num_command[20]
static Int_tstack_num_pos
Int_tstatus
Int_tstream_default_pos_param
Int_tstream_max_pos_param
FILE*tmp_file
TTree*treePointer to storage tree
char*varlistAllowed command for new variables
Double_t*xAxis values for _eval
Double_t*yAxis values for _eval
Double_t*zAxis values for _eval

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

PBatch()
Int_t Execute(Int_t command_pos = 0, Int_t retval = kFALSE)
Bool_t AddCommand(const char* command)
void AddSpacePlaceholder(char* command)
void RemoveSpacePlaceholder(char* command)
Int_t EvalPFormula(char* command)
This helper function evaluates a (possible)
PFormula command, and put the arguments on the stack
if this did not worked out, the stack is resetted
void ReplaceAll(TString* op, const char* oldstring, const char* newstring)
Similar to TString::ReplaceAll, but checks also the following
char
Int_t GetMethodHandle(char* name, Int_t flag = 0)
seeks for the internal method
returns a -1 if not found or invalid
Int_t CrackMethodArgs(char* name)
Input: the arg string including the trailing ")"
Int_t CheckObjectType(Int_t key)
Bool_t AddCommand(char command, int key_a, int key1, int key2, int key3 = -1, int key4 = -1, int key5 = -1)
Bool_t GetArguments(const char* a, char* name, char** function, char** arg1, char** arg2)
looks for syntax like f(a,b);
Int_t GetDelimPosition(char* arg, char delim, Int_t* yes = __null)
Bool_t CheckAndSplit(char* arg, char delim, int* key1, int* key2)
Int_t GetKey(char* name, int fl, int makeflag)
void Print(const Option_t* delme = __null) const
PBatch()
constructor
void SetPosition(Int_t my_num_batch, Int_t my_num_bulk)
Int_t GetNewBatch()
{return locnum_batch;}
Int_t GetNewBulk()
{return locnum_bulk;}
Int_t GetNewCommand()
{return locnum_command;}
Int_t GetOldCommand()
Int_t GetBranch()
{return locnum_branch;}
Int_t GetElsePosition()
{return else_position;}
Int_t GetCurrentPosition()
Int_t Execute(Int_t command_pos = 0, Int_t retval = kFALSE)
Int_t ExecuteLastLine(void)
void SetToolObject(TH1* Histo1)
void SetToolObject(TH2* Histo2)
void SetToolObject(TH3* Histo3)
void SetToolObject(TGraph* Graph)
void SetToolObject(TGraph2D* Graph2D)
void SetToolObject(FILE* f)
void SetToolObjectTmp(FILE* f)
Int_t IsReadonly()
PParticle * GetCurrentParticle(void)
Int_t Status(void)
workaround to check for a "[+]"
=1 for such a case
=0 in all other cases
void SetVarList(char* my_x)
Allowed commands for new variables
Format must be "a;b;c;" with trailing ;'s
If NULL don't care!
void SetTree(TTree* my_tree)
{tree = my_tree;}
TTree * GetTree(void)
{return tree;}
void SetSizeBranches(Int_t* my_size_branches)
{size_branches = my_size_branches;}
void SetKeysBranches(Int_t* my_key_branches)
{key_branches = my_key_branches;}