Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4AdjointTrackingAction.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id: G4AdjointTrackingAction.hh 75409 2013-11-01 00:31:00Z ldesorgh$
28 //
29 //
30 //---------------------------------------------------------------
31 //
32 // G4AdjointTrackingAction.hh
33 //
34 // class description:
35 // This class represents actions taken place at the
36 // the start/end point of processing one track during an adjoint simulation
37 //
38 //---------------------------------------------------------------
39 
40 
41 
42 #ifndef G4AdjointTrackingAction_h
43 #define G4AdjointTrackingAction_h 1
44 #include "globals.hh"
45 #include "G4UserTrackingAction.hh"
46 #include "G4ThreeVector.hh"
47 #include <vector>
49 class G4Track;
54 {
55 
56 //--------
57 public: // with description
58 //--------
59 
60 // Constructor & Destructor
62  virtual ~G4AdjointTrackingAction();
63 
64 // Member functions
65  virtual void PreUserTrackingAction(const G4Track*);
66  virtual void PostUserTrackingAction(const G4Track*);
69 
70 //inline methods
72  theUserFwdTrackingAction = anAction;}
73  inline G4ThreeVector GetPositionAtEndOfLastAdjointTrack(size_t i=0){ return last_pos_vec[i];}
74  inline G4ThreeVector GetDirectionAtEndOfLastAdjointTrack(size_t i=0){ return last_direction_vec[i];}
75  inline G4double GetEkinAtEndOfLastAdjointTrack(size_t i=0){ return last_ekin_vec[i];}
76  inline G4double GetEkinNucAtEndOfLastAdjointTrack(size_t i=0){ return last_ekin_nuc_vec[i];}
77  inline G4double GetWeightAtEndOfLastAdjointTrack(size_t i=0){return last_weight_vec[i];}
78  inline G4double GetCosthAtEndOfLastAdjointTrack(size_t i=0){return last_cos_th_vec[i];}
79  inline const G4String& GetFwdParticleNameAtEndOfLastAdjointTrack(){return last_fwd_part_name;}
80  inline G4int GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack(size_t i=0){return last_fwd_part_PDGEncoding_vec[i];}
81  inline G4bool GetIsAdjointTrackingMode(){return is_adjoint_tracking_mode;}
82  inline G4int GetLastFwdParticleIndex(size_t i=0){
83  return last_fwd_part_index_vec[i];};
84  inline size_t GetNbOfAdointTracksReachingTheExternalSurface(){return last_pos_vec.size();}
85  inline void SetListOfPrimaryFwdParticles( std::vector<G4ParticleDefinition*>*
86  aListOfParticles){pListOfPrimaryFwdParticles=aListOfParticles;}
87 
88 
89 private:
90  G4AdjointSteppingAction* theAdjointSteppingAction;
91  G4UserTrackingAction* theUserFwdTrackingAction;
92  G4bool is_adjoint_tracking_mode;
93 
94 
95  //adjoint particle information on the external surface
96  //-----------------------------
97  G4ThreeVector last_pos;
98  G4ThreeVector last_direction;
99  G4double last_ekin,last_ekin_nuc; //last_ekin_nuc=last_ekin/nuc, nuc is 1 if not a nucleus
100  G4double last_cos_th;
101  G4String last_fwd_part_name;
102  G4int last_fwd_part_PDGEncoding;
103  G4double last_weight;
104  G4int last_fwd_part_index;
105  std::vector<G4ParticleDefinition*>* pListOfPrimaryFwdParticles;
106 
107  std::vector<G4ThreeVector> last_pos_vec;
108  std::vector<G4ThreeVector> last_direction_vec;
109  std::vector<G4double> last_ekin_vec;
110  std::vector<G4double> last_ekin_nuc_vec;
111  std::vector<G4double> last_cos_th_vec;
112  std::vector<G4double> last_weight_vec;
113  std::vector<G4int> last_fwd_part_PDGEncoding_vec;
114  std::vector<G4int> last_fwd_part_index_vec;
115 
116 };
117 
118 #endif
119 
120 
G4int GetLastFwdParticleIndex(size_t i=0)
G4double GetEkinNucAtEndOfLastAdjointTrack(size_t i=0)
G4ThreeVector GetPositionAtEndOfLastAdjointTrack(size_t i=0)
const G4String & GetFwdParticleNameAtEndOfLastAdjointTrack()
G4AdjointTrackingAction(G4AdjointSteppingAction *anAction)
void SetListOfPrimaryFwdParticles(std::vector< G4ParticleDefinition * > *aListOfParticles)
G4double GetCosthAtEndOfLastAdjointTrack(size_t i=0)
int G4int
Definition: G4Types.hh:78
virtual void PreUserTrackingAction(const G4Track *)
bool G4bool
Definition: G4Types.hh:79
G4int GetFwdParticlePDGEncodingAtEndOfLastAdjointTrack(size_t i=0)
size_t GetNbOfAdointTracksReachingTheExternalSurface()
G4double GetEkinAtEndOfLastAdjointTrack(size_t i=0)
virtual void PostUserTrackingAction(const G4Track *)
double G4double
Definition: G4Types.hh:76
void SetUserForwardTrackingAction(G4UserTrackingAction *anAction)
G4ThreeVector GetDirectionAtEndOfLastAdjointTrack(size_t i=0)
G4double GetWeightAtEndOfLastAdjointTrack(size_t i=0)