Geant4-11
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Friends
G4MoleculeGun Class Reference

#include <G4MoleculeGun.hh>

Inheritance diagram for G4MoleculeGun:
G4ITGun

Public Types

typedef std::map< G4String, int > NameNumber
 

Public Member Functions

void AddMolecule (const G4String &moleculeName, const G4ThreeVector &position, double time=0)
 
void AddMoleculeInCMRepresentation (size_t n, const G4String &moleculeName, double time=0)
 
void AddMoleculeShoot (G4shared_ptr< G4MoleculeShoot >)
 
void AddMoleculesRandomPositionInBox (size_t n, const G4String &moleculeName, const G4ThreeVector &boxCenter, const G4ThreeVector &boxExtension, double time=0)
 
void AddNMolecules (size_t n, const G4String &moleculeName, const G4ThreeVector &position, double time=0)
 
virtual void DefineTracks ()
 
 G4MoleculeGun ()
 
const std::vector< G4shared_ptr< G4MoleculeShoot > > & GetMoleculeShoot ()
 
void GetNameAndNumber (NameNumber &)
 
virtual ~G4MoleculeGun ()
 

Protected Member Functions

void BuildAndPushTrack (const G4String &name, const G4ThreeVector &position, double time=0)
 
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 126 of file G4MoleculeGun.hh.

Member Typedef Documentation

◆ NameNumber

typedef std::map<G4String, int> G4MoleculeGun::NameNumber

Definition at line 193 of file G4MoleculeGun.hh.

Constructor & Destructor Documentation

◆ G4MoleculeGun()

G4MoleculeGun::G4MoleculeGun ( )

Definition at line 93 of file G4MoleculeGun.cc.

94{
96}
G4MoleculeGunMessenger * fpMessenger

References fpMessenger.

◆ ~G4MoleculeGun()

G4MoleculeGun::~G4MoleculeGun ( )
virtual

Definition at line 100 of file G4MoleculeGun.cc.

101{
102 if (fpMessenger) delete fpMessenger;
103}

References fpMessenger.

Member Function Documentation

◆ AddMolecule()

void G4MoleculeGun::AddMolecule ( const G4String moleculeName,
const G4ThreeVector position,
double  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)
#define position
Definition: xmlparse.cc:622

References fShoots, G4InuclParticleNames::name(), position, and G4INCL::DeJongSpin::shoot().

◆ AddMoleculeInCMRepresentation()

void G4MoleculeGun::AddMoleculeInCMRepresentation ( size_t  n,
const G4String moleculeName,
double  time = 0 
)

Definition at line 221 of file G4MoleculeGun.cc.

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

References fShoots, CLHEP::detail::n, and G4INCL::DeJongSpin::shoot().

◆ AddMoleculeShoot()

void G4MoleculeGun::AddMoleculeShoot ( G4shared_ptr< G4MoleculeShoot shoot)

Definition at line 216 of file G4MoleculeGun.cc.

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

References fShoots, and G4INCL::DeJongSpin::shoot().

Referenced by G4MoleculeGunMessenger::CreateNewType().

◆ AddMoleculesRandomPositionInBox()

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

Definition at line 146 of file G4MoleculeGun.cc.

151{
152 G4shared_ptr<G4MoleculeShoot> shoot(new TG4MoleculeShoot<G4Track>());
153 shoot->fNumber = 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

References fShoots, CLHEP::detail::n, and G4INCL::DeJongSpin::shoot().

◆ AddNMolecules()

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

Definition at line 130 of file G4MoleculeGun.cc.

134{
135 G4shared_ptr<G4MoleculeShoot> shoot(new TG4MoleculeShoot<G4Track>());
136 shoot->fNumber = n;
137 shoot->fMoleculeName = moleculeName;
138 shoot->fPosition = position;
139 shoot->fTime = time;
140 fShoots.push_back(shoot);
141}

References fShoots, CLHEP::detail::n, position, and G4INCL::DeJongSpin::shoot().

◆ BuildAndPushTrack()

void G4MoleculeGun::BuildAndPushTrack ( const G4String name,
const G4ThreeVector position,
double  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:373

References G4Molecule::BuildTrack(), G4MoleculeTable::GetConfiguration(), G4MoleculeTable::Instance(), G4InuclParticleNames::name(), and G4ITGun::PushTrack().

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 (size_t i = 0; i < fShoots.size(); i++)
110 {
111 fShoots[i]->Shoot(this);
112 }
113}

References fShoots.

◆ GetMoleculeShoot()

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

Definition at line 189 of file G4MoleculeGun.hh.

189 {
190 return fShoots;
191 }

References fShoots.

◆ GetNameAndNumber()

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

Definition at line 177 of file G4MoleculeGun.cc.

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

References fShoots.

◆ PushTrack()

void G4ITGun::PushTrack ( G4Track track)
protectedinherited

Definition at line 45 of file G4ITGun.cc.

46{
48}
static G4VITTrackHolder * Instance()
virtual void Push(G4Track *)

References G4VITTrackHolder::Instance(), and G4VITTrackHolder::Push().

Referenced by BuildAndPushTrack().

Friends And Related Function Documentation

◆ G4MoleculeShoot

friend class G4MoleculeShoot
friend

Definition at line 206 of file G4MoleculeGun.hh.

◆ TG4MoleculeShoot

template<class T >
friend class TG4MoleculeShoot
friend

Definition at line 207 of file G4MoleculeGun.hh.

Field Documentation

◆ fpMessenger

G4MoleculeGunMessenger* G4MoleculeGun::fpMessenger
protected

Definition at line 203 of file G4MoleculeGun.hh.

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

◆ fShoots

std::vector<G4shared_ptr<G4MoleculeShoot> > G4MoleculeGun::fShoots
protected

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