Import Geant4 10.5.0 source tree

This commit is contained in:
Gabriele Cosmo
2018-12-07 15:15:39 +01:00
parent 6aa23be517
commit db49709b53
11370 changed files with 187480 additions and 160142 deletions
@@ -65,11 +65,11 @@ void HadrontherapySteppingAction::UserSteppingAction(const G4Step* aStep)
// G4Track* theTrack = aStep->GetTrack();
//G4StepPoint* PreStep = aStep->GetPreStepPoint();
//G4StepPoint* PostStep = aStep->GetPostStepPoint();
G4StepPoint* PreStep = aStep->GetPreStepPoint();
G4StepPoint* PostStep = aStep->GetPostStepPoint();
//G4TouchableHandle touchPreStep = PreStep->GetTouchableHandle();
//G4TouchableHandle touchPostStep = PostStep->GetTouchableHandle();
G4TouchableHandle touchPreStep = PreStep->GetTouchableHandle();
G4TouchableHandle touchPostStep = PostStep->GetTouchableHandle();
//G4double PreStepX =PreStep->GetPosition().x();
//G4double PreStepY =PreStep->GetPosition().y();
@@ -79,14 +79,12 @@ void HadrontherapySteppingAction::UserSteppingAction(const G4Step* aStep)
//G4double PostStepY =PostStep->GetPosition().y();
//G4double PostStepZ =PostStep->GetPosition().z();
//To get the current volume:
//G4VPhysicalVolume* volumePre = touchPreStep->GetVolume();
G4VPhysicalVolume* volumePre = touchPreStep->GetVolume();
//G4VPhysicalVolume* volumePost =touchPostStep->GetVolume();
//To get its name:
//G4String namePre = volumePre->GetName();
G4String namePre = volumePre->GetName();
// positions in the global coordinate system:
@@ -98,27 +96,56 @@ void HadrontherapySteppingAction::UserSteppingAction(const G4Step* aStep)
//G4double parentID =aStep->GetTrack()->GetParentID();
//G4double trackID =aStep->GetTrack()->GetTrackID();
//G4double eKin = aStep -> GetPreStepPoint() -> GetKineticEnergy();
G4double eKin = aStep -> GetPreStepPoint() -> GetKineticEnergy();
//G4double PosX = aStep->GetTrack()->GetPosition().x();
//G4double PosY = aStep->GetTrack()->GetPosition().y();
//G4double PosZ = aStep->GetTrack()->GetPosition().z();
G4double PosX = aStep->GetTrack()->GetPosition().x();
G4double PosY = aStep->GetTrack()->GetPosition().y();
G4double PosZ = aStep->GetTrack()->GetPosition().z();
G4String volume= aStep->GetTrack()->GetVolume()->GetName();
G4Track* theTrack = aStep->GetTrack();
//G4String material= aStep -> GetTrack() -> GetMaterial() -> GetName();
//G4cout << "material " << material << G4endl;
//G4String volume= aStep->GetTrack()->GetVolume()->GetName();
//G4String pvname= pv-> GetName();
G4String particleName = aStep->GetTrack()->GetDefinition()->GetParticleName();
G4double momentumX = aStep->GetTrack()->GetMomentumDirection().x();
G4double momentumY = aStep->GetTrack()->GetMomentumDirection().y();
G4double momentumZ = aStep->GetTrack()->GetMomentumDirection().z();
G4ParticleDefinition *particleDef = theTrack -> GetDefinition();
G4int pdg = particleDef ->GetPDGEncoding();
if(namePre == "VirtualLayer")
{
std::ofstream WriteDataIn("Virtual_Layer.txt", std::ios::app);
WriteDataIn
<< eKin <<" " // 1
<< PosX <<" " // 2
<< PosY <<" " // 3
<< PosZ <<" " // 4
<< momentumX <<" " // 5
<< momentumY <<" " // 6
<< momentumZ <<" " // 7
<< pdg
//<< theTrack << '\t' << " "
<< G4endl;
theTrack -> SetTrackStatus(fKillTrackAndSecondaries);
}
}