Import Geant4 5.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:15:15 +02:00
parent 37fff30d2e
commit fbd4999cf7
4396 changed files with 56662 additions and 52446 deletions
@@ -21,6 +21,11 @@
// ********************************************************************
//
//
// $Id: ExN06DetectorConstruction.cc,v 1.11 2003/04/17 21:11:13 gum Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN06DetectorConstruction.hh"
@@ -36,87 +41,66 @@
#include "G4ThreeVector.hh"
#include "G4Transform3D.hh"
#include "G4PVPlacement.hh"
#include "G4OpBoundaryProcess.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06DetectorConstruction::ExN06DetectorConstruction()
{
expHall_x = 10.*m;
expHall_y = 10.*m;
expHall_z = 10.*m;
tank_x = 5.*m;
tank_y = 5.*m;
tank_z = 5.*m;
bubble_x = 0.5*m;
bubble_y = 0.5*m;
bubble_z = 0.5*m;
expHall_x = expHall_y = expHall_z = 10*m;
tank_x = tank_y = tank_z = 5*m;
bubble_x = bubble_y = bubble_z = 0.5*m;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06DetectorConstruction::~ExN06DetectorConstruction(){;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VPhysicalVolume* ExN06DetectorConstruction::Construct()
{
// ------------- Materials -------------
G4double a, z, density;
G4String name, symbol;
G4int nel;
G4int nelements;
// Air
// ---
//
G4Element* elN = new G4Element("Nitrogen", "N", z=7 , a=14.01*g/mole);
G4Element* elO = new G4Element("Oxygen" , "O", z=8 , a=16.00*g/mole);
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);
density = 1.29e-03*g/cm3;
G4Material* Air = new G4Material(name="Air", density, nel=2);
Air->AddElement(elN, .7);
Air->AddElement(elO, .3);
G4Material* Air = new G4Material("Air", density=1.29*mg/cm3, nelements=2);
Air->AddElement(elN, 70*perCent);
Air->AddElement(elO, 30*perCent);
// Water
// -----
a = 1.01*g/mole;
G4Element* elH = new G4Element(name="Hydrogen", symbol="H", z=1., a);
density = 1.0*g/cm3;
G4Material* Water = new G4Material(name="Water", density, nel=2);
//
G4Element* elH = new G4Element("Hydrogen", "H", z=1 , a=1.01*g/mole);
G4Material* Water = new G4Material("Water", density= 1.0*g/cm3, nelements=2);
Water->AddElement(elH, 2);
Water->AddElement(elO, 1);
/////////////////////////////////////////////
// Generate & Add Material Properties Table
/////////////////////////////////////////////
const G4int NUMENTRIES = 32;
G4double PPCKOV[NUMENTRIES] =
{ 2.034E-9*GeV, 2.068E-9*GeV, 2.103E-9*GeV, 2.139E-9*GeV,
2.177E-9*GeV, 2.216E-9*GeV, 2.256E-9*GeV, 2.298E-9*GeV,
2.341E-9*GeV, 2.386E-9*GeV, 2.433E-9*GeV, 2.481E-9*GeV,
2.532E-9*GeV, 2.585E-9*GeV, 2.640E-9*GeV, 2.697E-9*GeV,
2.757E-9*GeV, 2.820E-9*GeV, 2.885E-9*GeV, 2.954E-9*GeV,
3.026E-9*GeV, 3.102E-9*GeV, 3.181E-9*GeV, 3.265E-9*GeV,
3.353E-9*GeV, 3.446E-9*GeV, 3.545E-9*GeV, 3.649E-9*GeV,
3.760E-9*GeV, 3.877E-9*GeV, 4.002E-9*GeV, 4.136E-9*GeV };
// { 2.038E-9*GeV, 2.072E-9*GeV, 2.107E-9*GeV, 2.143E-9*GeV,
// 2.181E-9*GeV, 2.220E-9*GeV, 2.260E-9*GeV, 2.302E-9*GeV,
// 2.346E-9*GeV, 2.391E-9*GeV, 2.438E-9*GeV, 2.486E-9*GeV,
// 2.537E-9*GeV, 2.590E-9*GeV, 2.645E-9*GeV, 2.702E-9*GeV,
// 2.763E-9*GeV, 2.825E-9*GeV, 2.891E-9*GeV, 2.960E-9*GeV,
// 3.032E-9*GeV, 3.108E-9*GeV, 3.188E-9*GeV, 3.271E-9*GeV,
// 3.360E-9*GeV, 3.453E-9*GeV, 3.552E-9*GeV, 3.656E-9*GeV,
// 3.767E-9*GeV, 3.884E-9*GeV, 4.010E-9*GeV, 4.144E-9*GeV };
G4double RINDEX1[NUMENTRIES] =
//
// ------------ Generate & Add Material Properties Table ------------
//
const G4int nEntries = 32;
G4double PhotonEnergy[nEntries] =
{ 2.034*eV, 2.068*eV, 2.103*eV, 2.139*eV,
2.177*eV, 2.216*eV, 2.256*eV, 2.298*eV,
2.341*eV, 2.386*eV, 2.433*eV, 2.481*eV,
2.532*eV, 2.585*eV, 2.640*eV, 2.697*eV,
2.757*eV, 2.820*eV, 2.885*eV, 2.954*eV,
3.026*eV, 3.102*eV, 3.181*eV, 3.265*eV,
3.353*eV, 3.446*eV, 3.545*eV, 3.649*eV,
3.760*eV, 3.877*eV, 4.002*eV, 4.136*eV };
//
// Water
//
G4double RefractiveIndex1[nEntries] =
{ 1.3435, 1.344, 1.3445, 1.345, 1.3455,
1.346, 1.3465, 1.347, 1.3475, 1.348,
1.3485, 1.3492, 1.35, 1.3505, 1.351,
@@ -125,194 +109,154 @@ G4VPhysicalVolume* ExN06DetectorConstruction::Construct()
1.3572, 1.358, 1.3585, 1.359, 1.3595,
1.36, 1.3608};
// { 1.33, 1.33, 1.33, 1.33, 1.33, 1.33, 1.33,
// 1.33, 1.33, 1.34, 1.34, 1.34, 1.34, 1.34,
// 1.34, 1.34, 1.34, 1.34, 1.34, 1.34, 1.34,
// 1.34, 1.34, 1.35, 1.35, 1.35, 1.35, 1.35,
// 1.35, 1.35, 1.35, 1.35 };
G4double Absorption1[nEntries] =
{3.448*m, 4.082*m, 6.329*m, 9.174*m, 12.346*m, 13.889*m,
15.152*m, 17.241*m, 18.868*m, 20.000*m, 26.316*m, 35.714*m,
45.455*m, 47.619*m, 52.632*m, 52.632*m, 55.556*m, 52.632*m,
52.632*m, 47.619*m, 45.455*m, 41.667*m, 37.037*m, 33.333*m,
30.000*m, 28.500*m, 27.000*m, 24.500*m, 22.000*m, 19.500*m,
17.500*m, 14.500*m };
G4double RINDEX2[NUMENTRIES] =
G4double ScintilFast[nEntries] =
{ 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00 };
G4double ABSORPTION1[NUMENTRIES] =
{344.8*cm, 408.2*cm, 632.9*cm, 917.4*cm, 1234.6*cm, 1388.9*cm,
1515.2*cm, 1724.1*cm, 1886.8*cm, 2000.0*cm, 2631.6*cm, 3571.4*cm,
4545.5*cm, 4761.9*cm, 5263.2*cm, 5263.2*cm, 5555.6*cm, 5263.2*cm,
5263.2*cm, 4761.9*cm, 4545.5*cm, 4166.7*cm, 3703.7*cm, 3333.3*cm,
3000.0*cm, 2850.0*cm, 2700.0*cm, 2450.0*cm, 2200.0*cm, 1950.0*cm,
1750.0*cm, 1450.0*cm };
G4double SCINTILLATION_FAST[NUMENTRIES] =
{ 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00 };
G4double SCINTILLATION_SLOW[NUMENTRIES] =
G4double ScintilSlow[nEntries] =
{ 0.01, 1.00, 2.00, 3.00, 4.00, 5.00, 6.00,
7.00, 8.00, 9.00, 8.00, 7.00, 6.00, 4.00,
3.00, 2.00, 1.00, 0.01, 1.00, 2.00, 3.00,
4.00, 5.00, 6.00, 7.00, 8.00, 9.00, 8.00,
7.00, 6.00, 5.00, 4.00 };
G4MaterialPropertiesTable *myMPT1 = new G4MaterialPropertiesTable();
myMPT1->AddProperty("RINDEX", PPCKOV, RINDEX1, NUMENTRIES);
myMPT1->AddProperty("ABSLENGTH",PPCKOV, ABSORPTION1, NUMENTRIES);
myMPT1->AddProperty("FASTCOMPONENT",PPCKOV, SCINTILLATION_FAST, NUMENTRIES);
myMPT1->AddProperty("SLOWCOMPONENT",PPCKOV, SCINTILLATION_SLOW, NUMENTRIES);
G4MaterialPropertiesTable* myMPT1 = new G4MaterialPropertiesTable();
myMPT1->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex1,nEntries);
myMPT1->AddProperty("ABSLENGTH", PhotonEnergy, Absorption1, nEntries);
myMPT1->AddProperty("FASTCOMPONENT",PhotonEnergy, ScintilFast, nEntries);
myMPT1->AddProperty("SLOWCOMPONENT",PhotonEnergy, ScintilSlow, nEntries);
myMPT1->AddConstProperty("SCINTILLATIONYIELD",50./MeV);
myMPT1->AddConstProperty("RESOLUTIONSCALE",1.0);
myMPT1->AddConstProperty("FASTTIMECONSTANT", 1.*ns);
myMPT1->AddConstProperty("SLOWTIMECONSTANT",10.*ns);
myMPT1->AddConstProperty("YIELDRATIO",0.8);
Water->SetMaterialPropertiesTable(myMPT1);
G4MaterialPropertiesTable *myMPT2 = new G4MaterialPropertiesTable();
myMPT2->AddProperty("RINDEX", PPCKOV, RINDEX2, NUMENTRIES);
//
// Air
//
G4double RefractiveIndex2[nEntries] =
{ 1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00, 1.00, 1.00, 1.00,
1.00, 1.00, 1.00, 1.00 };
G4MaterialPropertiesTable* myMPT2 = new G4MaterialPropertiesTable();
myMPT2->AddProperty("RINDEX", PhotonEnergy, RefractiveIndex2, nEntries);
Air->SetMaterialPropertiesTable(myMPT2);
//
// ------------- Volumes --------------
// The experimental Hall
// ---------------------
// The experimental Hall
//
G4Box* expHall_box = new G4Box("World",expHall_x,expHall_y,expHall_z);
G4Box * expHall_box
= new G4Box("World",expHall_x,expHall_y,expHall_z);
G4LogicalVolume * expHall_log
G4LogicalVolume* expHall_log
= new G4LogicalVolume(expHall_box,Air,"World",0,0,0);
G4VPhysicalVolume * expHall_phys
= new G4PVPlacement(0,G4ThreeVector(),"World",expHall_log,0,false,0);
G4VPhysicalVolume* expHall_phys
= new G4PVPlacement(0,G4ThreeVector(),expHall_log,"World",0,false,0);
// The Water Tank
// --------------
// The Water Tank
//
G4Box* waterTank_box = new G4Box("Tank",tank_x,tank_y,tank_z);
G4Box * waterTank_box
= new G4Box("Tank",tank_x,tank_y,tank_z);
G4LogicalVolume * waterTank_log
G4LogicalVolume* waterTank_log
= new G4LogicalVolume(waterTank_box,Water,"Tank",0,0,0);
G4RotationMatrix *rot1=new G4RotationMatrix();
rot1->rotateZ(M_PI*0.125);
G4VPhysicalVolume* waterTank_phys
= new G4PVPlacement(0,G4ThreeVector(),waterTank_log,"Tank",
expHall_log,false,0);
// G4VPhysicalVolume * waterTank_phys
// = new G4PVPlacement(rot1,G4ThreeVector(),"Tank",
// waterTank_log,expHall_phys,false,0);
// The Air Bubble
//
G4Box* bubbleAir_box = new G4Box("Bubble",bubble_x,bubble_y,bubble_z);
G4VPhysicalVolume * waterTank_phys
= new G4PVPlacement(0,G4ThreeVector(),"Tank",
waterTank_log,expHall_phys,false,0);
// The Air Bubble
// --------------
G4Box * bubbleAir_box
= new G4Box("Bubble",bubble_x,bubble_y,bubble_z);
G4LogicalVolume * bubbleAir_log
G4LogicalVolume* bubbleAir_log
= new G4LogicalVolume(bubbleAir_box,Air,"Bubble",0,0,0);
G4RotationMatrix *rot2=new G4RotationMatrix();
rot2->rotateZ(M_PI*0.25);
// G4VPhysicalVolume * bubbleAir_phys
// = new G4PVPlacement(rot2,G4ThreeVector(0,2.5*m,0),"Bubble",
// bubbleAir_log,waterTank_phys,false,0);
// G4VPhysicalVolume * bubbleAir_phys =
new G4PVPlacement(0,G4ThreeVector(0,2.5*m,0),"Bubble",
bubbleAir_log,waterTank_phys,false,0);
//G4VPhysicalVolume* bubbleAir_phys =
new G4PVPlacement(0,G4ThreeVector(0,2.5*m,0),bubbleAir_log,"Bubble",
waterTank_log,false,0);
// ------------- Surfaces --------------
G4OpticalSurface * OpWaterSurface =
new G4OpticalSurface("WaterSurface");
G4LogicalBorderSurface * WaterSurface =
new G4LogicalBorderSurface("WaterSurface",
waterTank_phys,expHall_phys,
OpWaterSurface);
OpWaterSurface->SetType(dielectric_metal);
//
// Water Tank
//
G4OpticalSurface* OpWaterSurface = new G4OpticalSurface("WaterSurface");
OpWaterSurface->SetType(dielectric_dielectric);
OpWaterSurface->SetFinish(polished);
OpWaterSurface->SetModel(glisur);
if( WaterSurface->GetVolume1() == waterTank_phys ) G4cout << " Equal " << G4endl;
if( WaterSurface->GetVolume2() == expHall_phys ) G4cout << " Equal " << G4endl;
G4LogicalBorderSurface* WaterSurface =
new G4LogicalBorderSurface("WaterSurface",
waterTank_phys,expHall_phys,OpWaterSurface);
G4OpticalSurface * OpAirSurface =
new G4OpticalSurface("AirSurface");
G4LogicalSkinSurface * AirSurface =
new G4LogicalSkinSurface("AirSurface",
bubbleAir_log,
OpAirSurface);
if(WaterSurface->GetVolume1() == waterTank_phys) G4cout << "Equal" << G4endl;
if(WaterSurface->GetVolume2() == expHall_phys ) G4cout << "Equal" << G4endl;
// Air Bubble
//
G4OpticalSurface* OpAirSurface = new G4OpticalSurface("AirSurface");
OpAirSurface->SetType(dielectric_dielectric);
OpAirSurface->SetFinish(ground);
OpAirSurface->SetModel(unified);
if( AirSurface->GetLogicalVolume() == bubbleAir_log ) G4cout << " Equal " << G4endl;
G4LogicalSkinSurface* AirSurface =
new G4LogicalSkinSurface("AirSurface", bubbleAir_log, OpAirSurface);
if(AirSurface->GetLogicalVolume() == bubbleAir_log) G4cout << "Equal" << G4endl;
AirSurface->GetSurface(bubbleAir_log)->GetOpticalSurface()->DumpInfo();
// G4LogicalBorderSurface * Tmp1Surface = WaterSurface->
// GetSurface(waterTank_phys,expHall_phys);
//
// if (Tmp1Surface == *WaterSurface) G4cout << " Equal " << G4endl;
// Generate & Add Material Properties Table attached to the optical surfaces
//
const G4int num = 2;
G4double Ephoton[num] = {2.038*eV, 4.144*eV};
G4LogicalSkinSurface * Tmp2Surface = AirSurface->GetSurface(bubbleAir_log);
//OpticalWaterSurface
G4double RefractiveIndex[num] = {1.35, 1.40};
G4double SpecularLobe[num] = {0.3, 0.3};
G4double SpecularSpike[num] = {0.2, 0.2};
G4double Backscatter[num] = {0.2, 0.2};
// if (Tmp2Surface == *AirSurface ) G4cout << " Equal " << G4endl;
G4OpticalSurface * TmpOpSurface = Tmp2Surface->GetOpticalSurface();
TmpOpSurface->DumpInfo();
/////////////////////////////////////////////
// Generate & Add Material Properties Table
/////////////////////////////////////////////
const G4int NUM = 2;
G4double PP[NUM] =
{ 2.038E-9*GeV, 4.144E-9*GeV };
G4double RINDEX[NUM] =
{ 1.35, 1.40 };
G4double SPECULARLOBECONSTANT[NUM] =
{ 0.3, 0.3 };
G4double SPECULARSPIKECONSTANT[NUM] =
{ 0.2, 0.2 };
G4double BACKSCATTERCONSTANT[NUM] =
{ 0.2, 0.2 };
G4MaterialPropertiesTable *myST1 = new G4MaterialPropertiesTable();
myST1->AddProperty("RINDEX", PP, RINDEX, NUM);
myST1->
AddProperty("SPECULARLOBECONSTANT", PP, SPECULARLOBECONSTANT, NUM);
myST1->
AddProperty("SPECULARSPIKECONSTANT", PP, SPECULARSPIKECONSTANT, NUM);
myST1->
AddProperty("BACKSCATTERCONSTANT", PP, BACKSCATTERCONSTANT, NUM);
G4MaterialPropertiesTable* myST1 = new G4MaterialPropertiesTable();
myST1->AddProperty("RINDEX", Ephoton, RefractiveIndex, num);
myST1->AddProperty("SPECULARLOBECONSTANT", Ephoton, SpecularLobe, num);
myST1->AddProperty("SPECULARSPIKECONSTANT", Ephoton, SpecularSpike, num);
myST1->AddProperty("BACKSCATTERCONSTANT", Ephoton, Backscatter, num);
OpWaterSurface->SetMaterialPropertiesTable(myST1);
G4double REFLECTIVITY[NUM] =
{ 0.3, 0.5 };
G4double EFFICIENCY[NUM] =
{ 0.8, 1.0 };
//OpticalAirSurface
G4double Reflectivity[num] = {0.3, 0.5};
G4double Efficiency[num] = {0.8, 1.0};
G4MaterialPropertiesTable *myST2 = new G4MaterialPropertiesTable();
myST2->AddProperty("REFLECTIVITY", PP, REFLECTIVITY, NUM);
myST2->AddProperty("EFFICIENCY", PP, EFFICIENCY, NUM);
myST2->AddProperty("REFLECTIVITY", Ephoton, Reflectivity, num);
myST2->AddProperty("EFFICIENCY", Ephoton, Efficiency, num);
OpAirSurface->SetMaterialPropertiesTable(myST2);
//always return the physical World
return expHall_phys;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,76 @@
//
// ********************************************************************
// * 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: ExN06EventAction.cc,v 1.1 2003/01/23 15:34:31 maire Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN06EventAction.hh"
#include "G4Event.hh"
#include "G4EventManager.hh"
#include "G4TrajectoryContainer.hh"
#include "G4Trajectory.hh"
#include "G4VVisManager.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06EventAction::ExN06EventAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06EventAction::~ExN06EventAction()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06EventAction::BeginOfEventAction(const G4Event*)
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06EventAction::EndOfEventAction(const G4Event* evt)
{
// get number of stored trajectories
//
G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
G4int n_trajectories = 0;
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
// extract the trajectories and draw them
//
if (G4VVisManager::GetConcreteInstance())
{
for (G4int i=0; i<n_trajectories; i++)
{ G4Trajectory* trj = (G4Trajectory*)
((*(evt->GetTrajectoryContainer()))[i]);
trj->DrawTrajectory(50);
}
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+97 -42
View File
@@ -21,12 +21,18 @@
// ********************************************************************
//
//
// $Id: ExN06PhysicsList.cc,v 1.8 2003/01/23 15:34:32 maire Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ios.hh"
#include "g4std/iomanip"
#include "globals.hh"
#include "ExN06PhysicsList.hh"
#include "ExN06PhysicsListMessenger.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTypes.hh"
@@ -39,9 +45,31 @@
#include "G4ProcessManager.hh"
#include "G4ProcessVector.hh"
ExN06PhysicsList::ExN06PhysicsList() : G4VUserPhysicsList() {}
#include "G4Cerenkov.hh"
#include "G4Scintillation.hh"
#include "G4OpAbsorption.hh"
#include "G4OpRayleigh.hh"
#include "G4OpBoundaryProcess.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06PhysicsList::~ExN06PhysicsList() {}
ExN06PhysicsList::ExN06PhysicsList() : G4VUserPhysicsList()
{
theCerenkovProcess = 0;
theScintillationProcess = 0;
theAbsorptionProcess = 0;
theRayleighScatteringProcess = 0;
theBoundaryProcess = 0;
pMessenger = new ExN06PhysicsListMessenger(this);
SetVerboseLevel(0);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06PhysicsList::~ExN06PhysicsList() { delete pMessenger;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06PhysicsList::ConstructParticle()
{
@@ -54,9 +82,10 @@ void ExN06PhysicsList::ConstructParticle()
ConstructLeptons();
ConstructMesons();
ConstructBaryons();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06PhysicsList::ConstructBosons()
{
// pseudo-particles
@@ -70,6 +99,8 @@ void ExN06PhysicsList::ConstructBosons()
G4OpticalPhoton::OpticalPhotonDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06PhysicsList::ConstructLeptons()
{
// leptons
@@ -83,6 +114,8 @@ void ExN06PhysicsList::ConstructLeptons()
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06PhysicsList::ConstructMesons()
{
// mesons
@@ -91,6 +124,8 @@ void ExN06PhysicsList::ConstructMesons()
G4PionZero::PionZeroDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06PhysicsList::ConstructBaryons()
{
// barions
@@ -100,6 +135,8 @@ void ExN06PhysicsList::ConstructBaryons()
G4AntiNeutron::AntiNeutronDefinition();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06PhysicsList::ConstructProcess()
{
AddTransportation();
@@ -108,8 +145,12 @@ void ExN06PhysicsList::ConstructProcess()
ConstructOp();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4Decay.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06PhysicsList::ConstructGeneral()
{
G4Decay* theDecayProcess = new G4Decay();
@@ -123,6 +164,8 @@ void ExN06PhysicsList::ConstructGeneral()
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "G4ComptonScattering.hh"
#include "G4GammaConversion.hh"
#include "G4PhotoElectricEffect.hh"
@@ -139,6 +182,8 @@ void ExN06PhysicsList::ConstructGeneral()
#include "G4hIonisation.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06PhysicsList::ConstructEM()
{
theParticleIterator->reset();
@@ -157,70 +202,60 @@ void ExN06PhysicsList::ConstructEM()
} else if (particleName == "e-") {
//electron
// Construct processes for electron
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4eIonisation(),-1,2,2);
pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
pmanager->AddProcess(new G4MultipleScattering(),-1, 1, 1);
pmanager->AddProcess(new G4eIonisation(), -1, 2, 2);
pmanager->AddProcess(new G4eBremsstrahlung(), -1,-1, 3);
} else if (particleName == "e+") {
//positron
// Construct processes for positron
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4eIonisation(),-1,2,2);
pmanager->AddProcess(new G4eBremsstrahlung(),-1,-1,3);
pmanager->AddProcess(new G4eplusAnnihilation(),0,-1,4);
pmanager->AddProcess(new G4MultipleScattering(),-1, 1, 1);
pmanager->AddProcess(new G4eIonisation(), -1, 2, 2);
pmanager->AddProcess(new G4eBremsstrahlung(), -1,-1, 3);
pmanager->AddProcess(new G4eplusAnnihilation(), 0,-1, 4);
} else if( particleName == "mu+" ||
particleName == "mu-" ) {
//muon
// Construct processes for muon
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4MuIonisation(),-1,2,2);
pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3);
pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4);
pmanager->AddProcess(new G4MultipleScattering(),-1, 1, 1);
pmanager->AddProcess(new G4MuIonisation(), -1, 2, 2);
pmanager->AddProcess(new G4MuBremsstrahlung(), -1,-1, 3);
pmanager->AddProcess(new G4MuPairProduction(), -1,-1, 4);
} else {
if ((particle->GetPDGCharge() != 0.0) &&
(particle->GetParticleName() != "chargedgeantino")) {
// all others charged particles except geantino
pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
pmanager->AddProcess(new G4hIonisation(),-1,2,2);
pmanager->AddProcess(new G4hIonisation(), -1,2,2);
}
}
}
}
#include "G4Cerenkov.hh"
#include "G4Scintillation.hh"
#include "G4OpAbsorption.hh"
#include "G4OpRayleigh.hh"
#include "G4OpBoundaryProcess.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06PhysicsList::ConstructOp()
{
G4Cerenkov* theCerenkovProcess = new G4Cerenkov("Cerenkov");
G4Scintillation* theScintillationProcess = new G4Scintillation("Scintilltion");
G4OpAbsorption* theAbsorptionProcess = new G4OpAbsorption();
G4OpRayleigh* theRayleighScatteringProcess = new G4OpRayleigh();
G4OpBoundaryProcess* theBoundaryProcess = new G4OpBoundaryProcess();
theCerenkovProcess = new G4Cerenkov("Cerenkov");
theScintillationProcess = new G4Scintillation("Scintillation");
theAbsorptionProcess = new G4OpAbsorption();
theRayleighScatteringProcess = new G4OpRayleigh();
theBoundaryProcess = new G4OpBoundaryProcess();
// theCerenkovProcess->DumpPhysicsTable();
// theScintillationProcess->DumpPhysicsTable();
// theAbsorptionProcess->DumpPhysicsTable();
// theRayleighScatteringProcess->DumpPhysicsTable();
theCerenkovProcess->SetVerboseLevel(1);
theScintillationProcess->SetVerboseLevel(1);
theAbsorptionProcess->SetVerboseLevel(1);
theRayleighScatteringProcess->SetVerboseLevel(1);
theBoundaryProcess->SetVerboseLevel(1);
G4int MaxNumPhotons = 300;
SetVerbose(1);
theCerenkovProcess->SetMaxNumPhotonsPerStep(300);
theCerenkovProcess->SetTrackSecondariesFirst(true);
theCerenkovProcess->SetMaxNumPhotonsPerStep(MaxNumPhotons);
theScintillationProcess->SetTrackSecondariesFirst(true);
theScintillationProcess->SetScintillationYieldFactor(1.);
theScintillationProcess->SetTrackSecondariesFirst(true);
G4OpticalSurfaceModel themodel = unified;
theBoundaryProcess->SetModel(themodel);
@@ -245,15 +280,35 @@ void ExN06PhysicsList::ConstructOp()
pmanager->AddDiscreteProcess(theBoundaryProcess);
}
}
// set ordering for AtRestDoIt
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06PhysicsList::SetVerbose(G4int verbose)
{
theCerenkovProcess->SetVerboseLevel(verbose);
theScintillationProcess->SetVerboseLevel(verbose);
theAbsorptionProcess->SetVerboseLevel(verbose);
theRayleighScatteringProcess->SetVerboseLevel(verbose);
theBoundaryProcess->SetVerboseLevel(verbose);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06PhysicsList::SetNbOfPhotonsCerenkov(G4int MaxNumber)
{
theCerenkovProcess->SetMaxNumPhotonsPerStep(MaxNumber);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06PhysicsList::SetCuts()
{
if (verboseLevel >1){
G4cout << "ExN06PhysicsList::SetCuts:";
}
// " G4VUserPhysicsList::SetCutsWithDefault" method sets
// the default cut value for all particle types
SetCutsWithDefault();
// the default cut value for all particle types
//
SetCutsWithDefault();
if (verboseLevel>0) DumpCutValuesTable();
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,85 @@
//
// ********************************************************************
// * 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: ExN06PhysicsListMessenger.cc,v 1.1 2003/01/23 15:34:32 maire Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN06PhysicsListMessenger.hh"
#include "ExN06PhysicsList.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithAnInteger.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06PhysicsListMessenger::ExN06PhysicsListMessenger(ExN06PhysicsList* pPhys)
:pPhysicsList(pPhys)
{
N06Dir = new G4UIdirectory("/N06/");
N06Dir->SetGuidance("UI commands of this example");
physDir = new G4UIdirectory("/N06/phys/");
physDir->SetGuidance("PhysicsList control");
verboseCmd = new G4UIcmdWithAnInteger("/N06/phys/verbose",this);
verboseCmd->SetGuidance("set verbose for physics processes");
verboseCmd->SetParameterName("verbose",true);
verboseCmd->SetDefaultValue(1);
verboseCmd->SetRange("verbose>=0");
verboseCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
cerenkovCmd = new G4UIcmdWithAnInteger("/N06/phys/cerenkovMaxPhotons",this);
cerenkovCmd->SetGuidance("set max nb of photons per step");
cerenkovCmd->SetParameterName("MaxNumber",false);
cerenkovCmd->SetRange("MaxNumber>=0");
cerenkovCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06PhysicsListMessenger::~ExN06PhysicsListMessenger()
{
delete verboseCmd;
delete cerenkovCmd;
delete physDir;
delete N06Dir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06PhysicsListMessenger::SetNewValue(G4UIcommand* command,
G4String newValue)
{
if( command == verboseCmd )
{ pPhysicsList->SetVerbose(verboseCmd->GetNewIntValue(newValue));}
if( command == cerenkovCmd )
{pPhysicsList->SetNbOfPhotonsCerenkov(cerenkovCmd->GetNewIntValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,74 @@
//
// ********************************************************************
// * 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: ExN06PrimaryGeneratorMessenger.cc,v 1.1 2003/01/23 15:34:32 maire Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN06PrimaryGeneratorMessenger.hh"
#include "ExN06PrimaryGeneratorAction.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06PrimaryGeneratorMessenger::ExN06PrimaryGeneratorMessenger(
ExN06PrimaryGeneratorAction* ExN06Gun)
:ExN06Action(ExN06Gun)
{
gunDir = new G4UIdirectory("/N06/gun/");
gunDir->SetGuidance("PrimaryGenerator control");
polarCmd = new G4UIcmdWithADoubleAndUnit("/N06/gun/optPhotonPolar",this);
polarCmd->SetGuidance("Set linear polarization");
polarCmd->SetGuidance(" angle w.r.t. (k,n) plane");
polarCmd->SetParameterName("angle",true);
polarCmd->SetUnitCategory("Angle");
polarCmd->SetDefaultValue(0.);
polarCmd->AvailableForStates(G4State_Idle);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06PrimaryGeneratorMessenger::~ExN06PrimaryGeneratorMessenger()
{
delete polarCmd;
delete gunDir;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06PrimaryGeneratorMessenger::SetNewValue(
G4UIcommand* command, G4String newValue)
{
if( command == polarCmd )
{ ExN06Action->SetOptPhotonPolar(polarCmd->GetNewDoubleValue(newValue));}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -21,45 +21,79 @@
// ********************************************************************
//
//
// $Id: ExN06PrimaryGeneratorAction.cc,v 1.2 2003/01/23 15:34:32 maire Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN06PrimaryGeneratorAction.hh"
#include "ExN06PrimaryGeneratorMessenger.hh"
#include "globals.hh"
#include "G4Event.hh"
#include "G4ParticleGun.hh"
#include "G4ParticleTable.hh"
#include "G4ParticleDefinition.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06PrimaryGeneratorAction::ExN06PrimaryGeneratorAction()
{
G4int n_particle = 1;
particleGun = new G4ParticleGun(n_particle);
//create a messenger for this class
gunMessenger = new ExN06PrimaryGeneratorMessenger(this);
//default kinematic
//
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4ParticleDefinition* particle = particleTable->FindParticle("e-");
particleGun->SetParticleDefinition(particle);
particleGun->SetParticleTime(0.0*ns);
particleGun->SetParticlePosition(G4ThreeVector(0.0*cm,0.0*cm,0.0*cm));
particleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
particleGun->SetParticleEnergy(500.0*keV);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06PrimaryGeneratorAction::~ExN06PrimaryGeneratorAction()
{
delete particleGun;
delete gunMessenger;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
{
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
G4String particleName;
G4ParticleDefinition* particle
= particleTable->FindParticle(particleName="e+");
particleGun->SetParticleDefinition(particle);
particleGun->SetParticleTime(0.0*ns);
G4ThreeVector position(0.0*cm,0.0*cm,0.0*cm);
particleGun->SetParticlePosition(position);
G4ThreeVector direction(1.0,0.0,0.0);
particleGun->SetParticleMomentumDirection(direction.unit());
G4double energy = 10.0*MeV;
particleGun->SetParticleEnergy(energy);
particleGun->GeneratePrimaryVertex(anEvent);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06PrimaryGeneratorAction::SetOptPhotonPolar(G4double angle)
{
if (particleGun->GetParticleDefinition()->GetParticleName() != "opticalphoton")
{
G4cout << "--> warning from PrimaryGeneratorAction::SetOptPhotonPolar() :"
"the particleGun is not an opticalphoton" << G4endl;
return;
}
G4ThreeVector normal (1., 0., 0.);
G4ThreeVector kphoton = particleGun->GetParticleMomentumDirection();
G4ThreeVector product = normal.cross(kphoton);
G4double modul2 = product*product;
G4ThreeVector e_perpend (0., 0., 1.);
if (modul2 > 0.) e_perpend = (1./sqrt(modul2))*product;
G4ThreeVector e_paralle = e_perpend.cross(kphoton);
G4ThreeVector polar = cos(angle)*e_paralle + sin(angle)*e_perpend;
particleGun->SetParticlePolarization(polar);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+28 -6
View File
@@ -21,6 +21,11 @@
// ********************************************************************
//
//
// $Id: ExN06RunAction.cc,v 1.8 2003/01/23 15:34:32 maire Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
// Make this appear first!
#include "G4Timer.hh"
@@ -30,30 +35,47 @@
#include "G4ios.hh"
#include "G4Run.hh"
#include "G4UImanager.hh"
#include "G4VVisManager.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06RunAction::ExN06RunAction()
{
timer = new G4Timer;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06RunAction::~ExN06RunAction()
{
delete timer;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06RunAction::BeginOfRunAction(const G4Run* aRun)
{
G4UImanager* UI = G4UImanager::GetUIpointer();
UI->ApplyCommand("/event/verbose 1");
//UI->ApplyCommand("/tracking/verbose 1");
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
timer->Start();
if (G4VVisManager::GetConcreteInstance())
{
G4UImanager::GetUIpointer()->ApplyCommand("/vis/scene/notifyHandlers");
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06RunAction::EndOfRunAction(const G4Run* aRun)
{
if (G4VVisManager::GetConcreteInstance())
{
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/update");
}
timer->Stop();
G4cout << "number of event = " << aRun->GetNumberOfEvent()
<< " " << *timer << G4endl;
<< " " << *timer << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+24 -5
View File
@@ -19,38 +19,57 @@
// * based on the Program) you indicate your acceptance of this *
// * statement, and all its terms. *
// ********************************************************************
//
// $Id: ExN06StackingAction.cc,v 1.4 2003/01/23 15:34:32 maire Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN06StackingAction.hh"
#include "G4ios.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTypes.hh"
#include "G4Track.hh"
#include "G4ios.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06StackingAction::ExN06StackingAction()
: gammaCounter(0)
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06StackingAction::~ExN06StackingAction()
{;}
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4ClassificationOfNewTrack
ExN06StackingAction::ClassifyNewTrack(const G4Track * aTrack)
{
if(aTrack->GetDefinition()==G4OpticalPhoton::OpticalPhotonDefinition())
if(aTrack->GetDefinition() == G4OpticalPhoton::OpticalPhotonDefinition())
{ // particle is optical photon
if(aTrack->GetParentID()>0)
{ // particle is secondary
gammaCounter++;
}
}
return fUrgent;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06StackingAction::NewStage()
{
G4cout << "Number of optical photons produces in this event : "
<< gammaCounter << G4endl;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06StackingAction::PrepareNewEvent()
{ gammaCounter = 0; }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -0,0 +1,179 @@
//
// ********************************************************************
// * 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: ExN06SteppingVerbose.cc,v 1.2 2003/02/10 18:44:40 maire Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#include "ExN06SteppingVerbose.hh"
#include "G4SteppingManager.hh"
#include "G4UnitsTable.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06SteppingVerbose::ExN06SteppingVerbose()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
ExN06SteppingVerbose::~ExN06SteppingVerbose()
{}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06SteppingVerbose::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) << "Volume" << " "
<< 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->GetVolume()->GetName();
} else {
G4cout << G4std::setw(10) << "OutOfWorld";
}
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != 0){
G4cout << " "
<< G4std::setw(10)
<< fStep->GetPostStepPoint()->GetProcessDefinedStep()
->GetProcessName();
} else {
G4cout << " UserLimit";
}
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);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06SteppingVerbose::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) << "Volume" << " "
<< 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->GetVolume()->GetName();
} else {
G4cout << "OutOfWorld";
}
G4cout << " initStep" << G4endl;
}
G4cout.precision(prec);
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
+155
View File
@@ -0,0 +1,155 @@
//
// ********************************************************************
// * 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: ExN06VisManager.cc,v 1.1 2003/01/23 15:34:32 maire Exp $
// GEANT4 tag $Name: geant4-05-01 $
//
//
// John Allison 24th January 1998.
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
#ifdef G4VIS_USE
#include "ExN06VisManager.hh"
// Supported drivers...
// Not needing external packages or libraries...
#include "G4ASCIITree.hh"
#include "G4DAWNFILE.hh"
#include "G4GAGTree.hh"
#include "G4HepRepFile.hh"
#include "G4HepRep.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......
ExN06VisManager::ExN06VisManager () {}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void ExN06VisManager::RegisterGraphicsSystems () {
// Graphics Systems not needing external packages or libraries...
RegisterGraphicsSystem (new G4ASCIITree);
RegisterGraphicsSystem (new G4DAWNFILE);
RegisterGraphicsSystem (new G4GAGTree);
RegisterGraphicsSystem (new G4HepRepFile);
RegisterGraphicsSystem (new G4HepRep);
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......