Ignore:
Timestamp:
Nov 5, 2010, 4:08:39 PM (14 years ago)
Author:
garnier
Message:

update ti head

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/extended/electromagnetic/TestEm7/src/SteppingAction.cc

    r1337 r1342  
    2424// ********************************************************************
    2525//
    26 // $Id: SteppingAction.cc,v 1.14 2008/08/22 18:30:27 vnivanch Exp $
    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 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    3232#include "SteppingAction.hh"
    3333#include "DetectorConstruction.hh"
     34#include "HistoManager.hh"
    3435#include "RunAction.hh"
    3536#include "G4SteppingManager.hh"
     
    3839//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    3940
    40 SteppingAction::SteppingAction(DetectorConstruction* det,RunAction* RuAct)
    41 :detector(det),runAction(RuAct)
     41SteppingAction::SteppingAction(DetectorConstruction* det, HistoManager* histo,
     42                                RunAction* RuAct)
     43:detector(det), histoManager(histo), runAction(RuAct)
    4244{ }
    4345
     
    4951//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    5052
    51 void SteppingAction::UserSteppingAction(const G4Step* aStep)
     53void SteppingAction::UserSteppingAction(const G4Step* step)
    5254{
    53   G4double edep = aStep->GetTotalEnergyDeposit();
     55  G4double edep = step->GetTotalEnergyDeposit();
    5456  if (edep <= 0.) return;
     57 
     58  G4double niel = step->GetNonIonizingEnergyDeposit();
    5559
    56   // G4cout << "edep= " << edep << "NIEL= " << aStep->GetNonIonizingEnergyDeposit()<<G4endl;
     60  runAction->FillEdep(edep, niel);
    5761
    58   runAction->FillEdep(edep,aStep->GetNonIonizingEnergyDeposit());
    59 
    60   if(aStep->GetTrack()->GetTrackID() == 1) runAction->AddPrimaryStep(); 
     62  if (step->GetTrack()->GetTrackID() == 1) runAction->AddPrimaryStep(); 
    6163 
    6264  //Bragg curve
    6365  //   
    64   G4StepPoint* prePoint  = aStep->GetPreStepPoint();
    65   G4StepPoint* postPoint = aStep->GetPostStepPoint();
     66  G4StepPoint* prePoint  = step->GetPreStepPoint();
     67  G4StepPoint* postPoint = step->GetPostStepPoint();
    6668   
    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);
    7174
    7275  //fill tallies
Note: See TracChangeset for help on using the changeset viewer.