Ignore:
Timestamp:
Jun 18, 2010, 11:42:07 AM (14 years ago)
Author:
garnier
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/processes/hadronic/models/cascade/cascade/include/G4LorentzConvertor.hh

    r962 r1315  
    2323// * acceptance of all terms of the Geant4 Software license.          *
    2424// ********************************************************************
     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 $
    2527//
     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
    2633#ifndef G4LORENTZ_CONVERTOR_HH
    2734#define G4LORENTZ_CONVERTOR_HH
    2835
    29 #ifndef GLOB
    3036#include "globals.hh"
    31 #endif
     37#include "G4LorentzVector.hh"
     38#include "G4ThreeVector.hh"
    3239
    33 #include <vector>
    34 #include "G4CascadeMomentum.hh"
     40class G4InuclParticle;
    3541
    3642class G4LorentzConvertor {
     
    4046  G4LorentzConvertor();
    4147
    42   G4LorentzConvertor(const G4CascadeMomentum& bmom,
    43                      G4double bmass,
    44                      const G4CascadeMomentum& tmom,
    45                      G4double tmass) {
    46 
     48  G4LorentzConvertor(const G4LorentzVector& bmom, G4double bmass,
     49                     const G4LorentzVector& tmom, G4double tmass) {
    4750    setBullet(bmom, bmass);
    4851    setTarget(tmom, tmass);
    49     degenerated = false; 
    50   };
     52  }
    5153
    52   void setBullet(const G4CascadeMomentum& bmom,
    53                  G4double bmass) {
     54  G4LorentzConvertor(const G4InuclParticle* bullet,
     55                     const G4InuclParticle* target) {
     56    setBullet(bullet);
     57    setTarget(target);
     58  }
    5459
    55     bullet_mom = bmom;
    56     bullet_mass = bmass;
    57     //  G4cout << " bullet: e " << bmom[0] << " mass " << bmass << G4endl;
     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;
    5878  };
    5979
    60   void setTarget(const G4CascadeMomentum& tmom,
    61                  G4double tmass) {
     80  void setTarget(const G4LorentzVector& tmom, G4double tmass) {
     81    target_mom.setVectM(tmom.vect(), tmass);
    6282
    63     target_mom = tmom;
    64     target_mass = tmass;
    65     //  G4cout << " target: e " << tmom[0] << " mass " << tmass << G4endl;
     83    //  G4cout << " target: e " << target_mom.e() << " mass "
     84    //         << target_mom.m() << G4endl;
    6685  };
    6786
    6887  void toTheCenterOfMass();
    69  
    7088  void toTheTargetRestFrame();
    7189
    72   G4CascadeMomentum backToTheLab(const G4CascadeMomentum& mom) const;
     90  G4LorentzVector backToTheLab(const G4LorentzVector& mom) const;
    7391
    74   G4double getKinEnergyInTheTRS() const {
     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;
    75100
    76     G4double pv = bullet_mom[1] * target_mom[1] +
    77       bullet_mom[2] * target_mom[2] +
    78       bullet_mom[3] * target_mom[3]; 
    79     G4double ekin_trf = (target_mom[0] *
    80                          bullet_mom[0] - pv) / target_mass - bullet_mass;
    81     return ekin_trf;
    82   };
     101  G4LorentzVector rotate(const G4LorentzVector& mom) const;
    83102
    84   G4double getTotalSCMEnergy() const {
    85 
    86     return ecm_tot;
    87   };
    88 
    89   G4double getSCMMomentum() const {
    90 
    91     return pscm;
    92   };
    93 
    94   G4double getTRSMomentum() const {
    95 
    96     return plab;
    97   };
    98  
    99   G4CascadeMomentum rotate(const G4CascadeMomentum& mom) const;
    100 
    101   G4CascadeMomentum rotate(const G4CascadeMomentum& mom1,
    102                             const G4CascadeMomentum& mom) const;
     103  G4LorentzVector rotate(const G4LorentzVector& mom1,
     104                         const G4LorentzVector& mom) const;
    103105
    104106  G4bool reflectionNeeded() const;
    105107
    106   G4bool trivial() const {
    107     return degenerated;
    108   };
     108  G4bool trivial() const { return degenerated; }
    109109
    110110private:
    111 G4int verboseLevel;
    112   G4CascadeMomentum bullet_mom;
    113   G4double bullet_mass;
     111  static const G4double small;
    114112
    115   G4CascadeMomentum target_mom;
    116   G4double target_mass;
     113  G4int verboseLevel;
     114  G4LorentzVector bullet_mom;
     115  G4LorentzVector target_mom;
    117116
    118   std::vector<G4double> velocity;
     117  G4LorentzVector scm_momentum;         // CM momentum relative to target/bullet
    119118
    120   G4CascadeMomentum scm_momentum;
    121 
     119  // Buffer variables for doing ::rotate() calculations
     120  G4ThreeVector velocity;
     121  G4double gamma;
     122  G4double v2;
    122123  G4double ecm_tot;
    123 
    124   G4double pscm;
    125 
    126   G4double plab;
    127 
    128   G4double gamma;
    129 
    130   G4double v2;
    131 
    132124  G4double ga;
    133 
    134125  G4double gb;
    135 
    136126  G4double gbpp;
    137 
    138127  G4double gapp;
    139 
    140128  G4bool degenerated;
    141129};       
Note: See TracChangeset for help on using the changeset viewer.