Import Geant4 11.3.0.beta source tree
This commit is contained in:
@@ -29,51 +29,53 @@
|
||||
//
|
||||
|
||||
#include "RE01StackingAction.hh"
|
||||
#include "RE01TrackInformation.hh"
|
||||
#include "RE01CalorimeterHit.hh"
|
||||
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "RE01CalorimeterHit.hh"
|
||||
#include "RE01TrackInformation.hh"
|
||||
|
||||
#include "G4Event.hh"
|
||||
#include "G4HCofThisEvent.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4TrackStatus.hh"
|
||||
#include "G4ParticleDefinition.hh"
|
||||
#include "G4ParticleTypes.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4SDManager.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
#include "G4Track.hh"
|
||||
#include "G4TrackStatus.hh"
|
||||
#include "G4ios.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
RE01StackingAction::RE01StackingAction()
|
||||
:G4UserStackingAction(),
|
||||
fStage(0),fCalorimeterHitsColID(-1)
|
||||
{;}
|
||||
: G4UserStackingAction(), fStage(0), fCalorimeterHitsColID(-1)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
RE01StackingAction::~RE01StackingAction()
|
||||
{;}
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
G4ClassificationOfNewTrack RE01StackingAction
|
||||
::ClassifyNewTrack(const G4Track * aTrack)
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
G4ClassificationOfNewTrack RE01StackingAction ::ClassifyNewTrack(const G4Track* aTrack)
|
||||
{
|
||||
G4ClassificationOfNewTrack classification = fUrgent;
|
||||
|
||||
if(fStage==0)
|
||||
{
|
||||
if (fStage == 0) {
|
||||
RE01TrackInformation* trackInfo;
|
||||
if(aTrack->GetTrackStatus()==fSuspend) // Track reached to calorimeter
|
||||
if (aTrack->GetTrackStatus() == fSuspend) // Track reached to calorimeter
|
||||
{
|
||||
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
|
||||
else if (aTrack->GetParentID() == 0) // Primary particle
|
||||
{
|
||||
trackInfo = new RE01TrackInformation(aTrack);
|
||||
trackInfo->SetTrackingStatus(1);
|
||||
@@ -84,15 +86,15 @@ G4ClassificationOfNewTrack RE01StackingAction
|
||||
return classification;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
G4VHitsCollection* RE01StackingAction::GetCalCollection()
|
||||
{
|
||||
G4SDManager* SDMan = G4SDManager::GetSDMpointer();
|
||||
G4RunManager* runMan = G4RunManager::GetRunManager();
|
||||
if(fCalorimeterHitsColID<0)
|
||||
{ fCalorimeterHitsColID = SDMan->GetCollectionID("calCollection"); }
|
||||
if(fCalorimeterHitsColID>=0)
|
||||
{
|
||||
if (fCalorimeterHitsColID < 0) {
|
||||
fCalorimeterHitsColID = SDMan->GetCollectionID("calCollection");
|
||||
}
|
||||
if (fCalorimeterHitsColID >= 0) {
|
||||
const G4Event* currentEvent = runMan->GetCurrentEvent();
|
||||
G4HCofThisEvent* HCE = currentEvent->GetHCofThisEvent();
|
||||
return HCE->GetHC(fCalorimeterHitsColID);
|
||||
@@ -100,75 +102,64 @@ G4VHitsCollection* RE01StackingAction::GetCalCollection()
|
||||
return 0;
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
void RE01StackingAction::NewStage()
|
||||
{
|
||||
// G4cout << "+++++++++++ Stage " << fStage << G4endl;
|
||||
if(fStage==0)
|
||||
{
|
||||
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
|
||||
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();
|
||||
if(CHC)
|
||||
{
|
||||
RE01CalorimeterHitsCollection* CHC = (RE01CalorimeterHitsCollection*)GetCalCollection();
|
||||
if (CHC) {
|
||||
int n_hit = CHC->entries();
|
||||
G4double totE = 0;
|
||||
G4int n_hitByATrack = 0;
|
||||
for(int i=0;i<n_hit;i++)
|
||||
{
|
||||
for (int i = 0; i < n_hit; i++) {
|
||||
G4double edepByATrack = (*CHC)[i]->GetEdepByATrack();
|
||||
if(edepByATrack>0.)
|
||||
{
|
||||
if (edepByATrack > 0.) {
|
||||
totE += edepByATrack;
|
||||
if(n_hitByATrack==0)
|
||||
{ (*CHC)[i]->GetTrackInformation()->Print(); }
|
||||
if (n_hitByATrack == 0) {
|
||||
(*CHC)[i]->GetTrackInformation()->Print();
|
||||
}
|
||||
n_hitByATrack++;
|
||||
G4cout << "Cell[" << (*CHC)[i]->GetZ() << ","
|
||||
<< (*CHC)[i]->GetPhi() << "] "
|
||||
<< edepByATrack/GeV << " [GeV]" << G4endl;
|
||||
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;
|
||||
if (n_hitByATrack > 0) {
|
||||
G4cout << "### Total energy deposition in calorimeter by a source track in "
|
||||
<< n_hitByATrack << " cells : " << totE / GeV << " (GeV)" << G4endl;
|
||||
G4cout << G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(stackManager->GetNUrgentTrack())
|
||||
{
|
||||
if (stackManager->GetNUrgentTrack()) {
|
||||
// Transfer all tracks in Urgent stack to Waiting stack, since all tracks
|
||||
// in Waiting stack have already been transfered to Urgent stack before
|
||||
// invokation of this method.
|
||||
stackManager->TransferStackedTracks(fUrgent,fWaiting);
|
||||
stackManager->TransferStackedTracks(fUrgent, fWaiting);
|
||||
|
||||
// Then, transfer only one track to Urgent stack.
|
||||
stackManager->TransferOneStackedTrack(fWaiting,fUrgent);
|
||||
stackManager->TransferOneStackedTrack(fWaiting, fUrgent);
|
||||
|
||||
fStage++;
|
||||
}
|
||||
}
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
void RE01StackingAction::PrepareNewEvent()
|
||||
{
|
||||
fStage = 0;
|
||||
{
|
||||
fStage = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user