Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2b17981
one sensor per chip
maciacco Apr 30, 2026
3b72641
one sensor per chip also in second layer
maciacco Apr 30, 2026
e0f57a7
iotof segmentation and parameters. Segmentation parameters are stolen…
GiorgioAlbertoLucia Apr 30, 2026
c072ae2
compute number of chips in IOTOF
maciacco Apr 30, 2026
876f171
fill L2G transformation matrices
maciacco Apr 30, 2026
6ce0aa3
Merge pull request #4 from GiorgioAlbertoLucia/tf3_digit
maciacco Apr 30, 2026
684490f
fix cmakelist
maciacco Apr 30, 2026
abe83cb
only fill segmentation details if layout is segmented + add function …
maciacco May 1, 2026
ce30af9
use proper chip id for segmented barrel
maciacco May 1, 2026
0038f09
refactoring of segmentation, idependent for inner and outer tof, nons…
GiorgioAlbertoLucia May 4, 2026
728a505
singleton implementation of the segmentation class
GiorgioAlbertoLucia May 6, 2026
5924d18
realistic values fot the chip segmentation
GiorgioAlbertoLucia May 6, 2026
bdbd1b8
hit processing in place, tested on A3Studies/Digitization/testDigitiz…
GiorgioAlbertoLucia May 6, 2026
175f4db
clang format
GiorgioAlbertoLucia May 6, 2026
ea0d674
protect against disks for now
GiorgioAlbertoLucia May 6, 2026
e437ecf
added sanity checks
GiorgioAlbertoLucia May 6, 2026
d4b2789
thickness that matches the values currently in O2
GiorgioAlbertoLucia May 6, 2026
6a4c6c2
default init of chipspecifics to zero
GiorgioAlbertoLucia May 6, 2026
31daa6d
double typo (half the honor)
GiorgioAlbertoLucia May 6, 2026
213c808
Please consider the following formatting changes
alibuild May 6, 2026
f30965d
Merge pull request #1 from alibuild/alibot-cleanup-15372
GiorgioAlbertoLucia May 6, 2026
42c13bf
Fix row and column assignment in detector functions
GiorgioAlbertoLucia May 7, 2026
2a32b97
Change return type in segmentation function
GiorgioAlbertoLucia May 7, 2026
6326fbe
Remove return statement from detectorToLocalUnchecked
GiorgioAlbertoLucia May 7, 2026
adbaeb1
Remove Mat3D alias from GeometryTGeo class
njacazio May 7, 2026
0dc1796
Replace matrix transformation with Transform3D
njacazio May 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
iotof segmentation and parameters. Segmentation parameters are stolen…
… from ALPIDE and probably nonsensical
  • Loading branch information
GiorgioAlbertoLucia committed Apr 30, 2026
commit e0f57a709d8116f07029221b2ccf828769cb4460
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,20 @@ struct IOTOFBaseParam : public o2::conf::ConfigurableParamHelper<IOTOFBaseParam>
float x2x0 = 0.02f; // thickness expressed in radiation length, for all layers for the moment
float sensorThickness = 0.0050f; // thickness of the sensor in cm, for all layers for the moment, the default is set to 50 microns

struct chipSpecifics {
int NCols = 1024;
int NRows = 512;
float PitchCol = 29.24e-4;
float PitchRow = 26.88e-4;
float PassiveEdgeReadOut = 0.12f; // width of the readout edge (Passive bottom)
float PassiveEdgeTop = 37.44e-4; // Passive area on top
float PassiveEdgeSide = 29.12e-4; // width of Passive area on left/right of the sensor

// effective thickness of sensitive layer, accounting for charge collection non-unifoemity, https://alice.its.cern.ch/jira/browse/AOC-46
float SensorLayerThicknessEff = 28.e-4;
float SensorLayerThickness = 30.e-4; // physical thickness of sensitive part
} chipSpecifics;

O2ParamDef(IOTOFBaseParam, "IOTOFBase");
};

Expand Down
9 changes: 7 additions & 2 deletions Detectors/Upgrades/ALICE3/IOTOF/simulation/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,18 @@ o2_add_library(IOTOFSimulation
SOURCES src/Layer.cxx
src/Detector.cxx
src/Digitizer.cxx
src/DPLDigitizerParam.cxx
# src/IOTOFServices.cxx
src/Segmentation.cxx
PUBLIC_LINK_LIBRARIES O2::IOTOFBase
O2::DataFormatsIOTOF
O2::ITSMFTSimulation)

o2_target_root_dictionary(IOTOFSimulation
HEADERS include/IOTOFSimulation/Detector.h
include/IOTOFSimulation/Layer.h
include/IOTOFSimulation/Digitizer.h)
# include/IOTOFSimulation/IOTOFServices.h)
include/IOTOFSimulation/Digitizer.h
include/IOTOFSimulation/DPLDigitizerParam.h
# include/IOTOFSimulation/IOTOFServices.h
include/IOTOFSimulation/Segmentation.h
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,178 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

/// \file Segmentation.h
/// \brief Definition of the Segmentation class
/// \author Giorgio Alberto Lucia: giorgio.alberto.lucia@cern.ch

#ifndef ALICEO2_IOTOF_SEGMENTATION_H
#define ALICEO2_IOTOF_SEGMENTATION_H

#include <Rtypes.h>
#include "MathUtils/Cartesian.h"

namespace o2
{
namespace iotof
{

/// Segmentation and response for pixels in inner and outer TOF of the ALICE 3 apparatus
/// Questions to solve:
class Segmentation
{
public:

static int NCols;
static int NRows;
static int NPixels;
static float PitchCol;
static float PitchRow;
static float PassiveEdgeReadOut;
static float PassiveEdgeTop;
static float PassiveEdgeSide;
static float ActiveMatrixSizeCols;
static float ActiveMatrixSizeRows;

// effective thickness of sensitive layer, accounting for charge collection non-unifoemity, https://alice.its.cern.ch/jira/browse/AOC-46
static float SensorLayerThicknessEff;
static float SensorLayerThickness;
static float SensorSizeCols;
static float SensorSizeRows;

Segmentation();
~Segmentation() = default;

static void configChip(const int nCols, const int nRows, const float pitchCol, const float pitchRow, const float passiveEdgeReadOut, const float passiveEdgeTop,
const float passiveEdgeSide, const float sensorLayerThicknessEff, const float sensorLayerThickness);

/// Transformation from Geant detector centered local coordinates (cm) to
/// Pixel cell numbers iRow and iCol.
/// Returns kTRUE if point x,z is inside sensitive volume, kFALSE otherwise.
/// A value of -1 for iRow or iCol indicates that this point is outside of the
/// detector segmentation as defined.
/// \param float x Detector local coordinate x in cm with respect to
/// the center of the sensitive volume.
/// \param float z Detector local coordinate z in cm with respect to
/// the center of the sensitive volulme.
/// \param int iRow Detector x cell coordinate. Has the range 0 <= iRow < mNumberOfRows
/// \param int iCol Detector z cell coordinate. Has the range 0 <= iCol < mNumberOfColumns
static bool localToDetector(float x, float z, int& iRow, int& iCol);
/// same but w/o check for row/column range
static void localToDetectorUnchecked(float xRow, float zCol, int& iRow, int& iCol);

/// Transformation from Detector cell coordiantes to Geant detector centered
/// local coordinates (cm)
/// \param int iRow Detector x cell coordinate. Has the range 0 <= iRow < mNumberOfRows
/// \param int iCol Detector z cell coordinate. Has the range 0 <= iCol < mNumberOfColumns
/// \param float x Detector local coordinate x in cm with respect to the
/// center of the sensitive volume.
/// \param float z Detector local coordinate z in cm with respect to the
/// center of the sensitive volulme.
/// If iRow and or iCol is outside of the segmentation range a value of -0.5*Dx()
/// or -0.5*Dz() is returned.

// w/o check for row/col range
template <typename T = float, typename L = float>
static void detectorToLocalUnchecked(L row, L col, T& xRow, T& zCol)
{
xRow = getFirstRowCoordinate() - row * PitchRow;
zCol = col * PitchCol + getFirstColCoordinate();
}
template <typename T = float, typename L = float>
static void detectorToLocalUnchecked(L row, L col, math_utils::Point3D<T>& loc)
{
loc.SetCoordinates(getFirstRowCoordinate() - row * PitchRow, T(0.), col * PitchCol + getFirstColCoordinate());
}
template <typename T = float, typename L = float>
static void detectorToLocalUnchecked(L row, L col, std::array<T, 3>& loc)
{
loc[0] = getFirstRowCoordinate() - row * PitchRow;
loc[1] = T(0);
loc[2] = col * PitchCol + getFirstColCoordinate();
}

// same but with check for row/col range

template <typename T = float, typename L = float>
static bool detectorToLocal(L row, L col, T& xRow, T& zCol)
{
if (row < 0 || row >= NRows || col < 0 || col >= NCols) {
return false;
}
detectorToLocalUnchecked(row, col, xRow, zCol);
return true;
}

template <typename T = float, typename L = float>
static bool detectorToLocal(L row, L col, math_utils::Point3D<T>& loc)
{
if (row < 0 || row >= NRows || col < 0 || col >= NCols) {
return false;
}
detectorToLocalUnchecked(row, col, loc);
return true;
}
template <typename T = float, typename L = float>
static bool detectorToLocal(L row, L col, std::array<T, 3>& loc)
{
if (row < 0 || row >= NRows || col < 0 || col >= NCols) {
return false;
}
detectorToLocalUnchecked(row, col, loc);
return true;
}

static float getFirstRowCoordinate()
{
return 0.5 * ((ActiveMatrixSizeRows - PassiveEdgeTop + PassiveEdgeReadOut) - PitchRow);
}
static float getFirstColCoordinate() { return 0.5 * (PitchCol - ActiveMatrixSizeCols); }

static void print();

ClassDefNV(Segmentation, 1); // Segmentation class upgrade pixels
};

//_________________________________________________________________________________________________
inline void Segmentation::localToDetectorUnchecked(float xRow, float zCol, int& iRow, int& iCol)
{
// convert to row/col w/o over/underflow check
xRow = 0.5 * (ActiveMatrixSizeRows - PassiveEdgeTop + PassiveEdgeReadOut) - xRow; // coordinate wrt top edge of Active matrix
zCol += 0.5 * ActiveMatrixSizeCols; // coordinate wrt left edge of Active matrix
iRow = int(xRow / PitchRow);
iCol = int(zCol / PitchCol);
if (xRow < 0) {
iRow -= 1;
}
if (zCol < 0) {
iCol -= 1;
}
}

//_________________________________________________________________________________________________
inline bool Segmentation::localToDetector(float xRow, float zCol, int& iRow, int& iCol)
{
// convert to row/col
xRow = 0.5 * (ActiveMatrixSizeRows - PassiveEdgeTop + PassiveEdgeReadOut) - xRow; // coordinate wrt top edge of Active matrix
zCol += 0.5 * ActiveMatrixSizeCols; // coordinate wrt left edge of Active matrix
if (xRow < 0 || xRow >= ActiveMatrixSizeRows || zCol < 0 || zCol >= ActiveMatrixSizeCols) {
iRow = iCol = -1;
return false;
}
iRow = int(xRow / PitchRow);
iCol = int(zCol / PitchCol);
return true;
}

} // namespace iotof
} // namespace o2

#endif
79 changes: 79 additions & 0 deletions Detectors/Upgrades/ALICE3/IOTOF/simulation/src/Segmentation.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

/// \file Segmentation.cxx
/// \brief Implementation of the Segmentation class

#include "IOTOFSimulation/Segmentation.h"
#include "IOTOFBase/IOTOFBaseParam.h"
#include <cstdio>

namespace o2
{

namespace iotof
{

int Segmentation::NCols = 0;
int Segmentation::NRows = 0;
int Segmentation::NPixels = 0;
float Segmentation::PitchCol = 0.f;
float Segmentation::PitchRow = 0.f;
float Segmentation::PassiveEdgeReadOut = 0.f;
float Segmentation::PassiveEdgeTop = 0.f;
float Segmentation::PassiveEdgeSide = 0.f;
float Segmentation::ActiveMatrixSizeCols = 0.f;
float Segmentation::ActiveMatrixSizeRows = 0.f;
float Segmentation::SensorLayerThicknessEff = 0.f;
float Segmentation::SensorLayerThickness = 0.f;
float Segmentation::SensorSizeCols = 0.f;
float Segmentation::SensorSizeRows = 0.f;

Segmentation::Segmentation()
{
auto& iotofPars = IOTOFBaseParam::Instance();
auto& chipPars = iotofPars.chipSpecifics;
configChip(chipPars.NCols, chipPars.NRows, chipPars.PitchCol, chipPars.PitchRow, chipPars.PassiveEdgeReadOut, chipPars.PassiveEdgeTop,
chipPars.PassiveEdgeSide, chipPars.SensorLayerThicknessEff, chipPars.SensorLayerThickness);
}

void Segmentation::configChip(const int nCols, const int nRows, const float pitchCol, const float pitchRow, const float passiveEdgeReadOut,
const float passiveEdgeTop, const float passiveEdgeSide, const float sensorLayerThicknessEff, const float sensorLayerThickness)
{
NCols = nCols;
NRows = nRows;
NPixels = NCols * NRows;
PitchCol = pitchCol;
PitchRow = pitchRow;
PassiveEdgeReadOut = passiveEdgeReadOut;
PassiveEdgeTop = passiveEdgeTop;
PassiveEdgeSide = passiveEdgeSide;
ActiveMatrixSizeCols = PitchCol * NCols;
ActiveMatrixSizeRows = PitchRow * NRows;
SensorLayerThicknessEff = sensorLayerThicknessEff;
SensorLayerThickness = sensorLayerThickness;
SensorSizeCols = ActiveMatrixSizeCols + PassiveEdgeSide + PassiveEdgeSide;
SensorSizeRows = ActiveMatrixSizeRows + PassiveEdgeTop + PassiveEdgeReadOut;
}

void Segmentation::print()
{
printf("Pixel size: %.2f (along %d rows) %.2f (along %d columns) microns\n", PitchRow * 1e4, NRows, PitchCol * 1e4, NCols);
printf("Passive edges: bottom: %.2f, top: %.2f, left/right: %.2f microns\n",
PassiveEdgeReadOut * 1e4, PassiveEdgeTop * 1e4, PassiveEdgeSide * 1e4);
printf("Active/Total size: %.6f/%.6f (rows) %.6f/%.6f (cols) cm\n", ActiveMatrixSizeRows, SensorSizeRows,
ActiveMatrixSizeCols, SensorSizeCols);
}

} // namespace iotof
} // namespace o2

ClassImp(o2::iotof::Segmentation);