Skip to content
Snippets Groups Projects
Commit ac229450 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

v96r4p1

parent 0225bc85
Branches
Tags v96r4p1
No related merge requests found
Showing
with 888 additions and 75 deletions
......@@ -23,8 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4EmStandardPhysics_option1NoApplyCuts.hh,v 1.2 2010-06-02 17:21:29 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//---------------------------------------------------------------------------
//
......@@ -36,8 +35,6 @@
// 05.12.2005 V.Ivanchenko add controlled verbosity
// 13.11.2006 V.Ivanchenko set default msc step limit false
// 15.05.2007 V.Ivanchenko rename to _option1
// 12.07.2011 G.Corti rename as _option1NoApplyCuts to get back to G49.2
// functionality
//
//----------------------------------------------------------------------------
//
......
......@@ -3,7 +3,7 @@
# Maintainer : Gloria CORTI
#============================================================================
package G4LHCblists
version v3r0
version v3r2
# Structure, i.e. directories to process.
#============================================================================
......
......@@ -2,7 +2,18 @@
! Package : Geant4/G4LHCblists
! Responsible : Gloria CORTI
! Purpose : Private LHCb physics lists
!-----------------------------------------------------------------------------
!----------------------------------------------------------------------------
!======================== G4LHCblists v3r2 2015-04-30 ========================
! 2015-04-30 - Timothy Williams
- Replaced G4EmStandardPhysics_option1NoApplyCuts.cc and .hh with v9.6.p04
of G4EmStandardPhysics_option1.cc and .hh but with the EmProcessOption of "SetApplyCuts"
removed. Previous version was v9.4 of G4EmStandardPhysics_option1.cc with "SetApplyCuts" removed.
!======================== G4LHCblists v3r1 2015-03-07 ========================
! 2015-03-07 - Timothy Williams
- Modified G4EmStandardPhysics_option1NoApplyCuts.cc to use UrbanMsc93 and
WentzelVI models for multiple scattering as suggested by V.Ivanchenko.
!======================== G4LHCblists v3r0 2013-09-16 ========================
! 2013-09-16 - Gloria Corti
......
......@@ -23,8 +23,7 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4EmStandardPhysics_option1NoApplyCuts.cc,v 1.22 2010-12-19 18:11:05 vnivanch Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
// $Id$
//
//---------------------------------------------------------------------------
//
......@@ -42,15 +41,14 @@
// 15.05.2007 V.Ivanchenko rename to _option1
// 21.04.2008 V.Ivanchenko add long-lived D and B mesons
// 19.11.2010 V.Ivanchenko added WentzelVI model for muons;
// 12.07.2011 G.Corti disable ApplyCuts option to reproduce 9.2 and rename
// _option1NoApplyCuts
// disable ApplyCut option for compatibility with 9.2
//
//----------------------------------------------------------------------------
//
#include "G4EmStandardPhysics_option1NoApplyCuts.hh"
#include "G4SystemOfUnits.hh"
#include "G4ParticleDefinition.hh"
#include "G4ProcessManager.hh"
#include "G4LossTableManager.hh"
#include "G4EmProcessOptions.hh"
......@@ -61,12 +59,16 @@
#include "G4eMultipleScattering.hh"
#include "G4MuMultipleScattering.hh"
#include "G4hMultipleScattering.hh"
#include "G4eCoulombScatteringModel.hh"
#include "G4CoulombScattering.hh"
#include "G4WentzelVIModel.hh"
#include "G4UrbanMscModel93.hh"
#include "G4UrbanMscModel95.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"
#include "G4UAtomicDeexcitation.hh"
#include "G4MuIonisation.hh"
#include "G4MuBremsstrahlung.hh"
......@@ -74,6 +76,11 @@
#include "G4hBremsstrahlung.hh"
#include "G4hPairProduction.hh"
#include "G4MuBremsstrahlungModel.hh"
#include "G4MuPairProductionModel.hh"
#include "G4hBremsstrahlungModel.hh"
#include "G4hPairProductionModel.hh"
#include "G4hIonisation.hh"
#include "G4ionIonisation.hh"
#include "G4alphaIonisation.hh"
......@@ -95,12 +102,22 @@
#include "G4Alpha.hh"
#include "G4GenericIon.hh"
#include "G4PhysicsListHelper.hh"
#include "G4BuilderType.hh"
// factory
#include "G4PhysicsConstructorFactory.hh"
//
G4_DECLARE_PHYSCONSTR_FACTORY(G4EmStandardPhysics_option1NoApplyCuts);
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4EmStandardPhysics_option1NoApplyCuts::G4EmStandardPhysics_option1NoApplyCuts(G4int ver)
: G4VPhysicsConstructor("G4EmStandard_opt1"), verbose(ver)
{
G4LossTableManager::Instance();
SetPhysicsType(bElectromagnetic);
// std::cout<<"This is the v9.6 option 1 physics list with ApplyCuts option commented out"<<std::endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......@@ -109,6 +126,7 @@ G4EmStandardPhysics_option1NoApplyCuts::G4EmStandardPhysics_option1NoApplyCuts(G
: G4VPhysicsConstructor("G4EmStandard_opt1"), verbose(ver)
{
G4LossTableManager::Instance();
SetPhysicsType(bElectromagnetic);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......@@ -151,12 +169,36 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructParticle()
void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess()
{
// Add standard EM Processes
G4PhysicsListHelper* ph = G4PhysicsListHelper::GetPhysicsListHelper();
// muon & hadron bremsstrahlung and pair production
G4MuBremsstrahlung* mub = new G4MuBremsstrahlung();
G4MuPairProduction* mup = new G4MuPairProduction();
G4hBremsstrahlung* pib = new G4hBremsstrahlung();
G4hPairProduction* pip = new G4hPairProduction();
G4hBremsstrahlung* kb = new G4hBremsstrahlung();
G4hPairProduction* kp = new G4hPairProduction();
G4hBremsstrahlung* pb = new G4hBremsstrahlung();
G4hPairProduction* pp = new G4hPairProduction();
// muon & hadron multiple scattering
G4MuMultipleScattering* mumsc = new G4MuMultipleScattering();
mumsc->AddEmModel(0, new G4WentzelVIModel());
G4MuMultipleScattering* pimsc = new G4MuMultipleScattering();
pimsc->AddEmModel(0, new G4WentzelVIModel());
G4MuMultipleScattering* kmsc = new G4MuMultipleScattering();
kmsc->AddEmModel(0, new G4WentzelVIModel());
G4MuMultipleScattering* pmsc = new G4MuMultipleScattering();
pmsc->AddEmModel(0, new G4WentzelVIModel());
G4hMultipleScattering* hmsc = new G4hMultipleScattering("ionmsc");
// high energy limit for e+- scattering models and bremsstrahlung
G4double highEnergyLimit = 100*MeV;
// Add standard EM Processes
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
G4String particleName = particle->GetParticleName();
if(verbose > 1)
G4cout << "### " << GetPhysicsName() << " instantiates for "
......@@ -164,63 +206,111 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess()
if (particleName == "gamma") {
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect);
pmanager->AddDiscreteProcess(new G4ComptonScattering);
pmanager->AddDiscreteProcess(new G4GammaConversion);
ph->RegisterProcess(new G4PhotoElectricEffect(), particle);
ph->RegisterProcess(new G4ComptonScattering(), particle);
ph->RegisterProcess(new G4GammaConversion(), particle);
} else if (particleName == "e-") {
G4eIonisation* eioni = new G4eIonisation();
eioni->SetStepFunction(0.8, 1.0*mm);
G4eMultipleScattering* msc = new G4eMultipleScattering;
msc->SetStepLimitType(fMinimal);
pmanager->AddProcess(msc, -1, 1, 1);
pmanager->AddProcess(eioni, -1, 2, 2);
pmanager->AddProcess(new G4eBremsstrahlung, -1,-3, 3);
G4UrbanMscModel93* msc1 = new G4UrbanMscModel93();
G4WentzelVIModel* msc2 = new G4WentzelVIModel();
msc1->SetHighEnergyLimit(highEnergyLimit);
msc2->SetLowEnergyLimit(highEnergyLimit);
msc->AddEmModel(0, msc1);
msc->AddEmModel(0, msc2);
G4eCoulombScatteringModel* ssm = new G4eCoulombScatteringModel();
G4CoulombScattering* ss = new G4CoulombScattering();
ss->SetEmModel(ssm, 1);
ss->SetMinKinEnergy(highEnergyLimit);
ssm->SetLowEnergyLimit(highEnergyLimit);
ssm->SetActivationLowEnergyLimit(highEnergyLimit);
ph->RegisterProcess(msc, particle);
ph->RegisterProcess(eioni, particle);
ph->RegisterProcess(new G4eBremsstrahlung(), particle);
ph->RegisterProcess(ss, particle);
} else if (particleName == "e+") {
G4eIonisation* eioni = new G4eIonisation();
eioni->SetStepFunction(0.8, 1.0*mm);
G4eMultipleScattering* msc = new G4eMultipleScattering;
msc->SetStepLimitType(fMinimal);
pmanager->AddProcess(msc, -1, 1, 1);
pmanager->AddProcess(eioni, -1, 2, 2);
pmanager->AddProcess(new G4eBremsstrahlung, -1,-3, 3);
pmanager->AddProcess(new G4eplusAnnihilation, 0,-1, 4);
G4UrbanMscModel93* msc1 = new G4UrbanMscModel93();
G4WentzelVIModel* msc2 = new G4WentzelVIModel();
msc1->SetHighEnergyLimit(highEnergyLimit);
msc2->SetLowEnergyLimit(highEnergyLimit);
msc->AddEmModel(0, msc1);
msc->AddEmModel(0, msc2);
G4eCoulombScatteringModel* ssm = new G4eCoulombScatteringModel();
G4CoulombScattering* ss = new G4CoulombScattering();
ss->SetEmModel(ssm, 1);
ss->SetMinKinEnergy(highEnergyLimit);
ssm->SetLowEnergyLimit(highEnergyLimit);
ssm->SetActivationLowEnergyLimit(highEnergyLimit);
ph->RegisterProcess(msc, particle);
ph->RegisterProcess(eioni, particle);
ph->RegisterProcess(new G4eBremsstrahlung(), particle);
ph->RegisterProcess(new G4eplusAnnihilation(), particle);
ph->RegisterProcess(ss, particle);
} else if (particleName == "mu+" ||
particleName == "mu-" ) {
particleName == "mu-" ) {
G4MuMultipleScattering* msc = new G4MuMultipleScattering();
msc->AddEmModel(0, new G4WentzelVIModel());
pmanager->AddProcess(msc, -1, 1, 1);
pmanager->AddProcess(new G4MuIonisation, -1, 2, 2);
pmanager->AddProcess(new G4MuBremsstrahlung, -1,-3, 3);
pmanager->AddProcess(new G4MuPairProduction, -1,-4, 4);
pmanager->AddDiscreteProcess(new G4CoulombScattering());
ph->RegisterProcess(mumsc, particle);
ph->RegisterProcess(new G4MuIonisation(), particle);
ph->RegisterProcess(mub, particle);
ph->RegisterProcess(mup, particle);
ph->RegisterProcess(new G4CoulombScattering(), particle);
} else if (particleName == "alpha" ||
particleName == "He3") {
} else if (particleName == "alpha" ||
particleName == "He3" ) {
pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
pmanager->AddProcess(new G4ionIonisation, -1, 2, 2);
//ph->RegisterProcess(hmsc, particle);
ph->RegisterProcess(new G4hMultipleScattering(), particle);
ph->RegisterProcess(new G4ionIonisation(), particle);
} else if (particleName == "GenericIon") {
pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
pmanager->AddProcess(new G4ionIonisation, -1, 2, 2);
ph->RegisterProcess(hmsc, particle);
ph->RegisterProcess(new G4ionIonisation(), particle);
} else if (particleName == "pi+" ||
particleName == "pi-" ) {
//G4hMultipleScattering* pimsc = new G4hMultipleScattering();
ph->RegisterProcess(pimsc, particle);
ph->RegisterProcess(new G4hIonisation(), particle);
ph->RegisterProcess(pib, particle);
ph->RegisterProcess(pip, particle);
} else if (particleName == "pi+" ||
particleName == "pi-" ||
particleName == "kaon+" ||
particleName == "kaon-" ||
particleName == "proton" ) {
} else if (particleName == "kaon+" ||
particleName == "kaon-" ) {
pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
pmanager->AddProcess(new G4hBremsstrahlung, -1,-3, 3);
pmanager->AddProcess(new G4hPairProduction, -1,-4, 4);
//G4hMultipleScattering* kmsc = new G4hMultipleScattering();
ph->RegisterProcess(kmsc, particle);
ph->RegisterProcess(new G4hIonisation(), particle);
ph->RegisterProcess(kb, particle);
ph->RegisterProcess(kp, particle);
// } else if (particleName == "proton" ) {
} else if (particleName == "proton" ||
particleName == "anti_proton") {
//G4hMultipleScattering* pmsc = new G4hMultipleScattering();
ph->RegisterProcess(pmsc, particle);
ph->RegisterProcess(new G4hIonisation(), particle);
ph->RegisterProcess(pb, particle);
ph->RegisterProcess(pp, particle);
} else if (particleName == "B+" ||
particleName == "B-" ||
......@@ -233,7 +323,6 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess()
particleName == "anti_deuteron" ||
particleName == "anti_lambda_c+" ||
particleName == "anti_omega-" ||
particleName == "anti_proton" ||
particleName == "anti_sigma_c+" ||
particleName == "anti_sigma_c++" ||
particleName == "anti_sigma+" ||
......@@ -254,14 +343,19 @@ void G4EmStandardPhysics_option1NoApplyCuts::ConstructProcess()
particleName == "xi_c+" ||
particleName == "xi-" ) {
pmanager->AddProcess(new G4hMultipleScattering, -1, 1, 1);
pmanager->AddProcess(new G4hIonisation, -1, 2, 2);
ph->RegisterProcess(hmsc, particle);
ph->RegisterProcess(new G4hIonisation(), particle);
}
}
G4EmProcessOptions opt;
opt.SetVerbose(verbose);
opt.SetPolarAngleLimit(0.2);
opt.SetPolarAngleLimit(CLHEP::pi);
//opt.SetApplyCuts(true);
// Deexcitation
//
G4VAtomDeexcitation* de = new G4UAtomicDeexcitation();
G4LossTableManager::Instance()->SetAtomDeexcitation(de);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
......@@ -47,3 +47,9 @@ else
endif
cd $here
if( ${pack} == 'TestEm3' ) then
./copyPatchedSource.py
echo ' executed copyPatchedSource.py '
endif
......@@ -55,7 +55,7 @@ cd $here
# NKW 22/02/2014
#Not pretty but will work.
if ( $pack == "processes" ) then
if ( $pack == "processes" || $pack == "physics_lists" ) then
echo "Copying patched sources"
./copyPatchedSource.py
endif
......
package G4config
version v96r1p0
version v96r3p0
branches cmt doc
......@@ -19,7 +19,7 @@ use Geant4Files v96r* -no_auto_imports
#==============================================================================
set G4_native_version "9.6.p04" \
override-geant4-version "${G4_NATIVE_VERSION}"
set G4VERS v96r1p0
set G4VERS v96r3p0
# =============================================================================
# set Geant4 environment variables
......
......@@ -3,6 +3,13 @@
! Responsible : Gloria Corti/ Nigel Watson
! Purpose : Configuration package for Geant4 build
!-----------------------------------------------------------------------------
! ======================= G4config v96r3p0 2015-05-11 ========================
! 2015-05-11 - Timothy Williams
- Added execution of srcnew copying to copy_examples_source.csh
! ======================= G4config v96r2p0 2015-04-24 ========================
! 2015-04-24 - Nige Watson
- Updated copy scripts to copy new source for G4physics_list
! ======================= G4config v96r1p0 2015-03-06 ========================
! 2015-03-06 - Nige Watson
......
......@@ -3,7 +3,7 @@
# Maintainer : James Mccarthy
#============================================================================
package G4examples
version v5r0
version v5r1
#============================================================================
# Structure, i.e. directories to process.
......
......@@ -3,6 +3,9 @@
! Responsible : James Mccarthy
! Purpose : Examples packages provided my Geant4, used as standalone tests
!-----------------------------------------------------------------------------
!===================== Geant4/G4examples v5r1 2015-05-11 =====================
! 2015-05-11- Tim Williams
-Added copy patchedsource script and srcnew to TestEm3 to copy private source files into place upon build.
!===================== Geant4/G4examples v5r0 2015-03-06 =====================
......
......@@ -23,11 +23,23 @@ struct M{
int rebin;
};
struct SeperateProfiles
{
TH1D* PhotonsLead;
TH1D* ElectronsLead;
TH1D* PositronsLead;
TH1D* PhotonsScintillator;
TH1D* ElectronsScintillator;
TH1D* PositronsScintillator;
};
vector<SeperateProfiles> Profiles(15);
vector<M> Control(15);
double nEvents=10000;
int main()
{
TCanvas *c[15];
ofstream outt;
outt.open ("results.txt");
......@@ -109,7 +121,33 @@ int main()
hnew[i]= (TH1D*)h2[i]->Clone("hnew");
hnew[i]->Rebin(Control[i].rebin);
cout<<"nbins after cloning= "<<hnew[i]->GetNbinsX()<<endl;
Profiles[i].PhotonsLead=(TH1D*)In->Get("23");
Profiles[i].ElectronsLead=(TH1D*)In->Get("24");
Profiles[i].PositronsLead=(TH1D*)In->Get("25");
Profiles[i].PhotonsScintillator=(TH1D*)In->Get("26");
Profiles[i].ElectronsScintillator=(TH1D*)In->Get("27");
Profiles[i].PositronsScintillator=(TH1D*)In->Get("28");
Char_t Phl[50];
Char_t El[50];
Char_t Pol[50];
Char_t Phs[50];
Char_t Es[50];
Char_t Pos[50];
sprintf(Phl,"v9.6.p04 Photons in Lead Shower Profile at %.2f GeV",Control[i].Energy);
sprintf(El,"v9.6.p04 Electrons in Lead Shower Profile at %.2f GeV",Control[i].Energy);
sprintf(Pol,"v9.6.p04 Positrons in Lead Shower Profile at %.2f GeV",Control[i].Energy);
sprintf(Phs,"v9.6.p04 Photons in Scintillator Shower Profile at %.2f GeV",Control[i].Energy);
sprintf(Es,"v9.6.p04 Electrons in Scintillator Shower Profile at %.2f GeV",Control[i].Energy);
sprintf(Pos,"v9.6.p04 Positrons in Scintillator Shower Profile at %.2f GeV;",Control[i].Energy);
Profiles[i].PhotonsLead->SetTitle(Phl);
Profiles[i].ElectronsLead->SetTitle(El);
Profiles[i].PositronsLead->SetTitle(Pol);
Profiles[i].PhotonsScintillator->SetTitle(Phs);
Profiles[i].ElectronsScintillator->SetTitle(Es);
Profiles[i].PositronsScintillator->SetTitle(Pos);
//set titles of histograms
Char_t titleActive[50];
Char_t titlePassive[50];
......@@ -145,6 +183,7 @@ int main()
}
double SigmaOverE[15]; //sigma over E
double Xaxis[15]; //1 / sqrt(E)
double SigmaOverEError[15];
......@@ -171,6 +210,17 @@ CovElement[k])/AMean[k]));
TFile* out= new TFile("Save.root","RECREATE");
TCanvas*CStraightRes = new TCanvas("CStraightRes","CStraightRes",1800,1000);
for(int l=1;l<14;++l)
{
Profiles[l].PhotonsLead->Write();
Profiles[l].ElectronsLead->Write();
Profiles[l].PositronsLead->Write();
Profiles[l].PhotonsScintillator->Write();
Profiles[l].ElectronsScintillator->Write();
Profiles[l].PositronsScintillator->Write();
}
//------------1/sqrt(E)------------------------------------------------------------------------
TF1* fitstraight= new TF1("fitstraight","sqrt(([0]*x)**2+(([1])**2))",0,2);
fitstraight->SetParName(0,"a");
......@@ -260,10 +310,7 @@ CovElement[k])/AMean[k]));
double LeadSFError[15];
double ScintSFError[15];
double Energ[15];
double EnergyEr[15];
for(int n=1;n<14;++n){
double EnergyEr[15];for(int n=1;n<14;++n){
int k=n-1;
Double_t xmin=l2[n]->GetXaxis()->GetXmin();
Double_t xmax=l2[n]->GetXaxis()->GetXmax();
......@@ -369,6 +416,7 @@ CovElement[k])/AMean[k]));
// hnew[j]->Write();
}
for(int E=0;E<13;++E)
......
source /afs/cern.ch/lhcb/software/releases/LBSCRIPTS/prod/InstallArea/scripts/LbLogin.sh
SetupProject ROOT
SetupProject Geant4 HEAD --nightly lhcb-gauss-dev --user-area /afs/cern.ch/work/t/tiwillia/private/9.6.p04cmtuser
SetupProject Geant4 HEAD --nightly lhcb-gauss-dev
export TESTAREAROOT="/afs/cern.ch/work/t/tiwillia/private/9.6.p04cmtuser/Geant4_HEAD/GEANT4/GEANT4_HEAD/Geant4/G4examples/extended/electromagnetic/G4TestEm3"
export TESTAREAROOT="/afs/cern.ch/user/t/tiwillia/cmtuser/GEANT4/GEANT4_HEAD/Geant4/G4examples/extended/electromagnetic/G4TestEm3"
export PLIST="Test/opt1NoApplyCuts"
export PLIST="Test/opt1noapplycuts"
$TESTAREAROOT/x86_64-slc6-gcc48-opt/testEm3.exe $TESTAREAROOT/$PLIST/opt1noapplycuts.mac #generated the data if run with sim option
......
......@@ -13,7 +13,7 @@
/testem/det/setAbsor 2 Scintillator 4 mm
/testem/det/setSizeYZ 20 cm
#
/testem/phys/addPhysics emstandard_opt1nocuts
/testem/phys/addPhysics emstandard_opt1nocuts
#
#/gun/particle e-
#/gun/energy 100 GeV
......@@ -43,6 +43,12 @@
/analysis/h1/set 12 66 0. 66. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/analysis/h1/setActivation 23 true
/analysis/h1/setActivation 24 true
/analysis/h1/setActivation 25 true
/analysis/h1/setActivation 26 true
/analysis/h1/setActivation 27 true
/analysis/h1/setActivation 28 true
/run/beamOn 10000
#
/gun/particle e-
......@@ -57,6 +63,12 @@
/analysis/h1/set 12 66 0. 66. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/analysis/h1/setActivation 23 true
/analysis/h1/setActivation 24 true
/analysis/h1/setActivation 25 true
/analysis/h1/setActivation 26 true
/analysis/h1/setActivation 27 true
/analysis/h1/setActivation 28 true
/run/beamOn 10000
#
/gun/particle e-
......@@ -71,6 +83,12 @@
/analysis/h1/set 12 66 0. 66. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/analysis/h1/setActivation 23 true
/analysis/h1/setActivation 24 true
/analysis/h1/setActivation 25 true
/analysis/h1/setActivation 26 true
/analysis/h1/setActivation 27 true
/analysis/h1/setActivation 28 true
/run/beamOn 10000
#
/gun/particle e-
......@@ -85,6 +103,12 @@
/analysis/h1/set 12 66 0. 66. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/analysis/h1/setActivation 23 true
/analysis/h1/setActivation 24 true
/analysis/h1/setActivation 25 true
/analysis/h1/setActivation 26 true
/analysis/h1/setActivation 27 true
/analysis/h1/setActivation 28 true
/run/beamOn 10000
#
/gun/particle e-
......@@ -99,6 +123,12 @@
/analysis/h1/set 12 66 0. 66. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/analysis/h1/setActivation 23 true
/analysis/h1/setActivation 24 true
/analysis/h1/setActivation 25 true
/analysis/h1/setActivation 26 true
/analysis/h1/setActivation 27 true
/analysis/h1/setActivation 28 true
/run/beamOn 10000
#
/gun/particle e-
......@@ -113,7 +143,13 @@
/analysis/h1/set 12 66 0. 66. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/run/beamOn 10000
/analysis/h1/setActivation 23 true
/analysis/h1/setActivation 24 true
/analysis/h1/setActivation 25 true
/analysis/h1/setActivation 26 true
/analysis/h1/setActivation 27 true
/analysis/h1/setActivation 28 true
/run/beamOn 10000
#
/gun/particle e-
/gun/energy 4.94 GeV
......@@ -127,6 +163,12 @@
/analysis/h1/set 12 66 0. 66. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/analysis/h1/setActivation 23 true
/analysis/h1/setActivation 24 true
/analysis/h1/setActivation 25 true
/analysis/h1/setActivation 26 true
/analysis/h1/setActivation 27 true
/analysis/h1/setActivation 28 true
/run/beamOn 10000
#
/gun/particle e-
......@@ -141,6 +183,12 @@
/analysis/h1/set 12 66 0. 66. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/analysis/h1/setActivation 23 true
/analysis/h1/setActivation 24 true
/analysis/h1/setActivation 25 true
/analysis/h1/setActivation 26 true
/analysis/h1/setActivation 27 true
/analysis/h1/setActivation 28 true
/run/beamOn 10000
#
/gun/particle e-
......@@ -155,6 +203,12 @@
/analysis/h1/set 12 66 0. 66. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/analysis/h1/setActivation 23 true
/analysis/h1/setActivation 24 true
/analysis/h1/setActivation 25 true
/analysis/h1/setActivation 26 true
/analysis/h1/setActivation 27 true
/analysis/h1/setActivation 28 true
/run/beamOn 10000
#
/gun/particle e-
......@@ -169,6 +223,12 @@
/analysis/h1/set 12 66 0. 66. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/analysis/h1/setActivation 23 true
/analysis/h1/setActivation 24 true
/analysis/h1/setActivation 25 true
/analysis/h1/setActivation 26 true
/analysis/h1/setActivation 27 true
/analysis/h1/setActivation 28 true
/run/beamOn 10000
#
/gun/particle e-
......@@ -183,6 +243,12 @@
/analysis/h1/set 12 66 0. 66. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/analysis/h1/setActivation 23 true
/analysis/h1/setActivation 24 true
/analysis/h1/setActivation 25 true
/analysis/h1/setActivation 26 true
/analysis/h1/setActivation 27 true
/analysis/h1/setActivation 28 true
/run/beamOn 10000
#
/gun/particle e-
......@@ -197,6 +263,7 @@
/analysis/h1/set 12 66 0. 66. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/run/beamOn 10000
#
/gun/particle e-
......@@ -211,6 +278,12 @@
/analysis/h1/set 12 66 0. 66. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/analysis/h1/setActivation 23 true
/analysis/h1/setActivation 24 true
/analysis/h1/setActivation 25 true
/analysis/h1/setActivation 26 true
/analysis/h1/setActivation 27 true
/analysis/h1/setActivation 28 true
/run/beamOn 10000
#
/gun/particle e-
......@@ -225,4 +298,10 @@
/analysis/h1/set 12 66 0. 66. none #long. profile in absor2
/analysis/h1/set 21 102 0. 102. none #energy flow
/analysis/h1/set 22 102 0. 102. none #lateral energy leakage
/analysis/h1/setActivation 23 true
/analysis/h1/setActivation 24 true
/analysis/h1/setActivation 25 true
/analysis/h1/setActivation 26 true
/analysis/h1/setActivation 27 true
/analysis/h1/setActivation 28 true
/run/beamOn 10000
\ No newline at end of file
#run with . run.sh to keep environment for SetupProject
if [ "$1" = "sim" ]
then
../../x86_64-slc6-gcc48-opt/testEm3.exe opt1noapplycuts.mac #generated the data if run with sim option
../../x86_64-slc6-gcc48-opt/testEm3.exe opt1noapplycuts.mac
fi
#There is a bug with ROOT 6 opening Geant4 created histograms, have to use old root for now
SetupProject ROOT --version 72a
g++ -c `root-config --cflags` Plot.C
g++ -o Plot `root-config --glibs` Plot.o
......
......@@ -13,7 +13,7 @@
/testem/det/setAbsor 2 Scintillator 4 mm
/testem/det/setSizeYZ 20 cm
#
/testem/phys/addPhysics emstandard_opt2
/testem/phys/addPhysics emstandard_opt1nocuts
#
#/gun/particle e-
#/gun/energy 100 GeV
......
#!/usr/bin/env python
#
# copyPatchedSource.py
# Author Nigel Watson 14 Feb 2012
#
# Copy private G4 headers from package to install area
#
import os, sys, fnmatch, shutil
def main():
# Dir in which we keep updated source/headers.
# SRCNEW_Dir="../srcnew"
#SRCNEW_cross_sections_Dir = "../srcnew/cross_sections"
#11/2014 SRCNEW_diffraction_Dir="../srcnew/diffraction"
#11/2014 SRCNEW_management_Dir="../srcnew/management"
# Dir for original source
#11/2014 SRC_Dir="../hadronic/models/chiral_inv_phase_space/interface/src"
# Dir for original FTF source to be replaced
#11/2014 SRC_diffraction_Dir="../hadronic/models/parton_string/diffraction/src"
#11/2014 SRC_management_Dir="../hadronic/models/parton_string/management/src"
#SRC_cross_sections_Dir="../"
# Can we get cmt macro values in .python?
# Expanded by cmt to be $(GEANT4_home)/$(GEANT4_installarea_prefix)/include
# INSTALLAREA_project=os.environ['GEANT4_install_include']
# INSTALLAREA_package=os.environ['G4PROCESSESROOT']+'/G4processes'
#INSTALLAREA_project = "../../../InstallArea/include"
#INSTALLAREA_package = "../G4processes"
#$(G4processes_root)/G4processes
# Find any files in the srcnew dir (CHIPS cross-section fixes)
#11/2014 for newfile in os.listdir(SRCNEW_Dir):
#11/2014 if fnmatch.fnmatch(newfile, '*.hh'):
#11/2014#Replace old headers in install areas with new.
#11/2014 fname = os.path.join(SRCNEW_Dir, newfile)
#11/2014 shutil.copy2(fname,INSTALLAREA_project)
#11/2014 shutil.copy2(fname,INSTALLAREA_package)
#11/2014# Replace old .cc with new.
#11/2014 if fnmatch.fnmatch(newfile, '*.cc'):
#11/2014 fname = os.path.join(SRCNEW_Dir, newfile)
#11/2014 shutil.copy2(fname,SRC_Dir)
#11/2014# Find any files in the srcnew dir (FTF mass problem fixes)
#11/2014 for newfile in os.listdir(SRCNEW_diffraction_Dir):
#11/2014# Only .cc to replace for FTF fix.
#11/2014# if fnmatch.fnmatch(newfile, '*.hh'):
#11/2014#Replace old headers in install areas with new.
#11/2014# fname = os.path.join(SRCNEW_Dir, newfile)
#11/2014# shutil.copy2(fname,INSTALLAREA_project)
#11/2014# shutil.copy2(fname,INSTALLAREA_package)
#11/2014# Replace old .cc with new.
#11/2014 if fnmatch.fnmatch(newfile, '*.cc'):
#11/2014 fname = os.path.join(SRCNEW_diffraction_Dir, newfile)
#11/2014 shutil.copy2(fname,SRC_diffraction_Dir)
#11/2014# Find any files in the srcnew dir (string max. retries problem fixes)
#11/2014 for newfile in os.listdir(SRCNEW_management_Dir):
#11/2014# Only .cc to replace for max. retries fix.
#11/2014# if fnmatch.fnmatch(newfile, '*.hh'):
#11/2014#Replace old headers in install areas with new.
#11/2014# fname = os.path.join(SRCNEW_Dir, newfile)
#11/2014# shutil.copy2(fname,INSTALLAREA_project)
#11/2014# shutil.copy2(fname,INSTALLAREA_package)
#11/2014# Replace old .cc with new.
#11/2014 if fnmatch.fnmatch(newfile, '*.cc'):
#11/2014 fname = os.path.join(SRCNEW_management_Dir, newfile)
#11/2014 shutil.copy2(fname,SRC_management_Dir)
# Find any files in the srcnew dir (fixes missing assert in LHCb CLHEP version)
#for newfile in os.listdir(SRCNEW_cross_sections_Dir):
# Only .cc to replace for CLHEP fix.
# if fnmatch.fnmatch(newfile, '*.hh'):
#Replace old headers in install areas with new.
# fname = os.path.join(SRCNEW_Dir, newfile)
# shutil.copy2(fname,INSTALLAREA_project)
# shutil.copy2(fname,INSTALLAREA_package)
# Replace old .cc with new.
# if fnmatch.fnmatch(newfile, '*.cc'):
# fname = os.path.join(SRCNEW_cross_sections_Dir, newfile)
# shutil.copy2(fname,SRC_cross_sections_Dir)
#========================================TESTEM3 PRIVATE SRC COPYING========================================
SRCNEW_DIR="../srcnew/"
SRC_DIR="../src/"
for privatesource in os.listdir(SRCNEW_DIR):
if privatesource!='.svn':
fname=os.path.join(SRCNEW_DIR,privatesource)
shutil.copy2(fname,SRC_DIR)
if __name__ == "__main__":
main()
......@@ -3,16 +3,23 @@
! Responsible : Timothy Williams
! Purpose : Standalone Geant4 example used to test EM shower simulation
!-----------------------------------------------------------------------------
================================================================================
! 2015-05-07 - Timothy Williams
-Added srcnew diractory to store private source files. These get copied over with copyPatchedsource.py in cmt after sources are copied from LCG area.
================================================================================
! 2014-12-07- Timothy Williams
Updated Analysis code Plot.C, added more information and better formatting to plots, removed all binary files, added run.sh script to run entire analysis. Run as "run.sh sim" to run geant4 and create output.
================================================================================
! 2014-11-20 - Timothy Williams
-added README to Test/opt2 exaplining analysis for LHCbPR.2
================================================================================
! 2014-11-19 - Timothy Williams
-added Simulated data and analysis code in directory Test/opt2. This will be used for LHCbPR.
================================================================================
! 2014-11-13 - Timothy Williams
-Initial Version.
-Full desription of example available at:- http://geant4.web.cern.ch/geant4/UserDocumentation/Doxygen/examples_doc/html/ExampleTestEm3.html
2014-11-19 - Timothy Williams
-added Simulated data and analysis code in directory Test/opt2. This will be used for LHCbPR.
2014-11-20 - Timothy Williams
-added README to Test/opt2 exaplining analysis for LHCbPR.2
2015-12-07- Timothy Williams
Updated Analysis code Plot.C, added more information and better formatting to plots, removed all binary files, added run.sh script to run entire analysis. Run as "run.sh sim" to run geant4 and create output.
\ No newline at end of file
No preview for this file type
//
// ********************************************************************
// * 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$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "HistoManager.hh"
#include "G4UnitsTable.hh"
#include "DetectorConstruction.hh"
#include<map>
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HistoManager::HistoManager()
: fFileName("testem3")
{
Book();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
HistoManager::~HistoManager()
{
delete G4AnalysisManager::Instance();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void HistoManager::Book()
{
// Create or get analysis manager
// The choice of analysis technology is done via selection of a namespace
// in HistoManager.hh
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
analysisManager->SetFileName(fFileName);
analysisManager->SetVerboseLevel(1);
analysisManager->SetActivation(true); // enable inactivation of histograms
// Define histograms start values
const G4String id[] = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
"10","11","12","13","14","15","16","17","18","19",
"20","21","22"};
G4String title;
typedef std::map<G4String,G4String> HistPropertyCont;
HistPropertyCont Properties;
// define new histogram properties
Properties.insert(std::make_pair("23","Photons in Lead Shower Profile"));
Properties.insert(std::make_pair("24","Electrons in Lead Shower Profile"));
Properties.insert(std::make_pair("25","Positrons in Lead Shower Profile"));
Properties.insert(std::make_pair("26","Photons in Scintillator Shower Profile"));
Properties.insert(std::make_pair("27","Electrons in Scintillator Shower Profile"));
Properties.insert(std::make_pair("28","Positrons in Scintillator Shower Profile"));
// Default values (to be reset via /analysis/h1/set command)
G4int nbins = 100;
G4double vmin = 0.;
G4double vmax = 100.;
// Create all histograms as inactivated
// as we have not yet set nbins, vmin, vmax
for (G4int k=0; k<MaxHisto; k++) {
if (k < MaxAbsor) title = "Edep in absorber " + id[k];
if (k > MaxAbsor) title = "Edep longit. profile (MeV/event) in absorber "
+ id[k-MaxAbsor];
if (k == 2*MaxAbsor+1) title = "energy flow (MeV/event)";
if (k == 2*MaxAbsor+2) title = "lateral energy leak (MeV/event)";
G4int ih = analysisManager->CreateH1(id[k], title, nbins, vmin, vmax);
std::cout<<"histo k number= "<<k<<std::endl;
analysisManager->SetActivation(G4VAnalysisManager::kH1, ih, false);
}
//G4int i=analysisManager->CreateH1("23","A Test Histogram",66,1,67);
// analysisManager->SetActivation(G4VAnalysisManager::kH1,i,false);
HistPropertyCont::iterator h=Properties.begin();
for(;h!=Properties.end();++h){
G4int i= analysisManager->CreateH1((*h).first,(*h).second,66,1,67);
analysisManager->SetActivation(G4VAnalysisManager::kH1,i,false);
}
}
//
// ********************************************************************
// * 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 electromagnetic/TestEm3/src/PhysicsList.cc
/// \brief Implementation of the PhysicsList class
//
// $Id$
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "PhysicsList.hh"
#include "PhysicsListMessenger.hh"
#include "PhysListEmStandard.hh"
#include "PhysListEmStandardWVI.hh"
#include "G4EmStandardPhysics.hh"
#include "G4EmStandardPhysics_option1.hh"
#include "G4EmStandardPhysics_option2.hh"
#include "G4EmStandardPhysics_option3.hh"
#include "G4EmStandardPhysics_option4.hh"
#include "G4EmStandardPhysics_option1NoApplyCuts.hh"
#include "G4EmLivermorePhysics.hh"
#include "G4EmPenelopePhysics.hh"
#include "G4UnitsTable.hh"
#include "G4SystemOfUnits.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//a comment
PhysicsList::PhysicsList() : G4VModularPhysicsList()
{
fCurrentDefaultCut = 1.0*mm;
fCutForGamma = fCurrentDefaultCut;
fCutForElectron = fCurrentDefaultCut;
fCutForPositron = fCurrentDefaultCut;
fMessenger = new PhysicsListMessenger(this);
SetVerboseLevel(1);
// EM physics
fEmName = G4String("local");
fEmPhysicsList = new PhysListEmStandard(fEmName);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
PhysicsList::~PhysicsList()
{
delete fMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Bosons
#include "G4ChargedGeantino.hh"
#include "G4Geantino.hh"
#include "G4Gamma.hh"
#include "G4OpticalPhoton.hh"
// leptons
#include "G4MuonPlus.hh"
#include "G4MuonMinus.hh"
#include "G4NeutrinoMu.hh"
#include "G4AntiNeutrinoMu.hh"
#include "G4Electron.hh"
#include "G4Positron.hh"
#include "G4NeutrinoE.hh"
#include "G4AntiNeutrinoE.hh"
// Mesons
#include "G4PionPlus.hh"
#include "G4PionMinus.hh"
#include "G4PionZero.hh"
#include "G4Eta.hh"
#include "G4EtaPrime.hh"
#include "G4KaonPlus.hh"
#include "G4KaonMinus.hh"
#include "G4KaonZero.hh"
#include "G4AntiKaonZero.hh"
#include "G4KaonZeroLong.hh"
#include "G4KaonZeroShort.hh"
// Baryons
#include "G4Proton.hh"
#include "G4AntiProton.hh"
#include "G4Neutron.hh"
#include "G4AntiNeutron.hh"
// Nuclei
#include "G4Deuteron.hh"
#include "G4Triton.hh"
#include "G4Alpha.hh"
#include "G4GenericIon.hh"
void PhysicsList::ConstructParticle()
{
// pseudo-particles
G4Geantino::GeantinoDefinition();
G4ChargedGeantino::ChargedGeantinoDefinition();
// gamma
G4Gamma::GammaDefinition();
// optical photon
G4OpticalPhoton::OpticalPhotonDefinition();
// leptons
G4Electron::ElectronDefinition();
G4Positron::PositronDefinition();
G4MuonPlus::MuonPlusDefinition();
G4MuonMinus::MuonMinusDefinition();
G4NeutrinoE::NeutrinoEDefinition();
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
G4NeutrinoMu::NeutrinoMuDefinition();
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
// mesons
G4PionPlus::PionPlusDefinition();
G4PionMinus::PionMinusDefinition();
G4PionZero::PionZeroDefinition();
G4Eta::EtaDefinition();
G4EtaPrime::EtaPrimeDefinition();
G4KaonPlus::KaonPlusDefinition();
G4KaonMinus::KaonMinusDefinition();
G4KaonZero::KaonZeroDefinition();
G4AntiKaonZero::AntiKaonZeroDefinition();
G4KaonZeroLong::KaonZeroLongDefinition();
G4KaonZeroShort::KaonZeroShortDefinition();
// barions
G4Proton::ProtonDefinition();
G4AntiProton::AntiProtonDefinition();
G4Neutron::NeutronDefinition();
G4AntiNeutron::AntiNeutronDefinition();
// ions
G4Deuteron::DeuteronDefinition();
G4Triton::TritonDefinition();
G4Alpha::AlphaDefinition();
G4GenericIon::GenericIonDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ProcessManager.hh"
#include "G4Decay.hh"
void PhysicsList::ConstructProcess()
{
AddTransportation();
// electromagnetic Physics List
//
fEmPhysicsList->ConstructProcess();
// Add Decay Process
//
G4Decay* fDecayProcess = new G4Decay();
theParticleIterator->reset();
while( (*theParticleIterator)() ){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (fDecayProcess->IsApplicable(*particle)) {
pmanager ->AddProcess(fDecayProcess);
// set ordering for PostStepDoIt and AtRestDoIt
pmanager ->SetProcessOrdering(fDecayProcess, idxPostStep);
pmanager ->SetProcessOrdering(fDecayProcess, idxAtRest);
}
}
// stepLimitation (as a full process)
//
AddStepMax();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::AddPhysicsList(const G4String& name)
{
if (verboseLevel>1) {
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">" << G4endl;
}
if (name == fEmName) return;
if (name == "local") {
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new PhysListEmStandard(name);
} else if (name == "emstandard_opt0") {
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmStandardPhysics();
} else if (name == "emstandard_opt1") {
std::cout<<"opt1 physics list found"<<std::endl;
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 == "emstandard_opt1nocuts")
{
fEmName = name;
std::cout<<"Passed if statement in Physicslist.cc"<<std::endl;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmStandardPhysics_option1NoApplyCuts();
}
else if (name == "standardWVI") {
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new PhysListEmStandardWVI(name);
} else if (name == "emlivermore") {
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmLivermorePhysics();
} else if (name == "empenelope") {
fEmName = name;
delete fEmPhysicsList;
fEmPhysicsList = new G4EmPenelopePhysics();
} else {
G4cout << "PhysicsList::AddPhysicsList: <" << name << ">"
<< " is not defined"
<< G4endl;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "StepMax.hh"
void PhysicsList::AddStepMax()
{
// Step limitation seen as a process
fStepMaxProcess = new StepMax();
theParticleIterator->reset();
while ((*theParticleIterator)()){
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (fStepMaxProcess->IsApplicable(*particle))
{
pmanager ->AddDiscreteProcess(fStepMaxProcess);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::SetCuts()
{
if (verboseLevel >0) {
G4cout << "PhysicsList::SetCuts:";
G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << G4endl;
}
// set cut values for gamma at first and for e- second and next for e+,
// because some processes for e+/e- need cut values for gamma
SetCutValue(fCutForGamma, "gamma");
SetCutValue(fCutForElectron, "e-");
SetCutValue(fCutForPositron, "e+");
// Cut for proton not used in EM processes except single scattering
// so electron cut is used in this example
SetCutValue(fCutForElectron, "proton");
if (verboseLevel>0) DumpCutValuesTable();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::SetCutForGamma(G4double cut)
{
fCutForGamma = cut;
SetParticleCuts(fCutForGamma, G4Gamma::Gamma());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::SetCutForElectron(G4double cut)
{
fCutForElectron = cut;
SetParticleCuts(fCutForElectron, G4Electron::Electron());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void PhysicsList::SetCutForPositron(G4double cut)
{
fCutForPositron = cut;
SetParticleCuts(fCutForPositron, G4Positron::Positron());
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment