00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id$ 00028 // 00029 // ---------------------------------------------------------------------- 00030 // GEANT 4 class source file 00031 // 00032 // G4CellScorer.cc 00033 // 00034 // ---------------------------------------------------------------------- 00035 00036 #include "G4CellScorer.hh" 00037 #include "G4GeometryCell.hh" 00038 #include "G4Track.hh" 00039 #include "G4EventManager.hh" 00040 #include "G4Event.hh" 00041 00042 G4CellScorer::G4CellScorer() 00043 { 00044 G4cout << "--------------------------------------------------------" << G4endl 00045 << "WARNING: Class <G4CellScorer> is now obsolete |" << G4endl 00046 << " and will be removed starting from next Geant4 |" << G4endl 00047 << " major release. Please, consider switching to |" << G4endl 00048 << " general purpose scoring functionality. |" << G4endl 00049 << "--------------------------------------------------------" 00050 << G4endl; 00051 } 00052 00053 G4CellScorer::~G4CellScorer() 00054 {} 00055 00056 void G4CellScorer::ScoreAnExitingStep(const G4Step &aStep, 00057 const G4GeometryCell &pre_gCell){ 00058 fCellScoreComposer.EstimatorCalculation(aStep); 00059 ScorePopulation(pre_gCell, aStep); 00060 } 00061 00062 void G4CellScorer::ScoreAnEnteringStep(const G4Step &aStep, 00063 const G4GeometryCell &post_gCell){ 00064 // population counting 00065 ScorePopulation(post_gCell, aStep); 00066 // entering tracks 00067 fCellScoreComposer.TrackEnters(); 00068 } 00069 00070 void G4CellScorer::ScoreAnInVolumeStep(const G4Step &aStep, 00071 const G4GeometryCell &post_gCell){ 00072 // population counting 00073 ScorePopulation(post_gCell, aStep); 00074 // collisions counting 00075 if (aStep.GetPostStepPoint()->GetStepStatus() != fGeomBoundary) { 00076 fCellScoreComposer.SetCollisionWeight(aStep.GetTrack()->GetWeight()); 00077 } 00078 00079 // counting for step length estimators 00080 fCellScoreComposer.EstimatorCalculation(aStep); 00081 00082 } 00083 00084 void G4CellScorer::ScorePopulation(const G4GeometryCell &, 00085 const G4Step &aStep) { 00086 // check for new event 00087 fTrackLogger.SetEventID(G4EventManager::GetEventManager()-> 00088 GetConstCurrentEvent()-> 00089 GetEventID()); 00090 // increase population 00091 if (fTrackLogger.FirstEnterance(aStep.GetTrack()->GetTrackID())) { 00092 fCellScoreComposer.NewTrackPopedUp(); 00093 } 00094 } 00095 00096 const G4CellScoreComposer &G4CellScorer::GetCellScoreComposer() const { 00097 return fCellScoreComposer; 00098 } 00099 00100 const G4CellScoreValues &G4CellScorer::GetCellScoreValues() const { 00101 return fCellScoreComposer.GetStandardCellScoreValues(); 00102 } 00103