Import Geant4 9.1.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:37:50 +02:00
parent a8e9364cea
commit 96c8bcd0af
6923 changed files with 198390 additions and 41849 deletions
@@ -24,7 +24,7 @@
// ********************************************************************
//
// -------------------------------------------------------------------
// $Id: MicrobeamDetectorConstruction.cc,v 1.5 2006/06/29 16:05:25 gunter Exp $
// $Id: MicrobeamDetectorConstruction.cc,v 1.7 2007/08/27 15:51:54 gcosmo Exp $
// -------------------------------------------------------------------
#include "MicrobeamDetectorConstruction.hh"
@@ -396,7 +396,7 @@ G4VPhysicalVolume* MicrobeamDetectorConstruction::ConstructMicrobeamLine()
solid1Gap = new G4Cons("_CollObj_gap1_", 0.*micrometer, 6*micrometer,
0.*micrometer,2.5*micrometer,
3.5*micrometer,
0, ((360*M_PI)/180));
0, ((360*CLHEP::pi)/180));
logic1Gap = new G4LogicalVolume(solid1Gap, defaultMaterial, "_CollObj_gap1_");
@@ -408,7 +408,7 @@ G4VPhysicalVolume* MicrobeamDetectorConstruction::ConstructMicrobeamLine()
solid2Gap = new G4Cons("_CollObj_gap2_", 0.*micrometer, 15*micrometer,
0.*micrometer,6*micrometer,
6.5*micrometer,
0, ((360*M_PI)/180));
0, ((360*CLHEP::pi)/180));
logic2Gap = new G4LogicalVolume(solid2Gap, defaultMaterial, "_CollObj_gap2_");
@@ -420,7 +420,7 @@ G4VPhysicalVolume* MicrobeamDetectorConstruction::ConstructMicrobeamLine()
solid3Gap = new G4Cons("_CollObj_gap3_", 0.*micrometer, 105*micrometer,
0.*micrometer,15*micrometer,
25*micrometer,
0, ((360*M_PI)/180));
0, ((360*CLHEP::pi)/180));
logic3Gap = new G4LogicalVolume(solid3Gap, defaultMaterial, "_CollObj_gap3_");
@@ -443,7 +443,7 @@ G4VPhysicalVolume* MicrobeamDetectorConstruction::ConstructMicrobeamLine()
solid4Gap = new G4Cons("_CollDet_gap4_", 0.*micrometer, 8*micrometer,
0.*micrometer,5*micrometer,
7.5*micrometer,
0, ((360*M_PI)/180));
0, ((360*CLHEP::pi)/180));
logic4Gap = new G4LogicalVolume(solid4Gap, defaultMaterial, "_CollDet_gap4_");
@@ -454,7 +454,7 @@ G4VPhysicalVolume* MicrobeamDetectorConstruction::ConstructMicrobeamLine()
solid5Gap = new G4Cons("_CollDet_gap5_", 0.*micrometer, 105*micrometer,
0.*micrometer,8*micrometer,
27.5*micrometer,
0, ((360*M_PI)/180));
0, ((360*CLHEP::pi)/180));
logic5Gap = new G4LogicalVolume(solid5Gap, defaultMaterial, "_CollDet_gap5_");
@@ -633,7 +633,7 @@ G4VPhysicalVolume* MicrobeamDetectorConstruction::ConstructMicrobeamLine()
logicPhantom, // their logical volumr
// logicCyto, // Mother logical volume
logicKgm, // Mother logical volume
kZAxis, // Are placed along this axis
kUndefined, // Are placed along this axis
phantomParam->GetNoBoxes(), // Number of boxes
phantomParam,false); // The parametrisation
@@ -24,7 +24,7 @@
// ********************************************************************
//
// -------------------------------------------------------------------
// $Id: MicrobeamEMField.cc,v 1.5 2006/06/29 16:05:27 gunter Exp $
// $Id: MicrobeamEMField.cc,v 1.6 2007/07/06 06:52:54 sincerti Exp $
// -------------------------------------------------------------------
#include "MicrobeamEMField.hh"
@@ -253,6 +253,8 @@ if (z>=-1400*mm & z <-200*mm)
G2=0;
G3=0;
cte=0;
G4bool largeScattering=false;
for (G4int i=0;i<4; i++)
{
@@ -264,6 +266,8 @@ if (z>=-1400*mm & z <-200*mm)
x_local = (x - xoprime) * std::cos (lineAngle) - (z - zoprime) * std::sin (lineAngle);
y_local = y;
z_local = (z - zoprime) * std::cos (lineAngle) + (x - xoprime) * std::sin (lineAngle);
if (std::sqrt(x_local*x_local+y_local*y_local)>a0[i]) largeScattering=true;
}
if (i==1)
@@ -273,6 +277,7 @@ if (z>=-1400*mm & z <-200*mm)
x_local = (x - xoprime) * std::cos (lineAngle) - (z - zoprime) * std::sin (lineAngle);
y_local = y;
z_local = (z - zoprime) * std::cos (lineAngle) + (x - xoprime) * std::sin (lineAngle);
if (std::sqrt(x_local*x_local+y_local*y_local)>a0[i]) largeScattering=true;
}
if (i==2)
@@ -282,6 +287,7 @@ if (z>=-1400*mm & z <-200*mm)
x_local = (x - xoprime) * std::cos (lineAngle) - (z - zoprime) * std::sin (lineAngle);
y_local = y;
z_local = (z - zoprime) * std::cos (lineAngle) + (x - xoprime) * std::sin (lineAngle);
if (std::sqrt(x_local*x_local+y_local*y_local)>a0[i]) largeScattering=true;
}
if (i==3)
@@ -291,6 +297,7 @@ if (z>=-1400*mm & z <-200*mm)
x_local = (x - xoprime) * std::cos (lineAngle) - (z - zoprime) * std::sin (lineAngle);
y_local = y;
z_local = (z - zoprime) * std::cos (lineAngle) + (x - xoprime) * std::sin (lineAngle);
if (std::sqrt(x_local*x_local+y_local*y_local)>a0[i]) largeScattering=true;
}
@@ -357,6 +364,16 @@ if (z>=-1400*mm & z <-200*mm)
}
// PROTECTION AGAINST LARGE SCATTERING
if ( largeScattering )
{
G0=0;
G1=0;
G2=0;
G3=0;
}
// MAGNETIC FIELD COMPUTATION FOR EACH QUADRUPOLE
Bx_local = y_local*(G0-(1./12)*(3*x_local*x_local+y_local*y_local)*G2);
@@ -502,5 +519,26 @@ if (z>=-1400*mm & z <-200*mm)
Bfield[5] = 0;
}
// ZERO FIELD REGIONS
if (
(Bfield[0]==0. &
Bfield[1]==0. &
Bfield[2]==0. &
Bfield[4]==0. &
Bfield[5]==0. &
Bfield[6]==0. )
)
{
G4FieldManager *pFieldMgr;
pFieldMgr = G4TransportationManager::GetTransportationManager()->GetFieldManager();
pFieldMgr = NULL;
}
//
}
@@ -24,7 +24,7 @@
// ********************************************************************
//
// -------------------------------------------------------------------
// $Id: MicrobeamPrimaryGeneratorAction.cc,v 1.6 2006/06/29 16:05:35 gunter Exp $
// $Id: MicrobeamPrimaryGeneratorAction.cc,v 1.7 2007/08/27 15:51:54 gcosmo Exp $
// -------------------------------------------------------------------
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
@@ -83,7 +83,7 @@ void MicrobeamPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
}
while(theta>1.1e-6*rad);
phi=2*M_PI*G4UniformRand()*rad;
phi=CLHEP::twopi*G4UniformRand()*rad;
xMom0=std::sin(theta)*std::cos(phi);
yMom0=std::sin(theta)*std::sin(phi);
@@ -100,7 +100,7 @@ void MicrobeamPrimaryGeneratorAction::GeneratePrimaries(G4Event* anEvent)
G4cout
<< "-> Event # " << numEvent
<< " : THETA from Z axis (mrad) = " << theta*1000
<< " -- PHI (deg) = " << phi*180/M_PI
<< " -- PHI (deg) = " << phi*180/CLHEP::pi
<< " -- x0 (um) = " << x0/micrometer
<< " -- y0 (um) = " << y0/micrometer
<< " -- z0 (m) = " << z0/m
@@ -24,7 +24,7 @@
// ********************************************************************
//
// -------------------------------------------------------------------
// $Id: MicrobeamSteppingAction.cc,v 1.5 2006/06/29 16:05:39 gunter Exp $
// $Id: MicrobeamSteppingAction.cc,v 1.8 2007/08/22 13:58:33 sincerti Exp $
// -------------------------------------------------------------------
#include "G4SteppingManager.hh"
@@ -94,11 +94,21 @@ if ( ((aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() == "Polypr
fclose (myFile);
}
// Average dE over step syggested by Michel Maire
G4StepPoint* p1 = aStep->GetPreStepPoint();
G4ThreeVector coord1 = p1->GetPosition();
const G4AffineTransform transformation1 = p1->GetTouchable()->GetHistory()->GetTopTransform();
G4ThreeVector localPosition1 = transformation1.TransformPoint(coord1);
const G4AffineTransform transformation = p1->GetTouchable()->GetHistory()->GetTopTransform();
G4ThreeVector localPosition = transformation.TransformPoint(coord1);
G4StepPoint* p2 = aStep->GetPostStepPoint();
G4ThreeVector coord2 = p2->GetPosition();
const G4AffineTransform transformation2 = p2->GetTouchable()->GetHistory()->GetTopTransform();
G4ThreeVector localPosition2 = transformation2.TransformPoint(coord2);
G4ThreeVector localPosition = localPosition1 + G4UniformRand()*(localPosition2-localPosition1);
// end
FILE *myFile;
myFile=fopen("beamPosition.txt","a");
@@ -144,9 +154,8 @@ if (
// TOTAL DOSE DEPOSIT AND DOSE DEPOSIT WITHIN A PHANTOM VOXEL
if ( (aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() == "physicalNucleus")
&& (aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName() == "physicalNucleus")
&& (aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->GetParticleName() == "alpha") )
if (aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() == "physicalNucleus")
{
G4double dose = (e_SI*(aStep->GetTotalEnergyDeposit()/eV))/(Run->GetMassNucleus());
Run->AddDoseN(dose);
@@ -156,9 +165,9 @@ if ( (aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() == "physical
aStep->GetTotalEnergyDeposit()/eV);
}
if ( (aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() == "physicalCytoplasm")
&& (aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName() == "physicalCytoplasm")
&& (aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->GetParticleName() == "alpha") )
if (aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName() == "physicalCytoplasm")
{
G4double dose = (e_SI*(aStep->GetTotalEnergyDeposit()/eV))/(Run->GetMassCytoplasm());
Run->AddDoseC(dose);