ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VPolarizedCrossSection.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4VPolarizedCrossSection.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 // File name: G4VPolarizedCrossSection
27 //
28 // Author: Andreas Schaelicke
29 //
30 // Creation date: 15.05.2005
31 //
32 // Modifications:
33 //
34 // Class Description:
35 // (pure virtual) interface class
36 //
37 // provides readable but efficient routines to determine
38 // polarization for the final state of a given process
39 // empoying the differential cross section
40 //
41 
43 #include "Randomize.hh"
44 
46  fXmin(0), fXmax(1.), fYmin(1.), theA(1), theZ(1), fCoul(0.)
47 {
48 }
49 
51 {
52 }
53 
55  const G4StokesVector &,
56  const G4StokesVector &,
57  G4int )
58 {
59 }
60 
62 {
63  // neglects correlation effects!
64 
69  return G4ThreeVector(invXsecTotal*xsPol1,invXsecTotal*xsPol2,invXsecTotal*xsPol3);
70 }
71 
73 {
74  // neglects correlation effects!
75 
80  return G4ThreeVector(invXsecTotal*xsPol1,invXsecTotal*xsPol2,invXsecTotal*xsPol3);
81 }
82 // minimal energy fraction in TotalXSection
84 {
85  return fXmin;
86 }
87 
88 // maximal energy fraction in TotalXSection
90 {
91  return fXmax;
92 }
93 
94 
95 /*
96 void G4VPolarizedCrossSection::DicePolarization()
97 {
98  // can respect correlation effects, but is limited to
99  // one quantization axis!
100  G4double sigma[4];
101  sigma[0]=XSection(G4StokesVector::P3,G4StokesVector::P3);
102  sigma[1]=XSection(G4StokesVector::P3,G4StokesVector::M3);
103  sigma[2]=XSection(G4StokesVector::M3,G4StokesVector::P3);
104  sigma[3]=XSection(G4StokesVector::M3,G4StokesVector::M3);
105 
106  G4double sigma_max = 4. * XSection(G4StokesVector::ZERO,G4StokesVector::ZERO);
107 
108  for (G4int i=0;i<4;++i) {
109  G4cout<<"sigma="<<sigma[i]<<" vs."<<(.25*sigma_max)<<G4endl;
110  if (sigma[i]<0 || sigma[i]>sigma_max) {
111  G4cout<<"ERROR G4VPolarizedCrossSection::DicePolarization(["<<i<<"]): "
112  <<sigma[i]<<" vs."<<sigma_max<<G4endl;
113  }
114  if (i>0) sigma[i]+=sigma[i-1];
115  }
116 
117  G4int k = 0;
118  G4double disc = sigma[3]*G4UniformRand();
119  // Loop checking, 03-Aug-2015, Vladimir Ivanchenko
120  while (sigma[k]<disc && k<4) {
121  ++k;
122  }
123 
124  if ((k&2)==0) pol2=G4StokesVector::P3;
125  else pol2=G4StokesVector::M3;
126  if ((k&1)==0) pol3=G4StokesVector::P3;
127  else pol3=G4StokesVector::M3;
128 
129 }
130 */
131 
132 /*
133 G4StokesVector G4VPolarizedCrossSection::DicedPol2()
134 {
135  return pol2;
136 }
137 
138 G4StokesVector G4VPolarizedCrossSection::DicedPol3()
139 {
140  return pol3;
141 }
142 */
143 
145  const G4StokesVector &,const G4StokesVector &)
146 {
147  G4cout << "WARNING virtual function G4VPolarizedCrossSection::TotalXSection() called" << G4endl;
148  return 0.;
149 }