Geant4 10.7.0
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),
35 fexcludeList(nullptr),touchableHistory(nullptr)
36{
37 name = "unknown";
40 ed<<"The concept and the functionality of Readout Geometry has been merged\n"
41 <<"into Parallel World. This G4VReadOutGeometry is kept for the sake of\n"
42 <<"not breaking the commonly-used interface in the sensitive detector class.\n"
43 <<"But this functionality of G4VReadOutGeometry class is no longer tested\n"
44 <<"and thus may not be working well. We strongly recommend our customers to\n"
45 <<"migrate to Parallel World scheme.";
46 G4Exception("G4VReadOutGeometry","DIGIHIT1001",JustWarning,ed);
47}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
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 61 of file G4VReadOutGeometry.cc.

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

◆ ~G4VReadOutGeometry()

G4VReadOutGeometry::~G4VReadOutGeometry ( )
virtual

Definition at line 76 of file G4VReadOutGeometry.cc.

77{
78 //if(ROworld) delete ROworld; //should we do ? will it delete the goem tree also ?
79 if(fincludeList) delete fincludeList;
80 if(fexcludeList) delete fexcludeList;
82 if(ROnavigator) delete ROnavigator;
83}

◆ G4VReadOutGeometry() [3/3]

G4VReadOutGeometry::G4VReadOutGeometry ( const G4VReadOutGeometry right)
protected

Definition at line 49 of file G4VReadOutGeometry.cc.

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

Member Function Documentation

◆ Build()

virtual G4VPhysicalVolume * G4VReadOutGeometry::Build ( )
protectedpure virtual

Referenced by BuildROGeometry().

◆ BuildROGeometry()

void G4VReadOutGeometry::BuildROGeometry ( )

Definition at line 103 of file G4VReadOutGeometry.cc.

104{
105 ROworld = Build();
107}
void SetWorldVolume(G4VPhysicalVolume *pWorld)
virtual G4VPhysicalVolume * Build()=0

◆ CheckROVolume()

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

Definition at line 109 of file G4VReadOutGeometry.cc.

110{
111 ROhist = nullptr;
112 G4bool incFlg = true;
113 auto PV = currentStep->GetPreStepPoint()->GetPhysicalVolume();
114 if((fexcludeList)&&(fexcludeList->CheckPV(PV)))
115 { incFlg = false; }
116 else if ((fincludeList)&&(fincludeList->CheckPV(PV)))
117 { incFlg = true; }
118 else if((fexcludeList)&&(fexcludeList->CheckLV(PV->GetLogicalVolume())))
119 { incFlg = false; }
120 else if((fincludeList)&&(fincludeList->CheckLV(PV->GetLogicalVolume())))
121 { incFlg = true; }
122 if(!incFlg) return false;
123
124 if(ROworld)
125 { incFlg = FindROTouchable(currentStep); }
126 if(incFlg)
127 { ROhist = touchableHistory; }
128 return incFlg;
129}
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 131 of file G4VReadOutGeometry.cc.

132{
133 // Update G4TouchableHistory object (touchableHistory)
134 // using the parallel readout world (ROworld)
135 // Return false in case the current Step is outside of the
136 // sensitive volume of the readout world.
137
138 // At first invokation, creates the touchable history. Note
139 // that default value (false) of Locate method is used.
140 // ---------> But the default Value is TRUE <-------------------- J.A.
142 {
145 currentStep->GetPreStepPoint()->GetPosition(),
146 currentStep->GetPreStepPoint()->GetMomentumDirection(),
148 }
149 else
150 {
152 currentStep->GetPreStepPoint()->GetPosition(),
153 currentStep->GetPreStepPoint()->GetMomentumDirection(),
155 true);
156 }
157 // Can the above be improved by the use of an isotropic safety
158 // in order to avoid LocateGlobalPointAndUpdateTouchable
159 // at each Step ?
160 // Should require that an RO geometry is notified at the
161 // starting of a track to avoid possible confusion looking
162 // at the safety value only.
163
164 // checks if volume is sensitive:
165 auto currentVolume = touchableHistory->GetVolume();
166 // checks first if a physical volume exists here:
167 if ( currentVolume )
168 {
169 return currentVolume->GetLogicalVolume()->
170 GetSensitiveDetector() != 0;
171 }
172 // no sensitive volume found: returns false
173 return false;
174}
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 78 of file G4VReadOutGeometry.hh.

79 { return fexcludeList; }

◆ GetIncludeList()

const G4SensitiveVolumeList * G4VReadOutGeometry::GetIncludeList ( ) const
inline

Definition at line 74 of file G4VReadOutGeometry.hh.

75 { return fincludeList; }

◆ GetName()

G4String G4VReadOutGeometry::GetName ( ) const
inline

◆ GetROWorld()

G4VPhysicalVolume * G4VReadOutGeometry::GetROWorld ( ) const
inline

Definition at line 87 of file G4VReadOutGeometry.hh.

88 { return ROworld;}

Referenced by G4LogicalVolumeModel::DescribeYourselfTo().

◆ operator!=()

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

Definition at line 100 of file G4VReadOutGeometry.cc.

101{ return (this != (G4VReadOutGeometry *) &right); }

◆ operator=()

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

Definition at line 85 of file G4VReadOutGeometry.cc.

86{
87 if ( this == &right ) return *this;
88 delete fincludeList; fincludeList = nullptr;
89 delete fexcludeList; fexcludeList = nullptr;
90 name = right.name;
91 ROworld = right.ROworld;
92 delete touchableHistory; touchableHistory = nullptr;
93 delete ROnavigator; ROnavigator = new G4Navigator();
94 return *this;
95}

◆ operator==()

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

Definition at line 97 of file G4VReadOutGeometry.cc.

98{ return (this == (G4VReadOutGeometry *) &right); }

◆ SetExcludeList()

void G4VReadOutGeometry::SetExcludeList ( G4SensitiveVolumeList value)
inline

Definition at line 80 of file G4VReadOutGeometry.hh.

81 { fexcludeList = value; }

◆ SetIncludeList()

void G4VReadOutGeometry::SetIncludeList ( G4SensitiveVolumeList value)
inline

Definition at line 76 of file G4VReadOutGeometry.hh.

77 { fincludeList = value; }

◆ SetName()

void G4VReadOutGeometry::SetName ( G4String  value)
inline

Definition at line 84 of file G4VReadOutGeometry.hh.

85 { name = value; }

Member Data Documentation

◆ fexcludeList

G4SensitiveVolumeList* G4VReadOutGeometry::fexcludeList
protected

◆ fincludeList

G4SensitiveVolumeList* G4VReadOutGeometry::fincludeList
protected

◆ name

G4String G4VReadOutGeometry::name
protected

Definition at line 68 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: