00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // $Id: G4VPolarizedCrossSection.cc 69847 2013-05-16 09:36:18Z gcosmo $ 00027 // File name: G4VPolarizedCrossSection 00028 // 00029 // Author: Andreas Schaelicke 00030 // 00031 // Creation date: 15.05.2005 00032 // 00033 // Modifications: 00034 // 00035 // Class Description: 00036 // (pure virtual) interface class 00037 // 00038 // provides readable but efficient routines to determine 00039 // polarization for the final state of a given process 00040 // empoying the differential cross section 00041 // 00042 00043 #include "G4VPolarizedCrossSection.hh" 00044 #include "Randomize.hh" 00045 00046 G4VPolarizedCrossSection::G4VPolarizedCrossSection() : 00047 fXmin(0), fXmax(1.), fYmin(1.), theA(1), theZ(1), fCoul(0.) 00048 { 00049 } 00050 00051 G4VPolarizedCrossSection::~G4VPolarizedCrossSection() 00052 { 00053 } 00054 00055 void G4VPolarizedCrossSection::Initialize(G4double, G4double, G4double, 00056 const G4StokesVector &, 00057 const G4StokesVector &, 00058 G4int ) 00059 { 00060 } 00061 00062 G4StokesVector G4VPolarizedCrossSection::GetPol2() 00063 { 00064 // neglects correlation effects! 00065 00066 G4double invXsecTotal=1./XSection(G4StokesVector::ZERO,G4StokesVector::ZERO); 00067 G4double xsPol1=XSection(G4StokesVector::P1,G4StokesVector::ZERO); 00068 G4double xsPol2=XSection(G4StokesVector::P2,G4StokesVector::ZERO); 00069 G4double xsPol3=XSection(G4StokesVector::P3,G4StokesVector::ZERO); 00070 return G4ThreeVector(invXsecTotal*xsPol1,invXsecTotal*xsPol2,invXsecTotal*xsPol3); 00071 } 00072 00073 G4StokesVector G4VPolarizedCrossSection::GetPol3() 00074 { 00075 // neglects correlation effects! 00076 00077 G4double invXsecTotal=1./XSection(G4StokesVector::ZERO,G4StokesVector::ZERO); 00078 G4double xsPol1=XSection(G4StokesVector::ZERO,G4StokesVector::P1); 00079 G4double xsPol2=XSection(G4StokesVector::ZERO,G4StokesVector::P2); 00080 G4double xsPol3=XSection(G4StokesVector::ZERO,G4StokesVector::P3); 00081 return G4ThreeVector(invXsecTotal*xsPol1,invXsecTotal*xsPol2,invXsecTotal*xsPol3); 00082 } 00083 // minimal energy fraction in TotalXSection 00084 G4double G4VPolarizedCrossSection::GetXmin(G4double /*y*/) 00085 { 00086 return fXmin; 00087 } 00088 00089 // maximal energy fraction in TotalXSection 00090 G4double G4VPolarizedCrossSection::GetXmax(G4double /*y*/) 00091 { 00092 return fXmax; 00093 } 00094 00095 00096 /* 00097 void G4VPolarizedCrossSection::DicePolarization() 00098 { 00099 // can respect correlation effects, but is limited to 00100 // one quantization axis! 00101 G4double sigma[4]; 00102 sigma[0]=XSection(G4StokesVector::P3,G4StokesVector::P3); 00103 sigma[1]=XSection(G4StokesVector::P3,G4StokesVector::M3); 00104 sigma[2]=XSection(G4StokesVector::M3,G4StokesVector::P3); 00105 sigma[3]=XSection(G4StokesVector::M3,G4StokesVector::M3); 00106 00107 G4double sigma_max = 4. * XSection(G4StokesVector::ZERO,G4StokesVector::ZERO); 00108 00109 for (G4int i=0;i<4;++i) { 00110 G4cout<<"sigma="<<sigma[i]<<" vs."<<(.25*sigma_max)<<G4endl; 00111 if (sigma[i]<0 || sigma[i]>sigma_max) { 00112 G4cout<<"ERROR G4VPolarizedCrossSection::DicePolarization(["<<i<<"]): " 00113 <<sigma[i]<<" vs."<<sigma_max<<G4endl; 00114 } 00115 if (i>0) sigma[i]+=sigma[i-1]; 00116 } 00117 00118 G4int k = 0; 00119 G4double disc = sigma[3]*G4UniformRand(); 00120 while (sigma[k]<disc && k<4) { 00121 ++k; 00122 } 00123 00124 if ((k&2)==0) pol2=G4StokesVector::P3; 00125 else pol2=G4StokesVector::M3; 00126 if ((k&1)==0) pol3=G4StokesVector::P3; 00127 else pol3=G4StokesVector::M3; 00128 00129 } 00130 */ 00131 00132 /* 00133 G4StokesVector G4VPolarizedCrossSection::DicedPol2() 00134 { 00135 return pol2; 00136 } 00137 00138 G4StokesVector G4VPolarizedCrossSection::DicedPol3() 00139 { 00140 return pol3; 00141 } 00142 */ 00143 00144 G4double G4VPolarizedCrossSection::TotalXSection(G4double, G4double, G4double, 00145 const G4StokesVector &,const G4StokesVector &) 00146 { 00147 G4cout << "WARNING virtual function G4VPolarizedCrossSection::TotalXSection() called" << G4endl; 00148 return 0.; 00149 }