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

#include <G4MoleculeGun.hh>

+ Inheritance diagram for G4MoleculeGun:

Public Types

using NameNumber = std::map<G4String, G4int>
 

Public Member Functions

 G4MoleculeGun ()
 
 ~G4MoleculeGun () override
 
void DefineTracks () override
 
void AddMolecule (const G4String &moleculeName, const G4ThreeVector &position, G4double time=0)
 
void AddNMolecules (std::size_t n, const G4String &moleculeName, const G4ThreeVector &position, G4double time=0)
 
void AddMoleculesRandomPositionInBox (std::size_t n, const G4String &moleculeName, const G4ThreeVector &boxCenter, const G4ThreeVector &boxExtension, G4double time=0)
 
void AddMoleculeInCMRepresentation (std::size_t n, const G4String &moleculeName, G4double time=0)
 
const std::vector< G4shared_ptr< G4MoleculeShoot > > & GetMoleculeShoot ()
 
void GetNameAndNumber (NameNumber &)
 
void AddMoleculeShoot (G4shared_ptr< G4MoleculeShoot >)
 
- Public Member Functions inherited from G4ITGun
 G4ITGun ()
 
virtual ~G4ITGun ()
 

Protected Member Functions

void BuildAndPushTrack (const G4String &name, const G4ThreeVector &position, G4double time=0)
 
- Protected Member Functions inherited from G4ITGun
void PushTrack (G4Track *)
 

Protected Attributes

G4MoleculeGunMessengerfpMessenger
 
std::vector< G4shared_ptr< G4MoleculeShoot > > fShoots
 

Friends

class G4MoleculeShoot
 
template<class T >
class TG4MoleculeShoot
 

Detailed Description

Definition at line 137 of file G4MoleculeGun.hh.

Member Typedef Documentation

◆ NameNumber

Definition at line 204 of file G4MoleculeGun.hh.

Constructor & Destructor Documentation

◆ G4MoleculeGun()

G4MoleculeGun::G4MoleculeGun ( )

Definition at line 93 of file G4MoleculeGun.cc.

94{
96}
G4MoleculeGunMessenger * fpMessenger

◆ ~G4MoleculeGun()

G4MoleculeGun::~G4MoleculeGun ( )
override

Definition at line 100 of file G4MoleculeGun.cc.

101{
102 delete fpMessenger;
103}

Member Function Documentation

◆ AddMolecule()

void G4MoleculeGun::AddMolecule ( const G4String & moleculeName,
const G4ThreeVector & position,
G4double time = 0 )

Definition at line 117 of file G4MoleculeGun.cc.

120{
122 shoot->fMoleculeName = name;
123 shoot->fPosition = position;
124 shoot->fTime = time;
125 fShoots.push_back(shoot);
126}
#define G4shared_ptr
Definition G4memory.hh:32
std::vector< G4shared_ptr< G4MoleculeShoot > > fShoots
ThreeVector shoot(const G4int Ap, const G4int Af)
const char * name(G4int ptype)

◆ AddMoleculeInCMRepresentation()

void G4MoleculeGun::AddMoleculeInCMRepresentation ( std::size_t n,
const G4String & moleculeName,
G4double time = 0 )

Definition at line 220 of file G4MoleculeGun.cc.

223{
225 shoot->fNumber = (G4int)n;
226 shoot->fMoleculeName = moleculeName;
227 shoot->fTime = time;
228 fShoots.push_back(shoot);
229}
int G4int
Definition G4Types.hh:85

◆ AddMoleculeShoot()

void G4MoleculeGun::AddMoleculeShoot ( G4shared_ptr< G4MoleculeShoot > shoot)

Definition at line 215 of file G4MoleculeGun.cc.

216{
217 fShoots.push_back(shoot);
218}

Referenced by G4MoleculeGunMessenger::CreateNewType().

◆ AddMoleculesRandomPositionInBox()

void G4MoleculeGun::AddMoleculesRandomPositionInBox ( std::size_t n,
const G4String & moleculeName,
const G4ThreeVector & boxCenter,
const G4ThreeVector & boxExtension,
G4double time = 0 )

Definition at line 146 of file G4MoleculeGun.cc.

151{
153 shoot->fNumber = (G4int)n;
154 shoot->fMoleculeName = moleculeName;
155 shoot->fPosition = boxCenter;
156 shoot->fBoxSize = new G4ThreeVector(boxSize);
157 shoot->fTime = time;
158 fShoots.push_back(shoot);
159}
CLHEP::Hep3Vector G4ThreeVector

◆ AddNMolecules()

void G4MoleculeGun::AddNMolecules ( std::size_t n,
const G4String & moleculeName,
const G4ThreeVector & position,
G4double time = 0 )

Definition at line 130 of file G4MoleculeGun.cc.

134{
136 shoot->fNumber = (G4int)n;
137 shoot->fMoleculeName = moleculeName;
138 shoot->fPosition = position;
139 shoot->fTime = time;
140 fShoots.push_back(shoot);
141}

◆ BuildAndPushTrack()

void G4MoleculeGun::BuildAndPushTrack ( const G4String & name,
const G4ThreeVector & position,
G4double time = 0 )
protected

Definition at line 163 of file G4MoleculeGun.cc.

166{
169 assert(conf != 0);
170 auto molecule = new G4Molecule(conf);
171
172 PushTrack(molecule->BuildTrack(time, position));
173}
void PushTrack(G4Track *)
Definition G4ITGun.cc:40
G4MolecularConfiguration * GetConfiguration(const G4String &, bool mustExist=true)
static G4MoleculeTable * Instance()

Referenced by TG4MoleculeShoot< TYPE >::ShootAtFixedPosition(), and TG4MoleculeShoot< TYPE >::ShootAtRandomPosition().

◆ DefineTracks()

void G4MoleculeGun::DefineTracks ( )
overridevirtual

Reimplemented from G4ITGun.

Definition at line 107 of file G4MoleculeGun.cc.

108{
109 for (const auto & fShoot : fShoots)
110 {
111 fShoot->Shoot(this);
112 }
113}

◆ GetMoleculeShoot()

const std::vector< G4shared_ptr< G4MoleculeShoot > > & G4MoleculeGun::GetMoleculeShoot ( )
inline

Definition at line 200 of file G4MoleculeGun.hh.

200 {
201 return fShoots;
202 }

◆ GetNameAndNumber()

void G4MoleculeGun::GetNameAndNumber ( G4MoleculeGun::NameNumber & output)

Definition at line 177 of file G4MoleculeGun.cc.

178{
179 for(const auto & fShoot : fShoots)
180 {
181 output[fShoot->fMoleculeName]+=fShoot->fNumber;
182 }
183}

Friends And Related Symbol Documentation

◆ G4MoleculeShoot

friend class G4MoleculeShoot
friend

Definition at line 217 of file G4MoleculeGun.hh.

◆ TG4MoleculeShoot

template<class T >
friend class TG4MoleculeShoot
friend

Definition at line 218 of file G4MoleculeGun.hh.

Member Data Documentation

◆ fpMessenger

G4MoleculeGunMessenger* G4MoleculeGun::fpMessenger
protected

Definition at line 214 of file G4MoleculeGun.hh.

Referenced by G4MoleculeGun(), and ~G4MoleculeGun().

◆ fShoots


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