ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VXResonance.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4VXResonance.cc
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 // -------------------------------------------------------------------
28 // GEANT4 Class file
29 //
30 // For information related to this code contact:
31 //
32 // File name: G4VXResonance
33 //
34 // Author:
35 //
36 // Creation date: 15 April 1999
37 //
38 // Modifications:
39 //
40 // -------------------------------------------------------------------
41 
42 #include "globals.hh"
43 #include "G4ios.hh"
44 #include "G4KineticTrack.hh"
45 #include "G4VXResonance.hh"
46 #include "Randomize.hh"
47 #include "G4Proton.hh"
48 #include "G4HadTmpUtil.hh"
49 
51 { }
52 
53 
55 { }
56 
57 
59 {
60  return (this == (G4VXResonance *) &right);
61 }
62 
63 
65 {
66  return (this != (G4VXResonance *) &right);
67 }
68 
69 
71  const G4KineticTrack& trk2,
72  G4int isoOut1, G4int isoOut2,
73  G4double /*iSpinOut1*/, G4double /*iSpinOut2*/) const
74 {
75  G4double result = 0.;
76 
77  const G4ParticleDefinition* in1 = trk1.GetDefinition();
78  const G4ParticleDefinition* in2 = trk2.GetDefinition();
79 
80  G4int isoIn1 = in1->GetPDGiIsospin();
81  G4int iso3In1 = in1->GetPDGiIsospin3();
82  G4int isoIn2 = in2->GetPDGiIsospin();
83  G4int iso3In2 = in2->GetPDGiIsospin3();
84 
87 
88  G4double pWeight = clebsch.Weight(isoProton,iso3Proton, isoProton,iso3Proton, isoOut1,isoOut2);
89  if (pWeight == 0.) throw G4HadronicException(__FILE__, __LINE__, "G4VXResonance::IsospinCorrection, no resonances - pWeight is zero");
90 
91  if (in1->IsShortLived() || in2->IsShortLived())
92  {
93  // Resonances in the initial state
94  G4int iSpinProton = G4Proton::ProtonDefinition()->GetPDGiSpin();
95  G4double degeneracyFactor = DegeneracyFactor(trk1,trk2,iSpinProton,iSpinProton);
96 
97  G4double factor = degeneracyFactor * pWeight;
98  if (factor > DBL_MIN)
99  {
100  // Randomly select the Isospin3 of the initial state resonances
101  std::vector<G4double> iso = clebsch.GenerateIso3(isoIn1,iso3In1,
102  isoIn2,iso3In2,
103  isoProton,isoProton);
104  G4int isoA = G4lrint(iso[0]);
105  G4int isoB = G4lrint(iso[1]);
106  G4double rWeight = clebsch.Weight(isoProton,isoA,
107  isoProton,isoB,
108  isoOut1,isoOut2);
109  result = rWeight / pWeight;
110  }
111  }
112  else
113  {
114  G4double weight = clebsch.Weight(isoIn1,iso3In1, isoIn2,iso3In2, isoOut1,isoOut2);
115  result = weight / pWeight;
116  }
117 
118  return result;
119 }
120 
121 
123 
125  const G4KineticTrack& trk2,
126  G4int isoOut1, G4int isoOut2,
127  G4double iSpinOut1, G4double iSpinOut2,
128  G4double mOut1, G4double mOut2) const
129 {
130  // To handle the cases when resonances are involved the modified
131  // detailed balance of P. Danielewicz and G.F. Bertsch, Nucl. Phys. A533(1991) 712
132  // is used; in other words, the width of the resonances are folded to get the
133  // mean square of the final state momentum.
134 
135  const G4ParticleDefinition* in1 = trk1.GetDefinition();
136  const G4ParticleDefinition* in2 = trk2.GetDefinition();
137  if(in1->IsShortLived() && in2->IsShortLived())
138  {
139  throw G4HadronicException(__FILE__, __LINE__, "Detailed balance for resonance scattering still on the schedule.");
140  }
141 
142  G4double result = 0.;
143 
144  G4int isoIn1 = in1->GetPDGiIsospin();
145  G4int iso3In1 = in1->GetPDGiIsospin3();
146  G4int isoIn2 = in2->GetPDGiIsospin();
147  G4int iso3In2 = in2->GetPDGiIsospin3();
148  G4double weight = clebsch.Weight(isoIn1, iso3In1, isoIn2, iso3In2, isoOut1, isoOut2);
149 
150  if (weight > 00001)
151  {
152  // adding spin counting here ...... does not look quite consistent, but is correct anyway.
153  // revisit in the next design iteration @@
154  G4double degeneracy = DegeneracyFactor(trk1,trk2,iSpinOut1,iSpinOut2);
155  G4double factor = degeneracy * weight;
156 
157  // now the phase-space
158  G4double S = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag2();
159  G4double m_1 = in1->GetPDGMass();
160  G4double m_2 = in2->GetPDGMass();
161 
162  // on-shell
163  G4double pinitial2 = (S - (m_1+m_2) * (m_1+m_2)) * (S - (m_1-m_2) * (m_1-m_2)) / (4.0*S);
164  G4double pfinal2 = (S - (mOut1+mOut2) * (mOut1+mOut2)) * (S - ( mOut1-mOut2) * (mOut1-mOut2)) / (4.0*S);
165  G4double relativeMomsquared = pfinal2/pinitial2;
166 
167  // resonance-nucleon scattering - inverse channel
168  if(in1->IsShortLived())
169  {
171  relativeMomsquared = 1./theI.GetPhaseSpaceIntegral(std::sqrt(S));
172  }
173  else if(in2->IsShortLived())
174  {
176  relativeMomsquared = 1./theI.GetPhaseSpaceIntegral(std::sqrt(S));
177  }
178 
179  result = factor * relativeMomsquared;
180  }
181 
182  return result;
183 }
184 
185 
187  const G4KineticTrack& trk2,
188  G4double iSpinOut1, G4double iSpinOut2) const
189 {
190  G4double value = 0.;
191 
192  const G4ParticleDefinition* in1 = trk1.GetDefinition();
193  const G4ParticleDefinition* in2 = trk2.GetDefinition();
194 
195  G4double sIn1 = in1->GetPDGiSpin() + 1.;
196  G4double sIn2 = in2->GetPDGiSpin() + 1.;
197 
198  G4double denom = sIn1 * sIn2;
199  if (denom > 0.)
200  {
201  value = (iSpinOut1+1) * (iSpinOut2+1) / denom;
202  }
203  return value;
204 }
205 
206