Import Geant4 6.2.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 10:56:29 +02:00
parent 1d812b78b1
commit e083ffb441
1415 changed files with 111223 additions and 21207 deletions
@@ -20,13 +20,10 @@
// * statement, and all its terms. *
// ********************************************************************
//
//
// $Id: TrackingAction.cc,v 1.3 2004/02/19 18:18:54 maire Exp $
// GEANT4 tag $Name: geant4-06-01 $
// $Id: TrackingAction.cc,v 1.8 2004/06/21 10:57:15 maire Exp $
// GEANT4 tag $Name: geant4-06-02 $
//
//
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -38,10 +35,6 @@
#include "HistoManager.hh"
#include "G4Track.hh"
#ifdef G4ANALYSIS_USE
#include "AIDA/IHistogram1D.h"
#endif
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
@@ -49,13 +42,13 @@ TrackingAction::TrackingAction(DetectorConstruction* DET,RunAction* RA,
EventAction* EA, HistoManager* HM)
:detector(DET), runaction(RA), eventaction(EA), histoManager(HM)
{ }
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void TrackingAction::PreUserTrackingAction(const G4Track* aTrack )
{
{
// few initialisations
//
//
if (aTrack->GetTrackID() == 1) {
worldLimit = 0.5*(detector->GetWorldSizeX());
primaryCharge = aTrack->GetDefinition()->GetPDGCharge();
@@ -79,11 +72,10 @@ void TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
if (aTrack->GetTrackID() == 1) flag = 2;
if (transmit) eventaction->SetTransmitFlag(flag);
if (reflect) eventaction->SetReflectFlag(flag);
#ifdef G4ANALYSIS_USE
//
//
//histograms
//
//
G4int id = 0;
G4bool charged = (charge != 0.);
G4bool neutral = !charged;
@@ -94,49 +86,48 @@ void TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
else if (transmit && neutral) id = 8;
else if (reflect && charged) id = 11;
else if (reflect && neutral) id = 14;
if (histoManager->GetHisto(id)) {
G4double energy = aTrack->GetKineticEnergy();
G4double unit = histoManager->GetHistoUnit(id);
histoManager->GetHisto(id)->fill(energy/unit);
}
histoManager->FillHisto(id, aTrack->GetKineticEnergy());
//space angle distribution at exit
//
if (transmit && charged) id = 5;
else if (transmit && neutral) id = 9;
else if (reflect && charged) id = 12;
else if (reflect && neutral) id = 15;
if (histoManager->GetHisto(id)) {
G4ThreeVector direction = aTrack->GetMomentumDirection();
G4double theta = acos(abs(direction.x()));
G4ThreeVector direction = aTrack->GetMomentumDirection();
if (histoManager->HistoExist(id)) {
G4double theta = acos(direction.x());
G4double dteta = histoManager->GetBinWidth(id);
G4double weight = 1./(2*pi*sin(theta)*dteta);
G4double weight = 1./(twopi*sin(theta)*dteta);
G4double unit = histoManager->GetHistoUnit(id);
histoManager->GetHisto(id)->fill(theta/unit,weight*unit*unit);
histoManager->FillHisto(id,theta,weight*unit*unit);
}
//projected angle distribution at exit
//projected angles distribution at exit
//
if (transmit && charged) id = 6;
else if (transmit && neutral) id = 10;
else if (reflect && charged) id = 13;
else if (reflect && neutral) id = 16;
if (histoManager->GetHisto(id)) {
G4ThreeVector momentum = aTrack->GetMomentum();
G4double unit = histoManager->GetHistoUnit(id);
histoManager->GetHisto(id)->fill(atan(momentum.y()/abs(momentum.x()))/unit);
histoManager->GetHisto(id)->fill(atan(momentum.z()/abs(momentum.x()))/unit);
if(id>0) {
G4double tet = atan(direction.y()/abs(direction.x()));
histoManager->FillHisto(id,tet);
if (transmit && (flag == 2)) runaction->AddMscProjTheta(tet);
tet = atan(direction.z()/abs(direction.x()));
histoManager->FillHisto(id,tet);
if (transmit && (flag == 2)) runaction->AddMscProjTheta(tet);
}
//projected position at exit
//
if (transmit && charged) id = 7;
if (histoManager->GetHisto(id)) {
G4double unit = histoManager->GetHistoUnit(id);
histoManager->GetHisto(id)->fill(position.y()/unit);
histoManager->GetHisto(id)->fill(position.z()/unit);
}
#endif
if (transmit && charged) {
histoManager->FillHisto(7, position.y());
histoManager->FillHisto(7, position.z());
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......