source: trunk/source/processes/hadronic/models/cascade/cascade/include/G4LorentzConvertor.hh @ 1315

Last change on this file since 1315 was 1315, checked in by garnier, 14 years ago

update geant4-09-04-beta-cand-01 interfaces-V09-03-09 vis-V09-03-08

File size: 4.8 KB
Line 
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// $Id: G4LorentzConvertor.hh,v 1.15 2010/05/21 17:56:34 mkelsey Exp $
26// Geant4 tag: $Name: geant4-09-04-beta-cand-01 $
27//
28// 20100108  Michael Kelsey -- Use G4LorentzVector internally
29// 20100120  M. Kelsey -- BUG FIX:  scm_momentum should be G4ThreeVector
30// 20100126  M. Kelsey -- Remove G4CascadeMomentum, use G4LorentzVector directly
31// 20100519  M. Kelsey -- Add interfaces to pass G4InuclParticles directly
32
33#ifndef G4LORENTZ_CONVERTOR_HH
34#define G4LORENTZ_CONVERTOR_HH
35
36#include "globals.hh"
37#include "G4LorentzVector.hh"
38#include "G4ThreeVector.hh"
39
40class G4InuclParticle;
41
42class G4LorentzConvertor {
43
44public:
45
46  G4LorentzConvertor();
47
48  G4LorentzConvertor(const G4LorentzVector& bmom, G4double bmass, 
49                     const G4LorentzVector& tmom, G4double tmass) {
50    setBullet(bmom, bmass);
51    setTarget(tmom, tmass);
52  }
53
54  G4LorentzConvertor(const G4InuclParticle* bullet, 
55                     const G4InuclParticle* target) {
56    setBullet(bullet);
57    setTarget(target);
58  }
59
60  void setVerbose(G4int vb=0) { verboseLevel = vb; }
61
62  void setBullet(const G4InuclParticle* bullet);
63  void setTarget(const G4InuclParticle* target);
64
65  void setBullet(const G4InuclParticle& bullet) { setBullet(&bullet); }
66  void setTarget(const G4InuclParticle& target) { setTarget(&target); }
67
68  // Use correct four-vectors as input
69  void setBullet(const G4LorentzVector& bmom) { bullet_mom = bmom; }
70  void setTarget(const G4LorentzVector& bmom) { target_mom = bmom; }
71
72  // NOTE:  These functions "repair" input 4-vectors using specified mass
73  void setBullet(const G4LorentzVector& bmom, G4double bmass) {
74    bullet_mom.setVectM(bmom.vect(), bmass);
75
76    //  G4cout << " bullet: e " << bullet_mom.e() << " mass "
77    //         << bullet_mom.m() << G4endl;
78  };
79
80  void setTarget(const G4LorentzVector& tmom, G4double tmass) {
81    target_mom.setVectM(tmom.vect(), tmass);
82
83    //  G4cout << " target: e " << target_mom.e() << " mass "
84    //         << target_mom.m() << G4endl;
85  };
86
87  void toTheCenterOfMass();
88  void toTheTargetRestFrame(); 
89
90  G4LorentzVector backToTheLab(const G4LorentzVector& mom) const;
91
92  // Four-vectors of bullet and target in last chosen reference frame
93  const G4LorentzVector& getBullet() const { return bullet_mom; }
94  const G4LorentzVector& getTarget() const { return target_mom; }
95 
96  G4double getKinEnergyInTheTRS() const;
97  G4double getTotalSCMEnergy() const { return ecm_tot; }
98  G4double getSCMMomentum() const { return scm_momentum.rho(); }
99  G4double getTRSMomentum() const;
100
101  G4LorentzVector rotate(const G4LorentzVector& mom) const; 
102
103  G4LorentzVector rotate(const G4LorentzVector& mom1,
104                         const G4LorentzVector& mom) const; 
105
106  G4bool reflectionNeeded() const; 
107
108  G4bool trivial() const { return degenerated; }
109
110private: 
111  static const G4double small;
112
113  G4int verboseLevel;
114  G4LorentzVector bullet_mom;
115  G4LorentzVector target_mom;
116
117  G4LorentzVector scm_momentum;         // CM momentum relative to target/bullet
118
119  // Buffer variables for doing ::rotate() calculations
120  G4ThreeVector velocity;
121  G4double gamma;
122  G4double v2;
123  G4double ecm_tot;
124  G4double ga;
125  G4double gb;
126  G4double gbpp;
127  G4double gapp;
128  G4bool degenerated;
129};       
130
131#endif // G4LORENTZ_CONVERTOR_HH
Note: See TracBrowser for help on using the repository browser.