Skip to content
Draft
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 @@ -50,6 +50,7 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache
const int getOTOFNumberOfChips() const { return mNumberOfChipsIOTOF[1]; }
static const char* getOTOFLayerPattern() { return sOTOFLayerName.c_str(); }
static const char* getOTOFStavePattern() { return sOTOFStaveName.c_str(); }
static const char* getOTOFSubStavePattern() { return sOTOFSubStaveName.c_str(); }
static const char* getOTOFModulePattern() { return sOTOFModuleName.c_str(); }
static const char* getOTOFChipPattern() { return sOTOFChipName.c_str(); }
static const char* getOTOFSensorPattern() { return sOTOFSensorName.c_str(); }
Expand Down Expand Up @@ -96,8 +97,8 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache
int getIOTOFFirstChipIndex(int lay) const;
int getIOTOFLayer(int index) const;
bool isValidIOTOFChipIndex(int index) const { return index >= 0 && index <= mLastChipIndex[1]; }
int getIOTOFChipIndex(int lay, int sta, int mod, int chip) const;
bool getIOTOFChipId(int index, int& lay, int& sta, int& mod, int& chip) const;
int getIOTOFChipIndex(int lay, int sta, int substa, int mod, int chip) const;
bool getIOTOFChipId(int index, int& lay, int& sta, int& substa, int& mod, int& chip) const;
o2::math_utils::Point3D<float> detectorToLocal(int row, int col, int chipId) const;
static const ChipSpecifics& getChipSpecifics(int iotofLayer);

Expand Down Expand Up @@ -133,6 +134,7 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache
protected:
// Determine the number of active parts in the geometry
int extractNumberOfStavesIOTOF(int lay) const;
int extractNumberOfSubStavesIOTOF(int lay) const;
int extractNumberOfModulesIOTOF(int lay) const;
int extractNumberOfChipsPerModuleIOTOF(int lay) const;
int extractNumberOfChipsFTOF() const;
Expand All @@ -151,6 +153,7 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache
// Outer TOF
static std::string sOTOFLayerName;
static std::string sOTOFStaveName;
static std::string sOTOFSubStaveName;
static std::string sOTOFModuleName;
static std::string sOTOFChipName;
static std::string sOTOFSensorName;
Expand All @@ -167,9 +170,11 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache

// Inner/outer TOF
int mNumberOfStavesIOTOF[2]{};
int mNumberOfSubStavesIOTOF[2]{};
int mNumberOfModulesIOTOF[2]{};
int mNumberOfChipsPerModuleIOTOF[2]{};
int mNumberOfChipsPerStaveIOTOF[2]{};
int mNumberOfChipsPerSubStaveIOTOF[2]{};
int mNumberOfChipsIOTOF[2]{};
int mLastChipIndex[2]{-1, -1};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,65 +21,27 @@ namespace iotof
{

struct ChipSpecifics {
int NCols = 0;
int NRows = 0;
float PitchCol = 0.;
float PitchRow = 0.;
int NCols = 129;
int NRows = 271;
float PitchCol = 250.00e-4;
float PitchRow = 100.00e-4;
float PassiveEdgeReadOut = 0.;
float PassiveEdgeTop = 0.;
float PassiveEdgeSide = 0.;
float PixelPassiveEdgeX = 0.;
float PixelPassiveEdgeZ = 0.;
float SensorLayerThicknessEff = 0.;
float SensorLayerThickness = 0.;
float SensorLayerThicknessEff = 50.e-4;
float SensorLayerThickness = 50.e-4;

int NPixels() const { return NCols * NRows; }
float ActiveMatrixSizeCols() const { return PitchCol * NCols; }
float ActiveMatrixSizeRows() const { return PitchRow * NRows; }
float SensorSizeCols() const { return ActiveMatrixSizeCols() + 2 * PassiveEdgeSide; }
float SensorSizeCols() const { return ActiveMatrixSizeCols() + PassiveEdgeSide + PassiveEdgeSide; }
float SensorSizeRows() const { return ActiveMatrixSizeRows() + PassiveEdgeTop + PassiveEdgeReadOut; }
};

struct ITOFChipSpecifics : ChipSpecifics {
ITOFChipSpecifics()
{
NCols = 129;
NRows = 271;
PitchCol = 250.00e-4;
PitchRow = 100.00e-4;
PassiveEdgeReadOut = 0.;
PassiveEdgeTop = 0.;
PassiveEdgeSide = 0.;
PixelPassiveEdgeX = 0.;
PixelPassiveEdgeZ = 0.;
SensorLayerThicknessEff = 50.e-4;
SensorLayerThickness = 50.e-4;
}
};

struct OTOFChipSpecifics : ChipSpecifics {
OTOFChipSpecifics()
{
NCols = 125;
NRows = 243;
PitchCol = 250.00e-4;
PitchRow = 100.00e-4;
PassiveEdgeTop = 50.e-4;
PassiveEdgeSide = 115.8e-4;
PassiveEdgeReadOut = 50.e-4;
PixelPassiveEdgeX = 0.;
PixelPassiveEdgeZ = 0.;
SensorLayerThicknessEff = 50.e-4;
SensorLayerThickness = 50.e-4;
}
};

struct ITOFChipSpecificParam : public o2::conf::ConfigurableParamPromoter<ITOFChipSpecificParam, ITOFChipSpecifics> {
O2ParamDef(ITOFChipSpecificParam, "ITOFChipSpecific");
};

struct OTOFChipSpecificParam : public o2::conf::ConfigurableParamPromoter<OTOFChipSpecificParam, OTOFChipSpecifics> {
O2ParamDef(OTOFChipSpecificParam, "OTOFChipSpecific");
struct ChipSpecificsParam : public o2::conf::ConfigurableParamPromoter<ChipSpecificsParam, ChipSpecifics> {
O2ParamDef(ChipSpecificsParam, "ChipSpecificsParam")
};

struct IOTOFBaseParam : public o2::conf::ConfigurableParamHelper<IOTOFBaseParam> {
Expand Down
62 changes: 45 additions & 17 deletions Detectors/Upgrades/ALICE3/IOTOF/base/src/GeometryTGeo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ std::string GeometryTGeo::sITOFSensorName = "ITOFSensor";
// Outer TOF
std::string GeometryTGeo::sOTOFLayerName = "OTOFLayer";
std::string GeometryTGeo::sOTOFStaveName = "OTOFStave";
std::string GeometryTGeo::sOTOFSubStaveName = "OTOFSubStave";
std::string GeometryTGeo::sOTOFModuleName = "OTOFModule";
std::string GeometryTGeo::sOTOFChipName = "OTOFChip";
std::string GeometryTGeo::sOTOFSensorName = "OTOFSensor";
Expand Down Expand Up @@ -81,11 +82,38 @@ int GeometryTGeo::extractNumberOfStavesIOTOF(int lay) const
return numberOfStaves;
}

int GeometryTGeo::extractNumberOfSubStavesIOTOF(int lay) const
{
if (lay == 0) {
return 1;
}

int numberOfSubStaves{0};

std::string staveName = GeometryTGeo::getOTOFStavePattern();
TGeoVolume* staveV = gGeoManager->GetVolume(staveName.c_str());
if (staveV == nullptr) {
LOG(fatal) << "Can't find volume " << staveName;
return -1;
}

TObjArray* nodes = staveV->GetNodes();
int nNodes = nodes->GetEntriesFast();

for (int j{0}; j < nNodes; ++j) {
if (strstr(nodes->At(j)->GetName(), GeometryTGeo::getOTOFSubStavePattern()) != nullptr) {
numberOfSubStaves++;
}
}

return numberOfSubStaves;
}

int GeometryTGeo::extractNumberOfModulesIOTOF(int lay) const
{
int numberOfModules{0};

std::string staveName = lay == 0 ? GeometryTGeo::getITOFStavePattern() : GeometryTGeo::getOTOFStavePattern();
std::string staveName = lay == 0 ? GeometryTGeo::getITOFStavePattern() : GeometryTGeo::getOTOFSubStavePattern();
TGeoVolume* staveV = gGeoManager->GetVolume(staveName.c_str());
if (staveV == nullptr) {
LOG(fatal) << "Can't find volume " << staveName;
Expand Down Expand Up @@ -151,33 +179,27 @@ int GeometryTGeo::getIOTOFLayer(int index) const
return index > mLastChipIndex[0] ? 1 : 0;
}

int GeometryTGeo::getIOTOFChipIndex(int lay, int sta, int mod, int chip) const
int GeometryTGeo::getIOTOFChipIndex(int lay, int sta, int substa, int mod, int chip) const
{
return getIOTOFFirstChipIndex(lay) + (sta - 1) * mNumberOfChipsPerStaveIOTOF[lay] + (mod - 1) * mNumberOfChipsPerModuleIOTOF[lay] + (chip - 1);
return getIOTOFFirstChipIndex(lay) + (sta - 1) * mNumberOfChipsPerStaveIOTOF[lay] + (substa - 1) * mNumberOfChipsPerSubStaveIOTOF[lay] + (mod - 1) * mNumberOfChipsPerModuleIOTOF[lay] + (chip - 1);
}

bool GeometryTGeo::getIOTOFChipId(int index, int& lay, int& sta, int& mod, int& chip) const
bool GeometryTGeo::getIOTOFChipId(int index, int& lay, int& sta, int& substa, int& mod, int& chip) const
{
lay = getIOTOFLayer(index);
index -= getIOTOFFirstChipIndex(lay);
sta = mNumberOfStavesIOTOF[lay] > 0 ? index / mNumberOfChipsPerStaveIOTOF[lay] : -1;
index %= mNumberOfChipsPerStaveIOTOF[lay];
substa = mNumberOfSubStavesIOTOF[lay] > 0 ? index / mNumberOfChipsPerSubStaveIOTOF[lay] : -1;
index %= mNumberOfChipsPerSubStaveIOTOF[lay];
mod = mNumberOfModulesIOTOF[lay] > 0 ? index / mNumberOfChipsPerModuleIOTOF[lay] : -1;
chip = index % mNumberOfChipsPerModuleIOTOF[lay];
return true;
}

const ChipSpecifics& GeometryTGeo::getChipSpecifics(int iotofLayer)
{
if (iotofLayer == 0) {
return ITOFChipSpecificParam::Instance();
}
return OTOFChipSpecificParam::Instance();
}

o2::math_utils::Point3D<float> GeometryTGeo::detectorToLocal(int row, int col, int chipId) const
{
const auto& specs = getChipSpecifics(getIOTOFLayer(chipId));
const auto& specs = ChipSpecificsParam::Instance();
o2::math_utils::Point3D<float> loc;
loc.SetCoordinates(0.5f * ((specs.ActiveMatrixSizeRows() - specs.PassiveEdgeTop + specs.PassiveEdgeReadOut) - specs.PitchRow) - row * specs.PitchRow,
0.f,
Expand All @@ -187,11 +209,12 @@ o2::math_utils::Point3D<float> GeometryTGeo::detectorToLocal(int row, int col, i

TString GeometryTGeo::getMatrixPath(int index) const
{
int lay, sta, mod, chip;
getIOTOFChipId(index, lay, sta, mod, chip);
int lay, sta, substa, mod, chip;
getIOTOFChipId(index, lay, sta, substa, mod, chip);

TString path = Form("/cave_1/barrel_1/%s_2/", GeometryTGeo::getIOTOFVolPattern());
sta += 1;
substa += 1;
mod += 1;
chip += 1;

Expand All @@ -211,6 +234,9 @@ TString GeometryTGeo::getMatrixPath(int index) const
if (mNumberOfStavesIOTOF[lay] > 0) {
path += Form("%s_%d/", GeometryTGeo::getOTOFStavePattern(), sta);
}
if (mNumberOfSubStavesIOTOF[lay] > 0) {
path += Form("%s_%d/", GeometryTGeo::getOTOFSubStavePattern(), substa);
}
if (mNumberOfModulesIOTOF[lay] > 0) {
path += Form("%s_%d/", GeometryTGeo::getOTOFModulePattern(), mod);
}
Expand Down Expand Up @@ -266,6 +292,7 @@ void GeometryTGeo::Build(int loadTrans)
// Inner/outer TOF
for (int j{0}; j < 2; ++j) {
mNumberOfStavesIOTOF[j] = extractNumberOfStavesIOTOF(j);
mNumberOfSubStavesIOTOF[j] = extractNumberOfSubStavesIOTOF(j);
mNumberOfModulesIOTOF[j] = extractNumberOfModulesIOTOF(j);
mNumberOfChipsPerModuleIOTOF[j] = extractNumberOfChipsPerModuleIOTOF(j);
}
Expand All @@ -278,14 +305,15 @@ void GeometryTGeo::Build(int loadTrans)

int numberOfChips{0};
for (int j{0}; j < 2; ++j) {
mNumberOfChipsPerStaveIOTOF[j] = mNumberOfModulesIOTOF[j] * mNumberOfChipsPerModuleIOTOF[j];
mNumberOfChipsPerStaveIOTOF[j] = mNumberOfSubStavesIOTOF[j] * mNumberOfModulesIOTOF[j] * mNumberOfChipsPerModuleIOTOF[j];
mNumberOfChipsPerSubStaveIOTOF[j] = mNumberOfModulesIOTOF[j] * mNumberOfChipsPerModuleIOTOF[j];
mNumberOfChipsIOTOF[j] = mNumberOfStavesIOTOF[j] * mNumberOfChipsPerStaveIOTOF[j];
numberOfChips += mNumberOfChipsIOTOF[j];
mLastChipIndex[j] = numberOfChips - 1;
}

LOG(info) << "TF3 geometry: numberOfChipsITOF = " << mNumberOfChipsIOTOF[0] << ", numberOfChipsOTOF = "
<< mNumberOfChipsIOTOF[1] << ", numberOfChips = " << numberOfChips << ", mNumberOfChipesPerStaveITOF"
<< mNumberOfChipsIOTOF[1] << ", numberOfChips = " << numberOfChips << ", mNumberOfChipsPerStaveITOF"
<< mNumberOfChipsPerStaveIOTOF[0];

setSize(numberOfChips);
Expand Down
4 changes: 4 additions & 0 deletions Detectors/Upgrades/ALICE3/IOTOF/base/src/IOTOFBaseLinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@
#pragma link C++ class o2::iotof::IOTOFBaseParam + ;
#pragma link C++ class o2::conf::ConfigurableParamHelper < o2::iotof::IOTOFBaseParam> + ;

#pragma link C++ class o2::iotof::ChipSpecifics + ;
#pragma link C++ class o2::iotof::ChipSpecificsParam + ;
#pragma link C++ class o2::conf::ConfigurableParamPromoter < o2::iotof::ChipSpecificsParam, o2::iotof::ChipSpecifics> + ;

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@
#include "IOTOFBase/IOTOFBaseParam.h"

O2ParamImpl(o2::iotof::IOTOFBaseParam);
O2ParamImpl(o2::iotof::ITOFChipSpecificParam);
O2ParamImpl(o2::iotof::OTOFChipSpecificParam);
O2ParamImpl(o2::iotof::ChipSpecificsParam);
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,10 @@ class Segmentation
static std::unique_ptr<o2::iotof::Segmentation> sInstance;

public:
ChipSpecifics mITofSpecsConfig;
ChipSpecifics mOTofSpecsConfig;
static Segmentation* Instance();

~Segmentation() = default;

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 PixelPassiveEdgeX, const float PixelPassiveEdgeZ, const float sensorLayerThicknessEff, const float sensorLayerThickness, const int subDetectorID);
void configChip(const ChipSpecifics& specsConfig, const int subDetectorID);

/// 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 @@ -79,7 +73,7 @@ class Segmentation
row = col = -1;
return;
}
const ChipSpecifics& specsConfig = (subDetectorID == 0) ? mITofSpecsConfig : mOTofSpecsConfig;
const auto& specsConfig = ChipSpecificsParam::Instance();
xRow = getFirstRowCoordinate(subDetectorID) - row * specsConfig.PitchRow;
zCol = col * specsConfig.PitchCol + getFirstColCoordinate(subDetectorID);
}
Expand All @@ -90,7 +84,7 @@ class Segmentation
row = col = -1;
return;
}
const ChipSpecifics& specsConfig = (subDetectorID == 0) ? mITofSpecsConfig : mOTofSpecsConfig;
const auto& specsConfig = ChipSpecificsParam::Instance();
loc.SetCoordinates(getFirstRowCoordinate(subDetectorID) - row * specsConfig.PitchRow, T(0.), col * specsConfig.PitchCol + getFirstColCoordinate(subDetectorID));
}
template <typename T = float, typename L = float>
Expand All @@ -100,7 +94,7 @@ class Segmentation
row = col = -1;
return;
}
const ChipSpecifics& specsConfig = (subDetectorID == 0) ? mITofSpecsConfig : mOTofSpecsConfig;
const auto& specsConfig = ChipSpecificsParam::Instance();
loc[0] = getFirstRowCoordinate(subDetectorID) - row * specsConfig.PitchRow;
loc[1] = T(0);
loc[2] = col * specsConfig.PitchCol + getFirstColCoordinate(subDetectorID);
Expand All @@ -115,7 +109,7 @@ class Segmentation
row = col = -1;
return false;
}
const ChipSpecifics& specsConfig = (subDetectorID == 0) ? mITofSpecsConfig : mOTofSpecsConfig;
const auto& specsConfig = ChipSpecificsParam::Instance();
if (row < 0 || row >= specsConfig.NRows || col < 0 || col >= specsConfig.NCols) {
return false;
}
Expand All @@ -130,7 +124,7 @@ class Segmentation
row = col = -1;
return false;
}
const ChipSpecifics& specsConfig = (subDetectorID == 0) ? mITofSpecsConfig : mOTofSpecsConfig;
const auto& specsConfig = ChipSpecificsParam::Instance();
if (row < 0 || row >= specsConfig.NRows || col < 0 || col >= specsConfig.NCols) {
return false;
}
Expand All @@ -144,7 +138,7 @@ class Segmentation
row = col = -1;
return false;
}
const ChipSpecifics& specsConfig = (subDetectorID == 0) ? mITofSpecsConfig : mOTofSpecsConfig;
const auto& specsConfig = ChipSpecificsParam::Instance();
if (row < 0 || row >= specsConfig.NRows || col < 0 || col >= specsConfig.NCols) {
return false;
}
Expand All @@ -154,17 +148,15 @@ class Segmentation

float getFirstRowCoordinate(const int subDetectorID)
{
const ChipSpecifics& specsConfig = (subDetectorID == 0) ? mITofSpecsConfig : mOTofSpecsConfig;
const auto& specsConfig = ChipSpecificsParam::Instance();
return 0.5 * ((specsConfig.ActiveMatrixSizeRows() - specsConfig.PassiveEdgeTop + specsConfig.PassiveEdgeReadOut) - specsConfig.PitchRow);
}
float getFirstColCoordinate(const int subDetectorID)
{
const ChipSpecifics& specsConfig = (subDetectorID == 0) ? mITofSpecsConfig : mOTofSpecsConfig;
const auto& specsConfig = ChipSpecificsParam::Instance();
return 0.5 * (specsConfig.PitchCol - specsConfig.ActiveMatrixSizeCols());
}

void print();

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

Expand All @@ -176,7 +168,7 @@ inline void Segmentation::localToDetectorUnchecked(float xRow, float zCol, int&
iRow = iCol = -1;
return;
}
const ChipSpecifics& specsConfig = (subDetectorID == 0) ? mITofSpecsConfig : mOTofSpecsConfig;
const auto& specsConfig = ChipSpecificsParam::Instance();
xRow = 0.5 * (specsConfig.ActiveMatrixSizeRows() - specsConfig.PassiveEdgeTop + specsConfig.PassiveEdgeReadOut) - xRow; // coordinate wrt top edge of Active matrix
zCol += 0.5 * specsConfig.ActiveMatrixSizeCols(); // coordinate wrt left edge of Active matrix
iRow = int(xRow / specsConfig.PitchRow);
Expand All @@ -202,7 +194,7 @@ inline bool Segmentation::localToDetector(float xRow, float zCol, int& iRow, int
iRow = iCol = -1;
return false;
}
const ChipSpecifics& specsConfig = (subDetectorID == 0) ? mITofSpecsConfig : mOTofSpecsConfig;
const auto& specsConfig = ChipSpecificsParam::Instance();
xRow = 0.5 * (specsConfig.ActiveMatrixSizeRows() - specsConfig.PassiveEdgeTop + specsConfig.PassiveEdgeReadOut) - xRow; // coordinate wrt top edge of Active matrix
zCol += 0.5 * specsConfig.ActiveMatrixSizeCols(); // coordinate wrt left edge of Active matrix
if (xRow < 0 || xRow >= specsConfig.ActiveMatrixSizeRows() || zCol < 0 || zCol >= specsConfig.ActiveMatrixSizeCols()) {
Expand Down
Loading