Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:04

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // This example is provided by the Geant4-DNA collaboration
0027 // Any report or published results obtained using the Geant4-DNA software
0028 // shall cite the following Geant4-DNA collaboration publication:
0029 // Med. Phys. 37 (2010) 4692-4708
0030 // and papers
0031 // M. Batmunkh et al. J Radiat Res Appl Sci 8 (2015) 498-507
0032 // O. Belov et al. Physica Medica 32 (2016) 1510-1520
0033 // The Geant4-DNA web site is available at http://geant4-dna.org
0034 //
0035 // -------------------------------------------------------------------
0036 // November 2016
0037 // -------------------------------------------------------------------
0038 //
0039 //
0040 /// \file ITTrackingAction.hh
0041 /// \brief Implementation of the ITTrackingAction class
0042 
0043 #include "ITTrackingAction.hh"
0044 
0045 #include "G4Molecule.hh"
0046 #include "G4PhysicalConstants.hh"
0047 #include "G4SystemOfUnits.hh"
0048 #include "G4Track.hh"
0049 #include "G4UnitsTable.hh"
0050 //
0051 // #include "NeuronHitCompartments.hh"
0052 #include "Run.hh"
0053 
0054 #include "G4H2O.hh"
0055 #include "G4LogicalVolume.hh"
0056 #include "G4LogicalVolumeStore.hh"
0057 #include "G4MoleculeCounter.hh"
0058 #include "G4MoleculeGun.hh"
0059 #include "G4MoleculeTable.hh"
0060 #include "G4PhysicalVolumeStore.hh"
0061 #include "G4RunManager.hh"
0062 #include "G4VPhysicalVolume.hh"
0063 
0064 #include <G4Scheduler.hh>
0065 #include <cmath>
0066 
0067 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0068 
0069 ITTrackingAction::ITTrackingAction() : G4UserTrackingAction() {}
0070 
0071 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0072 
0073 ITTrackingAction::~ITTrackingAction() {}
0074 
0075 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0076 
0077 void ITTrackingAction::PreUserTrackingAction(const G4Track* track)
0078 {
0079   // Target volumes
0080   G4VPhysicalVolume* volumeStep = track->GetTouchableHandle()->GetVolume();
0081   G4VPhysicalVolume* volumeMedium = G4PhysicalVolumeStore::GetInstance()->GetVolume("Medium");
0082   G4VPhysicalVolume* volumeSlice = G4PhysicalVolumeStore::GetInstance()->GetVolume("BoundingSlice");
0083 
0084   // count produced species in neuron
0085   G4Molecule* molecule = GetMolecule(track);
0086   // const G4String& moleculeName = molecule->GetName();
0087   // G4double GTime  = track->GetGlobalTime() /picosecond;
0088 
0089   Run* run = static_cast<Run*>(G4RunManager::GetRunManager()->GetNonConstCurrentRun());
0090   // run->MoleculeCount(moleculeName,GTime);
0091 
0092   // time steps
0093 
0094   // particles outside neuron structure
0095   // if (volumeStep == volumeMedium || volumeStep == volumeSlice)
0096   //{
0097   // run->MoleculeCount(molecule);
0098   //}
0099   // count secondary particles in neuron
0100   // else //
0101   if (volumeStep != volumeMedium && volumeStep != volumeSlice) {
0102     run->MoleculeCountNeuron(molecule);
0103     // run->MoleculeCountNeuron(moleculeName,GTime);
0104 
0105     // number of molecules at time of 1 ns !
0106     // if ( (GTime > T_1ns-3.) && (GTime <= T_1ns))
0107     // {
0108     //  if (moleculeName =="OH^0") // OH* radical
0109     //  {
0110     // fEventAction->MoleculeCountNeuron()
0111     // G4MoleculeCounter::Instance()->GetNMoleculesAtTime(moleculeName, GTime);
0112 
0113     //   }
0114     // }
0115   }
0116 }
0117 
0118 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0119 
0120 void ITTrackingAction::PostUserTrackingAction(const G4Track* /*track*/) {}