VMC Version 2.0
|
Storing and re-using geometry states of the TGeoManager in use by storing them as TGeoBranchArrays. More...
#include <TGeoMCBranchArrayContainer.h>
Public Member Functions | |
TGeoMCBranchArrayContainer ()=default | |
Default constructor. | |
~TGeoMCBranchArrayContainer ()=default | |
Destructor. | |
void | Initialize (UInt_t maxlevels=100, UInt_t size=8) |
Initialize manually specifying initial number of internal TGeoBranchArray objects. | |
void | InitializeFromGeoManager (TGeoManager *man, UInt_t size=8) |
Initialize from TGeoManager to extract maxlevels. | |
void | ResetCache () |
Clear the internal cache. | |
TGeoBranchArray * | GetNewGeoState (UInt_t &userIndex) |
Get a TGeoBranchArray to set to current geo state. | |
const TGeoBranchArray * | GetGeoState (UInt_t userIndex) |
Get a TGeoBranchArray to read the current state from. | |
void | FreeGeoState (UInt_t userIndex) |
Free the index of this geo state such that it can be re-used. | |
void | FreeGeoState (const TGeoBranchArray *geoState) |
Free the index of this geo state such that it can be re-used. | |
void | FreeGeoStates () |
Free all geo states at once but keep the container size. | |
Private Member Functions | |
TGeoMCBranchArrayContainer (const TGeoMCBranchArrayContainer &) | |
Copying kept private. | |
TGeoMCBranchArrayContainer & | operator= (const TGeoMCBranchArrayContainer &) |
Assignement kept private. | |
void | ExtendCache (UInt_t targetSize=1) |
Resize the cache. | |
Private Attributes | |
std::vector< std::unique_ptr< TGeoBranchArray > > | fCache |
Cache states via TGeoBranchArray. | |
UInt_t | fMaxLevels = 100 |
Maximum level of node array inside a chached state. | |
std::vector< UInt_t > | fFreeIndices |
Provide indices in fCachedStates which are already popped and can be re-populated again. | |
Bool_t | fIsInitialized = kFALSE |
Flag if initialized. | |
Storing and re-using geometry states of the TGeoManager in use by storing them as TGeoBranchArrays.
After having initialized a navigator using a stored state, it can be freed to be used again for storing another geometry state. This makes it easy to handle many events with many stored geometry states and the memory used is kept as small as possible.
Definition at line 35 of file TGeoMCBranchArrayContainer.h.
|
default |
Default constructor.
|
default |
Destructor.
|
private |
Copying kept private.
void TGeoMCBranchArrayContainer::Initialize | ( | UInt_t | maxlevels = 100 , |
UInt_t | size = 8 |
||
) |
Initialize manually specifying initial number of internal TGeoBranchArray objects.
Definition at line 36 of file TGeoMCBranchArrayContainer.cxx.
Referenced by InitializeFromGeoManager().
void TGeoMCBranchArrayContainer::InitializeFromGeoManager | ( | TGeoManager * | man, |
UInt_t | size = 8 |
||
) |
Initialize from TGeoManager to extract maxlevels.
Definition at line 46 of file TGeoMCBranchArrayContainer.cxx.
Referenced by TMCManager::Init().
void TGeoMCBranchArrayContainer::ResetCache | ( | ) |
Clear the internal cache.
Definition at line 51 of file TGeoMCBranchArrayContainer.cxx.
Referenced by Initialize().
TGeoBranchArray * TGeoMCBranchArrayContainer::GetNewGeoState | ( | UInt_t & | userIndex | ) |
Get a TGeoBranchArray to set to current geo state.
Definition at line 58 of file TGeoMCBranchArrayContainer.cxx.
Referenced by TMCManager::TransferTrack().
const TGeoBranchArray * TGeoMCBranchArrayContainer::GetGeoState | ( | UInt_t | userIndex | ) |
Get a TGeoBranchArray to read the current state from.
Definition at line 72 of file TGeoMCBranchArrayContainer.cxx.
Referenced by TMCManagerStack::GetCurrentGeoState(), TMCManagerStack::GetGeoState(), and TMCManager::RestoreGeometryState().
void TGeoMCBranchArrayContainer::FreeGeoState | ( | UInt_t | userIndex | ) |
Free the index of this geo state such that it can be re-used.
Definition at line 90 of file TGeoMCBranchArrayContainer.cxx.
Referenced by FreeGeoState(), FreeGeoStates(), and TMCManager::RestoreGeometryState().
void TGeoMCBranchArrayContainer::FreeGeoState | ( | const TGeoBranchArray * | geoState | ) |
Free the index of this geo state such that it can be re-used.
Definition at line 102 of file TGeoMCBranchArrayContainer.cxx.
void TGeoMCBranchArrayContainer::FreeGeoStates | ( | ) |
Free all geo states at once but keep the container size.
Definition at line 109 of file TGeoMCBranchArrayContainer.cxx.
Referenced by TMCManager::PrepareNewEvent().
|
private |
Assignement kept private.
|
private |
Resize the cache.
Definition at line 118 of file TGeoMCBranchArrayContainer.cxx.
Referenced by GetNewGeoState(), and Initialize().
|
private |
Cache states via TGeoBranchArray.
Definition at line 71 of file TGeoMCBranchArrayContainer.h.
Referenced by ExtendCache(), FreeGeoState(), FreeGeoStates(), GetGeoState(), GetNewGeoState(), and ResetCache().
|
private |
Maximum level of node array inside a chached state.
Definition at line 73 of file TGeoMCBranchArrayContainer.h.
Referenced by ExtendCache(), and Initialize().
|
private |
Provide indices in fCachedStates which are already popped and can be re-populated again.
Definition at line 76 of file TGeoMCBranchArrayContainer.h.
Referenced by ExtendCache(), FreeGeoState(), GetNewGeoState(), and ResetCache().
|
private |
Flag if initialized.
Definition at line 78 of file TGeoMCBranchArrayContainer.h.
Referenced by Initialize(), and ResetCache().