Project
Loading...
Searching...
No Matches
VecGeomG4PropagatingNavigator.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
12#ifndef O2_SIMSETUP_VECGEOMG4PROPAGATINGNAVIGATOR_H_
13#define O2_SIMSETUP_VECGEOMG4PROPAGATINGNAVIGATOR_H_
14
16
17namespace o2::simsetup
18{
19
26{
27 public:
28 VecGeomG4PropagatingNavigator(VecGeomG4Map const& map, bool zeroSafety);
30
31 G4double ComputeStep(const G4ThreeVector& globalPoint, const G4ThreeVector& direction,
32 const G4double proposedStepLength, G4double& newSafety) override;
33
34 G4VPhysicalVolume* ResetHierarchyAndLocate(const G4ThreeVector& point, const G4ThreeVector& direction,
35 const G4TouchableHistory& history) override;
36
37 G4VPhysicalVolume* LocateGlobalPointAndSetup(const G4ThreeVector& point, const G4ThreeVector* direction = nullptr,
38 const G4bool relativeSearch = true,
39 const G4bool ignoreDirection = true) override;
40
41 void LocateGlobalPointWithinVolume(const G4ThreeVector& position) override;
42
43 G4double ComputeSafety(const G4ThreeVector& globalPoint, const G4double proposedMaxLength = DBL_MAX,
44 const G4bool keepState = true) override;
45
46 G4ThreeVector GetLocalExitNormal(G4bool* valid) override;
47 G4ThreeVector GetGlobalExitNormal(const G4ThreeVector& point, G4bool* valid) override;
48
49 private:
50 vecgeom::NavigationState mCurState;
51 vecgeom::NavigationState mNextState;
52 vecgeom::NavigationState mPrevState;
53 vecgeom::NavigationState mEmptyState;
54
55 bool mZeroSafety = false;
56 bool mHaveNextState = false;
57
58 G4ThreeVector mNextPoint{-1e8, -1e8, -1e8};
59 G4ThreeVector mLastDirection{0, 0, 1};
60
61 bool mWouldEnter = false;
62 bool mWouldExit = false;
63 bool mOnBoundary = false;
64 bool mForceReInit = false;
65 bool mCrossed = false;
66 bool mExitBlockPending = false;
67 G4ThreeVector mLocatedPoint{-1e8, -1e8, -1e8};
68
69 int mZeroSteps = 0;
70 long mNudgedSteps = 0;
71 long mGlobalRelocates = 0;
72};
73
74} // namespace o2::simsetup
75
76#endif
bool valid
G4double ComputeSafety(const G4ThreeVector &globalPoint, const G4double proposedMaxLength=DBL_MAX, const G4bool keepState=true) override
G4double ComputeStep(const G4ThreeVector &globalPoint, const G4ThreeVector &direction, const G4double proposedStepLength, G4double &newSafety) override
G4VPhysicalVolume * LocateGlobalPointAndSetup(const G4ThreeVector &point, const G4ThreeVector *direction=nullptr, const G4bool relativeSearch=true, const G4bool ignoreDirection=true) override
G4ThreeVector GetLocalExitNormal(G4bool *valid) override
G4ThreeVector GetGlobalExitNormal(const G4ThreeVector &point, G4bool *valid) override
void LocateGlobalPointWithinVolume(const G4ThreeVector &position) override
G4VPhysicalVolume * ResetHierarchyAndLocate(const G4ThreeVector &point, const G4ThreeVector &direction, const G4TouchableHistory &history) override