Geant4 11.1.1
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

typedef std::map< G4String, G4intNameNumber
 

Public Member Functions

 G4MoleculeGun ()
 
virtual ~G4MoleculeGun ()
 
virtual void DefineTracks ()
 
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 ()
 
virtual void DefineTracks ()
 

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 128 of file G4MoleculeGun.hh.

Member Typedef Documentation

◆ NameNumber

Definition at line 195 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 ( )
virtual

Definition at line 100 of file G4MoleculeGun.cc.

101{
102 if (fpMessenger) 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{
121 G4shared_ptr<G4MoleculeShoot> shoot(new TG4MoleculeShoot<G4Track>());
122 shoot->fMoleculeName = name;
123 shoot->fPosition = position;
124 shoot->fTime = time;
125 fShoots.push_back(shoot);
126}
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 221 of file G4MoleculeGun.cc.

224{
225 G4shared_ptr<G4MoleculeShoot> shoot(new TG4MoleculeShoot<G4ContinuousMedium>());
226 shoot->fNumber = (G4int)n;
227 shoot->fMoleculeName = moleculeName;
228 shoot->fTime = time;
229 fShoots.push_back(shoot);
230}
int G4int
Definition: G4Types.hh:85

◆ AddMoleculeShoot()

void G4MoleculeGun::AddMoleculeShoot ( G4shared_ptr< G4MoleculeShoot shoot)

Definition at line 216 of file G4MoleculeGun.cc.

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

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{
152 G4shared_ptr<G4MoleculeShoot> shoot(new TG4MoleculeShoot<G4Track>());
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{
135 G4shared_ptr<G4MoleculeShoot> shoot(new TG4MoleculeShoot<G4Track>());
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 G4Molecule* molecule = new G4Molecule(conf);
171
172 PushTrack(molecule->BuildTrack(time, position));
173}
void PushTrack(G4Track *)
Definition: G4ITGun.cc:45
G4MolecularConfiguration * GetConfiguration(const G4String &, bool mustExist=true)
static G4MoleculeTable * Instance()
G4Track * BuildTrack(G4double globalTime, const G4ThreeVector &Position)
Definition: G4Molecule.cc:371

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

◆ DefineTracks()

void G4MoleculeGun::DefineTracks ( )
virtual

Reimplemented from G4ITGun.

Definition at line 107 of file G4MoleculeGun.cc.

108{
109 for (std::size_t i = 0; i < fShoots.size(); i++)
110 {
111 fShoots[i]->Shoot(this);
112 }
113}

◆ GetMoleculeShoot()

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

Definition at line 191 of file G4MoleculeGun.hh.

191 {
192 return fShoots;
193 }

◆ GetNameAndNumber()

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

Definition at line 177 of file G4MoleculeGun.cc.

178{
179 for(std::size_t i = 0 ; i < fShoots.size() ; ++i)
180 {
181 output[fShoots[i]->fMoleculeName]+=fShoots[i]->fNumber;
182 }
183}

Friends And Related Function Documentation

◆ G4MoleculeShoot

friend class G4MoleculeShoot
friend

Definition at line 208 of file G4MoleculeGun.hh.

◆ TG4MoleculeShoot

template<class T >
friend class TG4MoleculeShoot
friend

Definition at line 209 of file G4MoleculeGun.hh.

Member Data Documentation

◆ fpMessenger

G4MoleculeGunMessenger* G4MoleculeGun::fpMessenger
protected

Definition at line 205 of file G4MoleculeGun.hh.

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

◆ fShoots


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