Import Geant4 4.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:39:52 +02:00
parent 921d3b1cda
commit 330b82b769
4524 changed files with 178689 additions and 43575 deletions
+15 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.40 2001/12/10 08:39:57 kurasige Exp $
$Id: History,v 1.45 2002/02/12 01:48:52 kurasige Exp $
-------------------------------------------------------------------
=========================================================
@@ -16,6 +16,20 @@ committal in the CVS repository !
----------------------------------------------------------
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
Feb. 09 ,02 H.Kurashige (track-V04-00-02)
- Modify G4Track::GetVelocity to get better performance for massless particles
Dec. 24 ,01 H.Kurashige (track-V04-00-01)
- Remove event biasing mechanism from track category
( it is moved to hadronic/models )
- Add G4Track::CopyTrackInfo
- Modified G4ParticleChange::AddSecondary to use touchable handle
- Fixed a bug of changing parent weight in G4ParticleChange::UpdateStepForAlongStep
Dec. 12, 01 H.Kurashige (track-V04-00-00)
- Added initialization of fStepLength in constructors.
- Fixed a bug that fStepLength is not copied in assginment operator
Dec. 10, 01 H.Kurashige (track-V03-02-08)
- Modified assignment operator so that fCurrentStepNumber is set to 0
@@ -1,95 +0,0 @@
//
// ********************************************************************
// * 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: G4EvtBiasMechanism.hh,v 1.4 2001/07/11 10:08:34 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
//
// ------------------------------------------------------------
// Class Description
// This is a simple example for Event Biasing
// This mechanism is applied to only particleToBeBiased.
// If a track currently processed is the specifed particle type,
// ApplyMath methods multiply all secondaries in particle change
// by factor of MultiplicationForSecondaries with their weights of
// (parent weight)/(MultiplicationForSecondaries)
#ifndef G4EvtBiasMechanism_h
#define G4EvtBiasMechanism_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4ParticleDefinition.hh"
#include "G4VEvtBiasMechanism.hh"
class G4VParticleChange;
class G4EvtBiasMechanism :public G4VEvtBiasMechanism
{
public: //with description
// constructors
G4EvtBiasMechanism(const G4String& name = "EBSample", G4int mulFactor=10);
G4EvtBiasMechanism(const G4EvtBiasMechanism&);
public:
virtual ~G4EvtBiasMechanism();
public: //with description
// virtual methods derived from G4VEvtBiasMechanism
virtual G4VParticleChange* ApplyMath( G4VParticleChange*, const G4Step& );
virtual G4bool IsApplicable(G4ParticleDefinition*) const;
// Set/Get particle type to be biased
void SetParticleBiased( G4ParticleDefinition* );
const G4ParticleDefinition* GetParticleBiased( ) const;
private:
G4ParticleDefinition* particleToBeBiased;
const G4int MultiplicationForSecondaries;
};
inline
G4bool G4EvtBiasMechanism::IsApplicable(G4ParticleDefinition* particle) const
{
return (particle == particleToBeBiased);
}
inline
void G4EvtBiasMechanism::SetParticleBiased(G4ParticleDefinition* particle)
{
particleToBeBiased = particle;
}
inline
const G4ParticleDefinition* G4EvtBiasMechanism::GetParticleBiased() const
{
return particleToBeBiased;
}
#endif
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4ForceCondition.hh,v 1.3 2001/07/11 10:08:35 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4GPILSelection.hh,v 1.3 2001/07/11 10:08:35 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
//---------------------------------------------------------------
-314
View File
@@ -1,314 +0,0 @@
//
// ********************************************************************
// * 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: G4Mars5GeVMechanism.hh,v 1.4 2001/07/11 10:08:35 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
//
// ------------------------------------------------------------
// First Implemention 17 Nov. 1998 M.Asai, H.Kurahige
//
// ------------------------------------------------------------
// Class Description
// This is a Event Biasing mechanism based on MARS code
// This model is applicable to
// proton/neutron/pi+-/K+-/gamma/anti_proton
// with energy < 5.0GeV
//*
// Original code is MARS13 written by Nikolai Mokhov (FNAL)
//**************************************************************
//* MARS13: 9. hA EVENT GENERATOR:
//* Copyright Nikolai Mokhov (Fermilab)
//*
//* LAST CHANGE: 14-NOV-1998
//**************************************************************
//* Copyright Nikolai Mokhov (Fermilab)
//*
//* MARS13(98)
//*
//* INCLUSIVE HADRON(photon)-NUCLEUS VERTEX AT E < 5 GEV !!!
//* THREE WEIGHTED HADRONS IN FINAL STATE: !!!
//* IP+A -> N/P(CASC)+ PI+/PI-(K+/K-) + PI0
//
#ifndef G4Mars5GeVMechanism_h
#define G4Mars5GeVMechanism_h 1
#include "globals.hh"
#include "G4ios.hh"
#include "G4VEvtBiasMechanism.hh"
class G4Material;
class G4DynamicParticle;
class G4VParticleChange;
class G4ParticleTable;
class G4ParticleDefinition;
#include "G4ThreeVector.hh"
#include "G4FastVector.hh"
class G4Mars5GeVMechanism :public G4VEvtBiasMechanism
{
public: // with description
// constructors
G4Mars5GeVMechanism(const G4String& name = "MARS5GeV");
G4Mars5GeVMechanism(const G4Mars5GeVMechanism&);
//destructor
virtual ~G4Mars5GeVMechanism();
// virtual methods derived from G4VEvtBiasMechanism
virtual G4VParticleChange* ApplyMath( G4VParticleChange*, const G4Step& );
virtual G4bool IsApplicable(G4ParticleDefinition*) const;
private:
void Treem5();
// This is the mothod which invoke MARS
// secondary information will be filled up
G4bool CoulombBarrier(G4int pType, G4double pE);
// Check if coulomb barrier exists
void CreateNucleon(G4int ib, G4int pType, G4double pE);
void CreatePion(G4int ib, G4int pType, G4double pE);
void CreatePionZero(G4int ib, G4int pType, G4double pE);
// Create secondary particles and add them into the list
void AddSecondary();
// Add a secondary particle into the list
G4double SelBS(G4int pType, G4double aNucl, G4double zNucl);
// Calculate weight of secondary
G4double D2N2(G4int pType, G4double incidentE,
G4double prodE, G4double tin,
G4int reacType, G4int proType,
G4double ai, G4double z);
// Calculate Hadron Inclusive Yield
G4double Rkaon(G4int ib, G4int jp, G4double eRaw);
// Calculate energy dependent K/pi ratio
void Trans(G4ThreeVector* d1, G4ThreeVector* d2);
// Direction cosine transformation using selec2(cs,ss,ch,sh)
public:
enum {FastVectorSize = 16};
typedef G4FastVector<G4DynamicParticle ,FastVectorSize> G4MarsSecondaryVector;
private:
// information of secondary
G4int numberOfSecondaries;
G4double weightOfSecondaries[FastVectorSize];
G4MarsSecondaryVector secondaries;
private:
const G4double EthForIncident;
G4bool IsApplicable(G4int marsEncoding) const;
private:
// Particle Table
G4ParticleTable* theParticleTable;
// particle encoding for MARS
enum { MarsUndefined =0,
MarsP, MarsN, MarsPIplus, MarsPIminus, MarsKplus, MarsKminus,
MarsMUplus, MarsMUminus, MarsGAM, MarsEminus, MarsEplus, MarsAP,
MarsPI0, MarsD, MarsT, MarsHe3, MarsHe4 };
G4int GetMarsEncoding(const G4ParticleDefinition* )const;
const G4String& GetParticleName(G4int marsEncoding) const;
G4ParticleDefinition* GetParticleDefinition(G4int marsEncoding) const;
G4double ProtonMass;
private:
// incident information
G4double incidentWeight;
const G4DynamicParticle* incidentParticle;
G4int incidentMarsEncoding;
void GetTargetNuclei(const G4Material*); //fill up fANucle and fZnucl
G4double fANucl, fZNucl; // target nucleus
private:
// these class is to define common blocks in original code
class Selec1
{
public:
G4double Einc, EN, V, V10;
G4int Treac, Tprod;
} selec1;
class Selec2
{
public:
G4double Cs, Ss, Ch, Sh;
} selec2;
class Selec3
{
public:
G4double Eth, Emax, Sqs, X, Pt2, Pt, P;
} selec3;
};
#include "G4ParticleDefinition.hh"
#include "G4ParticleTable.hh"
inline
G4int G4Mars5GeVMechanism::GetMarsEncoding(const G4ParticleDefinition* particle) const{
const G4String& name = particle->GetParticleName();
G4int encoding = MarsUndefined;
if (name == "proton") {
encoding = MarsP;
} else if (name == "neutron") {
encoding = MarsN;
} else if (name == "pi+") {
encoding = MarsPIplus;
} else if (name == "pi-") {
encoding = MarsPIminus;
} else if (name == "kaon+") {
encoding = MarsKplus;
} else if (name == "kaon-") {
encoding = MarsKminus;
} else if (name == "mu+") {
encoding = MarsMUplus;
} else if (name == "mu-") {
encoding = MarsMUminus;
} else if (name == "gamma") {
encoding = MarsGAM;
} else if (name == "e+") {
encoding = MarsEplus;
} else if (name == "e-") {
encoding = MarsEminus;
} else if (name == "anti_proton") {
encoding = MarsAP;
} else if (name == "pi0") {
encoding = MarsPI0;
} else if (name == "deuteron") {
encoding = MarsD;
} else if (name == "triton") {
encoding = MarsT;
} else if (name == "He3") {
encoding = MarsHe3;
} else if (name == "alpha") {
encoding = MarsHe4;
}
return encoding;
}
inline
const G4String& G4Mars5GeVMechanism::GetParticleName(G4int encoding) const
{
static G4String name;
name = "None";
switch (encoding)
{
case MarsP:
name = "proton";
break;
case MarsN:
name = "neutron";
break;
case MarsPIplus:
name = "pi+";
break;
case MarsPIminus:
name = "pi-";
break;
case MarsKplus:
name = "kaon+";
break;
case MarsKminus:
name = "kaon-";
break;
case MarsMUplus:
name = "mu+";
break;
case MarsMUminus:
name = "mu-";
break;
case MarsGAM:
name = "gamma";
break;
case MarsEplus:
name = "e+";
break;
case MarsEminus:
name = "e-";
break;
case MarsAP:
name = "anti_proton";
break;
case MarsPI0:
name = "pi0";
break;
case MarsD:
name = "deuteron";
break;
case MarsT:
name = "triton";
break;
case MarsHe3:
name = "He3";
break;
case MarsHe4:
name = "alpha";
break;
default:
break;
}
return name;
}
inline
G4ParticleDefinition* G4Mars5GeVMechanism::GetParticleDefinition(G4int encoding) const
{
G4String name = GetParticleName(encoding);
G4ParticleDefinition* particle = 0;
if (name != "None") {
particle = theParticleTable->FindParticle(name);
}
return particle;
}
inline
G4bool G4Mars5GeVMechanism::IsApplicable(G4int marsEncoding) const
{
return ( ((marsEncoding!=MarsUndefined) && (marsEncoding<=MarsKminus) )||
(marsEncoding==MarsGAM) ||
(marsEncoding==MarsAP) );
}
inline
G4bool G4Mars5GeVMechanism::IsApplicable(G4ParticleDefinition* particle) const
{
return IsApplicable(GetMarsEncoding(particle));
}
#endif
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParticleChange.hh,v 1.9 2001/11/21 14:05:57 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// ------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParticleChange.icc,v 1.9 2001/10/20 08:07:49 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
inline
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParticleChangeForDecay.hh,v 1.5 2001/07/11 10:08:35 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParticleChangeForLoss.hh,v 1.4 2001/07/11 10:08:35 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParticleChangeForMSC.icc,v 1.4 2001/07/11 10:08:36 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParticleChangeForRadDecay.hh,v 1.4 2001/10/24 05:41:46 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParticleChangeForTransport.hh,v 1.8 2001/10/22 04:19:39 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// ------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParticleChangeForTransport.icc,v 1.7 2001/10/22 04:19:40 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
inline
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4Step.hh,v 1.8 2001/07/11 10:08:36 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4Step.icc,v 1.7 2001/10/22 04:19:40 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4StepPoint.hh,v 1.9 2001/10/22 04:19:40 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4StepPoint.icc,v 1.5 2001/10/22 04:19:40 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
inline const G4ThreeVector& G4StepPoint::GetPosition() const
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4StepStatus.hh,v 1.3 2001/07/11 10:08:37 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4SteppingControl.hh,v 1.3 2001/07/11 10:08:37 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
//---------------------------------------------------------------
+14 -12
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Track.hh,v 1.13 2001/11/13 05:13:37 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// $Id: G4Track.hh,v 1.15 2001/12/14 09:59:35 kurasige Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
//
//---------------------------------------------------------------
@@ -67,15 +67,19 @@ public: // With description
// Constructor
G4Track();
G4Track(const G4Track&);
G4Track(G4DynamicParticle* apValueDynamicParticle,
G4double aValueTime,
const G4ThreeVector& aValuePosition);
// aValueTime is a global time
G4Track(const G4Track&);
// Copy Constructor copys members other than tracking information
private:
// Hide assignment operator as private
G4Track& operator=(const G4Track&);
//--------
public:
public: // With description
// Destrcutor
~G4Track();
@@ -86,12 +90,12 @@ public:
inline void operator delete(void *aTrack);
// Override "delete" for "G4Allocator".
int operator==( const G4Track& s);
// Define "==" operator because "G4TrackVector" uses
//"RWPtrOrderdVector" which requires this.
G4bool operator==( const G4Track& );
//--------
public: // With description
// Copy information of the track (w/o tracking information)
void CopyTrackInfo(const G4Track&);
// Get/Set functions
// track ID
@@ -252,9 +256,7 @@ public: // With description
// this will be set equal to 'StepLength' in G4Step.
G4double fWeight;
// This is a weight for this track used by G4VEvtBiasMechanism
// to execute inclusive simulation for hadronic/electomagnetic shower
// and neutron transportation etc.
// This is a weight for this track
const G4Step* fpStep;
+4 -4
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Track.icc,v 1.8 2001/10/22 04:19:40 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// $Id: G4Track.icc,v 1.9 2001/12/13 15:31:24 kurasige Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
//-----------------------------------------------------------------
// Definitions of inline functions
@@ -42,8 +42,8 @@
{ aTrackAllocator.FreeSingle((G4Track *) aTrack);}
// Override "delete" for "G4Allocator".
inline int G4Track::operator==( const G4Track& s)
{ return (this==&s) ? 1 : 0; }
inline G4bool G4Track::operator==( const G4Track& s)
{ return (this==&s); }
// Define "==" operator because "G4TrackVector" uses
// "RWPtrOrderdVector" which requires this.
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4TrackFastVector.hh,v 1.4 2001/07/11 10:08:37 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// ------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4TrackStatus.hh,v 1.3 2001/07/11 10:08:37 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
//---------------------------------------------------------------
@@ -1,92 +0,0 @@
//
// ********************************************************************
// * 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: G4VEvtBiasMechanism.hh,v 1.4 2001/07/11 10:08:37 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// ------------------------------------------------------------
// GEANT 4 class header file
//
//
// -------------------------------------------------------
// Class Description
// This class is a base class for all "event biasing mechanism".
//
//
// ------------------------------------------------------------
// Implemented for the new scheme 17 Nov. 1998 H.Kurahige
//
#ifndef G4VEvtBiasMechanism_h
#define G4VEvtBiasMechanism_h 1
#include "globals.hh"
#include "G4ios.hh"
class G4Step;
class G4VParticleChange;
class G4ParticleDefinition;
class G4VEvtBiasMechanism
{
public: // with description
// constructors
G4VEvtBiasMechanism(const G4String& name = "");
G4VEvtBiasMechanism(const G4VEvtBiasMechanism& right);
public:
//destructors
virtual ~G4VEvtBiasMechanism();
public: // with description
// pure virtual functions
// ApplyMath method will be invoked in G4VParticleChange::UpdateStepInfo()
// if G4VParticleChange::fUseEB is set
virtual G4VParticleChange* ApplyMath( G4VParticleChange*, const G4Step& ) =0;
// IsApplicable method returns 'true' if this Event Bias Mechanism is
// valid for the particle type
virtual G4bool IsApplicable(G4ParticleDefinition*) const = 0;
// name of the biasing mechanism
const G4String& GetName(){ return theEBName;}
// Set/Get Verbose level
G4int GetVerboseLevel() const { return verboseLevel; }
void SetVerboseLevel(G4int value) { verboseLevel = value; }
private:
G4String theEBName;
private:
G4int verboseLevel;
};
#endif
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VParticleChange.hh,v 1.7 2001/11/13 05:13:38 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// ------------------------------------------------------------
+4 -3
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VParticleChange.icc,v 1.8 2001/11/13 05:13:38 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// $Id: G4VParticleChange.icc,v 1.9 2001/12/24 05:14:39 kurasige Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
//----------------------------------------------------------------
// Virtual methods for updating G4Step
@@ -50,7 +50,8 @@ inline
G4Step* G4VParticleChange::UpdateStepForAlongStep(G4Step* Step)
{
if (!fSetParentWeightByProcess){
Step->GetPostStepPoint()->SetWeight( theParentWeight );
G4double newWeight= theParentWeight/(Step->GetPreStepPoint()->GetWeight())*(Step->GetPostStepPoint()->GetWeight());
Step->GetPostStepPoint()->SetWeight( newWeight );
}
return UpdateStepInfo(Step);
}
@@ -22,7 +22,7 @@
//
//
// $Id: G4VUserTrackInformation.hh,v 1.3 2001/07/11 10:08:38 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
//---------------------------------------------------------------
-109
View File
@@ -1,109 +0,0 @@
//
// ********************************************************************
// * 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: G4EvtBiasMechanism.cc,v 1.5 2001/08/16 08:17:58 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
//
//
// ------------------------------------------------------------
// Implemented for the new scheme 9 Nov. 1998 H.Kurahige
// --------------------------------------------------------------
#include "G4EvtBiasMechanism.hh"
#include "G4VParticleChange.hh"
#include "G4Track.hh"
#include "G4Step.hh"
G4EvtBiasMechanism::G4EvtBiasMechanism(const G4String& name, G4int mulFactor):
G4VEvtBiasMechanism(name),
particleToBeBiased(0),
MultiplicationForSecondaries(mulFactor)
{
}
G4EvtBiasMechanism::G4EvtBiasMechanism(const G4EvtBiasMechanism& right):
G4VEvtBiasMechanism(right),
MultiplicationForSecondaries(right.MultiplicationForSecondaries)
{
particleToBeBiased = right.particleToBeBiased;
}
G4EvtBiasMechanism::~G4EvtBiasMechanism()
{
}
G4VParticleChange* G4EvtBiasMechanism::ApplyMath( G4VParticleChange* pChange,
const G4Step& aStep )
{
if (particleToBeBiased != 0) {
G4int currentNumberOfSecondaries = pChange->GetNumberOfSecondaries();
G4int totalNumberOfSecondaries = currentNumberOfSecondaries;
G4int idx;
G4Track* track;
G4double theParentWeight = pChange->GetParentWeight();
G4TrackFastVector* tempList = new G4TrackFastVector();
tempList->Initialize(currentNumberOfSecondaries);
// fill tempList
for (idx=0; idx<currentNumberOfSecondaries; idx+=1){
track = pChange->GetSecondary(idx);
tempList->SetElement(idx, track);
if ( particleToBeBiased == track->GetDefinition() ) {
totalNumberOfSecondaries += (MultiplicationForSecondaries-1);
}
}
pChange->Clear();
pChange->SetNumberOfSecondaries(totalNumberOfSecondaries);
for (idx=0; idx<currentNumberOfSecondaries; idx+=1){
track = (*tempList)[idx];
if (particleToBeBiased == track->GetDefinition()) {
track->SetWeight( theParentWeight/double( MultiplicationForSecondaries) );
pChange->AddSecondary(track);
for (G4int i=0; i<MultiplicationForSecondaries-1; i+=1) {
// duplicate track
G4Track* newTrack = new G4Track(
new G4DynamicParticle( *(track->GetDynamicParticle()) ),
track->GetGlobalTime(),
track->GetPosition()
);
newTrack->SetWeight( theParentWeight/double( MultiplicationForSecondaries) );
pChange->AddSecondary(newTrack);
}
} else {
track->SetWeight( theParentWeight );
pChange->AddSecondary(track);
}
}
delete tempList;
}
return pChange;
}
File diff suppressed because it is too large Load Diff
+9 -8
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4ParticleChange.cc,v 1.18 2001/11/21 14:05:58 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// $Id: G4ParticleChange.cc,v 1.21 2001/12/24 05:14:40 kurasige Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// --------------------------------------------------------------
@@ -128,10 +128,10 @@ void G4ParticleChange::AddSecondary(G4DynamicParticle* aParticle,
// set IsGoodGorTrackingFlag
if (IsGoodForTracking) aTrack->SetGoodForTrackingFlag();
// Touchable is a temporary object, so you cannot keep the pointer
aTrack->SetTouchableHandle((G4VTouchable*)0);
// add a secondary
// Touchable handle is copied to keep the pointer
aTrack->SetTouchableHandle(theCurrentTrack->GetTouchableHandle());
// add a secondary
G4VParticleChange::AddSecondary(aTrack);
}
@@ -163,7 +163,7 @@ void G4ParticleChange::AddSecondary(G4DynamicParticle* aParticle,
if (IsGoodForTracking) aTrack->SetGoodForTrackingFlag();
// Touchable handle is copied to keep the pointer
aTrack->SetTouchableHandle(theCurrentTrack->GetTouchableHandle());
aTrack->SetTouchableHandle(theCurrentTrack->GetTouchableHandle());
// add a secondary
G4VParticleChange::AddSecondary(aTrack);
@@ -268,7 +268,8 @@ G4Step* G4ParticleChange::UpdateStepForAlongStep(G4Step* pStep)
- pPreStepPoint->GetProperTime());
// update weight
pPostStepPoint->SetWeight( theWeightChange );
G4double newWeight= theWeightChange/(pPreStepPoint->GetWeight())*(pPostStepPoint->GetWeight());
pPostStepPoint->SetWeight( newWeight );
#ifdef G4VERBOSE
if (debugFlag) CheckIt(*aTrack);
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParticleChangeForDecay.cc,v 1.7 2001/08/16 08:17:59 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// --------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParticleChangeForLoss.cc,v 1.6 2001/07/11 10:08:39 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// --------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParticleChangeForMSC.cc,v 1.8 2001/08/16 08:17:59 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// --------------------------------------------------------------
@@ -22,7 +22,7 @@
//
//
// $Id: G4ParticleChangeForTransport.cc,v 1.11 2001/10/22 04:19:41 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// --------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4Step.cc,v 1.5 2001/07/11 10:08:39 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
//---------------------------------------------------------------
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4StepPoint.cc,v 1.7 2001/08/16 08:17:59 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// GEANT4 tag $Name: geant4-04-01 $
//
//
//---------------------------------------------------------------
+27 -6
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Track.cc,v 1.15 2001/12/10 08:36:54 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// $Id: G4Track.cc,v 1.18 2002/02/12 01:48:53 kurasige Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
//
//---------------------------------------------------------------
@@ -49,8 +49,9 @@ G4Track::G4Track(G4DynamicParticle* apValueDynamicParticle,
fpDynamicParticle(apValueDynamicParticle),
fTrackStatus(fAlive),
fBelowThreshold(false), fGoodForTracking(false),
fWeight(1.0),
fStepLength(0.0), fWeight(1.0),
fpStep(0),
fVtxKineticEnergy(0.0),
fpLVAtVertex(0), fpCreatorProcess(0),
fpUserInformation(0)
{
@@ -66,8 +67,9 @@ G4Track::G4Track()
fpDynamicParticle(0),
fTrackStatus(fAlive),
fBelowThreshold(false), fGoodForTracking(false),
fWeight(1.0),
fStepLength(0.0), fWeight(1.0),
fpStep(0),
fVtxKineticEnergy(0.0),
fpLVAtVertex(0), fpCreatorProcess(0),
fpUserInformation(0)
{
@@ -97,6 +99,7 @@ G4Track & G4Track::operator=(const G4Track &right)
fLocalTime = right.fLocalTime;
fTrackLength = right.fTrackLength;
fWeight = right.fWeight;
fStepLength = right.fStepLength;
// Track ID (and Parent ID) is not copied and set to zero for new track
fTrackID = 0;
@@ -131,10 +134,27 @@ G4Track & G4Track::operator=(const G4Track &right)
return *this;
}
///////////////////
void G4Track::CopyTrackInfo(const G4Track& right)
//////////////////
{
*this = right;
}
#include "G4ParticleTable.hh"
///////////////////
G4double G4Track::GetVelocity() const
///////////////////
{
static G4bool isFirstTime = true;
static G4ParticleDefinition* fOpticalPhoton =0;
if ( isFirstTime ) {
isFirstTime = false;
// set fOpticalPhoton
fOpticalPhoton = G4ParticleTable::GetParticleTable()->FindParticle("opticalphoton");
}
G4double velocity ;
G4double mass = fpDynamicParticle->GetMass();
@@ -144,8 +164,9 @@ G4double G4Track::GetVelocity() const
velocity = c_light ;
// special case for photons
if(fpDynamicParticle->GetDefinition()->GetParticleName()=="opticalphoton"){
G4Material*
if ( (fOpticalPhoton !=0) &&
(fpDynamicParticle->GetDefinition()==fOpticalPhoton) ){
G4Material*
mat=fpTouchable->GetVolume()->GetLogicalVolume()->GetMaterial();
if(mat->GetMaterialPropertiesTable() != 0){
-63
View File
@@ -1,63 +0,0 @@
//
// ********************************************************************
// * 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: G4VEvtBiasMechanism.cc,v 1.3 2001/07/11 10:08:40 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// --------------------------------------------------------------
// GEANT 4 class implementation file
//
//
//
// ------------------------------------------------------------
// Implemented for the new scheme 13 Apr. 1999 H.Kurahige
#include "G4VEvtBiasMechanism.hh"
G4VEvtBiasMechanism::G4VEvtBiasMechanism(const G4String& name):
theEBName(name)
{
}
G4VEvtBiasMechanism::G4VEvtBiasMechanism(const G4VEvtBiasMechanism& right)
{
theEBName = right.theEBName;
}
G4VEvtBiasMechanism::~G4VEvtBiasMechanism()
{
}
+2 -3
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VParticleChange.cc,v 1.9 2001/11/13 05:13:39 kurasige Exp $
// GEANT4 tag $Name: geant4-04-00 $
// $Id: G4VParticleChange.cc,v 1.10 2001/12/14 09:59:36 kurasige Exp $
// GEANT4 tag $Name: geant4-04-01 $
//
//
// --------------------------------------------------------------
@@ -37,7 +37,6 @@
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4TrackFastVector.hh"
#include "G4Mars5GeVMechanism.hh"
const G4double G4VParticleChange::accuracyForWarning = 1.0e-9;
const G4double G4VParticleChange::accuracyForException = 0.001;