Import Geant4 1.1.0 source tree
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: Em8CalorHit.cc,v 1.1 2000/01/07 14:50:43 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "Em8CalorHit.hh"
|
||||
|
||||
G4Allocator<Em8CalorHit> Em8CalorHitAllocator;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8CalorHit::Em8CalorHit()
|
||||
{
|
||||
EdepAbs = 0.; TrackLengthAbs = 0.;
|
||||
EdepGap = 0.; TrackLengthGap = 0.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8CalorHit::~Em8CalorHit()
|
||||
{;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8CalorHit::Em8CalorHit(const Em8CalorHit& right)
|
||||
{
|
||||
EdepAbs = right.EdepAbs; TrackLengthAbs = right.TrackLengthAbs;
|
||||
EdepGap = right.EdepGap; TrackLengthGap = right.TrackLengthGap;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
const Em8CalorHit& Em8CalorHit::operator=(const Em8CalorHit& right)
|
||||
{
|
||||
EdepAbs = right.EdepAbs; TrackLengthAbs = right.TrackLengthAbs;
|
||||
EdepGap = right.EdepGap; TrackLengthGap = right.TrackLengthGap;
|
||||
return *this;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
int Em8CalorHit::operator==(const Em8CalorHit& right) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8CalorHit::Print()
|
||||
{;}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: Em8CalorimeterSD.cc,v 1.1 2000/01/07 14:50:44 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "Em8CalorimeterSD.hh"
|
||||
|
||||
#include "Em8CalorHit.hh"
|
||||
#include "Em8DetectorConstruction.hh"
|
||||
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
#include "G4Step.hh"
|
||||
#include "G4VTouchable.hh"
|
||||
#include "G4TouchableHistory.hh"
|
||||
#include "G4SDManager.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8CalorimeterSD::Em8CalorimeterSD(G4String name,
|
||||
Em8DetectorConstruction* det)
|
||||
:G4VSensitiveDetector(name),Detector(det)
|
||||
{
|
||||
collectionName.insert("CalCollection");
|
||||
HitID = new G4int[500];
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8CalorimeterSD::~Em8CalorimeterSD()
|
||||
{
|
||||
delete [] HitID;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8CalorimeterSD::Initialize(G4HCofThisEvent*HCE)
|
||||
{
|
||||
CalCollection = new Em8CalorHitsCollection
|
||||
(SensitiveDetectorName,collectionName[0]);
|
||||
for (G4int j=0;j<1; j++) {HitID[j] = -1;};
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4bool Em8CalorimeterSD::ProcessHits(G4Step* aStep,G4TouchableHistory* ROhist)
|
||||
{
|
||||
G4double edep = aStep->GetTotalEnergyDeposit();
|
||||
|
||||
G4double stepl = 0.;
|
||||
if (aStep->GetTrack()->GetDefinition()->GetPDGCharge() != 0.)
|
||||
stepl = aStep->GetStepLength();
|
||||
|
||||
if ((edep==0.)&&(stepl==0.)) return false;
|
||||
|
||||
G4TouchableHistory* theTouchable
|
||||
= (G4TouchableHistory*)(aStep->GetPreStepPoint()->GetTouchable());
|
||||
|
||||
G4VPhysicalVolume* physVol = theTouchable->GetVolume();
|
||||
//theTouchable->MoveUpHistory();
|
||||
G4int Em8Number = 0 ;
|
||||
|
||||
if (HitID[Em8Number]==-1)
|
||||
{
|
||||
Em8CalorHit* calHit = new Em8CalorHit();
|
||||
if (physVol == Detector->GetAbsorber()) calHit->AddAbs(edep,stepl);
|
||||
HitID[Em8Number] = CalCollection->insert(calHit) - 1;
|
||||
if (verboseLevel>0)
|
||||
G4cout << " New Calorimeter Hit on Em8: " << Em8Number << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (physVol == Detector->GetAbsorber())
|
||||
(*CalCollection)[HitID[Em8Number]]->AddAbs(edep,stepl);
|
||||
if (verboseLevel>0)
|
||||
G4cout << " Energy added to Em8: " << Em8Number << endl;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8CalorimeterSD::EndOfEvent(G4HCofThisEvent* HCE)
|
||||
{
|
||||
static G4int HCID = -1;
|
||||
if(HCID<0)
|
||||
{ HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]); }
|
||||
HCE->AddHitsCollection(HCID,CalCollection);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8CalorimeterSD::clear()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
void Em8CalorimeterSD::PrintAll()
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -0,0 +1,616 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: Em8DetectorConstruction.cc,v 1.1 2000/01/07 14:50:44 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "Em8DetectorConstruction.hh"
|
||||
#include "Em8DetectorMessenger.hh"
|
||||
|
||||
#include "Em8CalorimeterSD.hh"
|
||||
|
||||
#include "G4Material.hh"
|
||||
#include "G4Tubs.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
#include "G4PVPlacement.hh"
|
||||
#include "G4UniformMagField.hh"
|
||||
#include "G4FieldManager.hh"
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4RunManager.hh"
|
||||
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8DetectorConstruction::Em8DetectorConstruction()
|
||||
:solidWorld(NULL),logicWorld(NULL),physiWorld(NULL),
|
||||
solidAbsorber(NULL),logicAbsorber(NULL),physiAbsorber(NULL),
|
||||
AbsorberMaterial(NULL),WorldMaterial(NULL),fRadiatorMat(NULL),
|
||||
magField(NULL),calorimeterSD(NULL),worldchanged(false)
|
||||
{
|
||||
// default parameter values of the calorimeter
|
||||
WorldSizeZ = 8.*cm;
|
||||
WorldSizeR = 2.*cm;
|
||||
|
||||
AbsorberThickness = 10.0*mm;
|
||||
AbsorberRadius = 1.*cm;
|
||||
zAbsorber = 2.*cm ;
|
||||
|
||||
fRadThickness = 20*micrometer ;
|
||||
fGasGap = 500*micrometer ;
|
||||
fFoilNumber = 200 ;
|
||||
|
||||
fDetThickness = 20.0*mm ;
|
||||
fDetLength = 200.0*cm ;
|
||||
fDetGap = 1.0*mm ;
|
||||
fStartR = 40*cm ;
|
||||
fStartZ = 2.0*cm ;
|
||||
fModuleNumber = 1 ;
|
||||
|
||||
// create commands for interactive definition of the calorimeter
|
||||
|
||||
detectorMessenger = new Em8DetectorMessenger(this);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
Em8DetectorConstruction::~Em8DetectorConstruction()
|
||||
{
|
||||
delete detectorMessenger;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4VPhysicalVolume* Em8DetectorConstruction::Construct()
|
||||
{
|
||||
DefineMaterials();
|
||||
return ConstructCalorimeter();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void Em8DetectorConstruction::DefineMaterials()
|
||||
{
|
||||
//This function illustrates the possible ways to define materials
|
||||
|
||||
G4String name, symbol ; //a=mass of a mole;
|
||||
G4double a, z, density ; //z=mean number of protons;
|
||||
G4int iz, n, nel ; //iz=number of protons in an isotope;
|
||||
// n=number of nucleons in an isotope;
|
||||
|
||||
G4int ncomponents, natoms;
|
||||
G4double abundance, fractionmass;
|
||||
G4double temperature, pressure;
|
||||
|
||||
//
|
||||
// define Elements
|
||||
//
|
||||
|
||||
a = 1.01*g/mole;
|
||||
G4Element* elH = new G4Element(name="Hydrogen",symbol="H" , z= 1., a);
|
||||
|
||||
a = 6.01*g/mole;
|
||||
G4Element* elC = new G4Element(name="Carbon", symbol="C", z=6., a);
|
||||
|
||||
a = 14.01*g/mole;
|
||||
G4Element* elN = new G4Element(name="Nitrogen",symbol="N" , z= 7., a);
|
||||
|
||||
a = 16.00*g/mole;
|
||||
G4Element* elO = new G4Element(name="Oxygen" ,symbol="O" , z= 8., a);
|
||||
|
||||
a = 39.948*g/mole;
|
||||
G4Element* elAr = new G4Element(name="Argon", symbol="Ar", z=18., a);
|
||||
|
||||
a = 131.29*g/mole;
|
||||
G4Element* elXe = new G4Element(name="Xenon", symbol="Xe", z=54., a);
|
||||
|
||||
a = 19.00*g/mole;
|
||||
G4Element* elF = new G4Element(name="Fluorine", symbol="F", z=9., a);
|
||||
|
||||
|
||||
//
|
||||
// define simple materials
|
||||
//
|
||||
|
||||
/* ******************************************************************
|
||||
|
||||
density = 1.848*g/cm3;
|
||||
a = 9.01*g/mole;
|
||||
G4Material* Be = new G4Material(name="Beryllium", z=4., a, density);
|
||||
|
||||
density = 2.700*g/cm3;
|
||||
a = 26.98*g/mole;
|
||||
G4Material* Al = new G4Material(name="Aluminium", z=13., a, density);
|
||||
|
||||
density = 1.390*g/cm3;
|
||||
a = 39.95*g/mole;
|
||||
G4Material* lAr = new G4Material(name="liquidArgon", z=18., a, density);
|
||||
|
||||
density = 7.870*g/cm3;
|
||||
a = 55.85*g/mole;
|
||||
G4Material* Fe = new G4Material(name="Iron" , z=26., a, density);
|
||||
|
||||
density = 8.960*g/cm3;
|
||||
a = 63.55*g/mole;
|
||||
G4Material* Cu = new G4Material(name="Copper" , z=29., a, density);
|
||||
|
||||
density = 19.32*g/cm3;
|
||||
a =196.97*g/mole;
|
||||
G4Material* Au = new G4Material(name="Gold" , z=79., a, density);
|
||||
|
||||
density = 11.35*g/cm3;
|
||||
a = 207.19*g/mole;
|
||||
G4Material* Pb = new G4Material(name="Lead" , z=82., a, density);
|
||||
|
||||
//
|
||||
// define a material from elements. case 1: chemical molecule
|
||||
//
|
||||
|
||||
density = 1.000*g/cm3;
|
||||
G4Material* H2O = new G4Material(name="Water", density, ncomponents=2);
|
||||
H2O->AddElement(elH, natoms=2);
|
||||
H2O->AddElement(elO, natoms=1);
|
||||
|
||||
// Polypropelene
|
||||
|
||||
G4Material* CH2 = new G4Material ("Polypropelene" , 0.91*g/cm3, 2);
|
||||
C2H2->AddElement(elH,2);
|
||||
C2H2->AddElement(elC,1);
|
||||
|
||||
// Kapton (polyimide)
|
||||
|
||||
density = 1.39*g/cm3;
|
||||
G4Material* Kapton = new G4Material(name="Kapton", density, nel=3);
|
||||
Kapton->AddElement(elO,2);
|
||||
Kapton->AddElement(elC,5);
|
||||
Kapton->AddElement(elH,4);
|
||||
|
||||
// Silicon as detector material
|
||||
|
||||
density = 2.330*g/cm3;
|
||||
a = 28.09*g/mole;
|
||||
G4Material* Si = new G4Material(name="Silicon", z=14., a, density);
|
||||
|
||||
// Carbon dioxide
|
||||
|
||||
density = 1.977*mg/cm3;
|
||||
G4Material* CO2 = new G4Material(name="CO2", density, nel=2,
|
||||
kStateGas,273.15*kelvin,1.*atmosphere);
|
||||
CO2->AddElement(elC,1);
|
||||
CO2->AddElement(elO,2);
|
||||
|
||||
G4double TRT_Xe_density = 5.485*mg/cm3;
|
||||
G4Material* TRT_Xe = new G4Material(name="TRT_Xe", TRT_Xe_density, nel=1,
|
||||
kStateGas,293.15*kelvin,1.*atmosphere);
|
||||
TRT_Xe->AddElement(elXe,1);
|
||||
|
||||
G4double TRT_CO2_density = 1.842*mg/cm3;
|
||||
G4Material* TRT_CO2 = new G4Material(name="TRT_CO2", TRT_CO2_density, nel=2,
|
||||
kStateGas,293.15*kelvin,1.*atmosphere);
|
||||
TRT_CO2->AddElement(elC,1);
|
||||
TRT_CO2->AddElement(elO,2);
|
||||
|
||||
G4double TRT_CF4_density = 3.9*mg/cm3;
|
||||
G4Material* TRT_CF4 = new G4Material(name="TRT_CF4", TRT_CF4_density, nel=2,
|
||||
kStateGas,293.15*kelvin,1.*atmosphere);
|
||||
TRT_CF4->AddElement(elC,1);
|
||||
TRT_CF4->AddElement(elF,4);
|
||||
|
||||
// ATLAS TRT straw tube gas mixture (20 C, 1 atm)
|
||||
|
||||
G4double XeCO2CF4_density = 4.76*mg/cm3;
|
||||
G4Material* XeCO2CF4 = new G4Material(name="XeCO2CF4", XeCO2CF4_density,
|
||||
ncomponents=3,
|
||||
kStateGas,293.15*kelvin,1.*atmosphere);
|
||||
XeCO2CF4->AddMaterial(TRT_Xe,0.807);
|
||||
XeCO2CF4->AddMaterial(TRT_CO2,0.039);
|
||||
XeCO2CF4->AddMaterial(TRT_CF4,0.154);
|
||||
|
||||
// TRT_CH2
|
||||
|
||||
density = 0.935*g/cm3;
|
||||
G4Material* TRT_CH2 = new G4Material(name="TRT_CH2",density, nel=2);
|
||||
TRT_CH2->AddElement(elC,1);
|
||||
TRT_CH2->AddElement(elH,2);
|
||||
|
||||
// Radiator
|
||||
|
||||
density = 0.059*g/cm3;
|
||||
G4Material* Radiator = new G4Material(name="Radiator",density, nel=2);
|
||||
Radiator->AddElement(elC,1);
|
||||
Radiator->AddElement(elH,2);
|
||||
|
||||
// Carbon Fiber
|
||||
|
||||
density = 0.145*g/cm3;
|
||||
G4Material* CarbonFiber = new G4Material(name="CarbonFiber",density, nel=1);
|
||||
CarbonFiber->AddElement(elC,1);
|
||||
|
||||
density = 1.290*mg/cm3; // old air from elements
|
||||
G4Material* air = new G4Material(name="air" , density, ncomponents=2);
|
||||
Air->AddElement(elN, fractionmass=0.7);
|
||||
Air->AddElement(elO, fractionmass=0.3);
|
||||
|
||||
|
||||
density = 1.25053*mg/cm3 ; // STP
|
||||
a = 14.01*g/mole ; // get atomic weight !!!
|
||||
// a = 28.016*g/mole;
|
||||
G4Material* N2 = new G4Material(name="Nitrogen", z= 7.,a,density) ;
|
||||
|
||||
density = 1.25053*mg/cm3 ; // STP
|
||||
G4Material* anotherN2 = new G4Material(name="anotherN2", density,ncomponents=2);
|
||||
anotherN2->AddElement(elN, 1);
|
||||
anotherN2->AddElement(elN, 1);
|
||||
|
||||
************************ */
|
||||
|
||||
// Dry air (average composition)
|
||||
|
||||
density = 1.7836*mg/cm3 ; // STP
|
||||
G4Material* Argon = new G4Material(name="Argon" , density, ncomponents=1);
|
||||
Argon->AddElement(elAr, 1);
|
||||
|
||||
/* *********************
|
||||
|
||||
density = 1.25053*mg/cm3 ; // STP
|
||||
G4Material* Nitrogen = new G4Material(name="N2" , density, ncomponents=1);
|
||||
Nitrogen->AddElement(elN, 2);
|
||||
|
||||
density = 1.4289*mg/cm3 ; // STP
|
||||
G4Material* Oxygen = new G4Material(name="O2" , density, ncomponents=1);
|
||||
Oxygen->AddElement(elO, 2);
|
||||
|
||||
|
||||
density = 1.2928*mg/cm3 ; // STP
|
||||
G4Material* Air = new G4Material(name="Air" , density, ncomponents=3);
|
||||
Air->AddMaterial( Nitrogen, fractionmass = 0.7557 ) ;
|
||||
Air->AddMaterial( Oxygen, fractionmass = 0.2315 ) ;
|
||||
Air->AddMaterial( Argon, fractionmass = 0.0128 ) ;
|
||||
|
||||
*********************************** */
|
||||
|
||||
// Xenon as detector gas, STP
|
||||
|
||||
density = 5.858*mg/cm3 ;
|
||||
a = 131.29*g/mole ;
|
||||
G4Material* Xe = new G4Material(name="Xenon",z=54., a, density );
|
||||
|
||||
/* **************
|
||||
|
||||
density = 1.977*mg/cm3;
|
||||
G4Material* CarbonDioxide = new G4Material(name="CO2", density, nel=2);
|
||||
CarbonDioxide->AddElement(elC,1);
|
||||
CarbonDioxide->AddElement(elO,2);
|
||||
|
||||
// 80% Ar + 20% CO2, STP
|
||||
|
||||
density = 1.8223*mg/cm3 ;
|
||||
G4Material* Ar_80CO2_20 = new G4Material(name="ArCO2" , density, ncomponents=2);
|
||||
Ar_80CO2_20->AddMaterial( Argon, fractionmass = 0.783 ) ;
|
||||
Ar_80CO2_20->AddMaterial( CarbonDioxide, fractionmass = 0.217 ) ;
|
||||
|
||||
// 80% Xe + 20% CO2, STP
|
||||
|
||||
density = 5.0818*mg/cm3 ;
|
||||
G4Material* Xe_80CO2_20 = new G4Material(name="XeCO2" , density, ncomponents=2);
|
||||
Xe_80CO2_20->AddMaterial( Xe, fractionmass = 0.922 ) ;
|
||||
Xe_80CO2_20->AddMaterial( CarbonDioxide, fractionmass = 0.078 ) ;
|
||||
|
||||
*********** */
|
||||
|
||||
G4cout << *(G4Material::GetMaterialTable()) << endl;
|
||||
|
||||
//default materials of the calorimeter
|
||||
|
||||
// fRadiatorMat = CH2 ;
|
||||
|
||||
AbsorberMaterial = Xe ; // Xe_80CO2_20 ; // Argon ; // Ar_80CO2_20 ;
|
||||
WorldMaterial = Argon ;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4VPhysicalVolume* Em8DetectorConstruction::ConstructCalorimeter()
|
||||
{
|
||||
G4int i, j ;
|
||||
G4double zModule, zRadiator, rModule, rRadiator ;
|
||||
|
||||
// complete the Calor parameters definition and Print
|
||||
|
||||
ComputeCalorParameters();
|
||||
PrintCalorParameters();
|
||||
|
||||
// World
|
||||
|
||||
if(solidWorld) delete solidWorld ;
|
||||
if(logicWorld) delete logicWorld ;
|
||||
if(physiWorld) delete physiWorld ;
|
||||
|
||||
solidWorld = new G4Tubs("World", //its name
|
||||
0.,WorldSizeR,WorldSizeZ/2.,0.,twopi) ;//its size
|
||||
|
||||
logicWorld = new G4LogicalVolume(solidWorld, //its solid
|
||||
WorldMaterial, //its material
|
||||
"World"); //its name
|
||||
|
||||
physiWorld = new G4PVPlacement(0, //no rotation
|
||||
G4ThreeVector(), //at (0,0,0)
|
||||
"World", //its name
|
||||
logicWorld, //its logical volume
|
||||
NULL, //its mother volume
|
||||
false, //no boolean operation
|
||||
0); //copy number
|
||||
|
||||
/* *******************************************************************
|
||||
|
||||
fSolidRadSlice = new G4Tubs("RadSlice",0.0, // fStartR,fWorldRadius
|
||||
AbsorberRadius,0.5*fRadThickness,0.0,360*deg);
|
||||
|
||||
fLogicRadSlice = new G4LogicalVolume(fSolidRadSlice,fRadiatorMat,
|
||||
"RadSlice",0,0,0);
|
||||
|
||||
fPhysicRadSlice = new G4PVPlacement(0,
|
||||
G4ThreeVector(0.,0.,fStartZ+1.2*fDetThickness),
|
||||
"RadSlice",fLogicRadSlice,
|
||||
physiWorld,false,0);
|
||||
|
||||
for(i=1;i<=fModuleNumber;i++)
|
||||
{
|
||||
// rModule = fStartR + fDetThickness + fDetGap +
|
||||
// (i-1)*(fFoilNumber*(fRadThickness + fGasGap) +
|
||||
// fDetThickness + fDetGap) ;
|
||||
|
||||
zModule = fStartZ + fDetThickness + fDetGap +
|
||||
(i-1)*(fFoilNumber*(fRadThickness + fGasGap) +
|
||||
fDetThickness + fDetGap) ;
|
||||
|
||||
|
||||
for(j=1;j<=fFoilNumber;j++)
|
||||
{
|
||||
// rRadiator = rModule + j*(fRadThickness + fGasGap) ;
|
||||
|
||||
zRadiator = zModule + j*(fRadThickness + fGasGap) ;
|
||||
|
||||
// RadRing
|
||||
|
||||
|
||||
// fSolidRadRing = new G4Tubs("RadRing",rRadiator,
|
||||
// rRadiator + fRadThickness,
|
||||
// fDetLength,0.0,360*deg ) ;
|
||||
|
||||
// fLogicRadRing = new G4LogicalVolume(fSolidRadRing,fRadiatorMat,
|
||||
// "radRing",0,0,0);
|
||||
|
||||
// fPhysicRadRing = new G4PVPlacement(0,G4ThreeVector(),
|
||||
// "RadRing",fLogicRadRing,
|
||||
// physiWorld,false,j) ;
|
||||
|
||||
// Slice
|
||||
|
||||
fPhysicRadSlice = new G4PVPlacement(0,G4ThreeVector(0.,0.,zRadiator),
|
||||
"RadSlice",fLogicRadSlice,
|
||||
physiWorld,false,j);
|
||||
}
|
||||
// fPhysicDetSlice = new G4PVPlacement(0,
|
||||
// G4ThreeVector(0.,0.,zRadiator+
|
||||
// fDetGap +0.5*fDetThickness),"DetSlice",
|
||||
// fLogicDetSlice,physiWorld,false,i);
|
||||
}
|
||||
|
||||
****************************************** */
|
||||
|
||||
// Absorber
|
||||
|
||||
if (AbsorberThickness > 0.)
|
||||
{
|
||||
if(solidAbsorber) delete solidAbsorber ;
|
||||
if(logicAbsorber) delete logicAbsorber ;
|
||||
if(physiAbsorber) delete physiAbsorber ;
|
||||
|
||||
solidAbsorber = new G4Tubs("Absorber", //its name
|
||||
0.,AbsorberRadius,AbsorberThickness/2.,0.,twopi);
|
||||
|
||||
logicAbsorber = new G4LogicalVolume(solidAbsorber, // its solid
|
||||
AbsorberMaterial, // its material
|
||||
"Absorber"); // its name
|
||||
|
||||
physiAbsorber = new G4PVPlacement(0, // no rotation
|
||||
G4ThreeVector(0.,0.,zAbsorber), // its position
|
||||
"Absorber", // its name
|
||||
logicAbsorber, // its logical volume
|
||||
physiWorld, // its mother
|
||||
false, // no boulean operat
|
||||
0); // copy number
|
||||
|
||||
}
|
||||
|
||||
// Sensitive Detectors: Absorber
|
||||
|
||||
G4SDManager* SDman = G4SDManager::GetSDMpointer();
|
||||
|
||||
if(!calorimeterSD)
|
||||
{
|
||||
calorimeterSD = new Em8CalorimeterSD("CalorSD",this);
|
||||
SDman->AddNewDetector( calorimeterSD );
|
||||
}
|
||||
if (logicAbsorber) logicAbsorber->SetSensitiveDetector(calorimeterSD);
|
||||
|
||||
//always return the physical World
|
||||
|
||||
return physiWorld;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void Em8DetectorConstruction::PrintCalorParameters()
|
||||
{
|
||||
G4cout << "\n The WORLD is made of "
|
||||
<< WorldSizeZ/mm << "mm of " << WorldMaterial->GetName() ;
|
||||
G4cout << ", the transverse size (R) of the world is " << WorldSizeR/mm << " mm. " << endl;
|
||||
G4cout << " The ABSORBER is made of "
|
||||
<< AbsorberThickness/mm << "mm of " << AbsorberMaterial->GetName() ;
|
||||
G4cout << ", the transverse size (R) is " << AbsorberRadius/mm << " mm. " << endl;
|
||||
G4cout << " Z position of the (middle of the) absorber " << zAbsorber/mm << " mm." << endl;
|
||||
G4cout << endl;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void Em8DetectorConstruction::SetAbsorberMaterial(G4String materialChoice)
|
||||
{
|
||||
// get the pointer to the material table
|
||||
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
|
||||
|
||||
// search the material by its name
|
||||
G4Material* pttoMaterial;
|
||||
for (G4int J=0 ; J<theMaterialTable->length() ; J++)
|
||||
{ pttoMaterial = (*theMaterialTable)(J);
|
||||
if(pttoMaterial->GetName() == materialChoice)
|
||||
{AbsorberMaterial = pttoMaterial;
|
||||
logicAbsorber->SetMaterial(pttoMaterial);
|
||||
// PrintCalorParameters();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void Em8DetectorConstruction::SetWorldMaterial(G4String materialChoice)
|
||||
{
|
||||
// get the pointer to the material table
|
||||
const G4MaterialTable* theMaterialTable = G4Material::GetMaterialTable();
|
||||
|
||||
// search the material by its name
|
||||
G4Material* pttoMaterial;
|
||||
for (G4int J=0 ; J<theMaterialTable->length() ; J++)
|
||||
{ pttoMaterial = (*theMaterialTable)(J);
|
||||
if(pttoMaterial->GetName() == materialChoice)
|
||||
{WorldMaterial = pttoMaterial;
|
||||
logicWorld->SetMaterial(pttoMaterial);
|
||||
// PrintCalorParameters();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void Em8DetectorConstruction::SetAbsorberThickness(G4double val)
|
||||
{
|
||||
// change Absorber thickness and recompute the calorimeter parameters
|
||||
AbsorberThickness = val;
|
||||
ComputeCalorParameters();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void Em8DetectorConstruction::SetAbsorberRadius(G4double val)
|
||||
{
|
||||
// change the transverse size and recompute the calorimeter parameters
|
||||
AbsorberRadius = val;
|
||||
ComputeCalorParameters();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void Em8DetectorConstruction::SetWorldSizeZ(G4double val)
|
||||
{
|
||||
worldchanged=true;
|
||||
WorldSizeZ = val;
|
||||
ComputeCalorParameters();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void Em8DetectorConstruction::SetWorldSizeR(G4double val)
|
||||
{
|
||||
worldchanged=true;
|
||||
WorldSizeR = val;
|
||||
ComputeCalorParameters();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void Em8DetectorConstruction::SetAbsorberZpos(G4double val)
|
||||
{
|
||||
zAbsorber = val;
|
||||
ComputeCalorParameters();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void Em8DetectorConstruction::SetMagField(G4double fieldValue)
|
||||
{
|
||||
//apply a global uniform magnetic field along X axis
|
||||
|
||||
/* *********************************************************
|
||||
|
||||
G4FieldManager* fieldMgr
|
||||
= G4TransportationManager::GetTransportationManager()->GetFieldManager();
|
||||
|
||||
if(magField) delete magField; //delete the existing magn field
|
||||
|
||||
if(fieldValue!=0.) // create a new one if non nul
|
||||
{
|
||||
magField = new G4UniformMagField(G4ThreeVector(fieldValue,0.,0.));
|
||||
fieldMgr->SetDetectorField(magField);
|
||||
fieldMgr->CreateChordFinder(magField);
|
||||
}
|
||||
else
|
||||
{
|
||||
magField = NULL;
|
||||
fieldMgr->SetDetectorField(magField);
|
||||
}
|
||||
|
||||
*************************************************************** */
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void Em8DetectorConstruction::UpdateGeometry()
|
||||
{
|
||||
G4RunManager::GetRunManager()->DefineWorldVolume(ConstructCalorimeter());
|
||||
}
|
||||
|
||||
//
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -0,0 +1,143 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: Em8DetectorMessenger.cc,v 1.1 2000/01/07 14:50:44 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "Em8DetectorMessenger.hh"
|
||||
|
||||
#include "Em8DetectorConstruction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8DetectorMessenger::Em8DetectorMessenger(Em8DetectorConstruction * Em8Det)
|
||||
:Em8Detector(Em8Det)
|
||||
{
|
||||
Em8detDir = new G4UIdirectory("/calor/");
|
||||
Em8detDir->SetGuidance("Em8 detector control.");
|
||||
|
||||
AbsMaterCmd = new G4UIcmdWithAString("/calor/setAbsMat",this);
|
||||
AbsMaterCmd->SetGuidance("Select Material of the Absorber.");
|
||||
AbsMaterCmd->SetParameterName("choice",true);
|
||||
AbsMaterCmd->SetDefaultValue("Lead");
|
||||
AbsMaterCmd->AvailableForStates(Idle);
|
||||
|
||||
WorldMaterCmd = new G4UIcmdWithAString("/calor/setWorldMat",this);
|
||||
WorldMaterCmd->SetGuidance("Select Material of the World.");
|
||||
WorldMaterCmd->SetParameterName("wchoice",true);
|
||||
WorldMaterCmd->SetDefaultValue("Air");
|
||||
WorldMaterCmd->AvailableForStates(Idle);
|
||||
|
||||
AbsThickCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsThick",this);
|
||||
AbsThickCmd->SetGuidance("Set Thickness of the Absorber");
|
||||
AbsThickCmd->SetParameterName("SizeZ",false,false);
|
||||
AbsThickCmd->SetDefaultUnit("mm");
|
||||
AbsThickCmd->SetRange("SizeZ>0.");
|
||||
AbsThickCmd->AvailableForStates(Idle);
|
||||
|
||||
AbsRadCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsRad",this);
|
||||
AbsRadCmd->SetGuidance("Set radius of the Absorber");
|
||||
AbsRadCmd->SetParameterName("SizeR",false,false);
|
||||
AbsRadCmd->SetDefaultUnit("mm");
|
||||
AbsRadCmd->SetRange("SizeR>0.");
|
||||
AbsRadCmd->AvailableForStates(Idle);
|
||||
|
||||
AbsZposCmd = new G4UIcmdWithADoubleAndUnit("/calor/setAbsZpos",this);
|
||||
AbsZposCmd->SetGuidance("Set Z pos. of the Absorber");
|
||||
AbsZposCmd->SetParameterName("Zpos",false,false);
|
||||
AbsZposCmd->SetDefaultUnit("mm");
|
||||
AbsZposCmd->AvailableForStates(Idle);
|
||||
|
||||
WorldZCmd = new G4UIcmdWithADoubleAndUnit("/calor/setWorldZ",this);
|
||||
WorldZCmd->SetGuidance("Set Z size of the World");
|
||||
WorldZCmd->SetParameterName("WSizeZ",false,false);
|
||||
WorldZCmd->SetDefaultUnit("mm");
|
||||
WorldZCmd->SetRange("WSizeZ>0.");
|
||||
WorldZCmd->AvailableForStates(Idle);
|
||||
|
||||
WorldRCmd = new G4UIcmdWithADoubleAndUnit("/calor/setWorldR",this);
|
||||
WorldRCmd->SetGuidance("Set R size of the World");
|
||||
WorldRCmd->SetParameterName("WSizeR",false,false);
|
||||
WorldRCmd->SetDefaultUnit("mm");
|
||||
WorldRCmd->SetRange("WSizeR>0.");
|
||||
WorldRCmd->AvailableForStates(Idle);
|
||||
|
||||
UpdateCmd = new G4UIcmdWithoutParameter("/calor/update",this);
|
||||
UpdateCmd->SetGuidance("Update calorimeter geometry.");
|
||||
UpdateCmd->SetGuidance("This command MUST be applied before \"beamOn\" ");
|
||||
UpdateCmd->SetGuidance("if you changed geometrical value(s).");
|
||||
UpdateCmd->AvailableForStates(Idle);
|
||||
|
||||
MagFieldCmd = new G4UIcmdWithADoubleAndUnit("/calor/setField",this);
|
||||
MagFieldCmd->SetGuidance("Define magnetic field.");
|
||||
MagFieldCmd->SetGuidance("Magnetic field will be in Z direction.");
|
||||
MagFieldCmd->SetParameterName("Bz",false,false);
|
||||
MagFieldCmd->SetDefaultUnit("tesla");
|
||||
MagFieldCmd->AvailableForStates(Idle);
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8DetectorMessenger::~Em8DetectorMessenger()
|
||||
{
|
||||
delete AbsMaterCmd;
|
||||
delete AbsThickCmd;
|
||||
delete AbsRadCmd;
|
||||
delete AbsZposCmd;
|
||||
delete WorldMaterCmd;
|
||||
delete WorldZCmd;
|
||||
delete WorldRCmd;
|
||||
delete UpdateCmd;
|
||||
delete MagFieldCmd;
|
||||
delete Em8detDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8DetectorMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
{
|
||||
if( command == AbsMaterCmd )
|
||||
{ Em8Detector->SetAbsorberMaterial(newValue);}
|
||||
|
||||
if( command == WorldMaterCmd )
|
||||
{ Em8Detector->SetWorldMaterial(newValue);}
|
||||
|
||||
if( command == AbsThickCmd )
|
||||
{ Em8Detector->SetAbsorberThickness(AbsThickCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == AbsRadCmd )
|
||||
{ Em8Detector->SetAbsorberRadius(AbsRadCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == AbsZposCmd )
|
||||
{ Em8Detector->SetAbsorberZpos(AbsZposCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == WorldZCmd )
|
||||
{ Em8Detector->SetWorldSizeZ(WorldZCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == WorldRCmd )
|
||||
{ Em8Detector->SetWorldSizeR(WorldRCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
if( command == UpdateCmd )
|
||||
{ Em8Detector->UpdateGeometry(); }
|
||||
|
||||
if( command == MagFieldCmd )
|
||||
{ Em8Detector->SetMagField(MagFieldCmd->GetNewDoubleValue(newValue));}
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -0,0 +1,233 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: Em8EventAction.cc,v 1.1 2000/01/07 14:50:45 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "Em8EventAction.hh"
|
||||
|
||||
#include "Em8RunAction.hh"
|
||||
|
||||
#include "Em8CalorHit.hh"
|
||||
#include "Em8EventActionMessenger.hh"
|
||||
|
||||
#include "g4rw/tvordvec.h"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "G4HCofThisEvent.hh"
|
||||
#include "G4VHitsCollection.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4UImanager.hh"
|
||||
#include "G4TrajectoryContainer.hh"
|
||||
#include "G4Trajectory.hh"
|
||||
#include "G4VVisManager.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8EventAction::Em8EventAction(Em8RunAction* Em8RA)
|
||||
:calorimeterCollID(-1),eventMessenger(NULL),
|
||||
verboselevel(0),runaction(Em8RA),drawFlag("all"),printModulo(10000)
|
||||
{
|
||||
eventMessenger = new Em8EventActionMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8EventAction::~Em8EventAction()
|
||||
{
|
||||
delete eventMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8EventAction::BeginOfEventAction(const G4Event* evt)
|
||||
{
|
||||
G4int evtNb = evt->GetEventID();
|
||||
if (evtNb%printModulo == 0)
|
||||
G4cout << "\n---> Begin of Event: " << evtNb << endl;
|
||||
|
||||
if(verboselevel>1)
|
||||
G4cout << "<<< Event " << evtNb << " started." << endl;
|
||||
|
||||
if (calorimeterCollID==-1)
|
||||
{
|
||||
G4SDManager * SDman = G4SDManager::GetSDMpointer();
|
||||
calorimeterCollID = SDman->GetCollectionID("CalCollection");
|
||||
}
|
||||
|
||||
nstep = 0. ;
|
||||
nstepCharged = 0. ;
|
||||
nstepNeutral = 0. ;
|
||||
Nch = 0. ;
|
||||
Nne = 0. ;
|
||||
NE=0.;
|
||||
NP=0.;
|
||||
Transmitted=0.;
|
||||
Reflected =0.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8EventAction::EndOfEventAction(const G4Event* evt)
|
||||
{
|
||||
G4HCofThisEvent* HCE = evt->GetHCofThisEvent();
|
||||
Em8CalorHitsCollection* CHC = NULL;
|
||||
if (HCE)
|
||||
CHC = (Em8CalorHitsCollection*)(HCE->GetHC(calorimeterCollID));
|
||||
|
||||
if (CHC)
|
||||
{
|
||||
int n_hit = CHC->entries();
|
||||
// if(verboselevel==2)
|
||||
// G4cout << " " << n_hit
|
||||
// << " hits are stored in Em8CalorHitsCollection." << endl;
|
||||
|
||||
G4double totEAbs=0, totLAbs=0;
|
||||
for (int i=0;i<n_hit;i++)
|
||||
{ totEAbs += (*CHC)[i]->GetEdepAbs();
|
||||
totLAbs += (*CHC)[i]->GetTrakAbs();
|
||||
}
|
||||
if(verboselevel==2)
|
||||
G4cout
|
||||
<< " Absorber: total energy: " << setw(7) <<
|
||||
G4BestUnit(totEAbs,"Energy")
|
||||
<< " total track length: " << setw(7) <<
|
||||
G4BestUnit(totLAbs,"Length")
|
||||
<< endl;
|
||||
|
||||
// count event, add deposits to the sum ...
|
||||
runaction->CountEvent() ;
|
||||
runaction->AddTrackLength(totLAbs) ;
|
||||
runaction->AddnStepsCharged(nstepCharged) ;
|
||||
runaction->AddnStepsNeutral(nstepNeutral) ;
|
||||
if(verboselevel==2)
|
||||
G4cout << " Ncharged=" << Nch << " , Nneutral=" << Nne << endl;
|
||||
runaction->CountParticles(Nch,Nne);
|
||||
runaction->AddEP(NE,NP);
|
||||
runaction->AddTrRef(Transmitted,Reflected) ;
|
||||
runaction->AddEdeps(totEAbs) ;
|
||||
runaction->FillEn(totEAbs) ;
|
||||
|
||||
nstep=nstepCharged+nstepNeutral ;
|
||||
runaction->FillNbOfSteps(nstep);
|
||||
}
|
||||
|
||||
G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance();
|
||||
|
||||
if(pVVisManager)
|
||||
{
|
||||
G4TrajectoryContainer* trajectoryContainer = evt->GetTrajectoryContainer();
|
||||
G4int n_trajectories = 0;
|
||||
if (trajectoryContainer) n_trajectories = trajectoryContainer->entries();
|
||||
for(G4int i=0; i<n_trajectories; i++)
|
||||
{ G4Trajectory* trj = (G4Trajectory *)((*(evt->GetTrajectoryContainer()))[i]);
|
||||
if (drawFlag == "all") trj->DrawTrajectory(50);
|
||||
else if ((drawFlag == "charged")&&(trj->GetCharge() != 0.))
|
||||
trj->DrawTrajectory(50);
|
||||
}
|
||||
}
|
||||
|
||||
if(verboselevel>0)
|
||||
G4cout << "<<< Event " << evt->GetEventID() << " ended." << endl;
|
||||
|
||||
|
||||
//save rndm status
|
||||
if (runaction->GetRndmFreq() == 2)
|
||||
{
|
||||
HepRandom::saveEngineStatus("endOfEvent.rndm");
|
||||
G4int evtNb = evt->GetEventID();
|
||||
if (evtNb%printModulo == 0)
|
||||
{
|
||||
G4cout << "\n---> End of Event: " << evtNb << endl;
|
||||
HepRandom::showEngineStatus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4int Em8EventAction::GetEventno()
|
||||
{
|
||||
G4int evno = fpEventManager->GetConstCurrentEvent()->GetEventID() ;
|
||||
return evno ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8EventAction::setEventVerbose(G4int level)
|
||||
{
|
||||
verboselevel = level ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8EventAction::CountStepsCharged()
|
||||
{
|
||||
nstepCharged += 1. ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8EventAction::CountStepsNeutral()
|
||||
{
|
||||
nstepNeutral += 1. ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8EventAction::AddCharged()
|
||||
{
|
||||
Nch += 1.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8EventAction::AddNeutral()
|
||||
{
|
||||
Nne += 1.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8EventAction::AddE()
|
||||
{
|
||||
NE += 1.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8EventAction::AddP()
|
||||
{
|
||||
NP += 1.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8EventAction::SetTr()
|
||||
{
|
||||
Transmitted = 1.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8EventAction::SetRef()
|
||||
{
|
||||
Reflected = 1.;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: Em8EventActionMessenger.cc,v 1.1 2000/01/07 14:50:45 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "Em8EventActionMessenger.hh"
|
||||
|
||||
#include "Em8EventAction.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8EventActionMessenger::Em8EventActionMessenger(Em8EventAction* EvAct)
|
||||
:eventAction(EvAct)
|
||||
{
|
||||
setVerboseCmd = new G4UIcmdWithAnInteger("/event/setverbose",this);
|
||||
setVerboseCmd->SetGuidance("Set verbose level ." );
|
||||
setVerboseCmd->SetParameterName("level",true);
|
||||
setVerboseCmd->SetDefaultValue(0);
|
||||
|
||||
DrawCmd = new G4UIcmdWithAString("/event/drawTracks",this);
|
||||
DrawCmd->SetGuidance("Draw the tracks in the event");
|
||||
DrawCmd->SetGuidance(" Choice : none,charged, all");
|
||||
DrawCmd->SetParameterName("choice",true);
|
||||
DrawCmd->SetDefaultValue("all");
|
||||
DrawCmd->SetCandidates("none charged all");
|
||||
DrawCmd->AvailableForStates(Idle);
|
||||
|
||||
PrintCmd = new G4UIcmdWithAnInteger("/event/printModulo",this);
|
||||
PrintCmd->SetGuidance("Print events modulo n");
|
||||
PrintCmd->SetParameterName("EventNb",false);
|
||||
PrintCmd->SetRange("EventNb>0");
|
||||
PrintCmd->AvailableForStates(Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8EventActionMessenger::~Em8EventActionMessenger()
|
||||
{
|
||||
delete setVerboseCmd;
|
||||
delete DrawCmd;
|
||||
delete PrintCmd;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8EventActionMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
{
|
||||
if(command == setVerboseCmd)
|
||||
{eventAction->setEventVerbose(setVerboseCmd->GetNewIntValue(newValue));}
|
||||
|
||||
if(command == DrawCmd)
|
||||
{eventAction->SetDrawFlag(newValue);}
|
||||
|
||||
if(command == PrintCmd)
|
||||
{eventAction->SetPrintModulo(PrintCmd->GetNewIntValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
@@ -0,0 +1,446 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: Em8PhysicsList.cc,v 1.1 2000/01/07 14:50:45 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
|
||||
|
||||
#include "Em8PhysicsList.hh"
|
||||
#include "Em8DetectorConstruction.hh"
|
||||
#include "Em8PhysicsListMessenger.hh"
|
||||
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleWithCuts.hh"
|
||||
#include "G4ProcessManager.hh"
|
||||
#include "G4ProcessVector.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4Material.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
#include "G4UnitsTable.hh"
|
||||
#include "G4Timer.hh"
|
||||
#include "G4ios.hh"
|
||||
#include <iomanip.h>
|
||||
|
||||
/////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
Em8PhysicsList::Em8PhysicsList(Em8DetectorConstruction* p)
|
||||
: G4VUserPhysicsList(),
|
||||
thePhotoElectricEffect(NULL),theComptonScattering(NULL),
|
||||
theGammaConversion(NULL),
|
||||
theeminusMultipleScattering(NULL),theeminusIonisation(NULL),
|
||||
theeminusBremsstrahlung(NULL),
|
||||
theeplusMultipleScattering(NULL),theeplusIonisation(NULL),
|
||||
theeplusBremsstrahlung(NULL),
|
||||
theeplusAnnihilation(NULL),
|
||||
theeminusStepCut(NULL),theeplusStepCut(NULL),
|
||||
MaxChargedStep(DBL_MAX)
|
||||
{
|
||||
pDet = p;
|
||||
|
||||
defaultCutValue = 1.000*mm ;
|
||||
|
||||
cutForGamma = defaultCutValue ;
|
||||
cutForElectron = defaultCutValue ;
|
||||
cutForProton = defaultCutValue ;
|
||||
|
||||
SetVerboseLevel(1);
|
||||
physicsListMessenger = new Em8PhysicsListMessenger(this);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
Em8PhysicsList::~Em8PhysicsList()
|
||||
{
|
||||
delete physicsListMessenger;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void Em8PhysicsList::ConstructParticle()
|
||||
{
|
||||
// In this method, static member functions should be called
|
||||
// for all particles which you want to use.
|
||||
// This ensures that objects of these particle types will be
|
||||
// created in the program.
|
||||
|
||||
ConstructBosons();
|
||||
ConstructLeptons();
|
||||
ConstructMesons();
|
||||
ConstructBarions();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void Em8PhysicsList::ConstructBosons()
|
||||
{
|
||||
// gamma
|
||||
G4Gamma::GammaDefinition();
|
||||
}
|
||||
|
||||
void Em8PhysicsList::ConstructLeptons()
|
||||
{
|
||||
// leptons
|
||||
|
||||
G4Electron::ElectronDefinition();
|
||||
G4Positron::PositronDefinition();
|
||||
G4MuonPlus::MuonPlusDefinition();
|
||||
G4MuonMinus::MuonMinusDefinition();
|
||||
|
||||
G4NeutrinoE::NeutrinoEDefinition();
|
||||
G4AntiNeutrinoE::AntiNeutrinoEDefinition();
|
||||
G4NeutrinoMu::NeutrinoMuDefinition();
|
||||
G4AntiNeutrinoMu::AntiNeutrinoMuDefinition();
|
||||
}
|
||||
|
||||
void Em8PhysicsList::ConstructMesons()
|
||||
{
|
||||
// mesons
|
||||
|
||||
G4PionPlus::PionPlusDefinition();
|
||||
G4PionMinus::PionMinusDefinition();
|
||||
G4PionZero::PionZeroDefinition();
|
||||
G4KaonPlus::KaonPlusDefinition();
|
||||
G4KaonMinus::KaonMinusDefinition();
|
||||
}
|
||||
|
||||
|
||||
void Em8PhysicsList::ConstructBarions()
|
||||
{
|
||||
// barions
|
||||
|
||||
G4Proton::ProtonDefinition();
|
||||
G4AntiProton::AntiProtonDefinition();
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
void Em8PhysicsList::ConstructProcess()
|
||||
{
|
||||
AddTransportation();
|
||||
ConstructEM();
|
||||
ConstructGeneral();
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
#include "G4ComptonScattering.hh"
|
||||
#include "G4GammaConversion.hh"
|
||||
#include "G4PhotoElectricEffect.hh"
|
||||
|
||||
#include "G4MultipleScattering.hh"
|
||||
|
||||
#include "G4eIonisation.hh"
|
||||
#include "G4eBremsstrahlung.hh"
|
||||
#include "G4eplusAnnihilation.hh"
|
||||
|
||||
#include "G4MuIonisation.hh"
|
||||
#include "G4MuBremsstrahlung.hh"
|
||||
#include "G4MuPairProduction.hh"
|
||||
|
||||
#include "G4hIonisation.hh"
|
||||
#include "G4PAIonisation.hh"
|
||||
#include "G4ForwardXrayTR.hh"
|
||||
|
||||
#include "Em8StepCut.hh"
|
||||
|
||||
#include "G4IonisationByLogicalVolume.hh"
|
||||
|
||||
void Em8PhysicsList::ConstructEM()
|
||||
{
|
||||
theParticleIterator->reset();
|
||||
while( (*theParticleIterator)() )
|
||||
{
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
G4String particleName = particle->GetParticleName();
|
||||
|
||||
if (particleName == "gamma")
|
||||
{
|
||||
// Construct processes for gamma
|
||||
|
||||
thePhotoElectricEffect = new G4PhotoElectricEffect();
|
||||
theComptonScattering = new G4ComptonScattering();
|
||||
theGammaConversion = new G4GammaConversion();
|
||||
|
||||
pmanager->AddDiscreteProcess(thePhotoElectricEffect);
|
||||
pmanager->AddDiscreteProcess(theComptonScattering);
|
||||
|
||||
pmanager->AddDiscreteProcess(theGammaConversion);
|
||||
|
||||
}
|
||||
else if (particleName == "e-")
|
||||
{
|
||||
// Construct processes for electron
|
||||
|
||||
// theeminusMultipleScattering = new G4MultipleScattering();
|
||||
// theeminusIonisation = new G4eIonisation();
|
||||
theeminusBremsstrahlung = new G4eBremsstrahlung();
|
||||
|
||||
// fPAIonisation = new G4PAIonisation("Xenon") ;
|
||||
// fForwardXrayTR = new G4ForwardXrayTR("Air","Polypropelene","XrayTR") ;
|
||||
|
||||
theeminusStepCut = new Em8StepCut();
|
||||
|
||||
// pmanager->AddProcess(theeminusMultipleScattering,-1,1,1);
|
||||
|
||||
// pmanager->AddProcess(theeminusIonisation,-1,2,2);
|
||||
|
||||
pmanager->AddProcess(new G4IonisationByLogicalVolume(particleName,
|
||||
pDet->GetLogicalAbsorber(),
|
||||
"IonisationByLogVol"),-1,2,2);
|
||||
|
||||
pmanager->AddProcess(theeminusBremsstrahlung,-1,-1,3);
|
||||
|
||||
// pmanager->AddProcess(fPAIonisation,-1,2,2);
|
||||
|
||||
// pmanager->AddProcess(fForwardXrayTR,-1,-1,2);
|
||||
|
||||
pmanager->AddProcess(theeminusStepCut,-1,-1,4);
|
||||
theeminusStepCut->SetMaxStep(MaxChargedStep) ;
|
||||
|
||||
}
|
||||
else if (particleName == "e+")
|
||||
{
|
||||
// Construct processes for positron
|
||||
|
||||
// theeplusMultipleScattering = new G4MultipleScattering();
|
||||
theeplusIonisation = new G4eIonisation();
|
||||
theeplusBremsstrahlung = new G4eBremsstrahlung();
|
||||
// theeplusAnnihilation = new G4eplusAnnihilation();
|
||||
|
||||
// fPAIonisation = new G4PAIonisation("Xenon") ;
|
||||
// fForwardXrayTR = new G4ForwardXrayTR("Air","Polypropelene","XrayTR") ;
|
||||
|
||||
theeplusStepCut = new Em8StepCut();
|
||||
|
||||
// pmanager->AddProcess(theeplusMultipleScattering,-1,1,1);
|
||||
pmanager->AddProcess(theeplusIonisation,-1,2,2);
|
||||
pmanager->AddProcess(theeplusBremsstrahlung,-1,-1,3);
|
||||
// pmanager->AddProcess(theeplusAnnihilation,0,-1,4);
|
||||
|
||||
// pmanager->AddProcess(fPAIonisation,-1,2,2);
|
||||
|
||||
|
||||
// pmanager->AddProcess(fForwardXrayTR,-1,-1,2);
|
||||
|
||||
pmanager->AddProcess(theeplusStepCut,-1,-1,5);
|
||||
theeplusStepCut->SetMaxStep(MaxChargedStep) ;
|
||||
|
||||
}
|
||||
else if( particleName == "mu+" ||
|
||||
particleName == "mu-" )
|
||||
{
|
||||
// Construct processes for muon+
|
||||
|
||||
// Em8StepCut* muonStepCut = new Em8StepCut();
|
||||
|
||||
// G4MuIonisation* themuIonisation = new G4MuIonisation() ;
|
||||
// pmanager->AddProcess(new G4MultipleScattering(),-1,1,1);
|
||||
// pmanager->AddProcess(themuIonisation,-1,2,2);
|
||||
// pmanager->AddProcess(new G4MuBremsstrahlung(),-1,-1,3);
|
||||
// pmanager->AddProcess(new G4MuPairProduction(),-1,-1,4);
|
||||
|
||||
// pmanager->AddProcess(new G4PAIonisation("Xenon"),-1,2,2) ;
|
||||
// pmanager->AddProcess( muonStepCut,-1,-1,3);
|
||||
// muonStepCut->SetMaxStep(MaxChargedStep) ;
|
||||
|
||||
}
|
||||
else if (
|
||||
particleName == "proton"
|
||||
|| particleName == "antiproton"
|
||||
|| particleName == "pi+"
|
||||
|| particleName == "pi-"
|
||||
|| particleName == "kaon+"
|
||||
|| particleName == "kaon-"
|
||||
)
|
||||
{
|
||||
// Em8StepCut* thehadronStepCut = new Em8StepCut();
|
||||
|
||||
// G4hIonisation* thehIonisation = new G4hIonisation() ;
|
||||
// G4MultipleScattering* thehMultipleScattering =
|
||||
// new G4MultipleScattering() ;
|
||||
|
||||
// pmanager->AddProcess(thehMultipleScattering,-1,1,1);
|
||||
// pmanager->AddProcess(thehIonisation,-1,2,2);
|
||||
|
||||
// pmanager->AddProcess(new G4PAIonisation("Xenon"),-1,2,2) ;
|
||||
// pmanager->AddProcess(new G4PAIonisation("Argon"),-1,2,2) ;
|
||||
|
||||
// pmanager->AddProcess( thehadronStepCut,-1,-1,3);
|
||||
// thehadronStepCut->SetMaxStep(MaxChargedStep) ;
|
||||
// thehadronStepCut->SetMaxStep(10*mm) ;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#include "G4Decay.hh"
|
||||
|
||||
void Em8PhysicsList::ConstructGeneral()
|
||||
{
|
||||
// Add Decay Process
|
||||
|
||||
G4Decay* theDecayProcess = new G4Decay();
|
||||
theParticleIterator->reset();
|
||||
|
||||
while( (*theParticleIterator)() )
|
||||
{
|
||||
G4ParticleDefinition* particle = theParticleIterator->value();
|
||||
G4ProcessManager* pmanager = particle->GetProcessManager();
|
||||
|
||||
if (theDecayProcess->IsApplicable(*particle))
|
||||
{
|
||||
pmanager ->AddProcess(theDecayProcess);
|
||||
|
||||
// set ordering for PostStepDoIt and AtRestDoIt
|
||||
|
||||
pmanager ->SetProcessOrdering(theDecayProcess, idxPostStep);
|
||||
pmanager ->SetProcessOrdering(theDecayProcess, idxAtRest);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Em8PhysicsList::SetCuts()
|
||||
{
|
||||
G4Timer theTimer ;
|
||||
theTimer.Start() ;
|
||||
if (verboseLevel >0)
|
||||
{
|
||||
G4cout << "Em8PhysicsList::SetCuts:";
|
||||
G4cout << "CutLength : " << G4BestUnit(defaultCutValue,"Length") << endl;
|
||||
}
|
||||
// set cut values for gamma at first and for e- second and next for e+,
|
||||
// because some processes for e+/e- need cut values for gamma
|
||||
|
||||
SetCutValue(cutForGamma,"gamma");
|
||||
|
||||
SetCutValue(cutForElectron,"e-");
|
||||
SetCutValue(cutForElectron,"e+");
|
||||
|
||||
SetCutValue(defaultCutValue,"mu-");
|
||||
SetCutValue(defaultCutValue,"mu+");
|
||||
|
||||
// set cut values for proton and anti_proton before all other hadrons
|
||||
// because some processes for hadrons need cut values for proton/anti_proton
|
||||
|
||||
SetCutValue(defaultCutValue, "proton");
|
||||
SetCutValue(defaultCutValue, "anti_proton");
|
||||
|
||||
SetCutValueForOthers(defaultCutValue);
|
||||
|
||||
if (verboseLevel>1) DumpCutValuesTable();
|
||||
|
||||
theTimer.Stop();
|
||||
G4cout.precision(6);
|
||||
G4cout << endl ;
|
||||
G4cout << "total time(SetCuts)=" << theTimer.GetUserElapsed() << " s " <<endl;
|
||||
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Em8PhysicsList::SetGammaCut(G4double val)
|
||||
{
|
||||
ResetCuts();
|
||||
cutForGamma = val;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Em8PhysicsList::SetElectronCut(G4double val)
|
||||
{
|
||||
ResetCuts();
|
||||
cutForElectron = val;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Em8PhysicsList::SetProtonCut(G4double val)
|
||||
{
|
||||
ResetCuts();
|
||||
cutForProton = val;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Em8PhysicsList::SetCutsByEnergy(G4double val)
|
||||
{
|
||||
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
|
||||
G4Material* currMat = pDet->GetAbsorberMaterial();
|
||||
|
||||
// set cut values for gamma at first and for e- second and next for e+,
|
||||
// because some processes for e+/e- need cut values for gamma
|
||||
|
||||
G4ParticleDefinition* part;
|
||||
G4double cut;
|
||||
|
||||
part = theParticleTable->FindParticle("e-");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
SetCutValue(cut, "e-");
|
||||
|
||||
part = theParticleTable->FindParticle("e+");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
SetCutValue(cut, "e+");
|
||||
|
||||
// set cut values for proton and anti_proton before all other hadrons
|
||||
// because some processes for hadrons need cut values for proton/anti_proton
|
||||
|
||||
part = theParticleTable->FindParticle("proton");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
SetCutValue(cut, "proton");
|
||||
|
||||
part = theParticleTable->FindParticle("anti_proton");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
SetCutValue(cut, "anti_proton");
|
||||
|
||||
SetCutValueForOthers(cut);
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Em8PhysicsList::GetRange(G4double val)
|
||||
{
|
||||
G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable();
|
||||
G4Material* currMat = pDet->GetAbsorberMaterial();
|
||||
|
||||
G4ParticleDefinition* part;
|
||||
G4double cut;
|
||||
part = theParticleTable->FindParticle("e-");
|
||||
cut = G4EnergyLossTables::GetRange(part,val,currMat);
|
||||
G4cout << "material : " << currMat->GetName() << endl;
|
||||
G4cout << "particle : " << part->GetParticleName() << endl;
|
||||
G4cout << "energy : " << val / keV << " (keV)" << endl;
|
||||
G4cout << "range : " << cut / mm << " (mm)" << endl;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void Em8PhysicsList::SetMaxStep(G4double step)
|
||||
{
|
||||
MaxChargedStep = step ;
|
||||
G4cout << " MaxChargedStep=" << MaxChargedStep << endl;
|
||||
G4cout << endl;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: Em8PhysicsListMessenger.cc,v 1.1 2000/01/07 14:50:46 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "Em8PhysicsListMessenger.hh"
|
||||
|
||||
#include "Em8PhysicsList.hh"
|
||||
#include "G4UIcmdWithoutParameter.hh"
|
||||
#include "G4UIcmdWithADouble.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8PhysicsListMessenger::Em8PhysicsListMessenger(Em8PhysicsList * List)
|
||||
:Em8List(List)
|
||||
{
|
||||
cutGCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutG",this);
|
||||
cutGCmd->SetGuidance("Set cut values by RANGE for Gamma.");
|
||||
cutGCmd->SetParameterName("range",true);
|
||||
cutGCmd->SetDefaultValue(1.);
|
||||
cutGCmd->SetDefaultUnit("mm");
|
||||
cutGCmd->AvailableForStates(Idle);
|
||||
|
||||
cutECmd = new G4UIcmdWithADoubleAndUnit("/calor/cutE",this);
|
||||
cutECmd->SetGuidance("Set cut values by RANGE for e- e+.");
|
||||
cutECmd->SetParameterName("range",true);
|
||||
cutECmd->SetDefaultValue(1.);
|
||||
cutECmd->SetDefaultUnit("mm");
|
||||
cutECmd->AvailableForStates(Idle);
|
||||
|
||||
cutPCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutP",this);
|
||||
cutPCmd->SetGuidance("Set cut values by RANGE for proton and others.");
|
||||
cutPCmd->SetParameterName("range",true);
|
||||
cutPCmd->SetDefaultValue(1.);
|
||||
cutPCmd->SetDefaultUnit("mm");
|
||||
cutPCmd->AvailableForStates(Idle);
|
||||
|
||||
eCmd = new G4UIcmdWithADoubleAndUnit("/calor/cutEnergy",this);
|
||||
eCmd->SetGuidance("Set cut values by ENERGY for charged particles.");
|
||||
eCmd->SetParameterName("energy",true);
|
||||
eCmd->SetDefaultValue(10.);
|
||||
eCmd->SetDefaultUnit("keV");
|
||||
eCmd->AvailableForStates(Idle);
|
||||
|
||||
rCmd = new G4UIcmdWithADoubleAndUnit("/calor/range",this);
|
||||
rCmd->SetGuidance("Display the RANGE of Electron for the current material.");
|
||||
rCmd->SetParameterName("energy",true);
|
||||
rCmd->SetDefaultValue(10.);
|
||||
rCmd->SetDefaultUnit("keV");
|
||||
rCmd->AvailableForStates(Idle);
|
||||
|
||||
setMaxStepCmd = new G4UIcmdWithADoubleAndUnit("/step/setMaxStep",this);
|
||||
setMaxStepCmd->SetGuidance("Set max. step length in the detector");
|
||||
setMaxStepCmd->SetParameterName("mxStep",true);
|
||||
setMaxStepCmd->SetDefaultUnit("mm");
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8PhysicsListMessenger::~Em8PhysicsListMessenger()
|
||||
{
|
||||
|
||||
delete setMaxStepCmd;
|
||||
|
||||
delete cutGCmd;
|
||||
delete cutECmd;
|
||||
delete cutPCmd;
|
||||
delete rCmd;
|
||||
delete eCmd;
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8PhysicsListMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
|
||||
{
|
||||
if(command == cutGCmd)
|
||||
{ Em8List->SetGammaCut(cutGCmd->GetNewDoubleValue(newValue));}
|
||||
if(command == cutECmd)
|
||||
{ Em8List->SetElectronCut(eCmd->GetNewDoubleValue(newValue));}
|
||||
if(command == cutPCmd)
|
||||
{ Em8List->SetProtonCut(eCmd->GetNewDoubleValue(newValue));}
|
||||
if(command == eCmd)
|
||||
{ Em8List->SetCutsByEnergy(cutECmd->GetNewDoubleValue(newValue));}
|
||||
if(command == rCmd)
|
||||
{ Em8List->GetRange(rCmd->GetNewDoubleValue(newValue));}
|
||||
if(command == setMaxStepCmd)
|
||||
{ Em8List->SetMaxStep(setMaxStepCmd->GetNewDoubleValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -0,0 +1,136 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: Em8PrimaryGeneratorAction.cc,v 1.1 2000/01/07 14:50:46 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "Em8PrimaryGeneratorAction.hh"
|
||||
|
||||
#include "Em8DetectorConstruction.hh"
|
||||
#include "Em8PrimaryGeneratorMessenger.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4ParticleGun.hh"
|
||||
#include "G4ParticleTable.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
G4String Em8PrimaryGeneratorAction::thePrimaryParticleName="proton" ;
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8PrimaryGeneratorAction::Em8PrimaryGeneratorAction(
|
||||
Em8DetectorConstruction* Em8DC)
|
||||
:Em8Detector(Em8DC),rndmFlag("off"),xvertex(0.),yvertex(0.),zvertex(0.),
|
||||
vertexdefined(false)
|
||||
{
|
||||
G4int n_particle = 1;
|
||||
particleGun = new G4ParticleGun(n_particle);
|
||||
|
||||
//create a messenger for this class
|
||||
gunMessenger = new Em8PrimaryGeneratorMessenger(this);
|
||||
|
||||
// default particle kinematic
|
||||
|
||||
G4ParticleTable* particleTable = G4ParticleTable::GetParticleTable();
|
||||
G4String particleName;
|
||||
G4ParticleDefinition* particle
|
||||
= particleTable->FindParticle(particleName="proton");
|
||||
particleGun->SetParticleDefinition(particle);
|
||||
|
||||
thePrimaryParticleName = particle->GetParticleName() ;
|
||||
|
||||
particleGun->SetParticleMomentumDirection(G4ThreeVector(0.,0.,1.));
|
||||
particleGun->SetParticleEnergy(100.*GeV);
|
||||
|
||||
zvertex = 0.0 ; // -0.5*(Em8Detector->GetAbsorberThickness());
|
||||
particleGun->SetParticlePosition(G4ThreeVector(xvertex,yvertex,zvertex));
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8PrimaryGeneratorAction::~Em8PrimaryGeneratorAction()
|
||||
{
|
||||
delete particleGun;
|
||||
delete gunMessenger;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8PrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
|
||||
{
|
||||
//this function is called at the begining of event
|
||||
//
|
||||
thePrimaryParticleName = particleGun->GetParticleDefinition()->
|
||||
GetParticleName() ;
|
||||
G4double x0,y0,z0 ;
|
||||
if(vertexdefined)
|
||||
{
|
||||
x0 = xvertex ;
|
||||
y0 = yvertex ;
|
||||
z0 = zvertex ;
|
||||
}
|
||||
else
|
||||
{
|
||||
x0 = 0. ;
|
||||
y0 = 0. ;
|
||||
z0 = 0. ; // -0.5*(Em8Detector->GetWorldSizeZ()) ;
|
||||
}
|
||||
G4double r0,phi0 ;
|
||||
/* ****************************************************
|
||||
if (rndmFlag == "on")
|
||||
{
|
||||
r0 = (Em8Detector->GetAbsorberRadius())*sqrt(G4UniformRand());
|
||||
phi0 = twopi*G4UniformRand();
|
||||
x0 = r0*cos(phi0);
|
||||
y0 = r0*sin(phi0);
|
||||
}
|
||||
********************************************* */
|
||||
particleGun->SetParticlePosition(G4ThreeVector(x0,y0,z0));
|
||||
particleGun->GeneratePrimaryVertex(anEvent);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
//
|
||||
|
||||
G4String Em8PrimaryGeneratorAction::GetPrimaryName()
|
||||
{
|
||||
return thePrimaryParticleName ;
|
||||
}
|
||||
|
||||
void Em8PrimaryGeneratorAction::Setzvertex(G4double z)
|
||||
{
|
||||
vertexdefined = true ;
|
||||
zvertex = z ;
|
||||
G4cout << " Z coordinate of the primary vertex = " << zvertex/mm <<
|
||||
" mm." << endl;
|
||||
}
|
||||
void Em8PrimaryGeneratorAction::Setxvertex(G4double x)
|
||||
{
|
||||
vertexdefined = true ;
|
||||
xvertex = x ;
|
||||
G4cout << " X coordinate of the primary vertex = " << xvertex/mm <<
|
||||
" mm." << endl;
|
||||
}
|
||||
|
||||
void Em8PrimaryGeneratorAction::Setyvertex(G4double y)
|
||||
{
|
||||
vertexdefined = true ;
|
||||
yvertex = y ;
|
||||
G4cout << " Y coordinate of the primary vertex = " << yvertex/mm <<
|
||||
" mm." << endl;
|
||||
}
|
||||
@@ -0,0 +1,77 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: Em8PrimaryGeneratorMessenger.cc,v 1.1 2000/01/07 14:50:46 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "Em8PrimaryGeneratorMessenger.hh"
|
||||
|
||||
#include "Em8PrimaryGeneratorAction.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8PrimaryGeneratorMessenger::Em8PrimaryGeneratorMessenger(Em8PrimaryGeneratorAction* Em8Gun)
|
||||
:Em8Action(Em8Gun)
|
||||
{
|
||||
RndmCmd = new G4UIcmdWithAString("/gun/random",this);
|
||||
RndmCmd->SetGuidance("Shoot randomly the incident particle.");
|
||||
RndmCmd->SetGuidance(" Choice : on, off(default)");
|
||||
RndmCmd->SetParameterName("choice",true);
|
||||
RndmCmd->SetDefaultValue("off");
|
||||
RndmCmd->SetCandidates("on off");
|
||||
RndmCmd->AvailableForStates(PreInit,Idle);
|
||||
|
||||
setxvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/xvertex",this);
|
||||
setxvertexCmd->SetGuidance(" Set x coord. of the primary vertex.");
|
||||
setxvertexCmd->SetParameterName("xv",true);
|
||||
setxvertexCmd->SetDefaultValue(0.0*mm) ;
|
||||
|
||||
setyvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/yvertex",this);
|
||||
setyvertexCmd->SetGuidance(" Set y coord. of the primary vertex.");
|
||||
setyvertexCmd->SetParameterName("yv",true);
|
||||
setyvertexCmd->SetDefaultValue(0.0*mm) ;
|
||||
|
||||
setzvertexCmd = new G4UIcmdWithADoubleAndUnit("/gun/zvertex",this);
|
||||
setzvertexCmd->SetGuidance(" Set z coord. of the primary vertex.");
|
||||
setzvertexCmd->SetParameterName("zv",true);
|
||||
setzvertexCmd->SetDefaultValue(0.0*mm) ;
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8PrimaryGeneratorMessenger::~Em8PrimaryGeneratorMessenger()
|
||||
{
|
||||
delete RndmCmd;
|
||||
delete setxvertexCmd;
|
||||
delete setyvertexCmd;
|
||||
delete setzvertexCmd;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8PrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
|
||||
{
|
||||
if( command == RndmCmd )
|
||||
{ Em8Action->SetRndmFlag(newValue);}
|
||||
if( command == setxvertexCmd)
|
||||
{ Em8Action->Setxvertex(setxvertexCmd->GetNewDoubleValue(newValue));}
|
||||
if( command == setyvertexCmd)
|
||||
{ Em8Action->Setyvertex(setyvertexCmd->GetNewDoubleValue(newValue));}
|
||||
if( command == setzvertexCmd)
|
||||
{ Em8Action->Setzvertex(setzvertexCmd->GetNewDoubleValue(newValue));}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,374 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: Em8RunMessenger.cc,v 1.1 2000/01/07 14:50:47 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "Em8RunMessenger.hh"
|
||||
|
||||
#include "Em8RunAction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "G4UIcmdWithAnInteger.hh"
|
||||
#include "G4UIcmdWithADoubleAndUnit.hh"
|
||||
#include "G4UIcmdWithADouble.hh"
|
||||
#include "G4UIcmdWithAString.hh"
|
||||
#include "G4ios.hh"
|
||||
#include "globals.hh"
|
||||
#include "Randomize.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8RunMessenger::Em8RunMessenger(Em8RunAction* RA)
|
||||
:runAction (RA)
|
||||
{
|
||||
plotDir = new G4UIdirectory("/plots/");
|
||||
plotDir->SetGuidance("plot control");
|
||||
|
||||
sethistNameCmd = new G4UIcmdWithAString("/plots/sethistName",this);
|
||||
sethistNameCmd->SetGuidance("set name for the histogram file");
|
||||
|
||||
setnbinStepCmd = new G4UIcmdWithAnInteger("/plots/setnbinStep",this);
|
||||
setnbinStepCmd->SetGuidance("set nb of bins in #step plot");
|
||||
setnbinStepCmd->SetParameterName("nbinStep",false);
|
||||
|
||||
setSteplowCmd = new G4UIcmdWithADouble("/plots/setSteplow",this);
|
||||
setSteplowCmd->SetGuidance("set lower limit for #step plot ");
|
||||
setSteplowCmd->SetParameterName("Steplow",false);
|
||||
|
||||
setStephighCmd = new G4UIcmdWithADouble("/plots/setStephigh",this);
|
||||
setStephighCmd->SetGuidance("set upper limit for #step plot ");
|
||||
setStephighCmd->SetParameterName("Stephigh",false);
|
||||
|
||||
setnbinEnCmd = new G4UIcmdWithAnInteger("/plots/setnbinEn",this);
|
||||
setnbinEnCmd->SetGuidance("set nb of bins in Edep plot");
|
||||
setnbinEnCmd->SetParameterName("nbinE",false);
|
||||
|
||||
setEnlowCmd = new G4UIcmdWithADoubleAndUnit("/plots/setEnlow",this);
|
||||
setEnlowCmd->SetGuidance("set lower limit for Edep plot ");
|
||||
setEnlowCmd->SetParameterName("Elow",false);
|
||||
setEnlowCmd->SetUnitCategory("Energy");
|
||||
|
||||
setEnhighCmd = new G4UIcmdWithADoubleAndUnit("/plots/setEnhigh",this);
|
||||
setEnhighCmd->SetGuidance("set upper limit for Edep plot ");
|
||||
setEnhighCmd->SetParameterName("Ehigh",false);
|
||||
setEnhighCmd->SetUnitCategory("Energy");
|
||||
|
||||
setnbinGammaCmd = new G4UIcmdWithAnInteger("/plots/setnbinGamma",this);
|
||||
setnbinGammaCmd->SetGuidance("set nb of bins in gamma spectrum plot");
|
||||
setnbinGammaCmd->SetParameterName("nbinGamma",false);
|
||||
|
||||
setElowGammaCmd = new G4UIcmdWithADoubleAndUnit("/plots/setElowGamma",this);
|
||||
setElowGammaCmd->SetGuidance("set lower limit for gamma spectrum plot ");
|
||||
setElowGammaCmd->SetParameterName("ElowGamma",false);
|
||||
setElowGammaCmd->SetUnitCategory("Energy");
|
||||
|
||||
setEhighGammaCmd = new G4UIcmdWithADoubleAndUnit("/plots/setEhighGamma",this);
|
||||
setEhighGammaCmd->SetGuidance("set upper limit for gamma spectrum plot ");
|
||||
setEhighGammaCmd->SetParameterName("EhighGamma",false);
|
||||
setEhighGammaCmd->SetUnitCategory("Energy");
|
||||
|
||||
setnbinTtCmd = new G4UIcmdWithAnInteger("/plots/setnbinTt",this);
|
||||
setnbinTtCmd->SetGuidance("set nb of bins in Etransmitted plot");
|
||||
setnbinTtCmd->SetParameterName("nbinTt",false);
|
||||
|
||||
setTtlowCmd = new G4UIcmdWithADoubleAndUnit("/plots/setTtlow",this);
|
||||
setTtlowCmd->SetGuidance("set lower limit for Etransmitted plot ");
|
||||
setTtlowCmd->SetParameterName("Ttlow",false);
|
||||
|
||||
setTthighCmd = new G4UIcmdWithADoubleAndUnit("/plots/setTthigh",this);
|
||||
setTthighCmd->SetGuidance("set upper limit for Etransmitted plot ");
|
||||
setTthighCmd->SetParameterName("Tthigh",false);
|
||||
|
||||
setnbinTbCmd = new G4UIcmdWithAnInteger("/plots/setnbinTb",this);
|
||||
setnbinTbCmd->SetGuidance("set nb of bins in Ebackscattering plot");
|
||||
setnbinTbCmd->SetParameterName("nbinTb",false);
|
||||
|
||||
setTblowCmd = new G4UIcmdWithADoubleAndUnit("/plots/setTblow",this);
|
||||
setTblowCmd->SetGuidance("set lower limit for Ebackscattered plot ");
|
||||
setTblowCmd->SetParameterName("Tblow",false);
|
||||
|
||||
setTbhighCmd = new G4UIcmdWithADoubleAndUnit("/plots/setTbhigh",this);
|
||||
setTbhighCmd->SetGuidance("set upper limit for Ebackscattered plot ");
|
||||
setTbhighCmd->SetParameterName("Tbhigh",false);
|
||||
|
||||
setnbinTsecCmd = new G4UIcmdWithAnInteger("/plots/setnbinTsec",this);
|
||||
setnbinTsecCmd->SetGuidance("set nb of bins in charged Tsecondary plot");
|
||||
setnbinTsecCmd->SetParameterName("nbinTsec",false);
|
||||
|
||||
setTseclowCmd = new G4UIcmdWithADoubleAndUnit("/plots/setTseclow",this);
|
||||
setTseclowCmd->SetGuidance("set lower limit for charged Tsecondary plot ");
|
||||
setTseclowCmd->SetParameterName("Tseclow",false);
|
||||
|
||||
setTsechighCmd = new G4UIcmdWithADoubleAndUnit("/plots/setTsechigh",this);
|
||||
setTsechighCmd->SetGuidance("set upper limit for charged Tsecondary plot ");
|
||||
setTsechighCmd->SetParameterName("Tsechigh",false);
|
||||
|
||||
setnbinRCmd = new G4UIcmdWithAnInteger("/plots/setnbinR",this);
|
||||
setnbinRCmd->SetGuidance("set nb of bins in R plot");
|
||||
setnbinRCmd->SetParameterName("nbinR",false);
|
||||
|
||||
setRlowCmd = new G4UIcmdWithADoubleAndUnit("/plots/setRlow",this);
|
||||
setRlowCmd->SetGuidance("set lower limit for R plot ");
|
||||
setRlowCmd->SetParameterName("Rlow",false);
|
||||
|
||||
setRhighCmd = new G4UIcmdWithADoubleAndUnit("/plots/setRhigh",this);
|
||||
setRhighCmd->SetGuidance("set upper limit for R plot ");
|
||||
setRhighCmd->SetParameterName("Rhigh",false);
|
||||
|
||||
setnbinzvertexCmd = new G4UIcmdWithAnInteger("/plots/setnbinzvertex",this);
|
||||
setnbinzvertexCmd->SetGuidance("set nb of bins in Z vertex plot");
|
||||
setnbinzvertexCmd->SetParameterName("nbinZ",false);
|
||||
|
||||
setzlowCmd = new G4UIcmdWithADoubleAndUnit("/plots/setzlow",this);
|
||||
setzlowCmd->SetGuidance("set lower limit for Z vertex plot ");
|
||||
setzlowCmd->SetParameterName("zlow",false);
|
||||
|
||||
setzhighCmd = new G4UIcmdWithADoubleAndUnit("/plots/setzhigh",this);
|
||||
setzhighCmd->SetGuidance("set upper limit for Z vertex plot ");
|
||||
setzhighCmd->SetParameterName("zhigh",false);
|
||||
|
||||
setnbinThCmd = new G4UIcmdWithAnInteger("/plots/setnbinTh",this);
|
||||
setnbinThCmd->SetGuidance("set nb of bins in Theta transmitted plot");
|
||||
setnbinThCmd->SetParameterName("nbinTh",false);
|
||||
|
||||
setThlowCmd = new G4UIcmdWithADoubleAndUnit("/plots/setThlow",this);
|
||||
setThlowCmd->SetGuidance("set lower limit for Theta transmitted plot ");
|
||||
setThlowCmd->SetParameterName("Thlow",false);
|
||||
|
||||
setThhighCmd = new G4UIcmdWithADoubleAndUnit("/plots/setThhigh",this);
|
||||
setThhighCmd->SetGuidance("set upper limit for Theta transmitted plot ");
|
||||
setThhighCmd->SetParameterName("Thhigh",false);
|
||||
|
||||
setnbinThbackCmd = new G4UIcmdWithAnInteger("/plots/setnbinThback",this);
|
||||
setnbinThbackCmd->SetGuidance("set nb of bins in backscattering Theta plot");
|
||||
setnbinThbackCmd->SetParameterName("nbinThback",false);
|
||||
|
||||
setThlowbackCmd = new G4UIcmdWithADoubleAndUnit("/plots/setThlowback",this);
|
||||
setThlowbackCmd->SetGuidance("set lower limit for backscattering Theta plot ");
|
||||
setThlowbackCmd->SetParameterName("Thlowback",false);
|
||||
|
||||
setThhighbackCmd = new G4UIcmdWithADoubleAndUnit("/plots/setThhighback",this);
|
||||
setThhighbackCmd->SetGuidance("set upper limit for backscattering Theta plot ");
|
||||
setThhighbackCmd->SetParameterName("Thhighback",false);
|
||||
|
||||
RndmDir = new G4UIdirectory("/rndm/");
|
||||
RndmDir->SetGuidance("Rndm status control.");
|
||||
|
||||
RndmSaveCmd = new G4UIcmdWithAnInteger("/rndm/save",this);
|
||||
RndmSaveCmd->SetGuidance("set frequency to save rndm status on external files.");
|
||||
RndmSaveCmd->SetGuidance("freq = 0 not saved");
|
||||
RndmSaveCmd->SetGuidance("freq > 0 saved on: beginOfRun.rndm");
|
||||
RndmSaveCmd->SetGuidance("freq = 1 saved on: endOfRun.rndm");
|
||||
RndmSaveCmd->SetGuidance("freq = 2 saved on: endOfEvent.rndm");
|
||||
RndmSaveCmd->SetParameterName("frequency",false);
|
||||
RndmSaveCmd->SetRange("frequency>=0 && frequency<=2");
|
||||
RndmSaveCmd->AvailableForStates(PreInit,Idle);
|
||||
|
||||
RndmReadCmd = new G4UIcmdWithAString("/rndm/read",this);
|
||||
RndmReadCmd->SetGuidance("get rndm status from an external file.");
|
||||
RndmReadCmd->SetParameterName("fileName",true);
|
||||
RndmReadCmd->SetDefaultValue ("beginOfRun.rndm");
|
||||
RndmReadCmd->AvailableForStates(PreInit,Idle);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8RunMessenger::~Em8RunMessenger()
|
||||
{
|
||||
delete sethistNameCmd;
|
||||
|
||||
delete setnbinStepCmd;
|
||||
delete setSteplowCmd;
|
||||
delete setStephighCmd;
|
||||
|
||||
delete setnbinEnCmd;
|
||||
delete setEnlowCmd;
|
||||
delete setEnhighCmd;
|
||||
|
||||
delete setnbinGammaCmd;
|
||||
delete setElowGammaCmd;
|
||||
delete setEhighGammaCmd;
|
||||
|
||||
delete setnbinTtCmd;
|
||||
delete setTtlowCmd;
|
||||
delete setTthighCmd;
|
||||
|
||||
delete setnbinTbCmd;
|
||||
delete setTblowCmd;
|
||||
delete setTbhighCmd;
|
||||
|
||||
delete setnbinTsecCmd;
|
||||
delete setTseclowCmd;
|
||||
delete setTsechighCmd;
|
||||
|
||||
delete setnbinRCmd;
|
||||
delete setRlowCmd;
|
||||
delete setRhighCmd;
|
||||
|
||||
delete setnbinzvertexCmd;
|
||||
delete setzlowCmd;
|
||||
delete setzhighCmd;
|
||||
|
||||
delete setnbinThCmd;
|
||||
delete setThlowCmd;
|
||||
delete setThhighCmd;
|
||||
|
||||
delete setnbinThbackCmd;
|
||||
delete setThlowbackCmd;
|
||||
delete setThhighbackCmd;
|
||||
|
||||
delete plotDir;
|
||||
|
||||
delete RndmSaveCmd; delete RndmReadCmd; delete RndmDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8RunMessenger::SetNewValue(G4UIcommand* command,G4String newValues)
|
||||
{
|
||||
if( command == sethistNameCmd)
|
||||
runAction
|
||||
->SethistName(newValues) ;
|
||||
|
||||
if( command == setnbinStepCmd)
|
||||
runAction
|
||||
->SetnbinStep(setnbinStepCmd->GetNewIntValue(newValues));
|
||||
|
||||
if( command == setSteplowCmd)
|
||||
runAction
|
||||
->SetSteplow( setSteplowCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setStephighCmd)
|
||||
runAction
|
||||
->SetStephigh( setStephighCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setnbinEnCmd)
|
||||
runAction
|
||||
->SetnbinEn(setnbinEnCmd->GetNewIntValue(newValues));
|
||||
|
||||
if( command == setEnlowCmd)
|
||||
runAction
|
||||
->SetEnlow( setEnlowCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setEnhighCmd)
|
||||
runAction
|
||||
->SetEnhigh( setEnhighCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setnbinGammaCmd)
|
||||
runAction
|
||||
->SetnbinGamma(setnbinGammaCmd->GetNewIntValue(newValues));
|
||||
|
||||
if( command == setElowGammaCmd)
|
||||
runAction
|
||||
->SetElowGamma( setElowGammaCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setEhighGammaCmd)
|
||||
runAction
|
||||
->SetEhighGamma( setEhighGammaCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setnbinTtCmd)
|
||||
runAction
|
||||
->SetnbinTt(setnbinTtCmd->GetNewIntValue(newValues));
|
||||
|
||||
if( command == setTtlowCmd)
|
||||
runAction
|
||||
->SetTtlow( setTtlowCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setTthighCmd)
|
||||
runAction
|
||||
->SetTthigh( setTthighCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setnbinTbCmd)
|
||||
runAction
|
||||
->SetnbinTb(setnbinTbCmd->GetNewIntValue(newValues));
|
||||
|
||||
if( command == setTblowCmd)
|
||||
runAction
|
||||
->SetTblow( setTblowCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setTbhighCmd)
|
||||
runAction
|
||||
->SetTbhigh( setTbhighCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setnbinTsecCmd)
|
||||
runAction
|
||||
->SetnbinTsec(setnbinTsecCmd->GetNewIntValue(newValues));
|
||||
|
||||
if( command == setTseclowCmd)
|
||||
runAction
|
||||
->SetTseclow( setTseclowCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setTsechighCmd)
|
||||
runAction
|
||||
->SetTsechigh( setTsechighCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setnbinRCmd)
|
||||
runAction
|
||||
->SetnbinR(setnbinRCmd->GetNewIntValue(newValues));
|
||||
|
||||
if( command == setRlowCmd)
|
||||
runAction
|
||||
->SetRlow( setRlowCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setRhighCmd)
|
||||
runAction
|
||||
->SetRhigh( setRhighCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setnbinzvertexCmd)
|
||||
runAction
|
||||
->Setnbinzvertex(setnbinzvertexCmd->GetNewIntValue(newValues));
|
||||
|
||||
if( command == setzlowCmd)
|
||||
runAction
|
||||
->Setzlow( setzlowCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setzhighCmd)
|
||||
runAction
|
||||
->Setzhigh( setzhighCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setnbinThCmd)
|
||||
runAction
|
||||
->SetnbinTh(setnbinThCmd->GetNewIntValue(newValues));
|
||||
|
||||
if( command == setThlowCmd)
|
||||
runAction
|
||||
->SetThlow( setThlowCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setThhighCmd)
|
||||
runAction
|
||||
->SetThhigh( setThhighCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setnbinThbackCmd)
|
||||
runAction
|
||||
->SetnbinThBack(setnbinThbackCmd->GetNewIntValue(newValues));
|
||||
|
||||
if( command == setThlowbackCmd)
|
||||
runAction
|
||||
->SetThlowBack( setThlowbackCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if( command == setThhighbackCmd)
|
||||
runAction
|
||||
->SetThhighBack( setThhighbackCmd->GetNewDoubleValue(newValues));
|
||||
|
||||
if (command == RndmSaveCmd)
|
||||
runAction->SetRndmFreq(RndmSaveCmd->GetNewIntValue(newValues));
|
||||
|
||||
if (command == RndmReadCmd)
|
||||
{ G4cout << "\n---> rndm status restored from file: " << newValues << endl;
|
||||
HepRandom::restoreEngineStatus(newValues);
|
||||
HepRandom::showEngineStatus();
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: Em8StepCut.cc,v 1.1 2000/01/07 14:50:47 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
// --------------------------------------------------------------
|
||||
// GEANT 4 class implementation file
|
||||
//
|
||||
// For information related to this code contact:
|
||||
// CERN, CN Division, ASD Group
|
||||
// 05 March 1999 L. Urban
|
||||
// --------------------------------------------------------------
|
||||
// --------------------------------------------------------------
|
||||
|
||||
#include "Em8StepCut.hh"
|
||||
|
||||
#include "G4Step.hh"
|
||||
#include "G4UserLimits.hh"
|
||||
#include "G4VParticleChange.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
|
||||
Em8StepCut::Em8StepCut(const G4String& aName)
|
||||
: G4VDiscreteProcess(aName),MaxChargedStep(DBL_MAX)
|
||||
{
|
||||
if (verboseLevel>0) {
|
||||
G4cout << GetProcessName() << " is created "<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
Em8StepCut::~Em8StepCut()
|
||||
{
|
||||
}
|
||||
|
||||
Em8StepCut::Em8StepCut(Em8StepCut& right)
|
||||
:G4VDiscreteProcess(right)
|
||||
{}
|
||||
|
||||
void Em8StepCut::SetMaxStep(G4double step)
|
||||
{
|
||||
MaxChargedStep = step ;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: Em8SteppingAction.cc,v 1.1 2000/01/07 14:50:47 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "Em8DetectorConstruction.hh"
|
||||
#include "G4EnergyLossTables.hh"
|
||||
#include "G4SteppingManager.hh"
|
||||
#include "G4TrackVector.hh"
|
||||
#include "Em8SteppingAction.hh"
|
||||
#include "Em8PrimaryGeneratorAction.hh"
|
||||
#include "Em8EventAction.hh"
|
||||
#include "Em8RunAction.hh"
|
||||
#include "G4Event.hh"
|
||||
#include "G4EventManager.hh"
|
||||
#include "Em8SteppingMessenger.hh"
|
||||
#include "G4ios.hh"
|
||||
#include <iomanip.h>
|
||||
#include "G4UImanager.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8SteppingAction::Em8SteppingAction(Em8DetectorConstruction* DET,
|
||||
Em8EventAction* EA,
|
||||
Em8RunAction* RA)
|
||||
:detector (DET),eventaction (EA),runaction (RA),steppingMessenger(NULL),
|
||||
IDold(-1) ,evnoold(-1)
|
||||
{
|
||||
steppingMessenger = new Em8SteppingMessenger(this);
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8SteppingAction::~Em8SteppingAction()
|
||||
{
|
||||
delete steppingMessenger ;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8SteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
{
|
||||
|
||||
G4double Edep,Theta,Thetaback,Ttrans,Tback,Tsec,Egamma,xend,yend,zend,rend ;
|
||||
G4double Tkin ;
|
||||
G4int evno = eventaction->GetEventno() ;
|
||||
|
||||
IDnow = evno+10000*(aStep->GetTrack()->GetTrackID())+
|
||||
100000000*(aStep->GetTrack()->GetParentID());
|
||||
if(IDnow != IDold)
|
||||
{
|
||||
IDold=IDnow ;
|
||||
if(
|
||||
(((aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
|
||||
GetParticleName()) == "e-") &&
|
||||
((aStep->GetTrack()->GetTrackID() != 1) ||
|
||||
(aStep->GetTrack()->GetParentID() != 0)) )
|
||||
||
|
||||
(((aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
|
||||
GetParticleName()) == "e+") &&
|
||||
((aStep->GetTrack()->GetTrackID() != 1) ||
|
||||
(aStep->GetTrack()->GetParentID() != 0)) )
|
||||
)
|
||||
runaction->Fillvertexz(aStep->GetTrack()->GetVertexPosition().x());
|
||||
|
||||
if(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()=="Absorber")
|
||||
{
|
||||
if(((aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
|
||||
GetParticleName()) == "e-") &&
|
||||
((aStep->GetTrack()->GetTrackID() != 1) ||
|
||||
(aStep->GetTrack()->GetParentID() != 0)) )
|
||||
{
|
||||
eventaction->AddCharged() ;
|
||||
eventaction->AddE() ;
|
||||
Tsec = aStep->GetTrack()->GetKineticEnergy() ; // !!!!!!!!!!!!
|
||||
Tsec += aStep->GetTotalEnergyDeposit() ; // !!!!!!!!!!!!
|
||||
runaction->FillTsec(Tsec) ;
|
||||
}
|
||||
else
|
||||
if(((aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
|
||||
GetParticleName()) == "e+") &&
|
||||
((aStep->GetTrack()->GetTrackID() != 1) ||
|
||||
(aStep->GetTrack()->GetParentID() != 0)) )
|
||||
{
|
||||
eventaction->AddCharged() ;
|
||||
eventaction->AddP() ;
|
||||
Tsec = aStep->GetTrack()->GetKineticEnergy() ; // !!!!!!!!!!!!
|
||||
Tsec += aStep->GetTotalEnergyDeposit() ; // !!!!!!!!!!!!
|
||||
runaction->FillTsec(Tsec) ;
|
||||
}
|
||||
else
|
||||
if(((aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
|
||||
GetParticleName()) == "gamma") &&
|
||||
((aStep->GetTrack()->GetTrackID() != 1) ||
|
||||
(aStep->GetTrack()->GetParentID() != 0)) )
|
||||
{
|
||||
eventaction->AddNeutral() ;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()=="Absorber")
|
||||
{
|
||||
if(((aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
|
||||
GetParticleName()) == "e-")
|
||||
||
|
||||
((aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
|
||||
GetParticleName()) == "e+"))
|
||||
eventaction->CountStepsCharged() ;
|
||||
|
||||
if ((aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
|
||||
GetParticleName()) == "gamma")
|
||||
eventaction->CountStepsNeutral() ;
|
||||
}
|
||||
|
||||
if (
|
||||
(((aStep->GetTrack()->GetTrackID() == 1) &&
|
||||
(aStep->GetTrack()->GetParentID()== 0)) ||
|
||||
(aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
|
||||
GetParticleName() ==
|
||||
Em8PrimaryGeneratorAction::GetPrimaryName()))
|
||||
&&
|
||||
(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()=="Absorber")
|
||||
&&
|
||||
(aStep->GetTrack()->GetNextVolume()->GetName()=="World") &&
|
||||
(aStep->GetPostStepPoint()->GetProcessDefinedStep()
|
||||
->GetProcessName() == "Transportation") &&
|
||||
(aStep->GetTrack()->GetMomentumDirection().x()>0.)
|
||||
)
|
||||
{
|
||||
eventaction->SetTr();
|
||||
Theta = acos(aStep->GetTrack()->GetMomentumDirection().x()) ;
|
||||
runaction->FillTh(Theta) ;
|
||||
Ttrans = aStep->GetTrack()->GetKineticEnergy() ;
|
||||
runaction->FillTt(Ttrans) ;
|
||||
yend= aStep->GetTrack()->GetPosition().y() ;
|
||||
zend= aStep->GetTrack()->GetPosition().z() ;
|
||||
rend = sqrt(yend*yend+zend*zend) ;
|
||||
runaction->FillR(rend);
|
||||
}
|
||||
|
||||
if (
|
||||
(((aStep->GetTrack()->GetTrackID() == 1) &&
|
||||
(aStep->GetTrack()->GetParentID()== 0)) ||
|
||||
(aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
|
||||
GetParticleName() ==
|
||||
Em8PrimaryGeneratorAction::GetPrimaryName()))
|
||||
&&
|
||||
(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()=="Absorber") &&
|
||||
(aStep->GetTrack()->GetNextVolume()->GetName()=="World") &&
|
||||
(aStep->GetPostStepPoint()->GetProcessDefinedStep()
|
||||
->GetProcessName() == "Transportation") &&
|
||||
(aStep->GetTrack()->GetMomentumDirection().z()<0.)
|
||||
)
|
||||
{
|
||||
eventaction->SetRef();
|
||||
Thetaback = acos(aStep->GetTrack()->GetMomentumDirection().x()) ;
|
||||
Thetaback -= 0.5*pi ;
|
||||
runaction->FillThBack(Thetaback) ;
|
||||
Tback = aStep->GetTrack()->GetKineticEnergy() ;
|
||||
runaction->FillTb(Tback) ;
|
||||
}
|
||||
|
||||
|
||||
if (
|
||||
((aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName()=="Absorber") &&
|
||||
(aStep->GetTrack()->GetNextVolume()->GetName()=="World") &&
|
||||
(aStep->GetPostStepPoint()->GetProcessDefinedStep()
|
||||
->GetProcessName() == "Transportation") &&
|
||||
(aStep->GetTrack()->GetMomentumDirection().x()>0.) &&
|
||||
(aStep->GetTrack()->GetDynamicParticle()->GetDefinition()
|
||||
->GetParticleName() == "gamma"))
|
||||
)
|
||||
{
|
||||
Egamma = aStep->GetTrack()->GetKineticEnergy() ;
|
||||
runaction->FillGammaSpectrum(Egamma) ;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: Em8SteppingMessenger.cc,v 1.1 2000/01/07 14:50:48 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#include "Em8SteppingMessenger.hh"
|
||||
|
||||
#include "Em8SteppingAction.hh"
|
||||
#include "G4UIdirectory.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8SteppingMessenger::Em8SteppingMessenger(Em8SteppingAction* SA)
|
||||
:steppingAction (SA)
|
||||
{
|
||||
steppingDir = new G4UIdirectory("/stepping/");
|
||||
steppingDir->SetGuidance("stepping control");
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8SteppingMessenger::~Em8SteppingMessenger()
|
||||
{
|
||||
delete steppingDir;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8SteppingMessenger::SetNewValue(G4UIcommand* command,G4String newValues)
|
||||
{}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
|
||||
@@ -0,0 +1,170 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: Em8SteppingVerbose.cc,v 1.1 2000/01/07 14:50:48 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
//
|
||||
// Em8SteppingVerbose.cc
|
||||
//
|
||||
// Description:
|
||||
// Implementation of the Em8SteppingVerbose class
|
||||
// Contact:
|
||||
// Questions and comments to this code should be sent to
|
||||
// Katsuya Amako (e-mail: Katsuya.Amako@kek.jp)
|
||||
// Takashi Sasaki (e-mail: Takashi.Sasaki@kek.jp)
|
||||
//
|
||||
//---------------------------------------------------------------
|
||||
|
||||
#include "Em8SteppingVerbose.hh"
|
||||
#include "G4SteppingManager.hh"
|
||||
|
||||
#include "G4UnitsTable.hh"
|
||||
|
||||
////////////////////////////////////////////////
|
||||
Em8SteppingVerbose::Em8SteppingVerbose()
|
||||
////////////////////////////////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
Em8SteppingVerbose::~Em8SteppingVerbose()
|
||||
//////////////////////////////////////////////////
|
||||
{
|
||||
}
|
||||
|
||||
/////////////////////////////////////////
|
||||
void Em8SteppingVerbose::StepInfo()
|
||||
/////////////////////////////////////////
|
||||
{
|
||||
CopyState();
|
||||
|
||||
G4int prec = G4cout.precision(3);
|
||||
|
||||
if( verboseLevel >= 1 ){
|
||||
if( verboseLevel >= 4 ) VerboseTrack();
|
||||
if( verboseLevel >= 3 ){
|
||||
G4cout << endl;
|
||||
G4cout << setw( 5) << "#Step#" << " "
|
||||
<< setw( 6) << "X" << " "
|
||||
<< setw( 6) << "Y" << " "
|
||||
<< setw( 6) << "Z" << " "
|
||||
<< setw( 9) << "KineE" << " "
|
||||
<< setw( 9) << "dEStep" << " "
|
||||
<< setw(10) << "StepLeng"
|
||||
<< setw(10) << "TrakLeng"
|
||||
<< setw(10) << "NextVolu"
|
||||
<< setw(10) << "Process" << endl;
|
||||
}
|
||||
|
||||
G4cout << setw( 5) << fTrack->GetCurrentStepNumber() << " "
|
||||
<< setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
|
||||
|
||||
// if( fStepStatus != fWorldBoundary){
|
||||
if( fTrack->GetNextVolume() != 0 ) {
|
||||
G4cout << setw(10) << fTrack->GetNextVolume()->GetName();
|
||||
} else {
|
||||
G4cout << setw(10) << "OutOfWorld";
|
||||
}
|
||||
|
||||
if(fStep->GetPostStepPoint()->GetProcessDefinedStep() != NULL){
|
||||
G4cout << setw(10) << fStep->GetPostStepPoint()->GetProcessDefinedStep()
|
||||
->GetProcessName();
|
||||
} else {
|
||||
G4cout << "User Limit";
|
||||
}
|
||||
|
||||
G4cout << endl;
|
||||
|
||||
if( verboseLevel == 2 ){
|
||||
G4int tN2ndariesTot = fN2ndariesAtRestDoIt +
|
||||
fN2ndariesAlongStepDoIt +
|
||||
fN2ndariesPostStepDoIt;
|
||||
if(tN2ndariesTot>0){
|
||||
G4cout << " :----- List of 2ndaries - "
|
||||
<< "#SpawnInStep=" << setw(3) << tN2ndariesTot
|
||||
<< "(Rest=" << setw(2) << fN2ndariesAtRestDoIt
|
||||
<< ",Along=" << setw(2) << fN2ndariesAlongStepDoIt
|
||||
<< ",Post=" << setw(2) << fN2ndariesPostStepDoIt
|
||||
<< "), "
|
||||
<< "#SpawnTotal=" << setw(3) << (*fSecondary).entries()
|
||||
<< " ---------------"
|
||||
<< endl;
|
||||
|
||||
for(G4int lp1=(*fSecondary).entries()-tN2ndariesTot;
|
||||
lp1<(*fSecondary).entries(); lp1++){
|
||||
G4cout << " : "
|
||||
<< setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().x(),"Length")
|
||||
<< setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().y(),"Length")
|
||||
<< setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetPosition().z(),"Length")
|
||||
<< setw(6)
|
||||
<< G4BestUnit((*fSecondary)[lp1]->GetKineticEnergy(),"Energy")
|
||||
<< setw(10)
|
||||
<< (*fSecondary)[lp1]->GetDefinition()->GetParticleName();
|
||||
G4cout << endl;
|
||||
}
|
||||
|
||||
G4cout << " :-----------------------------"
|
||||
<< "----------------------------------"
|
||||
<< "-- EndOf2ndaries Info ---------------"
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////
|
||||
void Em8SteppingVerbose::TrackingStarted()
|
||||
////////////////////////////////////////////////
|
||||
{
|
||||
|
||||
CopyState();
|
||||
G4int prec = G4cout.precision(3);
|
||||
if( verboseLevel > 0 ){
|
||||
|
||||
G4cout << setw( 5) << "Step#" << " "
|
||||
<< setw( 6) << "X" << " "
|
||||
<< setw( 6) << "Y" << " "
|
||||
<< setw( 6) << "Z" << " "
|
||||
<< setw( 9) << "KineE" << " "
|
||||
<< setw( 9) << "dEStep" << " "
|
||||
<< setw(10) << "StepLeng"
|
||||
<< setw(10) << "TrakLeng"
|
||||
<< setw(10) << "NextVolu"
|
||||
<< setw(10) << "Process" << endl;
|
||||
|
||||
G4cout << setw( 5) << fTrack->GetCurrentStepNumber() << " "
|
||||
<< setw( 6) << G4BestUnit(fTrack->GetPosition().x(),"Length")
|
||||
<< setw( 6) << G4BestUnit(fTrack->GetPosition().y(),"Length")
|
||||
<< setw( 6) << G4BestUnit(fTrack->GetPosition().z(),"Length")
|
||||
<< setw( 6) << G4BestUnit(fTrack->GetKineticEnergy(),"Energy")
|
||||
<< setw( 6) << G4BestUnit(fStep->GetTotalEnergyDeposit(),"Energy")
|
||||
<< setw( 6) << G4BestUnit(fStep->GetStepLength(),"Length")
|
||||
<< setw( 6) << G4BestUnit(fTrack->GetTrackLength(),"Length");
|
||||
|
||||
if(fTrack->GetNextVolume()){
|
||||
G4cout << setw(10) << fTrack->GetNextVolume()->GetName() << " ";
|
||||
} else {
|
||||
G4cout << setw(10) << "OutOfWorld" << " ";
|
||||
}
|
||||
G4cout << setw(10) << "initStep" << endl;
|
||||
}
|
||||
G4cout.precision(prec);
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 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: Em8VisManager.cc,v 1.1 2000/01/07 14:50:48 grichine Exp $
|
||||
// GEANT4 tag $Name: geant4-01-01 $
|
||||
//
|
||||
//
|
||||
// John Allison 24th January 1998.
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
#ifdef G4VIS_USE
|
||||
|
||||
#include "Em8VisManager.hh"
|
||||
|
||||
// Supported drivers...
|
||||
|
||||
#ifdef G4VIS_USE_DAWN
|
||||
#include "G4FukuiRenderer.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_DAWNFILE
|
||||
#include "G4DAWNFILE.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_RAYX
|
||||
#include "G4RayX.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
#include "G4VRML1.hh"
|
||||
// #include "G4VRML2.hh"
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRMLFILE
|
||||
#include "G4VRML1File.hh"
|
||||
//#include "G4VRML2File.hh"
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
Em8VisManager::Em8VisManager () {}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
|
||||
void Em8VisManager::RegisterGraphicsSystems () {
|
||||
|
||||
#ifdef G4VIS_USE_DAWN
|
||||
RegisterGraphicsSystem (new G4FukuiRenderer);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_DAWNFILE
|
||||
RegisterGraphicsSystem (new G4DAWNFILE);
|
||||
#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_RAYX
|
||||
RegisterGraphicsSystem (new G4RayX);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRML
|
||||
RegisterGraphicsSystem (new G4VRML1);
|
||||
// RegisterGraphicsSystem (new G4VRML2);
|
||||
#endif
|
||||
|
||||
#ifdef G4VIS_USE_VRMLFILE
|
||||
RegisterGraphicsSystem (new G4VRML1File);
|
||||
// RegisterGraphicsSystem (new G4VRML2File);
|
||||
#endif
|
||||
|
||||
if (fVerbose > 0) {
|
||||
G4cout <<
|
||||
"\nYou have successfully chosen to use the following graphics systems."
|
||||
<< endl;
|
||||
PrintAvailableGraphicsSystems ();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
|
||||
Reference in New Issue
Block a user