Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 /// \file runAndEvent/RE01/src/RE01SteppingAct << 23 // $Id: RE01SteppingAction.cc,v 1.1 2004/11/26 07:37:42 asaim Exp $ 27 /// \brief Implementation of the RE01SteppingA << 24 // GEANT4 tag $Name: geant4-07-00-patch-01 $ 28 // << 29 // 25 // 30 26 31 #include "RE01SteppingAction.hh" << 32 27 33 #include "RE01RegionInformation.hh" << 28 #include "RE01SteppingAction.hh" 34 #include "RE01TrackInformation.hh" << 29 #include "G4Track.hh" 35 << 36 #include "G4LogicalVolume.hh" << 37 #include "G4Region.hh" << 38 #include "G4Step.hh" 30 #include "G4Step.hh" 39 #include "G4StepPoint.hh" 31 #include "G4StepPoint.hh" 40 #include "G4SteppingManager.hh" << 41 #include "G4Track.hh" << 42 #include "G4TrackStatus.hh" 32 #include "G4TrackStatus.hh" 43 #include "G4VPhysicalVolume.hh" 33 #include "G4VPhysicalVolume.hh" >> 34 #include "G4LogicalVolume.hh" >> 35 #include "G4Region.hh" >> 36 #include "RE01RegionInformation.hh" 44 37 45 //....oooOO0OOooo........oooOO0OOooo........oo << 38 RE01SteppingAction::RE01SteppingAction() 46 RE01SteppingAction::RE01SteppingAction() : G4U << 39 {;} 47 { << 48 ; << 49 } << 50 40 51 //....oooOO0OOooo........oooOO0OOooo........oo << 52 RE01SteppingAction::~RE01SteppingAction() 41 RE01SteppingAction::~RE01SteppingAction() 53 { << 42 {;} 54 ; << 55 } << 56 43 57 //....oooOO0OOooo........oooOO0OOooo........oo << 44 void RE01SteppingAction::UserSteppingAction(const G4Step * theStep) 58 void RE01SteppingAction::UserSteppingAction(co << 59 { 45 { 60 // Suspend a track if it is entering into th 46 // Suspend a track if it is entering into the calorimeter 61 47 62 // check if it is alive 48 // check if it is alive 63 G4Track* theTrack = theStep->GetTrack(); << 49 G4Track * theTrack = theStep->GetTrack(); 64 if (theTrack->GetTrackStatus() != fAlive) { << 50 if(theTrack->GetTrackStatus()!=fAlive) { return; } 65 return; << 66 } << 67 51 68 // get region information 52 // get region information 69 G4StepPoint* thePrePoint = theStep->GetPreSt << 53 G4StepPoint * thePrePoint = theStep->GetPreStepPoint(); 70 G4LogicalVolume* thePreLV = thePrePoint->Get << 54 G4LogicalVolume * thePreLV = thePrePoint->GetPhysicalVolume()->GetLogicalVolume(); 71 RE01RegionInformation* thePreRInfo = << 55 RE01RegionInformation* thePreRInfo 72 (RE01RegionInformation*)(thePreLV->GetRegi << 56 = (RE01RegionInformation*)(thePreLV->GetRegion()->GetUserInformation()); 73 G4StepPoint* thePostPoint = theStep->GetPost << 57 G4StepPoint * thePostPoint = theStep->GetPostStepPoint(); 74 G4LogicalVolume* thePostLV = thePostPoint->G << 58 G4LogicalVolume * thePostLV = thePostPoint->GetPhysicalVolume()->GetLogicalVolume(); 75 RE01RegionInformation* thePostRInfo = << 59 RE01RegionInformation* thePostRInfo 76 (RE01RegionInformation*)(thePostLV->GetReg << 60 = (RE01RegionInformation*)(thePostLV->GetRegion()->GetUserInformation()); 77 61 78 // check if it is entering to the calorimete 62 // check if it is entering to the calorimeter volume 79 if (!(thePreRInfo->IsCalorimeter()) && (theP << 63 if(!(thePreRInfo->IsCalorimeter()) && (thePostRInfo->IsCalorimeter())) 80 // if the track had already been suspended << 64 { theTrack->SetTrackStatus(fSuspend); } 81 RE01TrackInformation* trackInfo = << 82 static_cast<RE01TrackInformation*>(theTr << 83 if (trackInfo->GetSuspendedStepID() > -1) << 84 if (fpSteppingManager->GetverboseLevel() << 85 G4cout << "++++ This track had already << 86 << trackInfo->GetSuspendedStepI << 87 } << 88 } << 89 else { << 90 trackInfo->SetSuspendedStepID(theTrack-> << 91 theTrack->SetTrackStatus(fSuspend); << 92 } << 93 } << 94 } 65 } >> 66 >> 67 95 68