|
||||
Warning, file /geant4/examples/advanced/underground_physics/src/DMXStackingAction.cc was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
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 // 0027 // -------------------------------------------------------------- 0028 // GEANT 4 - Underground Dark Matter Detector Advanced Example 0029 // 0030 // For information related to this code contact: Alex Howard 0031 // e-mail: alexander.howard@cern.ch 0032 // -------------------------------------------------------------- 0033 // Comments 0034 // 0035 // Underground Advanced 0036 // by A. Howard and H. Araujo 0037 // (27th November 2001) 0038 // 0039 // StackingAction program 0040 // -------------------------------------------------------------- 0041 0042 #include "DMXStackingAction.hh" 0043 0044 #include "DMXStackingActionMessenger.hh" 0045 #include "DMXDetectorConstruction.hh" 0046 0047 #include "G4Track.hh" 0048 #include "G4TrackStatus.hh" 0049 #include "G4VPhysicalVolume.hh" 0050 #include "G4Navigator.hh" 0051 #include "G4TransportationManager.hh" 0052 #include "G4ParticleDefinition.hh" 0053 #include "G4ParticleTypes.hh" 0054 0055 0056 0057 DMXStackingAction::DMXStackingAction() { 0058 0059 // new messenger 0060 theMessenger = new DMXStackingActionMessenger(this); 0061 0062 // messenger defaults 0063 killGammasFlag = 0; 0064 0065 // global geometry navigator 0066 gNavigator = G4TransportationManager::GetTransportationManager() 0067 ->GetNavigatorForTracking(); 0068 } 0069 0070 0071 DMXStackingAction::~DMXStackingAction() { 0072 0073 delete theMessenger; 0074 } 0075 0076 0077 G4ClassificationOfNewTrack DMXStackingAction::ClassifyNewTrack 0078 (const G4Track* aTrack) { 0079 0080 0081 static G4int gammasKilled = 0; 0082 0083 G4ClassificationOfNewTrack classification = fWaiting; 0084 0085 // Kill gammas from neutrons in concrete wall 0086 if(killGammasFlag) { 0087 // check if particle is gamma 0088 G4ParticleDefinition* particleType = aTrack->GetDefinition(); 0089 if(particleType==G4Gamma::GammaDefinition()) { 0090 // check if particle is in world_phys 0091 G4ThreeVector pos = aTrack->GetPosition(); 0092 G4ThreeVector *ptr = NULL; 0093 G4VPhysicalVolume *theVolume; 0094 theVolume = gNavigator->LocateGlobalPointAndSetup(pos,ptr,false); 0095 if(theVolume->GetName() == "world_phys") { 0096 classification = fKill; 0097 G4cout << " Total for session Gammas killed in concrete wall (world_phys): " 0098 << ++gammasKilled << G4endl; 0099 } 0100 } 0101 } 0102 0103 return classification; 0104 0105 } 0106 0107 0108 void DMXStackingAction::NewStage() {;} 0109 0110 0111 void DMXStackingAction::PrepareNewEvent() {;} 0112 0113 0114 0115
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |