80 lines
3.2 KiB
C++
80 lines
3.2 KiB
C++
//
|
|
// ********************************************************************
|
|
// * 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: StepMax.cc,v 1.1 2004/11/24 11:25:02 maire Exp $
|
|
// GEANT4 tag $Name: geant4-07-00-cand-01 $
|
|
//
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
|
|
#include "StepMax.hh"
|
|
#include "StepMaxMessenger.hh"
|
|
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
|
|
StepMax::StepMax(const G4String& processName)
|
|
: G4VDiscreteProcess(processName)
|
|
{
|
|
for (G4int k=0; k<MaxAbsor; k++) stepMax[k] = DBL_MAX;
|
|
pMess = new StepMaxMessenger(this);
|
|
}
|
|
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
|
|
StepMax::~StepMax() { delete pMess; }
|
|
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
|
|
G4bool StepMax::IsApplicable(const G4ParticleDefinition& particle)
|
|
{
|
|
return (particle.GetPDGCharge() != 0. && !particle.IsShortLived());
|
|
}
|
|
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
|
|
void StepMax::SetStepMax(G4int k,G4double step) {stepMax[k] = step;}
|
|
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
|
|
G4double StepMax::PostStepGetPhysicalInteractionLength( const G4Track& aTrack,
|
|
G4double,
|
|
G4ForceCondition* condition)
|
|
{
|
|
// condition is set to "Not Forced"
|
|
*condition = NotForced;
|
|
|
|
return stepMax[aTrack.GetVolume()->GetCopyNo()];
|
|
}
|
|
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
|
|
G4VParticleChange* StepMax::PostStepDoIt(const G4Track& aTrack, const G4Step&)
|
|
{
|
|
// do nothing
|
|
aParticleChange.Initialize(aTrack);
|
|
return &aParticleChange;
|
|
}
|
|
|
|
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
|
|
|
|