Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TFoam Class Reference

TFoam is the main class of the multi-dimensional general purpose Monte Carlo event generator (integrator) FOAM.

FOAM Version 1.02M

Authors
S. Jadach and P.Sawicki Institute of Nuclear Physics, Cracow, Poland Stanislaw. Jadac.nosp@m.h@if.nosp@m.j.edu.nosp@m..pl, Pawel.nosp@m..Saw.nosp@m.icki@.nosp@m.ifj..nosp@m.edu.p.nosp@m.l

What is FOAM for?

  • Suppose you want to generate randomly points (vectors) according to an arbitrary probability distribution in n dimensions, for which you supply your own method. FOAM can do it for you! Even if your distributions has quite strong peaks and is discontinuous!
  • FOAM generates random points with weight one or with variable weight.
  • FOAM is capable to integrate using efficient "adaptive" MC method. (The distribution does not need to be normalized to one.)

How does it work?

FOAM is the simplified version of the multi-dimensional general purpose Monte Carlo event generator (integrator) FOAM. It creates hyper-rectangular "foam of cells", which is more dense around its peaks. See the following 2-dim. example of the map of 1000 cells for doubly peaked distribution:

FOAM is now fully integrated with the ROOT package. The important bonus of the ROOT use is persistency of the FOAM objects!

For more sophisticated problems full version of FOAM may be more appropriate: See full version of FOAM

Simple example of the use of FOAM:

#include "Riostream.h"
#include "TFoam.h"
#include "TCanvas.h"
#include "TH2.h"
#include "TMath.h"
#include "TFoamIntegrand.h"
#include "TRandom3.h"
//_____________________________________________________________________________
return x*x;
}
//_____________________________________________________________________________
// 2-dimensional distribution for Foam, normalized to one (within 1e-5)
Double_t GamSq= sqr(0.100e0);
Double_t Dist= 0;
Dist +=exp(-(sqr(x-1./3) +sqr(y-1./3))/GamSq)/GamSq/TMath::Pi();
Dist +=exp(-(sqr(x-2./3) +sqr(y-2./3))/GamSq)/GamSq/TMath::Pi();
return 0.5*Dist;
}
//_____________________________________________________________________________
cout<<"--- kanwa started ---"<<endl;
TH2D *hst_xy = new TH2D("hst_xy" , "x-y plot", 50,0,1.0, 50,0,1.0);
Double_t MCvect[2]; // 2-dim vector generated in the MC run
//
TRandom *PseRan = new TRandom3(); // Create random number generator
PseRan->SetSeed(4357);
TFoam *FoamX = new TFoam("FoamX"); // Create Simulator
FoamX->SetkDim(2); // No. of dimensions, obligatory!
FoamX->SetnCells(500); // Optionally No. of cells, default=2000
FoamX->SetRhoInt(Camel2); // Set 2-dim distribution, included below
FoamX->SetPseRan(PseRan); // Set random number generator
FoamX->Initialize(); // Initialize simulator, may take time...
//
// visualising generated distribution
TCanvas *cKanwa = new TCanvas("cKanwa","Canvas for plotting",600,600);
cKanwa->cd();
// From now on FoamX is ready to generate events
int nshow=5000;
for(long loop=0; loop<100000; loop++){
FoamX->MakeEvent(); // generate MC event
FoamX->GetMCvect( MCvect); // get generated vector (x,y)
if(loop<10) cout<<"(x,y) = ( "<< x <<", "<< y <<" )"<<endl;
hst_xy->Fill(x,y);
// live plot
if(loop == nshow){
nshow += 5000;
hst_xy->Draw("lego2");
cKanwa->Update();
}
}// loop
//
hst_xy->Draw("lego2"); // final plot
cKanwa->Update();
//
FoamX->GetIntegMC( MCresult, MCerror); // get MC integral, should be one
cout << " MCresult= " << MCresult << " +- " << MCerror <<endl;
cout<<"--- kanwa ended ---"<<endl;
return 0;
}
int Int_t
Signed integer 4 bytes (int)
Definition RtypesCore.h:59
double Double_t
Double 8 bytes.
Definition RtypesCore.h:73
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
The Canvas class.
Definition TCanvas.h:23
TFoam is the main class of the multi-dimensional general purpose Monte Carlo event generator (integra...
Definition TFoam.h:21
2-D histogram with a double per channel (see TH1 documentation)
Definition TH2.h:400
Random number generator class based on M.
Definition TRandom3.h:27
This is the base class for the ROOT Random number generators.
Definition TRandom.h:27
Double_t y[n]
Definition legend1.C:17
Double_t x[n]
Definition legend1.C:17
constexpr Double_t Pi()
Definition TMath.h:40

Canonical nine steering parameters of FOAM

Name default Description
kDim 0 Dimension of the integration space. Must be redefined!
nCells 1000 No of allocated number of cells,
nSampl 200 No. of MC events in the cell MC exploration
nBin 8 No. of bins in edge-histogram in cell exploration
OptRej 1 OptRej = 0, weighted; OptRej=1, wt=1 MC events
OptDrive 2 Maximum weight reduction, =1 for variance reduction
EvPerBin 25 Maximum number of the effective wt=1 events/bin,
EvPerBin=0 deactivates this option
Chat 1 =0,1,2 is the `‘chat level’' in the standard output
MaxWtRej 1.1 Maximum weight used to get w=1 MC events

The above can be redefined before calling Initialize() method, for instance FoamObject->SetkDim(15) sets dimension of the distribution to 15. Only kDim HAS TO BE redefined, the other parameters may be left at their defaults. nCell may be increased up to about million cells for wildly peaked distributions. Increasing nSampl sometimes helps, but it may cost CPU time. MaxWtRej may need to be increased for wild a distribution, while using OptRej=0.

Past versions of FOAM: August 2003, v.1.00; September 2003 v.1.01 Adopted starting from FOAM-2.06 by P. Sawicki

Users of FOAM are kindly requested to cite the following work: S. Jadach, Computer Physics Communications 152 (2003) 55.

Definition at line 21 of file TFoam.h.

Public Types

enum  {
  kIsOnHeap = 0x01000000 , kNotDeleted = 0x02000000 , kZombie = 0x04000000 , kInconsistent = 0x08000000 ,
  kBitMask = 0x00ffffff
}
 
enum  { kSingleKey = (1ULL << ( 0 )) , kOverwrite = (1ULL << ( 1 )) , kWriteDelete = (1ULL << ( 2 )) }
 
enum  EDeprecatedStatusBits { kObjInCanvas = (1ULL << ( 3 )) }
 
enum  EStatusBits {
  kCanDelete = (1ULL << ( 0 )) , kMustCleanup = (1ULL << ( 3 )) , kIsReferenced = (1ULL << ( 4 )) , kHasUUID = (1ULL << ( 5 )) ,
  kCannotPick = (1ULL << ( 6 )) , kNoContextMenu = (1ULL << ( 8 )) , kInvalidObject = (1ULL << ( 13 ))
}
 

Public Member Functions

 TFoam ()
 Default constructor for streamer, user should not use it.
 
 TFoam (const Char_t *)
 User constructor, to be employed by the user.
 
 TFoam (const TFoam &)
 Copy Constructor NOT IMPLEMENTED (NEVER USED)
 
 ~TFoam () override
 Default destructor.
 
void AbstractMethod (const char *method) const
 Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it.
 
virtual void AppendPad (Option_t *option="")
 Append graphics object to current pad.
 
virtual void Browse (TBrowser *b)
 Browse object. May be overridden for another default action.
 
virtual void Carver (Int_t &, Double_t &, Double_t &)
 Internal method used by Initialize.
 
virtual Int_t CellFill (Int_t, TFoamCell *)
 Internal method used by Initialize.
 
virtual void CheckAll (Int_t)
 User utility, miscellaneous and debug.
 
ULong_t CheckedHash ()
 Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.
 
virtual const char * ClassName () const
 Returns name of class to which the object belongs.
 
virtual void Clear (Option_t *="")
 
virtual TObjectClone (const char *newname="") const
 Make a clone of an object using the Streamer facility.
 
virtual Int_t Compare (const TObject *obj) const
 Compare abstract method.
 
virtual void Copy (TObject &object) const
 Copy this to obj.
 
virtual void Delete (Option_t *option="")
 Delete this object.
 
virtual Int_t DistancetoPrimitive (Int_t px, Int_t py)
 Computes distance from point (px,py) to the object.
 
virtual Int_t Divide (TFoamCell *)
 Internal method used by Initialize.
 
virtual void Draw (Option_t *option="")
 Default Draw method for all objects.
 
virtual void DrawClass () const
 Draw class inheritance tree of the class to which this object belongs.
 
virtual TObjectDrawClone (Option_t *option="") const
 Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).
 
virtual void Dump () const
 Dump contents of object on stdout.
 
virtual void Error (const char *method, const char *msgfmt,...) const
 Issue error message.
 
virtual Double_t Eval (Double_t *)
 Internal method.
 
virtual void Execute (const char *method, const char *params, Int_t *error=nullptr)
 Execute method on this object with the given parameter string, e.g.
 
virtual void Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr)
 Execute method on this object with parameters stored in the TObjArray.
 
virtual void ExecuteEvent (Int_t event, Int_t px, Int_t py)
 Execute action corresponding to an event at (px,py).
 
virtual void Explore (TFoamCell *Cell)
 Internal method used by Initialize.
 
virtual void Fatal (const char *method, const char *msgfmt,...) const
 Issue fatal error message.
 
virtual void Finalize (Double_t &, Double_t &)
 May be called optionally by the user after the MC run.
 
virtual TObjectFindObject (const char *name) const
 Must be redefined in derived classes.
 
virtual TObjectFindObject (const TObject *obj) const
 Must be redefined in derived classes.
 
virtual void GenerCel2 (TFoamCell *&)
 Internal method.
 
virtual Option_tGetDrawOption () const
 Get option used by the graphics system to draw this object.
 
virtual const char * GetIconName () const
 Returns mime type name of object.
 
virtual void GetIntegMC (Double_t &, Double_t &)
 User method.
 
virtual void GetIntNorm (Double_t &, Double_t &)
 User method.
 
virtual void GetMCvect (Double_t *)
 User may get generated MC point/vector with help of this method.
 
virtual Double_t GetMCwt ()
 User may get weight MC weight using this method.
 
virtual void GetMCwt (Double_t &)
 User may get weight MC weight using this method.
 
virtual const char * GetName () const
 Returns name of object.
 
virtual Long_t GetnCalls () const
 
virtual Long_t GetnEffev () const
 
virtual char * GetObjectInfo (Int_t px, Int_t py) const
 Returns string containing info about the object at position (px,py).
 
virtual Option_tGetOption () const
 
virtual Double_t GetPrimary () const
 
virtual void GetPrimary (Double_t &prime)
 
virtual TRandomGetPseRan () const
 
virtual TFoamIntegrandGetRho ()
 
virtual const char * GetTitle () const
 Returns title of object.
 
virtual Int_t GetTotDim () const
 
virtual UInt_t GetUniqueID () const
 Return the unique object id.
 
virtual const char * GetVersion () const
 
virtual void GetWtParams (Double_t, Double_t &, Double_t &, Double_t &)
 May be called optionally after the MC run.
 
virtual void Grow ()
 Internal method used by Initialize.
 
virtual Bool_t HandleTimer (TTimer *timer)
 Execute action in response of a timer timing out.
 
virtual ULong_t Hash () const
 Return hash value for this object.
 
Bool_t HasInconsistentHash () const
 Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.
 
virtual void Info (const char *method, const char *msgfmt,...) const
 Issue info message.
 
virtual Bool_t InheritsFrom (const char *classname) const
 Returns kTRUE if object inherits from class "classname".
 
virtual Bool_t InheritsFrom (const TClass *cl) const
 Returns kTRUE if object inherits from TClass cl.
 
virtual void InitCells ()
 Internal method used by Initialize.
 
virtual void Initialize ()
 Basic initialization of FOAM invoked by the user.
 
virtual void Initialize (TRandom *, TFoamIntegrand *)
 
virtual void Inspect () const
 Dump contents of this object in a graphics canvas.
 
void InvertBit (UInt_t f)
 
TClassIsA () const override
 
Bool_t IsDestructed () const
 IsDestructed.
 
virtual Bool_t IsEqual (const TObject *obj) const
 Default equal comparison (objects are equal if they have the same address in memory).
 
virtual Bool_t IsFolder () const
 Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
 
R__ALWAYS_INLINE Bool_t IsOnHeap () const
 
virtual Bool_t IsSortable () const
 
R__ALWAYS_INLINE Bool_t IsZombie () const
 
virtual void LinkCells (void)
 
virtual void ls (Option_t *option="") const
 The ls function lists the contents of a class on stdout.
 
virtual void MakeActiveList ()
 Internal method used by Initialize.
 
virtual void MakeAlpha ()
 Internal method used by Initialize.
 
virtual void MakeEvent ()
 User method.
 
void MayNotUse (const char *method) const
 Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).
 
virtual Double_t MCgenerate (Double_t *MCvect)
 User method which generates MC event and returns MC weight.
 
virtual Bool_t Notify ()
 This method must be overridden to handle object notification (the base implementation is no-op).
 
void Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const
 Use this method to declare a method obsolete.
 
void operator delete (void *, size_t)
 Operator delete for sized deallocation.
 
void operator delete (void *ptr)
 Operator delete.
 
void operator delete (void *ptr, void *vp)
 Only called by placement new when throwing an exception.
 
void operator delete[] (void *, size_t)
 Operator delete [] for sized deallocation.
 
void operator delete[] (void *ptr)
 Operator delete [].
 
void operator delete[] (void *ptr, void *vp)
 Only called by placement new[] when throwing an exception.
 
void * operator new (size_t sz)
 
void * operator new (size_t sz, void *vp)
 
void * operator new[] (size_t sz)
 
void * operator new[] (size_t sz, void *vp)
 
virtual void Paint (Option_t *option="")
 This method must be overridden if a class wants to paint itself.
 
virtual Long_t PeekMax ()
 Internal method used by Initialize.
 
virtual void Pop ()
 Pop on object drawn in a pad to the top of the display list.
 
virtual void Print (Option_t *option="") const
 This method must be overridden when a class wants to print itself.
 
virtual void PrintCells ()
 Prints geometry of ALL cells of the FOAM.
 
virtual Int_t Read (const char *name)
 Read contents of object with specified name from the current directory.
 
virtual void RecursiveRemove (TObject *obj)
 Recursively remove this object from a list.
 
void ResetBit (UInt_t f)
 
virtual void ResetPseRan (TRandom *PseRan)
 User may optionally reset random number generator using this method.
 
virtual void ResetRho (TFoamIntegrand *Rho)
 User may optionally reset the distribution using this method.
 
virtual void RootPlot2dim (Char_t *)
 Debugging tool which plots 2-dimensional cells as rectangles in C++ format readable for root.
 
virtual void SaveAs (const char *filename="", Option_t *option="") const
 Save this object in the file specified by filename.
 
virtual void SavePrimitive (std::ostream &out, Option_t *option="")
 Save a primitive as a C++ statement(s) on output stream "out".
 
void SetBit (UInt_t f)
 
void SetBit (UInt_t f, Bool_t set)
 Set or unset the user status bits as specified in f.
 
virtual void SetChat (Int_t Chat)
 
virtual void SetDrawOption (Option_t *option="")
 Set drawing option for object.
 
virtual void SetEvPerBin (Int_t EvPerBin)
 
virtual void SetInhiDiv (Int_t, Int_t)
 This can be called before Initialize, after setting kDim It defines which variables are excluded in the process of the cell division.
 
virtual void SetkDim (Int_t kDim)
 
virtual void SetMaxWtRej (Double_t MaxWtRej)
 
virtual void SetnBin (Int_t nBin)
 
virtual void SetnCells (Long_t nCells)
 
virtual void SetnSampl (Long_t nSampl)
 
virtual void SetOptDrive (Int_t OptDrive)
 
virtual void SetOptRej (Int_t OptRej)
 
virtual void SetPseRan (TRandom *PseRan)
 
virtual void SetRho (TFoamIntegrand *Rho)
 User may use this method to set the distribution object.
 
virtual void SetRhoInt (Double_t(*fun)(Int_t, Double_t *))
 User may use this method to set the distribution object as a global function pointer (and not as an interpreted function).
 
virtual void SetUniqueID (UInt_t uid)
 Set the unique object id.
 
virtual void SetXdivPRD (Int_t, Int_t, Double_t[])
 This should be called before Initialize, after setting kDim It predefines values of the cell division for certain variable iDim.
 
void Streamer (TBuffer &) override
 Stream an object of class TObject.
 
void StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b)
 
virtual void SysError (const char *method, const char *msgfmt,...) const
 Issue system error message.
 
R__ALWAYS_INLINE Bool_t TestBit (UInt_t f) const
 
Int_t TestBits (UInt_t f) const
 
virtual void UseCurrentStyle ()
 Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked.
 
virtual void Varedu (Double_t[5], Int_t &, Double_t &, Double_t &)
 Internal method used by Initialize.
 
virtual void Warning (const char *method, const char *msgfmt,...) const
 Issue warning message.
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0)
 Write this object to the current directory.
 
virtual Int_t Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const
 Write this object to the current directory.
 

Static Public Member Functions

static TClassClass ()
 
static const char * Class_Name ()
 
static constexpr Version_t Class_Version ()
 
static const char * DeclFileName ()
 
static Longptr_t GetDtorOnly ()
 Return destructor only flag.
 
static Bool_t GetObjectStat ()
 Get status of object stat flag.
 
static void SetDtorOnly (void *obj)
 Set destructor only flag.
 
static void SetObjectStat (Bool_t stat)
 Turn on/off tracking of objects in the TObjectTable.
 

Protected Types

enum  { kOnlyPrepStep = (1ULL << ( 3 )) }
 

Protected Member Functions

virtual void DoError (int level, const char *location, const char *fmt, va_list va) const
 Interface to ErrorHandler (protected).
 
void MakeZombie ()
 

Static Protected Member Functions

static void SavePrimitiveConstructor (std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE)
 Save object constructor in the output stream "out".
 
static void SavePrimitiveDraw (std::ostream &out, const char *variable_name, Option_t *option=nullptr)
 Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.
 
static TString SavePrimitiveVector (std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Int_t flag=0)
 Save array in the output stream "out" as vector.
 

Protected Attributes

Double_tfAlpha
 [fDim] Internal parameters of the hyper-rectangle
 
TFoamCell ** fCells = nullptr
 [fNCells] Array of ALL cells
 
std::vector< Long_tfCellsAct
 Index of active cells, constructed at the end of foam build-up.
 
Int_t fChat
 Chat=0,1,2 chat level in output, Chat=1 normal level.
 
TString fDate
 Release date of FOAM.
 
Int_t fDim
 Dimension of the integration/simulation space.
 
Int_t fEvPerBin
 Maximum number of effective (wt=1) events per bin.
 
TObjArrayfHistDbg
 Histograms of wt, for debug.
 
TObjArrayfHistEdg
 Histograms of wt, one for each cell edge.
 
TH1DfHistWt
 Histogram of the MC wt.
 
Int_tfInhiDiv
 ! [fDim] Flags for inhibiting cell division
 
Int_t fLastCe
 Index of the last cell.
 
Int_tfMaskDiv
 ! [fDim] Dynamic Mask for cell division
 
Double_t fMaxWtRej
 Maximum weight in rejection for getting wt=1 events.
 
Double_t fMCerror
 and its error
 
TFoamMaxwtfMCMonit
 Monitor of the MC weight for measuring MC efficiency.
 
Double_t fMCresult
 True Integral R from MC series.
 
Double_tfMCvect
 [fDim] Generated MC vector for the outside user
 
Double_t fMCwt
 MC weight.
 
TMethodCallfMethodCall
 ! ROOT's pointer to user-defined global distribution function
 
TString fName
 Name of a given instance of the FOAM class.
 
Int_t fNBin
 No. of bins in the edge histogram for cell MC exploration.
 
Long_t fNCalls
 Total number of the function calls.
 
Int_t fNCells
 Maximum number of cells.
 
Long_t fNEffev
 Total number of effective events (wt=1) in the foam buildup.
 
Double_t fNevGen
 Total number of the generated MC events.
 
Int_t fNoAct
 Number of active cells.
 
Int_t fNSampl
 No. of MC events, when dividing (exploring) cell.
 
Int_t fOptDrive
 Optimization switch =1,2 for variance or maximum weight optimization.
 
Int_t fOptPRD
 Option switch for predefined division, for quick check.
 
Int_t fOptRej
 Switch =0 for weighted events; =1 for unweighted events in MC.
 
Double_tfPrimAcu
 [fNoAct] Array of cumulative probability of all active cells
 
Double_t fPrime
 Primary integral R' (R=R'<wt>)
 
TRandomfPseRan
 Pointer to user-defined generator of pseudorandom numbers.
 
TFoamIntegrandfRho
 ! Pointer to the user-defined integrand function/distribution
 
Int_t fRNmax
 Maximum No. of the rand. numb. requested at once.
 
Double_tfRvec
 [fRNmax] random number vector from r.n. generator fDim+1 maximum elements
 
Double_t fSumOve
 Total Sum of overweighted events.
 
Double_t fSumWt
 
Double_t fSumWt2
 Total sum of wt and wt^2.
 
TString fVersion
 Actual version of the FOAM like (1.01m)
 
Double_t fWtMax
 
Double_t fWtMin
 Maximum/Minimum MC weight.
 
TFoamVect ** fXdivPRD
 ! Lists of division values encoded in one vector per direction
 

Private Member Functions

TFoamCellgetCell (std::size_t i) const
 
Double_t Sqr (Double_t x) const
 

Static Private Member Functions

static void AddToTObjectTable (TObject *)
 Private helper function which will dispatch to TObjectTable::AddObj.
 

Private Attributes

UInt_t fBits
 bit field status word
 
UInt_t fUniqueID
 object unique identifier
 

Static Private Attributes

static Longptr_t fgDtorOnly = 0
 object for which to call dtor only (i.e. no delete)
 
static Bool_t fgObjectStat = kTRUE
 if true keep track of objects in TObjectTable
 

#include <TFoam.h>

Inheritance diagram for TFoam:
TObject

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
kIsOnHeap 

object is on heap

kNotDeleted 

object has not been deleted

kZombie 

object ctor failed

kInconsistent 

class overload Hash but does call RecursiveRemove in destructor

kBitMask 

Definition at line 89 of file TObject.h.

◆ anonymous enum

anonymous enum
inherited
Enumerator
kSingleKey 

write collection with single key

kOverwrite 

overwrite existing object with same name

kWriteDelete 

write object, then delete previous key with same name

Definition at line 99 of file TObject.h.

◆ anonymous enum

anonymous enum
protectedinherited
Enumerator
kOnlyPrepStep 

Used to request that the class specific implementation of TObject::Write just prepare the objects to be ready to be written but do not actually write them into the TBuffer.

This is just for example by TBufferMerger to request that the TTree inside the file calls TTree::FlushBaskets (outside of the merging lock) and TBufferMerger will later ask for the write (inside the merging lock). To take advantage of this feature the class needs to overload TObject::Write and use this enum value accordingly. (See TTree::Write and TObject::Write) Do not use, this feature will be migrate to the Merge function (See TClass and TTree::Merge)

Definition at line 106 of file TObject.h.

◆ EDeprecatedStatusBits

Enumerator
kObjInCanvas 

for backward compatibility only, use kMustCleanup

Definition at line 84 of file TObject.h.

◆ EStatusBits

Enumerator
kCanDelete 

if object in a list can be deleted

kMustCleanup 

if object destructor must call RecursiveRemove()

kIsReferenced 

if object is referenced by a TRef or TRefArray

kHasUUID 

if object has a TUUID (its fUniqueID=UUIDNumber)

kCannotPick 

if object in a pad cannot be picked

kNoContextMenu 

if object does not want context menu

kInvalidObject 

if object ctor succeeded but object should not be used

Definition at line 70 of file TObject.h.

Constructor & Destructor Documentation

◆ TFoam() [1/3]

TFoam::TFoam ( )

Default constructor for streamer, user should not use it.

Definition at line 144 of file TFoam.cxx.

◆ TFoam() [2/3]

TFoam::TFoam ( const Char_t * Name)

User constructor, to be employed by the user.

Definition at line 165 of file TFoam.cxx.

◆ ~TFoam()

TFoam::~TFoam ( )
override

Default destructor.

Definition at line 227 of file TFoam.cxx.

◆ TFoam() [3/3]

TFoam::TFoam ( const TFoam & From)

Copy Constructor NOT IMPLEMENTED (NEVER USED)

Definition at line 266 of file TFoam.cxx.

Member Function Documentation

◆ AbstractMethod()

void TObject::AbstractMethod ( const char * method) const
inherited

Call this function within a function that you don't want to define as purely virtual, in order not to force all users deriving from that class to implement that maybe (on their side) unused function; but at the same time, emit a run-time warning if they try to call it, telling that it is not implemented in the derived class: action must thus be taken on the user side to override it.

In other word, this method acts as a "runtime purely virtual" warning instead of a "compiler purely virtual" error.

Warning
This interface is a legacy function that is no longer recommended to be used by new development code.
Note
The name "AbstractMethod" does not imply that it's an abstract method in the strict C++ sense.

Definition at line 1149 of file TObject.cxx.

◆ AddToTObjectTable()

void TObject::AddToTObjectTable ( TObject * op)
staticprivateinherited

Private helper function which will dispatch to TObjectTable::AddObj.

Included here to avoid circular dependency between header files.

Definition at line 195 of file TObject.cxx.

◆ AppendPad()

void TObject::AppendPad ( Option_t * option = "")
virtualinherited

Append graphics object to current pad.

In case no current pad is set yet, create a default canvas with the name "c1".

Definition at line 204 of file TObject.cxx.

◆ Browse()

◆ Carver()

void TFoam::Carver ( Int_t & kBest,
Double_t & xBest,
Double_t & yBest )
virtual

Internal method used by Initialize.

Determines the best edge-candidate and the position of the division plane for the future cell division, in the case of the optimization of the maximum weight. It exploits results of the cell MC exploration run stored in fHistEdg.

Definition at line 746 of file TFoam.cxx.

◆ CellFill()

Int_t TFoam::CellFill ( Int_t Status,
TFoamCell * parent )
virtual

Internal method used by Initialize.

It initializes content of the newly allocated active cell.

Definition at line 474 of file TFoam.cxx.

◆ CheckAll()

void TFoam::CheckAll ( Int_t level)
virtual

User utility, miscellaneous and debug.

Checks all pointers in the tree of cells. This is useful auto diagnostic.

  • level=0, no printout, failures causes STOP
  • level=1, printout, failures lead to WARNINGS only

Definition at line 1377 of file TFoam.cxx.

◆ CheckedHash()

ULong_t TObject::CheckedHash ( )
inlineinherited

Check and record whether this class has a consistent Hash/RecursiveRemove setup (*) and then return the regular Hash value for this object.

The intent is for this routine to be called instead of directly calling the function Hash during "insert" operations. See TObject::HasInconsistenTObjectHash();

(*) The setup is consistent when all classes in the class hierarchy that overload TObject::Hash do call ROOT::CallRecursiveRemoveIfNeeded in their destructor. i.e. it is safe to call the Hash virtual function during the RecursiveRemove operation.

Definition at line 332 of file TObject.h.

◆ Class()

static TClass * TFoam::Class ( )
static
Returns
TClass describing this class

◆ Class_Name()

static const char * TFoam::Class_Name ( )
static
Returns
Name of this class

◆ Class_Version()

static constexpr Version_t TFoam::Class_Version ( )
inlinestaticconstexpr
Returns
Version of this class

Definition at line 143 of file TFoam.h.

◆ ClassName()

const char * TObject::ClassName ( ) const
virtualinherited

Returns name of class to which the object belongs.

Definition at line 227 of file TObject.cxx.

◆ Clear()

◆ Clone()

TObject * TObject::Clone ( const char * newname = "") const
virtualinherited

Make a clone of an object using the Streamer facility.

If the object derives from TNamed, this function is called by TNamed::Clone. TNamed::Clone uses the optional argument to set a new name to the newly created object.

If the object class has a DirectoryAutoAdd function, it will be called at the end of the function with the parameter gDirectory. This usually means that the object will be appended to the current ROOT directory.

Reimplemented in TMVA::MinuitWrapper, RooCatType, TImage, RooStudyPackage, RooLinkedList, RooStats::ModelConfig, TNamed, TCollection, TClass, TFunction, TFunctionTemplate, TMethod, TMethodCall, TASImage, TH1, TStreamerInfo, TMinuit, RooAbsStudy, RooDataHist, RooDataSet, RooWorkspace, TChainIndex, TTreeIndex, TF1, RooAbsArg, RooAbsBinning, RooAbsCollection, RooCmdArg, RooFitResult, RooTemplateProxy< T >, RooTemplateProxy< const RooHistFunc >, RooTemplateProxy< RooAbsCategory >, RooTemplateProxy< RooAbsPdf >, RooTemplateProxy< RooAbsReal >, RooTemplateProxy< RooAbsRealLValue >, RooTemplateProxy< RooMultiCategory >, RooTemplateProxy< RooRealVar >, and RooStats::HypoTestResult.

Definition at line 243 of file TObject.cxx.

◆ Compare()

Int_t TObject::Compare ( const TObject * obj) const
virtualinherited

Compare abstract method.

Must be overridden if a class wants to be able to compare itself with other objects. Must return -1 if this is smaller than obj, 0 if objects are equal and 1 if this is larger than obj.

Reimplemented in TEnvRec, TFileInfo, TNamed, TObjString, TParameter< AParamType >, TParameter< Long64_t >, TUrl, TCollection, TGeoBranchArray, TGeoOverlap, TStructNode, TStructNodeProperty, TGFSFrameElement, TGLBFrameElement, RooAbsArg, and RooDouble.

Definition at line 258 of file TObject.cxx.

◆ Copy()

◆ DeclFileName()

static const char * TFoam::DeclFileName ( )
inlinestatic
Returns
Name of the file containing the class declaration

Definition at line 143 of file TFoam.h.

◆ Delete()

void TObject::Delete ( Option_t * option = "")
virtualinherited

◆ DistancetoPrimitive()

◆ Divide()

Int_t TFoam::Divide ( TFoamCell * cell)
virtual

Internal method used by Initialize.

It divides cell iCell into two daughter cells. The iCell is retained and tagged as inactive, daughter cells are appended at the end of the buffer. New vertex is added to list of vertices. List of active cells is updated, iCell removed, two daughters added and their properties set with help of MC sampling (TFoam_Explore) Returns Code RC=-1 of buffer limit is reached, fLastCe=fnBuf.

Definition at line 929 of file TFoam.cxx.

◆ DoError()

void TObject::DoError ( int level,
const char * location,
const char * fmt,
va_list va ) const
protectedvirtualinherited

Interface to ErrorHandler (protected).

Reimplemented in TTreeViewer, and TThread.

Definition at line 1059 of file TObject.cxx.

◆ Draw()

◆ DrawClass()

void TObject::DrawClass ( ) const
virtualinherited

Draw class inheritance tree of the class to which this object belongs.

If a class B inherits from a class A, description of B is drawn on the right side of description of A. Member functions overridden by B are shown in class A with a blue line crossing-out the corresponding member function. The following picture is the class inheritance tree of class TPaveLabel:

Reimplemented in TSystemDirectory, TSystemFile, and TGFrame.

Definition at line 308 of file TObject.cxx.

◆ DrawClone()

TObject * TObject::DrawClone ( Option_t * option = "") const
virtualinherited

Draw a clone of this object in the current selected pad with: gROOT->SetSelectedPad(c1).

If pad was not selected - gPad will be used.

Note
For histograms, use the more specialised TH1::DrawCopy().

Reimplemented in TSystemDirectory, TSystemFile, TGFrame, TAxis, and TCanvas.

Definition at line 319 of file TObject.cxx.

◆ Dump()

void TObject::Dump ( ) const
virtualinherited

Dump contents of object on stdout.

Using the information in the object dictionary (class TClass) each data member is interpreted. If a data member is a pointer, the pointer value is printed

The following output is the Dump of a TArrow object:

fAngle 0 Arrow opening angle (degrees)
fArrowSize 0.2 Arrow Size
fOption.*fData
fX1 0.1 X of 1st point
fY1 0.15 Y of 1st point
fX2 0.67 X of 2nd point
fY2 0.83 Y of 2nd point
fBits 50331648 bit field status word
fLineColor 1 line color
fLineStyle 1 line style
fLineWidth 1 line width
fFillColor 19 fill area color
fFillStyle 1001 fill area style
#define X(type, name)
Option_t Option_t TPoint TPoint angle
Option_t Option_t width
Option_t Option_t style
UInt_t fUniqueID
object unique identifier
Definition TObject.h:46
UInt_t fBits
bit field status word
Definition TObject.h:47
TLine * line

Reimplemented in TSystemFile, TCollection, TClass, TGFrame, and TGPack.

Definition at line 367 of file TObject.cxx.

◆ Error()

void TObject::Error ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue error message.

Use "location" to specify the method where the error occurred. Accepts standard printf formatting arguments.

Reimplemented in TFitResult.

Definition at line 1098 of file TObject.cxx.

◆ Eval()

Double_t TFoam::Eval ( Double_t * xRand)
virtual

Internal method.

Evaluates distribution to be generated.

Definition at line 1059 of file TFoam.cxx.

◆ Execute() [1/2]

void TObject::Execute ( const char * method,
const char * params,
Int_t * error = nullptr )
virtualinherited

Execute method on this object with the given parameter string, e.g.

"3.14,1,\"text\"".

Reimplemented in TMethodCall, TCling, TInterpreter, ROOT::R::TRInterface, and TContextMenu.

Definition at line 378 of file TObject.cxx.

◆ Execute() [2/2]

void TObject::Execute ( TMethod * method,
TObjArray * params,
Int_t * error = nullptr )
virtualinherited

Execute method on this object with parameters stored in the TObjArray.

The TObjArray should contain an argv vector like:

argv[0] ... argv[n] = the list of TObjString parameters
Collectable string class.
Definition TObjString.h:28
const Int_t n
Definition legend1.C:16

Reimplemented in TCling, TMethodCall, TInterpreter, ROOT::R::TRInterface, and TContextMenu.

Definition at line 398 of file TObject.cxx.

◆ ExecuteEvent()

◆ Explore()

void TFoam::Explore ( TFoamCell * cell)
virtual

Internal method used by Initialize.

It explores newly defined cell with help of special short MC sampling. As a result, estimates of true and drive volume is defined/determined Average and dispersion of the weight distribution will is found along each edge and the best edge (minimum dispersion, best maximum weight) is memorized for future use.

The optimal division point for eventual future cell division is determined/recorded. Recorded are also minimum and maximum weight etc. The volume estimate in all (inactive) parent cells is updated. Note that links to parents and initial volume = 1/2 parent has to be already defined prior to calling this routine.

Definition at line 517 of file TFoam.cxx.

◆ Fatal()

void TObject::Fatal ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue fatal error message.

Use "location" to specify the method where the fatal error occurred. Accepts standard printf formatting arguments.

Definition at line 1126 of file TObject.cxx.

◆ Finalize()

void TFoam::Finalize ( Double_t & IntNorm,
Double_t & Errel )
virtual

May be called optionally by the user after the MC run.

It provides normalization and also prints some information/statistics on the MC run.

Definition at line 1255 of file TFoam.cxx.

◆ FindObject() [1/2]

TObject * TObject::FindObject ( const char * name) const
virtualinherited

Must be redefined in derived classes.

This function is typically used with TCollections, but can also be used to find an object by name inside this object.

Reimplemented in TListOfEnums, TMap, TDirectory, TFolder, TROOT, TListOfTypes, TListOfTypes, TBtree, TCollection, THashList, THashTable, TList, TObjArray, TListOfDataMembers, TListOfDataMembers, TListOfEnums, TListOfEnumsWithLock, TListOfFunctions, TListOfFunctionTemplates, TListOfFunctionTemplates, TViewPubDataMembers, TViewPubFunctions, TPad, TGeometry, THbookFile, TGraph, TGraph2D, TH1, RooAbsCollection, and RooLinkedList.

Definition at line 425 of file TObject.cxx.

◆ FindObject() [2/2]

TObject * TObject::FindObject ( const TObject * obj) const
virtualinherited

Must be redefined in derived classes.

This function is typically used with TCollections, but can also be used to find an object inside this object.

Reimplemented in TMap, TDirectory, TFolder, TROOT, TListOfTypes, TBtree, TCollection, THashList, THashTable, TList, TObjArray, TListOfDataMembers, TListOfEnums, TListOfEnumsWithLock, TListOfFunctions, TListOfFunctionTemplates, TViewPubDataMembers, TViewPubFunctions, TPad, TGeometry, THbookFile, TGraph, TGraph2D, TH1, RooAbsCollection, and RooLinkedList.

Definition at line 435 of file TObject.cxx.

◆ GenerCel2()

void TFoam::GenerCel2 ( TFoamCell *& pCell)
virtual

Internal method.

Return randomly chosen active cell with probability equal to its contribution into total driver integral using interpolation search.

Definition at line 1081 of file TFoam.cxx.

◆ getCell()

TFoamCell * TFoam::getCell ( std::size_t i) const
private

Definition at line 1524 of file TFoam.cxx.

◆ GetDrawOption()

Option_t * TObject::GetDrawOption ( ) const
virtualinherited

Get option used by the graphics system to draw this object.

Note that before calling object.GetDrawOption(), you must have called object.Draw(..) before in the current pad.

Reimplemented in TBrowser, TFitEditor, TGedFrame, TGFileBrowser, TRootBrowser, and TRootBrowserLite.

Definition at line 445 of file TObject.cxx.

◆ GetDtorOnly()

Longptr_t TObject::GetDtorOnly ( )
staticinherited

Return destructor only flag.

Definition at line 1196 of file TObject.cxx.

◆ GetIconName()

const char * TObject::GetIconName ( ) const
virtualinherited

Returns mime type name of object.

Used by the TBrowser (via TGMimeTypes class). Override for class of which you would like to have different icons for objects of the same class.

Reimplemented in TSystemFile, TGeoVolume, TASImage, TGMainFrame, TKey, ROOT::Experimental::XRooFit::xRooNode, TBranch, TVirtualBranchBrowsable, TMethodBrowsable, and TBranchElement.

Definition at line 472 of file TObject.cxx.

◆ GetIntegMC()

void TFoam::GetIntegMC ( Double_t & mcResult,
Double_t & mcError )
virtual

User method.

It provides the value of the integral calculated from the averages of the MC run May be called after (or during) the MC run.

Definition at line 1204 of file TFoam.cxx.

◆ GetIntNorm()

void TFoam::GetIntNorm ( Double_t & IntNorm,
Double_t & ErrInt )
virtual

User method.

It returns NORMALIZATION integral to be combined with the average weights and content of the histograms in order to get proper absolute normalization of the integrand and distributions. It can be called after initialization, before or during the MC run.

Parameters
IntNormvariable where the integral will be stored
ErrIntvariable where the absolute error of the integral will be stored if internal rejection is active, otherwise set to 0.

Definition at line 1225 of file TFoam.cxx.

◆ GetMCvect()

void TFoam::GetMCvect ( Double_t * MCvect)
virtual

User may get generated MC point/vector with help of this method.

Definition at line 1169 of file TFoam.cxx.

◆ GetMCwt() [1/2]

Double_t TFoam::GetMCwt ( void )
virtual

User may get weight MC weight using this method.

Definition at line 1177 of file TFoam.cxx.

◆ GetMCwt() [2/2]

void TFoam::GetMCwt ( Double_t & mcwt)
virtual

User may get weight MC weight using this method.

Definition at line 1184 of file TFoam.cxx.

◆ GetName()

◆ GetnCalls()

virtual Long_t TFoam::GetnCalls ( ) const
inlinevirtual

Definition at line 131 of file TFoam.h.

◆ GetnEffev()

virtual Long_t TFoam::GetnEffev ( ) const
inlinevirtual

Definition at line 132 of file TFoam.h.

◆ GetObjectInfo()

char * TObject::GetObjectInfo ( Int_t px,
Int_t py ) const
virtualinherited

Returns string containing info about the object at position (px,py).

This method is typically overridden by classes of which the objects can report peculiarities for different positions. Returned string will be re-used (lock in MT environment).

Reimplemented in TGeoNode, TGeoVolume, TGeoTrack, TASImage, TColorWheel, TAxis3D, TNode, TGL5DDataSet, TGLHistPainter, TGLParametricEquation, TGLTH3Composition, TF1, TF2, TGraph, TH1, THistPainter, TPaletteAxis, TFileDrawMap, TParallelCoordVar, and TVirtualHistPainter.

Definition at line 491 of file TObject.cxx.

◆ GetObjectStat()

Bool_t TObject::GetObjectStat ( )
staticinherited

Get status of object stat flag.

Definition at line 1181 of file TObject.cxx.

◆ GetOption()

virtual Option_t * TObject::GetOption ( ) const
inlinevirtualinherited

◆ GetPrimary() [1/2]

virtual Double_t TFoam::GetPrimary ( ) const
inlinevirtual

Definition at line 129 of file TFoam.h.

◆ GetPrimary() [2/2]

virtual void TFoam::GetPrimary ( Double_t & prime)
inlinevirtual

Definition at line 130 of file TFoam.h.

◆ GetPseRan()

virtual TRandom * TFoam::GetPseRan ( ) const
inlinevirtual

Definition at line 108 of file TFoam.h.

◆ GetRho()

virtual TFoamIntegrand * TFoam::GetRho ( )
inlinevirtual

Definition at line 107 of file TFoam.h.

◆ GetTitle()

const char * TObject::GetTitle ( ) const
virtualinherited

Returns title of object.

This default method returns the class title (i.e. description). Classes that give objects a title should override this method.

Reimplemented in TNamed, TQCommand, TPair, TClassMenuItem, TBaseClass, TASImage, TPad, TGaxis, TPaveLabel, TEveGeoNode, TEvePointSet, TGTextButton, TGGroupFrame, TGLabel, TGTextLBEntry, TGLVEntry, TGTextEntry, TRootIconList, TAxis, TKey, TMapFile, TParticle, TPrimary, Axis2, TParallelCoordSelect, and TVirtualPad.

Definition at line 507 of file TObject.cxx.

◆ GetTotDim()

virtual Int_t TFoam::GetTotDim ( ) const
inlinevirtual

Definition at line 128 of file TFoam.h.

◆ GetUniqueID()

UInt_t TObject::GetUniqueID ( ) const
virtualinherited

Return the unique object id.

Definition at line 480 of file TObject.cxx.

◆ GetVersion()

virtual const char * TFoam::GetVersion ( ) const
inlinevirtual

Definition at line 127 of file TFoam.h.

◆ GetWtParams()

void TFoam::GetWtParams ( Double_t eps,
Double_t & aveWt,
Double_t & wtMax,
Double_t & sigma )
virtual

May be called optionally after the MC run.

Returns various parameters of the MC weight for efficiency evaluation

Definition at line 1242 of file TFoam.cxx.

◆ Grow()

void TFoam::Grow ( )
virtual

Internal method used by Initialize.

It grow new cells by the binary division process.

Definition at line 857 of file TFoam.cxx.

◆ HandleTimer()

Bool_t TObject::HandleTimer ( TTimer * timer)
virtualinherited

Execute action in response of a timer timing out.

This method must be overridden if an object has to react to timers.

Reimplemented in TGWindow, TGuiBldDragManager, TGraphTime, TGLEventHandler, TGCommandPlugin, TGDNDManager, TGFileContainer, TGPopupMenu, TGScrollBar, TGShutter, TGTextEdit, TGTextEditor, TGTextEntry, TGTextView, TGToolTip, TGHtml, and TTreeViewer.

Definition at line 516 of file TObject.cxx.

◆ Hash()

ULong_t TObject::Hash ( ) const
virtualinherited

Return hash value for this object.

Note: If this routine is overloaded in a derived class, this derived class should also add

void CallRecursiveRemoveIfNeeded(TObject &obj)
call RecursiveRemove for obj if gROOT is valid and obj.TestBit(kMustCleanup) is true.
Definition TROOT.h:406

Otherwise, when RecursiveRemove is called (by ~TObject or example) for this type of object, the transversal of THashList and THashTable containers will will have to be done without call Hash (and hence be linear rather than logarithmic complexity). You will also see warnings like

Mother of all ROOT objects.
Definition TObject.h:42
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Definition TObject.cxx:1098
virtual ULong_t Hash() const
Return hash value for this object.
Definition TObject.cxx:539
void RecursiveRemove(TObject *obj) override
Recursively remove this object from the list of Cleanups.
Definition TROOT.cxx:2651

Reimplemented in TEnvRec, TNamed, TObjString, TParameter< AParamType >, TParameter< Long64_t >, TCollection, TPair, TASImagePlugin, TASPluginGS, TPad, TImagePlugin, TPave, TGObject, TGPicture, TIconBoxThumb, TStatistic, and RooLinkedList.

Definition at line 539 of file TObject.cxx.

◆ HasInconsistentHash()

Bool_t TObject::HasInconsistentHash ( ) const
inlineinherited

Return true is the type of this object is known to have an inconsistent setup for Hash and RecursiveRemove (i.e.

missing call to RecursiveRemove in destructor).

Note: Since the consistency is only tested for during inserts, this routine will return true for object that have never been inserted whether or not they have a consistent setup. This has no negative side-effect as searching for the object with the right or wrong Hash will always yield a not-found answer (Since anyway no hash can be guaranteed unique, there is always a check)

Definition at line 366 of file TObject.h.

◆ Info()

void TObject::Info ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue info message.

Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.

Definition at line 1072 of file TObject.cxx.

◆ InheritsFrom() [1/2]

Bool_t TObject::InheritsFrom ( const char * classname) const
virtualinherited

Returns kTRUE if object inherits from class "classname".

Reimplemented in TClass.

Definition at line 549 of file TObject.cxx.

◆ InheritsFrom() [2/2]

Bool_t TObject::InheritsFrom ( const TClass * cl) const
virtualinherited

Returns kTRUE if object inherits from TClass cl.

Reimplemented in TClass.

Definition at line 557 of file TObject.cxx.

◆ InitCells()

void TFoam::InitCells ( )
virtual

Internal method used by Initialize.

It initializes "root part" of the FOAM of the tree of cells.

Definition at line 442 of file TFoam.cxx.

◆ Initialize() [1/2]

void TFoam::Initialize ( )
virtual

Basic initialization of FOAM invoked by the user.

IMPORTANT: Random number generator and the distribution object has to be provided using SetPseRan and SetRho prior to invoking this initialiser!

Definition at line 320 of file TFoam.cxx.

◆ Initialize() [2/2]

void TFoam::Initialize ( TRandom * PseRan,
TFoamIntegrand * fun )
virtual

Basic initialization of FOAM invoked by the user. Mandatory!

This method starts the process of the cell build-up. User must invoke Initialize with two arguments or Initialize without arguments. This is done BEFORE generating first MC event and AFTER allocating FOAM object and resetting (optionally) its internal parameters/switches. The overall operational scheme of the FOAM is the following:

This method invokes several other methods:

InitCells initializes memory storage for cells and begins exploration process from the root cell. The empty cells are allocated/filled using CellFill. The procedure Grow which loops over cells, picks up the cell with the biggest `‘driver integral’', see Computer Physics Communications 152 152 (2003) 55 for explanations, with the help of PeekMax procedure. The chosen cell is split using Divide. Subsequently, the procedure Explore called by the Divide (and by InitCells for the root cell) does the most important job in the FOAM object build-up: it performs a small MC run for each newly allocated daughter cell. Explore calculates how profitable the future split of the cell will be and defines the optimal cell division geometry with the help of Carver or Varedu procedures, for maximum weight or variance optimization respectively. All essential results of the exploration are written into the explored cell object. At the very end of the foam build-up, Finally, MakeActiveList is invoked to create a list of pointers to all active cells, for the purpose of the quick access during the MC generation. The procedure Explore employs MakeAlpha to generate random coordinates inside a given cell with the uniform distribution. The above sequence of the procedure calls is depicted in the following figure:

Definition at line 306 of file TFoam.cxx.

◆ Inspect()

void TObject::Inspect ( ) const
virtualinherited

Dump contents of this object in a graphics canvas.

Same action as Dump but in a graphical form. In addition pointers to other objects can be followed.

The following picture is the Inspect of a histogram object:

Reimplemented in TSystemFile, TInspectorObject, TGFrame, and ROOT::Experimental::XRooFit::xRooNode.

Definition at line 570 of file TObject.cxx.

◆ InvertBit()

void TObject::InvertBit ( UInt_t f)
inlineinherited

Definition at line 206 of file TObject.h.

◆ IsA()

TClass * TFoam::IsA ( ) const
inlineoverridevirtual
Returns
TClass describing current object

Reimplemented from TObject.

Definition at line 143 of file TFoam.h.

◆ IsDestructed()

Bool_t TObject::IsDestructed ( ) const
inlineinherited

IsDestructed.

Note
This function must be non-virtual as it can be used on destructed (but not yet modified) memory. This is used for example in TClonesArray to record the element that have been destructed but not deleted and thus are ready for re-use (by operator new with placement).
Returns
true if this object's destructor has been run.

Definition at line 186 of file TObject.h.

◆ IsEqual()

Bool_t TObject::IsEqual ( const TObject * obj) const
virtualinherited

Default equal comparison (objects are equal if they have the same address in memory).

More complicated classes might want to override this function.

Reimplemented in TObjString, TQCommand, TPair, and TGObject.

Definition at line 589 of file TObject.cxx.

◆ IsFolder()

◆ IsOnHeap()

R__ALWAYS_INLINE Bool_t TObject::IsOnHeap ( ) const
inlineinherited

Definition at line 160 of file TObject.h.

◆ IsSortable()

◆ IsZombie()

R__ALWAYS_INLINE Bool_t TObject::IsZombie ( ) const
inlineinherited

Definition at line 161 of file TObject.h.

◆ LinkCells()

void TFoam::LinkCells ( void )
virtual

Definition at line 1516 of file TFoam.cxx.

◆ ls()

◆ MakeActiveList()

void TFoam::MakeActiveList ( )
virtual

Internal method used by Initialize.

It finds out number of active cells fNoAct, creates list of active cell fCellsAct and primary cumulative fPrimAcu. They are used during the MC generation to choose randomly an active cell.

Definition at line 962 of file TFoam.cxx.

◆ MakeAlpha()

void TFoam::MakeAlpha ( )
virtual

Internal method used by Initialize.

Provides random vector Alpha 0< Alpha(i) < 1

Definition at line 842 of file TFoam.cxx.

◆ MakeEvent()

void TFoam::MakeEvent ( void )
virtual

User method.

It generates randomly point/vector according to user-defined distribution. Prior initialization with help of Initialize() is mandatory. Generated MC point/vector is available using GetMCvect and the MC weight with GetMCwt. MC point is generated with wt=1 or with variable weight, see OptRej switch.

Definition at line 1119 of file TFoam.cxx.

◆ MakeZombie()

void TObject::MakeZombie ( )
inlineprotectedinherited

Definition at line 55 of file TObject.h.

◆ MayNotUse()

void TObject::MayNotUse ( const char * method) const
inherited

Use this method to signal that a method (defined in a base class) may not be called in a derived class (in principle against good design since a child class should not provide less functionality than its parent, however, sometimes it is necessary).

Definition at line 1160 of file TObject.cxx.

◆ MCgenerate()

Double_t TFoam::MCgenerate ( Double_t * MCvect)
virtual

User method which generates MC event and returns MC weight.

Definition at line 1192 of file TFoam.cxx.

◆ Notify()

Bool_t TObject::Notify ( )
virtualinherited

This method must be overridden to handle object notification (the base implementation is no-op).

Different objects in ROOT use the Notify method for different purposes, in coordination with other objects that call this method at the appropriate time.

For example, TLeaf uses it to load class information; TBranchRef to load contents of referenced branches TBranchRef; most notably, based on Notify, TChain implements a callback mechanism to inform interested parties when it switches to a new sub-tree.

Reimplemented in TMessageHandler, TNotifyLink< Type >, TNotifyLink< RNoCleanupNotifierHelper >, TNotifyLink< ROOT::Detail::TBranchProxy >, TNotifyLink< TTreeReader >, TFileHandler, TSignalHandler, TStdExceptionHandler, TProcessEventTimer, TTimer, TIdleTimer, TSingleShotCleaner, TCollection, TRefTable, TBrowserTimer, TInterruptHandler, TTermInputHandler, TThreadTimer, TGLRedrawTimer, TViewTimer, TGContainerKeyboardTimer, TGContainerScrollTimer, TGInputHandler, TViewUpdateTimer, TPopupDelayTimer, TRepeatTimer, TSBRepeatTimer, TGTextEditHist, TInsCharCom, TDelCharCom, TBreakLineCom, TInsTextCom, TDelTextCom, TBlinkTimer, TTipDelayTimer, TGuiBldDragManagerRepeatTimer, TARInterruptHandler, TASLogHandler, TASInterruptHandler, TASSigPipeHandler, TASInputHandler, TSocketHandler, TTimeOutTimer, TBranchElement, TBranchRef, TLeafObject, TSelector, TTree, TSelectorDraw, TSelectorEntries, TTreeFormula, TTreeFormulaManager, TTreeReader, h1analysis, h1analysisTreeReader, and TSysEvtHandler.

Definition at line 618 of file TObject.cxx.

◆ Obsolete()

void TObject::Obsolete ( const char * method,
const char * asOfVers,
const char * removedFromVers ) const
inherited

Use this method to declare a method obsolete.

Specify as of which version the method is obsolete and as from which version it will be removed.

Definition at line 1169 of file TObject.cxx.

◆ operator delete() [1/3]

void TObject::operator delete ( void * ptr,
size_t size )
inherited

Operator delete for sized deallocation.

Definition at line 1234 of file TObject.cxx.

◆ operator delete() [2/3]

void TObject::operator delete ( void * ptr)
inherited

Operator delete.

Definition at line 1212 of file TObject.cxx.

◆ operator delete() [3/3]

void TObject::operator delete ( void * ptr,
void * vp )
inherited

Only called by placement new when throwing an exception.

Definition at line 1266 of file TObject.cxx.

◆ operator delete[]() [1/3]

void TObject::operator delete[] ( void * ptr,
size_t size )
inherited

Operator delete [] for sized deallocation.

Definition at line 1245 of file TObject.cxx.

◆ operator delete[]() [2/3]

void TObject::operator delete[] ( void * ptr)
inherited

Operator delete [].

Definition at line 1223 of file TObject.cxx.

◆ operator delete[]() [3/3]

void TObject::operator delete[] ( void * ptr,
void * vp )
inherited

Only called by placement new[] when throwing an exception.

Definition at line 1274 of file TObject.cxx.

◆ operator new() [1/2]

void * TObject::operator new ( size_t sz)
inlineinherited

Definition at line 189 of file TObject.h.

◆ operator new() [2/2]

void * TObject::operator new ( size_t sz,
void * vp )
inlineinherited

Definition at line 191 of file TObject.h.

◆ operator new[]() [1/2]

void * TObject::operator new[] ( size_t sz)
inlineinherited

Definition at line 190 of file TObject.h.

◆ operator new[]() [2/2]

void * TObject::operator new[] ( size_t sz,
void * vp )
inlineinherited

Definition at line 192 of file TObject.h.

◆ Paint()

void TObject::Paint ( Option_t * option = "")
virtualinherited

This method must be overridden if a class wants to paint itself.

The difference between Paint() and Draw() is that when a object draws itself it is added to the display list of the pad in which it is drawn (and automatically redrawn whenever the pad is redrawn). While paint just draws the object without adding it to the pad display list.

Reimplemented in TPie, TSQLFile, TXMLFile, ROOT::RGeoPainter, TGaxis, TGraph, TGraphTime, THStack, TMultiGraph, TScatter, TScatter2D, TTreePerfStats, ROOT::Experimental::RTreeMapPainter, TEfficiency, TRatioPlot, TGeoBoolNode, TGeoUnion, TGeoIntersection, TGeoSubtraction, TMarker3DBox, TGL5DDataSet, TGLHistPainter, TGLParametricEquation, TGLTH3Composition, TGraph2DPainter, TSpectrum2Painter, TFileDrawMap, TDirectory, TExec, TMacro, TStyle, TBits, TCollection, TGeoNode, TGeoPhysicalNode, TGeoShape, TGeoVolume, TGeoOverlap, TGeoPainter, TGeoTrack, TGeoVGShape, TASImage, TASPaletteEditor::PaintPalette, TASPaletteEditor::LimitLine, TAnnotation, TButton, TCanvas, TClassTree, TColorWheel, TPad, TArrow, TBox, TCrown, TDiamond, TEllipse, TFrame, TLatex, TLegend, TLine, TMarker, TMathText, TPave, TPaveLabel, TPaveStats, TPavesText, TPaveText, TPolyLine, TText, TWbox, TGraphEdge, TGraphNode, TEveArrow, TEveCaloViz, TEveDigitSet, TEveGeoTopNode, TEveGeoShape, TEvePlot3D, TEvePointSet, TEveProjectionAxes, TEveScene, TEveShape, TEveStraightLineSet, TEveText, TEveTriangleSet, TAxis3D, TNode, TNodeDiv, TPolyLine3D, TPolyMarker3D, TShape, TF1, TF2, TF3, TGraph2D, TH1, TPolyMarker, TSpline, THistPainter, TPaletteAxis, TFile, TGenerator, TParticle, TPrimary, TParallelCoordVar, TVirtualPad, TVirtualGeoPainter, TVirtualGeoTrack, TVirtualHistPainter, TParallelCoordRange, TSpider, TGraphPolargram, and TParallelCoord.

Definition at line 631 of file TObject.cxx.

◆ PeekMax()

Long_t TFoam::PeekMax ( )
virtual

Internal method used by Initialize.

It finds cell with maximal driver integral for the purpose of the division.

Definition at line 895 of file TFoam.cxx.

◆ Pop()

void TObject::Pop ( )
virtualinherited

Pop on object drawn in a pad to the top of the display list.

I.e. it will be drawn last and on top of all other primitives.

Reimplemented in TPad, TFrame, and TVirtualPad.

Definition at line 640 of file TObject.cxx.

◆ Print()

void TObject::Print ( Option_t * option = "") const
virtualinherited

This method must be overridden when a class wants to print itself.

Reimplemented in RooCmdArg, TPad, TVirtualPad, RooLinkedList, TObjString, TParameter< AParamType >, TParameter< Long64_t >, TRootBrowserHistoryCursor, TRolke, TSQLFile, TXMLFile, TGTextEdit, TStreamerInfoActions::TActionSequence, TStatistic, TMVA::TNeuron, TBranchSTL, TGraph, TGraph2D, TGraph2DAsymmErrors, TGraph2DErrors, TGraphAsymmErrors, TGraphBentErrors, TGraphErrors, TGraphMultiErrors, THStack, TMultiGraph, TScatter, TScatter2D, TBenchmark, TMatrixTBase< Element >, TMatrixTBase< AReal >, TMatrixTBase< Double_t >, TGeoDecayChannel, TPluginHandler, TPluginManager, TQSlot, TDecompBase, TDecompBK, TDecompChol, TDecompLU, TDecompQRH, TDecompSparse, TDecompSVD, TQpDataDens, TQpDataSparse, TDatabasePDG, TParticleClassPDG, TParticlePDG, ROOT::Experimental::XRooFit::xRooNLLVar::xRooHypoPoint, ROOT::Experimental::XRooFit::xRooNLLVar::xRooHypoSpace, ROOT::Experimental::XRooFit::xRooNode, TPrincipal, TFoamCell, TFoamVect, TMVA::PDEFoamCell, TMVA::PDEFoamVect, TMVA::Event, TMVA::OptionBase, TMVA::Option< T >, TCling, TColor, TDirectory, TEnv, TFileCollection, TInetAddress, TMacro, TMessageHandler, TNamed, TStopwatch, TUri, TUrl, TBits, TClassTable, TCollection, THashTable, TObjectTable, TFunction, TGDMLMatrix, TGeoBranchArray, TGeoElement, TGeoIsotope, TGeoElementRN, TGeoBatemanSol, TGeoElementTable, TGeoMatrix, TGeoOpticalSurface, TGeoSkinSurface, TGeoBorderSurface, TGeoPhysicalNode, TGeoRegion, TGeoTessellated, TGeoVolume, TGeoVoxelFinder, TGeoOverlap, TGeoTrack, TAnnotation, TBox, TEllipse, TLegend, TLegendEntry, TLine, TMarker, TPave, TPaveText, TPolyLine, TText, TEveTrans, ROOT::Experimental::REveTrans, THelix, TPolyLine3D, TPolyMarker3D, TXTRU, TGFont, TGFontPool, TGFrame, TGCompositeFrame, TGGC, TGGCPool, TGLayoutHints, TGFrameElement, TGMimeTypes, TGPicture, TGPicturePool, TGWindow, THbookTree, TF1, TFitResult, TFormula, TH1, THnBase, TPolyMarker, ROOT::v5::TFormula, TSpectrum, TSpectrum2, TSpectrum3, TFile, TFileCacheRead, TFileCacheWrite, TKey, TMapFile, TMemFile, TZIPFile, TZIPMember, TSQLStructure, TVectorT< Element >, TVectorT< Double_t >, TLorentzVector, TQuaternion, TVector2, TVector3, TQpVar, TAttParticle, TParticle, TPrimary, TApplicationRemote, TSQLColumnInfo, TSQLTableInfo, RooStats::ModelConfig, TBranch, TBranchClones, TBranchElement, TBranchObject, TBranchRef, TChain, TEventList, TTree, TTreeCache, TTreeCacheUnzip, TTreeIndex, TTreePerfStats, TParallelCoordVar, TMultiDimFit, TParallelCoordRange, TFileInfo, TFileInfoMeta, Roo1DTable, RooAbsArg, RooAbsBinning, RooAbsCollection, RooAbsData, RooAbsDataStore, RooAbsGenContext, RooCurve, RooEllipse, RooCatType, RooFitResult, RooGenFitStudy, RooHist, RooMsgService, RooNumGenConfig, RooNumIntConfig, RooPlot, RooSharedProperties, and RooWorkspace.

Definition at line 661 of file TObject.cxx.

◆ PrintCells()

void TFoam::PrintCells ( void )
virtual

Prints geometry of ALL cells of the FOAM.

Definition at line 1445 of file TFoam.cxx.

◆ Read()

Int_t TObject::Read ( const char * name)
virtualinherited

Read contents of object with specified name from the current directory.

First the key with the given name is searched in the current directory, next the key buffer is deserialized into the object. The object must have been created before via the default constructor. See TObject::Write().

Reimplemented in TKeyXML, TBuffer, TKey, and TKeySQL.

Definition at line 673 of file TObject.cxx.

◆ RecursiveRemove()

◆ ResetBit()

void TObject::ResetBit ( UInt_t f)
inlineinherited

Definition at line 203 of file TObject.h.

◆ ResetPseRan()

void TFoam::ResetPseRan ( TRandom * PseRan)
virtual

User may optionally reset random number generator using this method.

Usually it is done when FOAM object is restored from the disk. IMPORTANT: this method deletes existing random number generator registered in the FOAM object. In particular such an object is created by the streamer during the disk-read operation.

Definition at line 1003 of file TFoam.cxx.

◆ ResetRho()

void TFoam::ResetRho ( TFoamIntegrand * fun)
virtual

User may optionally reset the distribution using this method.

Usually it is done when FOAM object is restored from the disk. IMPORTANT: this method deletes existing distribution object registered in the FOAM object. In particular such an object is created by the streamer diring the disk-read operation. This method is used only in very special cases, because the distribution in most cases should be "owned" by the FOAM object and should not be replaced by another one after initialization.

Definition at line 1046 of file TFoam.cxx.

◆ RootPlot2dim()

void TFoam::RootPlot2dim ( Char_t * filename)
virtual

Debugging tool which plots 2-dimensional cells as rectangles in C++ format readable for root.

Definition at line 1462 of file TFoam.cxx.

◆ SaveAs()

void TObject::SaveAs ( const char * filename = "",
Option_t * option = "" ) const
virtualinherited

Save this object in the file specified by filename.

  • if "filename" contains ".root" the object is saved in filename as root binary file.
  • if "filename" contains ".xml" the object is saved in filename as a xml ascii file.
  • if "filename" contains ".cc" the object is saved in filename as C code independent from ROOT. The code is generated via SavePrimitive(). Specific code should be implemented in each object to handle this option. Like in TF1::SavePrimitive().
  • otherwise the object is written to filename as a CINT/C++ script. The C++ code to rebuild this object is generated via SavePrimitive(). The "option" parameter is passed to SavePrimitive. By default it is an empty string. It can be used to specify the Draw option in the code generated by SavePrimitive.

    The function is available via the object context menu.

Reimplemented in TSpline, TFolder, TGeoVolume, TClassTree, TPad, TPaveClass, TGObject, TSpline3, TSpline5, ROOT::Experimental::XRooFit::xRooNode, TTreePerfStats, TVirtualPad, TGraph, and TH1.

Definition at line 708 of file TObject.cxx.

◆ SavePrimitive()

void TObject::SavePrimitive ( std::ostream & out,
Option_t * option = "" )
virtualinherited

Save a primitive as a C++ statement(s) on output stream "out".

Reimplemented in TGeoTessellated, TGraphEdge, TGraphNode, TGeoIdentity, TStyle, TCurlyArc, TCurlyLine, TGedMarkerSelect, TGedPatternSelect, TGColorSelect, TGFont, TGVerticalLayout, TGHorizontalLayout, TGRowLayout, TGColumnLayout, TGMatrixLayout, TGTileLayout, TGListLayout, TGListDetailsLayout, TGTextLBEntry, TGNumberEntryField, TGNumberEntry, TGTableLayoutHints, TGTableLayout, TGTextEdit, TGTextView, TGXYLayoutHints, TGXYLayout, TRootContainer, TGHtml, TEfficiency, TExec, TMacro, TGeoArb8, TGeoTrap, TGeoGtra, TGeoBBox, TGeoBoolNode, TGeoUnion, TGeoIntersection, TGeoSubtraction, TGeoCompositeShape, TGeoCone, TGeoConeSeg, TGeoElementRN, TGeoDecayChannel, TGeoEltu, TGeoHalfSpace, TGeoHype, TGeoMaterial, TGeoMixture, TGeoTranslation, TGeoRotation, TGeoCombiTrans, TGeoHMatrix, TGeoMedium, TGeoPara, TGeoParaboloid, TGeoPatternX, TGeoPatternY, TGeoPatternZ, TGeoPatternParaX, TGeoPatternParaY, TGeoPatternParaZ, TGeoPatternTrapZ, TGeoPatternCylR, TGeoPatternCylPhi, TGeoPatternSphR, TGeoPatternSphTheta, TGeoPatternSphPhi, TGeoPcon, TGeoPgon, TGeoScaledShape, TGeoShapeAssembly, TGeoSphere, TGeoTorus, TGeoTrd1, TGeoTrd2, TGeoTube, TGeoTubeSeg, TGeoCtub, TGeoVolume, TGeoXtru, TASImage, TAnnotation, TButton, TCanvas, TGroupButton, TPad, TPaveClass, TSlider, TSliderBox, TArc, TArrow, TBox, TCrown, TCutG, TDiamond, TEllipse, TFrame, TGaxis, TGraphPolar, TGraphPolargram, TLatex, TLegend, TLine, TMarker, TMathText, TPave, TPaveLabel, TPaveStats, TPavesText, TPaveText, TPolyLine, TText, TWbox, TGraphStruct, TAxis3D, THelix, TMarker3DBox, TPolyLine3D, TPolyMarker3D, TGHorizontal3DLine, TGVertical3DLine, TGButton, TGTextButton, TGPictureButton, TGCheckButton, TGRadioButton, TGButtonGroup, TGVButtonGroup, TGHButtonGroup, TGContainer, TGCanvas, TGComboBox, TGLineStyleComboBox, TGLineWidthComboBox, TGDockableFrame, TGDoubleVSlider, TGDoubleHSlider, TGFrame, TGCompositeFrame, TGVerticalFrame, TGHorizontalFrame, TGMainFrame, TGTransientFrame, TGGroupFrame, TGFSComboBox, TGFileContainer, TGGC, TGIcon, TGLabel, TGLayoutHints, TGListBox, TGListTree, TGListView, TGLVContainer, TGMdiFrame, TGMdiMainFrame, TGMdiMenuBar, TGPopupMenu, TGMenuTitle, TGMenuBar, TGProgressBar, TGHProgressBar, TGVProgressBar, TGHScrollBar, TGVScrollBar, TGShapedFrame, TGShutterItem, TGShutter, TGVSlider, TGHSlider, TGSplitFrame, TGVSplitter, TGHSplitter, TGVFileSplitter, TGStatusBar, TGTabLayout, TGTab, TGTextEntry, TGToolBar, TGTripleVSlider, TGTripleHSlider, TRootEmbeddedCanvas, TF1, TF12, TF2, TF3, TGraph, TGraph2D, TGraph2DAsymmErrors, TGraph2DErrors, TGraphAsymmErrors, TGraphBentErrors, TGraphErrors, TGraphMultiErrors, TH1, TH2Poly, THStack, TMultiGraph, TPolyMarker, TProfile, TProfile2D, TProfile3D, TScatter, TScatter2D, TSpline3, TSpline5, TPaletteAxis, TChain, TTreePerfStats, TParallelCoord, TParallelCoordVar, TPie, and TPieSlice.

Definition at line 858 of file TObject.cxx.

◆ SavePrimitiveConstructor()

void TObject::SavePrimitiveConstructor ( std::ostream & out,
TClass * cl,
const char * variable_name,
const char * constructor_agrs = "",
Bool_t empty_line = kTRUE )
staticprotectedinherited

Save object constructor in the output stream "out".

Can be used as first statement when implementing SavePrimitive() method for the object

Definition at line 777 of file TObject.cxx.

◆ SavePrimitiveDraw()

void TObject::SavePrimitiveDraw ( std::ostream & out,
const char * variable_name,
Option_t * option = nullptr )
staticprotectedinherited

Save invocation of primitive Draw() method Skipped if option contains "nodraw" string.

Definition at line 845 of file TObject.cxx.

◆ SavePrimitiveVector()

TString TObject::SavePrimitiveVector ( std::ostream & out,
const char * prefix,
Int_t len,
Double_t * arr,
Int_t flag = 0 )
staticprotectedinherited

Save array in the output stream "out" as vector.

Create unique variable name based on prefix value Returns name of vector which can be used in constructor or in other places of C++ code If flag === kTRUE, just add empty line If flag === 111, check if array is empty and return nullptr or <vectorname>.data()

Definition at line 796 of file TObject.cxx.

◆ SetBit() [1/2]

void TObject::SetBit ( UInt_t f)
inlineinherited

Definition at line 202 of file TObject.h.

◆ SetBit() [2/2]

void TObject::SetBit ( UInt_t f,
Bool_t set )
inherited

Set or unset the user status bits as specified in f.

Definition at line 888 of file TObject.cxx.

◆ SetChat()

virtual void TFoam::SetChat ( Int_t Chat)
inlinevirtual

Definition at line 119 of file TFoam.h.

◆ SetDrawOption()

void TObject::SetDrawOption ( Option_t * option = "")
virtualinherited

Set drawing option for object.

This option only affects the drawing style and is stored in the option field of the TObjOptLink supporting a TPad's primitive list (TList). Note that it does not make sense to call object.SetDrawOption(option) before having called object.Draw().

Reimplemented in TSystemDirectory, TSystemFile, TPad, TGFrame, TAxis, TBrowser, TPaveStats, TGedFrame, TRootBrowserLite, and RooPlot.

Definition at line 871 of file TObject.cxx.

◆ SetDtorOnly()

void TObject::SetDtorOnly ( void * obj)
staticinherited

Set destructor only flag.

Definition at line 1204 of file TObject.cxx.

◆ SetEvPerBin()

virtual void TFoam::SetEvPerBin ( Int_t EvPerBin)
inlinevirtual

Definition at line 122 of file TFoam.h.

◆ SetInhiDiv()

void TFoam::SetInhiDiv ( Int_t iDim,
Int_t InhiDiv )
virtual

This can be called before Initialize, after setting kDim It defines which variables are excluded in the process of the cell division.

For example 'FoamX->SetInhiDiv(1, 1);' inhibits division of y-variable. The resulting map of cells in 2-dim. case will look as follows:

Definition at line 1307 of file TFoam.cxx.

◆ SetkDim()

virtual void TFoam::SetkDim ( Int_t kDim)
inlinevirtual

Definition at line 115 of file TFoam.h.

◆ SetMaxWtRej()

virtual void TFoam::SetMaxWtRej ( Double_t MaxWtRej)
inlinevirtual

Definition at line 123 of file TFoam.h.

◆ SetnBin()

virtual void TFoam::SetnBin ( Int_t nBin)
inlinevirtual

Definition at line 118 of file TFoam.h.

◆ SetnCells()

virtual void TFoam::SetnCells ( Long_t nCells)
inlinevirtual

Definition at line 116 of file TFoam.h.

◆ SetnSampl()

virtual void TFoam::SetnSampl ( Long_t nSampl)
inlinevirtual

Definition at line 117 of file TFoam.h.

◆ SetObjectStat()

void TObject::SetObjectStat ( Bool_t stat)
staticinherited

Turn on/off tracking of objects in the TObjectTable.

Definition at line 1188 of file TObject.cxx.

◆ SetOptDrive()

virtual void TFoam::SetOptDrive ( Int_t OptDrive)
inlinevirtual

Definition at line 121 of file TFoam.h.

◆ SetOptRej()

virtual void TFoam::SetOptRej ( Int_t OptRej)
inlinevirtual

Definition at line 120 of file TFoam.h.

◆ SetPseRan()

virtual void TFoam::SetPseRan ( TRandom * PseRan)
inlinevirtual

Definition at line 112 of file TFoam.h.

◆ SetRho()

void TFoam::SetRho ( TFoamIntegrand * Rho)
virtual

User may use this method to set the distribution object.

Definition at line 1015 of file TFoam.cxx.

◆ SetRhoInt()

void TFoam::SetRhoInt ( Double_t(*)(Int_t, Double_t *) fun)
virtual

User may use this method to set the distribution object as a global function pointer (and not as an interpreted function).

Definition at line 1026 of file TFoam.cxx.

◆ SetUniqueID()

void TObject::SetUniqueID ( UInt_t uid)
virtualinherited

Set the unique object id.

Definition at line 899 of file TObject.cxx.

◆ SetXdivPRD()

void TFoam::SetXdivPRD ( Int_t iDim,
Int_t len,
Double_t xDiv[] )
virtual

This should be called before Initialize, after setting kDim It predefines values of the cell division for certain variable iDim.

For example setting 3 predefined division lines using:

xDiv[0]=0.30; xDiv[1]=0.40; xDiv[2]=0.65;
FoamX->SetXdivPRD(0,3,xDiv);

results in the following 2-dim. pattern of the cells:

Definition at line 1337 of file TFoam.cxx.

◆ Sqr()

Double_t TFoam::Sqr ( Double_t x) const
inlineprivate

Definition at line 140 of file TFoam.h.

◆ Streamer()

void TFoam::Streamer ( TBuffer & R__b)
overridevirtual

Stream an object of class TObject.

Reimplemented from TObject.

◆ StreamerNVirtual()

void TFoam::StreamerNVirtual ( TBuffer & ClassDef_StreamerNVirtual_b)
inline

Definition at line 143 of file TFoam.h.

◆ SysError()

void TObject::SysError ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue system error message.

Use "location" to specify the method where the system error occurred. Accepts standard printf formatting arguments.

Definition at line 1112 of file TObject.cxx.

◆ TestBit()

R__ALWAYS_INLINE Bool_t TObject::TestBit ( UInt_t f) const
inlineinherited

Definition at line 204 of file TObject.h.

◆ TestBits()

Int_t TObject::TestBits ( UInt_t f) const
inlineinherited

Definition at line 205 of file TObject.h.

◆ UseCurrentStyle()

void TObject::UseCurrentStyle ( )
virtualinherited

Set current style settings in this object This function is called when either TCanvas::UseCurrentStyle or TROOT::ForceStyle have been invoked.

Reimplemented in TCanvas, TPad, TFrame, TPaveStats, TPaveText, TAxis3D, TGraph, TH1, and TTree.

Definition at line 909 of file TObject.cxx.

◆ Varedu()

void TFoam::Varedu ( Double_t ceSum[5],
Int_t & kBest,
Double_t & xBest,
Double_t & yBest )
virtual

Internal method used by Initialize.

It determines the best edge candidate and the position of the cell division plane in case of the variance reduction for future cell division, using results of the MC exploration run stored in fHistEdg

Definition at line 669 of file TFoam.cxx.

◆ Warning()

void TObject::Warning ( const char * location,
const char * fmt,
... ) const
virtualinherited

Issue warning message.

Use "location" to specify the method where the warning occurred. Accepts standard printf formatting arguments.

Definition at line 1084 of file TObject.cxx.

◆ Write() [1/2]

Int_t TObject::Write ( const char * name = nullptr,
Int_t option = 0,
Int_t bufsize = 0 )
virtualinherited

Write this object to the current directory.

For more see the const version of this method.

Reimplemented in TSQLFile, TXMLFile, TDirectory, TBuffer, ROOT::TBufferMergerFile, TDirectoryFile, TFile, TParallelMergingFile, TCollection, TMap, and TTree.

Definition at line 989 of file TObject.cxx.

◆ Write() [2/2]

Int_t TObject::Write ( const char * name = nullptr,
Int_t option = 0,
Int_t bufsize = 0 ) const
virtualinherited

Write this object to the current directory.

The data structure corresponding to this object is serialized. The corresponding buffer is written to the current directory with an associated key with name "name".

Writing an object to a file involves the following steps:

  • Creation of a support TKey object in the current directory. The TKey object creates a TBuffer object.
  • The TBuffer object is filled via the class::Streamer function.
  • If the file is compressed (default) a second buffer is created to hold the compressed buffer.
  • Reservation of the corresponding space in the file by looking in the TFree list of free blocks of the file.
  • The buffer is written to the file.

Bufsize can be given to force a given buffer size to write this object. By default, the buffersize will be taken from the average buffer size of all objects written to the current file so far.

If a name is specified, it will be the name of the key. If name is not given, the name of the key will be the name as returned by GetName().

The option can be a combination of: kSingleKey, kOverwrite or kWriteDelete Using the kOverwrite option a previous key with the same name is overwritten. The previous key is deleted before writing the new object. Using the kWriteDelete option a previous key with the same name is deleted only after the new object has been written. This option is safer than kOverwrite but it is slower. NOTE: Neither kOverwrite nor kWriteDelete reduces the size of a TFile– the space is simply freed up to be overwritten; in the case of a TTree, it is more complicated. If one opens a TTree, appends some entries, then writes it out, the behaviour is effectively the same. If, however, one creates a new TTree and writes it out in this way, only the metadata is replaced, effectively making the old data invisible without deleting it. TTree::Delete() can be used to mark all disk space occupied by a TTree as free before overwriting its metadata this way. The kSingleKey option is only used by TCollection::Write() to write a container with a single key instead of each object in the container with its own key.

An object is read from the file into memory via TKey::Read() or via TObject::Read().

The function returns the total number of bytes written to the file. It returns 0 if the object cannot be written.

Reimplemented in TSQLFile, TXMLFile, TDirectory, TBuffer, TDirectoryFile, TFile, TParallelMergingFile, TCollection, TMap, and TTree.

Definition at line 964 of file TObject.cxx.

Member Data Documentation

◆ fAlpha

Double_t* TFoam::fAlpha
protected

[fDim] Internal parameters of the hyper-rectangle

Definition at line 74 of file TFoam.h.

◆ fBits

UInt_t TObject::fBits
privateinherited

bit field status word

Definition at line 47 of file TObject.h.

◆ fCells

TFoamCell** TFoam::fCells = nullptr
protected

[fNCells] Array of ALL cells

Definition at line 46 of file TFoam.h.

◆ fCellsAct

std::vector<Long_t> TFoam::fCellsAct
protected

Index of active cells, constructed at the end of foam build-up.

Definition at line 50 of file TFoam.h.

◆ fChat

Int_t TFoam::fChat
protected

Chat=0,1,2 chat level in output, Chat=1 normal level.

Definition at line 32 of file TFoam.h.

◆ fDate

TString TFoam::fDate
protected

Release date of FOAM.

Definition at line 26 of file TFoam.h.

◆ fDim

Int_t TFoam::fDim
protected

Dimension of the integration/simulation space.

Definition at line 27 of file TFoam.h.

◆ fEvPerBin

Int_t TFoam::fEvPerBin
protected

Maximum number of effective (wt=1) events per bin.

Definition at line 37 of file TFoam.h.

◆ fgDtorOnly

Longptr_t TObject::fgDtorOnly = 0
staticprivateinherited

object for which to call dtor only (i.e. no delete)

Definition at line 49 of file TObject.h.

◆ fgObjectStat

Bool_t TObject::fgObjectStat = kTRUE
staticprivateinherited

if true keep track of objects in TObjectTable

Definition at line 50 of file TObject.h.

◆ fHistDbg

TObjArray* TFoam::fHistDbg
protected

Histograms of wt, for debug.

Definition at line 53 of file TFoam.h.

◆ fHistEdg

TObjArray* TFoam::fHistEdg
protected

Histograms of wt, one for each cell edge.

Definition at line 52 of file TFoam.h.

◆ fHistWt

TH1D* TFoam::fHistWt
protected

Histogram of the MC wt.

Definition at line 54 of file TFoam.h.

◆ fInhiDiv

Int_t* TFoam::fInhiDiv
protected

! [fDim] Flags for inhibiting cell division

Definition at line 40 of file TFoam.h.

◆ fLastCe

Int_t TFoam::fLastCe
protected

Index of the last cell.

Definition at line 45 of file TFoam.h.

◆ fMaskDiv

Int_t* TFoam::fMaskDiv
protected

! [fDim] Dynamic Mask for cell division

Definition at line 39 of file TFoam.h.

◆ fMaxWtRej

Double_t TFoam::fMaxWtRej
protected

Maximum weight in rejection for getting wt=1 events.

Definition at line 49 of file TFoam.h.

◆ fMCerror

Double_t TFoam::fMCerror
protected

and its error

Definition at line 72 of file TFoam.h.

◆ fMCMonit

TFoamMaxwt* TFoam::fMCMonit
protected

Monitor of the MC weight for measuring MC efficiency.

Definition at line 48 of file TFoam.h.

◆ fMCresult

Double_t TFoam::fMCresult
protected

True Integral R from MC series.

Definition at line 71 of file TFoam.h.

◆ fMCvect

Double_t* TFoam::fMCvect
protected

[fDim] Generated MC vector for the outside user

Definition at line 56 of file TFoam.h.

◆ fMCwt

Double_t TFoam::fMCwt
protected

MC weight.

Definition at line 57 of file TFoam.h.

◆ fMethodCall

TMethodCall* TFoam::fMethodCall
protected

! ROOT's pointer to user-defined global distribution function

Definition at line 61 of file TFoam.h.

◆ fName

TString TFoam::fName
protected

Name of a given instance of the FOAM class.

Definition at line 24 of file TFoam.h.

◆ fNBin

Int_t TFoam::fNBin
protected

No. of bins in the edge histogram for cell MC exploration.

Definition at line 35 of file TFoam.h.

◆ fNCalls

Long_t TFoam::fNCalls
protected

Total number of the function calls.

Definition at line 64 of file TFoam.h.

◆ fNCells

Int_t TFoam::fNCells
protected

Maximum number of cells.

Definition at line 28 of file TFoam.h.

◆ fNEffev

Long_t TFoam::fNEffev
protected

Total number of effective events (wt=1) in the foam buildup.

Definition at line 65 of file TFoam.h.

◆ fNevGen

Double_t TFoam::fNevGen
protected

Total number of the generated MC events.

Definition at line 68 of file TFoam.h.

◆ fNoAct

Int_t TFoam::fNoAct
protected

Number of active cells.

Definition at line 44 of file TFoam.h.

◆ fNSampl

Int_t TFoam::fNSampl
protected

No. of MC events, when dividing (exploring) cell.

Definition at line 36 of file TFoam.h.

◆ fOptDrive

Int_t TFoam::fOptDrive
protected

Optimization switch =1,2 for variance or maximum weight optimization.

Definition at line 31 of file TFoam.h.

◆ fOptPRD

Int_t TFoam::fOptPRD
protected

Option switch for predefined division, for quick check.

Definition at line 41 of file TFoam.h.

◆ fOptRej

Int_t TFoam::fOptRej
protected

Switch =0 for weighted events; =1 for unweighted events in MC.

Definition at line 33 of file TFoam.h.

◆ fPrimAcu

Double_t* TFoam::fPrimAcu
protected

[fNoAct] Array of cumulative probability of all active cells

Definition at line 51 of file TFoam.h.

◆ fPrime

Double_t TFoam::fPrime
protected

Primary integral R' (R=R'<wt>)

Definition at line 70 of file TFoam.h.

◆ fPseRan

TRandom* TFoam::fPseRan
protected

Pointer to user-defined generator of pseudorandom numbers.

Definition at line 62 of file TFoam.h.

◆ fRho

TFoamIntegrand* TFoam::fRho
protected

! Pointer to the user-defined integrand function/distribution

Definition at line 60 of file TFoam.h.

◆ fRNmax

Int_t TFoam::fRNmax
protected

Maximum No. of the rand. numb. requested at once.

Definition at line 29 of file TFoam.h.

◆ fRvec

Double_t* TFoam::fRvec
protected

[fRNmax] random number vector from r.n. generator fDim+1 maximum elements

Definition at line 58 of file TFoam.h.

◆ fSumOve

Double_t TFoam::fSumOve
protected

Total Sum of overweighted events.

Definition at line 67 of file TFoam.h.

◆ fSumWt

Double_t TFoam::fSumWt
protected

Definition at line 66 of file TFoam.h.

◆ fSumWt2

Double_t TFoam::fSumWt2
protected

Total sum of wt and wt^2.

Definition at line 66 of file TFoam.h.

◆ fUniqueID

UInt_t TObject::fUniqueID
privateinherited

object unique identifier

Definition at line 46 of file TObject.h.

◆ fVersion

TString TFoam::fVersion
protected

Actual version of the FOAM like (1.01m)

Definition at line 25 of file TFoam.h.

◆ fWtMax

Double_t TFoam::fWtMax
protected

Definition at line 69 of file TFoam.h.

◆ fWtMin

Double_t TFoam::fWtMin
protected

Maximum/Minimum MC weight.

Definition at line 69 of file TFoam.h.

◆ fXdivPRD

TFoamVect** TFoam::fXdivPRD
protected

! Lists of division values encoded in one vector per direction

Definition at line 42 of file TFoam.h.


The documentation for this class was generated from the following files: