Geant4_10
G4ITReactionChange.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 // $Id: G4ITReactionChange.hh 64057 2012-10-30 15:04:49Z gcosmo $
27 //
28 // Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
29 //
30 // WARNING : This class is released as a prototype.
31 // It might strongly evolve or even disapear in the next releases.
32 //
33 // History:
34 // -----------
35 // 10 Oct 2011 M.Karamitros created
36 //
37 // -------------------------------------------------------------------
38 
39 #ifndef G4ITReactionChange_H
40 #define G4ITReactionChange_H
41 
42 #include "globals.hh"
43 #include "G4ParticleChange.hh"
44 #include "G4TrackFastVector.hh"
45 
51 {
52 public:
56  virtual ~G4ITReactionChange();
57 
58  //_____________________________________________________
59  // To be used by reaction processes
60  void Initialize(const G4Track&,
61  const G4Track&,
62  G4VParticleChange* particleChangeA = 0,
63  G4VParticleChange* particleChangeB = 0
64  ) ;
65  void AddSecondary(G4Track* aSecondary);
66  inline void KillParents(G4bool);
67 
68  // If both parents are not killed therefore
69  // we can used the particle change
70  // you will have to give the pointers
71  // of your particleChange while intializing
72  // but it might tell you that energy is not
73  // conserved for instance
75 
76  //_____________________________________________________
77  // Not to be used in reaction processes
78  void UpdateStepInfo(G4Step*, G4Step*);
79  G4Track* GetSecondary(G4int) const;
81 
83  G4bool WereParentsKilled() const;
84 
85  const G4Track* GetTrackA();
86  const G4Track* GetTrackB();
87 
88 protected:
98  // equal/unequal operator
100  G4bool operator!=(const G4ITReactionChange &right) const;
101  // "equal" means that the objects have the same pointer.
102 protected:
103  std::map<const G4Track*, G4VParticleChange*> fParticleChange;
108 };
109 
111 {
112  return (*fSecondaries)[anIndex];
113 }
114 
116 {
117  return fNumberOfSecondaries;
118 }
119 
121 {
122  fKillParents = kill;
123 }
124 
126 {
127  return fKillParents ;
128 }
129 
131 {
132  return fSecondaries;
133 }
134 
135 #endif // G4ITReactionChange_H
const G4Track * GetTrackA()
G4TrackFastVector * GetfSecondary()
G4int GetNumberOfSecondaries() const
int G4int
Definition: G4Types.hh:78
G4bool operator==(const G4ITReactionChange &right) const
G4VParticleChange * GetParticleChange(const G4Track *)
G4ITReactionChange & operator=(const G4ITReactionChange &other)
void UpdateStepInfo(G4Step *, G4Step *)
void Initialize(const G4Track &, const G4Track &, G4VParticleChange *particleChangeA=0, G4VParticleChange *particleChangeB=0)
bool G4bool
Definition: G4Types.hh:79
Definition: G4Step.hh:76
G4Track * GetSecondary(G4int) const
const G4Track * GetTrackB()
std::map< const G4Track *, G4VParticleChange * > fParticleChange
G4bool operator!=(const G4ITReactionChange &right) const
G4bool WereParentsKilled() const
G4TrackFastVector * fSecondaries
void AddSecondary(G4Track *aSecondary)