- Timestamp:
- Nov 5, 2010, 4:08:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/electromagnetic/TestEm7/src/TrackingAction.cc
r1337 r1342 24 24 // ******************************************************************** 25 25 // 26 // $Id: TrackingAction.cc,v 1. 5 2008/08/22 18:30:27 vnivanchExp $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 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 32 32 #include "TrackingAction.hh" 33 33 34 #include "DetectorConstruction.hh" 35 #include "HistoManager.hh" 34 36 #include "RunAction.hh" 35 37 … … 38 40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 39 41 40 TrackingAction::TrackingAction(RunAction* run) 41 :runAction(run) 42 TrackingAction::TrackingAction(DetectorConstruction* det, HistoManager* histo, 43 RunAction* run) 44 :detector(det), histoManager(histo), runAction(run) 42 45 { } 43 46 44 47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... 45 48 46 void TrackingAction::PostUserTrackingAction(const G4Track* aTrack)49 void TrackingAction::PostUserTrackingAction(const G4Track* track) 47 50 { 48 51 // 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(); 54 54 if(x > 0.0) runAction->AddProjRange(x); 55 runAction->FillHisto(2, x/mm, 1.0);55 histoManager->FillHisto(3, x); 56 56 } 57 57 }
Note: See TracChangeset
for help on using the changeset viewer.