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,72 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file exoticphysics/dmparticle/src/DetectorConstruction.cc
/// \brief Implementation of the DetectorConstruction class
//
// $Id: ActionInitialization.cc 66241 2012-12-13 18:34:42Z gunter $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.....
#include "ActionInitialization.hh"
#include "RunAction.hh"
#include "EventAction.hh"
#include "StackingAction.hh"
#include "PrimaryGeneratorAction.hh"
#include "DetectorConstruction.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ActionInitialization::ActionInitialization(DetectorConstruction* det)
: G4VUserActionInitialization()
{
fDetector = det;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ActionInitialization::~ActionInitialization()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ActionInitialization::Build() const
{
SetUserAction(new PrimaryGeneratorAction(fDetector));
SetUserAction(new RunAction());
SetUserAction(new EventAction());
SetUserAction(new StackingAction());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ActionInitialization::BuildForMaster() const
{
SetUserAction(new RunAction());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,188 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file exoticphysics/dmparticle/src/DetectorConstruction.cc
/// \brief Implementation of the DetectorConstruction class
//
// $Id: DetectorConstruction.cc 68036 2013-03-13 14:13:45Z gcosmo $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "DetectorConstruction.hh"
#include "DetectorMessenger.hh"
#include "G4Material.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
#include "TargetSD.hh"
#include "G4SDManager.hh"
#include "G4GeometryManager.hh"
#include "G4UnitsTable.hh"
#include "G4NistManager.hh"
#include "G4FieldManager.hh"
#include "G4ThreeVector.hh"
#include "G4RunManager.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorConstruction::DetectorConstruction()
: G4VUserDetectorConstruction(),
fAbsorMaterial(nullptr),
fLogAbsor(nullptr),
fWorld(nullptr)
{
// default parameter values
fAbsorSizeZ = fAbsorSizeXY = 10 * cm;
fWorldSizeZ = fWorldSizeXY = 1.2 * fAbsorSizeZ;
SetMaterial("G4_Al");
fWorldMaterial =
G4NistManager::Instance()->FindOrBuildMaterial("G4_Galactic");
// create commands for interactive definition of the detector
fDetectorMessenger = new DetectorMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorConstruction::~DetectorConstruction()
{
delete fDetectorMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* DetectorConstruction::Construct()
{
if(fWorld) { return fWorld; }
/**************************** World *****************************/
G4Box * sWorld = new G4Box("world",
fWorldSizeXY / 2, fWorldSizeXY / 2, fWorldSizeZ / 2);
G4LogicalVolume * lWorld = new G4LogicalVolume(sWorld,
fWorldMaterial,
"world");
fWorld = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
lWorld, //logical volume
"world", //name
0, //mother volume
false, //no boolean operation
0); //copy number
/************************** Absorber ***************************/
G4Box * sAbsor = new G4Box("Absorber",
fAbsorSizeXY / 2, fAbsorSizeXY / 2, fAbsorSizeZ / 2);
fLogAbsor = new G4LogicalVolume(sAbsor,
fAbsorMaterial,
"Absorber");
new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
fLogAbsor, //logical volume
"Absorber", //name
lWorld, //mother volume
false, //no boolean operation
0); //copy number
PrintParameters();
/************ always return the World volume *****************/
return fWorld;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::PrintParameters()
{
G4cout << "\n---------------------------------------------------------\n";
G4cout << "---> The Absorber is " << G4BestUnit(fAbsorSizeZ, "Length")
<< " of " << fAbsorMaterial->GetName() << G4endl;
G4cout << "\n---------------------------------------------------------\n";
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetSizeZ(G4double value)
{
if(value > 0.0) {
fAbsorSizeZ = value;
fWorldSizeZ = 1.2 * fAbsorSizeZ;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetSizeXY(G4double value)
{
if(value > 0.0)
{
fAbsorSizeXY = value;
fWorldSizeXY = 1.2 * fAbsorSizeXY;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::SetMaterial(const G4String& namemat)
{
// search the material by its name
G4Material* mat = G4NistManager::Instance()->FindOrBuildMaterial(namemat);
if(!mat) {
G4cout << "!!! DetectorConstruction::SetMaterial: WARNING Material <"
<< namemat << "> does not exist in DB" << G4endl;
return;
}
// new material is found out
if (mat != fAbsorMaterial) {
fAbsorMaterial = mat;
if(fLogAbsor) { fLogAbsor->SetMaterial(mat); }
G4RunManager::GetRunManager()->PhysicsHasBeenModified();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorConstruction::ConstructSDandField()
{
auto sd = new TargetSD("Target");
G4SDManager::GetSDMpointer()->AddNewDetector(sd);
SetSensitiveDetector(fLogAbsor, sd);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,99 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file exoticphysics/dmparticle/src/DetectorMessenger.cc
/// \brief Implementation of the DetectorMessenger class
//
// $Id: DetectorMessenger.cc 68036 2013-03-13 14:13:45Z gcosmo $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "DetectorMessenger.hh"
#include "DetectorConstruction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWith3VectorAndUnit.hh"
#include "G4UIcmdWithoutParameter.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorMessenger::DetectorMessenger(DetectorConstruction * det)
: G4UImessenger(), fDetector(det)
{
fDetD = new G4UIdirectory("/testex/");
fDetD->SetGuidance("dmparticle example commands");
fDetDir = new G4UIdirectory("/testex/det/");
fDetDir->SetGuidance("detector construction commands");
fMaterCmd = new G4UIcmdWithAString("/testex/det/setMat",this);
fMaterCmd->SetGuidance("Select material of the box.");
fMaterCmd->SetParameterName("choice",false);
fMaterCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fSizeZCmd = new G4UIcmdWithADoubleAndUnit("/testex/det/setSizeZ",this);
fSizeZCmd->SetGuidance("Set sizeX of the absorber");
fSizeZCmd->SetParameterName("SizeZ",false);
fSizeZCmd->SetRange("SizeZ>0.");
fSizeZCmd->SetUnitCategory("Length");
fSizeZCmd->AvailableForStates(G4State_PreInit);
fSizeXYCmd = new G4UIcmdWithADoubleAndUnit("/testex/det/setSizeXY",this);
fSizeXYCmd->SetGuidance("Set sizeYZ of the absorber");
fSizeXYCmd->SetParameterName("SizeXY",false);
fSizeXYCmd->SetRange("SizeXY>0.");
fSizeXYCmd->SetUnitCategory("Length");
fSizeXYCmd->AvailableForStates(G4State_PreInit);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
DetectorMessenger::~DetectorMessenger()
{
delete fMaterCmd;
delete fSizeZCmd;
delete fSizeXYCmd;
delete fDetDir;
delete fDetD;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{
if( command == fMaterCmd )
{ fDetector->SetMaterial(newValue);}
if( command == fSizeZCmd )
{ fDetector->SetSizeZ(fSizeZCmd->GetNewDoubleValue(newValue));}
if( command == fSizeXYCmd )
{ fDetector->SetSizeXY(fSizeXYCmd->GetNewDoubleValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,79 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file exoticphysics/dmparticle/src/EventAction.cc
/// \brief Implementation of the EventAction class
//
// $Id: EventAction.cc 85243 2014-10-27 08:22:42Z gcosmo $
//
//---------------------------------------------------------------------------
//
// ClassName: EventAction
//
// Author: V.Ivanchenko 01.09.2010
//
//----------------------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "EventAction.hh"
#include "Run.hh"
#include "G4Event.hh"
#include "G4RunManager.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
EventAction::EventAction()
: G4UserEventAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
EventAction::~EventAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void EventAction::BeginOfEventAction(const G4Event*)
{
//additional initializations
Run* run
= static_cast<Run*>(G4RunManager::GetRunManager()->GetNonConstCurrentRun());
run->BeginOfEvent();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void EventAction::EndOfEventAction(const G4Event*)
{
Run* run
= static_cast<Run*>(G4RunManager::GetRunManager()->GetNonConstCurrentRun());
run->EndOfEvent();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,230 @@
//
// ********************************************************************
// * 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: G4hLDMBremModel.cc 74020 2013-09-19 13:38:38Z gcosmo $
//
// -------------------------------------------------------------------
//
// 21.03.17 V. Grichine based on G4hBremsstrahlungModel
//
// Class Description:
//
// Implementation of energy loss for LDMPhoton emission by hadrons
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4LDMBremModel.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4Log.hh"
#include "G4LDMPhoton.hh"
#include "G4ParticleChangeForLoss.hh"
#include "TestParameters.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
using namespace std;
G4LDMBremModel::G4LDMBremModel(const G4ParticleDefinition* p,
const G4String& nam)
: G4MuBremsstrahlungModel(p, nam)
{
fEpsilon = TestParameters::GetPointer()->GetAlphaFactor();
theLDMPhoton = G4LDMPhoton::LDMPhoton();
fLDMPhotonMass = theLDMPhoton->GetPDGMass();
minThreshold = 1.2*fLDMPhotonMass;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LDMBremModel::~G4LDMBremModel()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4LDMBremModel::ComputeDEDXPerVolume(const G4Material*,
const G4ParticleDefinition*,
G4double, G4double)
{
return 0.0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4LDMBremModel::ComputeDMicroscopicCrossSection(
G4double tkin,
G4double Z,
G4double gammaEnergy)
// differential cross section
{
G4double dxsection = 0.;
if( gammaEnergy > tkin || tkin < minThreshold) return dxsection;
/*
G4cout << "G4LDMBremModel m= " << mass
<< " " << particle->GetParticleName()
<< " Egamma(GeV)= " << gammaEnergy/GeV
<< " Ekin(GeV)= " << tkin/GeV << G4endl;
*/
G4double E = tkin + mass ;
G4double v = gammaEnergy/E ;
G4double delta = 0.5*mass*mass*v/(E-gammaEnergy) ;
G4double rab0=delta*sqrte ;
G4int iz = std::max(1,std::min(G4lrint(Z),99));
G4double z13 = 1.0/nist->GetZ13(iz);
G4double dn = mass*nist->GetA27(iz)/(70.*MeV);
G4double b = btf;
if(1 == iz) b = bh;
// nucleus contribution logarithm
G4double rab1=b*z13;
G4double fn=G4Log(rab1/(dn*(electron_mass_c2+rab0*rab1))*
(mass+delta*(dn*sqrte-2.))) ;
if(fn <0.) fn = 0. ;
G4double x = 1.0 - v;
if(particle->GetPDGSpin() != 0) { x += 0.75*v*v; }
dxsection = coeff*x*Z*Z*fn/gammaEnergy;
return dxsection;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4LDMBremModel::ComputeCrossSectionPerAtom(
const G4ParticleDefinition*,
G4double kineticEnergy,
G4double Z, G4double,
G4double cutEnergy,
G4double maxEnergy)
{
G4double cross = 0.0;
if (kineticEnergy <= lowestKinEnergy) return cross;
G4double tmax = std::min(maxEnergy, kineticEnergy);
G4double cut = std::min(cutEnergy, kineticEnergy);
cut = std::max(cut, minThreshold);
if (cut >= tmax) return cross;
cross = ComputeMicroscopicCrossSection (kineticEnergy, Z, cut);
if(tmax < kineticEnergy)
{
cross -= ComputeMicroscopicCrossSection(kineticEnergy, Z, tmax);
}
cross *= fEpsilon*fEpsilon;
return cross;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4LDMBremModel::SampleSecondaries(
std::vector<G4DynamicParticle*>* vdp,
const G4MaterialCutsCouple* couple,
const G4DynamicParticle* dp,
G4double minEnergy,
G4double maxEnergy)
{
G4double kineticEnergy = dp->GetKineticEnergy();
// check against insufficient energy
G4double tmax = std::min(kineticEnergy, maxEnergy);
G4double tmin = std::min(kineticEnergy, minEnergy);
tmin = std::max(tmin, minThreshold);
if(tmin >= tmax) return;
// ===== sampling of energy transfer ======
G4ParticleMomentum partDirection = dp->GetMomentumDirection();
// select randomly one element constituing the material
const G4Element* anElement = SelectRandomAtom(couple,particle,kineticEnergy);
G4double Z = anElement->GetZ();
G4double totalEnergy = kineticEnergy + mass;
G4double totalMomentum = sqrt(kineticEnergy*(kineticEnergy + 2.0*mass));
G4double func1 = tmin*
ComputeDMicroscopicCrossSection(kineticEnergy,Z,tmin);
G4double lnepksi, epksi;
G4double func2;
G4double xmin = G4Log(tmin/MeV);
G4double xmax = G4Log(tmax/tmin);
do
{
lnepksi = xmin + G4UniformRand()*xmax;
epksi = MeV*G4Exp(lnepksi);
func2 = epksi*ComputeDMicroscopicCrossSection(kineticEnergy,Z,epksi);
// Loop checking, 03-Aug-2015, Vladimir Ivanchenko
} while(func2 < func1*G4UniformRand());
G4double gEnergy = std::max(epksi, fLDMPhotonMass);
G4double gMomentum =
std::sqrt((epksi - fLDMPhotonMass)*(epksi + fLDMPhotonMass));
// ===== sample angle =====
G4double gam = totalEnergy/mass;
G4double rmax = gam*std::min(1.0, totalEnergy/gEnergy - 1.0);
G4double rmax2= rmax*rmax;
G4double x = G4UniformRand()*rmax2/(1.0 + rmax2);
G4double theta = std::sqrt(x/(1.0 - x))/gam;
G4double sint = std::sin(theta);
G4double phi = twopi * G4UniformRand() ;
G4double dirx = sint*cos(phi), diry = sint*sin(phi), dirz = cos(theta) ;
G4ThreeVector gDirection(dirx, diry, dirz);
gDirection.rotateUz(partDirection);
partDirection *= totalMomentum;
partDirection -= gMomentum*gDirection;
partDirection = partDirection.unit();
// primary change
kineticEnergy -= gEnergy;
fParticleChange->SetProposedKineticEnergy(kineticEnergy);
fParticleChange->SetProposedMomentumDirection(partDirection);
// save secondary
G4DynamicParticle* aLDMPhoton =
new G4DynamicParticle(theLDMPhoton,gDirection,gEnergy);
vdp->push_back(aLDMPhoton);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,102 @@
//
// ********************************************************************
// * 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: G4LDMBremsstrahlung.cc 97391 2016-06-02 10:08:45Z gcosmo $
//
// -------------------------------------------------------------------
//
// GEANT4 Class file
//
//
// File name: G4LDMBremsstrahlung
//
// Author: Vladimir Ivanchenko on base of model for muons
//
// Creation date: 01.03.2008
//
// Modifications:
//
//
// -------------------------------------------------------------------
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4LDMBremsstrahlung.hh"
#include "G4SystemOfUnits.hh"
#include "G4LDMBremModel.hh"
#include "G4LDMPhoton.hh"
#include "G4EmParameters.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
using namespace std;
G4LDMBremsstrahlung::G4LDMBremsstrahlung(const G4String& name)
: G4MuBremsstrahlung(name)
{
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LDMBremsstrahlung::~G4LDMBremsstrahlung()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool G4LDMBremsstrahlung::IsApplicable(const G4ParticleDefinition& p)
{
return (p.GetPDGCharge() != 0.0 && p.GetPDGMass() > 110.0*MeV);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double G4LDMBremsstrahlung::MinPrimaryEnergy(const G4ParticleDefinition*,
const G4Material*, G4double)
{
return MinKinEnergy();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void G4LDMBremsstrahlung::InitialiseEnergyLossProcess(
const G4ParticleDefinition*,
const G4ParticleDefinition*)
{
if(!isInitialised) {
isInitialised = true;
if (!EmModel()) { SetEmModel(new G4LDMBremModel()); }
G4VEmFluctuationModel* fm = nullptr;
G4EmParameters* param = G4EmParameters::Instance();
EmModel()->SetLowEnergyLimit(param->MinKinEnergy());
EmModel()->SetHighEnergyLimit(param->MaxKinEnergy());
AddEmModel(1, EmModel(), fm);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,112 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file exoticphysics/dmparticle/src/G4LDMHi.cc
/// \brief Implementation of the G4LDMHi class
//
// $Id: G4LDMHi.cc 66817 2013-01-12 16:16:08Z gcosmo $
//
//---------------------------------------------------------------------------
//
// ClassName: G4LDMHi
//
// Description:
//
// 15.03.17 V. Grichine based on G4Monopole
//
// Modified:
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4LDMHi.hh"
#include "G4ParticleTable.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LDMHi* G4LDMHi::theLDMHi = nullptr;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LDMHi::G4LDMHi(
const G4String& aName, G4double mass,
G4double width, G4double charge,
G4int iSpin, G4int iParity,
G4int iConjugation, G4int iIsospin,
G4int iIsospin3, G4int gParity,
const G4String& pType, G4int lepton,
G4int baryon, G4int encoding,
G4bool stable, G4double lifetime,
G4DecayTable *decaytable)
: G4ParticleDefinition( aName, mass, width, charge, iSpin, iParity,
iConjugation, iIsospin, iIsospin3, gParity, pType,
lepton, baryon, encoding, stable, lifetime, decaytable )
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LDMHi::~G4LDMHi()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
// Arguments for constructor are as follows
// name mass width charge
// 2*spin parity C-conjugation
// 2*Isospin 2*Isospin3 G-parity
// type lepton number baryon number PDG encoding
// stable lifetime decay table
//
//
G4LDMHi* G4LDMHi::LDMHiDefinition(G4double mass)
{
if(!theLDMHi)
{
theLDMHi = new G4LDMHi(
"ldmhi", mass, 0.0*MeV, 0,
0, -1, -1,
0, 0, 0,
"boson", 0, 0, 51,
true, -1.0, 0);
G4cout << "LDMHi is created: m(GeV)= " << theLDMHi->GetPDGMass()/GeV
<< G4endl;
}
return theLDMHi;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LDMHi* G4LDMHi::LDMHi()
{
return theLDMHi;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,109 @@
//
// ********************************************************************
// * 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: G4LDMHiBar.cc 66817 2013-01-12 16:16:08Z gcosmo $
//
//---------------------------------------------------------------------------
//
// ClassName: G4LDMHiBar
//
// Description:
//
// 15.03.17 V. Grichine based on G4Monopole
//
// Modified:
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4LDMHiBar.hh"
#include "G4ParticleTable.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LDMHiBar* G4LDMHiBar::theLDMHiBar = nullptr;
G4LDMHiBar::G4LDMHiBar(
const G4String& aName, G4double mass,
G4double width, G4double charge,
G4int iSpin, G4int iParity,
G4int iConjugation, G4int iIsospin,
G4int iIsospin3, G4int gParity,
const G4String& pType, G4int lepton,
G4int baryon, G4int encoding,
G4bool stable, G4double lifetime,
G4DecayTable *decaytable)
: G4ParticleDefinition( aName, mass, width, charge, iSpin, iParity,
iConjugation, iIsospin, iIsospin3, gParity, pType,
lepton, baryon, encoding, stable, lifetime, decaytable )
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LDMHiBar::~G4LDMHiBar()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
// Arguments for constructor are as follows
// name mass width charge
// 2*spin parity C-conjugation
// 2*Isospin 2*Isospin3 G-parity
// type lepton number baryon number PDG encoding
// stable lifetime decay table
//
//
G4LDMHiBar* G4LDMHiBar::LDMHiBarDefinition(G4double mass)
{
if(!theLDMHiBar)
{
theLDMHiBar = new G4LDMHiBar(
"ldmhibar", mass, 0.0*MeV, 0,
0, -1, -1,
0, 0, 0,
"boson", 0, 0, -51,
true, -1.0, 0);
G4cout << "LDMHiBar is created: m(GeV)= " << theLDMHiBar->GetPDGMass()/GeV
<< G4endl;
}
return theLDMHiBar;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LDMHiBar* G4LDMHiBar::LDMHiBar()
{
return theLDMHiBar;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,133 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file exoticphysics/dmparticle/src/G4LDMPhoton.cc
/// \brief Implementation of the G4LDMPhoton class
//
// $Id: G4LDMPhoton.cc 66817 2013-01-12 16:16:08Z gcosmo $
//
//---------------------------------------------------------------------------
//
// ClassName: G4LDMPhoton
//
// Description:
//
// 15.03.17 V. Grichine based on G4Monopole
//
// Modified:
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4LDMPhoton.hh"
#include "G4ParticleTable.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4DecayTable.hh"
#include "G4VDecayChannel.hh"
#include "G4PhaseSpaceDecayChannel.hh"
G4LDMPhoton* G4LDMPhoton::theLDMPhoton = nullptr;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LDMPhoton::G4LDMPhoton(
const G4String& aName, G4double mass,
G4double width, G4double charge,
G4int iSpin, G4int iParity,
G4int iConjugation, G4int iIsospin,
G4int iIsospin3, G4int gParity,
const G4String& pType, G4int lepton,
G4int baryon, G4int encoding,
G4bool stable, G4double lifetime,
G4DecayTable *decaytable)
: G4ParticleDefinition( aName, mass, width, charge, iSpin, iParity,
iConjugation, iIsospin, iIsospin3, gParity, pType,
lepton, baryon, encoding, stable, lifetime, decaytable )
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LDMPhoton::~G4LDMPhoton()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
// Arguments for constructor are as follows
// name mass width charge
// 2*spin parity C-conjugation
// 2*Isospin 2*Isospin3 G-parity
// type lepton number baryon number PDG encoding
// stable lifetime decay table
//
//
G4LDMPhoton* G4LDMPhoton::LDMPhotonDefinition(G4double mass)
{
if(!theLDMPhoton)
{
theLDMPhoton = new G4LDMPhoton(
"ldmphoton", mass, 5.317e-14*MeV, 0,
2, -1, -1,
0, 0, 0,
"boson", 0, 0, 50,
true, 12.380*ns, NULL);
//create Decay Table
G4DecayTable* table = new G4DecayTable();
// create decay channels
G4VDecayChannel** mode = new G4VDecayChannel*[3];
//
mode[0] =
new G4PhaseSpaceDecayChannel("ldmphoton",0.999,2,"ldmhi","ldmhibar");
//
mode[1] = new G4PhaseSpaceDecayChannel("ldmphoton",0.0005,2,"mu+","mu-");
//
mode[2] = new G4PhaseSpaceDecayChannel("ldmphoton",0.0005,3,"pi+","pi-");
for (G4int index=0; index <3; index++ ) table->Insert(mode[index]);
delete [] mode;
theLDMPhoton->SetDecayTable(table);
G4cout << "LDMPhoton is created: m(GeV)= "
<< theLDMPhoton->GetPDGMass()/GeV << G4endl;
}
return theLDMPhoton;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4LDMPhoton* G4LDMPhoton::LDMPhoton()
{
return theLDMPhoton;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,238 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file exoticphysics/dmparticle/src/PhysicsList.cc
/// \brief Implementation of the PhysicsList class
//
// $Id: PhysicsList.hh 92047 2015-08-14 07:23:37Z gcosmo $
//
/////////////////////////////////////////////////
//
// ClassName: PhysicsList
//
// Authors: 01.06.17 V.Ivanchenko
//
//
///////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysicsList.hh"
#include "PhysicsListMessenger.hh"
#include "G4EmStandardPhysics.hh"
#include "G4EmStandardPhysics_option1.hh"
#include "G4EmStandardPhysics_option2.hh"
#include "G4EmStandardPhysics_option3.hh"
#include "G4EmStandardPhysics_option4.hh"
#include "G4EmStandardPhysicsGS.hh"
#include "G4EmStandardPhysicsSS.hh"
#include "G4EmStandardPhysicsWVI.hh"
#include "G4EmLivermorePhysics.hh"
#include "G4EmPenelopePhysics.hh"
#include "G4EmLowEPPhysics.hh"
#include "G4DecayPhysics.hh"
#include "G4LDMHi.hh"
#include "G4LDMHiBar.hh"
#include "G4LDMPhoton.hh"
#include "G4LDMBremsstrahlung.hh"
#include "G4LDMBremModel.hh"
#include "G4UnitsTable.hh"
#include "G4SystemOfUnits.hh"
#include "G4LossTableManager.hh"
#include "G4ProductionCutsTable.hh"
#include "G4EmConfigurator.hh"
#include "G4EmParameters.hh"
#include "G4ProcessManager.hh"
#include "G4ParticleTypes.hh"
#include "G4ParticleTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsList::PhysicsList()
:G4VModularPhysicsList(),
fLDMPhotonMass(0.5*CLHEP::GeV),fLDMHiMass(0.1*CLHEP::GeV),
fLDMPhoton(true),fLDMHi(false)
{
fMessenger = new PhysicsListMessenger(this);
// Decay Physics is always defined
fDecayPhysicsList = new G4DecayPhysics();
// EM physics
fEmName = G4String("emstandard_opt0");
fEmPhysicsList = new G4EmStandardPhysics(1);
SetVerboseLevel(1);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsList::~PhysicsList()
{
delete fMessenger;
delete fDecayPhysicsList;
delete fEmPhysicsList;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::ConstructParticle()
{
SetDefaultCutValue(1*mm);
fDecayPhysicsList->ConstructParticle();
if(fLDMPhoton) { G4LDMPhoton::LDMPhotonDefinition(fLDMPhotonMass); }
if(fLDMHi) {
G4LDMHi::LDMHiDefinition(fLDMHiMass);
G4LDMHiBar::LDMHiBarDefinition(fLDMHiMass);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::ConstructProcess()
{
AddTransportation();
fEmPhysicsList->ConstructProcess();
fDecayPhysicsList->ConstructProcess();
AddDarkMatter();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::AddPhysicsList(const G4String& name)
{
//G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
if (name == fEmName) {
return;
} else if (name == "emstandard_opt0") {
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmStandardPhysics();
} else if (name == "emstandard_opt1") {
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmStandardPhysics_option1();
} else if (name == "emstandard_opt2") {
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmStandardPhysics_option2();
} else if (name == "emstandard_opt3") {
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmStandardPhysics_option3();
} else if (name == "emstandard_opt4") {
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmStandardPhysics_option4();
} else if (name == "emstandardWVI") {
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmStandardPhysicsWVI();
} else if (name == "emstandardSS") {
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmStandardPhysicsSS();
} else if (name == "emstandardGS") {
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmStandardPhysicsGS();
} else if (name == "emlivermore") {
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmLivermorePhysics();
} else if (name == "empenelope") {
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmPenelopePhysics();
} else if (name == "emlowenergy") {
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmLowEPPhysics();
} else {
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
<< " is not defined"
<< G4endl;
return;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::SetCuts()
{
G4ProductionCutsTable::GetProductionCutsTable()->SetEnergyRange(100.*eV,1e5);
if ( verboseLevel > 0 ) { DumpCutValuesTable(); }
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::AddDarkMatter()
{
G4cout << " PhysicsList::AddDarkMatter: " << fLDMPhoton << G4endl;
if(fLDMPhoton) {
//G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
G4LDMBremsstrahlung* ldmb = new G4LDMBremsstrahlung();
G4ParticleDefinition* p = G4Proton::Proton();
G4ProcessManager* man = p->GetProcessManager();
man->AddProcess(ldmb, -1, -1, 5);
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::SetLDMPhotonMass(G4double val)
{
G4cout << "### PhysicsList::SetLDMPhotonMass: new value " << val/GeV
<< " GeV" << G4endl;
fLDMPhotonMass = val;
fLDMPhoton = true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::SetLDMHiMass(G4double val)
{
fLDMHiMass = val;
fLDMHi = true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,138 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file exoticphysics/dmparticle/src/PhysicsListMessenger.cc
/// \brief Implementation of the PhysicsListMessenger class
//
// $Id: PhysicsListMessenger.cc 95713 2016-02-22 08:08:38Z gcosmo $
//
//---------------------------------------------------------------------------
//
// ClassName: PhysicsListMessenger
//
// Description: EM physics with a possibility to add PAI model
//
// Author: V.Ivanchenko 01.09.2010
//
//----------------------------------------------------------------------------
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysicsListMessenger.hh"
#include "PhysicsList.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithADouble.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "TestParameters.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
:G4UImessenger(),fPhysicsList(pPhys)
{
fPhysDir = new G4UIdirectory("/testex/phys/");
fPhysDir->SetGuidance("physics list commands");
fECmd = new G4UIcmdWithADoubleAndUnit("/testex/phys/setMaxE",this);
fECmd->SetGuidance("Set max energy deposit");
fECmd->SetParameterName("Emax",false);
fECmd->SetUnitCategory("Energy");
fECmd->SetRange("Emax>0.0");
fECmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fEBCmd = new G4UIcmdWithAnInteger("/testex/phys/setNbinsE",this);
fEBCmd->SetGuidance("Set number of bins in energy.");
fEBCmd->SetParameterName("Ebins",false);
fEBCmd->SetRange("Ebins>0");
fEBCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
fListCmd = new G4UIcmdWithAString("/testex/phys/addPhysics",this);
fListCmd->SetGuidance("Add modula physics list.");
fListCmd->SetParameterName("PList",false);
fListCmd->AvailableForStates(G4State_PreInit);
fPHCmd = new G4UIcmdWithADoubleAndUnit("/testex/phys/setLDMPhotonMass",this);
fPHCmd->SetGuidance("Set LDMPhotonMass");
fPHCmd->SetParameterName("LDMPmass",false);
fPHCmd->SetUnitCategory("Energy");
fPHCmd->SetRange("LDMPmass>0.0");
fPHCmd->AvailableForStates(G4State_PreInit);
fHCmd = new G4UIcmdWithADoubleAndUnit("/testex/phys/setLDMHiMass",this);
fHCmd->SetGuidance("Set LDMHiMass");
fHCmd->SetParameterName("LDMHmass",false);
fHCmd->SetUnitCategory("Energy");
fHCmd->SetRange("LDMHmass>0.0");
fHCmd->AvailableForStates(G4State_PreInit);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsListMessenger::~PhysicsListMessenger()
{
delete fECmd;
delete fPHCmd;
delete fHCmd;
delete fEBCmd;
delete fListCmd;
delete fPhysDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsListMessenger::SetNewValue(G4UIcommand* command,
G4String newValue)
{
TestParameters* man = TestParameters::GetPointer();
if( command == fECmd )
{
man->SetMaxEnergy(fECmd->GetNewDoubleValue(newValue));
}
if( command == fEBCmd )
{
man->SetNumberBins(fEBCmd->GetNewIntValue(newValue));
}
if( command == fListCmd )
{
fPhysicsList->AddPhysicsList(newValue);
}
if( command == fPHCmd )
{
fPhysicsList->SetLDMPhotonMass(fPHCmd->GetNewDoubleValue(newValue));
}
if( command == fHCmd )
{
fPhysicsList->SetLDMHiMass(fHCmd->GetNewDoubleValue(newValue));
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,77 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file exoticphysics/dmparticle/src/PrimaryGeneratorAction.cc
/// \brief Implementation of the PrimaryGeneratorAction class
//
// $Id$
#include "PrimaryGeneratorAction.hh"
#include "DetectorConstruction.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleDefinition.hh"
#include "G4Event.hh"
#include "TestParameters.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PrimaryGeneratorAction::PrimaryGeneratorAction(DetectorConstruction* det)
:G4VUserPrimaryGeneratorAction(),fDetector(det)
{
fParticleGun = new G4ParticleGun(1);
fParticleGun->SetParticleEnergy(100 * GeV);
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0., 0., 1.));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PrimaryGeneratorAction::~PrimaryGeneratorAction()
{
delete fParticleGun;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
// this function is called at the begining of event
if( 0 == anEvent->GetEventID() )
{
G4double z0 = -0.5*(fDetector->GetWorldSizeZ()) + 1*um;
G4cout<<"Event = "<<anEvent->GetEventID()<<"; z0 = "<<z0;
fParticleGun->SetParticlePosition( G4ThreeVector( 0.0, 0.0, z0) );
G4cout<<" Primary direction = "
<<fParticleGun->GetParticleMomentumDirection()<<G4endl;
TestParameters* param = TestParameters::GetPointer();
param->SetBeamParticle(fParticleGun->GetParticleDefinition());
param->SetBeamEnergy(fParticleGun->GetParticleEnergy());
param->SetPositionZ(z0);
}
fParticleGun->GeneratePrimaryVertex( anEvent );
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+222
View File
@@ -0,0 +1,222 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file exoticphysics/dmparticle/src/Run.cc
/// \brief Implementation of the Run class
//
// $Id$
#include "Run.hh"
#include "G4Step.hh"
#include "G4Run.hh"
#include "G4LossTableManager.hh"
#include "G4ElectronIonPair.hh"
#include "G4SystemOfUnits.hh"
#include "G4PhysicalConstants.hh"
#include "TestParameters.hh"
#include "Randomize.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Run::Run()
: G4Run(), fParam(TestParameters::GetPointer())
{
fTotStepGas = fOverflow = fTotEdep = fStepGas = fMaxEnergy = 0.0;
fEvt = fNbins = 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
Run::~Run()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Run::BeginOfRun()
{
// initilise scoring
fTotStepGas = fOverflow = fTotEdep = fStepGas = fMaxEnergy = 0.0;
fEvt = 0;
SetVerbose(1);
fNbins = fParam->GetNumberBins();
fMaxEnergy = fParam->GetMaxEnergy();
fEgas.resize(fNbins,0.0);
fEdep.reset();
if(fVerbose > 0)
{
G4cout << " BinsE= " << fNbins
<< " Emax(keV)= " << fMaxEnergy/keV << G4endl;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Run::EndOfRun()
{
G4int nEvt = GetNumberOfEvent();
G4double norm = (nEvt > 0) ? 1.0/(G4double)nEvt : 0.0;
fTotStepGas *= norm;
fOverflow *= norm;
G4double y1 = fEdep.mean();
G4double y2 = fEdep.rms();
//G4double de = fMaxEnergy/G4double(fNbins);
//G4double x1 = -de*0.5;
G4cout << " ====================================================" << G4endl;
G4cout << " Beam Particle: "
<< fParam->GetBeamParticle()->GetParticleName() << G4endl
<< " Ekin(GeV) = " << fParam->GetBeamEnergy()/GeV
<< G4endl
<< " Z(mm) = " << fParam->GetPositionZ()/mm
<< G4endl;
G4cout << " ================== run summary =====================" << G4endl;
G4int prec = G4cout.precision(5);
G4cout << " End of Run TotNbofEvents = "
<< nEvt << G4endl;
G4cout << G4endl;
G4cout << " Mean energy deposit in absorber = " <<
y1/GeV << " +- " << y2*std::sqrt(norm)/GeV << " GeV; ";
if(y1 > 0.0) { G4cout << " RMS/Emean = " << y2/y1; }
G4cout << G4endl;
G4cout << " Mean number of steps in absorber= "
<< fTotStepGas
<< G4endl;
G4cout << G4endl;
/*
G4cout << " ====== Energy deposit distribution Noverflows= " << fOverflow
<< " ====== " << G4endl ;
G4cout << " bin nb Elow entries normalized " << G4endl;
x1 = 0.0;
for(G4int j=0; j<fNbins; ++j)
{
G4cout << std::setw(5) << j << std::setw(10) << x1/keV
<< std::setw(12) << fEgas[j] << std::setw(12) << fEgas[j]*norm
<< G4endl ;
x1 += de;
}
*/
G4cout.precision(prec);
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
// normalize histograms
analysisManager->ScaleH1(1,norm);
G4cout << " ================== run end ==========================" << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Run::BeginOfEvent()
{
fTotEdep = 0.0;
fStepGas = 0;
++fEvt;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void Run::EndOfEvent()
{
/*
G4cout << "fStepGas = " << fStepGas << " fTotStepGas= " << fTotStepGas
<< " fTotEdep= " << fTotEdep << " fNbins= " << fNbins
<< " fMaxEnergy= " << fMaxEnergy << G4endl;
*/
fTotStepGas += fStepGas;
G4int idx = G4lrint(fTotEdep*fNbins/fMaxEnergy);
if(idx < 0) { fEgas[0] += 1.0; }
if(idx >= fNbins) { fOverflow += 1.0; }
else { fEgas[idx] += 1.0; }
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
// fill histo
analysisManager->FillH1(1,fTotEdep/GeV,1.0);
fEdep.fill(fTotEdep, 1.0);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
// Allows one to accumulate data from different threads
void Run::Merge( const G4Run* run )
{
const Run* localRun = static_cast<const Run*>(run);
fTotStepGas += localRun->fTotStepGas;
fOverflow += localRun->fOverflow;
G4StatDouble* stat = const_cast<G4StatDouble*>(localRun->GetStat());
fEdep.add(stat);
for( G4int j = 0; j < fNbins; ++j )
{
fEgas[j] += localRun->fEgas[j];
}
G4Run::Merge(run);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//
// Is called from TargetSD
void Run::AddEnergy( G4double edep, const G4Step* step )
{
if( 1 < fVerbose )
{
G4cout << "Run::AddEnergy: e(keV)= " << edep/keV
<< G4endl;
}
fTotEdep += edep;
if( step )
{
if( 1 == step->GetTrack()->GetTrackID())
{
fStepGas += 1.0;
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+132
View File
@@ -0,0 +1,132 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file exoticphysics/dmparticle/src/RunAction.cc
/// \brief Implementation of the RunAction class
//
// $Id: RunAction.cc 92047 2015-08-14 07:23:37Z gcosmo $
//
//---------------------------------------------------------------------------
//
// ClassName: RunAction
//
// Author: V.Ivanchenko 01.09.2010
//
//----------------------------------------------------------------------------
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "RunAction.hh"
#include "Run.hh"
#include "TestParameters.hh"
#include "G4Run.hh"
#include "G4RunManager.hh"
#include "G4UImanager.hh"
#include "G4VVisManager.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RunAction::RunAction()
: G4UserRunAction(), fAnalysisManager(nullptr), fRun(nullptr)
{
TestParameters::GetPointer();
fAnalysisManager = G4AnalysisManager::Instance();
fAnalysisManager->SetFileName("dmp");
fAnalysisManager->SetVerboseLevel(1);
fAnalysisManager->SetActivation(true);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RunAction::~RunAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::Book()
{
// Always creating analysis manager
TestParameters* param = TestParameters::GetPointer();
G4int nBinsE = param->GetNumberBins();
G4double maxEnergy = param->GetMaxEnergy();
// Creating an 1-dimensional histograms in the root directory of the tree
fAnalysisManager->SetFirstHistoId(1);
fAnalysisManager->CreateH1("h1","Energy deposition in detector (GeV)",
nBinsE,0.0,maxEnergy/GeV);
fAnalysisManager->OpenFile();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4Run* RunAction::GenerateRun()
{
fRun = new Run();
return fRun;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::BeginOfRunAction(const G4Run* aRun)
{
G4int id = aRun->GetRunID();
G4cout << "### Run " << id << " start analysis activation: "
<< G4endl;
fRun->BeginOfRun();
//histograms
Book();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RunAction::EndOfRunAction(const G4Run*)
{
// print Run summary
G4cout << "RunAction: End of run actions are started " << isMaster
<< " Nevt= " << fRun->GetNumberOfEvent()
<< " Edep= " << fRun->GetStat()->mean() << G4endl;
if (isMaster) {
fRun->EndOfRun();
}
// save histos and close analysis
if (fAnalysisManager->IsActive()) {
fAnalysisManager->Write();
fAnalysisManager->CloseFile();
}
//delete fAnalysisManager;
#ifdef G4VIS_USE
if (G4VVisManager::GetConcreteInstance()) {
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
}
#endif
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,90 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file exoticphysics/dmparticle/src/StackingAction.cc
/// \brief Implementation of the StackingAction class
//
// $Id: StackingAction.cc,v 1.8 2009-03-06 18:04:23 maire Exp $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "StackingAction.hh"
#include "Run.hh"
#include "StackingMessenger.hh"
#include "G4LDMPhoton.hh"
#include "G4LDMHi.hh"
#include "G4LDMHiBar.hh"
#include "G4Track.hh"
#include "G4Step.hh"
#include "G4RunManager.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
StackingAction::StackingAction()
: G4UserStackingAction(), fKillSecondary(false)
{
fStackMessenger = new StackingMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
StackingAction::~StackingAction()
{
delete fStackMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4ClassificationOfNewTrack
StackingAction::ClassifyNewTrack(const G4Track* aTrack)
{
//stack or delete secondaries
G4ClassificationOfNewTrack status = fUrgent;
//keep primary particle
if(aTrack->GetParentID() == 0) { return status; }
const G4ParticleDefinition* part = aTrack->GetDefinition();
if(part == G4LDMPhoton::LDMPhoton() ||
part == G4LDMHi::LDMHi() ||
part == G4LDMHiBar::LDMHiBar()) {
G4cout << "### New exotic particle produced: "
<< part->GetParticleName()
<< " Ekin(GeV)= " << aTrack->GetKineticEnergy()/CLHEP::GeV
<< " Mass(GeV)= " << part->GetPDGMass()/CLHEP::GeV
<< " TrackId= " << aTrack->GetTrackID()
<< G4endl;
return status;
}
if(fKillSecondary) { status = fKill; }
return status;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,65 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file exoticphysics/dmparticle/src/StackingMessenger.cc
/// \brief Implementation of the StackingMessenger class
//
// $Id: StackingMessenger.cc,v 1.5 2006-09-25 17:06:29 maire Exp $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "StackingMessenger.hh"
#include "StackingAction.hh"
#include "G4UIcmdWithABool.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
StackingMessenger::StackingMessenger(StackingAction* stack)
:G4UImessenger(),fStackAction(stack)
{
fKillCmd = new G4UIcmdWithABool("/testex/killSecondaries",this);
fKillCmd->SetGuidance("Kill secondary charged particles");
fKillCmd->SetParameterName("choice",true);
fKillCmd->SetDefaultValue(false);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
StackingMessenger::~StackingMessenger()
{
delete fKillCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void StackingMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
{
if(command == fKillCmd)
{fStackAction->SetKillStatus(fKillCmd->GetNewBoolValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+104
View File
@@ -0,0 +1,104 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file exoticphysics/dmparticle/src/TargetSD.cc
/// \brief Implementation of the TargetSD. class
//
// $Id$
//
/////////////////////////////////////////////////
//
// ClassName: TargetSD
//
// Authors: 01.06.17 V.Ivanchenko
//
//
///////////////////////////////////////////
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "TargetSD.hh"
#include "Run.hh"
#include "globals.hh"
#include "G4HCofThisEvent.hh"
#include "G4TouchableHistory.hh"
#include "G4Step.hh"
#include "G4String.hh"
#include "G4RunManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
TargetSD::TargetSD(const G4String& name)
: G4VSensitiveDetector(name), fRun(nullptr)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
TargetSD::~TargetSD()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void TargetSD::Initialize(G4HCofThisEvent*)
{
fRun = (Run*)G4RunManager::GetRunManager()->GetNonConstCurrentRun();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4bool TargetSD::ProcessHits( G4Step* aStep, G4TouchableHistory* )
{
G4double edep = aStep->GetTotalEnergyDeposit();
/*
G4String name = aStep->GetTrack()->GetDefinition()->GetParticleName();
if(name == "ldmhi" || name == "ldmhibar" || name == "ldmphoton")
{
G4cout << name << " Edep(MeV)= " << edep/MeV << G4endl;
}
*/
fRun->AddEnergy(edep, aStep);
return true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void TargetSD::EndOfEvent(G4HCofThisEvent*)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void TargetSD::clear()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void TargetSD::PrintAll()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,163 @@
//
// ********************************************************************
// * 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. *
// ********************************************************************
//
/// \file exoticphysics/dmparticle/src/TestParameters.cc
/// \brief Implementation of the TestParameters class
//
// $Id: TestParameters.cc 78707 2014-01-17 16:02:01Z gcosmo $
//
//---------------------------------------------------------------------------
//
// ClassName: TestParameters
//
// Author: V.Ivanchenko 01.09.2010
//
//----------------------------------------------------------------------------
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "TestParameters.hh"
#include "G4UnitsTable.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
TestParameters* TestParameters::fManager = nullptr;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
TestParameters* TestParameters::GetPointer()
{
if(!fManager) {
fManager = new TestParameters();
}
return fManager;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
TestParameters::TestParameters()
{
fMaxEnergy = 100.*GeV;
fBinsE = 100;
fPositionZ = 0.0;
fBeamEnergy = 0.0;
fEpsilon = 100.0;
fParticle = nullptr;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
TestParameters::~TestParameters()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void TestParameters::SetMaxEnergy(G4double value)
{
fMaxEnergy = value;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double TestParameters::GetMaxEnergy() const
{
return fMaxEnergy;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void TestParameters::SetNumberBins(G4int value)
{
fBinsE = value;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4int TestParameters::GetNumberBins() const
{
return fBinsE;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void TestParameters::SetPositionZ(G4double val)
{
fPositionZ = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double TestParameters::GetPositionZ() const
{
return fPositionZ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void TestParameters::SetBeamEnergy(G4double val)
{
fBeamEnergy = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double TestParameters::GetBeamEnergy() const
{
return fBeamEnergy;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void TestParameters::SetAlphaFactor(G4double val)
{
fEpsilon = val;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4double TestParameters::GetAlphaFactor() const
{
return fEpsilon;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void TestParameters::SetBeamParticle(const G4ParticleDefinition* ptr)
{
fParticle = ptr;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
const G4ParticleDefinition* TestParameters::GetBeamParticle() const
{
return fParticle;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......