G4Root Version 6.6
Loading...
Searching...
No Matches
TG4RootNavMgr.h
Go to the documentation of this file.
1// @(#)root/g4root:$Id$
2// Author: Andrei Gheata 07/08/06
3
4/*************************************************************************
5 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
16
17#ifndef ROOT_TG4RootNavMgr
18#define ROOT_TG4RootNavMgr
19
20#include <functional>
21
22#include "G4Threading.hh"
23
24#include "TObject.h"
25
26class TGeoManager;
30class G4TrackingManager;
31
35
36class TG4RootNavMgr : public TObject
37{
38
39 protected:
40 TGeoManager* fGeometry;
46 Bool_t fConnected;
47
50 TGeoManager* geom, TG4RootDetectorConstruction* detConstruction = 0);
51
52 private:
53 static G4ThreadLocal TG4RootNavMgr* fRootNavMgr;
56
57 public:
58 static TG4RootNavMgr* GetInstance(TGeoManager* geom = 0);
59 static TG4RootNavMgr* GetInstance(const TG4RootNavMgr& navMgr);
61 virtual ~TG4RootNavMgr();
62
63 Bool_t ConnectToG4();
64 void Initialize(
65 TVirtualUserPostDetConstruction* sdinit = 0, Int_t nthreads = 1);
66 void LocateGlobalPointAndSetup(Double_t* pt, Double_t* dir = 0);
67
68 // Test utilities
69 void PrintG4State() const;
70 void SetVerboseLevel(Int_t level);
71
81 void SetG4TrackingManager(G4TrackingManager* trackingManager);
82
85 std::function<Bool_t(Int_t)> restoreGeoStateFunction);
86
87 // ClassDef(TG4RootNavMgr,0) // Class crreating a G4Navigator based on ROOT
88 // geometry
89};
90#endif
Builder creating a pseudo G4 geometry starting from a TGeo geometry.
Manager class creating a G4Navigator based on a ROOT geometry.
static G4ThreadLocal TG4RootNavMgr * fRootNavMgr
void SetVerboseLevel(Int_t level)
TGeoManager * fGeometry
Pointer to TGeo geometry.
void SetNavigator(TG4RootNavigator *nav)
static TG4RootNavMgr * fgMasterInstance
void SetG4TrackingManager(G4TrackingManager *trackingManager)
Forward current G4TrackingManager.
TVirtualUserPostDetConstruction * fPostDetDetConstruction
TG4RootDetectorConstruction * GetDetConstruction() const
Return the G4 geometry built based on ROOT one.
Bool_t fConnected
Flags connection to G4.
TG4RootNavigator * GetNavigator() const
Return the G4 navigator working with TGeo.
static TG4RootNavMgr * GetMasterInstance()
TG4RootNavigator * fNavigator
G4 navigator working with TGeo.
void PrintG4State() const
void LocateGlobalPointAndSetup(Double_t *pt, Double_t *dir=0)
static TG4RootNavMgr * GetInstance(TGeoManager *geom=0)
void Initialize(TVirtualUserPostDetConstruction *sdinit=0, Int_t nthreads=1)
virtual ~TG4RootNavMgr()
TG4RootDetectorConstruction * fDetConstruction
void SetGeometryRestoreFunction(std::function< Bool_t(Int_t)> restoreGeoStateFunction)
Forward the given function to the TG4RootNavigator.
GEANT4 navigator using directly a TGeo geometry.
Abstract class for defining links to G4 geometry.