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/TrackingAction.cc

    r1337 r1342  
    2424// ********************************************************************
    2525//
    26 // $Id: TrackingAction.cc,v 1.5 2008/08/22 18:30:27 vnivanch Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: TrackingAction.cc,v 1.6 2010/09/17 18:45:43 maire Exp $
     27// GEANT4 tag $Name: examples-V09-03-09 $
    2828//
    2929//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
     
    3232#include "TrackingAction.hh"
    3333
     34#include "DetectorConstruction.hh"
     35#include "HistoManager.hh"
    3436#include "RunAction.hh"
    3537
     
    3840//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    3941
    40 TrackingAction::TrackingAction(RunAction* run)
    41 :runAction(run)
     42TrackingAction::TrackingAction(DetectorConstruction* det, HistoManager* histo,
     43                               RunAction* run)
     44:detector(det), histoManager(histo), runAction(run)
    4245{ }
    4346
    4447//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
    4548
    46 void TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
     49void TrackingAction::PostUserTrackingAction(const G4Track* track)
    4750{
    4851  // extract Projected Range of primary particle
    49   if (aTrack->GetTrackID() == 1) {
    50     G4double x = aTrack->GetPosition().x() + runAction->GetOffsetX();
    51     if(x > runAction->GetLength()) x = runAction->GetLength();
    52     //G4cout << " range= " << x << " x= " << aTrack->GetPosition().x()
    53     //     << " ofset= " << runAction->GetOffsetX() << G4endl;
     52  if (track->GetTrackID() == 1) {
     53    G4double x = track->GetPosition().x() + 0.5*detector->GetAbsorSizeX();
    5454    if(x > 0.0) runAction->AddProjRange(x);
    55     runAction->FillHisto(2, x/mm, 1.0);
     55    histoManager->FillHisto(3, x);
    5656  } 
    5757}
Note: See TracChangeset for help on using the changeset viewer.