source: trunk/source/processes/electromagnetic/polarisation/src/G4PolarizedPEEffectModel.cc @ 1350

Last change on this file since 1350 was 1337, checked in by garnier, 14 years ago

tag geant4.9.4 beta 1 + modifs locales

File size: 6.3 KB
Line 
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: G4PolarizedPEEffectModel.cc,v 1.1 2007/11/01 17:29:09 schaelic Exp $
27// GEANT4 tag $Name: geant4-09-04-beta-01 $
28//
29// -------------------------------------------------------------------
30//
31// GEANT4 Class file
32//
33//
34// File name:     G4PolarizedPEEffectModel
35//
36// Author:        Andreas Schaelicke & Karim Laihem
37//
38// Creation date: 22.02.2007
39//
40// Modifications:
41//
42// Class Description:
43//
44// Implementation of Photo electric effect
45// including polarization transfer from circularly polarised gammas
46
47// -------------------------------------------------------------------
48//
49
50//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
51//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
52
53#ifndef NOIONIZATIONAS
54
55#include "G4PolarizedPEEffectModel.hh"
56#include "G4Electron.hh"
57#include "G4Positron.hh"
58#include "G4Gamma.hh"
59#include "Randomize.hh"
60#include "G4DataVector.hh"
61#include "G4PhysicsLogVector.hh"
62#include "G4ParticleChangeForGamma.hh"
63#include "G4PolarizedPEEffectCrossSection.hh"
64#include "G4PolarizationHelper.hh"
65
66//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
67
68
69G4PolarizedPEEffectModel::G4PolarizedPEEffectModel(const G4ParticleDefinition* pd,
70                                         const G4String& nam)
71  : G4PEEffectModel(pd,nam),crossSectionCalculator(0)
72{
73}
74
75//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
76
77G4PolarizedPEEffectModel::~G4PolarizedPEEffectModel()
78{
79  if (crossSectionCalculator) delete crossSectionCalculator;
80}
81
82//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
83
84void G4PolarizedPEEffectModel::Initialise(const G4ParticleDefinition* pd,
85                                     const G4DataVector& dv)
86{
87  G4PEEffectModel::Initialise(pd,dv);
88  if (!crossSectionCalculator)
89    crossSectionCalculator = new G4PolarizedPEEffectCrossSection();
90}
91
92//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
93
94void G4PolarizedPEEffectModel::SampleSecondaries(std::vector<G4DynamicParticle*>* vdp,
95                                                 const G4MaterialCutsCouple* couple,
96                                                 const G4DynamicParticle* dp,
97                                                 G4double tmin,
98                                                 G4double maxEnergy)
99{
100  //  std::vector<G4DynamicParticle*>* vdp =
101  G4PEEffectModel::SampleSecondaries(vdp,couple, dp, tmin, maxEnergy);
102
103  if(vdp && vdp->size()>0) {
104    G4double gamEnergy0 = dp->GetKineticEnergy();
105    G4double lepEnergy1 = (*vdp)[0]->GetKineticEnergy();
106    G4double sintheta   = dp->GetMomentumDirection().cross((*vdp)[0]->GetMomentumDirection()).mag();
107    if (sintheta>1.) sintheta=1.;
108
109    G4StokesVector beamPol = dp->GetPolarization();
110    beamPol.SetPhoton();
111    //    G4cout<<" beamPol "<<beamPol<<G4endl;
112
113    // determine interaction plane
114    G4ThreeVector  nInteractionFrame = 
115      G4PolarizationHelper::GetFrame(dp->GetMomentumDirection(), 
116                                     (*vdp)[0]->GetMomentumDirection());
117    //    G4cout<<" nInteractionFrame = "<<nInteractionFrame<<G4endl;
118    if (dp->GetMomentumDirection().cross((*vdp)[0]->GetMomentumDirection()).mag()<1.e-10) {
119      //      G4cout<<" nInteractionFrame not well defined "<<G4endl;
120      //      G4cout<<" choosing random interaction frame "<<G4endl;
121
122      nInteractionFrame = G4PolarizationHelper::GetRandomFrame(dp->GetMomentumDirection());
123      //      G4cout<<"new nInteractionFrame = "<<nInteractionFrame<<G4endl;
124    }
125    /*
126    else {
127      G4ThreeVector mom1=dp->GetMomentumDirection();
128      G4ThreeVector mom2=(*vdp)[0]->GetMomentumDirection();
129      G4cout<<" mom1 = "<<mom1<<G4endl;
130      G4cout<<" mom2 = "<<mom2<<G4endl;
131      G4ThreeVector x=mom1.cross(mom2);
132      G4cout<<" mom1 x mom2 = "<<x<<" "<<x.mag()<<G4endl;
133      G4cout<<"  norm       = "<<(1./x.mag()*x)<<" "<<G4endl;
134    }
135    */
136
137    // transform polarization into interaction frame
138    beamPol.InvRotateAz(nInteractionFrame,dp->GetMomentumDirection());
139
140    // calulcate polarization transfer
141    crossSectionCalculator->SetMaterial(GetCurrentElement()->GetN(), // number of nucleons
142                                        GetCurrentElement()->GetZ(), 
143                                        GetCurrentElement()->GetfCoulomb());
144    crossSectionCalculator->Initialize(gamEnergy0, lepEnergy1, sintheta,
145                                       beamPol, G4StokesVector::ZERO);
146
147    // deterimine final state polarization
148    G4StokesVector lep1Pol = crossSectionCalculator->GetPol2();
149    //    G4cout<<" lepPol "<<lep1Pol<<G4endl;
150    lep1Pol.RotateAz(nInteractionFrame,(*vdp)[0]->GetMomentumDirection());
151    (*vdp)[0]->SetPolarization(lep1Pol.p1(),
152                               lep1Pol.p2(),
153                               lep1Pol.p3());
154
155    //    G4cout<<" lepPol "<<lep1Pol<<G4endl;
156    size_t num = vdp->size();
157    if (num!=1) G4cout<<" WARNING "<<num<<" secondaries in polarized photo electric effect not supported!\n"; 
158  }
159}
160
161//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
162#endif //NOIONIZATIONAS
Note: See TracBrowser for help on using the repository browser.