31 declareProperty(
"ExcessiveSubtrUnderflowFrac",
m_forceMaximumNegativeSubtrAmpFrac,
"If any RPD channel subtracted amplitude is negative and its fraction of subtracted amplitude sum is greater than or equal to this number, the centroid is invalid; per side");
33 declareProperty(
"UseCalibDecorations",
m_forceUseCalibDecorations,
"If true, use RPD channel sum/max ADC decorations with output calibration factors applied during reconstruction, else use decorations with raw values");
88 ATH_MSG_DEBUG(
"RpdSubtractCentroidTool reconstruction parameters:");
100 ATH_MSG_DEBUG(
"RpdSubtractCentroidTool is configured to check ZDC or EM energy; ZDC-related ReadDecorHandleKey's will be initialized");
130 return StatusCode::SUCCESS;
163 ATH_MSG_WARNING(
"RPD decoding error found - abandoning RPD centroid reco!");
168 ATH_MSG_WARNING(
"ZDC decoding error found - abandoning RPD centroid reco!");
186 ? std::optional<SG::ConstAccessor<float>>(
"CalibEnergy" +
m_auxSuffix)
189 ? std::optional<SG::ConstAccessor<unsigned int>>(
"Status" +
m_auxSuffix)
192 ? std::optional<SG::ConstAccessor<float>>(
"FinalEnergy" +
m_auxSuffix)
195 ? std::optional<SG::ConstAccessor<unsigned int>>(
"Status" +
m_auxSuffix)
200 for (
auto const *
const zdcModule : moduleContainer) {
206 m_EMStatus->at(side) = (*zdcModuleStatusAcc)(*zdcModule);
212 if (zdcModule->zdcChannel() < 0 ||
static_cast<unsigned int>(zdcModule->zdcChannel()) >
RPDUtils::nChannels - 1) {
213 ATH_MSG_ERROR(
"Invalid RPD channel found on side " << side <<
": channel number = " << zdcModule->zdcChannel());
216 auto const channel = zdcModule->zdcChannel();
217 auto const& row = rowAcc(*zdcModule);
218 auto const& col = colAcc(*zdcModule);
219 m_RPDChannelData.at(side).at(row).at(col).channel =
static_cast<unsigned int>(channel);
226 m_RPDChannelData.at(side).at(row).at(col).amp = rpdChannelSumAdcCalibAcc(*zdcModule);
228 m_RPDChannelData.at(side).at(row).at(col).amp = rpdChannelSumAdcAcc(*zdcModule);
232 m_RPDChannelData.at(side).at(row).at(col).amp = rpdChannelMaxADCCalibAcc(*zdcModule);
234 m_RPDChannelData.at(side).at(row).at(col).amp = rpdChannelMaxADCAcc(*zdcModule);
237 m_RPDChannelData.at(side).at(row).at(col).pileupFrac = rpdChannelPileupFracAcc(*zdcModule);
238 m_RPDChannelData.at(side).at(row).at(col).status = rpdChannelStatusAcc(*zdcModule);
242 for (
auto const *
const zdcSum: moduleSumContainer) {
397 if (
angle >= std::numbers::pi)
angle -= 2*std::numbers::pi_v<float>;
421 for (
auto const *
const zdcSum: moduleSumContainer) {
425 centroidEventValidHandle(*zdcSum) =
static_cast<char>(
m_eventValid);
430 centroidStatusHandle(*zdcSum) =
static_cast<unsigned int>(
m_centroidStatus.at(side).to_ulong());
431 rpdChannelSubtrAmpHandle(*zdcSum) =
m_subtrAmp.at(side);
446 if (moduleContainer.
empty()) {
448 return StatusCode::SUCCESS;
451 switch (
readAOD(moduleContainer, moduleSumContainer)) {
457 return StatusCode::FAILURE;
460 return StatusCode::SUCCESS;
479 return StatusCode::SUCCESS;
485 return StatusCode::FAILURE;
493 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
double angle(const GeoTrf::Vector2D &a, const GeoTrf::Vector2D &b)
Define enumerations for event-level ZDC data.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
ServiceHandle< StoreGateSvc > & evtStore()
bool empty() const noexcept
Returns true if the collection is empty.
Helper class to provide constant type-safe access to aux data.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Handle class for adding a decoration to an object.
@ ForwardDet
The forward detectors.
unsigned int ZDCSideToSideIndex(int const ZDCSide)
unsigned int constexpr nRows
int constexpr ZDCSumsGlobalZDCSide
unsigned int constexpr nChannels
unsigned int constexpr ZDCModuleRPDType
unsigned int constexpr sideC
unsigned int constexpr ZDCModuleZDCType
unsigned int constexpr sideA
unsigned int constexpr nCols
std::initializer_list< unsigned int > constexpr sides
unsigned int constexpr ZDCModuleEMModule
std::string vecToString(std::vector< T > const &v)
ZdcModuleContainer_v1 ZdcModuleContainer