Skip to content
Snippets Groups Projects
Commit bae10eeb authored by Sebastien Ponce's avatar Sebastien Ponce
Browse files

Merge branch 'gunther-cleanup-hitzone' into 'master'

Unify SciFiHits hitzone order by taking it from PrSciFiHits header

See merge request !3705
parents b6e49713 d53187f3
No related branches found
No related tags found
2 merge requests!3788Draft: Update SciFi cluster monitoring,!3705Unify SciFiHits hitzone order by taking it from PrSciFiHits header
Pipeline #6721634 passed
......@@ -20,6 +20,7 @@
#include <array>
#include <limits>
namespace LHCb::Pr::FT {
/**
......@@ -74,14 +75,6 @@ namespace LHCb::Pr::FT {
used[idx] = true;
}
}
constexpr auto xu = LHCb::Detector::FT::xZonesUpper;
constexpr auto uvu = LHCb::Detector::FT::uvZonesUpper;
constexpr auto xd = LHCb::Detector::FT::xZonesLower;
constexpr auto uvd = LHCb::Detector::FT::uvZonesLower;
constexpr auto hitzones = std::array<int, LHCb::Detector::FT::nZonesTotal>{
xd[0], uvd[0], uvd[1], xd[1], xd[2], uvd[2], uvd[3], xd[3], xd[4], uvd[4], uvd[5], xd[5],
xu[0], uvu[0], uvu[1], xu[1], xu[2], uvu[2], uvu[3], xu[3], xu[4], uvu[4], uvu[5], xu[5]};
for ( auto zone : hitzones ) {
const auto [zoneBegin, zoneEnd] = fthits.getZoneIndices( zone );
......
......@@ -83,6 +83,11 @@ namespace LHCb::Pr::FT {
SC{this, "Average X in T1X2"}, SC{this, "Average X in T2X1"}, SC{this, "Average X in T2U"},
SC{this, "Average X in T2V"}, SC{this, "Average X in T2X2"}, SC{this, "Average X in T3X1"},
SC{this, "Average X in T3U"}, SC{this, "Average X in T3V"}, SC{this, "Average X in T3X2"}};
mutable Gaudi::Accumulators::MsgCounter<MSG::WARNING> m_noCalib{
this, "Requested to correct FT mats for temperature distortions but conditions not available. "
"These corrections cannot be applied. Check your conditions tags if you intend to apply "
"these corrections or set property ApplyMatContractionCalibration to false if you do not. "
"Continuing without applying corrections."};
};
DECLARE_COMPONENT_WITH_ID( StoreHits, "PrStoreSciFiHits" )
......@@ -92,18 +97,6 @@ namespace LHCb::Pr::FT {
Hits hits{LHCb::getMemResource( evtCtx )};
constexpr auto xu = LHCb::Detector::FT::xZonesUpper;
constexpr auto uvu = LHCb::Detector::FT::uvZonesUpper;
constexpr auto xd = LHCb::Detector::FT::xZonesLower;
constexpr auto uvd = LHCb::Detector::FT::uvZonesLower;
// hits are stored in the same order as the layers are in z, i.e. x-u-v-x
// hit zone order here: 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 1, 3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 23
constexpr auto hitzones = std::array<int, LHCb::Detector::FT::nZonesTotal>{
xd[0], uvd[0], uvd[1], xd[1], xd[2], uvd[2], uvd[3], xd[3], xd[4], uvd[4], uvd[5], xd[5],
xu[0], uvu[0], uvu[1], xu[1], xu[2], uvu[2], uvu[3], xu[3], xu[4], uvu[4], uvu[5], xu[5]};
auto bufTotalHits = m_cntTotalHits.buffer();
std::array<SCbuf, LHCb::Detector::FT::nLayersTotal> bufHitsPerLayer = {
m_cntHitsPerLayer[0].buffer(), m_cntHitsPerLayer[1].buffer(), m_cntHitsPerLayer[2].buffer(),
......@@ -146,30 +139,25 @@ namespace LHCb::Pr::FT {
auto yMin = endPoint.y();
const auto x0_orig = endPoint.x() - dxdy * yMin;
auto x0 = x0_orig; // to be updated by conditions if available
// const auto x0 = endPoint.x() - dxdy * yMin;
bufXPerLayer[iQuarter / 4] += x0_orig;
const auto z0 = endPoint.z() - dzdy * yMin;
auto yMax = yMin + cache.globaldy[index];
if ( id.isBottom() ) std::swap( yMin, yMax );
assert( clus.pseudoSize() < 9 && "Pseudosize of cluster is > 8. Out of range." );
const auto matContractionParameterVector = cache.matContractionParameterVector[index];
const bool matContractionAvailable = matContractionParameterVector.size() != 0;
if ( m_applyMatContractionCalibration ) {
if ( !matContractionAvailable ) {
warning() << "Requested to correct FT mats for temperature distortions but conditions not available. "
"These corrections cannot be applied. Check your conditions tags if you intend to apply "
"these corrections or set property ApplyMatContractionCalibration to false if you do not. "
"Continuing without applying corrections."
<< endmsg;
} else {
const auto& matContractionParameterVector = cache.matContractionParameterVector[index];
if ( !matContractionParameterVector.empty() ) {
const auto matContraction = matContractionParameterVector.at( ( id.sipm() * 128 ) + id.channel() );
const auto x0Calibration =
( cache.ddx[index] * matContraction ).x() - dxdy * ( cache.ddx[index] * matContraction ).y();
const auto calibratedx0 = x0_orig + x0Calibration;
x0 = calibratedx0;
debug() << "x0 before contraction correction: " << x0_orig
<< ", x0 after contraction correction: " << calibratedx0 << endmsg;
const auto calibratedDdx = cache.ddx[index] * matContraction;
const auto x0Calibration = calibratedDdx.x() - dxdy * calibratedDdx.y();
x0 = x0_orig + x0Calibration;
if ( msgLevel( MSG::DEBUG ) ) {
debug() << "x0 before contraction correction: " << x0_orig
<< ", x0 after contraction correction: " << x0 << endmsg;
}
} else {
++m_noCalib;
}
}
hits.appendColumn( ( info & 63u ) >> 1, x0, {invClusRes2[clus.pseudoSize()], dzdy, dxdy, z0},
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment