Skip to content
Open
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 @@ -12,21 +12,40 @@
#ifndef O2_TRK_ALMIRAPARAM_H
#define O2_TRK_ALMIRAPARAM_H

#include <algorithm>

#include "CommonConstants/LHCConstants.h"
#include "CommonUtils/ConfigurableParam.h"
#include "CommonUtils/ConfigurableParamHelper.h"
#include "TRKBase/Specs.h"

namespace o2
{
namespace trk
{
constexpr float DEFAlmiraStrobeDelay = 0.f; ///< default strobe delay in ns wrt ROF start, to be tuned with the real chip response

struct AlmiraParam : public o2::conf::ConfigurableParamHelper<AlmiraParam> {
int roFrameLengthInBC = o2::constants::lhc::LHCMaxBunches / 198; ///< ROF length in BC for continuous mode
float strobeDelay = DEFAlmiraStrobeDelay; ///< strobe start in ns wrt ROF start
float strobeLengthCont = -1.; ///< if < 0, full ROF length minus delay
int roFrameBiasInBC = 0; ///< ROF start bias in BC wrt orbit start
static constexpr size_t kNLayers = constants::VD::petal::nLayers + constants::ML::nLayers + constants::OT::nLayers;
static constexpr size_t getNLayers() { return kNLayers; }

int roFrameLengthInBCPerLayer[kNLayers] = {0}; ///< ROF length in BC per layer
float strobeDelayPerLayer[kNLayers] = {0}; ///< strobe delay in ns per layer
float strobeLengthContPerLayer[kNLayers] = {0}; ///< strobe length in ns per layer
int roFrameBiasInBCPerLayer[kNLayers] = {0}; ///< ROF start bias in BC per layer
int roFrameDelayInBCPerLayer[kNLayers] = {0}; ///< extra ROF delay in BC per layer

int getROFLengthInBC(int layer) const
{
if (roFrameLengthInBCPerLayer[layer] > 0) {
return roFrameLengthInBCPerLayer[layer];
} else {
return o2::constants::lhc::LHCMaxBunches / 198;
}
}
float getStrobeDelay(int layer) const { return strobeDelayPerLayer[layer]; }
float getStrobeLengthCont(int layer) const { return strobeLengthContPerLayer[layer]; }
int getROFBiasInBC(int layer) const { return roFrameBiasInBCPerLayer[layer]; }
int getROFDelayInBC(int layer) const { return roFrameDelayInBCPerLayer[layer]; }

O2ParamDef(AlmiraParam, "TRKAlmiraParam");
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ class GeometryTGeo : public o2::detectors::DetMatrixCache
int getSubDetID(int index) const;
int getPetalCase(int index) const;
int getDisk(int index) const;
int getLayer(int index) const;
int getLayer(int index) const; ///< local layer index within the sub-detector (0-based per VD/MLOT)
int getLayerTRK(int index) const; ///< global layer index across the full TRK (VD layers 0..nVD-1, MLOT layers nVD..nTotal-1)
int getStave(int index) const;
int getHalfStave(int index) const;
int getModule(int index) const;
Expand Down
2 changes: 2 additions & 0 deletions Detectors/Upgrades/ALICE3/TRK/base/include/TRKBase/Specs.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ constexpr int nCols{static_cast<int>(length / chip::pitchZ)};

namespace ML
{
constexpr int nLayers{3}; // number of layers in the ML
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ciao @mpuccio, may I ask you why 3 layers for ML and 5 for OT, and not the opposite?

constexpr double width{constants::moduleMLOT::width * 1}; // width of the stave
// constexpr double length{constants::moduleMLOT::length * 10}; // length of the stave
constexpr double length{124 * cm}; // length of the stave, hardcoded to fit the implemented geometry
Expand All @@ -117,6 +118,7 @@ constexpr double length{258 * cm}; // len
constexpr int nRows{static_cast<int>(width / moduleMLOT::chip::pitchX)}; // number of rows in the halfstave
constexpr int nCols{static_cast<int>(length / moduleMLOT::chip::pitchZ)}; // number of columns in the halfstave
} // namespace halfstave
constexpr int nLayers{5}; // number of layers in the OT
constexpr double width{halfstave::width * 2}; // width of the stave
constexpr double length{halfstave::length}; // length of the stave
constexpr int nRows{static_cast<int>(width / moduleMLOT::chip::pitchX)}; // number of rows in the stave
Expand Down
9 changes: 9 additions & 0 deletions Detectors/Upgrades/ALICE3/TRK/base/src/GeometryTGeo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,15 @@ int GeometryTGeo::getLayer(int index) const
return -1; /// -1 if not found
}
//__________________________________________________________________________
int GeometryTGeo::getLayerTRK(int index) const
{
if (getDisk(index) != -1) {
return -1; /// disks do not have a global layer index
}
int subDetID = getSubDetID(index);
return subDetID * o2::trk::constants::VD::petal::nLayers + getLayer(index); // MLOT: offset by number of VD layers
}
//__________________________________________________________________________
int GeometryTGeo::getStave(int index) const
{
int subDetID = getSubDetID(index);
Expand Down
2 changes: 1 addition & 1 deletion Detectors/Upgrades/ALICE3/TRK/macros/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ o2_add_test_root_macro(CheckBandwidth.C
O2::Steer
LABELS trk COMPILE_ONLY)

o2_add_test_root_macro(CheckDigits.C
o2_add_test_root_macro(CheckDigitsTRK.C
PUBLIC_LINK_LIBRARIES O2::ITSMFTBase
O2::ITSMFTSimulation
O2::TRKBase
Expand Down
Loading