43 {
44
45 using namespace TRT_PAI_gasdata;
46 using namespace TRT_PAI_physicsConstants;
47
49
50
51
52
53
54
55
56
58
59 std::string gasType = "NotSet";
60
61
62
63
64
66 {
67 gasType = "Xenon";
68 }
70 {
73 }
74 else
75 {
77 << "'. Must be one of 'Auto', 'Xenon', 'Argon' or 'Krypton'." );
78 return StatusCode::FAILURE;
79 };
80
82
83
84
85
87
88
89 const double tempK = 289.;
90
91
92 using element_type = std::map<std::string, TRT_PAI_element, std::less<std::string>>;
93
94 element_type elements;
95 elements["Xe"] = TRT_PAI_element( "Xe", EXe , SXe , NXe , ZXe, AXe);
96 elements["C"] = TRT_PAI_element( "C" , EC , SC , NC , ZC , AC );
97 elements["F"] = TRT_PAI_element( "F" , EF , SF , NF , ZF , AF );
98 elements["O"] = TRT_PAI_element( "O" , EO , SO , NO , ZO , AO );
99 elements["Ar"] = TRT_PAI_element( "Ar", EAr , SAr , NAr , ZAr, AAr);
100 elements["Kr"] = TRT_PAI_element( "Kr", EKr , SKr , NKr , ZKr, AKr);
101
102
103 {
104 for (element_type::iterator ei=elements.begin(); ei!=elements.end(); ++ei) {
106 << ", A= " << (*ei).second.getAtomicA()
107 << ", Z= " << (*ei).second.getAtomicZ()
108 << ", rho=" << (*ei).second.getDensity(tempK)
109 << " (" << tempK << " Kelvin)"
110 );
111 }
112 }
113
114
115
116 using component_type = std::map<std::string, TRT_PAI_gasComponent, std::less<std::string>>;
117
118 component_type components;
119
120 components["Xe"] = TRT_PAI_gasComponent("Xe");
121 components["Xe"].addElement(&elements["Xe"],1);
122
123 components["CO2"] = TRT_PAI_gasComponent("CO2");
124 components["CO2"].addElement(&elements["C"],1);
125 components["CO2"].addElement(&elements["O"],2);
126
127 components["CF4"] = TRT_PAI_gasComponent("CF4");
128 components["CF4"].addElement(&elements["C"],1);
129 components["CF4"].addElement(&elements["F"],4);
130
131 components["O2"] = TRT_PAI_gasComponent("O2");
132 components["O2"].addElement(&elements["O"],2);
133
134 components["Ar"] = TRT_PAI_gasComponent("Ar");
135 components["Ar"].addElement(&elements["Ar"],1);
136
137 components["Kr"] = TRT_PAI_gasComponent("Kr");
138 components["Kr"].addElement(&elements["Kr"],1);
139
140
141
142 {
143 std::vector<std::string> cnam(6);
144 cnam[0] = "Xe"; cnam[1] = "CO2"; cnam[2] = "CF4"; cnam[3] = "CO2"; cnam[4] = "Ar"; cnam[5] = "Kr";
145
147 for (
int ic=0;
ic<6; ++
ic ) {
148 n = components[cnam[
ic]].getNElementTypes();
150 for (
int ie=0;
ie<
n; ++
ie ) {
151 ATH_MSG_DEBUG (
" - " << components[cnam[ic]].getElementMultiplicity(ie)
152 <<
" atoms " << (components[cnam[ic]].getElement(ie))->
getName()
153 << " with Z= " << (components[cnam[ic]].getElement(ie))->getAtomicZ()
154 << " and A= " << (components[cnam[ic]].getElement(ie))->getAtomicA()
155 );
156 }
157 ATH_MSG_DEBUG (
" > density: " << components[cnam[ic]].getDensity(tempK) <<
" (" << tempK <<
" Kelvin)" );
158 }
159 }
160
161
162 std::string mixtureName="TRT Gas Mixture";
163 mixtureName.insert(4, gasType);
164 m_trtgas =
new TRT_PAI_gasMixture(mixtureName);
165
166 if ( gasType == "Xenon" ) {
167 ATH_MSG_DEBUG (
"Using new Xenon gas mixture (Xe/CO2/O2 - 70/27/3)." );
168 m_trtgas->addComponent( &components[
"Xe"] , 0.70);
169 m_trtgas->addComponent( &components[
"CO2"], 0.27);
170 m_trtgas->addComponent( &components[
"O2"] , 0.03);
171 }
172
173 if (( gasType == "XenonOld" )){
174 ATH_MSG_DEBUG (
"Using old Xenon gas mixture (Xe/CO2/CF4 - 70/10/20)." );
175 m_trtgas->addComponent( &components[
"Xe"] , 0.70);
176 m_trtgas->addComponent( &components[
"CO2"], 0.10);
177 m_trtgas->addComponent( &components[
"CF4"], 0.20);
178 }
179
180 if ( gasType == "Argon" ) {
181 ATH_MSG_DEBUG (
"Using Argon gas mixture (Ar/CO2/O2 - 70/27/3)." );
182 m_trtgas->addComponent( &components[
"Ar"] , 0.70);
183 m_trtgas->addComponent( &components[
"CO2"], 0.27);
184 m_trtgas->addComponent( &components[
"O2"] , 0.03);
185 }
186
187 if ( gasType == "Krypton" ) {
188 ATH_MSG_DEBUG (
"Using Krypton gas mixture (Kr/CO2/O2 - 70/27/3)." );
189 m_trtgas->addComponent( &components[
"Kr"] , 0.70);
190 m_trtgas->addComponent( &components[
"CO2"], 0.27);
191 m_trtgas->addComponent( &components[
"O2"] , 0.03);
192 }
193
195
197
198
199
200
201
202
203 const double Emin = 12.0;
204 const double Emax = 1
e+07;
205
206
207 const double eps = 0.01;
208
209 TRT_PAI_effectiveGas effectiveGas(
m_trtgas, Emin, Emax, tempK, eps);
210
211
212
213 ATH_MSG_DEBUG (
"Making tables for various gamma factors." );
214
216 std::vector<float> lnE;
217
221 gamvec[ig] = 1. +
pow(10.,gamvar);
222 }
223
224
225
227
229
230 return StatusCode::SUCCESS;
231}
constexpr int pow(int base, int exp) noexcept