Import Geant4 10.4.0.beta source tree

This commit is contained in:
Gabriele Cosmo
2017-06-30 10:49:55 +02:00
parent 3a5407696b
commit 1a1316fea4
2180 changed files with 237880 additions and 59109 deletions
@@ -0,0 +1,140 @@
//
// ********************************************************************
// * 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 G4Channeling_h
#define G4Channeling_h 1
#include "G4ios.hh"
#include "globals.hh"
#include "G4VDiscreteProcess.hh"
#include "G4ChannelingMaterialData.hh"
#include "G4ExtendedMaterial.hh"
#include "G4LogicalCrystalVolume.hh"
class G4ChannelingTrackData;
class G4Channeling : public G4VDiscreteProcess
{
public:
G4Channeling();
virtual ~G4Channeling();
virtual G4VParticleChange* PostStepDoIt(const G4Track&,
const G4Step&);
virtual G4bool IsApplicable(const G4ParticleDefinition& aPD){
return(aPD.GetPDGCharge() != 0.);
};
virtual void BuildPhysicsTable(const G4ParticleDefinition&){;};
protected:
virtual G4double GetMeanFreePath(const G4Track&,
G4double,
G4ForceCondition*);
private:
G4ParticleDefinition* GetParticleDefinition(const G4Track& aTrack){
return const_cast<G4ParticleDefinition*>(aTrack.GetParticleDefinition());
}
private:
G4StepPoint* GetPre(const G4Track& aTrack){return aTrack.GetStep()->GetPreStepPoint();}
G4StepPoint* GetPost(const G4Track& aTrack){return aTrack.GetStep()->GetPostStepPoint();}
private:
G4ChannelingMaterialData* GetMatData(const G4Track& aTrack){
G4LogicalVolume* aLV = aTrack.GetVolume()->GetLogicalVolume();
if(aLV->IsExtended() == true){
G4ExtendedMaterial* aEM = (G4ExtendedMaterial*) aTrack.GetVolume()->GetLogicalVolume()->GetMaterial();
return (G4ChannelingMaterialData*) aEM->RetrieveExtension("channeling");
}
else{
return nullptr;
}
}
//----------------------------------------
// Functions for the calculations of
// parameters related to channeling
//----------------------------------------
public:
G4double GetCriticalAngle(const G4Track& aTrack){
return std::sqrt(2.0*GetMatData(aTrack)->GetPot()->GetMaxMin()
/GetPre(aTrack)->GetTotalEnergy());}
G4double GetOscillationPeriod(const G4Track& aTrack){
return (CLHEP::pi * GetMatData(aTrack)->GetPot()->GetIntSp(0)
/ GetCriticalAngle(aTrack));
}
//----------------------------------------
// Channeling Auxiliary Track Information
//----------------------------------------
private:
G4int fChannelingID;
G4ChannelingTrackData* GetTrackData(const G4Track&);
//----------------------------------------
// Variables for the integration
// of the particle trajectory
//----------------------------------------
private:
G4bool UpdateIntegrationStep(const G4Track&,
G4ThreeVector&,
G4double&);
G4bool UpdateParameters(const G4Track&);
void GetEF(const G4Track&,G4ThreeVector&,G4ThreeVector&);
public:
void PosToLattice(G4StepPoint* step,G4ThreeVector&);
public:
G4double GetTransverseVariationMax() {return fTransverseVariationMax;};
void SetTransverseVariationMax(G4double aDouble) {fTransverseVariationMax = aDouble;};
G4double GetTimeStepMin() {return fTimeStepMin;};
void SetTimeStepMin(G4double aDouble) {fTimeStepMin = aDouble;};
private:
G4double fTimeStepMin;
G4double fTimeStepMax;
G4double fTransverseVariationMax;
const G4ThreeVector k010;
G4ThreeVector fSpin;
};
#endif
@@ -0,0 +1,62 @@
//
// ********************************************************************
// * 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 G4ChannelingECHARM_h
#define G4ChannelingECHARM_h
#include "G4PhysicsVector.hh"
#include "G4Physics2DVector.hh"
#include "G4ThreeVector.hh"
class G4ChannelingECHARM {
public:
G4ChannelingECHARM(const G4String&,G4double);
~G4ChannelingECHARM();
//virtual function of XVCrystalCharacteristic
G4double GetEC(G4ThreeVector&);
virtual void ReadFromECHARM(const G4String&,G4double);
G4double GetMax() {return fMaximum;};
G4double GetMin() {return fMinimum;};
G4double GetMaxMin() {return fabs(fMaximum-fMinimum);};
G4double GetIntSp(G4int index) {return fDistances[index];};
private:
G4PhysicsVector* fVectorEC;
G4Physics2DVector* fVectorEC2D;
G4double fDistances[3];
G4int fPoints[3];
G4double fMaximum;
G4double fMinimum;
};
#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. *
// ********************************************************************
//
//
#ifndef G4ChannelingMaterialData_h
#define G4ChannelingMaterialData_h 1
#include "G4ios.hh"
#include "globals.hh"
#include "G4VMaterialExtension.hh"
#include "G4ChannelingECHARM.hh"
#include "G4StepPoint.hh"
#include "G4Track.hh"
#include <unordered_map>
#include "G4PhysicsLinearVector.hh"
class G4ChannelingMaterialData : public G4VMaterialExtension{
public:
G4ChannelingMaterialData(const G4String&);
virtual ~G4ChannelingMaterialData();
public:
void Print() const {G4cout << "Channeling Material Data" << G4endl;};
void SetFilename(const G4String&);
void SetFilenameElement(const G4String&,std::string);
public:
G4ChannelingECHARM* GetPot() {return fPotential;};
G4ChannelingECHARM* GetEFX() {return fElectricFieldX;};
G4ChannelingECHARM* GetEFY() {return fElectricFieldY;};
G4ChannelingECHARM* GetNuD() {return fNucleiDensity;};
G4ChannelingECHARM* GetElD() {return fElectronDensity;};
private:
G4ChannelingECHARM* fPotential;
G4ChannelingECHARM* fElectricFieldX;
G4ChannelingECHARM* fElectricFieldY;
G4ChannelingECHARM* fNucleiDensity;
G4ChannelingECHARM* fElectronDensity;
public:
G4ChannelingECHARM* GetPotEl(std::string name) {return fPotentialElement[name];};
G4ChannelingECHARM* GetEFXEl(std::string name) {return fElectricFieldXElement[name];};
G4ChannelingECHARM* GetEFYEl(std::string name) {return fElectricFieldYElement[name];};
G4ChannelingECHARM* GetNuDEl(std::string name) {return fNucleiDensityElement[name];};
G4ChannelingECHARM* GetElDEl(std::string name) {return fElectronDensityElement[name];};
private:
std::unordered_map<std::string,G4ChannelingECHARM*> fPotentialElement;
std::unordered_map<std::string,G4ChannelingECHARM*> fElectricFieldXElement;
std::unordered_map<std::string,G4ChannelingECHARM*> fElectricFieldYElement;
std::unordered_map<std::string,G4ChannelingECHARM*> fNucleiDensityElement;
std::unordered_map<std::string,G4ChannelingECHARM*> fElectronDensityElement;
public:
virtual G4bool IsBent() {
return bIsBent;
};
virtual G4ThreeVector GetBR(G4ThreeVector& v3) {
return G4ThreeVector(fVectorR->Value(v3.z()),0.,0.);
};
virtual void SetBR(const G4String&);
virtual void SetBR(G4double);
protected:
G4PhysicsVector* fVectorR;
G4bool bIsBent;
};
#endif
@@ -0,0 +1,103 @@
//
// ********************************************************************
// * 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: $
//---------------------------------------------------------------
//
// G4ChannelingOptrChangeCrossSection
// Based On GB01BOptrChangeCrossSection
// Class Description:
// A G4VBiasingOperator concrete implementation example to
// illustrate how to bias physics processes cross-section for
// one particle type.
// The G4VBiasingOperation G4BOptnChangeCrossSection is
// selected by this operator, and is sent to each process
// calling the operator.
// A simple constant bias to the cross-section is applied,
// but more sophisticated changes can be applied.
//
//---------------------------------------------------------------
//
#ifndef G4ChannelingOptrChangeCrossSection_hh
#define G4ChannelingOptrChangeCrossSection_hh 1
#include "G4VBiasingOperator.hh"
class G4BOptnChangeCrossSection;
class G4ParticleDefinition;
#include <map>
#include <unordered_map>
enum G4ChannelingDensityRatio{
fDensityRatioNotDefined = -1,
fDensityRatioNone = 0,
fDensityRatioNuDElD = 1,
fDensityRatioNuD = 2,
fDensityRatioElD = 3
};
class G4ChannelingOptrChangeCrossSection : public G4VBiasingOperator {
public:
// ------------------------------------------------------------
// -- Constructor: takes the name of the particle type to bias:
// ------------------------------------------------------------
G4ChannelingOptrChangeCrossSection(G4String particleToBias, G4String name = "ChannelingChangeXS");
virtual ~G4ChannelingOptrChangeCrossSection();
virtual void StartRun();
private:
G4int fChannelingID;
private:
virtual G4VBiasingOperation*
ProposeOccurenceBiasingOperation(const G4Track* track,
const G4BiasingProcessInterface* callingProcess);
virtual G4VBiasingOperation*
ProposeFinalStateBiasingOperation(const G4Track*, const G4BiasingProcessInterface*)
{return 0;}
virtual G4VBiasingOperation*
ProposeNonPhysicsBiasingOperation(const G4Track*, const G4BiasingProcessInterface*)
{return 0;}
private:
using G4VBiasingOperator::OperationApplied;
virtual void OperationApplied( const G4BiasingProcessInterface* callingProcess,
G4BiasingAppliedCase biasingCase,
G4VBiasingOperation* occurenceOperationApplied,
G4double weightForOccurenceInteraction,
G4VBiasingOperation* finalStateOperationApplied,
const G4VParticleChange* particleChangeProduced );
private:
std::map< const G4BiasingProcessInterface*,
G4BOptnChangeCrossSection* > fChangeCrossSectionOperations;
G4bool fSetup;
const G4ParticleDefinition* fParticleToBias;
private:
std::unordered_map<std::string,G4ChannelingDensityRatio> fProcessToDensity;
};
#endif
@@ -0,0 +1,113 @@
//
// ********************************************************************
// * 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: $
//-----------------------------------------------------------------
//
// G4ChannelingOptrMultiParticleChangeCrossSection
//
// Class Description:
// A G4VBiasingOperator concrete implementation example to
// illustrate how an operator can make use of an other operator.
// In the present case, the G4ChannelingOptrChangeCrossSection
// operator, that is made to bias processes of one particle
// type is instancied several times, one for each particle type
// to bias.
//
//-----------------------------------------------------------------
//
#ifndef G4ChannelingOptrMultiParticleChangeCrossSection_hh
#define G4ChannelingOptrMultiParticleChangeCrossSection_hh 1
#include "G4VBiasingOperator.hh"
class G4ChannelingOptrChangeCrossSection;
class G4ParticleDefinition;
#include <map>
class G4ChannelingOptrMultiParticleChangeCrossSection : public G4VBiasingOperator {
public:
G4ChannelingOptrMultiParticleChangeCrossSection();
virtual ~G4ChannelingOptrMultiParticleChangeCrossSection() {}
// ---------------------------------
// -- Method specific to this class:
// ---------------------------------
// -- Each particle type for which its name is passed will be biased; *provided*
// -- that the proper calls to biasingPhysics->Bias(particleName) have been done
// -- in the main program.
void AddParticle( G4String particleName );
void AddChargedParticles();
private:
// -----------------------------
// -- Mandatory from base class:
// -----------------------------
// -- This method returns a biasing operation that will bias the physics process occurence:
virtual G4VBiasingOperation*
ProposeOccurenceBiasingOperation(const G4Track* track,
const G4BiasingProcessInterface* callingProcess);
// -- Methods not used:
virtual G4VBiasingOperation*
ProposeFinalStateBiasingOperation(const G4Track*, const G4BiasingProcessInterface*)
{return 0;}
virtual G4VBiasingOperation*
ProposeNonPhysicsBiasingOperation(const G4Track*, const G4BiasingProcessInterface*)
{return 0;}
private:
// -- ("using" is to avoid compiler complaining against (false) method shadowing.)
using G4VBiasingOperator::OperationApplied;
// -- Optionnal base class method implementation.
// -- This method is called to inform the operator that a proposed operation has been applied.
// -- In the present case, it means that a physical interaction occured (interaction at
// -- PostStepDoIt level):
virtual void OperationApplied( const G4BiasingProcessInterface* callingProcess,
G4BiasingAppliedCase biasingCase,
G4VBiasingOperation* occurenceOperationApplied,
G4double weightForOccurenceInteraction,
G4VBiasingOperation* finalStateOperationApplied,
const G4VParticleChange* particleChangeProduced );
public:
// -- Optionnal base class method. It is called at the time a tracking of a particle starts:
void StartTracking( const G4Track* track );
private:
// -- List of associations between particle types and biasing operators:
std::map < const G4ParticleDefinition*,
G4ChannelingOptrChangeCrossSection* > fBOptrForParticle;
std::vector < const G4ParticleDefinition* > fParticlesToBias;
G4ChannelingOptrChangeCrossSection* fCurrentOperator;
// -- count number of biased interations for current track:
G4int fnInteractions;
};
#endif
@@ -0,0 +1,108 @@
//
// ********************************************************************
// * 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: $
//
// --------------------------------------------------------------------
// GEANT 4 class header file
//
// Class Description:
// Extends G4Track properties with information needed for the
// channeling biasing operator.
//
// ------------------ G4ChannelingTrackData ------------------
//
// Author: M.Verderi (LLR), E. Bagli (INFN) April 2016
//
// --------------------------------------------------------------------
#ifndef G4ChannelingTrackData_hh
#define G4ChannelingTrackData_hh
class G4Channeling;
#include "G4VAuxiliaryTrackInformation.hh"
#include "G4ThreeVector.hh"
class G4ChannelingTrackData : public G4VAuxiliaryTrackInformation {
friend class G4Channeling;
public:
G4ChannelingTrackData();
~G4ChannelingTrackData();
void Print() const;
private:
const G4Channeling* fChannelingProcess;
public:
void Reset(){
fChannelingProcess = nullptr;
fNuD = fElD = 1.;
fPosCh = fMomCh = fDBL;
}
public:
G4double GetDensity() {return (fNuD + fElD) * 0.5;}
void SetNuD(G4double aDouble) {fNuD = aDouble;};
G4double GetNuD() {return fNuD;};
void SetElD(G4double aDouble) {fElD = aDouble;};
G4double GetElD() {return fElD;};
void SetEFX(G4double aDouble) {fEFX = aDouble;};
G4double GetEFX() {return fEFX;};
void SetEFY(G4double aDouble) {fEFY = aDouble;};
G4double GetEFY() {return fEFY;};
G4ThreeVector GetMomCh() {return fMomCh;}
void SetMomCh(G4ThreeVector a3vec) {fMomCh = a3vec;}
G4ThreeVector GetPosCh() {return fPosCh;}
void SetPosCh(G4ThreeVector a3vec) {fPosCh = a3vec;}
private:
// ----------
// DBL_MAX vector for reset
// ----------
G4ThreeVector fDBL;
// ----------
// Positiona and momentum in the crystal reference frame
// ----------
G4ThreeVector fMomCh;
G4ThreeVector fPosCh;
G4double fNuD;
G4double fElD;
G4double fEFX;
G4double fEFY;
};
#endif