Import Geant4 4.1.0 source tree
This commit is contained in:
@@ -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
@@ -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);
|
||||
|
||||
@@ -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 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -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 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -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 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
|
||||
@@ -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 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -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 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
@@ -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){
|
||||
|
||||
@@ -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()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user