- Timestamp:
- Nov 5, 2010, 4:08:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/electromagnetic/TestEm7/src/SteppingAction.cc
r1337 r1342 24 24 // ******************************************************************** 25 25 // 26 // $Id: SteppingAction.cc,v 1.1 4 2008/08/22 18:30:27 vnivanchExp $27 // GEANT4 tag $Name: geant4-09-04-beta-01$26 // $Id: SteppingAction.cc,v 1.15 2010/09/17 18:45:43 maire Exp $ 27 // GEANT4 tag $Name: examples-V09-03-09 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 32 32 #include "SteppingAction.hh" 33 33 #include "DetectorConstruction.hh" 34 #include "HistoManager.hh" 34 35 #include "RunAction.hh" 35 36 #include "G4SteppingManager.hh" … … 38 39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 39 40 40 SteppingAction::SteppingAction(DetectorConstruction* det,RunAction* RuAct) 41 :detector(det),runAction(RuAct) 41 SteppingAction::SteppingAction(DetectorConstruction* det, HistoManager* histo, 42 RunAction* RuAct) 43 :detector(det), histoManager(histo), runAction(RuAct) 42 44 { } 43 45 … … 49 51 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 50 52 51 void SteppingAction::UserSteppingAction(const G4Step* aStep)53 void SteppingAction::UserSteppingAction(const G4Step* step) 52 54 { 53 G4double edep = aStep->GetTotalEnergyDeposit();55 G4double edep = step->GetTotalEnergyDeposit(); 54 56 if (edep <= 0.) return; 57 58 G4double niel = step->GetNonIonizingEnergyDeposit(); 55 59 56 // G4cout << "edep= " << edep << "NIEL= " << aStep->GetNonIonizingEnergyDeposit()<<G4endl;60 runAction->FillEdep(edep, niel); 57 61 58 runAction->FillEdep(edep,aStep->GetNonIonizingEnergyDeposit()); 59 60 if(aStep->GetTrack()->GetTrackID() == 1) runAction->AddPrimaryStep(); 62 if (step->GetTrack()->GetTrackID() == 1) runAction->AddPrimaryStep(); 61 63 62 64 //Bragg curve 63 65 // 64 G4StepPoint* prePoint = aStep->GetPreStepPoint();65 G4StepPoint* postPoint = aStep->GetPostStepPoint();66 G4StepPoint* prePoint = step->GetPreStepPoint(); 67 G4StepPoint* postPoint = step->GetPostStepPoint(); 66 68 67 G4double x1 = prePoint->GetPosition().x(), x2 = postPoint->GetPosition().x(); 68 G4double x = runAction->GetOffsetX() + x1 + G4UniformRand()*(x2-x1); 69 runAction->FillHisto(0, x/mm , edep); 70 runAction->FillHisto(1, x/mm , edep); 69 G4double x1 = prePoint->GetPosition().x(); 70 G4double x2 = postPoint->GetPosition().x(); 71 G4double x = x1 + G4UniformRand()*(x2-x1) + 0.5*(detector->GetAbsorSizeX()); 72 histoManager->FillHisto(1, x, edep); 73 histoManager->FillHisto(2, x, edep); 71 74 72 75 //fill tallies
Note: See TracChangeset
for help on using the changeset viewer.