Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ParticleChangeForGamma Class Reference

#include <G4ParticleChangeForGamma.hh>

Inheritance diagram for G4ParticleChangeForGamma:
Collaboration diagram for G4ParticleChangeForGamma:

Public Member Functions

 G4ParticleChangeForGamma ()
 
virtual ~G4ParticleChangeForGamma ()
 
G4StepUpdateStepForAtRest (G4Step *pStep)
 
G4StepUpdateStepForPostStep (G4Step *Step)
 
void InitializeForPostStep (const G4Track &)
 
void AddSecondary (G4DynamicParticle *aParticle)
 
G4double GetProposedKineticEnergy () const
 
void SetProposedKineticEnergy (G4double proposedKinEnergy)
 
const G4ThreeVectorGetProposedMomentumDirection () const
 
void ProposeMomentumDirection (G4double Px, G4double Py, G4double Pz)
 
void ProposeMomentumDirection (const G4ThreeVector &Pfinal)
 
const G4ThreeVectorGetProposedPolarization () const
 
void ProposePolarization (const G4ThreeVector &dir)
 
void ProposePolarization (G4double Px, G4double Py, G4double Pz)
 
const G4TrackGetCurrentTrack () const
 
virtual void DumpInfo () const
 
virtual G4bool CheckIt (const G4Track &)
 
- Public Member Functions inherited from G4VParticleChange
 G4VParticleChange ()
 
virtual ~G4VParticleChange ()
 
G4bool operator== (const G4VParticleChange &right) const
 
G4bool operator!= (const G4VParticleChange &right) const
 
virtual G4StepUpdateStepForAlongStep (G4Step *Step)
 
virtual void Initialize (const G4Track &)
 
G4double GetTrueStepLength () const
 
void ProposeTrueStepLength (G4double truePathLength)
 
G4double GetLocalEnergyDeposit () const
 
void ProposeLocalEnergyDeposit (G4double anEnergyPart)
 
G4double GetNonIonizingEnergyDeposit () const
 
void ProposeNonIonizingEnergyDeposit (G4double anEnergyPart)
 
G4TrackStatus GetTrackStatus () const
 
void ProposeTrackStatus (G4TrackStatus status)
 
G4SteppingControl GetSteppingControl () const
 
void ProposeSteppingControl (G4SteppingControl StepControlFlag)
 
G4bool GetFirstStepInVolume () const
 
G4bool GetLastStepInVolume () const
 
void ProposeFirstStepInVolume (G4bool flag)
 
void ProposeLastStepInVolume (G4bool flag)
 
void Clear ()
 
void SetNumberOfSecondaries (G4int totSecondaries)
 
G4int GetNumberOfSecondaries () const
 
G4TrackGetSecondary (G4int anIndex) const
 
void AddSecondary (G4Track *aSecondary)
 
G4double GetWeight () const
 
G4double GetParentWeight () const
 
void ProposeWeight (G4double finalWeight)
 
void ProposeParentWeight (G4double finalWeight)
 
void SetSecondaryWeightByProcess (G4bool)
 
G4bool IsSecondaryWeightSetByProcess () const
 
void SetParentWeightByProcess (G4bool)
 
G4bool IsParentWeightSetByProcess () const
 
void SetVerboseLevel (G4int vLevel)
 
G4int GetVerboseLevel () const
 
void ClearDebugFlag ()
 
void SetDebugFlag ()
 
G4bool GetDebugFlag () const
 

Protected Member Functions

 G4ParticleChangeForGamma (const G4ParticleChangeForGamma &right)
 
G4ParticleChangeForGammaoperator= (const G4ParticleChangeForGamma &right)
 
- Protected Member Functions inherited from G4VParticleChange
 G4VParticleChange (const G4VParticleChange &right)
 
G4VParticleChangeoperator= (const G4VParticleChange &right)
 
G4StepUpdateStepInfo (G4Step *Step)
 
void InitializeTrueStepLength (const G4Track &)
 
void InitializeLocalEnergyDeposit (const G4Track &)
 
void InitializeSteppingControl (const G4Track &)
 
void InitializeParentWeight (const G4Track &)
 
void InitializeParentGlobalTime (const G4Track &)
 
void InitializeStatusChange (const G4Track &)
 
void InitializeSecondaries (const G4Track &)
 
void InitializeStepInVolumeFlags (const G4Track &)
 
G4bool CheckSecondary (G4Track &)
 
G4double GetAccuracyForWarning () const
 
G4double GetAccuracyForException () const
 

Additional Inherited Members

- Protected Attributes inherited from G4VParticleChange
G4TrackFastVectortheListOfSecondaries
 
G4int theNumberOfSecondaries
 
G4int theSizeOftheListOfSecondaries
 
G4TrackStatus theStatusChange
 
G4SteppingControl theSteppingControlFlag
 
G4double theLocalEnergyDeposit
 
G4double theNonIonizingEnergyDeposit
 
G4double theTrueStepLength
 
G4bool theFirstStepInVolume
 
G4bool theLastStepInVolume
 
G4double theParentWeight
 
G4bool isParentWeightProposed
 
G4bool fSetSecondaryWeightByProcess
 
G4double theParentGlobalTime
 
G4int verboseLevel
 
G4bool debugFlag
 
- Static Protected Attributes inherited from G4VParticleChange
static const G4double accuracyForWarning = 1.0e-9
 
static const G4double accuracyForException = 0.001
 

Detailed Description

Definition at line 58 of file G4ParticleChangeForGamma.hh.

Constructor & Destructor Documentation

G4ParticleChangeForGamma::G4ParticleChangeForGamma ( )

Definition at line 49 of file G4ParticleChangeForGamma.cc.

50  : G4VParticleChange(), currentTrack(0), proposedKinEnergy(0.)
51 {
53  debugFlag = false;
54 #ifdef G4VERBOSE
55  if (verboseLevel>2) {
56  G4cout << "G4ParticleChangeForGamma::G4ParticleChangeForGamma() " << G4endl;
57  }
58 #endif
59 }
G4GLOB_DLL std::ostream G4cout
G4SteppingControl theSteppingControlFlag
#define G4endl
Definition: G4ios.hh:61
G4ParticleChangeForGamma::~G4ParticleChangeForGamma ( )
virtual

Definition at line 61 of file G4ParticleChangeForGamma.cc.

62 {
63 #ifdef G4VERBOSE
64  if (verboseLevel>2) {
65  G4cout << "G4ParticleChangeForGamma::~G4ParticleChangeForGamma() " << G4endl;
66  }
67 #endif
68 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4ParticleChangeForGamma::G4ParticleChangeForGamma ( const G4ParticleChangeForGamma right)
protected

Definition at line 70 of file G4ParticleChangeForGamma.cc.

71  : G4VParticleChange(right)
72 {
73  if (verboseLevel>1)
74  G4cout << "G4ParticleChangeForGamma:: copy constructor is called " << G4endl;
75 
76  currentTrack = right.currentTrack;
77  proposedKinEnergy = right.proposedKinEnergy;
78  proposedMomentumDirection = right.proposedMomentumDirection;
79  proposedPolarization = right.proposedPolarization;
80 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Member Function Documentation

void G4ParticleChangeForGamma::AddSecondary ( G4DynamicParticle aParticle)

Definition at line 123 of file G4ParticleChangeForGamma.cc.

124 {
125  // create track
126  G4Track* aTrack = new G4Track(aParticle, currentTrack->GetGlobalTime(),
127  currentTrack->GetPosition());
128 
129  // Touchable handle is copied to keep the pointer
130  aTrack->SetTouchableHandle(currentTrack->GetTouchableHandle());
131 
132  // add a secondary
134 }
const G4ThreeVector & GetPosition() const
void SetTouchableHandle(const G4TouchableHandle &apValue)
G4double GetGlobalTime() const
void AddSecondary(G4Track *aSecondary)
const G4TouchableHandle & GetTouchableHandle() const

Here is the call graph for this function:

G4bool G4ParticleChangeForGamma::CheckIt ( const G4Track aTrack)
virtual

Reimplemented from G4VParticleChange.

Definition at line 199 of file G4ParticleChangeForGamma.cc.

200 {
201  G4bool itsOK = true;
202  G4bool exitWithError = false;
203 
204  G4double accuracy;
205 
206  // Energy should not be lager than initial value
207  accuracy = ( proposedKinEnergy - aTrack.GetKineticEnergy())/MeV;
208  if (accuracy > accuracyForWarning) {
209  itsOK = false;
210  exitWithError = (accuracy > accuracyForException);
211 #ifdef G4VERBOSE
212  G4cout << "G4ParticleChangeForGamma::CheckIt: ";
213  G4cout << "KinEnergy become larger than the initial value!"
214  << " Difference: " << accuracy << "[MeV] " <<G4endl;
215  G4cout << aTrack.GetDefinition()->GetParticleName()
216  << " E=" << aTrack.GetKineticEnergy()/MeV
217  << " pos=" << aTrack.GetPosition().x()/m
218  << ", " << aTrack.GetPosition().y()/m
219  << ", " << aTrack.GetPosition().z()/m
220  << G4endl;
221 #endif
222  }
223 
224  // dump out information of this particle change
225 #ifdef G4VERBOSE
226  if (!itsOK) DumpInfo();
227 #endif
228 
229  // Exit with error
230  if (exitWithError) {
231  G4Exception("G4ParticleChangeForGamma::CheckIt",
232  "TRACK004",EventMustBeAborted,
233  "energy was illegal");
234  }
235 
236  //correction
237  if (!itsOK) {
238  proposedKinEnergy = aTrack.GetKineticEnergy();
239  }
240 
241  itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
242  return itsOK;
243 }
G4ParticleDefinition * GetDefinition() const
double x() const
const G4ThreeVector & GetPosition() const
const G4String & GetParticleName() const
double z() const
static const G4double accuracyForException
virtual G4bool CheckIt(const G4Track &)
G4double GetKineticEnergy() const
G4GLOB_DLL std::ostream G4cout
static constexpr double m
Definition: G4SIunits.hh:129
bool G4bool
Definition: G4Types.hh:79
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
double y() const
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214
double G4double
Definition: G4Types.hh:76
static const G4double accuracyForWarning

Here is the call graph for this function:

void G4ParticleChangeForGamma::DumpInfo ( ) const
virtual

Reimplemented from G4VParticleChange.

Definition at line 181 of file G4ParticleChangeForGamma.cc.

182 {
183 // use base-class DumpInfo
185 
186  G4int oldprc = G4cout.precision(3);
187  G4cout << " Kinetic Energy (MeV): "
188  << std::setw(20) << proposedKinEnergy/MeV
189  << G4endl;
190  G4cout << " Momentum Direction: "
191  << std::setw(20) << proposedMomentumDirection
192  << G4endl;
193  G4cout << " Polarization: "
194  << std::setw(20) << proposedPolarization
195  << G4endl;
196  G4cout.precision(oldprc);
197 }
virtual void DumpInfo() const
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
static constexpr double MeV
Definition: G4SIunits.hh:214

Here is the call graph for this function:

Here is the caller graph for this function:

const G4Track * G4ParticleChangeForGamma::GetCurrentTrack ( ) const
inline

Definition at line 154 of file G4ParticleChangeForGamma.hh.

155 {
156  return currentTrack;
157 }

Here is the caller graph for this function:

G4double G4ParticleChangeForGamma::GetProposedKineticEnergy ( ) const
inline

Definition at line 124 of file G4ParticleChangeForGamma.hh.

125 {
126  return proposedKinEnergy;
127 }

Here is the caller graph for this function:

const G4ThreeVector & G4ParticleChangeForGamma::GetProposedMomentumDirection ( ) const
inline

Definition at line 135 of file G4ParticleChangeForGamma.hh.

136 {
137  return proposedMomentumDirection;
138 }

Here is the caller graph for this function:

const G4ThreeVector & G4ParticleChangeForGamma::GetProposedPolarization ( ) const
inline

Definition at line 160 of file G4ParticleChangeForGamma.hh.

161 {
162  return proposedPolarization;
163 }
void G4ParticleChangeForGamma::InitializeForPostStep ( const G4Track track)
inline

Definition at line 179 of file G4ParticleChangeForGamma.hh.

180 {
182  theLocalEnergyDeposit = 0.0;
184  InitializeSecondaries(track);
185  theParentWeight = track.GetWeight();
186  isParentWeightProposed = false;
187  proposedKinEnergy = track.GetKineticEnergy();
188  proposedMomentumDirection = track.GetMomentumDirection();
189  proposedPolarization = track.GetPolarization();
190  currentTrack = &track;
191 }
const G4ThreeVector & GetPolarization() const
G4TrackStatus GetTrackStatus() const
G4double GetKineticEnergy() const
void InitializeSecondaries(const G4Track &)
const G4ThreeVector & GetMomentumDirection() const
G4double GetWeight() const
G4TrackStatus theStatusChange
G4double theNonIonizingEnergyDeposit

Here is the call graph for this function:

Here is the caller graph for this function:

G4ParticleChangeForGamma & G4ParticleChangeForGamma::operator= ( const G4ParticleChangeForGamma right)
protected

Definition at line 83 of file G4ParticleChangeForGamma.cc.

85 {
86 #ifdef G4VERBOSE
87  if (verboseLevel>1)
88  G4cout << "G4ParticleChangeForGamma:: assignment operator is called " << G4endl;
89 #endif
90 
91  if (this != &right) {
92  if (theNumberOfSecondaries>0) {
93 #ifdef G4VERBOSE
94  if (verboseLevel>0) {
95  G4cout << "G4ParticleChangeForGamma: assignment operator Warning ";
96  G4cout << "theListOfSecondaries is not empty ";
97  }
98 #endif
99  for (G4int index= 0; index<theNumberOfSecondaries; index++){
100  if ( (*theListOfSecondaries)[index] ) delete (*theListOfSecondaries)[index] ;
101  }
102  }
103  delete theListOfSecondaries;
105  theNumberOfSecondaries = right.theNumberOfSecondaries;
106  for (G4int index = 0; index<theNumberOfSecondaries; index++){
107  G4Track* newTrack = new G4Track(*((*right.theListOfSecondaries)[index] ));
108  theListOfSecondaries->SetElement(index, newTrack); }
109 
114 
115  currentTrack = right.currentTrack;
116  proposedKinEnergy = right.proposedKinEnergy;
117  proposedMomentumDirection = right.proposedMomentumDirection;
118  proposedPolarization = right.proposedPolarization;
119  }
120  return *this;
121 }
void SetElement(G4int anIndex, Type *anElement)
Definition: G4FastVector.hh:76
G4TrackFastVector * theListOfSecondaries
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
G4SteppingControl theSteppingControlFlag
G4FastVector< G4Track, G4TrackFastVectorSize > G4TrackFastVector
#define G4endl
Definition: G4ios.hh:61
G4TrackStatus theStatusChange

Here is the call graph for this function:

void G4ParticleChangeForGamma::ProposeMomentumDirection ( G4double  Px,
G4double  Py,
G4double  Pz 
)
inline

Definition at line 147 of file G4ParticleChangeForGamma.hh.

148 {
149  proposedMomentumDirection.setX(Px);
150  proposedMomentumDirection.setY(Py);
151  proposedMomentumDirection.setZ(Pz);
152 }
void setY(double)
void setZ(double)
void setX(double)

Here is the call graph for this function:

Here is the caller graph for this function:

void G4ParticleChangeForGamma::ProposeMomentumDirection ( const G4ThreeVector Pfinal)
inline

Definition at line 141 of file G4ParticleChangeForGamma.hh.

142 {
143  proposedMomentumDirection = dir;
144 }
void G4ParticleChangeForGamma::ProposePolarization ( const G4ThreeVector dir)
inline

Definition at line 166 of file G4ParticleChangeForGamma.hh.

167 {
168  proposedPolarization = dir;
169 }

Here is the caller graph for this function:

void G4ParticleChangeForGamma::ProposePolarization ( G4double  Px,
G4double  Py,
G4double  Pz 
)
inline

Definition at line 172 of file G4ParticleChangeForGamma.hh.

173 {
174  proposedPolarization.setX(Px);
175  proposedPolarization.setY(Py);
176  proposedPolarization.setZ(Pz);
177 }
void setY(double)
void setZ(double)
void setX(double)

Here is the call graph for this function:

void G4ParticleChangeForGamma::SetProposedKineticEnergy ( G4double  proposedKinEnergy)
inline

Definition at line 129 of file G4ParticleChangeForGamma.hh.

130 {
131  proposedKinEnergy = energy;
132 }
G4double energy(const ThreeVector &p, const G4double m)

Here is the call graph for this function:

G4Step * G4ParticleChangeForGamma::UpdateStepForAtRest ( G4Step pStep)
virtual

Reimplemented from G4VParticleChange.

Definition at line 140 of file G4ParticleChangeForGamma.cc.

141 {
143  pStep->SetStepLength( 0.0 );
144 
147  }
148 
149  return pStep;
150 }
void SetStepLength(G4double value)
void SetWeight(G4double aValue)
G4StepPoint * GetPostStepPoint() const
void AddTotalEnergyDeposit(G4double value)

Here is the call graph for this function:

G4Step * G4ParticleChangeForGamma::UpdateStepForPostStep ( G4Step Step)
virtual

Reimplemented from G4VParticleChange.

Definition at line 152 of file G4ParticleChangeForGamma.cc.

153 {
154  G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
155  G4Track* pTrack = pStep->GetTrack();
156 
157  pPostStepPoint->SetKineticEnergy( proposedKinEnergy );
158  pPostStepPoint->SetMomentumDirection( proposedMomentumDirection );
159  pPostStepPoint->SetPolarization( proposedPolarization );
160 
161  // update velocity for scattering process and particles with mass
162  if(proposedKinEnergy > 0.0) {
163  if(pTrack->GetParticleDefinition()->GetPDGMass() > 0.0) {
164  pPostStepPoint->SetVelocity(pTrack->CalculateVelocity());
165  }
166  }
167 
169  pPostStepPoint->SetWeight( theParentWeight );
170  }
171 
172  pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
173  pStep->AddNonIonizingEnergyDeposit( theNonIonizingEnergyDeposit );
174  return pStep;
175 }
void SetWeight(G4double aValue)
void SetMomentumDirection(const G4ThreeVector &aValue)
void SetPolarization(const G4ThreeVector &aValue)
const G4ParticleDefinition * GetParticleDefinition() const
G4double CalculateVelocity() const
Definition: G4Track.cc:222
G4double GetPDGMass() const
void SetVelocity(G4double v)
void SetKineticEnergy(const G4double aValue)
G4double theNonIonizingEnergyDeposit

Here is the call graph for this function:


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