Skip to content
Snippets Groups Projects
Commit 951ca109 authored by Louis Henry's avatar Louis Henry
Browse files

Create FTMonitoringHist2D namespace

parent 750707e2
No related branches found
No related tags found
No related merge requests found
Pipeline #6389535 failed with stages
in 4 minutes and 24 seconds
......@@ -11,6 +11,7 @@
#pragma once
#include "FTChannelID.h"
#include "FTConstants.h"
#include "Gaudi/Accumulators/Histogram.h"
#include <array>
#include <cstdint>
......@@ -83,5 +84,30 @@ namespace LHCb::Detector {
return chan.globalModuleIdx();
}
/// Histogram helper functions
namespace FTMonitoringHist2D {
Gaudi::Accumulators::Axis<float> xAxis() {
return {FTConstants::nMaxSiPMsPerQuarter, -0.5f - FTConstants::nMaxSiPMsPerQuarter,
FTConstants::nMaxSiPMsPerQuarter + 0.5f};
}
Gaudi::Accumulators::Axis<float> yAxis() {
return {2 * FTConstants::nLayers, -0.5f, 2 * FTConstants::nLayers - 0.5f};
}
[[nodiscard]] constexpr float xVal( FTChannelID chanID ) {
return ( 0.5f + chanID.localSiPMIdx_quarter() ) * ( -static_cast<float>( chanID.isRight() ) );
}
[[nodiscard]] constexpr float yVal( FTChannelID chanID ) {
return 2.f * chanID.globalLayerIdx() + static_cast<float>( chanID.isTop() );
}
void fillHist( Gaudi::Accumulators::Histogram<2, Gaudi::Accumulators::atomicity::full, float>& hist,
FTChannelID chanID ) {
++hist[{xVal( chanID ), yVal( chanID )}];
}
} // namespace FTMonitoringHist2D
} // namespace FTUtils
} // End namespace LHCb::Detector
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