20#include <TGeoManager.h>
21#include <TGeoMedium.h>
24#include <TGeoVolume.h>
108 const char* segmentName = Form(
"Segment %d",
i);
109 auto segment =
new TGeoVolumeAssembly(segmentName);
111 const int kNLayers = 6;
113 const std::string kLayerName[kNLayers] = {
"gas",
"cathode",
"insulator",
"rohacell",
"MEB",
"EERB"};
131 par[4] = -halfThickness;
134 par[7] = halfThickness;
140 segment->AddNode(
new TGeoVolume(Form(
"%s %s", segmentName, kLayerName[0].
data()),
new TGeoPgon(par), kLayerMedium[0]), 1);
144 for (
int j = 1;
j < kNLayers;
j++) {
146 halfThickness = kLayerHalfThickness[
j];
148 par[4] = -halfThickness;
149 par[7] = halfThickness;
150 auto layer =
new TGeoVolume(Form(
"Segment %d %s",
i, kLayerName[
j].
data()),
new TGeoPgon(par), kLayerMedium[
j]);
164 halfThickness = kLayerHalfThickness[0];
166 segment->AddNode(gGeoManager->MakeBox(Form(
"%s %s", segmentName, kLayerName[0].
data()), kLayerMedium[0], halfLength, halfHeight, halfThickness), 1);
170 for (
int j = 1;
j < kNLayers;
j++) {
172 halfThickness = kLayerHalfThickness[
j];
174 auto layer = gGeoManager->MakeBox(Form(
"%s %s", segmentName, kLayerName[
j].
data()), kLayerMedium[
j], halfLength, halfHeight, halfThickness);
220 double halfThickness = 0.,
z = 0.;
225 if (
i == 3 ||
i == 7) {
230 auto frame =
new TGeoVolumeAssembly(Form(
"Frame %d",
i));
242 frame->AddNode(rib, 1,
new TGeoTranslation(kRibXPos[
i - 1], kRibYPos[
i - 1],
z));
243 frame->AddNode(rib, 2,
new TGeoTranslation(kRibXPos[
i - 1], kRibYPos[
i - 1], -
z));
256 auto frame3 =
new TGeoVolumeAssembly(
"Frame 3");
262 par[4] = -halfThickness;
265 par[7] = halfThickness;
269 frame3->AddNode(
new TGeoVolume(
"Epoxy 3",
new TGeoPgon(par), kFrameMed), 1);
274 par[4] = -halfThickness;
277 par[7] = halfThickness;
281 auto rib3 =
new TGeoVolume(
"Rib 3",
new TGeoPgon(par), kRibMed);
284 frame3->AddNode(rib3, 1,
new TGeoTranslation(0., 0.,
z));
285 frame3->AddNode(rib3, 2,
new TGeoTranslation(0., 0., -
z));
288 auto frame7 =
new TGeoVolumeAssembly(
"Frame 7");
294 par[4] = -halfThickness;
297 par[7] = halfThickness;
300 frame3->AddNode(
new TGeoVolume(
"Epoxy 7",
new TGeoPgon(par), kFrameMed), 1);
305 par[4] = -halfThickness;
308 par[7] = halfThickness;
312 auto rib7 =
new TGeoVolume(
"Rib 7",
new TGeoPgon(par), kRibMed);
315 frame7->AddNode(rib7, 1,
new TGeoTranslation(0., 0.,
z));
316 frame7->AddNode(rib7, 2,
new TGeoTranslation(0., 0., -
z));
324 auto quadrant =
new TGeoVolumeAssembly(
"Station 2 quadrant");
331 quadrant->AddNode(
createSegment(
i), 0,
new TGeoTranslation(kSegXPos[
i], kSegYPos[
i], 0.));
338 const double kFrameXPos[
kNFrames] = {
349 const double kFrameYPos[
kNFrames] = {
361 quadrant->AddNode(gGeoManager->GetVolume(Form(
"Frame %d",
i)), 1,
362 new TGeoTranslation(kFrameXPos[
i - 1], kFrameYPos[
i - 1], 0.));
376 const int kNQuad = 4;
379 auto rot0 =
new TGeoRotation();
380 auto rot1 =
new TGeoRotation(
"reflXZ", 90., 180., 90., 90., 180., 0.);
381 auto rot2 =
new TGeoRotation(
"reflXY", 90., 180., 90., 270., 0., 0.);
382 auto rot3 =
new TGeoRotation(
"reflYZ", 90., 0., 90., -90., 180., 0.);
383 std::array<TGeoRotation*, kNQuad> rot = {rot0, rot1, rot2, rot3};
388 const int kFirstChamberNumber = 3;
390 for (
int ich = kFirstChamberNumber; ich < kFirstChamberNumber + 2; ich++) {
393 auto in =
new TGeoVolumeAssembly(Form(
"SC0%dI", ich));
394 auto out =
new TGeoVolumeAssembly(Form(
"SC0%dO", ich));
397 for (
int i = 0;
i < kNQuad;
i++) {
402 detElemID = 100 * ich +
i;
404 if (
i == 0 ||
i == 3) {
405 in->AddNode(quadrant, detElemID,
new TGeoCombiTrans(0., 0.,
z, rot[
i]));
407 out->AddNode(quadrant, detElemID,
new TGeoCombiTrans(0., 0.,
z, rot[
i]));
412 topVolume.AddNode(in, 2 * (ich - 1),
new TGeoTranslation(0., 0.,
kChamberZPos[ich - kFirstChamberNumber]));
413 topVolume.AddNode(out, 2 * ich - 1,
new TGeoTranslation(0., 0.,
kChamberZPos[ich - kFirstChamberNumber]));
423 std::vector<TGeoVolume*> sensitiveVolumeNames;
426 auto vol = gGeoManager->GetVolume(Form(
"Segment %d gas",
i));
429 throw std::runtime_error(Form(
"could not get expected volume : Segment %d gas",
i));
431 sensitiveVolumeNames.push_back(vol);
435 return sensitiveVolumeNames;
Implementation of the MID materials definitions.
Implementation of the station 2 geometry.
GLenum GLuint GLint GLint layer
GLdouble GLdouble GLdouble z
const double kRib7Radius[2]
const double kFrameHalfHeight[kNFrames]
const int kNFrames
Frames.
const double kGasHalfThickness
const double kRibHalfHeight[kNFrames]
const double kPCBHalfThickness
void createStation2Geometry(TGeoVolume &topVolume)
TGeoMedium * assertMedium(int imed)
const double kMEBHalfThickness
const double kFrame7Radius[2]
const double kBoxSegHalfLength[kNSegments]
std::vector< TGeoVolume * > getStation2SensitiveVolumes()
const double kInsuHalfThickness
TGeoVolume * createQuadrant()
const double kRibHalfLength[kNFrames]
const double kEpoxyHalfThickness
const double kFrame3Radius[2]
const double kFrameHalfLength[kNFrames]
const double kBoxSegHalfHeight[kNSegments]
const double kRibHalfThickness
const float kChamberZPos[2]
Constants.
const double kSegmentRadius[2]
const double kRohaHalfThickness
TGeoVolume * createSegment(int i)
const double kCathodeHalfThickness
const double kEERBHalfThickness
const int kNSegments
Segments.
const float kQuadrantZPos
const double kRib3Radius[2]
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...