Import Geant4 9.2.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
$Id: History,v 1.28 2007/10/30 03:14:18 gum Exp $
|
||||
$Id: History,v 1.34 2008/11/14 15:55:47 kurasige Exp $
|
||||
-------------------------------------------------------------------
|
||||
|
||||
=========================================================
|
||||
@@ -16,6 +16,27 @@ committal in the CVS repository !
|
||||
----------------------------------------------------------
|
||||
* Reverse chronological order (last date on top), please *
|
||||
----------------------------------------------------------
|
||||
-Sep. 19 2008 H.Kurashige (decay-V09-01-04)
|
||||
- modify process sub type enumeration
|
||||
|
||||
- Aug. 22, 08 P.Gumplinger (decay-V09-01-03)
|
||||
- fix a bug in G4DecayWithSpin.cc: there is a memory overwrite when the
|
||||
GetFieldValue being called initializes a fieldValue array of size 6
|
||||
when the array is only defined of size 3 in the calling program.
|
||||
Thanks to Kamil Sedlak (PSI) for pointing this out and suggesting this
|
||||
fix.
|
||||
|
||||
- Apr. 16, 08 H.Kurashige (decay-V09-01-02)
|
||||
- fix a bug when shortlived particles has finite pre-assigned proper time
|
||||
|
||||
- Apr. 11, 08 P.Gumplinger (decay-V09-01-01)
|
||||
- modify G4DecayWithSpin::DecayIt to allow spin precession also for EM Fields;
|
||||
e.g. fields that do "DoesFieldChangeEnergy()" but only if the B-field
|
||||
component is > 0. (thanks to Kamil Sedlak, Toni Shiroka from PSI)
|
||||
|
||||
- Dec. 15, 07 H.Kurashige (decay-V09-01-00)
|
||||
- add G4DecayProcessType
|
||||
- define process sub type
|
||||
|
||||
- Oct. 29, 07 P.Gumplinger (decay-V09-00-02)
|
||||
- add G4PionDecayMakeSpin class
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Decay.hh,v 1.18 2007/07/23 23:13:04 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4Decay.hh,v 1.20 2008/09/19 03:19:53 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
@@ -57,6 +57,8 @@
|
||||
#include "globals.hh"
|
||||
#include "G4VRestDiscreteProcess.hh"
|
||||
#include "G4ParticleChangeForDecay.hh"
|
||||
#include "G4DecayProcessType.hh"
|
||||
|
||||
class G4VExtDecayer;
|
||||
|
||||
class G4Decay : public G4VRestDiscreteProcess
|
||||
@@ -204,12 +206,6 @@ inline
|
||||
return DecayIt(aTrack, aStep);
|
||||
}
|
||||
|
||||
inline
|
||||
void G4Decay::SetExtDecayer(G4VExtDecayer* val)
|
||||
{
|
||||
pExtDecayer = val;
|
||||
}
|
||||
|
||||
inline
|
||||
const G4VExtDecayer* G4Decay::GetExtDecayer() const
|
||||
{
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * 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. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4DecayProcessType.hh,v 1.2 2008/09/19 03:19:53 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4DecayProcessType.hh
|
||||
//
|
||||
// Class Description:
|
||||
// This is an enumerator to define process sub type for decay
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#ifndef G4DecayProcessType_h
|
||||
#define G4DecayProcessType_h 1
|
||||
|
||||
enum G4DecayProcessType
|
||||
{
|
||||
DECAY = 201 ,
|
||||
DECAY_WithSpin ,
|
||||
DECAY_PionMakeSpin ,
|
||||
DECAY_Unknown = 211,
|
||||
DECAY_External = 231
|
||||
};
|
||||
#endif
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4UnknownDecay.hh,v 1.3 2006/06/29 19:30:56 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
//
|
||||
// $Id: G4VExtDecayer.hh,v 1.4 2006/06/29 19:31:11 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// ------------------------------------------------------------
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4Decay.cc,v 1.27 2007/10/06 07:01:09 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4Decay.cc,v 1.30 2008/09/19 03:19:53 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -63,11 +63,15 @@ G4Decay::G4Decay(const G4String& processName)
|
||||
HighestValue(20.0),
|
||||
pExtDecayer(0)
|
||||
{
|
||||
// set Process Sub Type
|
||||
SetProcessSubType(static_cast<int>(DECAY));
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>1) {
|
||||
G4cout << "G4Decay constructor " << " Name:" << processName << G4endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
pParticleChange = &fParticleChangeForDecay;
|
||||
}
|
||||
|
||||
@@ -403,9 +407,20 @@ G4double G4Decay::PostStepGetPhysicalInteractionLength(
|
||||
// reminder proper time
|
||||
fRemainderLifeTime = pTime - track.GetProperTime();
|
||||
if (fRemainderLifeTime <= 0.0) fRemainderLifeTime = DBL_MIN;
|
||||
|
||||
|
||||
G4double rvalue=0.0;
|
||||
// use pre-assigned Decay time to determine PIL
|
||||
return (fRemainderLifeTime/aLife)*GetMeanFreePath(track, previousStepSize, condition);
|
||||
if (aLife>0.0) {
|
||||
// ordinary particle
|
||||
rvalue = (fRemainderLifeTime/aLife)*GetMeanFreePath(track, previousStepSize, condition);
|
||||
} else {
|
||||
// shortlived particle
|
||||
rvalue = c_light * fRemainderLifeTime;
|
||||
// by using normalized kinetic energy (= Ekin/mass)
|
||||
G4double aMass = track.GetDynamicParticle()->GetMass();
|
||||
rvalue *= track.GetDynamicParticle()->GetTotalMomentum()/aMass;
|
||||
}
|
||||
return rvalue;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -427,3 +442,14 @@ G4double G4Decay::AtRestGetPhysicalInteractionLength(
|
||||
}
|
||||
return fRemainderLifeTime;
|
||||
}
|
||||
|
||||
|
||||
void G4Decay::SetExtDecayer(G4VExtDecayer* val)
|
||||
{
|
||||
pExtDecayer = val;
|
||||
|
||||
// set Process Sub Type
|
||||
if ( pExtDecayer !=0 ) {
|
||||
SetProcessSubType(static_cast<int>(DECAY_External));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
//
|
||||
// History:
|
||||
// 17 August 2004 P. Gumplinger, T. MacPhail
|
||||
// 11 April 2008 Kamil Sedlak (PSI), Toni Shiroka (PSI)
|
||||
// ------------------------------------------------------------
|
||||
//
|
||||
#include "G4DecayWithSpin.hh"
|
||||
@@ -46,7 +47,12 @@
|
||||
|
||||
#include "G4Transform3D.hh"
|
||||
|
||||
G4DecayWithSpin::G4DecayWithSpin(const G4String& processName):G4Decay(processName){}
|
||||
G4DecayWithSpin::G4DecayWithSpin(const G4String& processName):G4Decay(processName)
|
||||
{
|
||||
// set Process Sub Type
|
||||
SetProcessSubType(static_cast<int>(DECAY_WithSpin));
|
||||
|
||||
}
|
||||
|
||||
G4DecayWithSpin::~G4DecayWithSpin(){}
|
||||
|
||||
@@ -96,7 +102,7 @@ G4VParticleChange* G4DecayWithSpin::DecayIt(const G4Track& aTrack, const G4Step&
|
||||
const G4Field* field = NULL;
|
||||
if(fieldMgr)field = fieldMgr->GetDetectorField();
|
||||
|
||||
if (field && !(fieldMgr->DoesFieldChangeEnergy())) {
|
||||
if (field) {
|
||||
|
||||
G4double point[4];
|
||||
point[0] = (aStep.GetPostStepPoint()->GetPosition())[0];
|
||||
@@ -104,12 +110,14 @@ G4VParticleChange* G4DecayWithSpin::DecayIt(const G4Track& aTrack, const G4Step&
|
||||
point[2] = (aStep.GetPostStepPoint()->GetPosition())[2];
|
||||
point[3] = aTrack.GetGlobalTime();
|
||||
|
||||
G4double fieldValue[3];
|
||||
G4double fieldValue[6];
|
||||
field -> GetFieldValue(point,fieldValue);
|
||||
|
||||
G4ThreeVector B(fieldValue[0],fieldValue[1],fieldValue[2]);
|
||||
|
||||
parent_polarization = Spin_Precession(aStep,B,fRemainderLifeTime);
|
||||
// Call the spin precession only for non-zero mag. field
|
||||
if (B.mag2() > 0.) parent_polarization =
|
||||
Spin_Precession(aStep,B,fRemainderLifeTime);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,12 @@
|
||||
// constructor
|
||||
|
||||
G4PionDecayMakeSpin::G4PionDecayMakeSpin(const G4String& processName)
|
||||
: G4Decay(processName) { }
|
||||
: G4Decay(processName)
|
||||
{
|
||||
// set Process Sub Type
|
||||
SetProcessSubType(static_cast<int>(DECAY_PionMakeSpin));
|
||||
|
||||
}
|
||||
|
||||
G4PionDecayMakeSpin::~G4PionDecayMakeSpin() { }
|
||||
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4UnknownDecay.cc,v 1.5 2007/10/06 07:01:09 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-09-01 $
|
||||
// $Id: G4UnknownDecay.cc,v 1.6 2007/12/15 12:29:16 kurasige Exp $
|
||||
// GEANT4 tag $Name: geant4-09-02 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
@@ -39,6 +39,8 @@
|
||||
#include "G4DecayProducts.hh"
|
||||
#include "G4PhysicsLogVector.hh"
|
||||
#include "G4ParticleChangeForDecay.hh"
|
||||
#include "G4DecayProcessType.hh"
|
||||
|
||||
|
||||
// constructor
|
||||
G4UnknownDecay::G4UnknownDecay(const G4String& processName)
|
||||
@@ -46,6 +48,9 @@ G4UnknownDecay::G4UnknownDecay(const G4String& processName)
|
||||
verboseLevel(1),
|
||||
HighestValue(20.0)
|
||||
{
|
||||
// set Process Sub Type
|
||||
SetProcessSubType(static_cast<int>(DECAY_Unknown));
|
||||
|
||||
#ifdef G4VERBOSE
|
||||
if (GetVerboseLevel()>1) {
|
||||
G4cout << "G4UnknownDecay constructor " << " Name:" << processName << G4endl;
|
||||
|
||||
Reference in New Issue
Block a user