source: trunk/source/processes/hadronic/cross_sections/src/G4CrossSectionElastic.cc @ 1350

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

update to last version 4.9.4

File size: 3.5 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: G4CrossSectionElastic.cc,v 1.2 2010/11/19 11:12:11 vnivanch Exp $
27// GEANT4 tag $Name: geant4-09-04-ref-00 $
28//
29// -------------------------------------------------------------------
30//
31// GEANT4 Class file
32//
33//
34// File name:     G4CrossSectionElastic
35//
36// Author:        Vladimir Ivanchenko
37//
38// Creation date: 19.11.2010
39// Modifications:
40//
41// Class Description:
42//
43// Wrapper for elastic cross section build from a component
44//
45// -------------------------------------------------------------------
46//
47
48#include "G4CrossSectionElastic.hh"
49#include "G4VComponentCrossSection.hh"
50#include "G4ParticleDefinition.hh"
51
52G4CrossSectionElastic::G4CrossSectionElastic(const G4ParticleDefinition* p, 
53                                             G4VComponentCrossSection* c,
54                                             G4int zmin, G4int zmax, 
55                                             G4double Emin, G4double Emax)
56  : G4VCrossSectionDataSet(c->GetName()),particle(p), component(c),
57    Zmin(zmin),Zmax(zmax)
58{
59  SetMinKinEnergy(Emin);
60  SetMaxKinEnergy(Emax);
61}
62
63G4CrossSectionElastic::~G4CrossSectionElastic()
64{
65  delete component;
66}
67   
68G4bool G4CrossSectionElastic::IsApplicable(const G4DynamicParticle* p, 
69                                           const G4Element* elm)
70{
71  return IsIsoApplicable(p, G4int(elm->GetZ()), 0); 
72}
73
74G4bool
75G4CrossSectionElastic::IsIsoApplicable(const G4DynamicParticle* p, 
76                                       G4int Z, G4int)
77{
78  G4double e = p->GetKineticEnergy();
79  return 
80    (Z >= Zmin && Z <= Zmax && e >= GetMinKinEnergy() && e <= GetMaxKinEnergy()); 
81}
82
83
84G4double
85G4CrossSectionElastic::GetCrossSection(const G4DynamicParticle* p, 
86                                       const G4Element* elm, G4double)
87{
88  return component->GetElasticCrossSection(p->GetDefinition(), 
89                                           p->GetKineticEnergy(), elm);
90}
91
92G4double
93G4CrossSectionElastic::GetZandACrossSection(const G4DynamicParticle* p, G4int Z,
94                                              G4int A, G4double)
95{
96  return component->GetElasticZandACrossSection(p->GetDefinition(), 
97                                                p->GetKineticEnergy(), 
98                                                Z, A);
99}
Note: See TracBrowser for help on using the repository browser.