Skip to content

Commit 9fed823

Browse files
committed
ITS3: shift back to nominal pos + proper metal stack position
Signed-off-by: Felix Schlepper <[email protected]>
1 parent ee1574e commit 9fed823

File tree

7 files changed

+49
-42
lines changed

7 files changed

+49
-42
lines changed

Detectors/Upgrades/ITS3/base/include/ITS3Base/SegmentationMosaix.h

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class SegmentationMosaix
6666
static constexpr float Width{constants::pixelarray::width};
6767
static constexpr float PitchCol{constants::pixelarray::length / static_cast<float>(NCols)};
6868
static constexpr float PitchRow{constants::pixelarray::width / static_cast<float>(NRows)};
69-
static constexpr float SensorLayerThickness{constants::thickness};
69+
static constexpr float SensorLayerThickness{constants::totalThickness};
7070

7171
/// Transformation from the curved surface to a flat surface
7272
/// \param xCurved Detector local curved coordinate x in cm with respect to
@@ -79,11 +79,14 @@ class SegmentationMosaix
7979
/// the center of the sensitive volume.
8080
void curvedToFlat(const float xCurved, const float yCurved, float& xFlat, float& yFlat) const noexcept
8181
{
82-
// MUST align the flat surface with the curved surface with the original pixel array is on
82+
// MUST align the flat surface with the curved surface with the original pixel array is on and account for metal
83+
// stack
8384
float dist = std::hypot(xCurved, yCurved);
8485
float phi = std::atan2(yCurved, xCurved);
8586
xFlat = (getRadius() * phi) - Width / 2.f;
86-
yFlat = dist - getRadius();
87+
// the y position is in the silicon volume however we need the chip volume (silicon+metalstack)
88+
// this is accounted by a y shift
89+
yFlat = dist - getRadius() + static_cast<float>(constants::nominalYShift);
8790
}
8891

8992
/// Transformation from the flat surface to a curved surface
@@ -98,8 +101,11 @@ class SegmentationMosaix
98101
/// the center of the sensitive volume.
99102
void flatToCurved(float xFlat, float yFlat, float& xCurved, float& yCurved) const noexcept
100103
{
101-
// MUST align the flat surface with the curved surface with the original pixel array is on
102-
float dist = yFlat + getRadius();
104+
// MUST align the flat surface with the curved surface with the original pixel array is on and account for metal
105+
// stack
106+
// the y position is in the chip volume however we need the silicon volume
107+
// this is accounted by a -y shift
108+
float dist = yFlat + getRadius() - static_cast<float>(constants::nominalYShift);
103109
xCurved = dist * std::cos((xFlat + Width / 2.f) / getRadius());
104110
yCurved = dist * std::sin((xFlat + Width / 2.f) / getRadius());
105111
}
@@ -190,7 +196,7 @@ class SegmentationMosaix
190196

191197
float getRadius() const noexcept
192198
{
193-
return static_cast<float>(constants::radii[mLayer]);
199+
return static_cast<float>(constants::radiiMiddle[mLayer]);
194200
}
195201

196202
int mLayer{0}; ///< chip layer

Detectors/Upgrades/ITS3/base/include/ITS3Base/SpecsV2.h

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -134,30 +134,36 @@ constexpr double length{segment::length};
134134
constexpr double width{segment::width};
135135
constexpr EColor color{kBlack};
136136
} // namespace metalstack
137+
namespace silicon
138+
{
139+
constexpr double thickness{45 * mu}; // thickness of silicion
140+
constexpr double radiusInner{(thickness + metalstack::thickness) / 2.}; // inner silicion radius correction
141+
constexpr double radiusOuter{(thickness - metalstack::thickness) / 2.}; // outer silicion radius correction
142+
} // namespace silicon
137143
constexpr unsigned int nLayers{3};
138144
constexpr unsigned int nTotLayers{7};
139145
constexpr unsigned int nSensorsIB{2 * nLayers};
140146
constexpr double equatorialGap{1 * mm};
141147
constexpr std::array<unsigned int, nLayers> nSegments{3, 4, 5};
142-
constexpr double epitaxialThickness{10 * mu}; // eptixial layer (charge collection)
143-
constexpr double psubThickness{40 * mu}; // silicon substrate
144-
constexpr double thickness{epitaxialThickness + psubThickness}; // physical thickness of chip
145-
constexpr std::array<double, nLayers> radii{19.0006 * mm, 25.228 * mm, 31.4554 * mm}; // middle radius
146-
constexpr std::array<double, nLayers> radiiInner{radii[0] - thickness / 2.0, radii[1] - thickness / 2.0, radii[2] - thickness / 2.0}; // inner radius
147-
constexpr std::array<double, nLayers> radiiOuter{radii[0] + thickness / 2.0, radii[1] + thickness / 2.0, radii[2] + thickness / 2.0}; // outer radius
148+
constexpr double totalThickness{silicon::thickness + metalstack::thickness}; // total chip thickness
149+
constexpr std::array<double, nLayers> radii{19.0006 * mm, 25.228 * mm, 31.4554 * mm}; // nominal radius
150+
constexpr std::array<double, nLayers> radiiInner{radii[0] - silicon::radiusInner, radii[1] - silicon::radiusInner, radii[2] - silicon::radiusInner}; // inner silicon radius
151+
constexpr std::array<double, nLayers> radiiOuter{radii[0] + silicon::radiusOuter, radii[1] + silicon::radiusOuter, radii[2] + silicon::radiusOuter}; // outer silicon radius
152+
constexpr std::array<double, nLayers> radiiMiddle{(radiiInner[0] + radiiOuter[0]) / 2., (radiiInner[1] + radiiOuter[1]) / 2., (radiiInner[2] + radiiOuter[2]) / 2.}; // middle silicon radius
153+
constexpr double nominalYShift{-metalstack::thickness / 2.}; // shift to position in silicion volume to the chip volume (silicon+metalstack)
148154
namespace detID
149155
{
150-
constexpr unsigned int mDetIDs{2 * 12 * 12 * 12}; //< 2 Hemispheres * (3,4,5=12 segments in a layer) * 12 RSUs in a segment * 12 Tiles in a RSU
151-
constexpr unsigned int l0IDStart{0}; //< Start DetID layer 0
152-
constexpr unsigned int l0IDEnd{2 * 3 * 12 * 12 - 1}; //< End First DetID layer 0; inclusive range
153-
constexpr unsigned int l0IDTot{2 * 3 * 12 * 12}; //< Total DetID in Layer 0
154-
constexpr unsigned int l1IDStart{l0IDEnd + 1}; //< Start DetID layer 1
155-
constexpr unsigned int l1IDEnd{l1IDStart + 2 * 4 * 12 * 12 - 1}; //< End First DetID layer 1; inclusive range
156-
constexpr unsigned int l1IDTot{2 * 4 * 12 * 12}; //< Total DetID in Layer 1
157-
constexpr unsigned int l2IDStart{l1IDEnd + 1}; //< Start DetID layer 2
158-
constexpr unsigned int l2IDEnd{l2IDStart + 2 * 5 * 12 * 12 - 1}; //< End First DetID layer 2; inclusive range
159-
constexpr unsigned int l2IDTot{2 * 5 * 12 * 12}; //< Total DetID in Layer 2
160-
constexpr unsigned int nChips{l2IDEnd + 1}; //< number of Chips (PixelArrays) in IB
156+
constexpr unsigned int mDetIDs{2 * 12 * 12 * 12}; //< 2 Hemispheres * (3,4,5=12 segments in a layer) * 12 RSUs in a segment * 12 Tiles in a RSU
157+
constexpr unsigned int l0IDStart{0}; //< Start DetID layer 0
158+
constexpr unsigned int l0IDEnd{(2 * 3 * 12 * 12) - 1}; //< End First DetID layer 0; inclusive range
159+
constexpr unsigned int l0IDTot{2 * 3 * 12 * 12}; //< Total DetID in Layer 0
160+
constexpr unsigned int l1IDStart{l0IDEnd + 1}; //< Start DetID layer 1
161+
constexpr unsigned int l1IDEnd{l1IDStart + (2 * 4 * 12 * 12) - 1}; //< End First DetID layer 1; inclusive range
162+
constexpr unsigned int l1IDTot{2 * 4 * 12 * 12}; //< Total DetID in Layer 1
163+
constexpr unsigned int l2IDStart{l1IDEnd + 1}; //< Start DetID layer 2
164+
constexpr unsigned int l2IDEnd{l2IDStart + (2 * 5 * 12 * 12) - 1}; //< End First DetID layer 2; inclusive range
165+
constexpr unsigned int l2IDTot{2 * 5 * 12 * 12}; //< Total DetID in Layer 2
166+
constexpr unsigned int nChips{l2IDEnd + 1}; //< number of Chips (PixelArrays) in IB
161167

162168
template <typename T = int>
163169
inline T getDetID2Layer(T detID)

Detectors/Upgrades/ITS3/macros/test/CheckDigitsDensity.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ void CheckDigitsDensity(int nEvents = 10000, std::string digitFileName = "it3dig
8080
digitTree->SetBranchAddress("IT3Digit", &digitArrayPtr);
8181
std::array<TH2F*, 3> hists;
8282
for (int i{3}; i--;) {
83-
double rmin = its3::constants::radii[i] - its3::constants::thickness;
84-
double rmax = its3::constants::radii[i] + its3::constants::thickness;
83+
double rmin = its3::constants::radiiInner[i];
84+
double rmax = its3::constants::radiiOuter[i];
8585
hists[i] = new TH2F(Form("h_digits_dens_L%d", i), Form("Digit Density L%d in %d Events; Z_{Glo} [cm]; R_{Glo} [cm]", i, nEvents), 100, -15, 15, 100, rmin, rmax);
8686
}
8787

Detectors/Upgrades/ITS3/macros/test/CheckDigitsITS3.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ void CheckDigitsITS3(std::string digifile = "it3digits.root", std::string hitfil
185185
const auto* mc2hit = &mc2hitVec[lab.getEventID()];
186186
const auto& hitEntry = mc2hit->find(key);
187187
if (hitEntry == mc2hit->end()) {
188-
LOGP(error, "Failed to find MC hit entry for Tr {} chipID {}", trID, chipID);
188+
LOGP(debug, "Failed to find MC hit entry for Tr {} chipID {}", trID, chipID);
189189
continue;
190190
}
191191

@@ -197,7 +197,7 @@ void CheckDigitsITS3(std::string digifile = "it3digits.root", std::string hitfil
197197
auto xyzLocE = gman->getMatrixL2G(chipID) ^ (hit.GetPos()); // inverse conversion from global to local
198198
auto xyzLocS = gman->getMatrixL2G(chipID) ^ (hit.GetPosStart());
199199
o2::math_utils::Vector3D<float> xyzLocM;
200-
xyzLocM.SetCoordinates(0.5 * (xyzLocE.X() + xyzLocS.X()), 0.5 * (xyzLocE.Y() + xyzLocS.Y()), 0.5 * (xyzLocE.Z() + xyzLocS.Z()));
200+
xyzLocM.SetCoordinates(0.5f * (xyzLocE.X() + xyzLocS.X()), 0.5f * (xyzLocE.Y() + xyzLocS.Y()), 0.5f * (xyzLocE.Z() + xyzLocS.Z()));
201201
float xlc = 0., zlc = 0.;
202202
int row = 0, col = 0;
203203

Detectors/Upgrades/ITS3/macros/test/CheckMosaixSegment.C

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,7 @@ void CheckMosaixSegment(bool isTestDetectorToLocal = false,
186186
TArc* arc[3];
187187
h_xCurved_yCurved->Draw("colz");
188188
for (int i = 0; i < 3; i++) {
189-
arc[i] = new TArc(-0, 0, constants::radii[i] + constants::thickness / 2., -5, 40);
190-
arc[i]->SetLineColor(kRed);
189+
arc[i] = new TArc(-0, 0, constants::radiiOuter[i], -5, 40);
191190
arc[i]->SetFillStyle(0);
192191
}
193192

Detectors/Upgrades/ITS3/macros/test/CheckMosaixSegmentTrans.C

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ void CheckMosaixSegmentTrans()
8989
gStyle->SetOptStat(1111111);
9090

9191
for (int iLayer{0}; iLayer < 3; ++iLayer) {
92-
float r_inner = constants::radii[iLayer] - constants::thickness / 2.;
93-
float r_outer = constants::radii[iLayer] + constants::thickness / 2.;
92+
float r_inner = constants::radiiInner[iLayer];
93+
float r_outer = constants::radiiOuter[iLayer];
9494
float phiReadout_inner =
9595
constants::tile::readout::width / r_inner * Rad2Deg;
9696
float phiReadout_outer =
@@ -203,13 +203,11 @@ void CheckMosaixSegmentTrans()
203203
float xRow{0}, zCol{0};
204204
int iiRow{0}, iiCol{0};
205205
auto v1 = mMosaixSegmentations[iLayer].detectorToLocal(iRow, iCol, xRow, zCol);
206-
auto v2 = mMosaixSegmentations[iLayer].localToDetector(xRow, zCol, iiRow,
207-
iiCol);
208-
// Info("L2D",
209-
// "iRow=%d, iCol=%d --d2l(%s)--> xRow=%f, zCol=%f --l2d(%s)--> "
210-
// "iiRow=%d, iiCol=%d",
211-
// iRow, iCol, v1 ? "good" : "bad", xRow, zCol, v2 ? "good" :
212-
// "bad", iiRow, iiCol);
206+
auto v2 = mMosaixSegmentations[iLayer].localToDetector(xRow, zCol, iiRow, iiCol);
207+
Info("L2D",
208+
"iRow=%d, iCol=%d --d2l(%s)--> xRow=%f, zCol=%f --l2d(%s)--> "
209+
"iiRow=%d, iiCol=%d",
210+
iRow, iCol, v1 ? "good" : "bad", xRow, zCol, v2 ? "good" : "bad", iiRow, iiCol);
213211
if (!v1 || !v2) {
214212
Error("LOOP", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Layer %d", iLayer);
215213
return;

Detectors/Upgrades/ITS3/simulation/src/ITS3Layer.cxx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void ITS3Layer::createLayer(TGeoVolume* motherVolume)
7373
return;
7474
}
7575
// Add it to motherVolume
76-
auto* trans = new TGeoTranslation(0, 0, -constants::segment::lengthSensitive / 2. - constants::rsu::databackbone::length / 2. + constants::tile::powerswitches::length / 2.);
76+
auto* trans = new TGeoTranslation(0, 0, -constants::segment::lengthSensitive / 2.);
7777
motherVolume->AddNode(mLayer, 0, trans);
7878
}
7979

@@ -83,8 +83,6 @@ void ITS3Layer::createPixelArray()
8383
return;
8484
}
8585
// A pixel array is pure silicon and the sensitive part of our detector.
86-
// It will be segmented into a 442x156 matrix by the
87-
// SuperSegmentationAlpide.
8886
using namespace its3c::pixelarray;
8987
double pixelArrayPhi = width / mR * o2m::Rad2Deg;
9088
auto pixelArray = new TGeoTubeSeg(mRmin, mRmax, length / 2., 0, pixelArrayPhi);
@@ -293,7 +291,7 @@ void ITS3Layer::createCarbonForm()
293291
mCarbonForm->VisibleDaughters();
294292
double dRadius = -1;
295293
if (mNLayer < 2) {
296-
dRadius = constants::radii[mNLayer + 1] - constants::radii[mNLayer] - constants::thickness - constants::metalstack::thickness;
294+
dRadius = constants::radii[mNLayer + 1] - constants::radii[mNLayer] - constants::totalThickness;
297295
} else {
298296
dRadius = 0.7; // TODO: lack of carbon foam radius for layer 2, use 0.7mm as a temporary value
299297
}

0 commit comments

Comments
 (0)