ACTARSim
ACTAR TPC Simulation Reference Guide
ActarSimSteppingAction.cc
Go to the documentation of this file.
1 // - AUTHOR: Hector Alvarez-Pol 11/2004
2 /******************************************************************
3  * Copyright (C) 2005-2016, Hector Alvarez-Pol *
4  * All rights reserved. *
5  * *
6  * License according to GNU LESSER GPL (see lgpl-3.0.txt). *
7  * For the list of contributors see CREDITS. *
8  ******************************************************************/
9 //////////////////////////////////////////////////////////////////
10 /// \class ActarSimSteppingAction
11 /// Controls the actions to perform during the steps. Note
12 /// that unneeded code lines at this point will affect performance.
13 /////////////////////////////////////////////////////////////////
14 
16 
17 #include "ActarSimROOTAnalysis.hh"
18 
20 #include "ActarSimEventAction.hh"
21 
22 #include "G4Track.hh"
23 
24 //////////////////////////////////////////////////////////////////
25 /// Constructor
28  :detector(det), eventaction(evt){
29  if(detector){ ; }
30  if(eventaction){ ; }
31 }
32 
33 //////////////////////////////////////////////////////////////////
34 /// Destructor
36 }
37 
38 //////////////////////////////////////////////////////////////////
39 /// G4 actions to perform every step. All actions moved to
40 /// ROOT analysis classes for easier ROOT output
41 void ActarSimSteppingAction::UserSteppingAction(const G4Step* aStep) {
42  const G4Track* track = aStep->GetTrack();
43  G4VPhysicalVolume* volume = track->GetVolume();
44  if(volume){;} // to quiet the compiler
45 
46  // collect energy and track length step by step
47  G4double edep = aStep->GetTotalEnergyDeposit();
48  if(edep){;} // to quiet the compiler
49 
50  G4double stepl = 0.;
51  if(stepl){;} // to quiet the compiler
52  if (track->GetDefinition()->GetPDGCharge() != 0. && track->GetParentID()==0)
53  stepl = aStep->GetStepLength();
54  else stepl = 0;
55 
56  // Histogramming
58  gActarSimROOTAnalysis->UserSteppingAction(aStep); // original
59  // gActarSimROOTAnalysis->UserSteppingAction(aStep,eventaction); // dypang 080225
60 
61  // save the random number seed of this event, under condition
62  // if(condition) G4RunManager::GetRunManager()->rndmSaveThisEvent();
63 }
void UserSteppingAction(const G4Step *)
Actions to perform in the analysis after each step.
void UserSteppingAction(const G4Step *)
ActarSimDetectorConstruction * detector
NOT USED.
ActarSimEventAction * eventaction
NOT USED.
ActarSimROOTAnalysis * gActarSimROOTAnalysis
Global pointer to this soliton.
ActarSimSteppingAction(ActarSimDetectorConstruction *, ActarSimEventAction *)
Constructor.