Geant4 10.7.0
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 ()
 
void LocateProbe (G4ThreeVector pos)
 
G4int GetNumberOfProbes () const
 
void SetProbeSize (G4double val)
 
G4double GetProbeSize () const
 
G4bool SetMaterial (G4String val)
 
virtual void List () const
 
virtual void Draw (RunScore *, G4VScoreColorMap *, G4int)
 
virtual void DrawColumn (RunScore *, G4VScoreColorMap *, G4int, G4int)
 
- Public Member Functions inherited from G4VScoringMesh
 G4VScoringMesh (const G4String &wName)
 
virtual ~G4VScoringMesh ()
 
void Construct (G4VPhysicalVolume *fWorldPhys)
 
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 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

virtual void SetupGeometry (G4VPhysicalVolume *)
 
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]
 
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 37 of file G4ScoringProbe.hh.

Constructor & Destructor Documentation

◆ G4ScoringProbe()

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

Definition at line 50 of file G4ScoringProbe.cc.

51 :G4VScoringMesh(lvName), chkOverlap(checkOverlap),
52 layeredMaterialName("none"), layeredMaterial(nullptr)
53{
55 logVolName = lvName;
56 probeSize = half_size;
57 G4double hs[] = {half_size,half_size,half_size};
58 SetSize(hs);
59 G4int nBin[] = {1,1,1};
61 regName = lvName + "_region";
63 { new G4Region(regName); }
64}
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 ( )

Definition at line 66 of file G4ScoringProbe.cc.

67{
68}

Member Function Documentation

◆ Draw()

virtual void G4ScoringProbe::Draw ( RunScore ,
G4VScoreColorMap ,
G4int   
)
inlinevirtual

Implements G4VScoringMesh.

Definition at line 76 of file G4ScoringProbe.hh.

77 {;}

◆ DrawColumn()

virtual void G4ScoringProbe::DrawColumn ( RunScore ,
G4VScoreColorMap ,
G4int  ,
G4int   
)
inlinevirtual

Implements G4VScoringMesh.

Definition at line 78 of file G4ScoringProbe.hh.

80 {;}

◆ GetNumberOfProbes()

G4int G4ScoringProbe::GetNumberOfProbes ( ) const
inline

Definition at line 63 of file G4ScoringProbe.hh.

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

◆ GetProbeSize()

G4double G4ScoringProbe::GetProbeSize ( ) const
inline

Definition at line 67 of file G4ScoringProbe.hh.

68 { return probeSize; }

◆ List()

void G4ScoringProbe::List ( ) const
virtual

Reimplemented from G4VScoringMesh.

Definition at line 70 of file G4ScoringProbe.cc.

71{
72 G4cout << "G4ScoringProbe : " << logVolName << G4endl;
73 G4int np = posVec.size();
74 for(G4int i=0;i<np;i++)
75 { G4cout << " >> probe #" << i << " at " << posVec[i] << G4endl; }
77}
#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 57 of file G4ScoringProbe.hh.

58 {
59 posVec.push_back(pos);
60 G4int nbin[] = {static_cast<G4int>(posVec.size()),1,1};
62 }

◆ SetMaterial()

G4bool G4ScoringProbe::SetMaterial ( G4String  val)

Definition at line 118 of file G4ScoringProbe.cc.

119{
120 G4AutoLock l(&logvolmutex);
121 if(val == "none")
122 {
124 layeredMassFlg = false;
125 layeredMaterial = nullptr;
126 }
127 else
128 {
130 if(!mat)
131 { return false; }
133 layeredMassFlg = true;
134 layeredMaterial = mat;
135 }
137 assert(region!=nullptr);
138 region->UpdateMaterialList();
139 return true;
140}
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 65 of file G4ScoringProbe.hh.

66 { probeSize = val; }

◆ SetupGeometry()

void G4ScoringProbe::SetupGeometry ( G4VPhysicalVolume worldPhys)
protectedvirtual

Implements G4VScoringMesh.

Definition at line 82 of file G4ScoringProbe.cc.

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

Member Data Documentation

◆ chkOverlap

G4bool G4ScoringProbe::chkOverlap
protected

Definition at line 51 of file G4ScoringProbe.hh.

Referenced by SetupGeometry().

◆ layeredMaterial

G4Material* G4ScoringProbe::layeredMaterial
protected

Definition at line 53 of file G4ScoringProbe.hh.

Referenced by SetMaterial(), and SetupGeometry().

◆ layeredMaterialName

G4String G4ScoringProbe::layeredMaterialName
protected

Definition at line 52 of file G4ScoringProbe.hh.

Referenced by SetMaterial().

◆ logVolName

G4String G4ScoringProbe::logVolName
protected

Definition at line 48 of file G4ScoringProbe.hh.

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

◆ posVec

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

Definition at line 49 of file G4ScoringProbe.hh.

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

◆ probeSize

G4double G4ScoringProbe::probeSize
protected

Definition at line 50 of file G4ScoringProbe.hh.

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

◆ regName

G4String G4ScoringProbe::regName
protected

Definition at line 54 of file G4ScoringProbe.hh.

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


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