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 /// \file polarisation/Pol01/src/SteppingActio 27 /// \brief Implementation of the SteppingActio 28 // 29 // 30 //....oooOO0OOooo........oooOO0OOooo........oo 31 //....oooOO0OOooo........oooOO0OOooo........oo 32 33 #include "SteppingAction.hh" 34 35 #include "DetectorConstruction.hh" 36 #include "PrimaryGeneratorAction.hh" 37 #include "RunAction.hh" 38 39 #include "G4PolarizationHelper.hh" 40 #include "G4RunManager.hh" 41 42 //....oooOO0OOooo........oooOO0OOooo........oo 43 44 SteppingAction::SteppingAction(DetectorConstru 45 RunAction* ruAc 46 : G4UserSteppingAction(), fDetector(det), fP 47 {} 48 49 //....oooOO0OOooo........oooOO0OOooo........oo 50 51 SteppingAction::~SteppingAction() {} 52 53 //....oooOO0OOooo........oooOO0OOooo........oo 54 55 void SteppingAction::UserSteppingAction(const 56 { 57 G4StepPoint* prePoint = aStep->GetPreStepPoi 58 G4StepPoint* endPoint = aStep->GetPostStepPo 59 60 G4String procName = endPoint->GetProcessDefi 61 fRunAction->CountProcesses(procName); 62 63 if (prePoint->GetTouchableHandle()->GetVolum 64 && endPoint->GetTouchableHandle()->GetVo 65 { 66 G4Track* aTrack = aStep->GetTrack(); 67 const G4ParticleDefinition* part = aTrack- 68 // G4cout<<"a "<<particleName<<" left t 69 G4ThreeVector position = endPoint->GetPosi 70 G4ThreeVector direction = endPoint->GetMom 71 G4double kinEnergy = endPoint->GetKineticE 72 73 G4ThreeVector beamDirection = fPrimary->Ge 74 G4double polZ = endPoint->GetPolarization( 75 76 G4double costheta = direction * beamDirect 77 78 G4double xdir = direction * G4Polarization 79 G4double ydir = direction * G4Polarization 80 81 G4double phi = std::atan2(ydir, xdir); 82 fRunAction->FillData(part, kinEnergy, cost 83 } 84 } 85 86 //....oooOO0OOooo........oooOO0OOooo........oo 87