Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ScoringProbe Class Reference

#include <G4ScoringProbe.hh>

+ Inheritance diagram for G4ScoringProbe:

Public Member Functions

 G4ScoringProbe (G4String lvName, G4double half_size, G4bool checkOverlap=false)
 
 ~G4ScoringProbe () override=default
 
void LocateProbe (G4ThreeVector pos)
 
G4int GetNumberOfProbes () const
 
void SetProbeSize (G4double val)
 
G4double GetProbeSize () const
 
G4bool SetMaterial (G4String val)
 
void List () const override
 
void Draw (RunScore *, G4VScoreColorMap *, G4int) override
 
void DrawColumn (RunScore *, G4VScoreColorMap *, G4int, G4int) override
 
- Public Member Functions inherited from G4VScoringMesh
 G4VScoringMesh (const G4String &wName)
 
virtual ~G4VScoringMesh ()=default
 
virtual void Construct (G4VPhysicalVolume *fWorldPhys)
 
virtual void WorkerConstruct (G4VPhysicalVolume *fWorldPhys)
 
virtual void List () const
 
const G4StringGetWorldName () const
 
G4bool IsActive () const
 
void Activate (G4bool vl=true)
 
MeshShape GetShape () const
 
void Accumulate (G4THitsMap< G4double > *map)
 
void Accumulate (G4THitsMap< G4StatDouble > *map)
 
void Merge (const G4VScoringMesh *scMesh)
 
void Dump ()
 
void DrawMesh (const G4String &psName, G4VScoreColorMap *colorMap, G4int axflg=111)
 
void DrawMesh (const G4String &psName, G4int idxPlane, G4int iColumn, G4VScoreColorMap *colorMap)
 
virtual void Draw (RunScore *map, G4VScoreColorMap *colorMap, G4int axflg=111)=0
 
virtual void DrawColumn (RunScore *map, G4VScoreColorMap *colorMap, G4int idxProj, G4int idxColumn)=0
 
void ResetScore ()
 
void SetSize (G4double size[3])
 
G4ThreeVector GetSize () const
 
void SetAngles (G4double, G4double)
 
G4double GetStartAngle () const
 
G4double GetAngleSpan () const
 
void SetCenterPosition (G4double centerPosition[3])
 
G4ThreeVector GetTranslation () const
 
void RotateX (G4double delta)
 
void RotateY (G4double delta)
 
void RotateZ (G4double delta)
 
G4RotationMatrix GetRotationMatrix () const
 
void SetNumberOfSegments (G4int nSegment[3])
 
void GetNumberOfSegments (G4int nSegment[3])
 
void SetPrimitiveScorer (G4VPrimitiveScorer *ps)
 
void SetFilter (G4VSDFilter *filter)
 
void SetCurrentPrimitiveScorer (const G4String &name)
 
G4bool FindPrimitiveScorer (const G4String &psname)
 
G4bool IsCurrentPrimitiveScorerNull ()
 
G4String GetPSUnit (const G4String &psname)
 
G4String GetCurrentPSUnit ()
 
void SetCurrentPSUnit (const G4String &unit)
 
G4double GetPSUnitValue (const G4String &psname)
 
void SetDrawPSName (const G4String &psname)
 
void GetDivisionAxisNames (G4String divisionAxisNames[3])
 
void SetNullToCurrentPrimitiveScorer ()
 
void SetVerboseLevel (G4int vl)
 
MeshScoreMap GetScoreMap () const
 
G4bool ReadyForQuantity () const
 
G4VPrimitiveScorerGetPrimitiveScorer (const G4String &name)
 
void SetMeshElementLogical (G4LogicalVolume *val)
 
G4LogicalVolumeGetMeshElementLogical () const
 
void SetParallelWorldProcess (G4ParallelWorldProcess *proc)
 
G4ParallelWorldProcessGetParallelWorldProcess () const
 
void GeometryHasBeenDestroyed ()
 
void SetCopyNumberLevel (G4int val)
 
G4int GetCopyNumberLevel () const
 
G4bool LayeredMassFlg ()
 

Protected Member Functions

void SetupGeometry (G4VPhysicalVolume *) override
 
virtual void SetupGeometry (G4VPhysicalVolume *fWorldPhys)=0
 

Protected Attributes

G4String logVolName
 
std::vector< G4ThreeVectorposVec
 
G4double probeSize
 
G4bool chkOverlap
 
G4String layeredMaterialName
 
G4MateriallayeredMaterial
 
G4String regName
 
- Protected Attributes inherited from G4VScoringMesh
G4String fWorldName
 
G4VPrimitiveScorerfCurrentPS
 
G4bool fConstructed
 
G4bool fActive
 
MeshShape fShape
 
G4double fSize [3]
 
G4double fAngle [2]
 
G4ThreeVector fCenterPosition
 
G4RotationMatrixfRotationMatrix
 
G4int fNSegment [3]
 
MeshScoreMap fMap
 
G4MultiFunctionalDetectorfMFD
 
G4int verboseLevel
 
G4bool sizeIsSet
 
G4bool nMeshIsSet
 
G4String fDrawUnit
 
G4double fDrawUnitValue
 
G4String fDrawPSName
 
G4String fDivisionAxisNames [3]
 
G4LogicalVolumefMeshElementLogical
 
G4ParallelWorldProcessfParallelWorldProcess
 
G4bool fGeometryHasBeenDestroyed
 
G4int copyNumberLevel
 
G4bool layeredMassFlg
 

Additional Inherited Members

- Public Types inherited from G4VScoringMesh
enum class  MeshShape {
  box , cylinder , sphere , realWorldLogVol ,
  probe , undefined = -1
}
 
using EventScore = G4THitsMap< G4double >
 
using RunScore = G4THitsMap< G4StatDouble >
 
using MeshScoreMap = std::map< G4String, RunScore * >
 

Detailed Description

Definition at line 39 of file G4ScoringProbe.hh.

Constructor & Destructor Documentation

◆ G4ScoringProbe()

G4ScoringProbe::G4ScoringProbe ( G4String  lvName,
G4double  half_size,
G4bool  checkOverlap = false 
)

Definition at line 49 of file G4ScoringProbe.cc.

51 : G4VScoringMesh(lvName)
52 , chkOverlap(checkOverlap)
53 , layeredMaterialName("none")
54 , layeredMaterial(nullptr)
55{
57 logVolName = lvName;
58 probeSize = half_size;
59 G4double hs[] = { half_size, half_size, half_size };
60 SetSize(hs);
61 G4int nBin[] = { 1, 1, 1 };
63 regName = lvName + "_region";
65 {
66 new G4Region(regName);
67 }
68}
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
G4double probeSize
G4String logVolName
G4String layeredMaterialName
G4Material * layeredMaterial
void SetNumberOfSegments(G4int nSegment[3])
void SetSize(G4double size[3])
G4bool IsMasterThread()
Definition: G4Threading.cc:124

◆ ~G4ScoringProbe()

G4ScoringProbe::~G4ScoringProbe ( )
overridedefault

Member Function Documentation

◆ Draw()

void G4ScoringProbe::Draw ( RunScore ,
G4VScoreColorMap ,
G4int   
)
inlineoverridevirtual

Implements G4VScoringMesh.

Definition at line 61 of file G4ScoringProbe.hh.

63 {}

◆ DrawColumn()

void G4ScoringProbe::DrawColumn ( RunScore ,
G4VScoreColorMap ,
G4int  ,
G4int   
)
inlineoverridevirtual

Implements G4VScoringMesh.

Definition at line 64 of file G4ScoringProbe.hh.

66 {}

◆ GetNumberOfProbes()

G4int G4ScoringProbe::GetNumberOfProbes ( ) const
inline

Definition at line 53 of file G4ScoringProbe.hh.

53{ return (G4int)posVec.size(); }
std::vector< G4ThreeVector > posVec

◆ GetProbeSize()

G4double G4ScoringProbe::GetProbeSize ( ) const
inline

Definition at line 55 of file G4ScoringProbe.hh.

55{ return probeSize; }

◆ List()

void G4ScoringProbe::List ( ) const
overridevirtual

Reimplemented from G4VScoringMesh.

Definition at line 70 of file G4ScoringProbe.cc.

71{
72 G4cout << "G4ScoringProbe : " << logVolName << G4endl;
73 std::size_t np = posVec.size();
74 for(std::size_t i = 0; i < np; ++i)
75 {
76 G4cout << " >> probe #" << i << " at " << posVec[i] << G4endl;
77 }
79}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
virtual void List() const

◆ LocateProbe()

void G4ScoringProbe::LocateProbe ( G4ThreeVector  pos)
inline

Definition at line 47 of file G4ScoringProbe.hh.

48 {
49 posVec.push_back(pos);
50 G4int nbin[] = { static_cast<G4int>(posVec.size()), 1, 1 };
52 }

◆ SetMaterial()

G4bool G4ScoringProbe::SetMaterial ( G4String  val)

Definition at line 128 of file G4ScoringProbe.cc.

129{
131 {
132 if(val == "none")
133 {
135 layeredMassFlg = false;
136 layeredMaterial = nullptr;
137 }
138 else
139 {
141 if(mat == nullptr)
142 {
143 return false;
144 }
146 layeredMassFlg = true;
147 layeredMaterial = mat;
148 }
150 assert(region != nullptr);
151 region->UpdateMaterialList();
152 }
153 return true;
154}
G4Material * FindOrBuildMaterial(const G4String &name, G4bool isotopes=true, G4bool warning=false)
static G4NistManager * Instance()
static G4RegionStore * GetInstance()
G4Region * GetRegion(const G4String &name, G4bool verbose=true) const

◆ SetProbeSize()

void G4ScoringProbe::SetProbeSize ( G4double  val)
inline

Definition at line 54 of file G4ScoringProbe.hh.

54{ probeSize = val; }

◆ SetupGeometry()

void G4ScoringProbe::SetupGeometry ( G4VPhysicalVolume worldPhys)
overrideprotectedvirtual

Implements G4VScoringMesh.

Definition at line 87 of file G4ScoringProbe.cc.

88{
90 {
91 auto worldLog = worldPhys->GetLogicalVolume();
93 assert(region != nullptr);
94 region->AddRootLogicalVolume(worldLog);
95 region->SetWorld(worldPhys);
96
97 auto boxSolid =
98 new G4Box(logVolName + "_solid", probeSize, probeSize, probeSize);
100 new G4LogicalVolume(boxSolid, layeredMaterial, logVolName + "_log");
101
102 std::size_t np = posVec.size();
103 for(std::size_t i = 0; i < np; ++i)
104 {
105 new G4PVPlacement(nullptr, posVec[i], fMeshElementLogical, logVolName + "_phy",
106 worldLog, false, (G4int)i, chkOverlap);
107 }
108
109 auto wisatt = new G4VisAttributes(G4Colour(.5, .5, .5));
110 wisatt->SetVisibility(false);
111 worldLog->SetVisAttributes(wisatt);
112 auto visatt = new G4VisAttributes(G4Colour(.5, .5, .5));
113 visatt->SetVisibility(true);
115 }
116 else
117 {
118 G4AutoLock l(&logvolmutex);
121 assert(fMeshElementLogical != nullptr);
122 l.unlock();
123 }
124
126}
Definition: G4Box.hh:56
G4LogicalVolume * GetVolume(const G4String &name, G4bool verbose=true, G4bool reverseSearch=false) const
static G4LogicalVolumeStore * GetInstance()
void SetVisAttributes(const G4VisAttributes *pVA)
void SetSensitiveDetector(G4VSensitiveDetector *pSDetector)
G4LogicalVolume * GetLogicalVolume() const
G4MultiFunctionalDetector * fMFD
G4LogicalVolume * fMeshElementLogical

Member Data Documentation

◆ chkOverlap

G4bool G4ScoringProbe::chkOverlap
protected

Definition at line 76 of file G4ScoringProbe.hh.

Referenced by SetupGeometry().

◆ layeredMaterial

G4Material* G4ScoringProbe::layeredMaterial
protected

Definition at line 78 of file G4ScoringProbe.hh.

Referenced by SetMaterial(), and SetupGeometry().

◆ layeredMaterialName

G4String G4ScoringProbe::layeredMaterialName
protected

Definition at line 77 of file G4ScoringProbe.hh.

Referenced by SetMaterial().

◆ logVolName

G4String G4ScoringProbe::logVolName
protected

Definition at line 73 of file G4ScoringProbe.hh.

Referenced by G4ScoringProbe(), List(), and SetupGeometry().

◆ posVec

std::vector<G4ThreeVector> G4ScoringProbe::posVec
protected

Definition at line 74 of file G4ScoringProbe.hh.

Referenced by GetNumberOfProbes(), List(), LocateProbe(), and SetupGeometry().

◆ probeSize

G4double G4ScoringProbe::probeSize
protected

Definition at line 75 of file G4ScoringProbe.hh.

Referenced by G4ScoringProbe(), GetProbeSize(), SetProbeSize(), and SetupGeometry().

◆ regName

G4String G4ScoringProbe::regName
protected

Definition at line 79 of file G4ScoringProbe.hh.

Referenced by G4ScoringProbe(), SetMaterial(), and SetupGeometry().


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