Changeset 1342 for trunk/examples/extended/electromagnetic/TestEm14/src
- Timestamp:
- Nov 5, 2010, 4:08:39 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/extended/electromagnetic/TestEm14/src/SteppingAction.cc
r1337 r1342 24 24 // ******************************************************************** 25 25 // 26 // $Id: SteppingAction.cc,v 1. 6 2010/04/02 13:22:02 maireExp $27 // GEANT4 tag $Name: geant4-09-04-beta-01$26 // $Id: SteppingAction.cc,v 1.7 2010/10/13 13:42:33 vnivanch Exp $ 27 // GEANT4 tag $Name: examples-V09-03-09 $ 28 28 // 29 29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo...... … … 34 34 #include "RunAction.hh" 35 35 #include "HistoManager.hh" 36 37 36 #include "G4RunManager.hh" 38 37 … … 53 52 void SteppingAction::UserSteppingAction(const G4Step* aStep) 54 53 { 55 G4StepPoint* endPoint = aStep->GetPostStepPoint();54 const G4StepPoint* endPoint = aStep->GetPostStepPoint(); 56 55 G4String procName = endPoint->GetProcessDefinedStep()->GetProcessName(); 57 56 G4bool transmit = (endPoint->GetStepStatus() <= fGeomBoundary); 58 if (transmit) runAction->CountProcesses(procName);57 if (transmit) { runAction->CountProcesses(procName); } 59 58 else { 60 59 //count real processes and sum track length … … 82 81 //secondaries 83 82 // 84 G4TrackVector* secondary = fpSteppingManager->GetSecondary();83 const G4TrackVector* secondary = fpSteppingManager->GetSecondary(); 85 84 for (size_t lp=0; lp<(*secondary).size(); lp++) { 86 85 G4double charge = (*secondary)[lp]->GetDefinition()->GetPDGCharge(); 87 if (charge != 0.) id = 3; else id = 5;86 if (charge != 0.) { id = 3; } else { id = 5; } 88 87 G4double energy = (*secondary)[lp]->GetKineticEnergy(); 89 88 histoManager->FillHisto(id,energy); 90 89 91 id++;90 ++id; 92 91 G4ThreeVector direction = (*secondary)[lp]->GetMomentumDirection(); 93 92 G4double costeta = direction.x(); … … 95 94 96 95 //energy tranferred to charged secondaries 97 if (charge != 0.) runAction->SumeTransf(energy);96 if (charge != 0.) { runAction->SumeTransf(energy); } 98 97 } 99 98
Note: See TracChangeset
for help on using the changeset viewer.