Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 // Code developed by 27 // Silvia Pozzi (1), silvia.pozzi@iss.it 28 // Barbara Caccia (1), barbara.caccia@iss.it 29 // Carlo Mancini Terracciano (2), carlo.mancin 30 // (1) Istituto Superiore di Sanita' and INFN 31 // (2) Univ. La Sapienza and INFN Roma, Italy 32 33 #include "DetectorConstruction.hh" 34 #include "SteppingAction.hh" 35 36 #include <G4RunManager.hh> 37 #include <G4Step.hh> 38 #include <G4SystemOfUnits.hh> 39 40 void SteppingAction::UserSteppingAction(const 41 { 42 DetectorConstruction* detector = (DetectorCo 43 G4RunManager::GetRunManager() -> GetUserDe 44 45 G4double fFilterZ = detector -> GetFFilterZ( 46 G4double fFilterRadius = detector -> GetFFil 47 48 G4String particleName; 49 50 G4VPhysicalVolume* volume = aStep -> GetPost 51 52 const G4ThreeVector momentumDir = aStep -> G 53 if (momentumDir.z() < 0) 54 { 55 aStep->GetTrack()->SetTrackStatus(fStopAnd 56 } 57 58 if ( volume != nullptr ) 59 { 60 G4String volumeName = volume -> GetName( 61 62 if (volumeName == "Jaw1XPV" || volumeNam 63 || volumeName == "Jaw1YPV" || volumeName = 64 { 65 aStep->GetTrack()->SetTrackStatus(fStopAnd 66 } 67 } 68 69 if (aStep -> GetPreStepPoint() -> GetTouchab 70 { 71 if (aStep -> GetPreStepPoint() -> GetTou 72 aStep -> GetPreStepPoint() -> GetTouchable 73 aStep -> GetPreStepPoint() -> GetTouchable 74 aStep -> GetPreStepPoint() -> GetTouchable 75 aStep -> GetPreStepPoint() -> GetTouchable 76 { 77 if (std::abs(momentumDir.getX()/momentumDi 78 std::abs(momentumDir.getY()/momentumDi 79 { 80 aStep->GetTrack()->SetTrackStatus(fSto 81 } 82 } 83 } 84 } 85