construction wrapper seems to work

This commit is contained in:
Jan Kieseler
2023-09-07 23:31:46 +02:00
parent 3521cfd79e
commit 0adb64f763
6 changed files with 237 additions and 109 deletions
+62
View File
@@ -0,0 +1,62 @@
#include "ConstructionWrapper.hh"
Layer::Layer(){
thickness = 0;
material = "";
nx = 1;
ny = 1;
isActive = false;
physicalVolume = nullptr;
}
void Layer::setThickness(double thickness){
this->thickness = thickness;
}
void Layer::setMaterial(std::string material){
this->material = material;
}
void Layer::setNx(int nx){
this->nx = nx;
}
void Layer::setNy(int ny){
this->ny = ny;
}
void Layer::setIsActive(bool isActive){
this->isActive = isActive;
}
void Layer::assignPhysicalVolume(G4VPhysicalVolume* physicalVolume){
this->physicalVolume = physicalVolume;
}
ConstructionWrapper::ConstructionWrapper(double xy_width){
xywidth = xy_width;
}
void ConstructionWrapper::addLayer(double thickness, std::string material, bool isActive, int nx, int ny){
Layer layer;
layer.setThickness(thickness);
layer.setMaterial(material);
layer.setIsActive(isActive);
if(!isActive){
nx = 1;
ny = 1;
}
layer.setNx(nx);
layer.setNy(ny);
layer.sens_xwidth = xywidth/(float)nx;
layer.sens_ywidth = xywidth/(float)ny;
layers.push_back(layer);
}
const std::vector<Layer> & ConstructionWrapper::getLayers() const{
return layers;
}
std::vector<Layer> & ConstructionWrapper::getLayers(){
return layers;
}