7#include "G4Material.hh"
9#include "GDMLProcessor.hh"
15 double Z(0.),A(0.),Ionization(0.),Density(0.),Radlen(0.);
17 G4LogicalVolume *logicalMdc = 0;
22 G4Material* mdcMaterial = logicalMdc->GetMaterial();
24 for(i=0; i<mdcMaterial->GetElementVector()->size(); i++){
25 Z += (mdcMaterial->GetElement(i)->GetZ())*
26 (mdcMaterial->GetFractionVector()[i]);
27 A += (mdcMaterial->GetElement(i)->GetA())*
28 (mdcMaterial->GetFractionVector()[i]);
30 Ionization = mdcMaterial->GetIonisation()->GetMeanExcitationEnergy();
31 Density = mdcMaterial->GetDensity()/(g/cm3);
32 Radlen = mdcMaterial->GetRadlen();
33 std::cout<<
"mdcgas: Z: "<<Z<<
" A: "<<(A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<std::endl;
34 KalFitMaterial FitMdcMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
35 _BesKalmanFitMaterials.push_back(FitMdcMaterial);
39 G4LogicalVolume* innerWallFilm1Volume =
const_cast<G4LogicalVolume*
>(GDMLProcessor::GetInstance()->GetLogicalVolume(
"LogicalMdcInnerFilm1"));
40 G4Material* innerWallFilm1Material = innerWallFilm1Volume->GetMaterial();
41 G4Tubs* innerwallFilm1Tub =
dynamic_cast<G4Tubs*
>(innerWallFilm1Volume->GetSolid());
45 for(i=0; i<innerWallFilm1Material->GetElementVector()->size(); i++){
46 Z += (innerWallFilm1Material->GetElement(i)->GetZ())*
47 (innerWallFilm1Material->GetFractionVector()[i]);
48 A += (innerWallFilm1Material->GetElement(i)->GetA())*
49 (innerWallFilm1Material->GetFractionVector()[i]);
52 Ionization = innerWallFilm1Material->GetIonisation()->GetMeanExcitationEnergy();
53 Density = innerWallFilm1Material->GetDensity()/(g/cm3);
54 Radlen = innerWallFilm1Material->GetRadlen();
55 std::cout<<
"Mdc innerwall Film1, Al: Z: "<<Z<<
" A: "<<(A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<std::endl;
56 KalFitMaterial FitInnerwallFilm1Material(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
57 _BesKalmanFitMaterials.push_back(FitInnerwallFilm1Material);
61 G4LogicalVolume* innerwallVolume =
const_cast<G4LogicalVolume*
>(GDMLProcessor::GetInstance()->GetLogicalVolume(
"logicalMdcSegment2"));
62 G4Material* innerwallMaterial = innerwallVolume->GetMaterial();
63 G4Tubs* innerwallTub =
dynamic_cast<G4Tubs*
>(innerwallVolume->GetSolid());
67 for(i=0; i<innerwallMaterial->GetElementVector()->size(); i++){
68 Z += (innerwallMaterial->GetElement(i)->GetZ())*
69 (innerwallMaterial->GetFractionVector()[i]);
70 A += (innerwallMaterial->GetElement(i)->GetA())*
71 (innerwallMaterial->GetFractionVector()[i]);
74 Ionization = innerwallMaterial->GetIonisation()->GetMeanExcitationEnergy();
75 Density = innerwallMaterial->GetDensity()/(g/cm3);
76 Radlen = innerwallMaterial->GetRadlen();
77 std::cout<<
"Mdc innerwall, Al: Z: "<<Z<<
" A: "<<(A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<std::endl;
78 KalFitMaterial FitInnerwallMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
79 _BesKalmanFitMaterials.push_back(FitInnerwallMaterial);
82 G4LogicalVolume* innerWallFilm0Volume =
const_cast<G4LogicalVolume*
>(GDMLProcessor::GetInstance()->GetLogicalVolume(
"LogicalMdcInnerFilm0"));
83 G4Material* innerWallFilm0Material = innerWallFilm0Volume->GetMaterial();
84 G4Tubs* innerwallFilm0Tub =
dynamic_cast<G4Tubs*
>(innerWallFilm0Volume->GetSolid());
88 for(i=0; i<innerWallFilm0Material->GetElementVector()->size(); i++){
89 Z += (innerWallFilm0Material->GetElement(i)->GetZ())*
90 (innerWallFilm0Material->GetFractionVector()[i]);
91 A += (innerWallFilm0Material->GetElement(i)->GetA())*
92 (innerWallFilm0Material->GetFractionVector()[i]);
95 Ionization = innerWallFilm0Material->GetIonisation()->GetMeanExcitationEnergy();
96 Density = innerWallFilm0Material->GetDensity()/(g/cm3);
97 Radlen = innerWallFilm0Material->GetRadlen();
98 std::cout<<
"Mdc innerwall Film0, Al: Z: "<<Z<<
" A: "<<(A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<std::endl;
99 KalFitMaterial FitInnerwallFilm0Material(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
100 _BesKalmanFitMaterials.push_back(FitInnerwallFilm0Material);
103 G4LogicalVolume *logicalBes = 0;
108 G4LogicalVolume* logicalAirVolume =
const_cast<G4LogicalVolume*
>(GDMLProcessor::GetInstance()->GetLogicalVolume(
"logicalWorld"));
109 G4Material* airMaterial = logicalAirVolume->GetMaterial();
112 for(i=0; i<airMaterial->GetElementVector()->size(); i++){
113 Z += (airMaterial->GetElement(i)->GetZ())*
114 (airMaterial->GetFractionVector()[i]);
115 A += (airMaterial->GetElement(i)->GetA())*
116 (airMaterial->GetFractionVector()[i]);
119 Ionization = airMaterial->GetIonisation()->GetMeanExcitationEnergy();
120 Density = airMaterial->GetDensity()/(g/cm3);
121 Radlen = airMaterial->GetRadlen();
122 std::cout<<
"air: Z: "<<Z<<
" A: "<<(A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<std::endl;
123 KalFitMaterial FitAirMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
124 _BesKalmanFitMaterials.push_back(FitAirMaterial);
127 G4LogicalVolume* logicalOuterBeVolume =
const_cast<G4LogicalVolume*
>(GDMLProcessor::GetInstance()->GetLogicalVolume(
"logicalouterBe"));
128 G4Material* outerBeMaterial = logicalOuterBeVolume->GetMaterial();
130 G4Tubs* outerBeTub =
dynamic_cast<G4Tubs*
>(logicalOuterBeVolume->GetSolid());
133 for(i=0; i<outerBeMaterial->GetElementVector()->size(); i++){
134 Z += (outerBeMaterial->GetElement(i)->GetZ())*
135 (outerBeMaterial->GetFractionVector()[i]);
136 A += (outerBeMaterial->GetElement(i)->GetA())*
137 (outerBeMaterial->GetFractionVector()[i]);
139 Ionization = outerBeMaterial->GetIonisation()->GetMeanExcitationEnergy();
140 Density = outerBeMaterial->GetDensity()/(g/cm3);
141 Radlen = outerBeMaterial->GetRadlen();
142 std::cout<<
"outer beryllium: Z: "<<Z<<
" A: "<<(A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<std::endl;
143 KalFitMaterial FitOuterBeMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
144 _BesKalmanFitMaterials.push_back(FitOuterBeMaterial);
148 G4LogicalVolume* logicalOilLayerVolume =
const_cast<G4LogicalVolume*
>(GDMLProcessor::GetInstance()->GetLogicalVolume(
"logicaloilLayer"));
149 G4Material* oilLayerMaterial = logicalOilLayerVolume->GetMaterial();
150 G4Tubs* oilLayerTub =
dynamic_cast<G4Tubs*
>(logicalOilLayerVolume->GetSolid());
154 for(i=0; i<oilLayerMaterial->GetElementVector()->size(); i++){
155 Z += (oilLayerMaterial->GetElement(i)->GetZ())*
156 (oilLayerMaterial->GetFractionVector()[i]);
157 A += (oilLayerMaterial->GetElement(i)->GetA())*
158 (oilLayerMaterial->GetFractionVector()[i]);
160 Ionization = oilLayerMaterial->GetIonisation()->GetMeanExcitationEnergy();
161 Density = oilLayerMaterial->GetDensity()/(g/cm3);
162 Radlen = oilLayerMaterial->GetRadlen();
163 std::cout<<
"cooling oil: Z: "<<Z<<
" A: "<<(A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<std::endl;
164 KalFitMaterial FitOilLayerMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
165 _BesKalmanFitMaterials.push_back(FitOilLayerMaterial);
169 G4LogicalVolume* logicalInnerBeVolume =
const_cast<G4LogicalVolume*
>(GDMLProcessor::GetInstance()->GetLogicalVolume(
"logicalinnerBe"));
170 G4Material* innerBeMaterial = logicalInnerBeVolume->GetMaterial();
171 G4Tubs* innerBeTub =
dynamic_cast<G4Tubs*
>(logicalInnerBeVolume->GetSolid());
174 for(i=0; i<innerBeMaterial->GetElementVector()->size(); i++){
175 Z += (innerBeMaterial->GetElement(i)->GetZ())*
176 (innerBeMaterial->GetFractionVector()[i]);
177 A += (innerBeMaterial->GetElement(i)->GetA())*
178 (innerBeMaterial->GetFractionVector()[i]);
181 Ionization = innerBeMaterial->GetIonisation()->GetMeanExcitationEnergy();
182 Density = innerBeMaterial->GetDensity()/(g/cm3);
183 Radlen = innerBeMaterial->GetRadlen();
184 std::cout<<
"inner beryllium: Z: "<<Z<<
" A: "<<(A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<std::endl;
185 KalFitMaterial FitInnerBeMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
186 _BesKalmanFitMaterials.push_back(FitInnerBeMaterial);
190 G4LogicalVolume* logicalGoldLayerVolume =
const_cast<G4LogicalVolume*
>(GDMLProcessor::GetInstance()->GetLogicalVolume(
"logicalgoldLayer"));
191 G4Material* goldLayerMaterial = logicalGoldLayerVolume->GetMaterial();
192 G4Tubs* goldLayerTub =
dynamic_cast<G4Tubs*
>(logicalGoldLayerVolume->GetSolid());
196 for(i=0; i<goldLayerMaterial->GetElementVector()->size(); i++){
197 Z += (goldLayerMaterial->GetElement(i)->GetZ())*
198 (goldLayerMaterial->GetFractionVector()[i]);
199 A += (goldLayerMaterial->GetElement(i)->GetA())*
200 (goldLayerMaterial->GetFractionVector()[i]);
202 Ionization = goldLayerMaterial->GetIonisation()->GetMeanExcitationEnergy();
203 Density = goldLayerMaterial->GetDensity()/(g/cm3);
204 Radlen = goldLayerMaterial->GetRadlen();
205 std::cout<<
"gold layer: Z: "<<Z<<
" A: "<<(A/(g/mole))<<
" Ionization: "<<(Ionization/eV)<<
" Density: "<<Density<<
" Radlen: "<<Radlen<<std::endl;
206 KalFitMaterial FitGoldLayerMaterial(Z,A/g/mole,Ionization/eV,Density,Radlen/10.);
207 _BesKalmanFitMaterials.push_back(FitGoldLayerMaterial);
211 double radius, thick, length , z0;
214 radius = innerwallFilm1Tub->GetInnerRadius()/(cm);
215 thick = innerwallFilm1Tub->GetOuterRadius()/(cm) - innerwallFilm1Tub->GetInnerRadius()/(cm);
216 length = 2.0*innerwallFilm1Tub->GetZHalfLength()/(cm);
218 std::cout<<
"innerwallFilm1: "<<
" radius: "<<radius<<
" thick:"<<thick<<
" length: "<<length<<std::endl;
219 KalFitCylinder innerwallFilm1Cylinder(&_BesKalmanFitMaterials[1], radius, thick, length , z0);
220 _BesKalmanFitWalls.push_back(innerwallFilm1Cylinder);
224 radius = innerwallTub->GetInnerRadius()/(cm);
225 thick = innerwallTub->GetOuterRadius()/(cm) - innerwallTub->GetInnerRadius()/(cm);
226 length = 2.0*innerwallTub->GetZHalfLength()/(cm);
228 std::cout<<
"innerwall: "<<
" radius: "<<radius<<
" thick:"<<thick<<
" length: "<<length<<std::endl;
229 KalFitCylinder innerwallCylinder(&_BesKalmanFitMaterials[2], radius, thick, length , z0);
230 _BesKalmanFitWalls.push_back(innerwallCylinder);
233 radius = innerwallFilm0Tub->GetInnerRadius()/(cm);
234 thick = innerwallFilm0Tub->GetOuterRadius()/(cm) - innerwallFilm0Tub->GetInnerRadius()/(cm);
235 length = 2.0*innerwallFilm0Tub->GetZHalfLength()/(cm);
237 std::cout<<
"innerwallFilm0: "<<
" radius: "<<radius<<
" thick:"<<thick<<
" length: "<<length<<std::endl;
238 KalFitCylinder innerwallFilm0Cylinder(&_BesKalmanFitMaterials[3], radius, thick, length , z0);
239 _BesKalmanFitWalls.push_back(innerwallFilm0Cylinder);
242 radius = outerBeTub->GetOuterRadius()/(cm);
243 thick = innerwallTub->GetInnerRadius()/(cm) - outerBeTub->GetOuterRadius()/(cm);
244 length = 2.0*innerwallTub->GetZHalfLength()/(cm);
246 std::cout<<
"outer air: "<<
" radius: "<<radius<<
" thick:"<<thick<<
" length: "<<length<<std::endl;
247 KalFitCylinder outerAirCylinder(&_BesKalmanFitMaterials[4], radius, thick, length , z0);
248 _BesKalmanFitWalls.push_back(outerAirCylinder);
251 radius = outerBeTub->GetInnerRadius()/(cm);
252 thick = outerBeTub->GetOuterRadius()/(cm) - outerBeTub->GetInnerRadius()/(cm);
253 length = 2.0*outerBeTub->GetZHalfLength()/(cm);
255 std::cout<<
"outer Be: "<<
" radius: "<<radius<<
" thick:"<<thick<<
" length: "<<length<<std::endl;
256 KalFitCylinder outerBeCylinder(&_BesKalmanFitMaterials[5], radius, thick, length , z0);
257 _BesKalmanFitWalls.push_back(outerBeCylinder);
260 radius = oilLayerTub->GetInnerRadius()/(cm);
261 thick = oilLayerTub->GetOuterRadius()/(cm) - oilLayerTub->GetInnerRadius()/(cm);
262 length = 2.0*oilLayerTub->GetZHalfLength()/(cm);
264 std::cout<<
"oil layer: "<<
" radius: "<<radius<<
" thick:"<<thick<<
" length: "<<length<<std::endl;
265 KalFitCylinder oilLayerCylinder(&_BesKalmanFitMaterials[6], radius, thick, length , z0);
266 _BesKalmanFitWalls.push_back(oilLayerCylinder);
269 radius = innerBeTub->GetInnerRadius()/(cm);
270 thick = innerBeTub->GetOuterRadius()/(cm) - innerBeTub->GetInnerRadius()/(cm);
271 length = 2.0*innerBeTub->GetZHalfLength()/(cm);
273 std::cout<<
"inner Be: "<<
" radius: "<<radius<<
" thick:"<<thick<<
" length: "<<length<<std::endl;
274 KalFitCylinder innerBeCylinder(&_BesKalmanFitMaterials[7], radius, thick, length , z0);
275 _BesKalmanFitWalls.push_back(innerBeCylinder);
278 radius = goldLayerTub->GetInnerRadius()/(cm);
279 thick = goldLayerTub->GetOuterRadius()/(cm) - goldLayerTub->GetInnerRadius()/(cm);
280 length = 2.0*goldLayerTub->GetZHalfLength()/(cm);
282 std::cout<<
"gold layer: "<<
" radius: "<<radius<<
" thick:"<<thick<<
" length: "<<length<<std::endl;
283 KalFitCylinder goldLayerCylinder(&_BesKalmanFitMaterials[8], radius, thick, length , z0);
284 _BesKalmanFitWalls.push_back(goldLayerCylinder);
void setBesFromGdml(void)
Cylinder is an Element whose shape is a cylinder.
static double mdcGasRadlen_
G4LogicalVolume * GetTopVolume()
Get the top(world) volume;.