Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,20 @@ class SegmentationChip

static constexpr std::array<double, constants::VD::petal::nLayers> radiiVD = constants::VD::petal::layer::radii;

static inline int sNPetalsVD = -1; // not set
static void setNumberOfPetalsVD(int n) { sNPetalsVD = n; }
static float getWidthVD(int layer) // get the width of the petal according to the simulated geometry (supported: kIRIS4 (4 petals), kIRIS4a (3 petals), kIRISFullCyl)
{
if (sNPetalsVD < 1) {
LOGP(fatal, "SegmentationChip: VD number of petals not set. GeometryTGeo::Build() must be called before using the VD segmentation");
}
if (sNPetalsVD == 1) { // FullCyl: 360°, no gap
return 2 * M_PI * constants::VD::petal::layer::radii[layer];
}
return constants::VD::petal::layer::radii[layer] * 2 * M_PI / sNPetalsVD - constants::VD::petal::layer::gaps[layer];
}
static int getNRowsVD(int layer) { return static_cast<int>(getWidthVD(layer) / PitchRowVD); }

/// 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.
Expand Down Expand Up @@ -113,7 +127,7 @@ class SegmentationChip
if (subDetID == 0) {
pitchRow = PitchRowVD;
pitchCol = PitchColVD;
maxWidth = constants::VD::petal::layer::width[layer];
maxWidth = getWidthVD(layer);
maxLength = constants::VD::petal::layer::length;
// TODO: change this to use the layer and disk
} else if (subDetID == 1 || subDetID == 2) {
Expand All @@ -128,11 +142,11 @@ class SegmentationChip
};

// Check local coordinates (cm) validity.
static constexpr bool isValidLoc(float x, float z, int subDetID, int layer) noexcept
static bool isValidLoc(float x, float z, int subDetID, int layer) noexcept
{
float maxWidth(0), maxLength(0);
if (subDetID == 0) {
maxWidth = constants::VD::petal::layer::width[layer];
maxWidth = getWidthVD(layer);
maxLength = constants::VD::petal::layer::length;
// TODO: change this to use the layer and disk
} else if (subDetID == 1 || subDetID == 2) { // ML/OT
Expand All @@ -143,12 +157,12 @@ class SegmentationChip
}

// Check detector coordinates validity.
static constexpr bool isValidDet(int row, int col, int subDetID, int layer) noexcept
static bool isValidDet(int row, int col, int subDetID, int layer) noexcept
{
// Check if the row and column are within the valid range
int nRows(0), nCols(0);
if (subDetID == 0) {
nRows = constants::VD::petal::layer::nRows[layer];
nRows = getNRowsVD(layer);
nCols = constants::VD::petal::layer::nCols;
// TODO: change this to use the layer and disk
} else if (subDetID == 1 || subDetID == 2) {
Expand All @@ -171,7 +185,7 @@ class SegmentationChip
/// \param int subDetID Sub-detector ID (0 for VD, 1 for ML/OT)
/// \param int layer Layer number (0 to 2 for VD, 0 to 7 for ML/OT)
/// \param int disk Disk number (0 to 5 for VD)
static constexpr bool detectorToLocal(int iRow, int iCol, float& xRow, float& zCol, int subDetID, int layer, int disk) noexcept
static bool detectorToLocal(int iRow, int iCol, float& xRow, float& zCol, int subDetID, int layer, int disk) noexcept
{
if (!isValidDet(iRow, iCol, subDetID, layer)) {
LOGP(debug, "Detector coordinates not valid: iRow = {}, iCol = {}", iRow, iCol);
Expand All @@ -194,7 +208,7 @@ class SegmentationChip
/// xRow = half chip width - iRow(center) * pitch
/// zCol = iCol * pitch - half chip lenght
if (subDetID == 0) {
xRow = 0.5 * (constants::VD::petal::layer::width[layer] - PitchRowVD) - (row * PitchRowVD);
xRow = 0.5 * (getWidthVD(layer) - PitchRowVD) - (row * PitchRowVD);
zCol = col * PitchColVD + 0.5 * (PitchColVD - constants::VD::petal::layer::length);
} else if (subDetID == 1 || subDetID == 2) { // ML/OT
xRow = 0.5 * (constants::moduleMLOT::chip::width - constants::moduleMLOT::chip::passiveEdgeReadOut - PitchRowMLOT) - (row * PitchRowMLOT);
Expand Down Expand Up @@ -251,9 +265,9 @@ class SegmentationChip
/// Print segmentation info
static void Print() noexcept
{
LOG(info) << "Number of rows:\nVD L0: " << constants::VD::petal::layer::nRows[0]
<< "\nVD L1: " << constants::VD::petal::layer::nRows[1]
<< "\nVD L2: " << constants::VD::petal::layer::nRows[2]
LOG(info) << "Number of rows:\nVD L0: " << getNRowsVD(0)
<< "\nVD L1: " << getNRowsVD(1)
<< "\nVD L2: " << getNRowsVD(2)
<< "\nML/OT chip: " << constants::moduleMLOT::chip::nRows;

LOG(info) << "Number of cols:\nVD: " << constants::VD::petal::layer::nCols
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,13 @@ constexpr int nLayers{3}; // number of layers in each VD petal
constexpr int nDisks{6}; // number of disks in each VD petal
namespace layer
{
constexpr double pitchX{10 * mu}; // pitch of the row
constexpr double pitchZ{10 * mu}; // pitch of the column
constexpr double totalThickness{silicon::thickness + metalstack::thickness}; // total thickness of the chip
constexpr std::array<double, nLayers> gaps{1.63 * mm, 1.2 * mm, 1.2 * mm}; // gaps between two consecutive petals
constexpr std::array<double, nLayers> radii{0.5 * cm, 1.2 * cm, 2.5 * cm}; // radius of layer in cm
constexpr std::array<double, nLayers> width{radii[0] * 2 * M_PI / 4 - gaps[0], radii[1] * 2 * M_PI / 4 - gaps[1], radii[2] * 2 * M_PI / 4 - gaps[2]}; // width of the quarter of layer in cm
constexpr double length{50 * cm}; // length of the layer
constexpr int nCols{static_cast<int>(length / pitchZ)}; // number of columns in the chip
constexpr std::array<int, nLayers> nRows{static_cast<int>(width[0] / pitchX), static_cast<int>(width[1] / pitchX), static_cast<int>(width[2] / pitchX)}; // number of rows in the chip. For the moment is different for each layer since a siner segmentation in repetitive units is stil to be implemented
constexpr double pitchX{10 * mu}; // pitch of the row
constexpr double pitchZ{10 * mu}; // pitch of the column
constexpr double totalThickness{silicon::thickness + metalstack::thickness}; // total thickness of the chip
constexpr std::array<double, nLayers> gaps{1.63 * mm, 1.2 * mm, 1.2 * mm}; // gaps between two consecutive petals
constexpr std::array<double, nLayers> radii{0.5 * cm, 1.2 * cm, 2.5 * cm}; // radius of layer in cm
constexpr double length{50 * cm}; // length of the layer
constexpr int nCols{static_cast<int>(length / pitchZ)}; // number of columns in the chip

} // namespace layer
namespace disk
Expand Down Expand Up @@ -223,6 +221,14 @@ constexpr double responseYShift{5 * mu}; /// center of the epitaxial layer
constexpr double thickness{20 * mu};
} // namespace alice3resp

namespace alpideresp /// parameters for the alpide chip response
{
constexpr double pitchX{26.88 * mu};
constexpr double pitchZ{29.24 * mu};
constexpr double responseYShift{5 * mu}; /// center of the epitaxial layer
constexpr double thickness{45 * mu};
} // namespace alpideresp

namespace MLOTDisks
{
constexpr int nLayers{12}; // number of disks in the ML and OT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ void GeometryTGeo::Build(int loadTrans)

mNumberOfLayersMLOT = extractNumberOfLayersMLOT();
mNumberOfPetalsVD = extractNumberOfPetalsVD();
SegmentationChip::setNumberOfPetalsVD(mNumberOfPetalsVD);
LOGP(info, "VD segmentation set for {} petals", mNumberOfPetalsVD);

mNumberOfActivePartsVD = extractNumberOfActivePartsVD();
mNumberOfLayersVD = extractNumberOfLayersVD();
mNumberOfDisksVD = extractNumberOfDisksVD();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "SimulationDataFormat/MCCompLabel.h"
#include "SimulationDataFormat/MCTruthContainer.h"
#include "TRKBase/GeometryTGeo.h"
#include "TRKBase/SegmentationChip.h"
#include "TRKBase/Specs.h"
#include "TRKReconstruction/BuildTopologyDictionary.h"
#include <TFile.h>
Expand Down Expand Up @@ -190,7 +191,7 @@ void forEachCluster(const std::string& directory, F&& f)
const auto* pattern = candidate.pattern;
// Left out: at the matrix's edge, or one of several pieces of a crossing.
const bool vd = cluster.subDetID == 0;
const int nRows = vd ? o2::trk::constants::VD::petal::layer::nRows[cluster.layer] : o2::trk::constants::moduleMLOT::chip::nRows;
const int nRows = vd ? o2::trk::SegmentationChip::getNRowsVD(cluster.layer) : o2::trk::constants::moduleMLOT::chip::nRows;
const int nCols = vd ? o2::trk::constants::VD::petal::layer::nCols : o2::trk::constants::moduleMLOT::chip::nCols;
if (cluster.row == 0 || cluster.col == 0 || cluster.row + pattern[0] >= nRows || cluster.col + pattern[1] >= nCols ||
nClusters[candidate.key] > static_cast<int>(candidate.segments.size())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void Clusterer<DetID>::ClustererThread::initChip(gsl::span<const Digit> digits,
if (geom) {
if (geom->getSubDetID(chipID) == 0) { // VD
const int layer = geom->getLayer(chipID);
size = constants::VD::petal::layer::nRows[layer] + 2;
size = SegmentationChip::getNRowsVD(layer) + 2;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ void o2::trkft3::ChipDigitsContainer::addNoise(UInt_t rofMin, UInt_t rofMax, con
int maxCols = 0;

if (subDetID == 0) {
maxRows = o2::trk::constants::VD::petal::layer::nRows[layer];
maxRows = o2::trk::SegmentationChip::getNRowsVD(layer);
maxCols = o2::trk::constants::VD::petal::layer::nCols;
} else {
maxRows = o2::trk::constants::moduleMLOT::chip::nRows;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class Digitizer
int getNRows(int subDetID, int layer)
{
if (subDetID == 0) { // VD
return o2::trk::constants::VD::petal::layer::nRows[layer];
return o2::trk::SegmentationChip::getNRowsVD(layer);
} else if (subDetID == 1 || subDetID == 2) { // ML/OT
return o2::trk::constants::moduleMLOT::chip::nRows;
}
Expand Down
Loading