ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4empCrossSection.cc
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4empCrossSection.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 //
27 //
28 //
29 // History:
30 // -----------
31 // 29 Apr 2009 ALF 1st implementation
32 // 15 Mar 2011 ALF introduced the usage of G4AtomicShellEnumerator
33 // 09 Mar 2012 LP updated methods
34 //
35 
36 
37 #include "globals.hh"
38 #include "G4empCrossSection.hh"
39 #include "G4Proton.hh"
40 
41 
43  :G4VhShellCrossSection(nam),totalCS(0.0)
44 {
45  if (nam == "Empirical")
46  {
47  paulShellK = new G4PaulKxsModel();
49  flag=0;
50  }
51  else
52  {
53  G4cout << "G4empCrossSection::G4empCrossSection: "
54  << "ERROR in G4empCrossSection name; Paul+Orlic is selected."
55  << G4endl;
56  paulShellK = new G4PaulKxsModel();
58  flag=0;
59  }
60 
61 }
62 
64 {
65  delete paulShellK;
66  delete orlicShellLi;
67 }
68 
70  G4double incidentEnergy,
71  G4double mass,
72  G4double,
73  const G4Material*)
74 {
75  std::vector<G4double> crossSections;
77 
78  crossSections.push_back( paulShellK->CalculateKCrossSection(Z, mass, incidentEnergy) );
79 
80  // this check should be done in the Orlic class, that can handle only protons;
81  // however this would lead up tp three checks of the mass, while here we have only one
82  // moreover, at the present time,this class handles explicitly Paul and Orlic models,
83  // so it can hadle the responsibility of this check too
84 
85  if (mass == aProton->GetPDGMass()) {
86 
87  if (flag==0)
88  {
89  crossSections.push_back( orlicShellLi->CalculateL1CrossSection(Z, incidentEnergy) );
90  crossSections.push_back( orlicShellLi->CalculateL2CrossSection(Z, incidentEnergy) );
91  crossSections.push_back( orlicShellLi->CalculateL3CrossSection(Z, incidentEnergy) );
92  }
93 
94  }
95 
96  else {
97  crossSections.push_back( 0. );
98  crossSections.push_back( 0. );
99  crossSections.push_back( 0. );
100  }
101  return crossSections;
102 
103 }
104 
106  G4double incidentEnergy,
107  G4double mass,
108  const G4Material*)
109 {
110  G4double res = 0.0;
112 
113  if(fKShell == shell) {
114  res = paulShellK->CalculateKCrossSection(Z, mass, incidentEnergy);
115  }
116  // this check should be done in the Orlic class, that can handle only protons;
117  // however this would lead up tp three checks of the mass, while here we have only one
118  // moreover, at the present time,this class handles explicitly Paul and Orlic models,
119  // so it can hadle the responsibility of this check too
120 
121  else if (mass == aProton->GetPDGMass()) {
122 
123  if(fL1Shell == shell) {
124  if (flag==0) res = orlicShellLi->CalculateL1CrossSection(Z, incidentEnergy);
125  }
126  else if(fL2Shell == shell) {
127  if (flag==0) res = orlicShellLi->CalculateL2CrossSection(Z, incidentEnergy);
128  }
129  else if(fL3Shell == shell) {
130  if (flag==0) res = orlicShellLi->CalculateL3CrossSection(Z, incidentEnergy);
131  }
132  }
133  return res;
134 }
135 
137  G4double incidentEnergy,
138  G4double mass,
139  G4double deltaEnergy,
140  const G4Material* mat)
141 {
142 
143  std::vector<G4double> crossSections = GetCrossSection(Z, incidentEnergy, mass, deltaEnergy,mat);
144 
145  for (size_t i=0; i<crossSections.size(); i++ ) {
146 
147  if (totalCS) {
148  crossSections[i] = crossSections[i]/totalCS;
149  }
150 
151  }
152 
153  return crossSections;
154 
155 }
156 
157 
159 
160  totalCS = val;
161 
162 }
163 
164 
165