ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4CascadParticle.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4CascadParticle.hh
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 // 20100112 M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
28 // 20100126 M. Kelsey -- Replace vector<G4Double> position with G4ThreeVector,
29 // move ::print() to .cc file, fix uninitialized data members
30 // 20100915 M. Kelsey -- Make getGeneration() const
31 // 20110729 M. Kelsey -- Add initializer for _all_ data members (path, gen),
32 // re-organize declarations, with set/get pairs together
33 // 20110806 M. Kelsey -- Add fill() function to replicate ctor/op=() action
34 // 20110922 M. Kelsey -- Add stream argument to print(), add operator<<().
35 // 20120306 M. Kelsey -- Add access for cumulative path through nucleus.
36 // 20130221 M. Kelsey -- Move constructor to .cc file for parameter access.
37 // 20130304 M. Kelsey -- Add index data member, for use with G4CascadeHistory,
38 // and explicit copy operations and destructor.
39 
40 #ifndef G4CASCAD_PARTICLE_HH
41 #define G4CASCAD_PARTICLE_HH
42 
44 #include "G4LorentzVector.hh"
45 #include "G4ThreeVector.hh"
46 #include <iosfwd>
47 
48 
50 
51 public:
52  // NOTE: Default constructor does not make a functional object!
54 
56  const G4ThreeVector& pos, G4int izone, G4double cpath,
57  G4int gen);
58 
59  ~G4CascadParticle() {;} // No subclasses allowed
60 
61  // Allow copying of object data (for use with history and elsewhere)
62  // NOTE: history index IS copied (to avoid double counting)
63  G4CascadParticle(const G4CascadParticle& cpart) { *this = cpart; }
65 
66  // Analogue to operator=() to support filling vectors w/o temporaries
67  // NOTE: history index IS NOT copied (new particle is being made)
68  void fill(const G4InuclElementaryParticle& particle,
69  const G4ThreeVector& pos, G4int izone, G4double cpath,
70  G4int gen);
71 
72  // Data accessors
75 
76  G4int getGeneration() const { return generation; }
77  void setGeneration(G4int gen) { generation = gen; }
78 
79  G4int getHistoryId() const { return historyId; }
80  void setHistoryId(G4int id) { historyId = id; }
81 
82  G4LorentzVector getMomentum() const { // Can't return ref; temporary
83  return theParticle.getMomentum();
84  }
85 
88  }
89 
90  const G4ThreeVector& getPosition() const { return position; }
91  void updatePosition(const G4ThreeVector& pos) { position = pos; }
92 
95  reflected = true;
96  }
98 
99  void resetReflection() { reflected = false; }
100  G4bool reflectedNow() const { return reflected; }
101 
102  void initializePath(G4double npath) { current_path = npath; }
103  void incrementCurrentPath(G4double npath) { current_path += npath; }
105 
106  void updateZone(G4int izone) { current_zone = izone; }
107  G4int getCurrentZone() const { return current_zone; }
108 
109  void setMovingInsideNuclei(G4bool isMovingIn=true) { movingIn = isMovingIn; }
110  G4bool movingInsideNuclei() const { return movingIn; }
111 
113  void propagateAlongThePath(G4double path);
114 
115  G4bool young(G4double young_path_cut, G4double cpath) const {
116  return ((current_path < 1000.) && (cpath < young_path_cut));
117  }
118 
119  void print(std::ostream& os) const;
120 
121 private:
132 };
133 
134 // Proper stream output (just calls print())
135 
136 std::ostream& operator<<(std::ostream& os, const G4CascadParticle& part);
137 
138 #endif // G4CASCAD_PARTICLE_HH