Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VReadOutGeometry Class Referenceabstract

#include <G4VReadOutGeometry.hh>

Public Member Functions

 G4VReadOutGeometry ()
 
 G4VReadOutGeometry (G4String)
 
virtual ~G4VReadOutGeometry ()
 
G4bool operator== (const G4VReadOutGeometry &right) const
 
G4bool operator!= (const G4VReadOutGeometry &right) const
 
void BuildROGeometry ()
 
virtual G4bool CheckROVolume (G4Step *, G4TouchableHistory *&)
 
const G4SensitiveVolumeListGetIncludeList () const
 
void SetIncludeList (G4SensitiveVolumeList *value)
 
const G4SensitiveVolumeListGetExcludeList () const
 
void SetExcludeList (G4SensitiveVolumeList *value)
 
G4String GetName () const
 
void SetName (G4String value)
 
G4VPhysicalVolumeGetROWorld () const
 

Protected Member Functions

virtual G4VPhysicalVolumeBuild ()=0
 
 G4VReadOutGeometry (const G4VReadOutGeometry &right)
 
G4VReadOutGeometryoperator= (const G4VReadOutGeometry &right)
 
virtual G4bool FindROTouchable (G4Step *)
 

Protected Attributes

G4VPhysicalVolumeROworld
 
G4SensitiveVolumeListfincludeList
 
G4SensitiveVolumeListfexcludeList
 
G4String name
 
G4NavigatorROnavigator
 
G4TouchableHistorytouchableHistory
 

Detailed Description

Definition at line 39 of file G4VReadOutGeometry.hh.

Constructor & Destructor Documentation

◆ G4VReadOutGeometry() [1/3]

G4VReadOutGeometry::G4VReadOutGeometry ( )

Definition at line 33 of file G4VReadOutGeometry.cc.

34 : ROworld(nullptr), fincludeList(nullptr), fexcludeList(nullptr), touchableHistory(nullptr)
35{
36 name = "unknown";
39 ed << "The concept and the functionality of Readout Geometry has been merged\n"
40 << "into Parallel World. This G4VReadOutGeometry is kept for the sake of\n"
41 << "not breaking the commonly-used interface in the sensitive detector "
42 "class.\n"
43 << "But this functionality of G4VReadOutGeometry class is no longer "
44 "tested\n"
45 << "and thus may not be working well. We strongly recommend our customers "
46 "to\n"
47 << "migrate to Parallel World scheme.";
48 G4Exception("G4VReadOutGeometry", "DIGIHIT1001", JustWarning, ed);
49}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4VPhysicalVolume * ROworld
G4SensitiveVolumeList * fincludeList
G4TouchableHistory * touchableHistory
G4SensitiveVolumeList * fexcludeList

◆ G4VReadOutGeometry() [2/3]

G4VReadOutGeometry::G4VReadOutGeometry ( G4String n)

Definition at line 63 of file G4VReadOutGeometry.cc.

64 : ROworld(nullptr),
65 fincludeList(nullptr),
66 fexcludeList(nullptr),
67 name(n),
68 touchableHistory(nullptr)
69{
72 ed << "The concept and the functionality of Readout Geometry has been merged\n"
73 << "into Parallel World. This G4VReadOutGeometry is kept for the sake of\n"
74 << "not breaking the commonly-used interface in the sensitive detector "
75 "class.\n"
76 << "But this functionality of G4VReadOutGeometry class is no longer "
77 "tested\n"
78 << "and thus may not be working well. We strongly recommend our customers "
79 "to\n"
80 << "migrate to Parallel World scheme.";
81 G4Exception("G4VReadOutGeometry", "DIGIHIT1001", JustWarning, ed);
82}

◆ ~G4VReadOutGeometry()

G4VReadOutGeometry::~G4VReadOutGeometry ( )
virtual

Definition at line 84 of file G4VReadOutGeometry.cc.

85{
86 // if(ROworld) delete ROworld; //should we do ? will it delete the goem tree
87 // also ?
88 delete fincludeList;
89 delete fexcludeList;
90 delete touchableHistory;
91 delete ROnavigator;
92}

◆ G4VReadOutGeometry() [3/3]

G4VReadOutGeometry::G4VReadOutGeometry ( const G4VReadOutGeometry & right)
protected

Definition at line 51 of file G4VReadOutGeometry.cc.

52{
53 fincludeList = nullptr;
54 fexcludeList = nullptr;
55 name = right.name;
56 ROworld = right.ROworld;
57 touchableHistory = nullptr;
59 // COPY CONSTRUCTOR NOT STRAIGHT FORWARD: need to copy the touchabelHistory
60 // VALUE, same for navigator and same for the World+Geom hierachy
61}

Member Function Documentation

◆ Build()

virtual G4VPhysicalVolume * G4VReadOutGeometry::Build ( )
protectedpure virtual

Referenced by BuildROGeometry().

◆ BuildROGeometry()

void G4VReadOutGeometry::BuildROGeometry ( )

Definition at line 120 of file G4VReadOutGeometry.cc.

121{
122 ROworld = Build();
124}
void SetWorldVolume(G4VPhysicalVolume *pWorld)
virtual G4VPhysicalVolume * Build()=0

◆ CheckROVolume()

G4bool G4VReadOutGeometry::CheckROVolume ( G4Step * currentStep,
G4TouchableHistory *& ROhist )
virtual

Definition at line 126 of file G4VReadOutGeometry.cc.

127{
128 ROhist = nullptr;
129 G4bool incFlg = true;
130 auto PV = currentStep->GetPreStepPoint()->GetPhysicalVolume();
131 if (((fexcludeList) != nullptr) && (fexcludeList->CheckPV(PV))) {
132 incFlg = false;
133 }
134 else if (((fincludeList) != nullptr) && (fincludeList->CheckPV(PV))) {
135 incFlg = true;
136 }
137 else if (((fexcludeList) != nullptr) && (fexcludeList->CheckLV(PV->GetLogicalVolume()))) {
138 incFlg = false;
139 }
140 else if (((fincludeList) != nullptr) && (fincludeList->CheckLV(PV->GetLogicalVolume()))) {
141 incFlg = true;
142 }
143 if (! incFlg) return false;
144
145 if (ROworld != nullptr) {
146 incFlg = FindROTouchable(currentStep);
147 }
148 if (incFlg) {
149 ROhist = touchableHistory;
150 }
151 return incFlg;
152}
bool G4bool
Definition G4Types.hh:86
G4bool CheckLV(const G4LogicalVolume *lvp) const
G4bool CheckPV(const G4VPhysicalVolume *pvp) const
G4VPhysicalVolume * GetPhysicalVolume() const
G4StepPoint * GetPreStepPoint() const
virtual G4bool FindROTouchable(G4Step *)

Referenced by G4VFastSimSensitiveDetector::Hit(), G4VGFlashSensitiveDetector::Hit(), and G4VSensitiveDetector::Hit().

◆ FindROTouchable()

G4bool G4VReadOutGeometry::FindROTouchable ( G4Step * currentStep)
protectedvirtual

Definition at line 154 of file G4VReadOutGeometry.cc.

155{
156 // Update G4TouchableHistory object (touchableHistory)
157 // using the parallel readout world (ROworld)
158 // Return false in case the current Step is outside of the
159 // sensitive volume of the readout world.
160
161 // At first invokation, creates the touchable history. Note
162 // that default value (false) of Locate method is used.
163 // ---------> But the default Value is TRUE <-------------------- J.A.
164 if (touchableHistory == nullptr) {
168 }
169 else {
171 currentStep->GetPreStepPoint()->GetMomentumDirection(), touchableHistory, true);
172 }
173 // Can the above be improved by the use of an isotropic safety
174 // in order to avoid LocateGlobalPointAndUpdateTouchable
175 // at each Step ?
176 // Should require that an RO geometry is notified at the
177 // starting of a track to avoid possible confusion looking
178 // at the safety value only.
179
180 // checks if volume is sensitive:
181 auto currentVolume = touchableHistory->GetVolume();
182 // checks first if a physical volume exists here:
183 if (currentVolume != nullptr) {
184 return currentVolume->GetLogicalVolume()->GetSensitiveDetector() != nullptr;
185 }
186 // no sensitive volume found: returns false
187 return false;
188}
void LocateGlobalPointAndUpdateTouchable(const G4ThreeVector &position, const G4ThreeVector &direction, G4VTouchable *touchableToUpdate, const G4bool RelativeSearch=true)
const G4ThreeVector & GetPosition() const
const G4ThreeVector & GetMomentumDirection() const
virtual G4VPhysicalVolume * GetVolume(G4int depth=0) const

Referenced by CheckROVolume().

◆ GetExcludeList()

const G4SensitiveVolumeList * G4VReadOutGeometry::GetExcludeList ( ) const
inline

Definition at line 57 of file G4VReadOutGeometry.hh.

57{ return fexcludeList; }

◆ GetIncludeList()

const G4SensitiveVolumeList * G4VReadOutGeometry::GetIncludeList ( ) const
inline

Definition at line 55 of file G4VReadOutGeometry.hh.

55{ return fincludeList; }

◆ GetName()

G4String G4VReadOutGeometry::GetName ( ) const
inline

Definition at line 59 of file G4VReadOutGeometry.hh.

59{ return name; }

Referenced by G4ASCIITreeSceneHandler::RequestPrimitives().

◆ GetROWorld()

G4VPhysicalVolume * G4VReadOutGeometry::GetROWorld ( ) const
inline

Definition at line 62 of file G4VReadOutGeometry.hh.

62{ return ROworld; }

Referenced by G4LogicalVolumeModel::DescribeYourselfTo().

◆ operator!=()

G4bool G4VReadOutGeometry::operator!= ( const G4VReadOutGeometry & right) const

Definition at line 115 of file G4VReadOutGeometry.cc.

116{
117 return (this != (G4VReadOutGeometry*)&right);
118}

◆ operator=()

G4VReadOutGeometry & G4VReadOutGeometry::operator= ( const G4VReadOutGeometry & right)
protected

Definition at line 94 of file G4VReadOutGeometry.cc.

95{
96 if (this == &right) return *this;
97 delete fincludeList;
98 fincludeList = nullptr;
99 delete fexcludeList;
100 fexcludeList = nullptr;
101 name = right.name;
102 ROworld = right.ROworld;
103 delete touchableHistory;
104 touchableHistory = nullptr;
105 delete ROnavigator;
106 ROnavigator = new G4Navigator();
107 return *this;
108}

◆ operator==()

G4bool G4VReadOutGeometry::operator== ( const G4VReadOutGeometry & right) const

Definition at line 110 of file G4VReadOutGeometry.cc.

111{
112 return (this == (G4VReadOutGeometry*)&right);
113}

◆ SetExcludeList()

void G4VReadOutGeometry::SetExcludeList ( G4SensitiveVolumeList * value)
inline

Definition at line 58 of file G4VReadOutGeometry.hh.

58{ fexcludeList = value; }

◆ SetIncludeList()

void G4VReadOutGeometry::SetIncludeList ( G4SensitiveVolumeList * value)
inline

Definition at line 56 of file G4VReadOutGeometry.hh.

56{ fincludeList = value; }

◆ SetName()

void G4VReadOutGeometry::SetName ( G4String value)
inline

Definition at line 60 of file G4VReadOutGeometry.hh.

60{ name = value; }

Member Data Documentation

◆ fexcludeList

G4SensitiveVolumeList* G4VReadOutGeometry::fexcludeList
protected

◆ fincludeList

G4SensitiveVolumeList* G4VReadOutGeometry::fincludeList
protected

◆ name

G4String G4VReadOutGeometry::name
protected

◆ ROnavigator

G4Navigator* G4VReadOutGeometry::ROnavigator
protected

◆ ROworld

G4VPhysicalVolume* G4VReadOutGeometry::ROworld
protected

◆ touchableHistory

G4TouchableHistory* G4VReadOutGeometry::touchableHistory
protected

The documentation for this class was generated from the following files: