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 | // $Id: G4VPolarizedCrossSection.cc,v 1.4 2007/11/01 17:32:34 schaelic Exp $ |
---|
27 | // GEANT4 tag $Name: $ |
---|
28 | // File name: G4VPolarizedCrossSection |
---|
29 | // |
---|
30 | // Author: Andreas Schaelicke |
---|
31 | // |
---|
32 | // Creation date: 15.05.2005 |
---|
33 | // |
---|
34 | // Modifications: |
---|
35 | // |
---|
36 | // Class Description: |
---|
37 | // (pure virtual) interface class |
---|
38 | // |
---|
39 | // provides readable but efficient routines to determine |
---|
40 | // polarization for the final state of a given process |
---|
41 | // empoying the differential cross section |
---|
42 | // |
---|
43 | |
---|
44 | #include "G4VPolarizedCrossSection.hh" |
---|
45 | #include "Randomize.hh" |
---|
46 | |
---|
47 | G4VPolarizedCrossSection::G4VPolarizedCrossSection() : |
---|
48 | fXmin(0), fXmax(1.), fYmin(1.), theA(1), theZ(1), fCoul(0.) |
---|
49 | { |
---|
50 | } |
---|
51 | |
---|
52 | G4VPolarizedCrossSection::~G4VPolarizedCrossSection() |
---|
53 | { |
---|
54 | } |
---|
55 | |
---|
56 | void G4VPolarizedCrossSection::Initialize(G4double, G4double, G4double, |
---|
57 | const G4StokesVector &, |
---|
58 | const G4StokesVector &, |
---|
59 | G4int ) |
---|
60 | { |
---|
61 | } |
---|
62 | |
---|
63 | G4StokesVector G4VPolarizedCrossSection::GetPol2() |
---|
64 | { |
---|
65 | // neglects correlation effects! |
---|
66 | |
---|
67 | G4double invXsecTotal=1./XSection(G4StokesVector::ZERO,G4StokesVector::ZERO); |
---|
68 | G4double xsPol1=XSection(G4StokesVector::P1,G4StokesVector::ZERO); |
---|
69 | G4double xsPol2=XSection(G4StokesVector::P2,G4StokesVector::ZERO); |
---|
70 | G4double xsPol3=XSection(G4StokesVector::P3,G4StokesVector::ZERO); |
---|
71 | return G4ThreeVector(invXsecTotal*xsPol1,invXsecTotal*xsPol2,invXsecTotal*xsPol3); |
---|
72 | } |
---|
73 | |
---|
74 | G4StokesVector G4VPolarizedCrossSection::GetPol3() |
---|
75 | { |
---|
76 | // neglects correlation effects! |
---|
77 | |
---|
78 | G4double invXsecTotal=1./XSection(G4StokesVector::ZERO,G4StokesVector::ZERO); |
---|
79 | G4double xsPol1=XSection(G4StokesVector::ZERO,G4StokesVector::P1); |
---|
80 | G4double xsPol2=XSection(G4StokesVector::ZERO,G4StokesVector::P2); |
---|
81 | G4double xsPol3=XSection(G4StokesVector::ZERO,G4StokesVector::P3); |
---|
82 | return G4ThreeVector(invXsecTotal*xsPol1,invXsecTotal*xsPol2,invXsecTotal*xsPol3); |
---|
83 | } |
---|
84 | // minimal energy fraction in TotalXSection |
---|
85 | G4double G4VPolarizedCrossSection::GetXmin(G4double /*y*/) |
---|
86 | { |
---|
87 | return fXmin; |
---|
88 | } |
---|
89 | |
---|
90 | // maximal energy fraction in TotalXSection |
---|
91 | G4double G4VPolarizedCrossSection::GetXmax(G4double /*y*/) |
---|
92 | { |
---|
93 | return fXmax; |
---|
94 | } |
---|
95 | |
---|
96 | |
---|
97 | /* |
---|
98 | void G4VPolarizedCrossSection::DicePolarization() |
---|
99 | { |
---|
100 | // can respect correlation effects, but is limited to |
---|
101 | // one quantization axis! |
---|
102 | G4double sigma[4]; |
---|
103 | sigma[0]=XSection(G4StokesVector::P3,G4StokesVector::P3); |
---|
104 | sigma[1]=XSection(G4StokesVector::P3,G4StokesVector::M3); |
---|
105 | sigma[2]=XSection(G4StokesVector::M3,G4StokesVector::P3); |
---|
106 | sigma[3]=XSection(G4StokesVector::M3,G4StokesVector::M3); |
---|
107 | |
---|
108 | G4double sigma_max = 4. * XSection(G4StokesVector::ZERO,G4StokesVector::ZERO); |
---|
109 | |
---|
110 | for (G4int i=0;i<4;++i) { |
---|
111 | G4cout<<"sigma="<<sigma[i]<<" vs."<<(.25*sigma_max)<<G4endl; |
---|
112 | if (sigma[i]<0 || sigma[i]>sigma_max) { |
---|
113 | G4cout<<"ERROR G4VPolarizedCrossSection::DicePolarization(["<<i<<"]): " |
---|
114 | <<sigma[i]<<" vs."<<sigma_max<<G4endl; |
---|
115 | } |
---|
116 | if (i>0) sigma[i]+=sigma[i-1]; |
---|
117 | } |
---|
118 | |
---|
119 | G4int k = 0; |
---|
120 | G4double disc = sigma[3]*G4UniformRand(); |
---|
121 | while (sigma[k]<disc && k<4) { |
---|
122 | ++k; |
---|
123 | } |
---|
124 | |
---|
125 | if ((k&2)==0) pol2=G4StokesVector::P3; |
---|
126 | else pol2=G4StokesVector::M3; |
---|
127 | if ((k&1)==0) pol3=G4StokesVector::P3; |
---|
128 | else pol3=G4StokesVector::M3; |
---|
129 | |
---|
130 | } |
---|
131 | */ |
---|
132 | |
---|
133 | /* |
---|
134 | G4StokesVector G4VPolarizedCrossSection::DicedPol2() |
---|
135 | { |
---|
136 | return pol2; |
---|
137 | } |
---|
138 | |
---|
139 | G4StokesVector G4VPolarizedCrossSection::DicedPol3() |
---|
140 | { |
---|
141 | return pol3; |
---|
142 | } |
---|
143 | */ |
---|
144 | |
---|
145 | G4double G4VPolarizedCrossSection::TotalXSection(const G4double, const G4double, const G4double, |
---|
146 | const G4StokesVector &,const G4StokesVector &) |
---|
147 | { |
---|
148 | G4cout << "WARNING virtual function G4VPolarizedCrossSection::TotalXSection() called" << G4endl; |
---|
149 | return 0.; |
---|
150 | } |
---|