Import Geant4 9.6.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 17:01:34 +02:00
parent b1eb5424d2
commit e2d2f9810a
10384 changed files with 698580 additions and 628834 deletions
@@ -23,12 +23,15 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: RE01StackingAction.cc,v 1.3 2010-11-24 22:47:23 asaim Exp $
// GEANT4 tag $Name: not supported by cvs2svn $
/// \file runAndEvent/RE01/src/RE01StackingAction.cc
/// \brief Implementation of the RE01StackingAction class
//
// $Id$
//
#include "RE01StackingAction.hh"
#include "RE01TrackInformation.hh"
#include "RE01CalorimeterHit.hh"
#include "G4SDManager.hh"
#include "G4RunManager.hh"
@@ -38,24 +41,26 @@
#include "G4TrackStatus.hh"
#include "G4ParticleDefinition.hh"
#include "G4ParticleTypes.hh"
#include "G4SystemOfUnits.hh"
#include "G4ios.hh"
#include "RE01TrackInformation.hh"
#include "RE01CalorimeterHit.hh"
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE01StackingAction::RE01StackingAction()
:stage(0),trackerHitsColID(-1),calorimeterHitsColID(-1)
{ ; }
:G4UserStackingAction(),
fStage(0),fCalorimeterHitsColID(-1)
{;}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
RE01StackingAction::~RE01StackingAction()
{ ; }
{;}
G4ClassificationOfNewTrack
RE01StackingAction::ClassifyNewTrack(const G4Track * aTrack)
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4ClassificationOfNewTrack RE01StackingAction
::ClassifyNewTrack(const G4Track * aTrack)
{
G4ClassificationOfNewTrack classification = fUrgent;
if(stage==0)
if(fStage==0)
{
RE01TrackInformation* trackInfo;
if(aTrack->GetTrackStatus()==fSuspend) // Track reached to calorimeter
@@ -63,8 +68,10 @@ RE01StackingAction::ClassifyNewTrack(const G4Track * aTrack)
trackInfo = (RE01TrackInformation*)(aTrack->GetUserInformation());
trackInfo->SetTrackingStatus(0);
trackInfo->SetSourceTrackInformation(aTrack);
// G4cout << "Track " << aTrack->GetTrackID() << " (parentID " << aTrack->GetParentID()
// << ") has reached to calorimeter and has been suspended at " << aTrack->GetPosition() << G4endl;
// G4cout << "Track " << aTrack->GetTrackID()
// << " (parentID " << aTrack->GetParentID()
// << ") has reached to calorimeter and has been suspended at "
// << aTrack->GetPosition() << G4endl;
classification = fWaiting;
}
else if(aTrack->GetParentID()==0) // Primary particle
@@ -78,39 +85,44 @@ RE01StackingAction::ClassifyNewTrack(const G4Track * aTrack)
return classification;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
G4VHitsCollection* RE01StackingAction::GetCalCollection()
{
G4SDManager* SDMan = G4SDManager::GetSDMpointer();
G4RunManager* runMan = G4RunManager::GetRunManager();
if(calorimeterHitsColID<0)
{ calorimeterHitsColID = SDMan->GetCollectionID("calCollection"); }
if(calorimeterHitsColID>=0)
if(fCalorimeterHitsColID<0)
{ fCalorimeterHitsColID = SDMan->GetCollectionID("calCollection"); }
if(fCalorimeterHitsColID>=0)
{
const G4Event* currentEvent = runMan->GetCurrentEvent();
G4HCofThisEvent* HCE = currentEvent->GetHCofThisEvent();
return HCE->GetHC(calorimeterHitsColID);
return HCE->GetHC(fCalorimeterHitsColID);
}
return 0;
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE01StackingAction::NewStage()
{
G4cout << "+++++++++++ Stage " << stage << G4endl;
if(stage==0)
G4cout << "+++++++++++ Stage " << fStage << G4endl;
if(fStage==0)
{
// display trajetory information in the tracking region
G4cout << G4endl;
G4cout << "Tracks in tracking region have been processed. -- Stage 0 over." << G4endl;
G4cout << "Tracks in tracking region have been processed. -- Stage 0 over."
<< G4endl;
G4cout << G4endl;
}
else
{
// display calorimeter information caused by a "source" track in the tracker region
// G4cout << G4endl;
// G4cout << "Processing one shower originated by a source track in tracker region is over." << G4endl;
// G4cout << G4endl;
RE01CalorimeterHitsCollection* CHC = (RE01CalorimeterHitsCollection*)GetCalCollection();
// display calorimeter information caused by a "source" track
// in the tracker region
// G4cout << G4endl;
// G4cout << "Processing one shower originated by a source track "
// << "in tracker region is over." << G4endl;
// G4cout << G4endl;
RE01CalorimeterHitsCollection* CHC =
(RE01CalorimeterHitsCollection*)GetCalCollection();
if(CHC)
{
int n_hit = CHC->entries();
@@ -125,15 +137,18 @@ G4cout << "+++++++++++ Stage " << stage << G4endl;
if(n_hitByATrack==0)
{ (*CHC)[i]->GetTrackInformation()->Print(); }
n_hitByATrack++;
G4cout << "Cell[" << (*CHC)[i]->GetZ() << "," << (*CHC)[i]->GetPhi() << "] "
G4cout << "Cell[" << (*CHC)[i]->GetZ() << ","
<< (*CHC)[i]->GetPhi() << "] "
<< edepByATrack/GeV << " [GeV]" << G4endl;
(*CHC)[i]->ClearEdepByATrack();
}
}
if(n_hitByATrack>0)
{
G4cout << "### Total energy deposition in calorimeter by a source track in "
<< n_hitByATrack << " cells : " << totE / GeV << " (GeV)" << G4endl;
G4cout <<
"### Total energy deposition in calorimeter by a source track in "
<< n_hitByATrack << " cells : " << totE / GeV << " (GeV)"
<< G4endl;
G4cout << G4endl;
}
}
@@ -149,13 +164,12 @@ G4cout << "+++++++++++ Stage " << stage << G4endl;
// Then, transfer only one track to Urgent stack.
stackManager->TransferOneStackedTrack(fWaiting,fUrgent);
stage++;
fStage++;
}
}
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
void RE01StackingAction::PrepareNewEvent()
{
stage = 0;
fStage = 0;
}