Geant4 11.1.1
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4DNAPTBExcitationStructure.cc
Go to the documentation of this file.
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
27#include "G4SystemOfUnits.hh"
28
30{
31
32// taken directly from PTra code by MPietrzak
33 energyConstant["N2"].push_back( 1.85*eV);
34 energyConstant["N2"].push_back( 2.15*eV);
35 energyConstant["N2"].push_back( 8.00*eV);
36 energyConstant["N2"].push_back( 8.50*eV);
37 energyConstant["N2"].push_back( 8.60*eV);
38 energyConstant["N2"].push_back(11.05*eV);
39 energyConstant["N2"].push_back(11.79*eV);
40 energyConstant["N2"].push_back(11.90*eV);
41 energyConstant["N2"].push_back(12.25*eV);
42 energyConstant["N2"].push_back(12.50*eV);
43 energyConstant["N2"].push_back(13.01*eV);
44 energyConstant["N2"].push_back(13.19*eV);
45 energyConstant["N2"].push_back(13.30*eV);
46 energyConstant["N2"].push_back(14.33*eV);
47 energyConstant["N2"].push_back(14.84*eV);
48 energyConstant["N2"].push_back(15.18*eV);
49 energyConstant["N2"].push_back(15.70*eV);
50 energyConstant["N2"].push_back(15.75*eV);
51 energyConstant["N2"].push_back(15.86*eV);
52 energyConstant["N2"].push_back(17.36*eV);
53 energyConstant["N2"].push_back(17.95*eV);
54 energyConstant["N2"].push_back(19.77*eV);
55 energyConstant["N2"].push_back(20.79*eV);
56 energyConstant["N2"].push_back(20.87*eV);
57 energyConstant["N2"].push_back(22.27*eV);
58 energyConstant["N2"].push_back(22.83*eV);
59 energyConstant["N2"].push_back(37.19*eV);
60 energyConstant["N2"].push_back(38.67*eV);
61 energyConstant["N2"].push_back(39.23*eV);
62
63
64 for(const auto& [name,levels] : energyConstant)
65 {
66 nExcLevels[name] = (G4int)levels.size();
67 }
68}
69
70
72{
73 G4String matNameModif = ReplaceMaterial(materialName);
74
75 // check if the material exist in the map
76 if(energyConstant.find(matNameModif)==energyConstant.end())
77 {
78 std::ostringstream oss;
79 oss << "Material name was not found in energyConstantMap. Problematic material is: "<<matNameModif;
80 G4Exception("G4DNAPTBExcitationStructure::ExcitationEnergy","em0002",
81 FatalException, oss.str().c_str());
82 }
83
84 G4double excitation = 0.;
85
86 if (ExcLevel >=0 && ExcLevel < nExcLevels[matNameModif]) excitation = energyConstant[matNameModif][ExcLevel];
87
88 return excitation;
89}
90
92{
93 G4String matNameModif = ReplaceMaterial(materialName);
94
95 // check if the material exist in the map
96 if(nExcLevels.find(matNameModif)==nExcLevels.end())
97 {
98 std::ostringstream oss;
99 oss << "Material name was not found in energyConstantMap. Problematic material is: "<<matNameModif;
100 G4Exception("G4DNAPTBNDExcitationStructure::NumberOfExcLevels","em0002",
101 FatalException, oss.str().c_str());
102 }
103
104 return nExcLevels[matNameModif];
105}
106
107G4String G4DNAPTBExcitationStructure::ReplaceMaterial(const G4String& materialName)
108{
109 G4String materialNameModified (materialName);
110
111 if(materialName=="G4_N2") materialNameModified = "N2";
112
113 return materialNameModified;
114}
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:59
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
G4int NumberOfExcLevels(const G4String &materialName)
G4double ExcitationEnergy(G4int ExcLevel, const G4String &materialName)