Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CML2PrimaryGenerationAction Class Reference

#include <ML2PrimaryGenerationAction.hh>

Inheritance diagram for CML2PrimaryGenerationAction:
Collaboration diagram for CML2PrimaryGenerationAction:

Public Member Functions

 CML2PrimaryGenerationAction (void)
 
 ~CML2PrimaryGenerationAction (void)
 
void design (G4double accTargetZPosition)
 
void GeneratePrimaries (G4Event *anEvent)
 
void inizialize (SPrimaryParticle *primaryParticleData)
 
void setNRecycling (G4int val)
 
void setNLoopsPhSpParticles (G4int val)
 
void setNMaxParticlesInRamPhaseSpace (G4int val)
 
void setGunMeanEnergy (G4double val)
 
void setGunStdEnergy (G4double val)
 
void setGunRadious (G4double val)
 
void setCalculatedPhaseSpaceFileIN (G4String val)
 
void setSourceTypeName (G4String val)
 
void setRotation (G4RotationMatrix *val)
 
G4int getNrecycling ()
 
G4int getSourceTypeName ()
 
- Public Member Functions inherited from G4VUserPrimaryGeneratorAction
 G4VUserPrimaryGeneratorAction ()
 
virtual ~G4VUserPrimaryGeneratorAction ()
 

Static Public Member Functions

static
CML2PrimaryGenerationAction
GetInstance (void)
 

Detailed Description

Definition at line 65 of file ML2PrimaryGenerationAction.hh.

Constructor & Destructor Documentation

CML2PrimaryGenerationAction::CML2PrimaryGenerationAction ( void  )

Definition at line 47 of file ML2PrimaryGenerationAction.cc.

48 :particleGun(0),gamma(0),electron(0),positron(0),primaryParticleData(0),particles(0)
49 {
50 }

Here is the caller graph for this function:

CML2PrimaryGenerationAction::~CML2PrimaryGenerationAction ( void  )

Definition at line 108 of file ML2PrimaryGenerationAction.cc.

109 {
110  delete particleGun;
111  delete [] particles;
112  delete particles;
113 }

Member Function Documentation

void CML2PrimaryGenerationAction::design ( G4double  accTargetZPosition)

Definition at line 80 of file ML2PrimaryGenerationAction.cc.

81 {
82  accTargetZPosition=aTZ;
83  switch (idParticleSource)
84  {
85  case id_randomTarget:
86  setGunRandom();
87  break;
88  case id_phaseSpace:
89  setGunCalculatedPhaseSpace();
90  break;
91  }
92 }
idParticleSource

Here is the caller graph for this function:

void CML2PrimaryGenerationAction::GeneratePrimaries ( G4Event anEvent)
virtual

Implements G4VUserPrimaryGeneratorAction.

Definition at line 114 of file ML2PrimaryGenerationAction.cc.

115 {
116  static int currentRecycle=nRecycling;
117  static G4ThreeVector pos0, dir0;
118  if (currentRecycle==nRecycling)
119  {
120  currentRecycle=0;
121  switch (idCurrentParticleSource)
122  {
123  case id_randomTarget:
124  GenerateFromRandom();
125  break;
126  case id_phaseSpace:
127  GenerateFromCalculatedPhaseSpace();
128  break;
129  }
130  pos0=pos;
131  dir0=dir;
132  }
133  currentRecycle++;
134  pos=pos0;
135  dir=dir0;
136  applySourceRotation(); // to follow the accelerator rotation
137 
138  primaryParticleData->partPDGE=particleGun->GetParticleDefinition()->GetPDGEncoding();
139  primaryParticleData->nPrimaryParticle++;
140 
141  particleGun->SetParticleEnergy(ek*MeV);
142  particleGun->SetParticlePosition(pos*mm);
144  particleGun->GeneratePrimaryVertex(anEvent);
145 }
static constexpr double mm
Definition: G4SIunits.hh:115
void SetParticleMomentumDirection(G4ParticleMomentum aMomentumDirection)
virtual void GeneratePrimaryVertex(G4Event *evt)
void SetParticlePosition(G4ThreeVector aPosition)
G4double ek
void SetParticleEnergy(G4double aKineticEnergy)
G4ParticleDefinition * GetParticleDefinition() const
static constexpr double MeV
Definition: G4SIunits.hh:214
static const G4double pos

Here is the call graph for this function:

CML2PrimaryGenerationAction * CML2PrimaryGenerationAction::GetInstance ( void  )
static

Definition at line 53 of file ML2PrimaryGenerationAction.cc.

54 {
55  if (instance == 0)
56  {
58  }
59  return instance;
60 }
static MCTruthManager * instance

Here is the call graph for this function:

Here is the caller graph for this function:

G4int CML2PrimaryGenerationAction::getNrecycling ( )
inline

Definition at line 96 of file ML2PrimaryGenerationAction.hh.

96 {return nRecycling;};

Here is the caller graph for this function:

G4int CML2PrimaryGenerationAction::getSourceTypeName ( )
inline

Definition at line 97 of file ML2PrimaryGenerationAction.hh.

97 {return idParticleSource;};
idParticleSource
void CML2PrimaryGenerationAction::inizialize ( SPrimaryParticle primaryParticleData)

Definition at line 61 of file ML2PrimaryGenerationAction.cc.

62 {
63  rm=new G4RotationMatrix();
64  PrimaryGenerationActionMessenger=new CML2PrimaryGenerationActionMessenger(this);
65  particle=new Sparticle;
66  nParticle=nPhSpParticles=nRandomParticles=0;
67 
69 
70  gamma=particleTable->FindParticle("gamma");
71  electron=particleTable->FindParticle("e-");
72  positron=particleTable->FindParticle("e+");
73  particleGun=new G4ParticleGun();
74 
75  primaryParticleData=pData;
76  primaryParticleData->nPrimaryParticle=0;
77  primaryParticleData->partPDGE=0;
78 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
CLHEP::HepRotation G4RotationMatrix
static G4ParticleTable * GetParticleTable()

Here is the call graph for this function:

Here is the caller graph for this function:

void CML2PrimaryGenerationAction::setCalculatedPhaseSpaceFileIN ( G4String  val)
inline

Definition at line 82 of file ML2PrimaryGenerationAction.hh.

82 {calculatedPhaseSpaceFileIN=val;}

Here is the caller graph for this function:

void CML2PrimaryGenerationAction::setGunMeanEnergy ( G4double  val)
inline

Definition at line 79 of file ML2PrimaryGenerationAction.hh.

79 {GunMeanEnegy=val;}

Here is the caller graph for this function:

void CML2PrimaryGenerationAction::setGunRadious ( G4double  val)
inline

Definition at line 81 of file ML2PrimaryGenerationAction.hh.

81 {GunRadious=val;}

Here is the caller graph for this function:

void CML2PrimaryGenerationAction::setGunStdEnergy ( G4double  val)
inline

Definition at line 80 of file ML2PrimaryGenerationAction.hh.

80 {GunStdEnegy=val;}

Here is the caller graph for this function:

void CML2PrimaryGenerationAction::setNLoopsPhSpParticles ( G4int  val)
inline

Definition at line 76 of file ML2PrimaryGenerationAction.hh.

76 {nLoopsPhSpParticles=val;}
void CML2PrimaryGenerationAction::setNMaxParticlesInRamPhaseSpace ( G4int  val)
inline

Definition at line 77 of file ML2PrimaryGenerationAction.hh.

77 {nMaxParticlesInRamPhaseSpace=val;std::cout<<"Current nMaxParticlesInRamPhaseSpace: " << nMaxParticlesInRamPhaseSpace<< G4endl;}
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

void CML2PrimaryGenerationAction::setNRecycling ( G4int  val)
inline

Definition at line 75 of file ML2PrimaryGenerationAction.hh.

75 {nRecycling=val;}

Here is the caller graph for this function:

void CML2PrimaryGenerationAction::setRotation ( G4RotationMatrix val)
inline

Definition at line 95 of file ML2PrimaryGenerationAction.hh.

95 {rm=val;};

Here is the caller graph for this function:

void CML2PrimaryGenerationAction::setSourceTypeName ( G4String  val)
inline

Definition at line 83 of file ML2PrimaryGenerationAction.hh.

84  {
85  sourceTypeName=val;
86  if (sourceTypeName=="randomTarget")
87  {
89  }
90  else if (sourceTypeName=="phaseSpace")
91  {
93  }
94  }
idParticleSource

Here is the caller graph for this function:


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