Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4VScatteringCollision Class Referenceabstract

#include <G4VScatteringCollision.hh>

Inheritance diagram for G4VScatteringCollision:
Collaboration diagram for G4VScatteringCollision:

Public Member Functions

 G4VScatteringCollision ()
 
void establish_G4MT_TLS_G4VScatteringCollision ()
 
virtual ~G4VScatteringCollision ()
 
G4bool operator== (const G4VScatteringCollision &right) const
 
G4bool operator!= (const G4VScatteringCollision &right) const
 
virtual G4KineticTrackVectorFinalState (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual const
G4VAngularDistribution
GetAngularDistribution () const
 
- Public Member Functions inherited from G4VCollision
 G4VCollision ()
 
void establish_G4MT_TLS_G4VCollision ()
 
 G4VCollision (void *s1, void *s2, void *s3, void *s4, void *s5, void *s6, void *s7)
 
virtual ~G4VCollision ()
 
G4bool operator== (const G4VCollision &right) const
 
G4bool operator!= (const G4VCollision &right) const
 
virtual G4double CrossSection (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 
virtual G4bool IsInCharge (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const =0
 
virtual G4String GetName () const =0
 
virtual void Print () const
 
virtual void Print (const G4KineticTrack &trk1, const G4KineticTrack &trk2) const
 

Protected Member Functions

virtual const std::vector
< const G4ParticleDefinition * > & 
GetOutgoingParticles () const =0
 
- Protected Member Functions inherited from G4VCollision
G4int GetNumberOfPartons (const G4ParticleDefinition *aP) const
 
virtual const G4CollisionVectorGetComponents () const
 
virtual const
G4VCrossSectionSource
GetCrossSectionSource () const =0
 
virtual const std::vector
< G4String > & 
GetListOfColliders (G4int whichOne) const =0
 

Detailed Description

Definition at line 56 of file G4VScatteringCollision.hh.

Constructor & Destructor Documentation

G4VScatteringCollision::G4VScatteringCollision ( )

Definition at line 47 of file G4VScatteringCollision.cc.

48 {
49  theAngularDistribution = new G4AngularDistribution(true);
50 }
G4VScatteringCollision::~G4VScatteringCollision ( )
virtual

Definition at line 53 of file G4VScatteringCollision.cc.

54 {
55  delete theAngularDistribution;
56  theAngularDistribution=0;
57 }

Member Function Documentation

void G4VScatteringCollision::establish_G4MT_TLS_G4VScatteringCollision ( )

Definition at line 180 of file G4VScatteringCollision.cc.

181 {
183  if ( theAngularDistribution ) delete theAngularDistribution;
184  theAngularDistribution = new G4AngularDistribution(true);
185 }
void establish_G4MT_TLS_G4VCollision()

Here is the call graph for this function:

Here is the caller graph for this function:

G4KineticTrackVector * G4VScatteringCollision::FinalState ( const G4KineticTrack trk1,
const G4KineticTrack trk2 
) const
virtual

Implements G4VCollision.

Definition at line 60 of file G4VScatteringCollision.cc.

62 {
63  const G4VAngularDistribution* angDistribution = GetAngularDistribution();
64  G4LorentzVector p = trk1.Get4Momentum() + trk2.Get4Momentum();
65  G4double sqrtS = p.m();
66  G4double S = sqrtS * sqrtS;
67 
68  std::vector<const G4ParticleDefinition*> OutputDefinitions = GetOutgoingParticles();
69  if (OutputDefinitions.size() != 2)
70  throw G4HadronicException(__FILE__, __LINE__, "G4VScatteringCollision: Too many output particles!");
71 
72  if (OutputDefinitions[0]->IsShortLived() && OutputDefinitions[1]->IsShortLived())
73  {
74  if(getenv("G4KCDEBUG")) G4cerr << "two shortlived for Type = "<<typeid(*this).name()<<G4endl;
75  // throw G4HadronicException(__FILE__, __LINE__, "G4VScatteringCollision: can't handle two shortlived particles!"); // @hpw@
76  }
77 
78  G4double outm1 = OutputDefinitions[0]->GetPDGMass();
79  G4double outm2 = OutputDefinitions[1]->GetPDGMass();
80 
81  if (OutputDefinitions[0]->IsShortLived())
82  {
83  outm1 = SampleResonanceMass(outm1,
84  OutputDefinitions[0]->GetPDGWidth(),
85  G4Neutron::NeutronDefinition()->GetPDGMass()+G4PionPlus::PionPlus()->GetPDGMass(),
86  sqrtS-(G4Neutron::NeutronDefinition()->GetPDGMass()+G4PionPlus::PionPlus()->GetPDGMass()));
87 
88  }
89  if (OutputDefinitions[1]->IsShortLived())
90  {
91  outm2 = SampleResonanceMass(outm2, OutputDefinitions[1]->GetPDGWidth(),
92  G4Neutron::NeutronDefinition()->GetPDGMass()+G4PionPlus::PionPlus()->GetPDGMass(),
93  sqrtS-outm1);
94  }
95 
96  // Angles of outgoing particles
97  G4double cosTheta = angDistribution->CosTheta(S, trk1.GetActualMass(), trk2.GetActualMass());
98  G4double phi = angDistribution->Phi();
99 
100  // Unit vector of three-momentum
101  G4LorentzRotation fromCMSFrame(p.boostVector());
102  G4LorentzRotation toCMSFrame(fromCMSFrame.inverse());
103  G4LorentzVector TempPtr = toCMSFrame*trk1.Get4Momentum();
104  G4LorentzRotation toZ;
105  toZ.rotateZ(-1*TempPtr.phi());
106  toZ.rotateY(-1*TempPtr.theta());
107  G4LorentzRotation toCMS(toZ.inverse());
108 
109  G4ThreeVector pFinal1(std::sin(std::acos(cosTheta))*std::cos(phi), std::sin(std::acos(cosTheta))*std::sin(phi), cosTheta);
110 
111  // Three momentum in cm system
112  G4double pCM = std::sqrt( (S-(outm1+outm2)*(outm1+outm2)) * (S-(outm1-outm2)*(outm1-outm2)) /(4.*S));
113  pFinal1 = pFinal1 * pCM;
114  G4ThreeVector pFinal2 = -pFinal1;
115 
116  G4double eFinal1 = std::sqrt(pFinal1.mag2() + outm1*outm1);
117  G4double eFinal2 = std::sqrt(pFinal2.mag2() + outm2*outm2);
118 
119  G4LorentzVector p4Final1(pFinal1, eFinal1);
120  G4LorentzVector p4Final2(pFinal2, eFinal2);
121  p4Final1 = toCMS*p4Final1;
122  p4Final2 = toCMS*p4Final2;
123 
124 
125  // Lorentz transformation
126  G4LorentzRotation toLabFrame(p.boostVector());
127  p4Final1 *= toLabFrame;
128  p4Final2 *= toLabFrame;
129 
130  // Final tracks are copies of incoming ones, with modified 4-momenta
131 
132  G4double chargeBalance = OutputDefinitions[0]->GetPDGCharge()+OutputDefinitions[1]->GetPDGCharge();
133  chargeBalance-= trk1.GetDefinition()->GetPDGCharge();
134  chargeBalance-= trk2.GetDefinition()->GetPDGCharge();
135  if(std::abs(chargeBalance) >.1)
136  {
137  G4cout << "Charges in "<<typeid(*this).name()<<G4endl;
138  G4cout << OutputDefinitions[0]->GetPDGCharge()<<" "<<OutputDefinitions[0]->GetParticleName()
139  << OutputDefinitions[1]->GetPDGCharge()<<" "<<OutputDefinitions[1]->GetParticleName()
140  << trk1.GetDefinition()->GetPDGCharge()<<" "<<trk1.GetDefinition()->GetParticleName()
141  << trk2.GetDefinition()->GetPDGCharge()<<" "<<trk2.GetDefinition()->GetParticleName()<<G4endl;
142  }
143  G4KineticTrack* final1 = new G4KineticTrack(OutputDefinitions[0], 0.0, trk1.GetPosition(), p4Final1);
144  G4KineticTrack* final2 = new G4KineticTrack(OutputDefinitions[1], 0.0, trk2.GetPosition(), p4Final2);
145 
146  G4KineticTrackVector* finalTracks = new G4KineticTrackVector;
147 
148  finalTracks->push_back(final1);
149  finalTracks->push_back(final2);
150 
151  return finalTracks;
152 }
Hep3Vector boostVector() const
double S(double temp)
const G4ThreeVector & GetPosition() const
const char * p
Definition: xmltok.h:285
G4double GetActualMass() const
virtual G4double CosTheta(G4double s, G4double m1, G4double m2) const =0
const G4String & GetParticleName() const
HepLorentzRotation & rotateY(double delta)
G4GLOB_DLL std::ostream G4cout
virtual G4double Phi() const
virtual const G4VAngularDistribution * GetAngularDistribution() const
static G4PionPlus * PionPlus()
Definition: G4PionPlus.cc:98
virtual const std::vector< const G4ParticleDefinition * > & GetOutgoingParticles() const =0
HepLorentzRotation & rotateZ(double delta)
double mag2() const
#define G4endl
Definition: G4ios.hh:61
HepLorentzRotation inverse() const
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const
const G4LorentzVector & Get4Momentum() const
const G4ParticleDefinition * GetDefinition() const
static G4Neutron * NeutronDefinition()
Definition: G4Neutron.cc:99
G4GLOB_DLL std::ostream G4cerr

Here is the call graph for this function:

virtual const G4VAngularDistribution* G4VScatteringCollision::GetAngularDistribution ( ) const
inlinevirtual

Implements G4VCollision.

Definition at line 70 of file G4VScatteringCollision.hh.

71  {
72  return theAngularDistribution;
73  }

Here is the caller graph for this function:

virtual const std::vector<const G4ParticleDefinition*>& G4VScatteringCollision::GetOutgoingParticles ( ) const
protectedpure virtual

Implemented in G4ConcreteNNTwoBodyResonance.

Here is the caller graph for this function:

G4bool G4VScatteringCollision::operator!= ( const G4VScatteringCollision right) const
G4bool G4VScatteringCollision::operator== ( const G4VScatteringCollision right) const

The documentation for this class was generated from the following files: