Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4NavigationLogger.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26// G4NavigationLogger
27//
28// Class description:
29//
30// Simple utility class for use by navigation systems
31// for verbosity and check-mode.
32
33// Author: Gabriele Cosmo (CERN), November 2010
34// --------------------------------------------------------------------
35#ifndef G4NAVIGATIONLOGGER_HH
36#define G4NAVIGATIONLOGGER_HH 1
37
39#include "G4VPhysicalVolume.hh"
40#include "G4LogicalVolume.hh"
41#include "G4VSolid.hh"
42#include "G4ThreeVector.hh"
43
44/**
45 * @brief G4NavigationLogger is a simple utility class for use by the
46 * navigation systems for verbosity and check-mode.
47 */
48
50{
51 public:
52
53 /**
54 * Constructor and Destructor.
55 */
58
59 /**
60 * Reports about first check - mother safety.
61 */
62 void PreComputeStepLog (const G4VPhysicalVolume* motherPhysical,
63 G4double motherSafety,
64 const G4ThreeVector& localPoint) const;
65
66 /**
67 * Reports about a candidate daughter.
68 */
69 void AlongComputeStepLog(const G4VSolid* sampleSolid,
70 const G4ThreeVector& samplePoint,
71 const G4ThreeVector& sampleDirection,
72 const G4ThreeVector& localDirection,
73 G4double sampleSafety,
74 G4double sampleStep) const;
75
76 /**
77 * Checks suspicious distance to a candidate daughter.
78 */
79 void CheckDaughterEntryPoint(const G4VSolid* sampleSolid,
80 const G4ThreeVector& samplePoint,
81 const G4ThreeVector& sampleDirection,
82 const G4VSolid* motherSolid,
83 const G4ThreeVector& localPoint,
84 const G4ThreeVector& localDirection,
85 G4double motherStep,
86 G4double sampleStep) const;
87
88 /**
89 * Reports exit distance from mother.
90 */
91 void PostComputeStepLog (const G4VSolid* motherSolid,
92 const G4ThreeVector& localPoint,
93 const G4ThreeVector& localDirection,
94 G4double motherStep,
95 G4double motherSafety) const;
96
97 /**
98 * Reports about safety computation.
99 */
100 void ComputeSafetyLog (const G4VSolid* solid,
101 const G4ThreeVector& point,
102 G4double safety,
103 G4bool isMotherVolume, // For labeling
104 G4int banner= -1) const;
105
106 /**
107 * Reports about a new minimum distance to candidate daughter.
108 */
109 void PrintDaughterLog (const G4VSolid* sampleSolid,
110 const G4ThreeVector& samplePoint,
111 G4double sampleSafety,
112 G4bool onlySafety,
113 const G4ThreeVector& sampleDirection,
114 G4double sampleStep) const;
115
116 /**
117 * Reports issue with normal from Solid - for ComputeStep().
118 */
120 const G4ThreeVector& localPoint,
121 const G4ThreeVector& localDirection,
122 G4double step,
123 const G4VSolid* solid,
124 const char* msg) const;
125
126 /**
127 * Reports issue with normal from Rotation - for ComputeStep().
128 */
130 const G4ThreeVector& originalNormal,
131 const G4RotationMatrix& rotationM,
132 const char* msg) const;
133
134 /**
135 * Reports if point wrongly located outside mother volume.
136 */
137 void ReportOutsideMother(const G4ThreeVector& localPoint,
138 const G4ThreeVector& localDirection,
139 const G4VPhysicalVolume* motherPV,
140 G4double tDist = 30.0*CLHEP::cm) const;
141
142 /**
143 * Auxiliary method to report information about volume
144 * and position/direction
145 */
146 void ReportVolumeAndIntersection(std::ostream& ostrm,
147 const G4ThreeVector& localPoint,
148 const G4ThreeVector& localDirection,
149 const G4VPhysicalVolume* physical) const;
150
151 /**
152 * Verbosity control.
153 */
154 inline G4int GetVerboseLevel() const { return fVerbose; }
155 inline void SetVerboseLevel(G4int level) { fVerbose = level; }
156
157 /**
158 * Accessors/modifiers.
159 */
160 inline G4double GetMinTriggerDistance() const {return fMinTriggerDistance;}
161 inline void SetMinTriggerDistance(G4double d) {fMinTriggerDistance= d;}
162 inline G4bool GetReportSoftWarnings() const {return fReportSoftWarnings;}
163 inline void SetReportSoftWarnings(G4bool b) {fReportSoftWarnings = b;}
164
165 private:
166
167 G4String fId; // Navigation type
168 G4int fVerbose = 0; // Verbosity level
169 G4double fMinTriggerDistance = DBL_MAX; // Errors beyond this are fatal
170 G4bool fReportSoftWarnings = false; // Flag to warn about small issues
171};
172
173#endif
CLHEP::HepRotation G4RotationMatrix
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition G4Types.hh:83
bool G4bool
Definition G4Types.hh:86
int G4int
Definition G4Types.hh:85
void SetVerboseLevel(G4int level)
void PreComputeStepLog(const G4VPhysicalVolume *motherPhysical, G4double motherSafety, const G4ThreeVector &localPoint) const
G4NavigationLogger(const G4String &id)
void CheckDaughterEntryPoint(const G4VSolid *sampleSolid, const G4ThreeVector &samplePoint, const G4ThreeVector &sampleDirection, const G4VSolid *motherSolid, const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, G4double motherStep, G4double sampleStep) const
G4int GetVerboseLevel() const
void PrintDaughterLog(const G4VSolid *sampleSolid, const G4ThreeVector &samplePoint, G4double sampleSafety, G4bool onlySafety, const G4ThreeVector &sampleDirection, G4double sampleStep) const
G4bool CheckAndReportBadNormal(const G4ThreeVector &unitNormal, const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, G4double step, const G4VSolid *solid, const char *msg) const
void SetReportSoftWarnings(G4bool b)
void ComputeSafetyLog(const G4VSolid *solid, const G4ThreeVector &point, G4double safety, G4bool isMotherVolume, G4int banner=-1) const
void ReportVolumeAndIntersection(std::ostream &ostrm, const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, const G4VPhysicalVolume *physical) const
void PostComputeStepLog(const G4VSolid *motherSolid, const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, G4double motherStep, G4double motherSafety) const
G4bool GetReportSoftWarnings() const
G4double GetMinTriggerDistance() const
void ReportOutsideMother(const G4ThreeVector &localPoint, const G4ThreeVector &localDirection, const G4VPhysicalVolume *motherPV, G4double tDist=30.0 *CLHEP::cm) const
void SetMinTriggerDistance(G4double d)
void AlongComputeStepLog(const G4VSolid *sampleSolid, const G4ThreeVector &samplePoint, const G4ThreeVector &sampleDirection, const G4ThreeVector &localDirection, G4double sampleSafety, G4double sampleStep) const
G4VPhysicalVolume is an abstract base class for the representation of a positioned volume....
G4VSolid is an abstract base class for solids, physical shapes that can be tracked through....
Definition G4VSolid.hh:80
#define DBL_MAX
Definition templates.hh:62