Import Geant4 9.4.0 source tree
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef G4EnergySplitter_h
|
||||
#define G4EnergySplitter_h 1
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// (Description)
|
||||
//
|
||||
// Class to calculate the split of energy in voxels when G4RegularNavigation is used
|
||||
// It takes into account energy loss and multiple scattering corrections as the particles loses energies from voxel to voxel
|
||||
//
|
||||
// Created: 2010-11-09 Pedro Arce
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
#include "globals.hh"
|
||||
class G4PhantomParameterisation;
|
||||
class G4EnergyLossForExtrapolator;
|
||||
class G4VPhysicalVolume;
|
||||
class G4Material;
|
||||
class G4Step;
|
||||
#include <vector>
|
||||
|
||||
class G4EnergySplitter
|
||||
{
|
||||
public: // with description
|
||||
G4EnergySplitter();
|
||||
virtual ~G4EnergySplitter();
|
||||
|
||||
G4int SplitEnergyInVolumes(const G4Step* aStep ); // Calculates the energy spliting, and dumps it into theEnergies. Returns number of steps
|
||||
|
||||
inline void GetLastVoxelID( G4int& voxelID);
|
||||
inline void GetFirstVoxelID( G4int& voxelID);
|
||||
inline void GetVoxelID( G4int stepNo, G4int& voxelID );
|
||||
inline void GetVoxelIDAndLength( G4int stepNo, G4int& voxelID, G4double& stepLength );
|
||||
inline void GetLengthAndEnergyDeposited( G4int stepNo, G4int& voxelID, G4double& stepLength, G4double &energyLoss);
|
||||
inline void GetLengthAndInitialEnergy( G4double &preStepEnergy, G4int stepNo, G4int& voxelID, G4double& stepLength, G4double &initialEnergy);
|
||||
|
||||
inline void SetNIterations( G4int niter );
|
||||
|
||||
inline G4Material* GetVoxelMaterial( G4int stepNo );
|
||||
|
||||
private:
|
||||
inline void GetStepLength( G4int stepNo, G4double& stepLength );
|
||||
|
||||
void GetPhantomParam(G4bool mustExist);
|
||||
G4bool IsPhantomVolume( G4VPhysicalVolume* pv );
|
||||
|
||||
G4EnergyLossForExtrapolator* theElossExt;
|
||||
|
||||
G4int theNIterations;
|
||||
|
||||
std::vector<G4double> theEnergies;
|
||||
|
||||
G4PhantomParameterisation* thePhantomParam;
|
||||
|
||||
};
|
||||
|
||||
#include "G4EnergySplitter.icc"
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,106 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#include "G4RegularNavigationHelper.hh"
|
||||
#include "G4UIcommand.hh"
|
||||
#include "G4PhantomParameterisation.hh"
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
inline void G4EnergySplitter::GetLastVoxelID( G4int& voxelID)
|
||||
{
|
||||
voxelID = (*(G4RegularNavigationHelper::theStepLengths.begin())).first;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
inline void G4EnergySplitter::GetFirstVoxelID( G4int& voxelID)
|
||||
{
|
||||
voxelID = (*(G4RegularNavigationHelper::theStepLengths.rbegin())).first;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
inline void G4EnergySplitter::GetVoxelID( G4int stepNo, G4int& voxelID )
|
||||
{
|
||||
if( stepNo < 0 || stepNo >= G4int(G4RegularNavigationHelper::theStepLengths.size()) ) {
|
||||
G4Exception("G4EnergySplitter::GetVoxelID",
|
||||
"Invalid stepNo, smaller than 0 or bigger or equal to number of voxels traversed",
|
||||
FatalErrorInArgument,
|
||||
G4String("stepNo = " + G4UIcommand::ConvertToString(stepNo) + ", number of voxels = " + G4UIcommand::ConvertToString(G4int(G4RegularNavigationHelper::theStepLengths.size())) ).c_str());
|
||||
}
|
||||
std::vector< std::pair<G4int,G4double> >::const_iterator ite = G4RegularNavigationHelper::theStepLengths.begin();
|
||||
advance( ite, stepNo );
|
||||
voxelID = (*ite).first;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
inline void G4EnergySplitter::GetStepLength( G4int stepNo, G4double& stepLength )
|
||||
{
|
||||
std::vector< std::pair<G4int,G4double> >::const_iterator ite = G4RegularNavigationHelper::theStepLengths.begin();
|
||||
advance( ite, stepNo );
|
||||
stepLength = (*ite).second;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
inline void G4EnergySplitter::GetVoxelIDAndLength( G4int stepNo, G4int& voxelID, G4double& stepLength )
|
||||
{
|
||||
GetVoxelID( stepNo, voxelID );
|
||||
GetStepLength( stepNo, stepLength);
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
inline void G4EnergySplitter::GetLengthAndEnergyDeposited( G4int stepNo, G4int& voxelID, G4double& stepLength, G4double &energyLoss)
|
||||
{
|
||||
GetVoxelIDAndLength( stepNo, voxelID, stepLength );
|
||||
|
||||
energyLoss = theEnergies[stepNo];
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
inline void G4EnergySplitter::GetLengthAndInitialEnergy( G4double &preStepEnergy, G4int stepNo, G4int& voxelID, G4double& stepLength, G4double &initialEnergy)
|
||||
{
|
||||
GetVoxelIDAndLength( stepNo, voxelID, stepLength );
|
||||
|
||||
initialEnergy = preStepEnergy;
|
||||
for( G4int ii = 0; ii < stepNo; ii++ ){
|
||||
initialEnergy -= theEnergies[stepNo];
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
inline void G4EnergySplitter::SetNIterations( G4int niter )
|
||||
{
|
||||
theNIterations = niter;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
inline G4Material* G4EnergySplitter::GetVoxelMaterial( G4int stepNo )
|
||||
{
|
||||
if( !thePhantomParam ) GetPhantomParam(TRUE);
|
||||
G4int voxelID;
|
||||
GetVoxelID( stepNo, voxelID );
|
||||
return thePhantomParam->GetMaterial( voxelID );
|
||||
}
|
||||
|
||||
@@ -0,0 +1,168 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * 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: G4ScoreSplittingProcess.hh,v 1.4 2010/11/22 14:30:49 japost Exp $
|
||||
// GEANT4 tag $Name: geant4-09-04 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// G4ScoreSplittingProcess.hh
|
||||
//
|
||||
// Description:
|
||||
// This process is used to split the length and energy
|
||||
// of a step in a regular structure into sub-steps, and to
|
||||
// call the scorers for each sub-volume.
|
||||
// It invokes sensitive detectors assigned in the *mass*
|
||||
// world.
|
||||
//
|
||||
// Design and first implementation: J. Apostolakis / M.Asai 2010
|
||||
//---------------------------------------------------------------
|
||||
|
||||
|
||||
#ifndef G4ScoreSplittingProcess_h
|
||||
#define G4ScoreSplittingProcess_h 1
|
||||
|
||||
#include "globals.hh"
|
||||
class G4Step;
|
||||
class G4Navigator;
|
||||
class G4TransportationManager;
|
||||
class G4PathFinder;
|
||||
class G4VTouchable;
|
||||
class G4VPhysicalVolume;
|
||||
class G4ParticleChange;
|
||||
class G4EnergySplitter;
|
||||
|
||||
#include "G4VProcess.hh"
|
||||
#include "G4FieldTrack.hh"
|
||||
#include "G4TouchableHandle.hh"
|
||||
class G4TouchableHistory;
|
||||
// #include "G4TouchableHistory.hh"
|
||||
|
||||
//------------------------------------------
|
||||
//
|
||||
// G4ScoreSplittingProcess class
|
||||
//
|
||||
//------------------------------------------
|
||||
|
||||
|
||||
// Class Description:
|
||||
|
||||
class G4ScoreSplittingProcess : public G4VProcess
|
||||
{
|
||||
public: // with description
|
||||
|
||||
//------------------------
|
||||
// Constructor/Destructor
|
||||
//------------------------
|
||||
|
||||
G4ScoreSplittingProcess(const G4String& processName = "ScoreSplittingProc",
|
||||
G4ProcessType theType = fParameterisation);
|
||||
virtual ~G4ScoreSplittingProcess();
|
||||
|
||||
//--------------------------------------------------------------
|
||||
// Process interface
|
||||
//--------------------------------------------------------------
|
||||
|
||||
void StartTracking(G4Track*);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// GetPhysicalInteractionLength() and DoIt() methods for AtRest
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
G4double AtRestGetPhysicalInteractionLength(
|
||||
const G4Track& ,
|
||||
G4ForceCondition*
|
||||
);
|
||||
|
||||
G4VParticleChange* AtRestDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
//------------------------------------------------------------------------
|
||||
// GetPhysicalInteractionLength() and DoIt() methods for AlongStep
|
||||
//------------------------------------------------------------------------
|
||||
|
||||
G4double AlongStepGetPhysicalInteractionLength(
|
||||
const G4Track&,
|
||||
G4double ,
|
||||
G4double ,
|
||||
G4double&,
|
||||
G4GPILSelection*
|
||||
);
|
||||
|
||||
G4VParticleChange* AlongStepDoIt(
|
||||
const G4Track& ,
|
||||
const G4Step&
|
||||
);
|
||||
|
||||
//-----------------------------------------------------------------------
|
||||
// GetPhysicalInteractionLength() and DoIt() methods for PostStep
|
||||
//-----------------------------------------------------------------------
|
||||
|
||||
G4double PostStepGetPhysicalInteractionLength(const G4Track& track,
|
||||
G4double previousStepSize,
|
||||
G4ForceCondition* condition);
|
||||
|
||||
G4VParticleChange* PostStepDoIt(const G4Track& ,const G4Step& );
|
||||
|
||||
private:
|
||||
G4TouchableHistory* CreateTouchableForSubStep( G4int newVoxelNum, G4ThreeVector newPosition );
|
||||
|
||||
private:
|
||||
void CopyStepStart(const G4Step & step);
|
||||
|
||||
G4Step * fSplitStep;
|
||||
G4StepPoint *fSplitPreStepPoint;
|
||||
G4StepPoint *fSplitPostStepPoint;
|
||||
|
||||
G4VParticleChange dummyParticleChange;
|
||||
G4ParticleChange xParticleChange;
|
||||
|
||||
// G4TransportationManager* fTransportationManager;
|
||||
// G4PathFinder* fPathFinder;
|
||||
|
||||
// -------------------------------
|
||||
// Touchables for the Split Step
|
||||
// -------------------------------
|
||||
G4TouchableHandle fOldTouchableH;
|
||||
G4TouchableHandle fNewTouchableH;
|
||||
|
||||
// Memory of Touchables of full step
|
||||
G4TouchableHandle fInitialTouchableH;
|
||||
G4TouchableHandle fFinalTouchableH;
|
||||
|
||||
G4EnergySplitter *fpEnergySplitter;
|
||||
|
||||
// ******************************************************
|
||||
// For TESTS:
|
||||
// ******************************************************
|
||||
public:
|
||||
void Verbose(const G4Step&) const;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user