Commit 85f12f93 authored by Sylvester Joosten's avatar Sylvester Joosten
Browse files

Add missing include directives to TOPSiDE source files

parent 8bd34b0c
Pipeline #8430 failed with stages
in 8 minutes and 6 seconds
......@@ -12,7 +12,7 @@ default:
before_script:
- mkdir -p images && mkdir -p doc/
- git clone https://eicweb.phy.anl.gov/EIC/detectors/accelerator.git && ln -s accelerator/eic
- mkdir build && cd build && cmake ../. -DCMAKE_INSTALL_PREFIX=/usr/local && make -j20 && make install && cd ..
- mkdir build && cd build && cmake ../. -DCMAKE_CXX_STANDARD=17 -DCMAKE_INSTALL_PREFIX=/usr/local && make -j20 && make install && cd .. || exit 1
artifacts:
paths:
- images/
......
#include "DD4hep/DetFactoryHelper.h"
#include "DD4hep/Printout.h"
#include "DD4hep/Shapes.h"
#include "DDRec/DetectorData.h"
#include "DDRec/Surface.h"
#include "TMath.h"
#include "XML/Helper.h"
#include "XML/Layering.h"
using namespace dd4hep;
static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens) {
xml::DetElement detElem = handle;
static Ref_t createDetector(Detector& desc, xml::Handle_t handle, SensitiveDetector sens)
{
xml::DetElement detElem = handle;
std::string detName = detElem.nameStr();
int detID = detElem.id();
std::string detName = detElem.nameStr();
int detID = detElem.id();
xml::Component dims = detElem.dimensions();
double rInner = dims.inner_radius();
double rOuter = dims.outer_radius();
double zMin = dims.zmin();
double angle = dims.angle();
double thickness = dims.thickness();
xml::Component dims = detElem.dimensions();
double rInner = dims.inner_radius();
double rOuter = dims.outer_radius();
double zMin = dims.zmin();
double angle = dims.angle();
double thickness = dims.thickness();
Material mat = desc.material(detElem.materialStr());
Material mat = desc.material(detElem.materialStr());
Cone envShape(0.5 * thickness, rInner, rOuter, rInner, rOuter + std::tan(angle) * thickness);
Volume envVol(detName + "_envelope", envShape, mat);
Cone envShape(0.5 * thickness, rInner, rOuter, rInner, rOuter + std::tan(angle) * thickness);
Volume envVol(detName + "_envelope", envShape, mat);
envVol.setVisAttributes(desc.visAttributes(detElem.visStr()));
envVol.setVisAttributes(desc.visAttributes(detElem.visStr()));
DetElement det(detName, detID);
Volume motherVol = desc.pickMotherVolume(det);
PlacedVolume envPV = motherVol.placeVolume(envVol, Position(0, 0, zMin + 0.5 * thickness));
envPV.addPhysVolID("system", detID);
det.setPlacement(envPV);
return det;
DetElement det(detName, detID);
Volume motherVol = desc.pickMotherVolume(det);
PlacedVolume envPV = motherVol.placeVolume(envVol, Position(0, 0, zMin + 0.5 * thickness));
envPV.addPhysVolID("system", detID);
det.setPlacement(envPV);
return det;
}
// clang-format off
......
#include "DD4hep/DetFactoryHelper.h"
#include "DD4hep/Printout.h"
#include "DD4hep/Shapes.h"
#include "DDRec/DetectorData.h"
#include "DDRec/Surface.h"
#include "XML/Layering.h"
#include <XML/Helper.h>
using namespace dd4hep;
static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens) {
xml::DetElement detElem = handle;
static Ref_t createDetector(Detector& desc, xml_h handle, SensitiveDetector sens)
{
xml::DetElement detElem = handle;
std::string detName = detElem.nameStr();
int detID = detElem.id();
std::string detName = detElem.nameStr();
int detID = detElem.id();
xml::Component dims = detElem.dimensions();
double rInner = dims.inner_radius();
double rMin = dims.rmin();
double thickness = dims.thickness();
double innerZ = dims.inner_z();
double angle = dims.angle();
xml::Component dims = detElem.dimensions();
double rInner = dims.inner_radius();
double rMin = dims.rmin();
double thickness = dims.thickness();
double innerZ = dims.inner_z();
double angle = dims.angle();
Material mat = desc.material(detElem.materialStr());
Material mat = desc.material(detElem.materialStr());
Tube outerTubeShape(rMin, rInner + thickness, innerZ + thickness);
Tube innerTubeShape(0, rInner, innerZ);
SubtractionSolid unchamferedShape(outerTubeShape, innerTubeShape);
Cone chamferShape(thickness, 0, rMin, 0, rMin + 2 * tan(angle) * thickness);
SubtractionSolid detShape(unchamferedShape, chamferShape, Position(0, 0, innerZ + thickness));
Volume detVol(detName, detShape, mat);
Tube outerTubeShape(rMin, rInner + thickness, innerZ + thickness);
Tube innerTubeShape(0, rInner, innerZ);
SubtractionSolid unchamferedShape(outerTubeShape, innerTubeShape);
Cone chamferShape(thickness, 0, rMin, 0, rMin + 2 * tan(angle) * thickness);
SubtractionSolid detShape(unchamferedShape, chamferShape, Position(0, 0, innerZ + thickness));
Volume detVol(detName, detShape, mat);
detVol.setVisAttributes(desc.visAttributes(detElem.visStr()));
detVol.setVisAttributes(desc.visAttributes(detElem.visStr()));
DetElement det(detName, detID);
Volume motherVol = desc.pickMotherVolume(det);
PlacedVolume detPV = motherVol.placeVolume(detVol);
det.setPlacement(detPV);
return det;
DetElement det(detName, detID);
Volume motherVol = desc.pickMotherVolume(det);
PlacedVolume detPV = motherVol.placeVolume(detVol);
det.setPlacement(detPV);
return det;
}
// clang-format off
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment