13#ifndef ROOT_TMCManager
14#define ROOT_TMCManager
67 void GetEngines(std::vector<TVirtualMC *> &engines)
const;
119 template <
typename F>
133 template <
typename F>
163#if !defined(__CINT__)
176 std::vector<std::unique_ptr<TMCManagerStack>>
fStacks;
#define ClassDef(name, id)
Storing and re-using geometry states of the TGeoManager in use by storing them as TGeoBranchArrays.
Concrete implementation of particles stack used by the TMCManager.
Singleton manager class for handling and steering a run with multiple TVirtualMC engines sharing even...
Int_t GetEngineId(const char *name) const
Get engine ID by its name.
Bool_t RestoreGeometryState()
Try to restore geometry for the track currently set.
TVirtualMC * GetCurrentEngine() const
Get the current engine pointer.
void TerminateRun()
Terminate a run in all engines.
virtual ~TMCManager()
Destructor.
void ForwardTrack(Int_t toBeDone, Int_t trackId, Int_t parentId, TParticle *particle, Int_t engineId)
User interface to forward particle to specifiic engine.
std::vector< TParticle * > fParticles
All tracks (persistent)
std::vector< TVirtualMC ** > fConnectedEnginePointers
Connected engine pointers which will be updated everytime the current engine changes.
Int_t fTotalNPrimaries
Total number of primaries ever pushed.
void ConnectEnginePointer(TVirtualMC **mc)
Connect a pointer which is updated whenever the engine is changed.
void TransferTrack(Int_t engineTargetId)
Transfer track from current engine to engine with engineTargetId.
Bool_t GetNextEngine()
Find the next engine.
TVirtualMC * fCurrentEngine
Pointer to current engine.
TVirtualMC * GetEngine(Int_t id) const
Get an engine pointer by ID.
void UpdateEnginePointers(TVirtualMC *mc)
Update all engine pointers connected to the TMCManager.
void Apply(F engineLambda)
Apply something to all engines.
void Init()
Initialize engines.
Bool_t fIsInitializedUser
Flag if specific initialization for engines was done.
TVirtualMCApplication * fApplication
Pointer to user application.
void PrepareNewEvent()
Do necessary steps before an event is triggered.
std::vector< std::unique_ptr< TMCManagerStack > > fStacks
Stacks connected to engines.
TVirtualMCStack * fUserStack
Pointer to user stack.
static TMCThreadLocal TMCManager * fgInstance
Singleton instance.
static TMCManager * Instance()
Static access method.
Int_t fTotalNTracks
Total number of tracks ever pushed.
TMCManager()
Default constructor.
std::vector< std::unique_ptr< TMCParticleStatus > > fParticlesStatus
All particles' status (persistent)
void Run(Int_t nEvents)
Run the event loop.
std::vector< TVirtualMC * > fEngines
Collecting pointers to all instanciated TVirtualMCs.
Bool_t fIsInitialized
Flag if engines are initilaized.
void SetUserStack(TVirtualMCStack *stack)
Set user stack.
Int_t NEngines() const
Return the number of registered engines.
void Init(F initFunction)
Further specific initialization.
TGeoMCBranchArrayContainer fBranchArrayContainer
Pointer to cache with geometry states.
void Register(TVirtualMC *engine)
A TVirtualMC will register itself via this method during construction if a TMCManager was instanciate...
void GetEngines(std::vector< TVirtualMC * > &engines) const
Get registered engine pointers.
Description of the dynamic properties of a particle.
Interface to a user Monte Carlo application.
Interface to a user defined particles stack.
Abstract Monte Carlo interface.