Geant4 11.1.1
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 32 of file G4VReadOutGeometry.cc.

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

◆ G4VReadOutGeometry() [2/3]

G4VReadOutGeometry::G4VReadOutGeometry ( G4String  n)

Definition at line 66 of file G4VReadOutGeometry.cc.

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

◆ ~G4VReadOutGeometry()

G4VReadOutGeometry::~G4VReadOutGeometry ( )
virtual

Definition at line 88 of file G4VReadOutGeometry.cc.

89{
90 // if(ROworld) delete ROworld; //should we do ? will it delete the goem tree
91 // also ?
92 if(fincludeList)
93 delete fincludeList;
94 if(fexcludeList)
95 delete fexcludeList;
97 delete touchableHistory;
98 if(ROnavigator)
99 delete ROnavigator;
100}

◆ G4VReadOutGeometry() [3/3]

G4VReadOutGeometry::G4VReadOutGeometry ( const G4VReadOutGeometry right)
protected

Definition at line 54 of file G4VReadOutGeometry.cc.

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

Member Function Documentation

◆ Build()

virtual G4VPhysicalVolume * G4VReadOutGeometry::Build ( )
protectedpure virtual

Referenced by BuildROGeometry().

◆ BuildROGeometry()

void G4VReadOutGeometry::BuildROGeometry ( )

Definition at line 130 of file G4VReadOutGeometry.cc.

131{
132 ROworld = Build();
134}
void SetWorldVolume(G4VPhysicalVolume *pWorld)
virtual G4VPhysicalVolume * Build()=0

◆ CheckROVolume()

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

Definition at line 136 of file G4VReadOutGeometry.cc.

138{
139 ROhist = nullptr;
140 G4bool incFlg = true;
141 auto PV = currentStep->GetPreStepPoint()->GetPhysicalVolume();
142 if((fexcludeList) && (fexcludeList->CheckPV(PV)))
143 {
144 incFlg = false;
145 }
146 else if((fincludeList) && (fincludeList->CheckPV(PV)))
147 {
148 incFlg = true;
149 }
150 else if((fexcludeList) && (fexcludeList->CheckLV(PV->GetLogicalVolume())))
151 {
152 incFlg = false;
153 }
154 else if((fincludeList) && (fincludeList->CheckLV(PV->GetLogicalVolume())))
155 {
156 incFlg = true;
157 }
158 if(!incFlg)
159 return false;
160
161 if(ROworld)
162 {
163 incFlg = FindROTouchable(currentStep);
164 }
165 if(incFlg)
166 {
167 ROhist = touchableHistory;
168 }
169 return incFlg;
170}
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 172 of file G4VReadOutGeometry.cc.

173{
174 // Update G4TouchableHistory object (touchableHistory)
175 // using the parallel readout world (ROworld)
176 // Return false in case the current Step is outside of the
177 // sensitive volume of the readout world.
178
179 // At first invokation, creates the touchable history. Note
180 // that default value (false) of Locate method is used.
181 // ---------> But the default Value is TRUE <-------------------- J.A.
183 {
186 currentStep->GetPreStepPoint()->GetPosition(),
188 }
189 else
190 {
192 currentStep->GetPreStepPoint()->GetPosition(),
194 true);
195 }
196 // Can the above be improved by the use of an isotropic safety
197 // in order to avoid LocateGlobalPointAndUpdateTouchable
198 // at each Step ?
199 // Should require that an RO geometry is notified at the
200 // starting of a track to avoid possible confusion looking
201 // at the safety value only.
202
203 // checks if volume is sensitive:
204 auto currentVolume = touchableHistory->GetVolume();
205 // checks first if a physical volume exists here:
206 if(currentVolume)
207 {
208 return currentVolume->GetLogicalVolume()->GetSensitiveDetector() != 0;
209 }
210 // no sensitive volume found: returns false
211 return false;
212}
G4VSensitiveDetector * GetSensitiveDetector() const
void LocateGlobalPointAndUpdateTouchable(const G4ThreeVector &position, const G4ThreeVector &direction, G4VTouchable *touchableToUpdate, const G4bool RelativeSearch=true)
const G4ThreeVector & GetPosition() const
const G4ThreeVector & GetMomentumDirection() const
G4VPhysicalVolume * GetVolume(G4int depth=0) const
G4LogicalVolume * GetLogicalVolume() const

Referenced by CheckROVolume().

◆ GetExcludeList()

const G4SensitiveVolumeList * G4VReadOutGeometry::GetExcludeList ( ) const
inline

Definition at line 83 of file G4VReadOutGeometry.hh.

84 {
85 return fexcludeList;
86 }

◆ GetIncludeList()

const G4SensitiveVolumeList * G4VReadOutGeometry::GetIncludeList ( ) const
inline

Definition at line 75 of file G4VReadOutGeometry.hh.

76 {
77 return fincludeList;
78 }

◆ GetName()

G4String G4VReadOutGeometry::GetName ( ) const
inline

Definition at line 91 of file G4VReadOutGeometry.hh.

91{ return name; }

Referenced by G4ASCIITreeSceneHandler::RequestPrimitives().

◆ GetROWorld()

G4VPhysicalVolume * G4VReadOutGeometry::GetROWorld ( ) const
inline

Definition at line 94 of file G4VReadOutGeometry.hh.

94{ return ROworld; }

Referenced by G4LogicalVolumeModel::DescribeYourselfTo().

◆ operator!=()

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

Definition at line 125 of file G4VReadOutGeometry.cc.

126{
127 return (this != (G4VReadOutGeometry*) &right);
128}

◆ operator=()

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

Definition at line 102 of file G4VReadOutGeometry.cc.

104{
105 if(this == &right)
106 return *this;
107 delete fincludeList;
108 fincludeList = nullptr;
109 delete fexcludeList;
110 fexcludeList = nullptr;
111 name = right.name;
112 ROworld = right.ROworld;
113 delete touchableHistory;
114 touchableHistory = nullptr;
115 delete ROnavigator;
116 ROnavigator = new G4Navigator();
117 return *this;
118}

◆ operator==()

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

Definition at line 120 of file G4VReadOutGeometry.cc.

121{
122 return (this == (G4VReadOutGeometry*) &right);
123}

◆ SetExcludeList()

void G4VReadOutGeometry::SetExcludeList ( G4SensitiveVolumeList value)
inline

Definition at line 87 of file G4VReadOutGeometry.hh.

88 {
89 fexcludeList = value;
90 }

◆ SetIncludeList()

void G4VReadOutGeometry::SetIncludeList ( G4SensitiveVolumeList value)
inline

Definition at line 79 of file G4VReadOutGeometry.hh.

80 {
81 fincludeList = value;
82 }

◆ SetName()

void G4VReadOutGeometry::SetName ( G4String  value)
inline

Definition at line 92 of file G4VReadOutGeometry.hh.

92{ name = value; }

Member Data Documentation

◆ fexcludeList

G4SensitiveVolumeList* G4VReadOutGeometry::fexcludeList
protected

◆ fincludeList

G4SensitiveVolumeList* G4VReadOutGeometry::fincludeList
protected

◆ name

G4String G4VReadOutGeometry::name
protected

Definition at line 69 of file G4VReadOutGeometry.hh.

Referenced by G4VReadOutGeometry(), GetName(), operator=(), and SetName().

◆ 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: