25#ifndef ROOT_TGeoMCBranchArrayContainer
26#define ROOT_TGeoMCBranchArrayContainer
31#include "TGeoBranchArray.h"
44 void Initialize(UInt_t maxlevels = 100, UInt_t size = 8);
53 const TGeoBranchArray *
GetGeoState(UInt_t userIndex);
71 std::vector<std::unique_ptr<TGeoBranchArray>>
fCache;
Storing and re-using geometry states of the TGeoManager in use by storing them as TGeoBranchArrays.
void ExtendCache(UInt_t targetSize=1)
Resize the cache.
~TGeoMCBranchArrayContainer()=default
Destructor.
UInt_t fMaxLevels
Maximum level of node array inside a chached state.
void Initialize(UInt_t maxlevels=100, UInt_t size=8)
Initialize manually specifying initial number of internal TGeoBranchArray objects.
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.
std::vector< UInt_t > fFreeIndices
Provide indices in fCachedStates which are already popped and can be re-populated again.
TGeoMCBranchArrayContainer(const TGeoMCBranchArrayContainer &)
Copying kept private.
void InitializeFromGeoManager(TGeoManager *man, UInt_t size=8)
Initialize from TGeoManager to extract maxlevels.
Bool_t fIsInitialized
Flag if initialized.
void ResetCache()
Clear the internal cache.
void FreeGeoStates()
Free all geo states at once but keep the container size.
TGeoMCBranchArrayContainer()=default
Default constructor.
TGeoMCBranchArrayContainer & operator=(const TGeoMCBranchArrayContainer &)
Assignement kept private.
void FreeGeoState(UInt_t userIndex)
Free the index of this geo state such that it can be re-used.
std::vector< std::unique_ptr< TGeoBranchArray > > fCache
Cache states via TGeoBranchArray.