Import Geant4 10.0.0 source tree
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file biasing/B03/src/B03ActionInitialization.cc
|
||||
/// \brief Implementation of the B03ActionInitialization class
|
||||
//
|
||||
//
|
||||
// $Id: B03ActionInitialization.cc 66780 2013-01-12 14:56:35Z gcosmo $
|
||||
//
|
||||
|
||||
#include "B03ActionInitialization.hh"
|
||||
#include "B03PrimaryGeneratorAction.hh"
|
||||
#include "B03RunAction.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
|
||||
B03ActionInitialization::B03ActionInitialization()
|
||||
{;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B03ActionInitialization::~B03ActionInitialization()
|
||||
{;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03ActionInitialization::BuildForMaster() const
|
||||
{
|
||||
SetUserAction(new B03RunAction);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03ActionInitialization::Build() const
|
||||
{
|
||||
|
||||
SetUserAction(new B03PrimaryGeneratorAction);
|
||||
SetUserAction(new B03RunAction);
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
@@ -0,0 +1,246 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file biasing/B03/src/B03DetectorConstruction.cc
|
||||
/// \brief Implementation of the B03DetectorConstruction class
|
||||
//
|
||||
//
|
||||
// $Id: B03DetectorConstruction.cc 70238 2013-05-27 11:59:40Z gcosmo $
|
||||
//
|
||||
#include "G4Types.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
#include "B03DetectorConstruction.hh"
|
||||
|
||||
#include "G4Material.hh"
|
||||
#include "G4Box.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Colour.hh"
|
||||
#include "G4PhysicalConstants.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
// for importance biasing
|
||||
#include "G4IStore.hh"
|
||||
|
||||
// For Primitive Scorers
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4MultiFunctionalDetector.hh"
|
||||
#include "G4SDParticleFilter.hh"
|
||||
#include "G4PSNofCollision.hh"
|
||||
#include "G4PSPopulation.hh"
|
||||
#include "G4PSTrackCounter.hh"
|
||||
#include "G4PSTrackLength.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B03DetectorConstruction::B03DetectorConstruction()
|
||||
: G4VUserDetectorConstruction()
|
||||
{;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B03DetectorConstruction::~B03DetectorConstruction()
|
||||
{;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4VPhysicalVolume* B03DetectorConstruction::Construct()
|
||||
{
|
||||
G4double pos_x;
|
||||
G4double pos_y;
|
||||
G4double pos_z;
|
||||
|
||||
G4double density, pressure, temperature;
|
||||
G4double A;
|
||||
G4int Z;
|
||||
|
||||
G4String name, symbol;
|
||||
G4double z;
|
||||
G4double fractionmass;
|
||||
|
||||
A = 1.01*g/mole;
|
||||
G4Element* elH = new G4Element(name="Hydrogen",symbol="H" , Z= 1, A);
|
||||
|
||||
A = 12.01*g/mole;
|
||||
G4Element* elC = new G4Element(name="Carbon" ,symbol="C" , Z = 6, A);
|
||||
|
||||
A = 16.00*g/mole;
|
||||
G4Element* elO = new G4Element(name="Oxygen" ,symbol="O" , Z= 8, A);
|
||||
|
||||
A = 22.99*g/mole;
|
||||
G4Element* elNa = new G4Element(name="Natrium" ,symbol="Na" , Z=11 , A);
|
||||
|
||||
A = 200.59*g/mole;
|
||||
G4Element* elHg = new G4Element(name="Hg" ,symbol="Hg" , Z=80, A);
|
||||
|
||||
A = 26.98*g/mole;
|
||||
G4Element* elAl = new G4Element(name="Aluminium" ,symbol="Al" , Z=13, A);
|
||||
|
||||
A = 28.09*g/mole;
|
||||
G4Element* elSi = new G4Element(name="Silicon", symbol="Si", Z=14, A);
|
||||
|
||||
A = 39.1*g/mole;
|
||||
G4Element* elK = new G4Element(name="K" ,symbol="K" , Z=19 , A);
|
||||
|
||||
A = 69.72*g/mole;
|
||||
G4Element* elCa = new G4Element(name="Calzium" ,symbol="Ca" , Z=31 , A);
|
||||
|
||||
A = 55.85*g/mole;
|
||||
G4Element* elFe = new G4Element(name="Iron" ,symbol="Fe", Z=26, A);
|
||||
|
||||
density = universe_mean_density; //from PhysicalConstants.h
|
||||
pressure = 3.e-18*pascal;
|
||||
temperature = 2.73*kelvin;
|
||||
G4Material *Galactic =
|
||||
new G4Material(name="Galactic", z=1., A=1.01*g/mole, density,
|
||||
kStateGas,temperature,pressure);
|
||||
|
||||
density = 2.03*g/cm3;
|
||||
G4Material* Concrete = new G4Material("Concrete", density, 10);
|
||||
Concrete->AddElement(elH , fractionmass= 0.01);
|
||||
Concrete->AddElement(elO , fractionmass= 0.529);
|
||||
Concrete->AddElement(elNa , fractionmass= 0.016);
|
||||
Concrete->AddElement(elHg , fractionmass= 0.002);
|
||||
Concrete->AddElement(elAl , fractionmass= 0.034);
|
||||
Concrete->AddElement(elSi , fractionmass= 0.337);
|
||||
Concrete->AddElement(elK , fractionmass= 0.013);
|
||||
Concrete->AddElement(elCa , fractionmass= 0.044);
|
||||
Concrete->AddElement(elFe , fractionmass= 0.014);
|
||||
Concrete->AddElement(elC , fractionmass= 0.001);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/////////////////////////////
|
||||
// world cylinder volume
|
||||
////////////////////////////
|
||||
|
||||
// world solid
|
||||
|
||||
G4double innerRadiusCylinder = 0*cm;
|
||||
G4double outerRadiusCylinder = 101*cm; // dont't have scoring
|
||||
// cells coinside eith world volume boundary
|
||||
// G4double heightCylinder = 105*cm;
|
||||
G4double heightCylinder = 100*cm;
|
||||
G4double startAngleCylinder = 0*deg;
|
||||
G4double spanningAngleCylinder = 360*deg;
|
||||
|
||||
G4Tubs *worldCylinder = new G4Tubs("worldCylinder",
|
||||
innerRadiusCylinder,
|
||||
outerRadiusCylinder,
|
||||
heightCylinder,
|
||||
startAngleCylinder,
|
||||
spanningAngleCylinder);
|
||||
|
||||
// logical world
|
||||
|
||||
G4LogicalVolume *worldCylinder_log =
|
||||
new G4LogicalVolume(worldCylinder, Galactic, "worldCylinder_log");
|
||||
|
||||
name = "shieldWorld";
|
||||
fWorldVolume = new G4PVPlacement(0, G4ThreeVector(0,0,0), worldCylinder_log
|
||||
,name, 0, false, 0);
|
||||
|
||||
|
||||
// creating 18 slobs of 10 cm thick concrete
|
||||
|
||||
G4double innerRadiusShield = 0*cm;
|
||||
G4double outerRadiusShield = 100*cm;
|
||||
G4double heightShield = 90*cm;
|
||||
G4double startAngleShield = 0*deg;
|
||||
G4double spanningAngleShield = 360*deg;
|
||||
|
||||
G4Tubs *aShield = new G4Tubs("aShield",
|
||||
innerRadiusShield,
|
||||
outerRadiusShield,
|
||||
heightShield,
|
||||
startAngleShield,
|
||||
spanningAngleShield);
|
||||
|
||||
// logical shield
|
||||
|
||||
G4LogicalVolume *aShield_log =
|
||||
new G4LogicalVolume(aShield, Concrete, "aShield_log");
|
||||
|
||||
G4VisAttributes* pShieldVis = new
|
||||
G4VisAttributes(G4Colour(0.0,0.0,1.0));
|
||||
pShieldVis->SetForceSolid(true);
|
||||
aShield_log->SetVisAttributes(pShieldVis);
|
||||
|
||||
// physical shields
|
||||
|
||||
name = "concreteShield";
|
||||
|
||||
pos_x = 0*cm;
|
||||
pos_y = 0*cm;
|
||||
pos_z = 0;
|
||||
|
||||
new G4PVPlacement(0,
|
||||
G4ThreeVector(pos_x, pos_y, pos_z),
|
||||
aShield_log,
|
||||
name,
|
||||
worldCylinder_log,
|
||||
false,
|
||||
0);
|
||||
|
||||
|
||||
return fWorldVolume;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// void B03DetectorConstruction::ConstructSDandField()
|
||||
// {
|
||||
// ;
|
||||
// }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4VPhysicalVolume *B03DetectorConstruction::GetWorldVolume() {
|
||||
return fWorldVolume;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4VPhysicalVolume &B03DetectorConstruction::GetWorldVolumeAddress() const{
|
||||
return *fWorldVolume;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,339 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file biasing/B03/src/B03ImportanceDetectorConstruction.cc
|
||||
/// \brief Implementation of the B03ImportanceDetectorConstruction class
|
||||
//
|
||||
//
|
||||
// $Id: B03ImportanceDetectorConstruction.cc 70093 2013-05-23 09:03:57Z gcosmo $
|
||||
//
|
||||
|
||||
#include "globals.hh"
|
||||
#include <sstream>
|
||||
|
||||
#include "B03ImportanceDetectorConstruction.hh"
|
||||
|
||||
#include "G4Material.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4PhysicalConstants.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
// For Primitive Scorers
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4MultiFunctionalDetector.hh"
|
||||
#include "G4SDParticleFilter.hh"
|
||||
#include "G4PSNofCollision.hh"
|
||||
#include "G4PSPopulation.hh"
|
||||
#include "G4PSTrackCounter.hh"
|
||||
#include "G4PSTrackLength.hh"
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B03ImportanceDetectorConstruction::
|
||||
B03ImportanceDetectorConstruction(G4String worldName)
|
||||
:G4VUserParallelWorld(worldName),fLogicalVolumeVector()
|
||||
{
|
||||
// Construct();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B03ImportanceDetectorConstruction::~B03ImportanceDetectorConstruction()
|
||||
{
|
||||
fLogicalVolumeVector.clear();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03ImportanceDetectorConstruction::Construct()
|
||||
{
|
||||
G4cout << " constructing parallel world " << G4endl;
|
||||
|
||||
G4Material* dummyMat = 0;
|
||||
|
||||
//GetWorld methods create a clone of the mass world to the parallel world (!)
|
||||
// via the transportation manager
|
||||
fGhostWorld = GetWorld();
|
||||
G4cout << " B03ImportanceDetectorConstruction:: ghostWorldName = "
|
||||
<< fGhostWorld->GetName() << G4endl;
|
||||
G4LogicalVolume* worldLogical = fGhostWorld->GetLogicalVolume();
|
||||
fLogicalVolumeVector.push_back(worldLogical);
|
||||
|
||||
G4String name("none");
|
||||
// fPVolumeStore.AddPVolume(G4GeometryCell(*pWorldVolume, 0));
|
||||
fPVolumeStore.AddPVolume(G4GeometryCell(*fGhostWorld, 0));
|
||||
|
||||
|
||||
|
||||
|
||||
// creating 18 slobs of 10 cm thicknes
|
||||
|
||||
G4double innerRadiusShield = 0*cm;
|
||||
G4double outerRadiusShield = 100*cm;
|
||||
G4double heightShield = 5*cm;
|
||||
G4double startAngleShield = 0*deg;
|
||||
G4double spanningAngleShield = 360*deg;
|
||||
|
||||
G4Tubs *aShield = new G4Tubs("aShield",
|
||||
innerRadiusShield,
|
||||
outerRadiusShield,
|
||||
heightShield,
|
||||
startAngleShield,
|
||||
spanningAngleShield);
|
||||
|
||||
// logical parallel cells
|
||||
|
||||
G4LogicalVolume *aShield_log_imp =
|
||||
new G4LogicalVolume(aShield, dummyMat, "aShield_log_imp");
|
||||
fLogicalVolumeVector.push_back(aShield_log_imp);
|
||||
|
||||
// physical parallel cells
|
||||
|
||||
G4int i = 1;
|
||||
G4double startz = -85*cm;
|
||||
// for (i=1; i<=18; ++i) {
|
||||
for (i=1; i<=18; i++) {
|
||||
|
||||
name = GetCellName(i);
|
||||
|
||||
G4double pos_x = 0*cm;
|
||||
G4double pos_y = 0*cm;
|
||||
G4double pos_z = startz + (i-1) * (2*heightShield);
|
||||
G4VPhysicalVolume *pvol =
|
||||
new G4PVPlacement(0,
|
||||
G4ThreeVector(pos_x, pos_y, pos_z),
|
||||
aShield_log_imp,
|
||||
name,
|
||||
worldLogical,
|
||||
false,
|
||||
i);
|
||||
// 0);
|
||||
G4GeometryCell cell(*pvol, i);
|
||||
// G4GeometryCell cell(*pvol, 0);
|
||||
fPVolumeStore.AddPVolume(cell);
|
||||
}
|
||||
|
||||
// filling the rest of the world volumr behind the concrete with
|
||||
// another slob which should get the same importance value as the
|
||||
// last slob
|
||||
innerRadiusShield = 0*cm;
|
||||
// outerRadiusShield = 110*cm; exceeds world volume!!!!
|
||||
outerRadiusShield = 100*cm;
|
||||
// heightShield = 10*cm;
|
||||
heightShield = 5*cm;
|
||||
startAngleShield = 0*deg;
|
||||
spanningAngleShield = 360*deg;
|
||||
|
||||
G4Tubs *aRest = new G4Tubs("Rest",
|
||||
innerRadiusShield,
|
||||
outerRadiusShield,
|
||||
heightShield,
|
||||
startAngleShield,
|
||||
spanningAngleShield);
|
||||
|
||||
G4LogicalVolume *aRest_log =
|
||||
new G4LogicalVolume(aRest, dummyMat, "aRest_log");
|
||||
|
||||
fLogicalVolumeVector.push_back(aRest_log);
|
||||
|
||||
name = GetCellName(19);
|
||||
|
||||
G4double pos_x = 0*cm;
|
||||
G4double pos_y = 0*cm;
|
||||
// G4double pos_z = 100*cm;
|
||||
G4double pos_z = 95*cm;
|
||||
G4VPhysicalVolume *pvol =
|
||||
new G4PVPlacement(0,
|
||||
G4ThreeVector(pos_x, pos_y, pos_z),
|
||||
aRest_log,
|
||||
name,
|
||||
worldLogical,
|
||||
false,
|
||||
19);
|
||||
// 0);
|
||||
G4GeometryCell cell(*pvol, 19);
|
||||
// G4GeometryCell cell(*pvol, 0);
|
||||
fPVolumeStore.AddPVolume(cell);
|
||||
|
||||
SetSensitive();
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
const G4VPhysicalVolume &B03ImportanceDetectorConstruction::
|
||||
GetPhysicalVolumeByName(const G4String& name) const {
|
||||
return *fPVolumeStore.GetPVolume(name);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4String B03ImportanceDetectorConstruction::ListPhysNamesAsG4String(){
|
||||
G4String names(fPVolumeStore.GetPNames());
|
||||
return names;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4String B03ImportanceDetectorConstruction::GetCellName(G4int i) {
|
||||
std::ostringstream os;
|
||||
os << "cell_";
|
||||
if (i<10) {
|
||||
os << "0";
|
||||
}
|
||||
os << i;
|
||||
G4String name = os.str();
|
||||
return name;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4GeometryCell B03ImportanceDetectorConstruction::GetGeometryCell(G4int i){
|
||||
G4String name(GetCellName(i));
|
||||
const G4VPhysicalVolume *p=0;
|
||||
p = fPVolumeStore.GetPVolume(name);
|
||||
if (p) {
|
||||
return G4GeometryCell(*p,0);
|
||||
}
|
||||
else {
|
||||
G4cout << "B03ImportanceDetectorConstruction::GetGeometryCell: " << G4endl
|
||||
<< " couldn't get G4GeometryCell" << G4endl;
|
||||
return G4GeometryCell(*fGhostWorld,-2);
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4VPhysicalVolume &B03ImportanceDetectorConstruction::
|
||||
GetWorldVolumeAddress() const{
|
||||
return *fGhostWorld;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4VPhysicalVolume *B03ImportanceDetectorConstruction::GetWorldVolume() {
|
||||
return fGhostWorld;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03ImportanceDetectorConstruction::SetSensitive(){
|
||||
|
||||
// -------------------------------------------------
|
||||
// The collection names of defined Primitives are
|
||||
// 0 ConcreteSD/Collisions
|
||||
// 1 ConcreteSD/CollWeight
|
||||
// 2 ConcreteSD/Population
|
||||
// 3 ConcreteSD/TrackEnter
|
||||
// 4 ConcreteSD/SL
|
||||
// 5 ConcreteSD/SLW
|
||||
// 6 ConcreteSD/SLWE
|
||||
// 7 ConcreteSD/SLW_V
|
||||
// 8 ConcreteSD/SLWE_V
|
||||
// -------------------------------------------------
|
||||
|
||||
//now moved to ConstructSD()
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
void B03ImportanceDetectorConstruction::ConstructSD()
|
||||
{
|
||||
|
||||
G4SDManager* SDman = G4SDManager::GetSDMpointer();
|
||||
//
|
||||
// Sensitive Detector Name
|
||||
G4String concreteSDname = "ConcreteSD";
|
||||
|
||||
//------------------------
|
||||
// MultiFunctionalDetector
|
||||
//------------------------
|
||||
//
|
||||
// Define MultiFunctionalDetector with name.
|
||||
G4MultiFunctionalDetector* MFDet =
|
||||
new G4MultiFunctionalDetector(concreteSDname);
|
||||
SDman->AddNewDetector( MFDet ); // Register SD to SDManager
|
||||
|
||||
|
||||
G4String fltName,particleName;
|
||||
G4SDParticleFilter* neutronFilter =
|
||||
new G4SDParticleFilter(fltName="neutronFilter", particleName="neutron");
|
||||
|
||||
MFDet->SetFilter(neutronFilter);
|
||||
|
||||
|
||||
for (std::vector<G4LogicalVolume *>::iterator it =
|
||||
fLogicalVolumeVector.begin();
|
||||
it != fLogicalVolumeVector.end(); it++){
|
||||
// (*it)->SetSensitiveDetector(MFDet);
|
||||
SetSensitiveDetector((*it)->GetName(), MFDet);
|
||||
}
|
||||
|
||||
G4String psName;
|
||||
G4PSNofCollision* scorer0 = new G4PSNofCollision(psName="Collisions");
|
||||
MFDet->RegisterPrimitive(scorer0);
|
||||
|
||||
|
||||
G4PSNofCollision* scorer1 = new G4PSNofCollision(psName="CollWeight");
|
||||
scorer1->Weighted(true);
|
||||
MFDet->RegisterPrimitive(scorer1);
|
||||
|
||||
|
||||
G4PSPopulation* scorer2 = new G4PSPopulation(psName="Population");
|
||||
MFDet->RegisterPrimitive(scorer2);
|
||||
|
||||
G4PSTrackCounter* scorer3 =
|
||||
new G4PSTrackCounter(psName="TrackEnter",fCurrent_In);
|
||||
MFDet->RegisterPrimitive(scorer3);
|
||||
|
||||
G4PSTrackLength* scorer4 = new G4PSTrackLength(psName="SL");
|
||||
MFDet->RegisterPrimitive(scorer4);
|
||||
|
||||
G4PSTrackLength* scorer5 = new G4PSTrackLength(psName="SLW");
|
||||
scorer5->Weighted(true);
|
||||
MFDet->RegisterPrimitive(scorer5);
|
||||
|
||||
G4PSTrackLength* scorer6 = new G4PSTrackLength(psName="SLWE");
|
||||
scorer6->Weighted(true);
|
||||
scorer6->MultiplyKineticEnergy(true);
|
||||
MFDet->RegisterPrimitive(scorer6);
|
||||
|
||||
G4PSTrackLength* scorer7 = new G4PSTrackLength(psName="SLW_V");
|
||||
scorer7->Weighted(true);
|
||||
scorer7->DivideByVelocity(true);
|
||||
MFDet->RegisterPrimitive(scorer7);
|
||||
|
||||
G4PSTrackLength* scorer8 = new G4PSTrackLength(psName="SLWE_V");
|
||||
scorer8->Weighted(true);
|
||||
scorer8->MultiplyKineticEnergy(true);
|
||||
scorer8->DivideByVelocity(true);
|
||||
MFDet->RegisterPrimitive(scorer8);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,111 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file biasing/B03/src/B03PVolumeStore.cc
|
||||
/// \brief Implementation of the B03PVolumeStore class
|
||||
//
|
||||
//
|
||||
// $Id: B03PVolumeStore.cc 70074 2013-05-22 21:01:50Z ahoward $
|
||||
// GEANT4 tag
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// GEANT 4 class source file
|
||||
//
|
||||
// B03PVolumeStore.cc
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "B03PVolumeStore.hh"
|
||||
#include <sstream>
|
||||
|
||||
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B03PVolumeStore::B03PVolumeStore(){}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B03PVolumeStore::~B03PVolumeStore(){}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03PVolumeStore::AddPVolume(const G4GeometryCell &cell){
|
||||
|
||||
B03SetGeometryCell::iterator it =
|
||||
fSetGeometryCell.find(cell);
|
||||
if (it != fSetGeometryCell.end()) {
|
||||
G4cout << "B03PVolumeStore::AddPVolume: cell already stored"
|
||||
<< G4endl;
|
||||
return;
|
||||
}
|
||||
|
||||
fSetGeometryCell.insert(cell);
|
||||
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
const G4VPhysicalVolume *B03PVolumeStore::
|
||||
GetPVolume(const G4String &name) const {
|
||||
const G4VPhysicalVolume *pvol = 0;
|
||||
for (B03SetGeometryCell::const_iterator it = fSetGeometryCell.begin();
|
||||
it != fSetGeometryCell.end(); ++it) {
|
||||
const G4VPhysicalVolume &vol = it->GetPhysicalVolume();
|
||||
if (vol.GetName() == name) {
|
||||
pvol = &vol;
|
||||
}
|
||||
}
|
||||
if (!pvol) {
|
||||
G4cout << "B03PVolumeStore::GetPVolume: no physical volume named: "
|
||||
<< name << ", found" << G4endl;
|
||||
}
|
||||
return pvol;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4String B03PVolumeStore::GetPNames() const {
|
||||
G4String NameString;
|
||||
for (B03SetGeometryCell::const_iterator it = fSetGeometryCell.begin();
|
||||
it != fSetGeometryCell.end(); ++it) {
|
||||
const G4VPhysicalVolume &vol = it->GetPhysicalVolume();
|
||||
std::ostringstream os;
|
||||
os << vol.GetName() << "_" << it->GetReplicaNumber()
|
||||
<< "\n";
|
||||
G4String cellname = os.str();
|
||||
|
||||
// G4String cellname(vol.GetName());
|
||||
// cellname += G4String("_");
|
||||
// cellname += std::str(it->GetReplicaNumber());
|
||||
|
||||
NameString += cellname;
|
||||
}
|
||||
return NameString;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,700 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file biasing/B03/src/B03PhysicsList.cc
|
||||
/// \brief Implementation of the B03PhysicsList class
|
||||
//
|
||||
//
|
||||
// $Id: B03PhysicsList.cc 75089 2013-10-25 23:25:21Z dwright $
|
||||
//
|
||||
|
||||
#include "globals.hh"
|
||||
#include <iomanip>
|
||||
|
||||
#include "B03PhysicsList.hh"
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleWithCuts.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4ProcessVector.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4BosonConstructor.hh"
|
||||
#include "G4LeptonConstructor.hh"
|
||||
#include "G4MesonConstructor.hh"
|
||||
#include "G4BaryonConstructor.hh"
|
||||
#include "G4IonConstructor.hh"
|
||||
#include "G4ShortLivedConstructor.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4MaterialTable.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B03PhysicsList::B03PhysicsList(): G4VUserPhysicsList()
|
||||
{
|
||||
fParaWorldName.clear();
|
||||
SetVerboseLevel(1);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B03PhysicsList::~B03PhysicsList()
|
||||
{
|
||||
fParaWorldName.clear();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03PhysicsList::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.
|
||||
|
||||
ConstructAllBosons();
|
||||
ConstructAllLeptons();
|
||||
ConstructAllMesons();
|
||||
ConstructAllBaryons();
|
||||
ConstructAllIons();
|
||||
ConstructAllShortLiveds();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03PhysicsList::ConstructAllBosons()
|
||||
{
|
||||
// Construct all bosons
|
||||
G4BosonConstructor pConstructor;
|
||||
pConstructor.ConstructParticle();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03PhysicsList::ConstructAllLeptons()
|
||||
{
|
||||
// Construct all leptons
|
||||
G4LeptonConstructor pConstructor;
|
||||
pConstructor.ConstructParticle();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03PhysicsList::ConstructAllMesons()
|
||||
{
|
||||
// Construct all mesons
|
||||
G4MesonConstructor pConstructor;
|
||||
pConstructor.ConstructParticle();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03PhysicsList::ConstructAllBaryons()
|
||||
{
|
||||
// Construct all barions
|
||||
G4BaryonConstructor pConstructor;
|
||||
pConstructor.ConstructParticle();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03PhysicsList::ConstructAllIons()
|
||||
{
|
||||
// Construct light ions
|
||||
G4IonConstructor pConstructor;
|
||||
pConstructor.ConstructParticle();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03PhysicsList::ConstructAllShortLiveds()
|
||||
{
|
||||
// Construct resonaces and quarks
|
||||
G4ShortLivedConstructor pConstructor;
|
||||
pConstructor.ConstructParticle();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03PhysicsList::ConstructProcess()
|
||||
{
|
||||
AddTransportation();
|
||||
AddScoringProcess();
|
||||
AddBiasingProcess();
|
||||
ConstructEM();
|
||||
ConstructLeptHad();
|
||||
ConstructHad();
|
||||
ConstructGeneral();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4ComptonScattering.hh"
|
||||
#include "G4GammaConversion.hh"
|
||||
#include "G4PhotoElectricEffect.hh"
|
||||
|
||||
#include "G4eMultipleScattering.hh"
|
||||
#include "G4MuMultipleScattering.hh"
|
||||
#include "G4hMultipleScattering.hh"
|
||||
|
||||
#include "G4eIonisation.hh"
|
||||
#include "G4eBremsstrahlung.hh"
|
||||
#include "G4eplusAnnihilation.hh"
|
||||
|
||||
#include "G4MuIonisation.hh"
|
||||
#include "G4MuBremsstrahlung.hh"
|
||||
#include "G4MuPairProduction.hh"
|
||||
|
||||
#include "G4hIonisation.hh"
|
||||
|
||||
void B03PhysicsList::ConstructEM()
|
||||
{
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
if (particleName == "gamma") {
|
||||
// gamma
|
||||
// Construct processes for gamma
|
||||
pmanager->AddDiscreteProcess(new G4GammaConversion());
|
||||
pmanager->AddDiscreteProcess(new G4ComptonScattering());
|
||||
pmanager->AddDiscreteProcess(new G4PhotoElectricEffect());
|
||||
|
||||
} else if (particleName == "e-") {
|
||||
//electron
|
||||
// Construct processes for electron
|
||||
pmanager->AddProcess(new G4eMultipleScattering(),-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 G4eMultipleScattering(),-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 G4MuMultipleScattering(),-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( particleName == "GenericIon" ) {
|
||||
pmanager->AddProcess(new G4hMultipleScattering(),-1,1,1);
|
||||
pmanager->AddProcess(new G4hIonisation(),-1,2,2);
|
||||
} else {
|
||||
if ((particle->GetPDGCharge() != 0.0) &&
|
||||
(particle->GetParticleName() != "chargedgeantino")&&
|
||||
(!particle->IsShortLived()) ) {
|
||||
// all others charged particles except geantino
|
||||
pmanager->AddProcess(new G4hMultipleScattering(),-1,1,1);
|
||||
pmanager->AddProcess(new G4hIonisation(),-1,2,2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// Hadron Processes
|
||||
|
||||
#include "G4HadronElasticProcess.hh"
|
||||
#include "G4HadronFissionProcess.hh"
|
||||
#include "G4HadronCaptureProcess.hh"
|
||||
|
||||
#include "G4PionPlusInelasticProcess.hh"
|
||||
#include "G4PionMinusInelasticProcess.hh"
|
||||
#include "G4KaonPlusInelasticProcess.hh"
|
||||
#include "G4KaonZeroSInelasticProcess.hh"
|
||||
#include "G4KaonZeroLInelasticProcess.hh"
|
||||
#include "G4KaonMinusInelasticProcess.hh"
|
||||
#include "G4ProtonInelasticProcess.hh"
|
||||
#include "G4AntiProtonInelasticProcess.hh"
|
||||
#include "G4NeutronInelasticProcess.hh"
|
||||
#include "G4AntiNeutronInelasticProcess.hh"
|
||||
#include "G4LambdaInelasticProcess.hh"
|
||||
#include "G4AntiLambdaInelasticProcess.hh"
|
||||
#include "G4SigmaPlusInelasticProcess.hh"
|
||||
#include "G4SigmaMinusInelasticProcess.hh"
|
||||
#include "G4AntiSigmaPlusInelasticProcess.hh"
|
||||
#include "G4AntiSigmaMinusInelasticProcess.hh"
|
||||
#include "G4XiZeroInelasticProcess.hh"
|
||||
#include "G4XiMinusInelasticProcess.hh"
|
||||
#include "G4AntiXiZeroInelasticProcess.hh"
|
||||
#include "G4AntiXiMinusInelasticProcess.hh"
|
||||
#include "G4DeuteronInelasticProcess.hh"
|
||||
#include "G4TritonInelasticProcess.hh"
|
||||
#include "G4AlphaInelasticProcess.hh"
|
||||
#include "G4OmegaMinusInelasticProcess.hh"
|
||||
#include "G4AntiOmegaMinusInelasticProcess.hh"
|
||||
|
||||
// Low-energy Models
|
||||
|
||||
#include "G4HadronElastic.hh"
|
||||
#include "G4NeutronRadCapture.hh"
|
||||
#include "G4LFission.hh"
|
||||
|
||||
// -- generator models
|
||||
#include "G4TheoFSGenerator.hh"
|
||||
#include "G4ExcitationHandler.hh"
|
||||
#include "G4Evaporation.hh"
|
||||
#include "G4CompetitiveFission.hh"
|
||||
#include "G4FermiBreakUp.hh"
|
||||
#include "G4StatMF.hh"
|
||||
#include "G4GeneratorPrecompoundInterface.hh"
|
||||
#include "G4Fancy3DNucleus.hh"
|
||||
#include "G4CascadeInterface.hh"
|
||||
#include "G4StringModel.hh"
|
||||
#include "G4PreCompoundModel.hh"
|
||||
#include "G4FTFModel.hh"
|
||||
#include "G4QGSMFragmentation.hh"
|
||||
#include "G4LundStringFragmentation.hh"
|
||||
#include "G4ExcitedStringDecay.hh"
|
||||
#include "G4QMDReaction.hh"
|
||||
#include "G4BinaryLightIonReaction.hh"
|
||||
|
||||
// Cross sections
|
||||
#include "G4IonsShenCrossSection.hh"
|
||||
#include "G4TripathiCrossSection.hh"
|
||||
#include "G4TripathiLightCrossSection.hh"
|
||||
|
||||
//
|
||||
// ConstructHad()
|
||||
//
|
||||
// Makes discrete physics processes for the hadrons
|
||||
// The processes are: Elastic scattering, Inelastic scattering,
|
||||
// Fission (for neutron only), and Capture (neutron).
|
||||
//
|
||||
|
||||
void B03PhysicsList::ConstructHad()
|
||||
{
|
||||
// this will be the model class for high energies
|
||||
G4TheoFSGenerator* theTheoModel = new G4TheoFSGenerator;
|
||||
G4TheoFSGenerator* antiBHighEnergyModel = new G4TheoFSGenerator;
|
||||
|
||||
// all models for treatment of thermal nucleus
|
||||
G4Evaporation* theEvaporation = new G4Evaporation;
|
||||
G4FermiBreakUp* theFermiBreakUp = new G4FermiBreakUp;
|
||||
G4StatMF* theMF = new G4StatMF;
|
||||
|
||||
// Evaporation logic
|
||||
G4ExcitationHandler* theHandler = new G4ExcitationHandler;
|
||||
theHandler->SetEvaporation(theEvaporation);
|
||||
theHandler->SetFermiModel(theFermiBreakUp);
|
||||
theHandler->SetMultiFragmentation(theMF);
|
||||
theHandler->SetMaxAandZForFermiBreakUp(12, 6);
|
||||
theHandler->SetMinEForMultiFrag(3*MeV);
|
||||
|
||||
// Pre equilibrium stage
|
||||
G4PreCompoundModel* thePreEquilib = new G4PreCompoundModel(theHandler);
|
||||
|
||||
// a no-cascade generator-precompound interaface
|
||||
G4GeneratorPrecompoundInterface* theCascade =
|
||||
new G4GeneratorPrecompoundInterface;
|
||||
theCascade->SetDeExcitation(thePreEquilib);
|
||||
|
||||
// Bertini cascade
|
||||
G4CascadeInterface* bertini = new G4CascadeInterface;
|
||||
bertini->SetMaxEnergy(22*MeV);
|
||||
|
||||
// here come the high energy parts
|
||||
G4VPartonStringModel* theStringModel;
|
||||
theStringModel = new G4FTFModel;
|
||||
theTheoModel->SetTransport(theCascade);
|
||||
theTheoModel->SetHighEnergyGenerator(theStringModel);
|
||||
theTheoModel->SetMinEnergy(19*GeV);
|
||||
theTheoModel->SetMaxEnergy(100*TeV);
|
||||
|
||||
G4VLongitudinalStringDecay* theFragmentation = new G4QGSMFragmentation;
|
||||
G4ExcitedStringDecay* theStringDecay =
|
||||
new G4ExcitedStringDecay(theFragmentation);
|
||||
theStringModel->SetFragmentationModel(theStringDecay);
|
||||
|
||||
// high energy model for anti-baryons
|
||||
antiBHighEnergyModel = new G4TheoFSGenerator("ANTI-FTFP");
|
||||
G4FTFModel* antiBStringModel = new G4FTFModel;
|
||||
G4ExcitedStringDecay* stringDecay =
|
||||
new G4ExcitedStringDecay(new G4LundStringFragmentation);
|
||||
antiBStringModel->SetFragmentationModel(stringDecay);
|
||||
|
||||
G4GeneratorPrecompoundInterface* antiBCascade =
|
||||
new G4GeneratorPrecompoundInterface;
|
||||
G4PreCompoundModel* preEquilib =
|
||||
new G4PreCompoundModel(new G4ExcitationHandler);
|
||||
antiBCascade->SetDeExcitation(preEquilib);
|
||||
|
||||
antiBHighEnergyModel->SetTransport(antiBCascade);
|
||||
antiBHighEnergyModel->SetHighEnergyGenerator(antiBStringModel);
|
||||
antiBHighEnergyModel->SetMinEnergy(0.0);
|
||||
antiBHighEnergyModel->SetMaxEnergy(20*TeV);
|
||||
|
||||
// Light ion models
|
||||
G4BinaryLightIonReaction* binaryCascade = new G4BinaryLightIonReaction;
|
||||
binaryCascade->SetMinEnergy(0.0);
|
||||
binaryCascade->SetMaxEnergy(110*MeV);
|
||||
|
||||
G4QMDReaction* qmd = new G4QMDReaction;
|
||||
qmd->SetMinEnergy(100*MeV);
|
||||
qmd->SetMaxEnergy(10*GeV);
|
||||
|
||||
G4IonsShenCrossSection* shenXS = new G4IonsShenCrossSection;
|
||||
G4TripathiCrossSection* tripXS = new G4TripathiCrossSection;
|
||||
G4TripathiLightCrossSection* tripLightXS = new G4TripathiLightCrossSection;
|
||||
|
||||
// Elastic process
|
||||
G4HadronElasticProcess* theElasticProcess = new G4HadronElasticProcess;
|
||||
G4HadronElastic* theElasticModel = new G4HadronElastic;
|
||||
theElasticProcess->RegisterMe(theElasticModel);
|
||||
|
||||
theParticleIterator->reset();
|
||||
while ((*theParticleIterator)()) {
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
if (particleName == "pi+") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4PionPlusInelasticProcess* theInelasticProcess =
|
||||
new G4PionPlusInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(bertini);
|
||||
theInelasticProcess->RegisterMe(theTheoModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
} else if (particleName == "pi-") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4PionMinusInelasticProcess* theInelasticProcess =
|
||||
new G4PionMinusInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(bertini);
|
||||
theInelasticProcess->RegisterMe(theTheoModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
} else if (particleName == "kaon+") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4KaonPlusInelasticProcess* theInelasticProcess =
|
||||
new G4KaonPlusInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(bertini);
|
||||
theInelasticProcess->RegisterMe(theTheoModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "kaon0S") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4KaonZeroSInelasticProcess* theInelasticProcess =
|
||||
new G4KaonZeroSInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(bertini);
|
||||
theInelasticProcess->RegisterMe(theTheoModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "kaon0L") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4KaonZeroLInelasticProcess* theInelasticProcess =
|
||||
new G4KaonZeroLInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(bertini);
|
||||
theInelasticProcess->RegisterMe(theTheoModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "kaon-") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4KaonMinusInelasticProcess* theInelasticProcess =
|
||||
new G4KaonMinusInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(bertini);
|
||||
theInelasticProcess->RegisterMe(theTheoModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "proton") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4ProtonInelasticProcess* theInelasticProcess =
|
||||
new G4ProtonInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(bertini);
|
||||
theInelasticProcess->RegisterMe(theTheoModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "anti_proton") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4AntiProtonInelasticProcess* theInelasticProcess =
|
||||
new G4AntiProtonInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(antiBHighEnergyModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
|
||||
} else if (particleName == "neutron") {
|
||||
// elastic scattering
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
|
||||
// inelastic scattering
|
||||
G4NeutronInelasticProcess* theInelasticProcess =
|
||||
new G4NeutronInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(bertini);
|
||||
theInelasticProcess->RegisterMe(theTheoModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
|
||||
// fission
|
||||
G4HadronFissionProcess* theFissionProcess = new G4HadronFissionProcess;
|
||||
G4LFission* theFissionModel = new G4LFission;
|
||||
theFissionProcess->RegisterMe(theFissionModel);
|
||||
pmanager->AddDiscreteProcess(theFissionProcess);
|
||||
|
||||
// capture
|
||||
G4HadronCaptureProcess* theCaptureProcess = new G4HadronCaptureProcess;
|
||||
G4NeutronRadCapture* theCaptureModel = new G4NeutronRadCapture;
|
||||
theCaptureProcess->RegisterMe(theCaptureModel);
|
||||
pmanager->AddDiscreteProcess(theCaptureProcess);
|
||||
|
||||
} else if (particleName == "anti_neutron") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4AntiNeutronInelasticProcess* theInelasticProcess =
|
||||
new G4AntiNeutronInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(antiBHighEnergyModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
|
||||
} else if (particleName == "lambda") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4LambdaInelasticProcess* theInelasticProcess =
|
||||
new G4LambdaInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(bertini);
|
||||
theInelasticProcess->RegisterMe(theTheoModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "anti_lambda") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4AntiLambdaInelasticProcess* theInelasticProcess =
|
||||
new G4AntiLambdaInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(antiBHighEnergyModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "sigma+") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4SigmaPlusInelasticProcess* theInelasticProcess =
|
||||
new G4SigmaPlusInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(bertini);
|
||||
theInelasticProcess->RegisterMe(theTheoModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "sigma-") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4SigmaMinusInelasticProcess* theInelasticProcess =
|
||||
new G4SigmaMinusInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(bertini);
|
||||
theInelasticProcess->RegisterMe(theTheoModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "anti_sigma+") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4AntiSigmaPlusInelasticProcess* theInelasticProcess =
|
||||
new G4AntiSigmaPlusInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(antiBHighEnergyModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "anti_sigma-") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4AntiSigmaMinusInelasticProcess* theInelasticProcess =
|
||||
new G4AntiSigmaMinusInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(antiBHighEnergyModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "xi0") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4XiZeroInelasticProcess* theInelasticProcess =
|
||||
new G4XiZeroInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(bertini);
|
||||
theInelasticProcess->RegisterMe(theTheoModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "xi-") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4XiMinusInelasticProcess* theInelasticProcess =
|
||||
new G4XiMinusInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(bertini);
|
||||
theInelasticProcess->RegisterMe(theTheoModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "anti_xi0") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4AntiXiZeroInelasticProcess* theInelasticProcess =
|
||||
new G4AntiXiZeroInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(antiBHighEnergyModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "anti_xi-") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4AntiXiMinusInelasticProcess* theInelasticProcess =
|
||||
new G4AntiXiMinusInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(antiBHighEnergyModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "deuteron") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4DeuteronInelasticProcess* theInelasticProcess =
|
||||
new G4DeuteronInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(binaryCascade);
|
||||
theInelasticProcess->RegisterMe(qmd);
|
||||
theInelasticProcess->AddDataSet(shenXS);
|
||||
theInelasticProcess->AddDataSet(tripXS);
|
||||
theInelasticProcess->AddDataSet(tripLightXS);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "triton") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4TritonInelasticProcess* theInelasticProcess =
|
||||
new G4TritonInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(binaryCascade);
|
||||
theInelasticProcess->RegisterMe(qmd);
|
||||
theInelasticProcess->AddDataSet(shenXS);
|
||||
theInelasticProcess->AddDataSet(tripXS);
|
||||
theInelasticProcess->AddDataSet(tripLightXS);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
else if (particleName == "alpha") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4AlphaInelasticProcess* theInelasticProcess =
|
||||
new G4AlphaInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(binaryCascade);
|
||||
theInelasticProcess->RegisterMe(qmd);
|
||||
theInelasticProcess->AddDataSet(shenXS);
|
||||
theInelasticProcess->AddDataSet(tripXS);
|
||||
theInelasticProcess->AddDataSet(tripLightXS);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
|
||||
} else if (particleName == "omega-") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4OmegaMinusInelasticProcess* theInelasticProcess =
|
||||
new G4OmegaMinusInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(bertini);
|
||||
theInelasticProcess->RegisterMe(theTheoModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
|
||||
} else if (particleName == "anti_omega-") {
|
||||
pmanager->AddDiscreteProcess(theElasticProcess);
|
||||
G4AntiOmegaMinusInelasticProcess* theInelasticProcess =
|
||||
new G4AntiOmegaMinusInelasticProcess("inelastic");
|
||||
theInelasticProcess->RegisterMe(antiBHighEnergyModel);
|
||||
pmanager->AddDiscreteProcess(theInelasticProcess);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03PhysicsList::ConstructLeptHad()
|
||||
{;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4Decay.hh"
|
||||
void B03PhysicsList::ConstructGeneral()
|
||||
{
|
||||
G4Decay* theDecayProcess = new G4Decay();
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
if (theDecayProcess->IsApplicable(*particle)) {
|
||||
pmanager ->AddProcess(theDecayProcess);
|
||||
pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
|
||||
pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03PhysicsList::SetCuts()
|
||||
{
|
||||
if (verboseLevel >0)
|
||||
{
|
||||
G4cout << "B03PhysicsList::SetCuts:";
|
||||
G4cout << "CutLength : " << defaultCutValue/mm << " (mm)" << G4endl;
|
||||
}
|
||||
// "G4VUserPhysicsList::SetCutsWithDefault" method sets
|
||||
// the default cut value for all particle types
|
||||
SetCutsWithDefault();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4ParallelWorldScoringProcess.hh"
|
||||
void B03PhysicsList::AddScoringProcess(){
|
||||
|
||||
G4int npw = fParaWorldName.size();
|
||||
for ( G4int i = 0; i < npw; i++){
|
||||
G4ParallelWorldScoringProcess* theParallelWorldScoringProcess
|
||||
= new G4ParallelWorldScoringProcess("ParaWorldScoringProc");
|
||||
theParallelWorldScoringProcess->SetParallelWorld(fParaWorldName[i]);
|
||||
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() ){
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
if ( !particle->IsShortLived() ){
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
pmanager->AddProcess(theParallelWorldScoringProcess);
|
||||
pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess
|
||||
,idxAtRest);
|
||||
pmanager->SetProcessOrdering(theParallelWorldScoringProcess
|
||||
,idxAlongStep,1);
|
||||
pmanager->SetProcessOrderingToLast(theParallelWorldScoringProcess
|
||||
,idxPostStep);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "G4ImportanceProcess.hh"
|
||||
#include "G4IStore.hh"
|
||||
void B03PhysicsList::AddBiasingProcess(){
|
||||
|
||||
|
||||
G4cout << " Preparing Importance Sampling with GhostWorld "
|
||||
<< fBiasWorldName << G4endl;
|
||||
fGeomSampler->SetParallel(true); // parallelworld
|
||||
G4IStore* iStore = G4IStore::GetInstance(fBiasWorldName);
|
||||
fGeomSampler->SetWorld(iStore->GetParallelWorldVolumePointer());
|
||||
// fGeomSampler->PrepareImportanceSampling(G4IStore::
|
||||
// GetInstance(fBiasWorldName), 0);
|
||||
static G4bool first = true;
|
||||
if(first) {
|
||||
fGeomSampler->PrepareImportanceSampling(iStore, 0);
|
||||
|
||||
fGeomSampler->Configure();
|
||||
G4cout << " GeomSampler Configured!!! " << G4endl;
|
||||
first = false;
|
||||
}
|
||||
|
||||
#ifdef G4MULTITHREADED
|
||||
fGeomSampler->AddProcess();
|
||||
#else
|
||||
G4cout << " Running in singlethreaded mode!!! " << G4endl;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file biasing/B03/src/B03PrimaryGeneratorAction.cc
|
||||
/// \brief Implementation of the B03PrimaryGeneratorAction class
|
||||
//
|
||||
//
|
||||
// $Id: B03PrimaryGeneratorAction.cc 70222 2013-05-27 10:07:27Z ihrivnac $
|
||||
//
|
||||
|
||||
#include "globals.hh"
|
||||
|
||||
#include "B03PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4Neutron.hh"
|
||||
#include "G4ThreeVector.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B03PrimaryGeneratorAction::B03PrimaryGeneratorAction()
|
||||
: G4VUserPrimaryGeneratorAction(), fParticleGun(0)
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
fParticleGun = new G4ParticleGun(n_particle);
|
||||
fParticleGun->SetParticleDefinition(G4Neutron::NeutronDefinition());
|
||||
fParticleGun->SetParticleEnergy(10.0*MeV);
|
||||
fParticleGun->SetParticlePosition(G4ThreeVector(0.0, 0.0, -90.0005*cm));
|
||||
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(0.0, 0.0, 1.0));
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
B03PrimaryGeneratorAction::~B03PrimaryGeneratorAction()
|
||||
{
|
||||
delete fParticleGun;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
fParticleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,238 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file biasing/B03/src/B03Run.cc
|
||||
/// \brief Implementation of the B03Run class
|
||||
//
|
||||
//
|
||||
// $Id: B03Run.cc 70528 2013-05-31 16:50:36Z gcosmo $
|
||||
//
|
||||
|
||||
//=====================================================================
|
||||
//
|
||||
// (Description)
|
||||
// B03Run Class is for accumulating scored quantities which is
|
||||
// scored using G4MutiFunctionalDetector and G4VPrimitiveScorer.
|
||||
// Accumulation is done using G4THitsMap object.
|
||||
//
|
||||
// The constructor B03Run(const std::vector<G4String> mfdName)
|
||||
// needs a vector filled with MultiFunctionalDetector names which
|
||||
// was assigned at instantiation of MultiFunctionalDetector(MFD).
|
||||
// Then B03Run constructor automatically scans primitive scorers
|
||||
// in the MFD, and obtains collectionIDs of all collections associated
|
||||
// to those primitive scorers. Futhermore, the G4THitsMap objects
|
||||
// for accumulating during a RUN are automatically created too.
|
||||
// (*) Collection Name is same as primitive scorer name.
|
||||
//
|
||||
// The resultant information is kept inside B03Run objects as
|
||||
// data members.
|
||||
// std::vector<G4String> fCollName; // Collection Name,
|
||||
// std::vector<G4int> fCollID; // Collection ID,
|
||||
// std::vector<G4THitsMap<G4double>*> fRunMap; // HitsMap for RUN.
|
||||
//
|
||||
// The resualtant HitsMap objects are obtain using access method,
|
||||
// GetHitsMap(..).
|
||||
//
|
||||
//=====================================================================
|
||||
|
||||
#include "B03Run.hh"
|
||||
#include "G4SDManager.hh"
|
||||
|
||||
#include "G4MultiFunctionalDetector.hh"
|
||||
#include "G4VPrimitiveScorer.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// Constructor.
|
||||
// (The vector of MultiFunctionalDetector name has to given.)
|
||||
B03Run::B03Run(const std::vector<G4String> mfdName): G4Run()
|
||||
{
|
||||
G4SDManager* SDman = G4SDManager::GetSDMpointer();
|
||||
//=================================================
|
||||
// Initalize RunMaps for accumulation.
|
||||
// Get CollectionIDs for HitCollections.
|
||||
//=================================================
|
||||
G4int Nmfd = mfdName.size();
|
||||
for ( G4int idet = 0; idet < Nmfd ; idet++){ // Loop for all MFD.
|
||||
G4String detName = mfdName[idet];
|
||||
//--- Seek and Obtain MFD objects from SDmanager.
|
||||
G4MultiFunctionalDetector* mfd =
|
||||
(G4MultiFunctionalDetector*)(SDman->FindSensitiveDetector(detName));
|
||||
//
|
||||
if ( mfd ){
|
||||
//--- Loop over the registered primitive scorers.
|
||||
for (G4int icol = 0; icol < mfd->GetNumberOfPrimitives(); icol++){
|
||||
// Get Primitive Scorer object.
|
||||
G4VPrimitiveScorer* scorer=mfd->GetPrimitive(icol);
|
||||
// collection name and collectionID for HitsCollection,
|
||||
// where type of HitsCollection is G4THitsMap in case of primitive scorer.
|
||||
// The collection name is given by <MFD name>/<Primitive Scorer name>.
|
||||
G4String collectionName = scorer->GetName();
|
||||
G4String fullCollectionName = detName+"/"+collectionName;
|
||||
G4int collectionID = SDman->GetCollectionID(fullCollectionName);
|
||||
//
|
||||
if ( collectionID >= 0 ){
|
||||
G4cout << "++ "<<fullCollectionName<< " id "
|
||||
<< collectionID << G4endl;
|
||||
// Store obtained HitsCollection information into data members.
|
||||
// And, creates new G4THitsMap for accumulating quantities during RUN.
|
||||
fCollName.push_back(fullCollectionName);
|
||||
fCollID.push_back(collectionID);
|
||||
fRunMap.push_back(new G4THitsMap<G4double>(detName
|
||||
,collectionName));
|
||||
}else{
|
||||
G4cout << "** collection " << fullCollectionName
|
||||
<< " not found. "<<G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// Destructor
|
||||
// clear all data members.
|
||||
B03Run::~B03Run()
|
||||
{
|
||||
//--- Clear HitsMap for RUN
|
||||
G4int Nmap = fRunMap.size();
|
||||
for ( G4int i = 0; i < Nmap; i++){
|
||||
if(fRunMap[i] ) fRunMap[i]->clear();
|
||||
}
|
||||
fCollName.clear();
|
||||
fCollID.clear();
|
||||
fRunMap.clear();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// RecordEvent is called at end of event.
|
||||
// For scoring purpose, the resultant quantity in a event,
|
||||
// is accumulated during a Run.
|
||||
void B03Run::RecordEvent(const G4Event* aEvent)
|
||||
{
|
||||
numberOfEvent++; // This is an original line.
|
||||
|
||||
//=============================
|
||||
// HitsCollection of This Event
|
||||
//============================
|
||||
G4HCofThisEvent* HCE = aEvent->GetHCofThisEvent();
|
||||
if (!HCE) return;
|
||||
//=======================================================
|
||||
// Sum up HitsMap of this Event into HitsMap of this RUN
|
||||
//=======================================================
|
||||
G4int Ncol = fCollID.size();
|
||||
for ( G4int i = 0; i < Ncol ; i++ ){ // Loop over HitsCollection
|
||||
G4THitsMap<G4double>* EvtMap=0;
|
||||
if ( fCollID[i] >= 0 ){ // Collection is attached to HCE
|
||||
EvtMap = (G4THitsMap<G4double>*)(HCE->GetHC(fCollID[i]));
|
||||
}else{
|
||||
G4cout <<" Error EvtMap Not Found "<< i << G4endl;
|
||||
}
|
||||
if ( EvtMap ) {
|
||||
//=== Sum up HitsMap of this event to HitsMap of RUN.===
|
||||
*fRunMap[i] += *EvtMap;
|
||||
//======================================================
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// Access method for HitsMap of the RUN
|
||||
//
|
||||
// Access HitsMap.
|
||||
// By MultiFunctionalDetector name and Collection Name.
|
||||
G4THitsMap<G4double>* B03Run::GetHitsMap(const G4String& detName,
|
||||
const G4String& colName){
|
||||
G4String fullName = detName+"/"+colName;
|
||||
G4cout << " getting hits map " << fullName << G4endl;
|
||||
return GetHitsMap(fullName);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// Access HitsMap.
|
||||
// By full description of collection name, that is
|
||||
// <MultiFunctional Detector Name>/<Primitive Scorer Name>
|
||||
G4THitsMap<G4double>* B03Run::GetHitsMap(const G4String& fullName){
|
||||
G4cout << " getting hits map " << fullName << G4endl;
|
||||
G4int Ncol = fCollName.size();
|
||||
for ( G4int i = 0; i < Ncol; i++){
|
||||
if ( fCollName[i] == fullName ){
|
||||
return fRunMap[i];
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// - Dump All HitsMap of this RUN. (for debuging and monitoring of quantity).
|
||||
// This method calls G4THisMap::PrintAll() for individual HitsMap.
|
||||
void B03Run::DumpAllScorer(){
|
||||
|
||||
// - Number of HitsMap in this RUN.
|
||||
G4int n = GetNumberOfHitsMap();
|
||||
// - GetHitsMap and dump values.
|
||||
for ( G4int i = 0; i < n ; i++ ){
|
||||
G4THitsMap<G4double>* RunMap =GetHitsMap(i);
|
||||
if ( RunMap ) {
|
||||
G4cout << " PrimitiveScorer RUN "
|
||||
<< RunMap->GetSDname() <<","<< RunMap->GetName() << G4endl;
|
||||
G4cout << " Number of entries " << RunMap->entries() << G4endl;
|
||||
std::map<G4int,G4double*>::iterator itr = RunMap->GetMap()->begin();
|
||||
for(; itr != RunMap->GetMap()->end(); itr++) {
|
||||
G4cout << " copy no.: " << itr->first
|
||||
<< " Run Value : " << *(itr->second)
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03Run::Merge(const G4Run* aRun)
|
||||
{
|
||||
const B03Run * localRun = static_cast<const B03Run *>(aRun);
|
||||
//=======================================================
|
||||
// Merge HitsMap of working threads
|
||||
//=======================================================
|
||||
G4int nCol = localRun->fCollID.size();
|
||||
for ( G4int i = 0; i < nCol ; i++ ){ // Loop over HitsCollection
|
||||
if ( localRun->fCollID[i] >= 0 ){
|
||||
*fRunMap[i] += *localRun->fRunMap[i];
|
||||
}
|
||||
}
|
||||
|
||||
G4Run::Merge(aRun);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -0,0 +1,271 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * License and Disclaimer *
|
||||
// * *
|
||||
// * The Geant4 software is copyright of the Copyright Holders of *
|
||||
// * the Geant4 Collaboration. It is provided under the terms and *
|
||||
// * conditions of the Geant4 Software License, included in the file *
|
||||
// * LICENSE and available at http://cern.ch/geant4/license . These *
|
||||
// * include a list of copyright holders. *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. Please see the license in the file LICENSE and URL above *
|
||||
// * for the full disclaimer and the limitation of liability. *
|
||||
// * *
|
||||
// * This code implementation is the result of the scientific and *
|
||||
// * technical work of the GEANT4 collaboration. *
|
||||
// * By using, copying, modifying or distributing the software (or *
|
||||
// * any work based on the software) you agree to acknowledge its *
|
||||
// * use in resulting scientific publications, and indicate your *
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file biasing/B03/src/B03RunAction.cc
|
||||
/// \brief Implementation of the B03RunAction class
|
||||
//
|
||||
//
|
||||
// $Id: B03RunAction.cc 72953 2013-08-14 14:13:36Z gcosmo $
|
||||
//
|
||||
#include "B03RunAction.hh"
|
||||
#include "B03Run.hh"
|
||||
|
||||
//-- In order to obtain detector information.
|
||||
#include "G4RunManager.hh"
|
||||
#include "B03ImportanceDetectorConstruction.hh"
|
||||
#include "G4THitsMap.hh"
|
||||
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// B03RunAction
|
||||
//
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// Constructor
|
||||
B03RunAction::B03RunAction():
|
||||
G4UserRunAction(),
|
||||
// fFieldName(15),
|
||||
fFieldValue(14)
|
||||
{
|
||||
// - Prepare data member for B03Run.
|
||||
// vector represents a list of MultiFunctionalDetector names.
|
||||
fSDName.push_back(G4String("ConcreteSD"));
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
// Destructor.
|
||||
B03RunAction::~B03RunAction()
|
||||
{
|
||||
fSDName.clear();
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
G4Run* B03RunAction::GenerateRun()
|
||||
{
|
||||
// Generate new RUN object, which is specially
|
||||
// dedicated for MultiFunctionalDetector scheme.
|
||||
// Detail description can be found in B03Run.hh/cc.
|
||||
return new B03Run(fSDName);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03RunAction::BeginOfRunAction(const G4Run* aRun)
|
||||
{
|
||||
G4cout << "### Run " << aRun->GetRunID() << " start." << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03RunAction::EndOfRunAction(const G4Run* aRun)
|
||||
{
|
||||
G4cout << " ###### EndOfRunAction " <<G4endl;
|
||||
//- B03Run object.
|
||||
B03Run* b02Run = (B03Run*)aRun;
|
||||
//--- Dump all socred quantities involved in B03Run.
|
||||
// b02Run->DumpAllScorer();
|
||||
//---
|
||||
G4RunManager* mgr = G4RunManager::GetRunManager();
|
||||
//
|
||||
|
||||
for ( G4int i = 0; i < (G4int)fSDName.size(); i++ ){
|
||||
const G4VUserDetectorConstruction* vdet =
|
||||
mgr->GetUserDetectorConstruction();
|
||||
// B03DetectorConstruction* bdet = (B03DetectorConstruction*)vdet;
|
||||
B03ImportanceDetectorConstruction* bdet =
|
||||
(B03ImportanceDetectorConstruction*)vdet;
|
||||
//
|
||||
|
||||
//---------------------------------------------
|
||||
// Dump accumulated quantities for this RUN.
|
||||
// (Display only central region of x-y plane)
|
||||
// 0 ConcreteSD/Collisions
|
||||
// 1 ConcreteSD/CollWeight
|
||||
// 2 ConcreteSD/Population
|
||||
// 3 ConcreteSD/TrackEnter
|
||||
// 4 ConcreteSD/SL
|
||||
// 5 ConcreteSD/SLW
|
||||
// 6 ConcreteSD/SLWE
|
||||
// 7 ConcreteSD/SLW_V
|
||||
// 8 ConcreteSD/SLWE_V
|
||||
//---------------------------------------------
|
||||
G4THitsMap<G4double>* Collisions =
|
||||
b02Run->GetHitsMap(fSDName[i]+"/Collisions");
|
||||
G4THitsMap<G4double>* CollWeight =
|
||||
b02Run->GetHitsMap(fSDName[i]+"/CollWeight");
|
||||
G4THitsMap<G4double>* Population =
|
||||
b02Run->GetHitsMap(fSDName[i]+"/Population");
|
||||
G4THitsMap<G4double>* TrackEnter =
|
||||
b02Run->GetHitsMap(fSDName[i]+"/TrackEnter");
|
||||
G4THitsMap<G4double>* SL =
|
||||
b02Run->GetHitsMap(fSDName[i]+"/SL");
|
||||
G4THitsMap<G4double>* SLW =
|
||||
b02Run->GetHitsMap(fSDName[i]+"/SLW");
|
||||
G4THitsMap<G4double>* SLWE =
|
||||
b02Run->GetHitsMap(fSDName[i]+"/SLWE");
|
||||
G4THitsMap<G4double>* SLW_V =
|
||||
b02Run->GetHitsMap(fSDName[i]+"/SLW_V");
|
||||
G4THitsMap<G4double>* SLWE_V =
|
||||
b02Run->GetHitsMap(fSDName[i]+"/SLWE_V");
|
||||
|
||||
if (IsMaster())
|
||||
{
|
||||
G4cout <<
|
||||
"\n--------------------End of Global Run-----------------------" <<
|
||||
G4endl;
|
||||
G4cout <<
|
||||
" Number of event processed : "<< aRun->GetNumberOfEvent() << G4endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
G4cout <<
|
||||
"\n--------------------End of Local Run------------------------" <<
|
||||
G4endl;
|
||||
G4cout << " Number of event processed : "<< aRun->GetNumberOfEvent() <<
|
||||
G4endl;
|
||||
}
|
||||
|
||||
G4cout << "============================================================="
|
||||
<<G4endl;
|
||||
G4cout << "============================================================="
|
||||
<<G4endl;
|
||||
|
||||
|
||||
std::ostream *myout = &G4cout;
|
||||
PrintHeader(myout);
|
||||
|
||||
for ( G4int iz = 0; iz < 20; iz++){
|
||||
G4double* SumCollisions = (*Collisions)[iz];
|
||||
G4double* SumCollWeight = (*CollWeight)[iz];
|
||||
G4double* Populations = (*Population)[iz];
|
||||
G4double* TrackEnters = (*TrackEnter)[iz];
|
||||
G4double* SLs = (*SL)[iz];
|
||||
G4double* SLWs = (*SLW)[iz];
|
||||
G4double* SLWEs = (*SLWE)[iz];
|
||||
G4double* SLW_Vs = (*SLW_V)[iz];
|
||||
G4double* SLWE_Vs = (*SLWE_V)[iz];
|
||||
if ( !SumCollisions ) SumCollisions = new G4double(0.0);
|
||||
if ( !SumCollWeight ) SumCollWeight = new G4double(0.0);
|
||||
if ( !Populations ) Populations = new G4double(0.0);
|
||||
if ( !TrackEnters ) { G4cout << " NO TRACKS - WHY? " << G4endl;
|
||||
TrackEnters = new G4double(0.0);}
|
||||
if ( !SLs ) SLs = new G4double(0.0);
|
||||
if ( !SLWs ) SLWs = new G4double(0.0);
|
||||
if ( !SLWEs ) SLWEs = new G4double(0.0);
|
||||
if ( !SLW_Vs ) SLW_Vs = new G4double(0.0);
|
||||
if ( !SLWE_Vs ) SLWE_Vs = new G4double(0.0);
|
||||
G4double NumWeightedEnergy =0.0;
|
||||
G4double FluxWeightedEnergy=0.0;
|
||||
G4double AverageTrackWeight=0.0;
|
||||
if ( *SLW_Vs !=0. ) NumWeightedEnergy = (*SLWE_Vs)/(*SLW_Vs);
|
||||
if ( *SLWs !=0. ) FluxWeightedEnergy = (*SLWEs)/(*SLWs);
|
||||
if ( *SLs !=0. ) AverageTrackWeight = (*SLWs)/(*SLs);
|
||||
G4String cname = bdet->GetCellName(iz);
|
||||
G4cout
|
||||
<< std::setw(fFieldValue) << cname << " |"
|
||||
<< std::setw(fFieldValue) << (*TrackEnters) << " |"
|
||||
<< std::setw(fFieldValue) << (*Populations) << " |"
|
||||
<< std::setw(fFieldValue) << (*SumCollisions) << " |"
|
||||
<< std::setw(fFieldValue) << (*SumCollWeight) << " |"
|
||||
<< std::setw(fFieldValue) << NumWeightedEnergy << " |"
|
||||
<< std::setw(fFieldValue) << FluxWeightedEnergy << " |"
|
||||
<< std::setw(fFieldValue) << AverageTrackWeight << " |"
|
||||
<< std::setw(fFieldValue) << (*SLs) << " |"
|
||||
<< std::setw(fFieldValue) << (*SLWs) << " |"
|
||||
<< std::setw(fFieldValue) << (*SLW_Vs) << " |"
|
||||
<< std::setw(fFieldValue) << (*SLWEs) << " |"
|
||||
<< std::setw(fFieldValue) << (*SLWE_Vs) << " |"
|
||||
<< G4endl;
|
||||
}
|
||||
G4cout << "============================================="<<G4endl;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
void B03RunAction::PrintHeader(std::ostream *out)
|
||||
{
|
||||
std::vector<G4String> vecScoreName;
|
||||
vecScoreName.push_back("Tr.Entering");
|
||||
vecScoreName.push_back("Population");
|
||||
vecScoreName.push_back("Collisions");
|
||||
vecScoreName.push_back("Coll*WGT");
|
||||
vecScoreName.push_back("NumWGTedE");
|
||||
vecScoreName.push_back("FluxWGTedE");
|
||||
vecScoreName.push_back("Av.Tr.WGT");
|
||||
vecScoreName.push_back("SL");
|
||||
vecScoreName.push_back("SLW");
|
||||
vecScoreName.push_back("SLW_v");
|
||||
vecScoreName.push_back("SLWE");
|
||||
vecScoreName.push_back("SLWE_v");
|
||||
|
||||
// head line
|
||||
//std::string vname = FillString("Volume", ' ', FieldName+1);
|
||||
//*out << vname << '|';
|
||||
std::string vname;
|
||||
*out << std::setw(fFieldValue) << "Volume" << " |";
|
||||
for (std::vector<G4String>::iterator it = vecScoreName.begin();
|
||||
it != vecScoreName.end(); it++) {
|
||||
//vname = FillString((*it),
|
||||
// ' ',
|
||||
// fFieldValue+1,
|
||||
// false);
|
||||
// *out << vname << '|';
|
||||
*out << std::setw(fFieldValue) << (*it) << " |";
|
||||
}
|
||||
*out << G4endl;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
std::string B03RunAction::FillString(const std::string &name,
|
||||
char c, G4int n, G4bool back)
|
||||
{
|
||||
std::string fname("");
|
||||
G4int k = n - name.size();
|
||||
if (k > 0) {
|
||||
if (back) {
|
||||
fname = name;
|
||||
fname += std::string(k,c);
|
||||
}
|
||||
else {
|
||||
fname = std::string(k,c);
|
||||
fname += name;
|
||||
}
|
||||
}
|
||||
else {
|
||||
fname = name;
|
||||
}
|
||||
return fname;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
Reference in New Issue
Block a user