Skip to content

Commit ec14f04

Browse files
authored
[FOCAL-87] Implementing a new design for the HCAL (#14367)
* Implementing a new design for the HCAL. * Formatting
1 parent 33ad8d4 commit ec14f04

File tree

7 files changed

+465
-54
lines changed

7 files changed

+465
-54
lines changed

Detectors/FOCAL/base/include/FOCALBase/Geometry.h

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ class VirtualSegment
5959
class Geometry
6060
{
6161
public:
62+
enum HCALDesgin {
63+
Sandwich = 0, // Sandwich HCAL design
64+
Spaghetti = 1, // Spaghetti design
65+
Sheets = 2 // Sheets design
66+
};
67+
6268
Geometry() = default;
6369
Geometry(Geometry* geo);
6470
Geometry(const Geometry& geo) = default;
@@ -134,6 +140,8 @@ class Geometry
134140
float getMiddleTowerOffset() const { return mGlobal_Middle_Tower_Offset; }
135141
bool getInsertFrontPadLayers() const { return mInsertFrontPadLayers; }
136142
bool getInsertHCalReadoutMaterial() const { return mInsertFrontHCalReadoutMaterial; }
143+
float getHCALPitchSize() const { return mGlobal_HCAL_Pitch_Size; }
144+
float getHCALBeamPipeHoleSize() const { return mGlobal_HCAL_BeamPipeHole_Size; }
137145

138146
float getDetectorOpeningRight() const { return mGlobal_DetectorOpening_Right; }
139147
float getDetectorOpeningLeft() const { return mGlobal_DetectorOpening_Left; }
@@ -158,7 +166,7 @@ class Geometry
158166
void setUpLayerSegmentMap();
159167
void setUpTowerWaferSize();
160168

161-
bool getUseHCALSandwich() { return mUseSandwichHCAL; }
169+
HCALDesgin getHCALDesign() const { return mHCALDesign; }
162170

163171
protected:
164172
std::vector<Composition> mGeometryComposition;
@@ -206,9 +214,11 @@ class Geometry
206214
std::string mGlobal_Gap_Material; // gap filling material NOTE: currently not used
207215

208216
float mGlobal_HCAL_Tower_Size = 0.0;
209-
int mGlobal_HCAL_Tower_NX = 0; // Number of HCAL towers on X
210-
int mGlobal_HCAL_Tower_NY = 0; // Number of HCAL towers on Y
211-
bool mUseSandwichHCAL = false;
217+
int mGlobal_HCAL_Tower_NX = 0; // Number of HCAL towers on X
218+
int mGlobal_HCAL_Tower_NY = 0; // Number of HCAL towers on Y
219+
float mGlobal_HCAL_Pitch_Size = 0.0; // Distance between two fibers
220+
float mGlobal_HCAL_BeamPipeHole_Size = 0.0; // beam pipe hole size in HCAL
221+
HCALDesgin mHCALDesign = Sandwich; // HCAL design type
212222

213223
float mGlobal_FOCAL_Z0 = 0.0;
214224

Detectors/FOCAL/base/src/Geometry.cxx

Lines changed: 121 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,11 @@ void Geometry::setParameters(std::string geometryfile)
366366
LOG(debug) << "The size of the HCAL readout tower will be : " << mGlobal_HCAL_Tower_Size;
367367
}
368368

369+
if (command.find("HCAL_PITCH_SIZE") != std::string::npos) {
370+
mGlobal_HCAL_Pitch_Size = std::stof(tokens[1]);
371+
LOG(debug) << "The distance between fibers is : " << mGlobal_HCAL_Pitch_Size;
372+
}
373+
369374
if (command.find("HCAL_TOWER_NX") != std::string::npos) {
370375
mGlobal_HCAL_Tower_NX = std::stoi(tokens[1]);
371376
LOG(debug) << "The number of the HCAL readout towers in X will be : " << mGlobal_HCAL_Tower_NX;
@@ -376,6 +381,11 @@ void Geometry::setParameters(std::string geometryfile)
376381
LOG(debug) << "The number of the HCAL readout towers in Y will be : " << mGlobal_HCAL_Tower_NY;
377382
}
378383

384+
if (command.find("HCAL_BEAMPIPE") != std::string::npos) {
385+
mGlobal_HCAL_BeamPipeHole_Size = std::stof(tokens[1]);
386+
LOG(debug) << "The HCAL beam pipe openning : " << mGlobal_HCAL_BeamPipeHole_Size;
387+
}
388+
379389
if (command.find("PIX_OffsetX") != std::string::npos) {
380390
mGlobal_PIX_OffsetX = std::stof(tokens[1]);
381391
LOG(debug) << "Pixel offset from the beam pipe will be: " << mGlobal_PIX_OffsetX;
@@ -429,11 +439,6 @@ void Geometry::setParameters(std::string geometryfile)
429439
if (command.find("NUMBER_OF_HCAL_LAYERS") != std::string::npos) {
430440
mNHCalLayers = std::stoi(tokens[1]);
431441
LOG(debug) << "Number of HCAL layers " << mNHCalLayers;
432-
if (mNHCalLayers == 1) {
433-
mUseSandwichHCAL = false;
434-
} else {
435-
mUseSandwichHCAL = true;
436-
}
437442
}
438443

439444
if (command.find("NUMBER_OF_SEGMENTS") != std::string::npos) {
@@ -640,6 +645,14 @@ void Geometry::setParameters(std::string geometryfile)
640645
mHCalLayerThickness = center_z;
641646
center_z = 0;
642647

648+
if (mNHCalLayers == 1 && hHCal > 2) {
649+
mHCALDesign = Geometry::HCALDesgin::Sheets;
650+
} else if (mNHCalLayers == 1 && hHCal == 2) {
651+
mHCALDesign = Geometry::HCALDesgin::Spaghetti;
652+
} else {
653+
mHCALDesign = Geometry::HCALDesgin::Sandwich;
654+
}
655+
643656
mFrontMatterLayerThickness = center_z;
644657
LOG(debug) << " end of SetParameters ";
645658
}
@@ -702,27 +715,34 @@ std::tuple<double, double, double> Geometry::getGeoTowerCenter(int tower, int se
702715
int ix = id % nCols;
703716
int iy = id / nRows;
704717

705-
if (mUseSandwichHCAL) {
706-
float padSize = mVirtualSegmentComposition[segment].mPadSize;
707-
double hCALsizeX = nCols * padSize;
708-
double hCALsizeY = nRows * padSize;
709-
x = ix * padSize + 0.5 * padSize - 0.5 * hCALsizeX;
710-
y = iy * padSize + 0.5 * padSize - 0.5 * hCALsizeY;
711-
} else {
712-
nCols = std::floor(getFOCALSizeX() / getHCALTowerSize() + 0.001) + 1;
713-
nRows = std::floor(getFOCALSizeY() / getHCALTowerSize() + 0.001);
714-
ix = id % nCols;
715-
iy = id / nRows;
716-
double beamPipeRadius = 3.6; // in cm TODO: check if this is OK
717-
double towerHalfDiag = std::sqrt(2) * 0.5 * getTowerSizeX(); // tower half diagonal
718-
double minRadius = beamPipeRadius + towerHalfDiag;
719-
720-
float towerSize = getHCALTowerSize() / 7; // To be set from outside (number of channels on x & y)
721-
y = iy * towerSize + 0.5 * towerSize - 0.5 * towerSize * nRows;
722-
x = ix * towerSize + 0.5 * towerSize - 0.5 * towerSize * nCols;
723-
if (y < minRadius && y > -minRadius) {
724-
x = int(x) <= 0 ? x - (minRadius - towerSize) : x + (minRadius - towerSize);
718+
switch (mHCALDesign) {
719+
case HCALDesgin::Sandwich: {
720+
float padSize = mVirtualSegmentComposition[segment].mPadSize;
721+
double hCALsizeX = nCols * padSize;
722+
double hCALsizeY = nRows * padSize;
723+
724+
x = ix * padSize + 0.5 * padSize - 0.5 * hCALsizeX;
725+
y = iy * padSize + 0.5 * padSize - 0.5 * hCALsizeY;
726+
break;
725727
}
728+
case HCALDesgin::Spaghetti: {
729+
float towerSize = getHCALTowerSize() / 7; // To be set from outside (number of channels on x & y)
730+
y = iy * towerSize + 0.5 * towerSize - 0.5 * towerSize * nRows;
731+
x = ix * towerSize + 0.5 * towerSize - 0.5 * towerSize * nCols;
732+
break;
733+
}
734+
case HCALDesgin::Sheets: {
735+
Composition comp1 = mHCalCompositionBase[0];
736+
Composition comp2 = mHCalCompositionBase[2];
737+
double hCALsizeX = comp1.sizeX() * 2; // Size of two sheet in X
738+
double hCALsizeY = getHCALTowersInY() * (comp1.sizeY() + comp2.sizeY()) * 2; // To be set in a better way
739+
740+
x = ix * hCALsizeX / getHCALTowersInX() + 0.5 * hCALsizeX / getHCALTowersInX() - 0.5 * hCALsizeX;
741+
y = iy * hCALsizeY / getHCALTowersInY() + 0.5 * hCALsizeY / getHCALTowersInY() - 0.5 * hCALsizeY;
742+
break;
743+
}
744+
default:
745+
break;
726746
}
727747
}
728748

@@ -1118,12 +1138,41 @@ std::tuple<bool, int, int, int, int> Geometry::getVirtualInfo(double x, double y
11181138
x = x < 0 ? x - 0.001 : x + 0.001;
11191139
y = y < 0 ? y - 0.001 : y + 0.001;
11201140
}
1121-
if (!mUseSandwichHCAL) {
1122-
row = (int)((y + hCALsizeY / 2) / (towerSize / 7));
1123-
col = (int)((x + hCALsizeX / 2) / (towerSize / 7));
1124-
} else {
1125-
row = (int)((y + hCALsizeY / 2) / (towerSize));
1126-
col = (int)((x + hCALsizeX / 2) / (towerSize));
1141+
1142+
switch (mHCALDesign) {
1143+
case HCALDesgin::Sandwich: {
1144+
row = (int)((y + hCALsizeY / 2) / (towerSize));
1145+
col = (int)((x + hCALsizeX / 2) / (towerSize));
1146+
break;
1147+
}
1148+
case HCALDesgin::Spaghetti: {
1149+
row = (int)((y + hCALsizeY / 2) / (towerSize / 7));
1150+
col = (int)((x + hCALsizeX / 2) / (towerSize / 7));
1151+
break;
1152+
}
1153+
case HCALDesgin::Sheets: {
1154+
Composition comp1 = mHCalCompositionBase[0];
1155+
Composition comp2 = mHCalCompositionBase[2];
1156+
double hCALsizeX = comp1.sizeX() * 2; // Size of two sheet in X
1157+
double hCALsizeY = getHCALTowersInY() * (comp1.sizeY() + comp2.sizeY()) * 2; // To be set in a better way
1158+
1159+
if (y < getHCALBeamPipeHoleSize() / 2 && y > -getHCALBeamPipeHoleSize() / 2) {
1160+
if (x < 0) {
1161+
x += 1.0; // remove the offset around the beam pipe
1162+
} else {
1163+
x -= 1.0; // remove the offset around the beam pipe
1164+
}
1165+
}
1166+
1167+
row = (int)((y + hCALsizeY / 2) / (hCALsizeY / getHCALTowersInY()));
1168+
if (x > 0) {
1169+
x = x - 0.15 - 0.06;
1170+
}
1171+
col = (int)((x - 0.15 + hCALsizeX / 2) / ((hCALsizeX - 0.15 * 2 - 0.06 * 2) / getHCALTowersInX()));
1172+
break;
1173+
}
1174+
default:
1175+
break;
11271176
}
11281177
} else {
11291178
row = (int)((y + getFOCALSizeY() / 2) / mVirtualSegmentComposition[segment].mPadSize);
@@ -1150,12 +1199,29 @@ std::tuple<bool, double, double, double> Geometry::getXYZFromColRowSeg(int col,
11501199
double hCALsizeX = getHCALTowersInX() * towerSize;
11511200
double hCALsizeY = getHCALTowersInY() * towerSize;
11521201

1153-
if (!mUseSandwichHCAL) {
1154-
y = -1 * hCALsizeY / 2 + ((float)row + 0.5) * (towerSize / 7);
1155-
x = -1 * hCALsizeX / 2 + ((float)col + 0.5) * (towerSize / 7);
1156-
} else {
1157-
y = -1 * hCALsizeY / 2 + ((float)row + 0.5) * (towerSize);
1158-
x = -1 * hCALsizeX / 2 + ((float)col + 0.5) * (towerSize);
1202+
switch (mHCALDesign) {
1203+
case HCALDesgin::Sandwich: {
1204+
y = -1 * hCALsizeY / 2 + ((float)row + 0.5) * (towerSize);
1205+
x = -1 * hCALsizeX / 2 + ((float)col + 0.5) * (towerSize);
1206+
break;
1207+
}
1208+
case HCALDesgin::Spaghetti: {
1209+
y = -1 * hCALsizeY / 2 + ((float)row + 0.5) * (towerSize / 7);
1210+
x = -1 * hCALsizeX / 2 + ((float)col + 0.5) * (towerSize / 7);
1211+
break;
1212+
}
1213+
case HCALDesgin::Sheets: {
1214+
Composition comp1 = mHCalCompositionBase[0];
1215+
Composition comp2 = mHCalCompositionBase[2];
1216+
double hCALsizeX = comp1.sizeX() * 2; // Size of two sheet in X
1217+
double hCALsizeY = getHCALTowersInY() * (comp1.sizeY() + comp2.sizeY()) * 2; // To be set in a better way
1218+
1219+
y = -1 * hCALsizeY / 2 + ((float)row + 0.5) * (hCALsizeY / getHCALTowersInY());
1220+
x = -1 * hCALsizeX / 2 + ((float)col + 0.5) * (hCALsizeX / getHCALTowersInX());
1221+
break;
1222+
}
1223+
default:
1224+
break;
11591225
}
11601226
} else {
11611227
y = -1 * getFOCALSizeY() / 2 + ((float)row + 0.5) * mVirtualSegmentComposition[segment].mPadSize;
@@ -1191,12 +1257,24 @@ std::tuple<bool, int, int> Geometry::getVirtualNColRow(int segment) const
11911257
nCol = (int)(getFOCALSizeX() / mVirtualSegmentComposition[segment].mPadSize + 0.001);
11921258
nRow = (int)(getFOCALSizeY() / mVirtualSegmentComposition[segment].mPadSize + 0.001);
11931259
if (getVirtualIsHCal(segment)) {
1194-
if (!mUseSandwichHCAL) {
1195-
nCol = getHCALTowersInX() * 7; // To be set from outside (number of channels in each tower on x)
1196-
nRow = getHCALTowersInY() * 7; // To be set from outside (number of channels in each tower on y)
1197-
} else {
1198-
nCol = getHCALTowersInX();
1199-
nRow = getHCALTowersInY();
1260+
switch (mHCALDesign) {
1261+
case HCALDesgin::Sandwich: {
1262+
nCol = getHCALTowersInX();
1263+
nRow = getHCALTowersInY();
1264+
break;
1265+
}
1266+
case HCALDesgin::Spaghetti: {
1267+
nCol = getHCALTowersInX() * 7; // To be set from outside (number of channels in each tower on x)
1268+
nRow = getHCALTowersInY() * 7; // To be set from outside (number of channels in each tower on y)
1269+
break;
1270+
}
1271+
case HCALDesgin::Sheets: {
1272+
nCol = getHCALTowersInX();
1273+
nRow = getHCALTowersInY();
1274+
break;
1275+
}
1276+
default:
1277+
break;
12001278
}
12011279
}
12021280
return {true, nCol, nRow};
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Volume Name Material C-X C-Y X Y Z
2+
COMPOSITION_PAD_S0 Alloy 0 0 9. 8. 0.35
3+
COMPOSITION_PAD_S1 G10 0 0 9. 8. 0.08
4+
COMPOSITION_PAD_S2 SiPad 0 0 9. 8. 0.03
5+
COMPOSITION_PAD_S3 G10 0 0 9. 8. 0.08
6+
COMPOSITION_PAD_S4 Cu 0 0 9. 8. 0.014
7+
COMPOSITION_PAD_S5 Air 0 0 9. 8. 0.296
8+
# Replica of above pad layers to 50 layers
9+
COMMAND_NUMBER_OF_PAD_LAYERS 18
10+
# HCAL layers
11+
# Volume Name Material C-X C-Y X Y Z
12+
COMPOSITION_HCAL_S0 CuHCAL 0 0 49.81 0.20 110
13+
COMPOSITION_HCAL_S1 Scint 0 0 0.1 0.1 110
14+
COMPOSITION_HCAL_S2 CuHCAL 0 0 49.81 0.15 110
15+
COMMAND_NUMBER_OF_HCAL_LAYERS 1
16+
COMMAND_NUMBER_OF_SEGMENTS 21
17+
# Strip sectors
18+
# Volume Name Material C-X C-Y X Y Z
19+
COMPOSITION_PIX_S0 Alloy 0 0 3.0 2.74 0.35
20+
COMPOSITION_PIX_S1 G10 0 0 3.0 2.74 0.1
21+
COMPOSITION_PIX_S2 Si 0 0 3.0 2.74 0.047
22+
COMPOSITION_PIX_S3 SiPix 0 0 3.0 2.74 0.003
23+
COMPOSITION_PIX_S4 G10 0 0 3.0 2.74 0.1
24+
COMPOSITION_PIX_S5 Cu 0 0 3.0 2.74 0.001
25+
COMPOSITION_PIX_S6 Air 0 0 3.0 2.74 0.249
26+
COMMAND_INSERT_PIX_AT_L4
27+
COMMAND_INSERT_PIX_AT_L9
28+
# COMMAND_INSERT_STR_AT_L4
29+
# COMMAND_INSERT_STR_AT_L6
30+
# COMMAND_INSERT_STR_AT_L8
31+
#Front Matter definition
32+
COMPOSITION_FM_S0 G10 0 0 5. 5. 0.01
33+
COMPOSITION_FM_S1 SiStripX 0 0 5. 5. 0.05
34+
COMPOSITION_FM_S2 G10 0 0 5. 5. 0.05
35+
COMPOSITION_FM_S3 Air 0 0 5. 5. 0.01
36+
COMPOSITION_FM_S4 G10 0 0 5. 5. 0.01
37+
COMPOSITION_FM_S5 SiStripY 0 0 5. 5. 0.05
38+
COMPOSITION_FM_S6 G10 0 0 5. 5. 0.05
39+
# PIXEL readout
40+
GLOBAL_PIX_NX 15
41+
GLOBAL_PIX_NY 3
42+
GLOBAL_PIX_OffsetX 1.2
43+
GLOBAL_PIX_OffsetY 0.09
44+
GLOBAL_PIX_SKIN 0.004
45+
# pxel size in cm
46+
COMMAND_PIXEL_READOUT_ON 0.005
47+
# Pad information
48+
GLOBAL_PAD_SIZE_X_Y 1
49+
GLOBAL_PAD_NX_NY 8
50+
GLOBAL_PAD_NX 9
51+
GLOBAL_PAD_NY 8
52+
GLOBAL_PAD_PPTOL 0.
53+
GLOBAL_PAD_SKIN 0.2
54+
# Global information (TOL:1cm of T-T space filled with "AIR")
55+
GLOBAL_PAD_SUPERMODULE_X 5
56+
GLOBAL_PAD_SUPERMODULE_Y 1
57+
GLOBAL_SUPERMODULE_TOLX 0. Air
58+
GLOBAL_SUPERMODULE_TOLY 0. Air
59+
GLOBAL_TOWER_TOL 0. Air
60+
GLOBAL_TOWER_TOLX 0.02 Air
61+
GLOBAL_TOWER_TOLY 0.8 Al
62+
GLOBAL_FOCAL_Z 764.47
63+
GLOBAL_Tower_NX 2
64+
GLOBAL_Tower_NY 11
65+
GLOBAL_MIDDLE_TOWER_OFFSET 5
66+
GLOBAL_NSTRIPS 128
67+
GLOBAL_STRIPSIZE_LONG 9.0
68+
GLOBAL_STRIPSIZE_WIDTH 0.07
69+
GLOBAL_HCAL_PITCH_SIZE 0.4
70+
GLOBAL_HCAL_TOWER_NY 72
71+
GLOBAL_HCAL_TOWER_NX 62
72+
GLOBAL_HCAL_BEAMPIPE 8.4
73+
# COMMAND_INSERT_FRONT_PAD_LAYERS
74+
# COMMAND_INSERT_HCAL_READOUT
75+
# New VIRTUAL settings
76+
VIRTUAL_N_SEGMENTS 7
77+
# N Start End PadSize RelThickness IsPixel PixelTreshold [eV]
78+
# Layer Layer
79+
VIRTUAL_SEGMENT_LAYOUT_N0 0 3 1.0 1.0 0 300000
80+
VIRTUAL_SEGMENT_LAYOUT_N1 4 4 0.05 1.0 1 4000
81+
VIRTUAL_SEGMENT_LAYOUT_N2 5 8 1.0 1.0 0 300000
82+
VIRTUAL_SEGMENT_LAYOUT_N3 9 9 0.05 1.0 1 4000
83+
VIRTUAL_SEGMENT_LAYOUT_N4 10 14 1.0 1.0 0 375000
84+
VIRTUAL_SEGMENT_LAYOUT_N5 15 19 1.0 1.0 0 375000
85+
VIRTUAL_SEGMENT_LAYOUT_N6 20 20 0.4 1.0 2 5000
86+
#EOF

Detectors/FOCAL/simulation/include/FOCALSimulation/Detector.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "DetectorsBase/Detector.h"
1818
#include "FOCALBase/Hit.h"
1919
#include "FOCALBase/Geometry.h"
20+
#include "TGeoManager.h"
2021

2122
class FairVolume;
2223

@@ -157,6 +158,17 @@ class Detector : public o2::base::DetImpl<Detector>
157158

158159
virtual void CreateHCALSpaghetti();
159160
virtual void CreateHCALSandwich();
161+
virtual void CreateHCALSheets();
162+
163+
TGeoVolumeAssembly* CreatePitchAssembly(double Lx = 498.1,
164+
double Ly1 = 2.0,
165+
double Ly2 = 1.5,
166+
double Lz = 1100.0,
167+
double hole_diameter = 1.1,
168+
double hole_spacing = 4.0,
169+
int nholes = 124,
170+
double fiber_radius = 0.5,
171+
std::string suffix = "");
160172

161173
/// \brief Generate ECAL geometry
162174
void CreateECALGeometry();

0 commit comments

Comments
 (0)