Import Geant4 7.1.0 source tree
This commit is contained in:
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChange.cc,v 1.27 2004/12/02 06:38:02 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChangeForDecay.cc,v 1.10 2004/09/21 21:32:32 gum Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChangeForGamma.cc,v 1.1 2005/04/14 18:00:15 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
// 15 April 2005 V.Ivanchenko for gamma EM processes
|
||||
// --------------------------------------------------------------
|
||||
//
|
||||
// Modified:
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
//
|
||||
#include "G4ParticleChangeForGamma.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4DynamicParticle.hh"
|
||||
#include "G4ExceptionSeverity.hh"
|
||||
|
||||
G4ParticleChangeForGamma::G4ParticleChangeForGamma():G4VParticleChange()
|
||||
{
|
||||
theSteppingControlFlag = NormalCondition;
|
||||
debugFlag = false;
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>2) {
|
||||
G4cout << "G4ParticleChangeForGamma::G4ParticleChangeForGamma() " << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
G4ParticleChangeForGamma::~G4ParticleChangeForGamma()
|
||||
{
|
||||
#ifdef G4VERBOSE
|
||||
if (verboseLevel>2) {
|
||||
G4cout << "G4ParticleChangeForGamma::~G4ParticleChangeForGamma() " << G4endl;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
G4ParticleChangeForGamma::G4ParticleChangeForGamma(
|
||||
const G4ParticleChangeForGamma &right): G4VParticleChange(right)
|
||||
{
|
||||
if (verboseLevel>1) {
|
||||
G4cout << "G4ParticleChangeForGamma:: copy constructor is called " << G4endl;
|
||||
}
|
||||
currentTrack = right.currentTrack;
|
||||
proposedKinEnergy = right.proposedKinEnergy;
|
||||
//theProposedWeight = right.theProposedWeight;
|
||||
proposedMomentumDirection = right.proposedMomentumDirection;
|
||||
proposedPolarization = right.proposedPolarization;
|
||||
}
|
||||
|
||||
// assignment operator
|
||||
G4ParticleChangeForGamma & G4ParticleChangeForGamma::operator=(
|
||||
const G4ParticleChangeForGamma &right)
|
||||
{
|
||||
if (verboseLevel>1) {
|
||||
G4cout << "G4ParticleChangeForGamma:: assignment operator is called " << G4endl;
|
||||
}
|
||||
if (this != &right)
|
||||
{
|
||||
theListOfSecondaries = right.theListOfSecondaries;
|
||||
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
|
||||
theNumberOfSecondaries = right.theNumberOfSecondaries;
|
||||
theStatusChange = right.theStatusChange;
|
||||
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
|
||||
theSteppingControlFlag = right.theSteppingControlFlag;
|
||||
|
||||
currentTrack = right.currentTrack;
|
||||
proposedKinEnergy = right.proposedKinEnergy;
|
||||
//theProposedWeight = right.theProposedWeight;
|
||||
proposedMomentumDirection = right.proposedMomentumDirection;
|
||||
proposedPolarization = right.proposedPolarization;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for printing messages
|
||||
//
|
||||
|
||||
void G4ParticleChangeForGamma::DumpInfo() const
|
||||
{
|
||||
// use base-class DumpInfo
|
||||
G4VParticleChange::DumpInfo();
|
||||
|
||||
G4cout.precision(3);
|
||||
G4cout << " Kinetic Energy (MeV): "
|
||||
<< std::setw(20) << proposedKinEnergy/MeV
|
||||
<< G4endl;
|
||||
G4cout << " Momentum Direction: "
|
||||
<< std::setw(20) << proposedMomentumDirection
|
||||
<< G4endl;
|
||||
G4cout << " Polarization: "
|
||||
<< std::setw(20) << proposedPolarization
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
G4bool G4ParticleChangeForGamma::CheckIt(const G4Track& aTrack)
|
||||
{
|
||||
G4bool itsOK = true;
|
||||
G4bool exitWithError = false;
|
||||
|
||||
G4double accuracy;
|
||||
|
||||
// Energy should not be lager than initial value
|
||||
accuracy = ( proposedKinEnergy - aTrack.GetKineticEnergy())/MeV;
|
||||
if (accuracy > accuracyForWarning) {
|
||||
#ifdef G4VERBOSE
|
||||
G4cout << "G4ParticleChangeForGamma::CheckIt: ";
|
||||
G4cout << "KinEnergy become larger than the initial value!" << G4endl;
|
||||
G4cout << " Difference: " << accuracy << "[MeV] " <<G4endl;
|
||||
#endif
|
||||
itsOK = false;
|
||||
if (accuracy > accuracyForException) exitWithError = true;
|
||||
}
|
||||
|
||||
// dump out information of this particle change
|
||||
#ifdef G4VERBOSE
|
||||
if (!itsOK) {
|
||||
G4cout << "G4ParticleChangeForGamma::CheckIt " << G4endl;
|
||||
DumpInfo();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Exit with error
|
||||
if (exitWithError) {
|
||||
G4Exception("G4ParticleChangeForGamma::CheckIt",
|
||||
"400",
|
||||
EventMustBeAborted,
|
||||
"energy was illegal");
|
||||
}
|
||||
|
||||
//correction
|
||||
if (!itsOK) {
|
||||
proposedKinEnergy = aTrack.GetKineticEnergy();
|
||||
}
|
||||
|
||||
itsOK = (itsOK) && G4VParticleChange::CheckIt(aTrack);
|
||||
return itsOK;
|
||||
}
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChangeForLoss.cc,v 1.13 2004/06/15 08:17:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// $Id: G4ParticleChangeForLoss.cc,v 1.14 2005/04/14 17:59:38 vnivanch Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -34,6 +34,7 @@
|
||||
//
|
||||
// Modified:
|
||||
// 16.01.04 V.Ivanchenko update for model variant of energy loss
|
||||
// 15.04.05 V.Ivanchenko inline update methods
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
//
|
||||
@@ -66,115 +67,38 @@ G4ParticleChangeForLoss::~G4ParticleChangeForLoss()
|
||||
G4ParticleChangeForLoss::G4ParticleChangeForLoss(
|
||||
const G4ParticleChangeForLoss &right): G4VParticleChange(right)
|
||||
{
|
||||
if (verboseLevel>1) {
|
||||
if (verboseLevel>1) {
|
||||
G4cout << "G4ParticleChangeForLoss:: copy constructor is called " << G4endl;
|
||||
}
|
||||
currentTrack = right.currentTrack;
|
||||
proposedKinEnergy = right.proposedKinEnergy;
|
||||
currentCharge = right.currentCharge;
|
||||
//theProposedWeight = right.theProposedWeight;
|
||||
proposedMomentumDirection = right.proposedMomentumDirection;
|
||||
}
|
||||
currentTrack = right.currentTrack;
|
||||
proposedKinEnergy = right.proposedKinEnergy;
|
||||
currentCharge = right.currentCharge;
|
||||
//theProposedWeight = right.theProposedWeight;
|
||||
proposedMomentumDirection = right.proposedMomentumDirection;
|
||||
}
|
||||
|
||||
// assignment operator
|
||||
G4ParticleChangeForLoss & G4ParticleChangeForLoss::operator=(
|
||||
const G4ParticleChangeForLoss &right)
|
||||
{
|
||||
if (verboseLevel>1) {
|
||||
if (verboseLevel>1) {
|
||||
G4cout << "G4ParticleChangeForLoss:: assignment operator is called " << G4endl;
|
||||
}
|
||||
if (this != &right)
|
||||
{
|
||||
theListOfSecondaries = right.theListOfSecondaries;
|
||||
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
|
||||
theNumberOfSecondaries = right.theNumberOfSecondaries;
|
||||
theStatusChange = right.theStatusChange;
|
||||
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
|
||||
theSteppingControlFlag = right.theSteppingControlFlag;
|
||||
|
||||
currentTrack = right.currentTrack;
|
||||
proposedKinEnergy = right.proposedKinEnergy;
|
||||
currentCharge = right.currentCharge;
|
||||
//theProposedWeight = right.theProposedWeight;
|
||||
proposedMomentumDirection = right.proposedMomentumDirection;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
// methods for updating G4Step
|
||||
//
|
||||
|
||||
G4Step* G4ParticleChangeForLoss::UpdateStepForAlongStep(G4Step* pStep)
|
||||
{
|
||||
// A physics process always calculates the final state of the
|
||||
// particle relative to the initial state at the beginning
|
||||
// of the Step, i.e., based on information of G4Track (or
|
||||
// equivalently the PreStepPoint).
|
||||
// So, the differences (delta) between these two states have to be
|
||||
// calculated and be accumulated in PostStepPoint.
|
||||
|
||||
G4StepPoint* pPreStepPoint = pStep->GetPreStepPoint();
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
|
||||
// calculate new kinetic energy
|
||||
G4double kinEnergy = pPostStepPoint->GetKineticEnergy()
|
||||
+ (proposedKinEnergy - pPreStepPoint->GetKineticEnergy());
|
||||
|
||||
// update kinetic energy and momentum direction
|
||||
if (kinEnergy < 0.0) {
|
||||
theLocalEnergyDeposit += kinEnergy;
|
||||
kinEnergy = 0.0;
|
||||
}
|
||||
if (this != &right) {
|
||||
theListOfSecondaries = right.theListOfSecondaries;
|
||||
theSizeOftheListOfSecondaries = right.theSizeOftheListOfSecondaries;
|
||||
theNumberOfSecondaries = right.theNumberOfSecondaries;
|
||||
theStatusChange = right.theStatusChange;
|
||||
theLocalEnergyDeposit = right.theLocalEnergyDeposit;
|
||||
theSteppingControlFlag = right.theSteppingControlFlag;
|
||||
|
||||
pPostStepPoint->SetKineticEnergy( kinEnergy );
|
||||
pPostStepPoint->SetCharge( currentCharge );
|
||||
|
||||
// update weight
|
||||
// this feature is commented out, it should be overwritten in case
|
||||
// if energy loss processes will use biasing
|
||||
// G4double newWeight = theProposedWeight/(pPreStepPoint->GetWeight())*(pPostStepPoint->GetWeight());
|
||||
// pPostStepPoint->SetWeight( newWeight );
|
||||
|
||||
|
||||
// Not necessary to check now
|
||||
//#ifdef G4VERBOSE
|
||||
// if (debugFlag) CheckIt(*aTrack);
|
||||
//#endif
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
|
||||
return pStep;
|
||||
}
|
||||
|
||||
G4Step* G4ParticleChangeForLoss::UpdateStepForPostStep(G4Step* pStep)
|
||||
{
|
||||
// A physics process always calculates the final state of the
|
||||
// particle relative to the initial state at the beginning
|
||||
// of the Step, i.e., based on information of G4Track (or
|
||||
// equivalently the PreStepPoint).
|
||||
// So, the differences (delta) between these two states have to be
|
||||
// calculated and be accumulated in PostStepPoint.
|
||||
|
||||
G4StepPoint* pPostStepPoint = pStep->GetPostStepPoint();
|
||||
|
||||
pPostStepPoint->SetKineticEnergy( proposedKinEnergy );
|
||||
pPostStepPoint->SetCharge( currentCharge );
|
||||
pPostStepPoint->SetMomentumDirection( proposedMomentumDirection );
|
||||
|
||||
// update weight
|
||||
// this feature is commented out, it should be overwritten in case
|
||||
// if energy loss processes will use biasing
|
||||
// pPostStepPoint->SetWeight( theProposedWeight );
|
||||
|
||||
// Not necessary to check now
|
||||
//#ifdef G4VERBOSE
|
||||
// if (debugFlag) CheckIt(*aTrack);
|
||||
//#endif
|
||||
|
||||
// Update the G4Step specific attributes
|
||||
pStep->AddTotalEnergyDeposit( theLocalEnergyDeposit );
|
||||
return pStep;
|
||||
currentTrack = right.currentTrack;
|
||||
proposedKinEnergy = right.proposedKinEnergy;
|
||||
currentCharge = right.currentCharge;
|
||||
//theProposedWeight = right.theProposedWeight;
|
||||
proposedMomentumDirection = right.proposedMomentumDirection;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChangeForMSC.cc,v 1.12 2004/12/02 06:38:05 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4ParticleChangeForTransport.cc,v 1.17 2004/08/12 00:50:11 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4Step.cc,v 1.5 2001/07/11 10:08:39 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4StepPoint.cc,v 1.10 2004/08/12 00:50:11 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
+19
-20
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Track.cc,v 1.22 2004/12/02 06:38:17 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
// $Id: G4Track.cc,v 1.24 2005/06/27 15:32:43 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
@@ -33,6 +33,7 @@
|
||||
// Add copy constructor Hisaya Feb. 07 01
|
||||
// Fix GetVelocity Hisaya Feb. 17 01
|
||||
// Modification for G4TouchableHandle 22 Oct. 2001 R.Chytracek//
|
||||
// Fix GetVelocity (bug report #741) Horton-Smith Apr 14 2005
|
||||
|
||||
#include "G4Track.hh"
|
||||
|
||||
@@ -166,26 +167,24 @@ G4double G4Track::GetVelocity() const
|
||||
// special case for photons
|
||||
if ( (fOpticalPhoton !=0) &&
|
||||
(fpDynamicParticle->GetDefinition()==fOpticalPhoton) ){
|
||||
G4Material*
|
||||
mat=fpTouchable->GetVolume()->GetLogicalVolume()->GetMaterial();
|
||||
|
||||
if(mat->GetMaterialPropertiesTable() != 0){
|
||||
if(mat->GetMaterialPropertiesTable()->GetProperty("RINDEX") != 0 ){
|
||||
// light velocity = c/reflection-index
|
||||
velocity /=
|
||||
mat->GetMaterialPropertiesTable()->GetProperty("RINDEX")->
|
||||
GetProperty(fpDynamicParticle->GetTotalMomentum()) ;
|
||||
}
|
||||
}
|
||||
|
||||
G4Material*
|
||||
mat=fpTouchable->GetVolume()->GetLogicalVolume()->GetMaterial();
|
||||
|
||||
if(mat->GetMaterialPropertiesTable() != 0){
|
||||
// light velocity = c/(rindex+d(rindex)/d(log(E_phot)))
|
||||
// values stored in GROUPVEL material properties vector
|
||||
G4MaterialPropertyVector *groupvel =
|
||||
mat->GetMaterialPropertiesTable()->GetProperty("GROUPVEL");
|
||||
if(groupvel != 0 )
|
||||
velocity =
|
||||
groupvel->GetProperty(fpDynamicParticle->GetTotalMomentum());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
G4double T = fpDynamicParticle->GetKineticEnergy();
|
||||
velocity = c_light*std::sqrt(T*(T+2.*mass))/(T+mass) ;
|
||||
velocity = c_light*std::sqrt(T*(T+2.*mass))/(T+mass);
|
||||
}
|
||||
|
||||
return velocity ;
|
||||
|
||||
return velocity ;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VParticleChange.cc,v 1.17 2004/12/02 06:38:21 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-03 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VUserTrackInformation.cc,v 1.1 2004/11/26 06:47:00 asaim Exp $
|
||||
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
||||
// GEANT4 tag $Name: geant4-07-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user