Skip to content

Commit e9bb24f

Browse files
committed
ITS3: scale pixel-resp + fix OB resp func
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent 079db51 commit e9bb24f

File tree

3 files changed

+41
-6
lines changed

3 files changed

+41
-6
lines changed

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

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,27 @@ constexpr int nRows{442};
3535
constexpr int nPixels{nRows * nCols};
3636
constexpr EColor color{kGreen};
3737
constexpr double area{width * length};
38+
namespace pixels
39+
{
40+
namespace apts
41+
{
42+
constexpr double pitchX{15.0 * mu};
43+
constexpr double pitchZ{15.0 * mu};
44+
} // namespace apts
45+
namespace moss
46+
{
47+
namespace top
48+
{
49+
constexpr double pitchX{22.5 * mu};
50+
constexpr double pitchZ{22.5 * mu};
51+
} // namespace top
52+
namespace bot
53+
{
54+
constexpr double pitchX{18.0 * mu};
55+
constexpr double pitchZ{18.0 * mu};
56+
} // namespace bot
57+
} // namespace moss
58+
} // namespace pixels
3859
} // namespace pixelarray
3960
namespace tile
4061
{

Detectors/Upgrades/ITS3/simulation/include/ITS3Simulation/Digitizer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ class Digitizer : public TObject
111111
o2::itsmft::AlpideSimResponse* mSimRespIB = nullptr; // simulated response for IB
112112
o2::itsmft::AlpideSimResponse* mSimRespOB = nullptr; // simulated response for OB
113113
float mSimRespIBShift{0.}; // adjusting the Y-shift in the IB response function to match sensor local coord.
114+
float mSimRespIBScaleX{1.}; // scale x-local coordinate to response function x-coordinate
115+
float mSimRespIBScaleZ{1.}; // scale z-local coordinate to response function z-coordinate
114116
float mSimRespOBShift{0.}; // adjusting the Y-shift in the OB response function to match sensor local coord.
115117

116118
const o2::its::GeometryTGeo* mGeometry = nullptr; ///< ITS3 geometry

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

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ void Digitizer::init()
4848
auto loadSetResponseFunc = [&](const char* name, const char* fileIB, const char* nameIB, const char* fileOB, const char* nameOB) {
4949
LOGP(info, "Loading response function for {}: IB={}:{} ; OB={}:{}", name, nameIB, fileIB, nameOB, fileOB);
5050
auto fIB = TFile::Open(fileIB, "READ");
51-
if (fIB->IsZombie() || !fIB->IsOpen()) {
51+
if (!fIB || fIB->IsZombie() || !fIB->IsOpen()) {
5252
LOGP(fatal, "Cannot open file {}", fileIB);
5353
}
54-
auto fOB = TFile::Open(fileIB, "READ");
55-
if (fOB->IsZombie() || !fOB->IsOpen()) {
54+
auto fOB = TFile::Open(fileOB, "READ");
55+
if (!fOB || fOB->IsZombie() || !fOB->IsOpen()) {
5656
LOGP(fatal, "Cannot open file {}", fileOB);
5757
}
5858
mParams.setIBSimResponse(mSimRespIB = fIB->Get<o2::itsmft::AlpideSimResponse>(nameIB));
@@ -72,11 +72,15 @@ void Digitizer::init()
7272
loadSetResponseFunc("APTS", responseFileIB, "response1", responseFileOB, "response1");
7373
mSimRespIBShift = mSimRespIB->getDepthMax() - 10.e-4f;
7474
mSimRespOBShift = mSimRespOB->getDepthMax() - Segmentation::SensorLayerThickness / 2.f;
75+
mSimRespIBScaleX = 0.5 * constants::pixelarray::pixels::apts::pitchX / SegmentationMosaix::mPitchRow;
76+
mSimRespIBScaleZ = 0.5 * constants::pixelarray::pixels::apts::pitchZ / SegmentationMosaix::mPitchCol;
7577
} else {
7678
LOGP(fatal, "ResponseFunction '{}' not implemented!", func);
7779
}
7880
}
7981
mParams.print();
82+
LOGP(info, "IBShift = {} ; OBShift = {}", mSimRespIBShift, mSimRespOBShift);
83+
LOGP(info, "IB-Scale: X={} ; Z={}", mSimRespIBScaleX, mSimRespIBScaleZ);
8084
mIRFirstSampledTF = o2::raw::HBFUtils::Instance().getFirstSampledTFIR();
8185
}
8286

@@ -375,9 +379,17 @@ void Digitizer::processHit(const o2::itsmft::Hit& hit, uint32_t& maxFr, int evID
375379
}
376380
bool flipCol = false, flipRow = false;
377381
// note that response needs coordinates along column row (locX) (locZ) then depth (locY)
378-
float rowMax{0.5f * (innerBarrel ? SegmentationMosaix::mPitchRow : Segmentation::PitchRow)};
379-
float colMax{0.5f * (innerBarrel ? SegmentationMosaix::mPitchCol : Segmentation::PitchCol)};
380-
auto rspmat = ((innerBarrel) ? mSimRespIB : mSimRespOB)->getResponse(xyzLocS.X() - cRowPix, xyzLocS.Z() - cColPix, xyzLocS.Y(), flipRow, flipCol, rowMax, colMax);
382+
float rowMax{}, colMax{};
383+
const AlpideRespSimMat* rspmat{nullptr};
384+
if (innerBarrel) {
385+
rowMax = 0.5 * SegmentationMosaix::mPitchRow;
386+
colMax = 0.5 * SegmentationMosaix::mPitchCol;
387+
rspmat = mSimRespIB->getResponse(mSimRespIBScaleX * (xyzLocS.X() - cRowPix), mSimRespIBScaleZ * (xyzLocS.Z() - cColPix), xyzLocS.Y(), flipRow, flipCol, rowMax, colMax);
388+
} else {
389+
rowMax = 0.5 * Segmentation::PitchRow;
390+
colMax = 0.5 * Segmentation::PitchCol;
391+
rspmat = mSimRespOB->getResponse(xyzLocS.X() - cRowPix, xyzLocS.Z() - cColPix, xyzLocS.Y(), flipRow, flipCol, rowMax, colMax);
392+
}
381393

382394
xyzLocS += step;
383395
if (rspmat == nullptr) {

0 commit comments

Comments
 (0)