Import Geant4 10.0.0 source tree
This commit is contained in:
@@ -32,8 +32,6 @@
|
||||
// Institute in the framework of the MC-INFN Group
|
||||
//
|
||||
|
||||
#include <CLHEP/Units/SystemOfUnits.h>
|
||||
|
||||
#include "G4SteppingManager.hh"
|
||||
#include "G4TrackVector.hh"
|
||||
#include "HadrontherapySteppingAction.hh"
|
||||
@@ -47,10 +45,11 @@
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4UserEventAction.hh"
|
||||
|
||||
#include "HadrontherapyAnalysisManager.hh"
|
||||
|
||||
#include "G4TransportationManager.hh"
|
||||
#include "G4VSensitiveDetector.hh"
|
||||
#include "HadrontherapyRunAction.hh"
|
||||
#include "HadrontherapyAnalysisManager.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
HadrontherapySteppingAction::HadrontherapySteppingAction( HadrontherapyRunAction *run)
|
||||
@@ -66,9 +65,22 @@ HadrontherapySteppingAction::~HadrontherapySteppingAction()
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
void HadrontherapySteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
{
|
||||
// G4TransportationManager* tManager = G4TransportationManager::GetTransportationManager();
|
||||
//G4VPhysicalVolume* pW = tManager->GetParallelWorld ("DetectorROGeometry");
|
||||
|
||||
//G4Navigator* gNav = tManager->GetNavigator(pW);
|
||||
|
||||
// G4VPhysicalVolume* currentVol = gNav->LocateGlobalPointAndSetup(aStep->GetTrack()->GetPosition());
|
||||
|
||||
// G4cout << "Step: " << currentVol->GetName() << " " << aStep->GetTrack()->GetPosition() << G4endl;
|
||||
//G4cout << "G4LogicalVolume: = " << currentVol->GetLogicalVolume()->GetName() << G4endl;
|
||||
//if (currentVol->GetLogicalVolume()->GetSensitiveDetector())
|
||||
// G4cout << "Sensitive Detector: " << currentVol->GetLogicalVolume()->GetSensitiveDetector()->GetName() << G4endl;
|
||||
|
||||
|
||||
/*
|
||||
// USEFULL METHODS TO RETRIEVE INFORMATION DURING THE STEPS
|
||||
if( (aStep->GetTrack()->GetVolume()->GetName() == "DetectorPhys")
|
||||
if( (aStep->GetTLocateGlobalPointAndSeturack()->GetVolume()->GetName() == "DetectorPhys")
|
||||
&& aStep->GetTrack()->GetDefinition()->GetParticleName() == "proton")
|
||||
//G4int evtNb = G4RunManager::GetRunManager()->GetCurrentEvent() -> GetEventID();
|
||||
{
|
||||
@@ -90,18 +102,18 @@ void HadrontherapySteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
if(particleType == "nucleus") {
|
||||
G4int A = def->GetBaryonNumber();
|
||||
G4double Z = def->GetPDGCharge();
|
||||
G4double posX = aStep->GetTrack()->GetPosition().x() / CLHEP::cm;
|
||||
G4double posY = aStep->GetTrack()->GetPosition().y() / CLHEP::cm;
|
||||
G4double posZ = aStep->GetTrack()->GetPosition().z() / CLHEP::cm;
|
||||
G4double energy = secondaryParticleKineticEnergy / A / CLHEP::MeV;
|
||||
G4double posX = aStep->GetTrack()->GetPosition().x() / cm;
|
||||
G4double posY = aStep->GetTrack()->GetPosition().y() / cm;
|
||||
G4double posZ = aStep->GetTrack()->GetPosition().z() / cm;
|
||||
G4double energy = secondaryParticleKineticEnergy / A / MeV;
|
||||
|
||||
HadrontherapyAnalysisManager* analysisMgr = HadrontherapyAnalysisManager::GetInstance();
|
||||
analysisMgr->FillFragmentTuple(A, Z, energy, posX, posY, posZ);
|
||||
} else if(particleName == "proton") { // proton (hydrogen-1) is a special case
|
||||
G4double posX = aStep->GetTrack()->GetPosition().x() / CLHEP::cm ;
|
||||
G4double posY = aStep->GetTrack()->GetPosition().y() / CLHEP::cm ;
|
||||
G4double posZ = aStep->GetTrack()->GetPosition().z() / CLHEP::cm ;
|
||||
G4double energy = secondaryParticleKineticEnergy * CLHEP::MeV; // Hydrogen-1: A = 1, Z = 1
|
||||
G4double posX = aStep->GetTrack()->GetPosition().x() / cm ;
|
||||
G4double posY = aStep->GetTrack()->GetPosition().y() / cm ;
|
||||
G4double posZ = aStep->GetTrack()->GetPosition().z() / cm ;
|
||||
G4double energy = secondaryParticleKineticEnergy * MeV; // Hydrogen-1: A = 1, Z = 1
|
||||
HadrontherapyAnalysisManager::GetInstance()->FillFragmentTuple(1, 1.0, energy, posX, posY, posZ);
|
||||
}
|
||||
|
||||
@@ -111,19 +123,19 @@ void HadrontherapySteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
HadrontherapyAnalysisManager* analysis = HadrontherapyAnalysisManager::GetInstance();
|
||||
//There is a bunch of stuff recorded with the energy 0, something should perhaps be done about this.
|
||||
if(secondaryParticleName == "proton") {
|
||||
analysis->hydrogenEnergy(secondaryParticleKineticEnergy / CLHEP::MeV);
|
||||
analysis->hydrogenEnergy(secondaryParticleKineticEnergy / MeV);
|
||||
}
|
||||
if(secondaryParticleName == "deuteron") {
|
||||
analysis->hydrogenEnergy((secondaryParticleKineticEnergy/2) / CLHEP::MeV);
|
||||
analysis->hydrogenEnergy((secondaryParticleKineticEnergy/2) / MeV);
|
||||
}
|
||||
if(secondaryParticleName == "triton") {
|
||||
analysis->hydrogenEnergy((secondaryParticleKineticEnergy/3) / CLHEP::MeV);
|
||||
analysis->hydrogenEnergy((secondaryParticleKineticEnergy/3) / MeV);
|
||||
}
|
||||
if(secondaryParticleName == "alpha") {
|
||||
analysis->heliumEnergy((secondaryParticleKineticEnergy/4) / CLHEP::MeV);
|
||||
analysis->heliumEnergy((secondaryParticleKineticEnergy/4) / MeV);
|
||||
}
|
||||
if(secondaryParticleName == "He3"){
|
||||
analysis->heliumEnergy((secondaryParticleKineticEnergy/3) / CLHEP::MeV);
|
||||
analysis->heliumEnergy((secondaryParticleKineticEnergy/3) / MeV);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -179,19 +191,19 @@ void HadrontherapySteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
HadrontherapyAnalysisManager* analysis = HadrontherapyAnalysisManager::GetInstance();
|
||||
|
||||
if (secondaryParticleName == "e-")
|
||||
analysis -> electronEnergyDistribution(secondaryParticleKineticEnergy/CLHEP::MeV);
|
||||
analysis -> electronEnergyDistribution(secondaryParticleKineticEnergy/MeV);
|
||||
|
||||
if (secondaryParticleName == "gamma")
|
||||
analysis -> gammaEnergyDistribution(secondaryParticleKineticEnergy/CLHEP::MeV);
|
||||
analysis -> gammaEnergyDistribution(secondaryParticleKineticEnergy/MeV);
|
||||
|
||||
if (secondaryParticleName == "deuteron")
|
||||
analysis -> deuteronEnergyDistribution(secondaryParticleKineticEnergy/CLHEP::MeV);
|
||||
analysis -> deuteronEnergyDistribution(secondaryParticleKineticEnergy/MeV);
|
||||
|
||||
if (secondaryParticleName == "triton")
|
||||
analysis -> tritonEnergyDistribution(secondaryParticleKineticEnergy/CLHEP::MeV);
|
||||
analysis -> tritonEnergyDistribution(secondaryParticleKineticEnergy/MeV);
|
||||
|
||||
if (secondaryParticleName == "alpha")
|
||||
analysis -> alphaEnergyDistribution(secondaryParticleKineticEnergy/CLHEP::MeV);
|
||||
analysis -> alphaEnergyDistribution(secondaryParticleKineticEnergy/MeV);
|
||||
|
||||
G4double z = (*fSecondary)[lp1]-> GetDynamicParticle() -> GetDefinition() -> GetPDGCharge();
|
||||
if (z > 0.)
|
||||
@@ -201,7 +213,7 @@ void HadrontherapySteppingAction::UserSteppingAction(const G4Step* aStep)
|
||||
|
||||
// If a generic ion is originated in the detector, its baryonic number, PDG charge,
|
||||
// total number of electrons in the orbitals are stored in a ntuple
|
||||
analysis -> genericIonInformation(a, z, electronOccupancy, secondaryParticleKineticEnergy/CLHEP::MeV);
|
||||
analysis -> genericIonInformation(a, z, electronOccupancy, secondaryParticleKineticEnergy/MeV);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user