Import Geant4 4.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:18:25 +02:00
parent 36c080dca6
commit 921d3b1cda
3990 changed files with 185376 additions and 82884 deletions
@@ -0,0 +1,79 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em10CalorHit.cc,v 1.2 2001/07/11 09:57:23 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "Em10CalorHit.hh"
G4Allocator<Em10CalorHit> Em10CalorHitAllocator;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10CalorHit::Em10CalorHit()
{
EdepAbs = 0.; TrackLengthAbs = 0.;
EdepGap = 0.; TrackLengthGap = 0.;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10CalorHit::~Em10CalorHit()
{;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10CalorHit::Em10CalorHit(const Em10CalorHit& right)
{
EdepAbs = right.EdepAbs; TrackLengthAbs = right.TrackLengthAbs;
EdepGap = right.EdepGap; TrackLengthGap = right.TrackLengthGap;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
const Em10CalorHit& Em10CalorHit::operator=(const Em10CalorHit& right)
{
EdepAbs = right.EdepAbs; TrackLengthAbs = right.TrackLengthAbs;
EdepGap = right.EdepGap; TrackLengthGap = right.TrackLengthGap;
return *this;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
int Em10CalorHit::operator==(const Em10CalorHit& right) const
{
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10CalorHit::Print()
{;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,131 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em10CalorimeterSD.cc,v 1.2 2001/07/11 09:57:23 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "Em10CalorimeterSD.hh"
#include "Em10CalorHit.hh"
#include "Em10DetectorConstruction.hh"
#include "G4VPhysicalVolume.hh"
#include "G4Step.hh"
#include "G4VTouchable.hh"
#include "G4TouchableHistory.hh"
#include "G4SDManager.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10CalorimeterSD::Em10CalorimeterSD(G4String name,
Em10DetectorConstruction* det)
:G4VSensitiveDetector(name),Detector(det)
{
collectionName.insert("CalCollection");
HitID = new G4int[500];
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10CalorimeterSD::~Em10CalorimeterSD()
{
delete [] HitID;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10CalorimeterSD::Initialize(G4HCofThisEvent*HCE)
{
CalCollection = new Em10CalorHitsCollection
(SensitiveDetectorName,collectionName[0]);
for (G4int j=0;j<1; j++) {HitID[j] = -1;};
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4bool Em10CalorimeterSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist)
{
G4double edep = aStep->GetTotalEnergyDeposit();
G4double stepl = 0.;
if (aStep->GetTrack()->GetDefinition()->GetPDGCharge() != 0.)
stepl = aStep->GetStepLength();
if ((edep==0.)&&(stepl==0.)) return false;
G4TouchableHistory* theTouchable
= (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
G4VPhysicalVolume* physVol = theTouchable->GetVolume();
//theTouchable->MoveUpHistory();
G4int Em10Number = 0 ;
if (HitID[Em10Number]==-1)
{
Em10CalorHit* calHit = new Em10CalorHit();
if (physVol == Detector->GetAbsorber()) calHit->AddAbs(edep,stepl);
HitID[Em10Number] = CalCollection->insert(calHit) - 1;
if (verboseLevel>0)
G4cout << " New Calorimeter Hit on Em10: " << Em10Number << G4endl;
}
else
{
if (physVol == Detector->GetAbsorber())
(*CalCollection)[HitID[Em10Number]]->AddAbs(edep,stepl);
if (verboseLevel>0)
G4cout << " Energy added to Em10: " << Em10Number << G4endl;
}
return true;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10CalorimeterSD::EndOfEvent(G4HCofThisEvent* HCE)
{
static G4int HCID = -1;
if(HCID<0)
{ HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]); }
HCE->AddHitsCollection(HCID,CalCollection);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10CalorimeterSD::clear()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10CalorimeterSD::PrintAll()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,908 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em10DetectorConstruction.cc,v 1.7 2001/11/21 18:48:56 mverderi Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
#include "Em10DetectorConstruction.hh"
#include "Em10DetectorMessenger.hh"
#include "Em10CalorimeterSD.hh"
#include "G4VXrayTRmodel.hh"
#include "G4VXrayTRadModel.hh"
#include "G4IrregularXrayTRmodel.hh"
#include "G4FoamXrayTRmodel.hh"
#include "G4RegularXrayTRmodel.hh"
#include "G4GamDistrXrayTRmodel.hh"
#include "G4PlateIrrGasXrayTRmodel.hh"
#include "G4VXTRdEdx.hh"
#include "G4IrregularXTRdEdx.hh"
#include "G4FoamXTRdEdx.hh"
#include "G4RegularXTRdEdx.hh"
#include "G4GamDistrXTRdEdx.hh"
#include "G4PlateIrrGasXTRdEdx.hh"
#include "G4Material.hh"
#include "G4Box.hh"
#include "G4LogicalVolume.hh"
#include "G4PVPlacement.hh"
#include "G4UniformMagField.hh"
#include "G4FieldManager.hh"
#include "G4TransportationManager.hh"
#include "G4SDManager.hh"
#include "G4RunManager.hh"
#include "G4FastSimulationManager.hh"
#include "G4ios.hh"
/////////////////////////////////////////////////////////////////////////////
//
//
Em10DetectorConstruction::Em10DetectorConstruction()
:worldchanged(false), AbsorberMaterial(0), fGapMat(0),
WorldMaterial(0), solidWorld(0), logicWorld(0), physiWorld(0),
fSolidRadSlice(0), fLogicRadSlice(0), fPhysicRadSlice(0),
solidRadiator(0), logicRadiator(0), physiRadiator(0),
fRadiatorMat(0),
solidAbsorber(0), logicAbsorber(0), physiAbsorber(0),
magField(0), calorimeterSD(0), fXTRModel(0)
{
// default parameter values of the calorimeter
WorldSizeZ = 80.*cm;
WorldSizeR = 20.*cm;
// Radiator and detector parameters
fRadThickness = 40.0*micrometer ; // 25*micrometer ;
fGasGap = 0.126*mm ; // 1500*micrometer ;
fFoilNumber = 300 ; // 188 ;
AbsorberThickness = 3.0*cm ; // 40.0*mm ;
AbsorberRadius = 10.*cm;
zAbsorber = 36.*cm ;
fWindowThick = 51.0*micrometer ;
fElectrodeThick = 10.0*micrometer ;
fGapThick = 1.0*mm ;
fDetThickness = 40.0*mm ;
fDetLength = 200.0*cm ;
fDetGap = 1.0*mm ;
fStartR = 40.0*cm ;
fStartZ = 50.0*mm ;
fModuleNumber = 1 ;
// create commands for interactive definition of the calorimeter
detectorMessenger = new Em10DetectorMessenger(this);
}
//////////////////////////////////////////////////////////////////////////
//
//
Em10DetectorConstruction::~Em10DetectorConstruction()
{
delete detectorMessenger;
if(fXTRModel) delete fXTRModel;
}
//////////////////////////////////////////////////////////////////////////
//
//
G4VPhysicalVolume* Em10DetectorConstruction::Construct()
{
DefineMaterials();
return ConstructCalorimeter();
}
//////////////////////////////////////////////////////////////////////////////
//
//
void Em10DetectorConstruction::DefineMaterials()
{
//This function illustrates the possible ways to define materials
G4String name, symbol ; //a =mass of a mole;
G4double a, z, density ; //z =mean number of protons;
//G4int iz, n, nel ; //iz=number of protons in an isotope;
//n =number of nucleons in an isotope;
G4int nel ;
//G4int ncomponents, natoms;
G4int ncomponents;
//G4double abundance, fractionmass;
G4double fractionmass;
//G4double temperature, pressure;
//
// define Elements
//
a = 1.01*g/mole;
G4Element* elH = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
a = 6.94*g/mole;
G4Element* elLi = new G4Element(name="Lithium",symbol="Li" , z= 3., a);
a = 9.01*g/mole;
G4Element* elBe = new G4Element(name="Berillium",symbol="Be" , z= 4., a);
a = 6.01*g/mole;
G4Element* elC = new G4Element(name="Carbon", symbol="C", z=6., a);
a = 14.01*g/mole;
G4Element* elN = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
a = 16.00*g/mole;
G4Element* elO = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
a = 39.948*g/mole;
G4Element* elAr = new G4Element(name="Argon", symbol="Ar", z=18., a);
a = 131.29*g/mole;
G4Element* elXe = new G4Element(name="Xenon", symbol="Xe", z=54., a);
a = 19.00*g/mole;
G4Element* elF = new G4Element(name="Fluorine", symbol="F", z=9., a);
/////////////////////////////////////////////////////////////////
//
// Detector windows, electrodes
// Al for electrodes
density = 2.700*g/cm3;
a = 26.98*g/mole;
G4Material* Al = new G4Material(name="Aluminium", z=13., a, density);
////////////////////////////////////////////////////////////////////////////
//
// Materials for popular X-ray TR radiators
//
// TRT_CH2
density = 0.935*g/cm3;
G4Material* TRT_CH2 = new G4Material(name="TRT_CH2",density, nel=2);
TRT_CH2->AddElement(elC,1);
TRT_CH2->AddElement(elH,2);
// Radiator
density = 0.059*g/cm3;
G4Material* Radiator = new G4Material(name="Radiator",density, nel=2);
Radiator->AddElement(elC,1);
Radiator->AddElement(elH,2);
// Carbon Fiber
density = 0.145*g/cm3;
G4Material* CarbonFiber = new G4Material(name="CarbonFiber",density, nel=1);
CarbonFiber->AddElement(elC,1);
// Lithium
density = 0.534*g/cm3;
G4Material* Li = new G4Material(name="Li",density, nel=1);
Li->AddElement(elLi,1);
// Beryllium
density = 1.848*g/cm3;
G4Material* Be = new G4Material(name="Be",density, nel=1);
Be->AddElement(elBe,1);
// Mylar
density = 1.39*g/cm3;
G4Material* Mylar = new G4Material(name="Mylar", density, nel=3);
Mylar->AddElement(elO,2);
Mylar->AddElement(elC,5);
Mylar->AddElement(elH,4);
// Kapton (polyimide) ??? since = Mylar C5H4O2
density = 1.39*g/cm3;
G4Material* Kapton = new G4Material(name="Kapton", density, nel=3);
Kapton->AddElement(elO,2);
Kapton->AddElement(elC,5);
Kapton->AddElement(elH,4);
// Polypropelene
G4Material* CH2 = new G4Material ("Polypropelene" , 0.91*g/cm3, 2);
CH2->AddElement(elH,2);
CH2->AddElement(elC,1);
//////////////////////////////////////////////////////////////////////////
//
// Noble gases , STP conditions
// Helium as detector gas, STP
density = 0.178*mg/cm3 ;
a = 4.0026*g/mole ;
G4Material* He = new G4Material(name="He",z=2., a, density );
// Neon as detector gas, STP
density = 0.900*mg/cm3 ;
a = 20.179*g/mole ;
G4Material* Ne = new G4Material(name="Ne",z=10., a, density );
// Argon as detector gas, STP
density = 1.7836*mg/cm3 ; // STP
G4Material* Argon = new G4Material(name="Argon" , density, ncomponents=1);
Argon->AddElement(elAr, 1);
// Krypton as detector gas, STP
density = 3.700*mg/cm3 ;
a = 83.80*g/mole ;
G4Material* Kr = new G4Material(name="Kr",z=36., a, density );
// Xenon as detector gas, STP
density = 5.858*mg/cm3 ;
a = 131.29*g/mole ;
G4Material* Xe = new G4Material(name="Xenon",z=54., a, density );
/////////////////////////////////////////////////////////////////////////////
//
// Hydrocarbones, metane and others
// Metane, STP
density = 0.7174*mg/cm3 ;
G4Material* metane = new G4Material(name="CH4",density,nel=2) ;
metane->AddElement(elC,1) ;
metane->AddElement(elH,4) ;
// Propane, STP
density = 2.005*mg/cm3 ;
G4Material* propane = new G4Material(name="C3H8",density,nel=2) ;
propane->AddElement(elC,3) ;
propane->AddElement(elH,8) ;
// iso-Butane (methylpropane), STP
density = 2.67*mg/cm3 ;
G4Material* isobutane = new G4Material(name="isoC4H10",density,nel=2) ;
isobutane->AddElement(elC,4) ;
isobutane->AddElement(elH,10) ;
///////////////////////////////////////////////////////////////////////////
//
// Molecular gases
// Carbon dioxide
density = 1.977*mg/cm3;
G4Material* CO2 = new G4Material(name="CO2", density, nel=2,
kStateGas,273.15*kelvin,1.*atmosphere);
CO2->AddElement(elC,1);
CO2->AddElement(elO,2);
// Carbon dioxide, STP
density = 1.977*mg/cm3;
G4Material* CarbonDioxide = new G4Material(name="CO2", density, nel=2);
CarbonDioxide->AddElement(elC,1);
CarbonDioxide->AddElement(elO,2);
// Nitrogen, STP
density = 1.25053*mg/cm3 ; // STP
G4Material* Nitrogen = new G4Material(name="N2" , density, ncomponents=1);
Nitrogen->AddElement(elN, 2);
// Oxygen, STP
density = 1.4289*mg/cm3 ; // STP
G4Material* Oxygen = new G4Material(name="O2" , density, ncomponents=1);
Oxygen->AddElement(elO, 2);
/* *****************************
density = 1.25053*mg/cm3 ; // STP
a = 14.01*g/mole ; // get atomic weight !!!
// a = 28.016*g/mole;
G4Material* N2 = new G4Material(name="Nitrogen", z= 7.,a,density) ;
density = 1.25053*mg/cm3 ; // STP
G4Material* anotherN2 = new G4Material(name="anotherN2", density,ncomponents=2);
anotherN2->AddElement(elN, 1);
anotherN2->AddElement(elN, 1);
// air made from oxigen and nitrogen only
density = 1.290*mg/cm3; // old air from elements
G4Material* air = new G4Material(name="air" , density, ncomponents=2);
air->AddElement(elN, fractionmass=0.7);
air->AddElement(elO, fractionmass=0.3);
******************************************** */
// Dry Air (average composition), STP
density = 1.2928*mg/cm3 ; // STP
G4Material* Air = new G4Material(name="Air" , density, ncomponents=3);
Air->AddMaterial( Nitrogen, fractionmass = 0.7557 ) ;
Air->AddMaterial( Oxygen, fractionmass = 0.2315 ) ;
Air->AddMaterial( Argon, fractionmass = 0.0128 ) ;
////////////////////////////////////////////////////////////////////////////
//
// MWPC mixtures
// 80% Xe + 20% CO2, STP
density = 5.0818*mg/cm3 ;
G4Material* Xe20CO2 = new G4Material(name="Xe20CO2" , density, ncomponents=2);
Xe20CO2->AddMaterial( Xe, fractionmass = 0.922 ) ;
Xe20CO2->AddMaterial( CarbonDioxide, fractionmass = 0.078 ) ;
// 80% Kr + 20% CO2, STP
density = 3.601*mg/cm3 ;
G4Material* Kr20CO2 = new G4Material(name="Kr20CO2", density,
ncomponents=2);
Kr20CO2->AddMaterial( Kr, fractionmass = 0.89 ) ;
Kr20CO2->AddMaterial( CarbonDioxide, fractionmass = 0.11 ) ;
// Xe + 55% He + 15% CH4 ; NIM A294 (1990) 465-472; STP
density = 1.963*mg/cm3;
G4Material* Xe55He15CH4 = new G4Material(name="Xe55He15CH4",density,
ncomponents=3);
Xe55He15CH4->AddMaterial(Xe, 0.895);
Xe55He15CH4->AddMaterial(He, 0.050);
Xe55He15CH4->AddMaterial(metane,0.055);
// 90% Xe + 10% CH4, STP ; NIM A248 (1986) 379-388
density = 5.344*mg/cm3 ;
G4Material* Xe10CH4 = new G4Material(name="Xe10CH4" , density,
ncomponents=2);
Xe10CH4->AddMaterial( Xe, fractionmass = 0.987 ) ;
Xe10CH4->AddMaterial( metane, fractionmass = 0.013 ) ;
// 95% Xe + 5% CH4, STP ; NIM A214 (1983) 261-268
density = 5.601*mg/cm3 ;
G4Material* Xe5CH4 = new G4Material(name="Xe5CH4" , density,
ncomponents=2);
Xe5CH4->AddMaterial( Xe, fractionmass = 0.994 ) ;
Xe5CH4->AddMaterial( metane, fractionmass = 0.006 ) ;
// 80% Xe + 20% CH4, STP ; NIM A253 (1987) 235-244
density = 4.83*mg/cm3 ;
G4Material* Xe20CH4 = new G4Material(name="Xe20CH4" , density,
ncomponents=2);
Xe20CH4->AddMaterial( Xe, fractionmass = 0.97 ) ;
Xe20CH4->AddMaterial( metane, fractionmass = 0.03 ) ;
G4cout << *(G4Material::GetMaterialTable()) << G4endl;
// default materials of the calorimeter and TR radiator
fRadiatorMat = Li ; // CH2 Mylar ;
fWindowMat = Mylar ;
fElectrodeMat = Al ;
AbsorberMaterial = Xe10CH4 ;
fGapMat = Xe10CH4 ;
WorldMaterial = He ;
}
/////////////////////////////////////////////////////////////////////////
//
//
G4VPhysicalVolume* Em10DetectorConstruction::ConstructCalorimeter()
{
// G4int i, j ;
G4int j ;
// G4double zModule, zRadiator, rModule, rRadiator ;
G4double zModule, zRadiator ;
// complete the Calor parameters definition and Print
ComputeCalorParameters();
PrintCalorParameters();
// World
if(solidWorld) delete solidWorld ;
if(logicWorld) delete logicWorld ;
if(physiWorld) delete physiWorld ;
solidWorld = new G4Box("World", //its name
WorldSizeR,WorldSizeR,WorldSizeZ/2.) ;//its size
logicWorld = new G4LogicalVolume(solidWorld, //its solid
WorldMaterial, //its material
"World"); //its name
physiWorld = new G4PVPlacement(0, //no rotation
G4ThreeVector(), //at (0,0,0)
"World", //its name
logicWorld, //its logical volume
0, //its mother volume
false, //no boolean operation
0); //copy number
// TR radiator envelope
G4double radThick = fFoilNumber*(fRadThickness + fGasGap) + fDetGap ;
G4double zRad = fStartZ + 0.5*radThick ;
G4cout<<"zRad = "<<zRad/mm<<" mm"<<G4endl ;
radThick *= 1.2 ;
G4cout<<"radThick = "<<radThick/mm<<" mm"<<G4endl ;
G4cout<<"fFoilNumber = "<<fFoilNumber<<G4endl ;
G4cout<<"fRadiatorMat = "<<fRadiatorMat->GetName()<<G4endl ;
G4cout<<"WorldMaterial = "<<WorldMaterial->GetName()<<G4endl ;
if(solidRadiator) delete solidRadiator;
if(logicRadiator) delete logicRadiator;
if(physiRadiator) delete physiRadiator;
solidRadiator = new G4Box("Radiator",1.1*AbsorberRadius ,
1.1*AbsorberRadius,
0.5*radThick ) ;
logicRadiator = new G4LogicalVolume(solidRadiator,
WorldMaterial,
"Radiator");
physiRadiator = new G4PVPlacement(0,
G4ThreeVector(0,0,zRad),
"Radiator", logicRadiator,
physiWorld, false, 0 );
if(fSolidRadSlice) delete fSolidRadSlice;
if(fLogicRadSlice) delete fLogicRadSlice;
if(fPhysicRadSlice) delete fPhysicRadSlice;
fSolidRadSlice = new G4Box("RadSlice",AbsorberRadius,
AbsorberRadius,0.5*fRadThickness ) ;
fLogicRadSlice = new G4LogicalVolume(fSolidRadSlice,fRadiatorMat,
"RadSlice",0,0,0);
zModule = fStartZ + fRadThickness ;
G4cout<<"zModule = "<<zModule/mm<<" mm"<<G4endl ;
for(j=0;j<fFoilNumber;j++)
{
zRadiator = zModule + j*(fRadThickness + fGasGap) ;
G4cout<<zRadiator/mm<<" mm"<<"\t" ;
// G4cout<<"j = "<<j<<"\t" ;
fPhysicRadSlice = new G4PVPlacement(0,G4ThreeVector(0.,0.,zRadiator-zRad),
"RadSlice",fLogicRadSlice,
physiRadiator,false,j);
}
G4cout<<G4endl ;
G4Box* solidWindow = new G4Box("Window",AbsorberRadius,
AbsorberRadius,
fWindowThick/2. );
G4LogicalVolume* logicWindow = new G4LogicalVolume(solidWindow,
fWindowMat, "Window");
G4double zWindow = fStartZ + radThick + fWindowThick/2. + 5.0*mm ;
// G4VPhysicalVolume* physiWindow = new G4PVPlacement(0,
// G4ThreeVector(0.,0.,zWindow),
// "Window",logicWindow,physiWorld,false,0);
G4Box* solidGap = new G4Box("Gap",AbsorberRadius,
AbsorberRadius,
fGapThick/2. ) ;
G4LogicalVolume* logicGap = new G4LogicalVolume(solidGap,fGapMat, "Gap");
G4double zGap = zWindow + fWindowThick/2. + fGapThick/2. + 0.01*mm ;
// G4VPhysicalVolume* physiGap = new G4PVPlacement(0,
// G4ThreeVector(0.,0.,zGap),
// "Gap",logicGap,physiWorld,false,0);
G4Box* solidElectrode = new G4Box("Electrode",AbsorberRadius,
AbsorberRadius,
fElectrodeThick/2. );
G4LogicalVolume* logicElectrode = new G4LogicalVolume(solidElectrode,
fElectrodeMat, "Electrode");
G4double zElectrode = zGap + fGapThick/2. + fElectrodeThick/2. + 0.01*mm;
// G4VPhysicalVolume* physiElectrode = new G4PVPlacement(0,
// G4ThreeVector(0.,0.,zElectrode),
// "Electrode",logicElectrode,
// physiWorld,false,0);
// Absorber
zAbsorber = zElectrode + fElectrodeThick/2. + AbsorberThickness/2. + 0.01*mm;
if (AbsorberThickness > 0.)
{
if(solidAbsorber) delete solidAbsorber ;
if(logicAbsorber) delete logicAbsorber ;
if(physiAbsorber) delete physiAbsorber ;
solidAbsorber = new G4Box("Absorber",AbsorberRadius,
AbsorberRadius,
AbsorberThickness/2. );
logicAbsorber = new G4LogicalVolume(solidAbsorber,
AbsorberMaterial,
"Absorber");
physiAbsorber = new G4PVPlacement(0,
G4ThreeVector(0.,0.,zAbsorber),
"Absorber",
logicAbsorber,
physiWorld,
false,
0);
}
// Sensitive Detectors: Absorber
G4SDManager* SDman = G4SDManager::GetSDMpointer();
if(!calorimeterSD)
{
calorimeterSD = new Em10CalorimeterSD("CalorSD",this);
SDman->AddNewDetector( calorimeterSD );
}
if (logicAbsorber) logicAbsorber->SetSensitiveDetector(calorimeterSD);
// Parameterisation
ParametrisationModel();
// always return physics world
return physiWorld;
}
////////////////////////////////////////////////////////////////////////////
//
// Construct parametrisation model depending on the current value of fModelNumber
void Em10DetectorConstruction::ParametrisationModel()
{
G4cout<<"Em10DetectorConstruction::ParametrisationModel() is called"<<G4endl;
G4cout<<"fModelNumber = "<<fModelNumber<<G4endl;
G4double alphaPlate = 160.0 ;
G4double alphaGas = 160.0 ;
if(fXTRModel) {
// Remove first the model from the envelope:
logicRadiator->GetFastSimulationManager()->RemoveFastSimulationModel(fXTRModel);
// Then delete it:
delete fXTRModel;
}
switch(fModelNumber)
{
case 1:
fXTRModel = new G4FoamXrayTRmodel(logicRadiator,fRadThickness,fGasGap);
break;
case 2:
fXTRModel = new G4FoamXTRdEdx(logicRadiator,fRadThickness,fGasGap);
break;
case 3:
fXTRModel = new G4GamDistrXrayTRmodel(logicRadiator,
fRadThickness,alphaPlate,
fGasGap,alphaGas);
break;
case 4:
fXTRModel = new G4GamDistrXTRdEdx(logicRadiator,
fRadThickness,alphaPlate,
fGasGap,alphaGas);
break;
case 5:
fXTRModel = new G4IrregularXrayTRmodel(logicRadiator,fRadThickness,fGasGap);
break;
case 6:
fXTRModel = new G4IrregularXTRdEdx(logicRadiator,fRadThickness,fGasGap);
break;
case 7:
fXTRModel = new G4PlateIrrGasXrayTRmodel(logicRadiator,
fRadThickness,fGasGap);
break;
case 8:
fXTRModel = new G4PlateIrrGasXTRdEdx(logicRadiator,fRadThickness,fGasGap);
break;
case 9:
fXTRModel = new G4RegularXrayTRmodel(logicRadiator,fRadThickness,fGasGap);
break;
case 10:
fXTRModel = new G4RegularXTRdEdx(logicRadiator,fRadThickness,fGasGap);
break;
default:
fXTRModel = 0;
G4cout<<"Warning: No parametrisation model was defined?"<<G4endl ;
break ;
}
// fXTRModel->GetPlateZmuProduct() ;
// fXTRModel->GetGasZmuProduct() ;
// fXTRModel->GetNumberOfPhotons() ;
return;
}
////////////////////////////////////////////////////////////////////////////
//
//
void Em10DetectorConstruction::PrintCalorParameters()
{
G4cout << "\n The WORLD is made of "
<< WorldSizeZ/mm << "mm of " << WorldMaterial->GetName() ;
G4cout << ", the transverse size (R) of the world is " << WorldSizeR/mm << " mm. " << G4endl;
G4cout << " The ABSORBER is made of "
<< AbsorberThickness/mm << "mm of " << AbsorberMaterial->GetName() ;
G4cout << ", the transverse size (R) is " << AbsorberRadius/mm << " mm. " << G4endl;
G4cout << " Z position of the (middle of the) absorber " << zAbsorber/mm << " mm." << G4endl;
G4cout << G4endl;
}
///////////////////////////////////////////////////////////////////////////
//
//
void Em10DetectorConstruction::SetAbsorberMaterial(G4String materialChoice)
{
// get the pointer to the material table
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
// search the material by its name
G4Material* pttoMaterial;
for (size_t J=0 ; J<theMaterialTable->size() ; J++)
{
pttoMaterial = (*theMaterialTable)[J];
if(pttoMaterial->GetName() == materialChoice)
{
AbsorberMaterial = pttoMaterial;
logicAbsorber->SetMaterial(pttoMaterial);
// PrintCalorParameters();
}
}
}
///////////////////////////////////////////////////////////////////////////
//
//
void Em10DetectorConstruction::SetRadiatorMaterial(G4String materialChoice)
{
// get the pointer to the material table
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
// search the material by its name
G4Material* pttoMaterial;
for (size_t J=0 ; J<theMaterialTable->size() ; J++)
{
pttoMaterial = (*theMaterialTable)[J];
if(pttoMaterial->GetName() == materialChoice)
{
fRadiatorMat = pttoMaterial;
fLogicRadSlice->SetMaterial(pttoMaterial);
// PrintCalorParameters();
}
}
}
////////////////////////////////////////////////////////////////////////////
//
//
void Em10DetectorConstruction::SetWorldMaterial(G4String materialChoice)
{
// get the pointer to the material table
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
// search the material by its name
G4Material* pttoMaterial;
for (size_t J=0 ; J<theMaterialTable->size() ; J++)
{
pttoMaterial = (*theMaterialTable)[J];
if(pttoMaterial->GetName() == materialChoice)
{
WorldMaterial = pttoMaterial;
logicWorld->SetMaterial(pttoMaterial);
// PrintCalorParameters();
}
}
}
///////////////////////////////////////////////////////////////////////////
//
//
void Em10DetectorConstruction::SetAbsorberThickness(G4double val)
{
// change Absorber thickness and recompute the calorimeter parameters
AbsorberThickness = val;
ComputeCalorParameters();
}
///////////////////////////////////////////////////////////////////////////
//
//
void Em10DetectorConstruction::SetRadiatorThickness(G4double val)
{
// change XTR radiator thickness and recompute the calorimeter parameters
fRadThickness = val;
// ComputeCalorParameters();
}
///////////////////////////////////////////////////////////////////////////
//
//
void Em10DetectorConstruction::SetGasGapThickness(G4double val)
{
// change XTR gas gap thickness and recompute the calorimeter parameters
fGasGap = val;
// ComputeCalorParameters();
}
/////////////////////////////////////////////////////////////////////////////
//
//
void Em10DetectorConstruction::SetAbsorberRadius(G4double val)
{
// change the transverse size and recompute the calorimeter parameters
AbsorberRadius = val;
ComputeCalorParameters();
}
////////////////////////////////////////////////////////////////////////////
//
//
void Em10DetectorConstruction::SetWorldSizeZ(G4double val)
{
worldchanged=true;
WorldSizeZ = val;
ComputeCalorParameters();
}
///////////////////////////////////////////////////////////////////////////
//
//
void Em10DetectorConstruction::SetWorldSizeR(G4double val)
{
worldchanged=true;
WorldSizeR = val;
ComputeCalorParameters();
}
//////////////////////////////////////////////////////////////////////////////
//
//
void Em10DetectorConstruction::SetAbsorberZpos(G4double val)
{
zAbsorber = val;
ComputeCalorParameters();
}
//////////////////////////////////////////////////////////////////////////////
//
//
void Em10DetectorConstruction::SetMagField(G4double fieldValue)
{
//apply a global uniform magnetic field along X axis
/* *********************************************************
G4FieldManager* fieldMgr
= G4TransportationManager::GetTransportationManager()->GetFieldManager();
if(magField) delete magField; //delete the existing magn field
if(fieldValue!=0.) // create a new one if non nul
{
magField = new G4UniformMagField(G4ThreeVector(fieldValue,0.,0.));
fieldMgr->SetDetectorField(magField);
fieldMgr->CreateChordFinder(magField);
}
else
{
magField = 0;
fieldMgr->SetDetectorField(magField);
}
*************************************************************** */
}
///////////////////////////////////////////////////////////////////////////////
//
//
void Em10DetectorConstruction::UpdateGeometry()
{
G4RunManager::GetRunManager()->DefineWorldVolume(ConstructCalorimeter());
}
//
//
////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,226 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em10DetectorMessenger.cc,v 1.5 2001/11/21 18:48:56 mverderi Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
#include "Em10DetectorMessenger.hh"
#include "Em10DetectorConstruction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithoutParameter.hh"
//////////////////////////////////////////////////////////////////////////////
Em10DetectorMessenger::Em10DetectorMessenger(Em10DetectorConstruction * Em10Det)
:Em10Detector(Em10Det)
{
Em10detDir = new G4UIdirectory("/XTRdetector/");
Em10detDir->SetGuidance("Em10 detector control.");
AbsMaterCmd = new G4UIcmdWithAString("/XTRdetector/setAbsMat",this);
AbsMaterCmd->SetGuidance("Select Material of the Absorber.");
AbsMaterCmd->SetParameterName("choice",true);
AbsMaterCmd->SetDefaultValue("Xe");
AbsMaterCmd->AvailableForStates(Idle);
RadiatorMaterCmd = new G4UIcmdWithAString("/XTRdetector/setRadMat",this);
RadiatorMaterCmd->SetGuidance("Select Material of the XTR radiator.");
RadiatorMaterCmd->SetParameterName("choice",true);
RadiatorMaterCmd->SetDefaultValue("CH2");
RadiatorMaterCmd->AvailableForStates(Idle);
ModelCmd = new G4UIcmdWithAnInteger("/XTRdetector/setModel",this);
ModelCmd->SetGuidance("Select Model for XTR");
ModelCmd->SetParameterName("choice",true);
ModelCmd->SetDefaultValue(0);
// ModelCmd->AvailableForStates(PreInit,Idle);
ModelCmd->AvailableForStates(Idle);
FoilNumCmd = new G4UIcmdWithAnInteger("/XTRdetector/setFoilNum",this);
FoilNumCmd->SetGuidance("Select foil number for XTR");
FoilNumCmd->SetParameterName("choice",true);
FoilNumCmd->SetDefaultValue(0);
FoilNumCmd->AvailableForStates(PreInit,Idle);
WorldMaterCmd = new G4UIcmdWithAString("/XTRdetector/setWorldMat",this);
WorldMaterCmd->SetGuidance("Select Material of the World.");
WorldMaterCmd->SetParameterName("wchoice",true);
WorldMaterCmd->SetDefaultValue("Air");
WorldMaterCmd->AvailableForStates(Idle);
AbsThickCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setAbsThick",this);
AbsThickCmd->SetGuidance("Set Thickness of the Absorber");
AbsThickCmd->SetParameterName("SizeZ",false,false);
AbsThickCmd->SetDefaultUnit("mm");
AbsThickCmd->SetRange("SizeZ>0.");
AbsThickCmd->AvailableForStates(Idle);
RadiatorThickCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setRadThick",this);
RadiatorThickCmd->SetGuidance("Set Thickness of XTR radiator");
RadiatorThickCmd->SetParameterName("SizeZ",false,false);
RadiatorThickCmd->SetDefaultUnit("mm");
RadiatorThickCmd->SetRange("SizeZ>0.");
RadiatorThickCmd->AvailableForStates(Idle);
GasGapThickCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setGasGapThick",this);
GasGapThickCmd->SetGuidance("Set Thickness of XTR gas gaps");
GasGapThickCmd->SetParameterName("SizeZ",false,false);
GasGapThickCmd->SetDefaultUnit("mm");
GasGapThickCmd->SetRange("SizeZ>0.");
GasGapThickCmd->AvailableForStates(Idle);
AbsRadCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setAbsRad",this);
AbsRadCmd->SetGuidance("Set radius of the Absorber");
AbsRadCmd->SetParameterName("SizeR",false,false);
AbsRadCmd->SetDefaultUnit("mm");
AbsRadCmd->SetRange("SizeR>0.");
AbsRadCmd->AvailableForStates(Idle);
AbsZposCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setAbsZpos",this);
AbsZposCmd->SetGuidance("Set Z pos. of the Absorber");
AbsZposCmd->SetParameterName("Zpos",false,false);
AbsZposCmd->SetDefaultUnit("mm");
AbsZposCmd->AvailableForStates(Idle);
WorldZCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setWorldZ",this);
WorldZCmd->SetGuidance("Set Z size of the World");
WorldZCmd->SetParameterName("WSizeZ",false,false);
WorldZCmd->SetDefaultUnit("mm");
WorldZCmd->SetRange("WSizeZ>0.");
WorldZCmd->AvailableForStates(Idle);
WorldRCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setWorldR",this);
WorldRCmd->SetGuidance("Set R size of the World");
WorldRCmd->SetParameterName("WSizeR",false,false);
WorldRCmd->SetDefaultUnit("mm");
WorldRCmd->SetRange("WSizeR>0.");
WorldRCmd->AvailableForStates(Idle);
UpdateCmd = new G4UIcmdWithoutParameter("/XTRdetector/update",this);
UpdateCmd->SetGuidance("Update calorimeter geometry.");
UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
UpdateCmd->SetGuidance("if you changed geometrical value(s).");
UpdateCmd->AvailableForStates(Idle);
MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/XTRdetector/setField",this);
MagFieldCmd->SetGuidance("Define magnetic field.");
MagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
MagFieldCmd->SetParameterName("Bz",false,false);
MagFieldCmd->SetDefaultUnit("tesla");
MagFieldCmd->AvailableForStates(Idle);
}
///////////////////////////////////////////////////////////////////////////////
Em10DetectorMessenger::~Em10DetectorMessenger()
{
delete AbsMaterCmd;
delete ModelCmd;
delete FoilNumCmd;
delete AbsThickCmd;
delete RadiatorThickCmd;
delete GasGapThickCmd;
delete AbsRadCmd;
delete AbsZposCmd;
delete WorldMaterCmd;
delete RadiatorMaterCmd;
delete WorldZCmd;
delete WorldRCmd;
delete UpdateCmd;
delete MagFieldCmd;
delete Em10detDir;
}
/////////////////////////////////////////////////////////////////////////////
void Em10DetectorMessenger::SetNewValue(G4UIcommand* command,G4int newValue)
{
if( command == ModelCmd )
{
Em10Detector->SetParametrisationModel(newValue);
Em10Detector->Construct();
}
}
////////////////////////////////////////////////////////////////////////////
//
//
void Em10DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{
if( command == ModelCmd )
{
Em10Detector->SetParametrisationModel(ModelCmd->GetNewIntValue(newValue));
Em10Detector->ParametrisationModel();
}
if( command == FoilNumCmd )
{
Em10Detector->SetFoilNumber(FoilNumCmd->GetNewIntValue(newValue));
}
if( command == AbsMaterCmd )
{ Em10Detector->SetAbsorberMaterial(newValue);}
if( command == RadiatorMaterCmd )
{ Em10Detector->SetRadiatorMaterial(newValue);}
if( command == WorldMaterCmd )
{ Em10Detector->SetWorldMaterial(newValue);}
if( command == AbsThickCmd )
{ Em10Detector->SetAbsorberThickness(AbsThickCmd->GetNewDoubleValue(newValue));}
if( command == RadiatorThickCmd )
{ Em10Detector->SetRadiatorThickness(RadiatorThickCmd->
GetNewDoubleValue(newValue));}
if( command == GasGapThickCmd )
{ Em10Detector->SetGasGapThickness(GasGapThickCmd->
GetNewDoubleValue(newValue));}
if( command == AbsRadCmd )
{ Em10Detector->SetAbsorberRadius(AbsRadCmd->GetNewDoubleValue(newValue));}
if( command == AbsZposCmd )
{ Em10Detector->SetAbsorberZpos(AbsZposCmd->GetNewDoubleValue(newValue));}
if( command == WorldZCmd )
{ Em10Detector->SetWorldSizeZ(WorldZCmd->GetNewDoubleValue(newValue));}
if( command == WorldRCmd )
{ Em10Detector->SetWorldSizeR(WorldRCmd->GetNewDoubleValue(newValue));}
if( command == UpdateCmd )
{ Em10Detector->UpdateGeometry(); }
if( command == MagFieldCmd )
{ Em10Detector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,248 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em10EventAction.cc,v 1.3 2001/11/21 11:57:14 mverderi Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "Em10EventAction.hh"
#include "Em10RunAction.hh"
#include "Em10CalorHit.hh"
#include "Em10EventActionMessenger.hh"
#include "G4Event.hh"
#include "G4EventManager.hh"
#include "G4HCofThisEvent.hh"
#include "G4VHitsCollection.hh"
#include "G4SDManager.hh"
#include "G4UImanager.hh"
#include "G4TrajectoryContainer.hh"
#include "G4Trajectory.hh"
#include "G4VVisManager.hh"
#include "G4ios.hh"
#include "G4UnitsTable.hh"
#include "Randomize.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10EventAction::Em10EventAction(Em10RunAction* Em10RA)
:calorimeterCollID(-1),eventMessenger(0),
runaction(Em10RA),verboselevel(0),drawFlag("all"),printModulo(10000)
{
eventMessenger = new Em10EventActionMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10EventAction::~Em10EventAction()
{
delete eventMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10EventAction::BeginOfEventAction(const G4Event* evt)
{
G4int evtNb = evt->GetEventID();
if (evtNb%printModulo == 0)
G4cout << "\n---> Begin of Event: " << evtNb << G4endl;
if(verboselevel>1)
G4cout << "<<< Event " << evtNb << " started." << G4endl;
if (calorimeterCollID==-1)
{
G4SDManager * SDman = G4SDManager::GetSDMpointer();
calorimeterCollID = SDman->GetCollectionID("CalCollection");
}
nstep = 0. ;
nstepCharged = 0. ;
nstepNeutral = 0. ;
Nch = 0. ;
Nne = 0. ;
NE=0.;
NP=0.;
Transmitted=0.;
Reflected =0.;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10EventAction::EndOfEventAction(const G4Event* evt)
{
G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
Em10CalorHitsCollection* CHC = 0;
if (HCE)
CHC = (Em10CalorHitsCollection*)(HCE->GetHC(calorimeterCollID));
if (CHC)
{
int n_hit = CHC->entries();
// if(verboselevel==2)
// G4cout << " " << n_hit
// << " hits are stored in Em10CalorHitsCollection." << G4endl;
G4double totEAbs=0, totLAbs=0;
for (int i=0;i<n_hit;i++)
{ totEAbs += (*CHC)[i]->GetEdepAbs();
totLAbs += (*CHC)[i]->GetTrakAbs();
}
if(verboselevel==2)
G4cout
<< " Absorber: total energy: " << G4std::setw(7) <<
G4BestUnit(totEAbs,"Energy")
<< " total track length: " << G4std::setw(7) <<
G4BestUnit(totLAbs,"Length")
<< G4endl;
// count event, add deposits to the sum ...
runaction->CountEvent() ;
runaction->AddTrackLength(totLAbs) ;
runaction->AddnStepsCharged(nstepCharged) ;
runaction->AddnStepsNeutral(nstepNeutral) ;
if(verboselevel==2)
G4cout << " Ncharged=" << Nch << " , Nneutral=" << Nne << G4endl;
runaction->CountParticles(Nch,Nne);
runaction->AddEP(NE,NP);
runaction->AddTrRef(Transmitted,Reflected) ;
runaction->AddEdeps(totEAbs) ;
runaction->FillEn(totEAbs) ;
nstep=nstepCharged+nstepNeutral ;
runaction->FillNbOfSteps(nstep);
}
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
if(pVVisManager)
{
G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
G4int n_trajectories = 0;
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
for(G4int i=0; i<n_trajectories; i++)
{ G4Trajectory* trj = (G4Trajectory *)((*(evt->GetTrajectoryContainer()))[i]);
if (drawFlag == "all") trj->DrawTrajectory(50);
else if ((drawFlag == "charged")&&(trj->GetCharge() != 0.))
trj->DrawTrajectory(50);
}
}
if(verboselevel>0)
G4cout << "<<< Event " << evt->GetEventID() << " ended." << G4endl;
//save rndm status
if (runaction->GetRndmFreq() == 2)
{
HepRandom::saveEngineStatus("endOfEvent.rndm");
G4int evtNb = evt->GetEventID();
if (evtNb%printModulo == 0)
{
G4cout << "\n---> End of Event: " << evtNb << G4endl;
HepRandom::showEngineStatus();
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4int Em10EventAction::GetEventno()
{
G4int evno = fpEventManager->GetConstCurrentEvent()->GetEventID() ;
return evno ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10EventAction::setEventVerbose(G4int level)
{
verboselevel = level ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10EventAction::CountStepsCharged()
{
nstepCharged += 1. ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10EventAction::CountStepsNeutral()
{
nstepNeutral += 1. ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10EventAction::AddCharged()
{
Nch += 1.;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10EventAction::AddNeutral()
{
Nne += 1.;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10EventAction::AddE()
{
NE += 1.;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10EventAction::AddP()
{
NP += 1.;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10EventAction::SetTr()
{
Transmitted = 1.;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10EventAction::SetRef()
{
Reflected = 1.;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,88 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em10EventActionMessenger.cc,v 1.2 2001/07/11 09:57:24 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "Em10EventActionMessenger.hh"
#include "Em10EventAction.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10EventActionMessenger::Em10EventActionMessenger(Em10EventAction* EvAct)
:eventAction(EvAct)
{
setVerboseCmd = new G4UIcmdWithAnInteger("/event/setverbose",this);
setVerboseCmd->SetGuidance("Set verbose level ." );
setVerboseCmd->SetParameterName("level",true);
setVerboseCmd->SetDefaultValue(0);
DrawCmd = new G4UIcmdWithAString("/event/drawTracks",this);
DrawCmd->SetGuidance("Draw the tracks in the event");
DrawCmd->SetGuidance(" Choice : none,charged, all");
DrawCmd->SetParameterName("choice",true);
DrawCmd->SetDefaultValue("all");
DrawCmd->SetCandidates("none charged all");
DrawCmd->AvailableForStates(Idle);
PrintCmd = new G4UIcmdWithAnInteger("/event/printModulo",this);
PrintCmd->SetGuidance("Print events modulo n");
PrintCmd->SetParameterName("EventNb",false);
PrintCmd->SetRange("EventNb>0");
PrintCmd->AvailableForStates(Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10EventActionMessenger::~Em10EventActionMessenger()
{
delete setVerboseCmd;
delete DrawCmd;
delete PrintCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10EventActionMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
{
if(command == setVerboseCmd)
{eventAction->setEventVerbose(setVerboseCmd->GetNewIntValue(newValue));}
if(command == DrawCmd)
{eventAction->SetDrawFlag(newValue);}
if(command == PrintCmd)
{eventAction->SetPrintModulo(PrintCmd->GetNewIntValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,494 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em10PhysicsList.cc,v 1.3 2001/11/21 11:57:14 mverderi Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
#include "G4Timer.hh"
#include "Em10PhysicsList.hh"
#include "Em10DetectorConstruction.hh"
#include "Em10PhysicsListMessenger.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleWithCuts.hh"
#include "G4ProcessManager.hh"
#include "G4ProcessVector.hh"
#include "G4ParticleTypes.hh"
#include "G4ParticleTable.hh"
#include "G4Material.hh"
#include "G4EnergyLossTables.hh"
#include "G4UnitsTable.hh"
#include "G4ios.hh"
#include "g4std/iomanip"
#include "G4FastSimulationManagerProcess.hh"
/////////////////////////////////////////////////////////////
//
//
Em10PhysicsList::Em10PhysicsList(Em10DetectorConstruction* p)
: G4VUserPhysicsList(),
MaxChargedStep(DBL_MAX),
thePhotoElectricEffect(0), theComptonScattering(0),
theGammaConversion(0),
theeminusMultipleScattering(0), theeminusIonisation(0),
theeminusBremsstrahlung(0),
theeplusMultipleScattering(0), theeplusIonisation(0),
theeplusBremsstrahlung(0),
theeplusAnnihilation(0),
theeminusStepCut(0), theeplusStepCut(0)
{
pDet = p;
defaultCutValue = 1.000*mm ;
cutForGamma = defaultCutValue ;
cutForElectron = defaultCutValue ;
cutForProton = defaultCutValue ;
SetVerboseLevel(1);
physicsListMessenger = new Em10PhysicsListMessenger(this);
}
/////////////////////////////////////////////////////////////////////////
//
//
Em10PhysicsList::~Em10PhysicsList()
{
delete physicsListMessenger;
}
///////////////////////////////////////////////////////////////////////////
//
//
void Em10PhysicsList::ConstructParticle()
{
// In this method, static member functions should be called
// for all particles which you want to use.
// This ensures that objects of these particle types will be
// created in the program.
ConstructBosons();
ConstructLeptons();
ConstructMesons();
ConstructBarions();
}
////////////////////////////////////////////////////////////////////////////
//
//
void Em10PhysicsList::ConstructBosons()
{
// gamma
G4Gamma::GammaDefinition();
}
void Em10PhysicsList::ConstructLeptons()
{
// leptons
G4Electron::ElectronDefinition();
G4Positron::PositronDefinition();
G4MuonPlus::MuonPlusDefinition();
G4MuonMinus::MuonMinusDefinition();
G4NeutrinoE::NeutrinoEDefinition();
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
G4NeutrinoMu::NeutrinoMuDefinition();
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
}
void Em10PhysicsList::ConstructMesons()
{
// mesons
G4PionPlus::PionPlusDefinition();
G4PionMinus::PionMinusDefinition();
G4PionZero::PionZeroDefinition();
G4KaonPlus::KaonPlusDefinition();
G4KaonMinus::KaonMinusDefinition();
}
void Em10PhysicsList::ConstructBarions()
{
// barions
G4Proton::ProtonDefinition();
G4AntiProton::AntiProtonDefinition();
}
///////////////////////////////////////////////////////////////////////
//
//
void Em10PhysicsList::ConstructProcess()
{
AddTransportation();
AddParameterisation();
ConstructEM();
ConstructGeneral();
}
/////////////////////////////////////////////////////////////////////////////
//
//
#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"
#include "G4MultipleScattering.hh"
#include "G4eIonisation.hh"
#include "G4eBremsstrahlung.hh"
#include "G4eplusAnnihilation.hh"
#include "G4MuIonisation.hh"
#include "G4MuBremsstrahlung.hh"
#include "G4MuPairProduction.hh"
#include "G4hIonisation.hh"
#include "G4PAIonisation.hh"
#include "G4ForwardXrayTR.hh"
#include "Em10StepCut.hh"
#include "G4IonisationByLogicalVolume.hh"
void Em10PhysicsList::ConstructEM()
{
theParticleIterator->reset();
while( (*theParticleIterator)() )
{
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
G4String particleName = particle->GetParticleName();
if (particleName == "gamma")
{
// Construct processes for gamma
thePhotoElectricEffect = new G4PhotoElectricEffect();
theComptonScattering = new G4ComptonScattering();
theGammaConversion = new G4GammaConversion();
pmanager->AddDiscreteProcess(thePhotoElectricEffect);
pmanager->AddDiscreteProcess(theComptonScattering);
pmanager->AddDiscreteProcess(theGammaConversion);
}
else if (particleName == "e-")
{
// Construct processes for electron
// theeminusMultipleScattering = new G4MultipleScattering();
// theeminusIonisation = new G4eIonisation();
theeminusBremsstrahlung = new G4eBremsstrahlung();
// fPAIonisation = new G4PAIonisation("Xenon") ;
// fForwardXrayTR = new G4ForwardXrayTR("Air","Polypropelene","XrayTR") ;
theeminusStepCut = new Em10StepCut();
// pmanager->AddProcess(theeminusMultipleScattering,-1,1,1);
// pmanager->AddProcess(theeminusIonisation,-1,2,2);
pmanager->AddProcess(new G4IonisationByLogicalVolume(particleName,
pDet->GetLogicalAbsorber(),
"IonisationByLogVol"),-1,1,-1);
pmanager->AddProcess(theeminusBremsstrahlung,-1,-1,-1);
// pmanager->AddProcess(fPAIonisation,-1,2,2);
// pmanager->AddProcess(fForwardXrayTR,-1,-1,2);
pmanager->AddProcess(theeminusStepCut,-1,-1,4);
theeminusStepCut->SetMaxStep(MaxChargedStep) ;
}
else if (particleName == "e+")
{
// Construct processes for positron
// theeplusMultipleScattering = new G4MultipleScattering();
theeplusIonisation = new G4eIonisation();
theeplusBremsstrahlung = new G4eBremsstrahlung();
// theeplusAnnihilation = new G4eplusAnnihilation();
// fPAIonisation = new G4PAIonisation("Xenon") ;
// fForwardXrayTR = new G4ForwardXrayTR("Air","Polypropelene","XrayTR") ;
theeplusStepCut = new Em10StepCut();
// pmanager->AddProcess(theeplusMultipleScattering,-1,1,1);
pmanager->AddProcess(theeplusIonisation,-1,2,2);
pmanager->AddProcess(theeplusBremsstrahlung,-1,-1,3);
// pmanager->AddProcess(theeplusAnnihilation,0,-1,4);
// pmanager->AddProcess(fPAIonisation,-1,2,2);
// pmanager->AddProcess(fForwardXrayTR,-1,-1,2);
pmanager->AddProcess(theeplusStepCut,-1,-1,5);
theeplusStepCut->SetMaxStep(MaxChargedStep) ;
}
else if( particleName == "mu+" ||
particleName == "mu-" )
{
// Construct processes for muon+
// Em10StepCut* muonStepCut = new Em10StepCut();
// G4MuIonisation* themuIonisation = new G4MuIonisation() ;
// pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
// pmanager->AddProcess(themuIonisation,-1,2,2);
// pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3);
// pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4);
// pmanager->AddProcess(new G4PAIonisation("Xenon"),-1,2,2) ;
// pmanager->AddProcess( muonStepCut,-1,-1,3);
// muonStepCut->SetMaxStep(MaxChargedStep) ;
}
else if (
particleName == "proton"
|| particleName == "antiproton"
|| particleName == "pi+"
|| particleName == "pi-"
|| particleName == "kaon+"
|| particleName == "kaon-"
)
{
Em10StepCut* thehadronStepCut = new Em10StepCut();
// G4hIonisation* thehIonisation = new G4hIonisation() ;
// G4MultipleScattering* thehMultipleScattering =
// new G4MultipleScattering() ;
pmanager->AddProcess(new G4IonisationByLogicalVolume(particleName,
pDet->GetLogicalAbsorber(),
"IonisationByLogVolHadr"),-1,2,2);
// pmanager->AddProcess(thehMultipleScattering,-1,1,1);
// pmanager->AddProcess(thehIonisation,-1,2,2);
// pmanager->AddProcess(new G4PAIonisation("Xenon"),-1,2,2) ;
// pmanager->AddProcess(new G4PAIonisation("Argon"),-1,2,2) ;
pmanager->AddProcess( thehadronStepCut,-1,-1,3);
thehadronStepCut->SetMaxStep(MaxChargedStep) ;
// thehadronStepCut->SetMaxStep(10*mm) ;
}
}
}
#include "G4Decay.hh"
void Em10PhysicsList::ConstructGeneral()
{
// Add Decay Process
G4Decay* theDecayProcess = new G4Decay();
theParticleIterator->reset();
while( (*theParticleIterator)() )
{
G4ParticleDefinition* particle = theParticleIterator->value();
G4ProcessManager* pmanager = particle->GetProcessManager();
if (theDecayProcess->IsApplicable(*particle))
{
pmanager ->AddProcess(theDecayProcess);
// set ordering for PostStepDoIt and AtRestDoIt
pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
}
}
}
/////////////////////////////////////////////////////////////////////////////
void Em10PhysicsList::AddParameterisation()
{
G4FastSimulationManagerProcess* theFastSimulationManagerProcess =
new G4FastSimulationManagerProcess() ;
theParticleIterator->reset();
while( (*theParticleIterator)() )
{
G4ParticleDefinition* particle = theParticleIterator->value() ;
G4ProcessManager* pmanager = particle->GetProcessManager() ;
// both postStep and alongStep action are required: because
// of the use of ghost volumes. If no ghost, the postStep is sufficient.
pmanager->AddProcess(theFastSimulationManagerProcess, -1, 1, 1);
}
}
/////////////////////////////////////////////////////////////////////////////
void Em10PhysicsList::SetCuts()
{
G4Timer theTimer ;
theTimer.Start() ;
if (verboseLevel >0)
{
G4cout << "Em10PhysicsList::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(cutForGamma,"gamma");
SetCutValue(cutForElectron,"e-");
SetCutValue(cutForElectron,"e+");
SetCutValue(defaultCutValue,"mu-");
SetCutValue(defaultCutValue,"mu+");
// set cut values for proton and anti_proton before all other hadrons
// because some processes for hadrons need cut values for proton/anti_proton
SetCutValue(defaultCutValue, "proton");
SetCutValue(defaultCutValue, "anti_proton");
SetCutValueForOthers(defaultCutValue);
if (verboseLevel>1) DumpCutValuesTable();
theTimer.Stop();
G4cout.precision(6);
G4cout << G4endl ;
G4cout << "total time(SetCuts)=" << theTimer.GetUserElapsed() << " s " <<G4endl;
}
///////////////////////////////////////////////////////////////////////////
void Em10PhysicsList::SetGammaCut(G4double val)
{
ResetCuts();
cutForGamma = val;
}
///////////////////////////////////////////////////////////////////////////
void Em10PhysicsList::SetElectronCut(G4double val)
{
ResetCuts();
cutForElectron = val;
}
//////////////////////////////////////////////////////////////////////
void Em10PhysicsList::SetProtonCut(G4double val)
{
ResetCuts();
cutForProton = val;
}
////////////////////////////////////////////////////////////////////////////
void Em10PhysicsList::SetCutsByEnergy(G4double val)
{
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
G4Material* currMat = pDet->GetAbsorberMaterial();
// 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
G4ParticleDefinition* part;
G4double cut;
part = theParticleTable->FindParticle("e-");
cut = G4EnergyLossTables::GetRange(part,val,currMat);
SetCutValue(cut, "e-");
part = theParticleTable->FindParticle("e+");
cut = G4EnergyLossTables::GetRange(part,val,currMat);
SetCutValue(cut, "e+");
// set cut values for proton and anti_proton before all other hadrons
// because some processes for hadrons need cut values for proton/anti_proton
part = theParticleTable->FindParticle("proton");
cut = G4EnergyLossTables::GetRange(part,val,currMat);
SetCutValue(cut, "proton");
part = theParticleTable->FindParticle("anti_proton");
cut = G4EnergyLossTables::GetRange(part,val,currMat);
SetCutValue(cut, "anti_proton");
SetCutValueForOthers(cut);
}
//////////////////////////////////////////////////////////////////////////////
void Em10PhysicsList::GetRange(G4double val)
{
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
G4Material* currMat = pDet->GetAbsorberMaterial();
G4ParticleDefinition* part;
G4double cut;
part = theParticleTable->FindParticle("e-");
cut = G4EnergyLossTables::GetRange(part,val,currMat);
G4cout << "material : " << currMat->GetName() << G4endl;
G4cout << "particle : " << part->GetParticleName() << G4endl;
G4cout << "energy : " << val / keV << " (keV)" << G4endl;
G4cout << "range : " << cut / mm << " (mm)" << G4endl;
}
////////////////////////////////////////////////////////////////////////////
void Em10PhysicsList::SetMaxStep(G4double step)
{
MaxChargedStep = step ;
G4cout << " MaxChargedStep=" << MaxChargedStep << G4endl;
G4cout << G4endl;
}
@@ -0,0 +1,120 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em10PhysicsListMessenger.cc,v 1.2 2001/07/11 09:57:24 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "Em10PhysicsListMessenger.hh"
#include "Em10PhysicsList.hh"
#include "G4UIcmdWithoutParameter.hh"
#include "G4UIcmdWithADouble.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10PhysicsListMessenger::Em10PhysicsListMessenger(Em10PhysicsList * List)
:Em10List(List)
{
cutGCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutG",this);
cutGCmd->SetGuidance("Set cut values by RANGE for Gamma.");
cutGCmd->SetParameterName("range",true);
cutGCmd->SetDefaultValue(1.);
cutGCmd->SetDefaultUnit("mm");
cutGCmd->AvailableForStates(Idle);
cutECmd = new G4UIcmdWithADoubleAndUnit("/calor/cutE",this);
cutECmd->SetGuidance("Set cut values by RANGE for e- e+.");
cutECmd->SetParameterName("range",true);
cutECmd->SetDefaultValue(1.);
cutECmd->SetDefaultUnit("mm");
cutECmd->AvailableForStates(Idle);
cutPCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutP",this);
cutPCmd->SetGuidance("Set cut values by RANGE for proton and others.");
cutPCmd->SetParameterName("range",true);
cutPCmd->SetDefaultValue(1.);
cutPCmd->SetDefaultUnit("mm");
cutPCmd->AvailableForStates(Idle);
eCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutEnergy",this);
eCmd->SetGuidance("Set cut values by ENERGY for charged particles.");
eCmd->SetParameterName("energy",true);
eCmd->SetDefaultValue(10.);
eCmd->SetDefaultUnit("keV");
eCmd->AvailableForStates(Idle);
rCmd = new G4UIcmdWithADoubleAndUnit("/calor/range",this);
rCmd->SetGuidance("Display the RANGE of Electron for the current material.");
rCmd->SetParameterName("energy",true);
rCmd->SetDefaultValue(10.);
rCmd->SetDefaultUnit("keV");
rCmd->AvailableForStates(Idle);
setMaxStepCmd = new G4UIcmdWithADoubleAndUnit("/step/setMaxStep",this);
setMaxStepCmd->SetGuidance("Set max. step length in the detector");
setMaxStepCmd->SetParameterName("mxStep",true);
setMaxStepCmd->SetDefaultUnit("mm");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10PhysicsListMessenger::~Em10PhysicsListMessenger()
{
delete setMaxStepCmd;
delete cutGCmd;
delete cutECmd;
delete cutPCmd;
delete rCmd;
delete eCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10PhysicsListMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
{
if(command == cutGCmd)
{ Em10List->SetGammaCut(cutGCmd->GetNewDoubleValue(newValue));}
if(command == cutECmd)
{ Em10List->SetElectronCut(eCmd->GetNewDoubleValue(newValue));}
if(command == cutPCmd)
{ Em10List->SetProtonCut(eCmd->GetNewDoubleValue(newValue));}
if(command == eCmd)
{ Em10List->SetCutsByEnergy(cutECmd->GetNewDoubleValue(newValue));}
if(command == rCmd)
{ Em10List->GetRange(rCmd->GetNewDoubleValue(newValue));}
if(command == setMaxStepCmd)
{ Em10List->SetMaxStep(setMaxStepCmd->GetNewDoubleValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,152 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em10PrimaryGeneratorAction.cc,v 1.3 2001/11/21 11:57:14 mverderi Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "Em10PrimaryGeneratorAction.hh"
#include "Em10DetectorConstruction.hh"
#include "Em10PrimaryGeneratorMessenger.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
#include "Randomize.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
G4String Em10PrimaryGeneratorAction::thePrimaryParticleName="proton" ;
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10PrimaryGeneratorAction::Em10PrimaryGeneratorAction(
Em10DetectorConstruction* Em10DC)
:Em10Detector(Em10DC),rndmFlag("off"),xvertex(0.),yvertex(0.),zvertex(0.),
vertexdefined(false)
{
G4int n_particle = 1;
particleGun = new G4ParticleGun(n_particle);
//create a messenger for this class
gunMessenger = new Em10PrimaryGeneratorMessenger(this);
// default particle kinematic
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4String particleName;
G4ParticleDefinition* particle
= particleTable->FindParticle(particleName="proton");
particleGun->SetParticleDefinition(particle);
thePrimaryParticleName = particle->GetParticleName() ;
particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
particleGun->SetParticleEnergy(100.*GeV);
zvertex = 0.0 ; // -0.5*(Em10Detector->GetAbsorberThickness());
particleGun->SetParticlePosition(G4ThreeVector(xvertex,yvertex,zvertex));
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10PrimaryGeneratorAction::~Em10PrimaryGeneratorAction()
{
delete particleGun;
delete gunMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
//this function is called at the begining of event
//
thePrimaryParticleName = particleGun->GetParticleDefinition()->
GetParticleName() ;
G4double x0,y0,z0 ;
if(vertexdefined)
{
x0 = xvertex ;
y0 = yvertex ;
z0 = zvertex ;
}
else
{
x0 = 0. ;
y0 = 0. ;
z0 = 0. ; // -0.5*(Em10Detector->GetWorldSizeZ()) ;
}
/* ****************************************************
G4double r0,phi0 ;
if (rndmFlag == "on")
{
r0 = (Em10Detector->GetAbsorberRadius())*sqrt(G4UniformRand());
phi0 = twopi*G4UniformRand();
x0 = r0*cos(phi0);
y0 = r0*sin(phi0);
}
********************************************* */
particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
particleGun->GeneratePrimaryVertex(anEvent);
}
///////////////////////////////////////////////////////////////////////
//
//
G4String Em10PrimaryGeneratorAction::GetPrimaryName()
{
return thePrimaryParticleName ;
}
void Em10PrimaryGeneratorAction::Setzvertex(G4double z)
{
vertexdefined = true ;
zvertex = z ;
G4cout << " Z coordinate of the primary vertex = " << zvertex/mm <<
" mm." << G4endl;
}
void Em10PrimaryGeneratorAction::Setxvertex(G4double x)
{
vertexdefined = true ;
xvertex = x ;
G4cout << " X coordinate of the primary vertex = " << xvertex/mm <<
" mm." << G4endl;
}
void Em10PrimaryGeneratorAction::Setyvertex(G4double y)
{
vertexdefined = true ;
yvertex = y ;
G4cout << " Y coordinate of the primary vertex = " << yvertex/mm <<
" mm." << G4endl;
}
@@ -0,0 +1,93 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em10PrimaryGeneratorMessenger.cc,v 1.2 2001/07/11 09:57:25 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "Em10PrimaryGeneratorMessenger.hh"
#include "Em10PrimaryGeneratorAction.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10PrimaryGeneratorMessenger::Em10PrimaryGeneratorMessenger(Em10PrimaryGeneratorAction* Em10Gun)
:Em10Action(Em10Gun)
{
RndmCmd = new G4UIcmdWithAString("/gun/random",this);
RndmCmd->SetGuidance("Shoot randomly the incident particle.");
RndmCmd->SetGuidance(" Choice : on, off(default)");
RndmCmd->SetParameterName("choice",true);
RndmCmd->SetDefaultValue("off");
RndmCmd->SetCandidates("on off");
RndmCmd->AvailableForStates(PreInit,Idle);
setxvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/xvertex",this);
setxvertexCmd->SetGuidance(" Set x coord. of the primary vertex.");
setxvertexCmd->SetParameterName("xv",true);
setxvertexCmd->SetDefaultValue(0.0*mm) ;
setyvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/yvertex",this);
setyvertexCmd->SetGuidance(" Set y coord. of the primary vertex.");
setyvertexCmd->SetParameterName("yv",true);
setyvertexCmd->SetDefaultValue(0.0*mm) ;
setzvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/zvertex",this);
setzvertexCmd->SetGuidance(" Set z coord. of the primary vertex.");
setzvertexCmd->SetParameterName("zv",true);
setzvertexCmd->SetDefaultValue(0.0*mm) ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10PrimaryGeneratorMessenger::~Em10PrimaryGeneratorMessenger()
{
delete RndmCmd;
delete setxvertexCmd;
delete setyvertexCmd;
delete setzvertexCmd;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10PrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
{
if( command == RndmCmd )
{ Em10Action->SetRndmFlag(newValue);}
if( command == setxvertexCmd)
{ Em10Action->Setxvertex(setxvertexCmd->GetNewDoubleValue(newValue));}
if( command == setyvertexCmd)
{ Em10Action->Setyvertex(setyvertexCmd->GetNewDoubleValue(newValue));}
if( command == setzvertexCmd)
{ Em10Action->Setzvertex(setzvertexCmd->GetNewDoubleValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,390 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em10RunMessenger.cc,v 1.2 2001/07/11 09:57:26 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "Em10RunMessenger.hh"
#include "Em10RunAction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWithADouble.hh"
#include "G4UIcmdWithAString.hh"
#include "G4ios.hh"
#include "globals.hh"
#include "Randomize.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10RunMessenger::Em10RunMessenger(Em10RunAction* RA)
:runAction (RA)
{
plotDir = new G4UIdirectory("/plots/");
plotDir->SetGuidance("plot control");
sethistNameCmd = new G4UIcmdWithAString("/plots/sethistName",this);
sethistNameCmd->SetGuidance("set name for the histogram file");
setnbinStepCmd = new G4UIcmdWithAnInteger("/plots/setnbinStep",this);
setnbinStepCmd->SetGuidance("set nb of bins in #step plot");
setnbinStepCmd->SetParameterName("nbinStep",false);
setSteplowCmd = new G4UIcmdWithADouble("/plots/setSteplow",this);
setSteplowCmd->SetGuidance("set lower limit for #step plot ");
setSteplowCmd->SetParameterName("Steplow",false);
setStephighCmd = new G4UIcmdWithADouble("/plots/setStephigh",this);
setStephighCmd->SetGuidance("set upper limit for #step plot ");
setStephighCmd->SetParameterName("Stephigh",false);
setnbinEnCmd = new G4UIcmdWithAnInteger("/plots/setnbinEn",this);
setnbinEnCmd->SetGuidance("set nb of bins in Edep plot");
setnbinEnCmd->SetParameterName("nbinE",false);
setEnlowCmd = new G4UIcmdWithADoubleAndUnit("/plots/setEnlow",this);
setEnlowCmd->SetGuidance("set lower limit for Edep plot ");
setEnlowCmd->SetParameterName("Elow",false);
setEnlowCmd->SetUnitCategory("Energy");
setEnhighCmd = new G4UIcmdWithADoubleAndUnit("/plots/setEnhigh",this);
setEnhighCmd->SetGuidance("set upper limit for Edep plot ");
setEnhighCmd->SetParameterName("Ehigh",false);
setEnhighCmd->SetUnitCategory("Energy");
setnbinGammaCmd = new G4UIcmdWithAnInteger("/plots/setnbinGamma",this);
setnbinGammaCmd->SetGuidance("set nb of bins in gamma spectrum plot");
setnbinGammaCmd->SetParameterName("nbinGamma",false);
setElowGammaCmd = new G4UIcmdWithADoubleAndUnit("/plots/setElowGamma",this);
setElowGammaCmd->SetGuidance("set lower limit for gamma spectrum plot ");
setElowGammaCmd->SetParameterName("ElowGamma",false);
setElowGammaCmd->SetUnitCategory("Energy");
setEhighGammaCmd = new G4UIcmdWithADoubleAndUnit("/plots/setEhighGamma",this);
setEhighGammaCmd->SetGuidance("set upper limit for gamma spectrum plot ");
setEhighGammaCmd->SetParameterName("EhighGamma",false);
setEhighGammaCmd->SetUnitCategory("Energy");
setnbinTtCmd = new G4UIcmdWithAnInteger("/plots/setnbinTt",this);
setnbinTtCmd->SetGuidance("set nb of bins in Etransmitted plot");
setnbinTtCmd->SetParameterName("nbinTt",false);
setTtlowCmd = new G4UIcmdWithADoubleAndUnit("/plots/setTtlow",this);
setTtlowCmd->SetGuidance("set lower limit for Etransmitted plot ");
setTtlowCmd->SetParameterName("Ttlow",false);
setTthighCmd = new G4UIcmdWithADoubleAndUnit("/plots/setTthigh",this);
setTthighCmd->SetGuidance("set upper limit for Etransmitted plot ");
setTthighCmd->SetParameterName("Tthigh",false);
setnbinTbCmd = new G4UIcmdWithAnInteger("/plots/setnbinTb",this);
setnbinTbCmd->SetGuidance("set nb of bins in Ebackscattering plot");
setnbinTbCmd->SetParameterName("nbinTb",false);
setTblowCmd = new G4UIcmdWithADoubleAndUnit("/plots/setTblow",this);
setTblowCmd->SetGuidance("set lower limit for Ebackscattered plot ");
setTblowCmd->SetParameterName("Tblow",false);
setTbhighCmd = new G4UIcmdWithADoubleAndUnit("/plots/setTbhigh",this);
setTbhighCmd->SetGuidance("set upper limit for Ebackscattered plot ");
setTbhighCmd->SetParameterName("Tbhigh",false);
setnbinTsecCmd = new G4UIcmdWithAnInteger("/plots/setnbinTsec",this);
setnbinTsecCmd->SetGuidance("set nb of bins in charged Tsecondary plot");
setnbinTsecCmd->SetParameterName("nbinTsec",false);
setTseclowCmd = new G4UIcmdWithADoubleAndUnit("/plots/setTseclow",this);
setTseclowCmd->SetGuidance("set lower limit for charged Tsecondary plot ");
setTseclowCmd->SetParameterName("Tseclow",false);
setTsechighCmd = new G4UIcmdWithADoubleAndUnit("/plots/setTsechigh",this);
setTsechighCmd->SetGuidance("set upper limit for charged Tsecondary plot ");
setTsechighCmd->SetParameterName("Tsechigh",false);
setnbinRCmd = new G4UIcmdWithAnInteger("/plots/setnbinR",this);
setnbinRCmd->SetGuidance("set nb of bins in R plot");
setnbinRCmd->SetParameterName("nbinR",false);
setRlowCmd = new G4UIcmdWithADoubleAndUnit("/plots/setRlow",this);
setRlowCmd->SetGuidance("set lower limit for R plot ");
setRlowCmd->SetParameterName("Rlow",false);
setRhighCmd = new G4UIcmdWithADoubleAndUnit("/plots/setRhigh",this);
setRhighCmd->SetGuidance("set upper limit for R plot ");
setRhighCmd->SetParameterName("Rhigh",false);
setnbinzvertexCmd = new G4UIcmdWithAnInteger("/plots/setnbinzvertex",this);
setnbinzvertexCmd->SetGuidance("set nb of bins in Z vertex plot");
setnbinzvertexCmd->SetParameterName("nbinZ",false);
setzlowCmd = new G4UIcmdWithADoubleAndUnit("/plots/setzlow",this);
setzlowCmd->SetGuidance("set lower limit for Z vertex plot ");
setzlowCmd->SetParameterName("zlow",false);
setzhighCmd = new G4UIcmdWithADoubleAndUnit("/plots/setzhigh",this);
setzhighCmd->SetGuidance("set upper limit for Z vertex plot ");
setzhighCmd->SetParameterName("zhigh",false);
setnbinThCmd = new G4UIcmdWithAnInteger("/plots/setnbinTh",this);
setnbinThCmd->SetGuidance("set nb of bins in Theta transmitted plot");
setnbinThCmd->SetParameterName("nbinTh",false);
setThlowCmd = new G4UIcmdWithADoubleAndUnit("/plots/setThlow",this);
setThlowCmd->SetGuidance("set lower limit for Theta transmitted plot ");
setThlowCmd->SetParameterName("Thlow",false);
setThhighCmd = new G4UIcmdWithADoubleAndUnit("/plots/setThhigh",this);
setThhighCmd->SetGuidance("set upper limit for Theta transmitted plot ");
setThhighCmd->SetParameterName("Thhigh",false);
setnbinThbackCmd = new G4UIcmdWithAnInteger("/plots/setnbinThback",this);
setnbinThbackCmd->SetGuidance("set nb of bins in backscattering Theta plot");
setnbinThbackCmd->SetParameterName("nbinThback",false);
setThlowbackCmd = new G4UIcmdWithADoubleAndUnit("/plots/setThlowback",this);
setThlowbackCmd->SetGuidance("set lower limit for backscattering Theta plot ");
setThlowbackCmd->SetParameterName("Thlowback",false);
setThhighbackCmd = new G4UIcmdWithADoubleAndUnit("/plots/setThhighback",this);
setThhighbackCmd->SetGuidance("set upper limit for backscattering Theta plot ");
setThhighbackCmd->SetParameterName("Thhighback",false);
RndmDir = new G4UIdirectory("/rndm/");
RndmDir->SetGuidance("Rndm status control.");
RndmSaveCmd = new G4UIcmdWithAnInteger("/rndm/save",this);
RndmSaveCmd->SetGuidance("set frequency to save rndm status on external files.");
RndmSaveCmd->SetGuidance("freq = 0 not saved");
RndmSaveCmd->SetGuidance("freq > 0 saved on: beginOfRun.rndm");
RndmSaveCmd->SetGuidance("freq = 1 saved on: endOfRun.rndm");
RndmSaveCmd->SetGuidance("freq = 2 saved on: endOfEvent.rndm");
RndmSaveCmd->SetParameterName("frequency",false);
RndmSaveCmd->SetRange("frequency>=0 && frequency<=2");
RndmSaveCmd->AvailableForStates(PreInit,Idle);
RndmReadCmd = new G4UIcmdWithAString("/rndm/read",this);
RndmReadCmd->SetGuidance("get rndm status from an external file.");
RndmReadCmd->SetParameterName("fileName",true);
RndmReadCmd->SetDefaultValue ("beginOfRun.rndm");
RndmReadCmd->AvailableForStates(PreInit,Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10RunMessenger::~Em10RunMessenger()
{
delete sethistNameCmd;
delete setnbinStepCmd;
delete setSteplowCmd;
delete setStephighCmd;
delete setnbinEnCmd;
delete setEnlowCmd;
delete setEnhighCmd;
delete setnbinGammaCmd;
delete setElowGammaCmd;
delete setEhighGammaCmd;
delete setnbinTtCmd;
delete setTtlowCmd;
delete setTthighCmd;
delete setnbinTbCmd;
delete setTblowCmd;
delete setTbhighCmd;
delete setnbinTsecCmd;
delete setTseclowCmd;
delete setTsechighCmd;
delete setnbinRCmd;
delete setRlowCmd;
delete setRhighCmd;
delete setnbinzvertexCmd;
delete setzlowCmd;
delete setzhighCmd;
delete setnbinThCmd;
delete setThlowCmd;
delete setThhighCmd;
delete setnbinThbackCmd;
delete setThlowbackCmd;
delete setThhighbackCmd;
delete plotDir;
delete RndmSaveCmd; delete RndmReadCmd; delete RndmDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10RunMessenger::SetNewValue(G4UIcommand* command,G4String newValues)
{
if( command == sethistNameCmd)
runAction
->SethistName(newValues) ;
if( command == setnbinStepCmd)
runAction
->SetnbinStep(setnbinStepCmd->GetNewIntValue(newValues));
if( command == setSteplowCmd)
runAction
->SetSteplow( setSteplowCmd->GetNewDoubleValue(newValues));
if( command == setStephighCmd)
runAction
->SetStephigh( setStephighCmd->GetNewDoubleValue(newValues));
if( command == setnbinEnCmd)
runAction
->SetnbinEn(setnbinEnCmd->GetNewIntValue(newValues));
if( command == setEnlowCmd)
runAction
->SetEnlow( setEnlowCmd->GetNewDoubleValue(newValues));
if( command == setEnhighCmd)
runAction
->SetEnhigh( setEnhighCmd->GetNewDoubleValue(newValues));
if( command == setnbinGammaCmd)
runAction
->SetnbinGamma(setnbinGammaCmd->GetNewIntValue(newValues));
if( command == setElowGammaCmd)
runAction
->SetElowGamma( setElowGammaCmd->GetNewDoubleValue(newValues));
if( command == setEhighGammaCmd)
runAction
->SetEhighGamma( setEhighGammaCmd->GetNewDoubleValue(newValues));
if( command == setnbinTtCmd)
runAction
->SetnbinTt(setnbinTtCmd->GetNewIntValue(newValues));
if( command == setTtlowCmd)
runAction
->SetTtlow( setTtlowCmd->GetNewDoubleValue(newValues));
if( command == setTthighCmd)
runAction
->SetTthigh( setTthighCmd->GetNewDoubleValue(newValues));
if( command == setnbinTbCmd)
runAction
->SetnbinTb(setnbinTbCmd->GetNewIntValue(newValues));
if( command == setTblowCmd)
runAction
->SetTblow( setTblowCmd->GetNewDoubleValue(newValues));
if( command == setTbhighCmd)
runAction
->SetTbhigh( setTbhighCmd->GetNewDoubleValue(newValues));
if( command == setnbinTsecCmd)
runAction
->SetnbinTsec(setnbinTsecCmd->GetNewIntValue(newValues));
if( command == setTseclowCmd)
runAction
->SetTseclow( setTseclowCmd->GetNewDoubleValue(newValues));
if( command == setTsechighCmd)
runAction
->SetTsechigh( setTsechighCmd->GetNewDoubleValue(newValues));
if( command == setnbinRCmd)
runAction
->SetnbinR(setnbinRCmd->GetNewIntValue(newValues));
if( command == setRlowCmd)
runAction
->SetRlow( setRlowCmd->GetNewDoubleValue(newValues));
if( command == setRhighCmd)
runAction
->SetRhigh( setRhighCmd->GetNewDoubleValue(newValues));
if( command == setnbinzvertexCmd)
runAction
->Setnbinzvertex(setnbinzvertexCmd->GetNewIntValue(newValues));
if( command == setzlowCmd)
runAction
->Setzlow( setzlowCmd->GetNewDoubleValue(newValues));
if( command == setzhighCmd)
runAction
->Setzhigh( setzhighCmd->GetNewDoubleValue(newValues));
if( command == setnbinThCmd)
runAction
->SetnbinTh(setnbinThCmd->GetNewIntValue(newValues));
if( command == setThlowCmd)
runAction
->SetThlow( setThlowCmd->GetNewDoubleValue(newValues));
if( command == setThhighCmd)
runAction
->SetThhigh( setThhighCmd->GetNewDoubleValue(newValues));
if( command == setnbinThbackCmd)
runAction
->SetnbinThBack(setnbinThbackCmd->GetNewIntValue(newValues));
if( command == setThlowbackCmd)
runAction
->SetThlowBack( setThlowbackCmd->GetNewDoubleValue(newValues));
if( command == setThhighbackCmd)
runAction
->SetThhighBack( setThhighbackCmd->GetNewDoubleValue(newValues));
if (command == RndmSaveCmd)
runAction->SetRndmFreq(RndmSaveCmd->GetNewIntValue(newValues));
if (command == RndmReadCmd)
{ G4cout << "\n---> rndm status restored from file: " << newValues << G4endl;
HepRandom::restoreEngineStatus(newValues);
HepRandom::showEngineStatus();
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,56 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em10StepCut.cc,v 1.2 2001/07/11 09:57:26 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
#include "Em10StepCut.hh"
#include "G4Step.hh"
#include "G4UserLimits.hh"
#include "G4VParticleChange.hh"
#include "G4EnergyLossTables.hh"
Em10StepCut::Em10StepCut(const G4String& aName)
: G4VDiscreteProcess(aName),MaxChargedStep(DBL_MAX)
{
if (verboseLevel>0) {
G4cout << GetProcessName() << " is created "<< G4endl;
}
}
Em10StepCut::~Em10StepCut()
{
}
Em10StepCut::Em10StepCut(Em10StepCut& right)
:G4VDiscreteProcess(right)
{}
void Em10StepCut::SetMaxStep(G4double step)
{
MaxChargedStep = step ;
}
@@ -0,0 +1,207 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em10SteppingAction.cc,v 1.3 2001/11/21 11:57:15 mverderi Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "Em10DetectorConstruction.hh"
#include "G4EnergyLossTables.hh"
#include "G4SteppingManager.hh"
#include "G4TrackVector.hh"
#include "Em10SteppingAction.hh"
#include "Em10PrimaryGeneratorAction.hh"
#include "Em10EventAction.hh"
#include "Em10RunAction.hh"
#include "G4Event.hh"
#include "G4EventManager.hh"
#include "Em10SteppingMessenger.hh"
#include "G4ios.hh"
#include "g4std/iomanip"
#include "G4UImanager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10SteppingAction::Em10SteppingAction(Em10DetectorConstruction* DET,
Em10EventAction* EA,
Em10RunAction* RA)
:detector (DET),eventaction (EA),runaction (RA),steppingMessenger(0),
IDold(-1) ,evnoold(-1)
{
steppingMessenger = new Em10SteppingMessenger(this);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10SteppingAction::~Em10SteppingAction()
{
delete steppingMessenger ;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10SteppingAction::UserSteppingAction(const G4Step* aStep)
{
G4double Theta,Thetaback,Ttrans,Tback,Tsec,Egamma,yend,zend,rend ;
G4int evno = eventaction->GetEventno() ;
IDnow = evno+10000*(aStep->GetTrack()->GetTrackID())+
100000000*(aStep->GetTrack()->GetParentID());
if(IDnow != IDold)
{
IDold=IDnow ;
if(
(((aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
GetParticleName()) == "e-") &&
((aStep->GetTrack()->GetTrackID() != 1) ||
(aStep->GetTrack()->GetParentID() != 0)) )
||
(((aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
GetParticleName()) == "e+") &&
((aStep->GetTrack()->GetTrackID() != 1) ||
(aStep->GetTrack()->GetParentID() != 0)) )
)
runaction->Fillvertexz(aStep->GetTrack()->GetVertexPosition().x());
if(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()=="Absorber")
{
if(((aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
GetParticleName()) == "e-") &&
((aStep->GetTrack()->GetTrackID() != 1) ||
(aStep->GetTrack()->GetParentID() != 0)) )
{
eventaction->AddCharged() ;
eventaction->AddE() ;
Tsec = aStep->GetTrack()->GetKineticEnergy() ; // !!!!!!!!!!!!
Tsec += aStep->GetTotalEnergyDeposit() ; // !!!!!!!!!!!!
runaction->FillTsec(Tsec) ;
}
else
if(((aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
GetParticleName()) == "e+") &&
((aStep->GetTrack()->GetTrackID() != 1) ||
(aStep->GetTrack()->GetParentID() != 0)) )
{
eventaction->AddCharged() ;
eventaction->AddP() ;
Tsec = aStep->GetTrack()->GetKineticEnergy() ; // !!!!!!!!!!!!
Tsec += aStep->GetTotalEnergyDeposit() ; // !!!!!!!!!!!!
runaction->FillTsec(Tsec) ;
}
else
if(((aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
GetParticleName()) == "gamma") &&
((aStep->GetTrack()->GetTrackID() != 1) ||
(aStep->GetTrack()->GetParentID() != 0)) )
{
eventaction->AddNeutral() ;
}
}
}
if(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()=="Absorber")
{
if(((aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
GetParticleName()) == "e-")
||
((aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
GetParticleName()) == "e+"))
eventaction->CountStepsCharged() ;
if ((aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
GetParticleName()) == "gamma")
eventaction->CountStepsNeutral() ;
}
if (
(((aStep->GetTrack()->GetTrackID() == 1) &&
(aStep->GetTrack()->GetParentID()== 0)) ||
(aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
GetParticleName() ==
Em10PrimaryGeneratorAction::GetPrimaryName()))
&&
(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()=="Absorber")
&&
(aStep->GetTrack()->GetNextVolume()->GetName()=="World") &&
(aStep->GetPostStepPoint()->GetProcessDefinedStep()
->GetProcessName() == "Transportation") &&
(aStep->GetTrack()->GetMomentumDirection().x()>0.)
)
{
eventaction->SetTr();
Theta = acos(aStep->GetTrack()->GetMomentumDirection().x()) ;
runaction->FillTh(Theta) ;
Ttrans = aStep->GetTrack()->GetKineticEnergy() ;
runaction->FillTt(Ttrans) ;
yend= aStep->GetTrack()->GetPosition().y() ;
zend= aStep->GetTrack()->GetPosition().z() ;
rend = sqrt(yend*yend+zend*zend) ;
runaction->FillR(rend);
}
if (
(((aStep->GetTrack()->GetTrackID() == 1) &&
(aStep->GetTrack()->GetParentID()== 0)) ||
(aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
GetParticleName() ==
Em10PrimaryGeneratorAction::GetPrimaryName()))
&&
(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()=="Absorber") &&
(aStep->GetTrack()->GetNextVolume()->GetName()=="World") &&
(aStep->GetPostStepPoint()->GetProcessDefinedStep()
->GetProcessName() == "Transportation") &&
(aStep->GetTrack()->GetMomentumDirection().z()<0.)
)
{
eventaction->SetRef();
Thetaback = acos(aStep->GetTrack()->GetMomentumDirection().x()) ;
Thetaback -= 0.5*pi ;
runaction->FillThBack(Thetaback) ;
Tback = aStep->GetTrack()->GetKineticEnergy() ;
runaction->FillTb(Tback) ;
}
if (
((aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()=="Absorber") &&
(aStep->GetTrack()->GetNextVolume()->GetName()=="World") &&
(aStep->GetPostStepPoint()->GetProcessDefinedStep()
->GetProcessName() == "Transportation") &&
(aStep->GetTrack()->GetMomentumDirection().x()>0.) &&
(aStep->GetTrack()->GetDynamicParticle()->GetDefinition()
->GetParticleName() == "gamma"))
)
{
Egamma = aStep->GetTrack()->GetKineticEnergy() ;
runaction->FillGammaSpectrum(Egamma) ;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,60 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em10SteppingMessenger.cc,v 1.2 2001/07/11 09:57:27 gunter Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#include "Em10SteppingMessenger.hh"
#include "Em10SteppingAction.hh"
#include "G4UIdirectory.hh"
#include "globals.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10SteppingMessenger::Em10SteppingMessenger(Em10SteppingAction* SA)
:steppingAction (SA)
{
steppingDir = new G4UIdirectory("/stepping/");
steppingDir->SetGuidance("stepping control");
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10SteppingMessenger::~Em10SteppingMessenger()
{
delete steppingDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10SteppingMessenger::SetNewValue(G4UIcommand* command,G4String newValues)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -0,0 +1,186 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em10SteppingVerbose.cc,v 1.3 2001/11/21 11:57:15 mverderi Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
//---------------------------------------------------------------
//
// Em10SteppingVerbose.cc
//
// Description:
// Implementation of the Em10SteppingVerbose class
// Contact:
// Questions and comments to this code should be sent to
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
//
//---------------------------------------------------------------
#include "Em10SteppingVerbose.hh"
#include "G4SteppingManager.hh"
#include "G4UnitsTable.hh"
////////////////////////////////////////////////
Em10SteppingVerbose::Em10SteppingVerbose()
////////////////////////////////////////////////
{
}
//////////////////////////////////////////////////
Em10SteppingVerbose::~Em10SteppingVerbose()
//////////////////////////////////////////////////
{
}
/////////////////////////////////////////
void Em10SteppingVerbose::StepInfo()
/////////////////////////////////////////
{
CopyState();
G4int prec = G4cout.precision(3);
if( verboseLevel >= 1 ){
if( verboseLevel >= 4 ) VerboseTrack();
if( verboseLevel >= 3 ){
G4cout << G4endl;
G4cout << G4std::setw( 5) << "#Step#" << " "
<< G4std::setw( 6) << "X" << " "
<< G4std::setw( 6) << "Y" << " "
<< G4std::setw( 6) << "Z" << " "
<< G4std::setw( 9) << "KineE" << " "
<< G4std::setw( 9) << "dEStep" << " "
<< G4std::setw(10) << "StepLeng"
<< G4std::setw(10) << "TrakLeng"
<< G4std::setw(10) << "NextVolu"
<< G4std::setw(10) << "Process" << G4endl;
}
G4cout << G4std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< G4std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< G4std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< G4std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< G4std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
// if( fStepStatus != fWorldBoundary){
if( fTrack->GetNextVolume() != 0 ) {
G4cout << G4std::setw(10) << fTrack->GetNextVolume()->GetName();
} else {
G4cout << G4std::setw(10) << "OutOfWorld";
}
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){
G4cout << G4std::setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
->GetProcessName();
} else {
G4cout << "User Limit";
}
G4cout << G4endl;
if( verboseLevel == 2 ){
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
fN2ndariesAlongStepDoIt +
fN2ndariesPostStepDoIt;
if(tN2ndariesTot>0){
G4cout << " :----- List of 2ndaries - "
<< "#SpawnInStep=" << G4std::setw(3) << tN2ndariesTot
<< "(Rest=" << G4std::setw(2) << fN2ndariesAtRestDoIt
<< ",Along=" << G4std::setw(2) << fN2ndariesAlongStepDoIt
<< ",Post=" << G4std::setw(2) << fN2ndariesPostStepDoIt
<< "), "
<< "#SpawnTotal=" << G4std::setw(3) << (*fSecondary).size()
<< " ---------------"
<< G4endl;
for(size_t lp1=(*fSecondary).size()-tN2ndariesTot;
lp1<(*fSecondary).size(); lp1++){
G4cout << " : "
<< G4std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
<< G4std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
<< G4std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
<< G4std::setw(6)
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
<< G4std::setw(10)
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
G4cout << G4endl;
}
G4cout << " :-----------------------------"
<< "----------------------------------"
<< "-- EndOf2ndaries Info ---------------"
<< G4endl;
}
}
}
G4cout.precision(prec);
}
////////////////////////////////////////////////
void Em10SteppingVerbose::TrackingStarted()
////////////////////////////////////////////////
{
CopyState();
G4int prec = G4cout.precision(3);
if( verboseLevel > 0 ){
G4cout << G4std::setw( 5) << "Step#" << " "
<< G4std::setw( 6) << "X" << " "
<< G4std::setw( 6) << "Y" << " "
<< G4std::setw( 6) << "Z" << " "
<< G4std::setw( 9) << "KineE" << " "
<< G4std::setw( 9) << "dEStep" << " "
<< G4std::setw(10) << "StepLeng"
<< G4std::setw(10) << "TrakLeng"
<< G4std::setw(10) << "NextVolu"
<< G4std::setw(10) << "Process" << G4endl;
G4cout << G4std::setw( 5) << fTrack->GetCurrentStepNumber() << " "
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
<< G4std::setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
<< G4std::setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
<< G4std::setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
<< G4std::setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
<< G4std::setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
if(fTrack->GetNextVolume()){
G4cout << G4std::setw(10) << fTrack->GetNextVolume()->GetName() << " ";
} else {
G4cout << G4std::setw(10) << "OutOfWorld" << " ";
}
G4cout << G4std::setw(10) << "initStep" << G4endl;
}
G4cout.precision(prec);
}
@@ -0,0 +1,153 @@
//
// ********************************************************************
// * DISCLAIMER *
// * *
// * The following disclaimer summarizes all the specific disclaimers *
// * of contributors to this software. The specific disclaimers,which *
// * govern, are listed with their locations in: *
// * http://cern.ch/geant4/license *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. *
// * *
// * This code implementation is the intellectual property of the *
// * GEANT4 collaboration. *
// * By copying, distributing or modifying the Program (or any work *
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: Em10VisManager.cc,v 1.3 2001/12/12 15:22:30 johna Exp $
// GEANT4 tag $Name: geant4-04-00 $
//
//
// John Allison 24th January 1998.
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
#ifdef G4VIS_USE
#include "Em10VisManager.hh"
// Supported drivers...
// Not needing external packages or libraries...
#include "G4ASCIITree.hh"
#include "G4DAWNFILE.hh"
#include "G4GAGTree.hh"
#include "G4HepRepFile.hh"
#include "G4RayTracer.hh"
#include "G4VRML1File.hh"
#include "G4VRML2File.hh"
// Needing external packages or libraries...
#ifdef G4VIS_USE_DAWN
#include "G4FukuiRenderer.hh"
#endif
#ifdef G4VIS_USE_OPACS
#include "G4Wo.hh"
#include "G4Xo.hh"
#endif
#ifdef G4VIS_USE_OPENGLX
#include "G4OpenGLImmediateX.hh"
#include "G4OpenGLStoredX.hh"
#endif
#ifdef G4VIS_USE_OPENGLWIN32
#include "G4OpenGLImmediateWin32.hh"
#include "G4OpenGLStoredWin32.hh"
#endif
#ifdef G4VIS_USE_OPENGLXM
#include "G4OpenGLImmediateXm.hh"
#include "G4OpenGLStoredXm.hh"
#endif
#ifdef G4VIS_USE_OIX
#include "G4OpenInventorX.hh"
#endif
#ifdef G4VIS_USE_OIWIN32
#include "G4OpenInventorWin32.hh"
#endif
#ifdef G4VIS_USE_VRML
#include "G4VRML1.hh"
#include "G4VRML2.hh"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
Em10VisManager::Em10VisManager () {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
void Em10VisManager::RegisterGraphicsSystems () {
// Graphics Systems not needing external packages or libraries...
RegisterGraphicsSystem (new G4ASCIITree);
RegisterGraphicsSystem (new G4DAWNFILE);
RegisterGraphicsSystem (new G4GAGTree);
RegisterGraphicsSystem (new G4HepRepFile);
RegisterGraphicsSystem (new G4RayTracer);
RegisterGraphicsSystem (new G4VRML1File);
RegisterGraphicsSystem (new G4VRML2File);
// Graphics systems needing external packages or libraries...
#ifdef G4VIS_USE_DAWN
RegisterGraphicsSystem (new G4FukuiRenderer);
#endif
#ifdef G4VIS_USE_OPACS
RegisterGraphicsSystem (new G4Wo);
RegisterGraphicsSystem (new G4Xo);
#endif
#ifdef G4VIS_USE_OPENGLX
RegisterGraphicsSystem (new G4OpenGLImmediateX);
RegisterGraphicsSystem (new G4OpenGLStoredX);
#endif
#ifdef G4VIS_USE_OPENGLWIN32
RegisterGraphicsSystem (new G4OpenGLImmediateWin32);
RegisterGraphicsSystem (new G4OpenGLStoredWin32);
#endif
#ifdef G4VIS_USE_OPENGLXM
RegisterGraphicsSystem (new G4OpenGLImmediateXm);
RegisterGraphicsSystem (new G4OpenGLStoredXm);
#endif
#ifdef G4VIS_USE_OIX
RegisterGraphicsSystem (new G4OpenInventorX);
#endif
#ifdef G4VIS_USE_OIWIN32
RegisterGraphicsSystem (new G4OpenInventorWin32);
#endif
#ifdef G4VIS_USE_VRML
RegisterGraphicsSystem (new G4VRML1);
RegisterGraphicsSystem (new G4VRML2);
#endif
if (fVerbose > 0) {
G4cout <<
"\nYou have successfully chosen to use the following graphics systems."
<< G4endl;
PrintAvailableGraphicsSystems ();
}
}
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....