ATLAS Offline Software
Loading...
Searching...
No Matches
RpdSubtractCentroidTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include <numbers>
6
12#include "ZdcUtils/RPDUtils.h"
14
15namespace ZDC
16{
17
19 : asg::AsgTool(name)
20{
21 declareProperty("ZDCModuleContainerName", m_ZDCModuleContainerName = "ZdcModules", "Location of ZDC processed data");
22 declareProperty("ZDCSumContainerName", m_ZDCSumContainerName = "ZdcSums", "Location of ZDC processed sums");
23 declareProperty("Configuration", m_configuration = "default");
24 declareProperty("WriteAux", m_writeAux = true, "If true, write AOD decorations");
25 declareProperty("AuxSuffix", m_auxSuffix = "", "Suffix to add to AOD decorations for reading and writing");
26 declareProperty("MinZDCEnergy", m_forceMinZDCEnergy, "Minimum (calibrated) ZDC energy for valid centroid (negative to disable); per side");
27 declareProperty("MaxZDCEnergy", m_forceMaxZDCEnergy, "Maximum (calibrated) ZDC energy for valid centroid (negative to disable); per side");
28 declareProperty("MinEMEnergy", m_forceMinEMEnergy, "Minimum (calibrated) EM energy for valid centroid (negative to disable); per side");
29 declareProperty("MaxEMEnergy", m_forceMaxEMEnergy, "Minimum (calibrated) EM energy for valid centroid (negative to disable); per side");
30 declareProperty("PileupMaxFrac", m_forcePileupMaxFrac, "Maximum fractional pileup allowed in an RPD channel for valid centroid; per side");
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");
32 declareProperty("UseRPDSumAdc", m_forceUseRPDSumAdc, "If true, use RPD channel sum ADC for centroid calculation, else use RPD channel max ADC");
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");
34}
35
36StatusCode RpdSubtractCentroidTool::initializeKey(std::string const& containerName, SG::WriteDecorHandleKey<xAOD::ZdcModuleContainer> & writeHandleKey, std::string const& key) {
37 writeHandleKey = containerName + key + m_auxSuffix;
38 return writeHandleKey.initialize();
39}
40
42 // first initialize reconstruction parameters
43 m_minZDCEnergy = {-1.0, -1.0};
44 m_maxZDCEnergy = {-1.0, -1.0};
45 m_minEMEnergy = {-1.0, -1.0};
46 m_maxEMEnergy = {-1.0, -1.0};
47 m_pileupMaxFrac = {1.0, 1.0};
49 m_useRPDSumAdc = true;
51
52 // then overwrite inidividual parameters from configuration if any were provided
53 if (m_forceMinZDCEnergy.has_value()) {
55 }
56 if (m_forceMaxZDCEnergy.has_value()) {
58 }
59 if (m_forceMinEMEnergy.has_value()) {
61 }
62 if (m_forceMaxEMEnergy.has_value()) {
64 }
65 if (m_forcePileupMaxFrac.has_value()) {
67 }
68 if (m_forceMaximumNegativeSubtrAmpFrac.has_value()) {
70 }
71 if (m_forceUseRPDSumAdc.has_value()) {
73 }
74 if (m_forceUseCalibDecorations.has_value()) {
76 }
77
78 // if any ZDC/EM energy threshold is nonnegative, ZDC decorations must be read
80
81 for (auto const side : RPDUtils::sides) {
82 if (m_minZDCEnergy.at(side) < 0) m_minZDCEnergy.at(side) = -std::numeric_limits<float>::infinity();
83 if (m_maxZDCEnergy.at(side) < 0) m_maxZDCEnergy.at(side) = std::numeric_limits<float>::infinity();
84 if (m_minEMEnergy.at(side) < 0) m_minEMEnergy.at(side) = -std::numeric_limits<float>::infinity();
85 if (m_maxEMEnergy.at(side) < 0) m_maxEMEnergy.at(side) = std::numeric_limits<float>::infinity();
86 }
87
88 ATH_MSG_DEBUG("RpdSubtractCentroidTool reconstruction parameters:");
89 ATH_MSG_DEBUG("config = " << m_configuration);
95 ATH_MSG_DEBUG("maximumNegativeSubtrAmpFrac = " << RPDUtils::vecToString(m_maximumNegativeSubtrAmpFrac));
96 ATH_MSG_DEBUG("useRPDSumAdc = " << m_useRPDSumAdc);
97 ATH_MSG_DEBUG("useCalibDecorations = " << m_useCalibDecorations);
98
100 ATH_MSG_DEBUG("RpdSubtractCentroidTool is configured to check ZDC or EM energy; ZDC-related ReadDecorHandleKey's will be initialized");
101 m_ZDCSideStatus = {0, 0};
102 m_ZDCFinalEnergy = {0, 0};
103 m_EMCalibEnergy = {0, 0};
104 m_EMStatus = {0, 0};
105 }
106
107 ATH_CHECK(m_eventInfoKey.initialize());
108
123
124 if (m_writeAux && !m_auxSuffix.empty()) {
125 ATH_MSG_DEBUG("suffix string = " << m_auxSuffix);
126 }
127
128 m_initialized = true;
129
130 return StatusCode::SUCCESS;
131}
132
154
156 // initialize read handles from read handle keys
158 if (!eventInfo.isValid()) {
160 }
161 // RPD decorations are always needed
162 if (eventInfo->isEventFlagBitSet(xAOD::EventInfo::ForwardDet, ZdcEventInfo::RPDDECODINGERROR)) {
163 ATH_MSG_WARNING("RPD decoding error found - abandoning RPD centroid reco!");
165 }
166 // ZDC decorations are sometimes needed
168 ATH_MSG_WARNING("ZDC decoding error found - abandoning RPD centroid reco!");
170 }
171
172 // nominally, aux suffix is added to read key, since upstream tools were probably configured to write decorations with the same suffix
173 // however, certain decorations remain unchanged in a reprocessing (e.g., those written by ZdcRecChannelToolLucrod), in which case the suffix should NOT be added
174 static SG::ConstAccessor<float> const xposRelAcc("xposRel");
175 static SG::ConstAccessor<float> const yposRelAcc("yposRel");
176 static SG::ConstAccessor<unsigned short> const rowAcc("row");
177 static SG::ConstAccessor<unsigned short> const colAcc("col");
178 static SG::ConstAccessor<float> const rpdChannelSumAdcAcc("RPDChannelAmplitude" + m_auxSuffix);
179 static SG::ConstAccessor<float> const rpdChannelSumAdcCalibAcc("RPDChannelAmplitudeCalib" + m_auxSuffix);
180 static SG::ConstAccessor<float> const rpdChannelMaxADCAcc("RPDChannelMaxADC" + m_auxSuffix);
181 static SG::ConstAccessor<float> const rpdChannelMaxADCCalibAcc("RPDChannelMaxADCCalib" + m_auxSuffix);
182 static SG::ConstAccessor<float> const rpdChannelPileupFracAcc("RPDChannelPileupFrac" + m_auxSuffix);
183 static SG::ConstAccessor<unsigned int> const rpdChannelStatusAcc("RPDChannelStatus" + m_auxSuffix);
184 static SG::ConstAccessor<unsigned int> const rpdSideStatusAcc("RPDStatus" + m_auxSuffix);
185 static auto const zdcModuleCalibEnergyAcc = m_readZDCDecorations
186 ? std::optional<SG::ConstAccessor<float>>("CalibEnergy" + m_auxSuffix)
187 : std::nullopt;
188 static auto const zdcModuleStatusAcc = m_readZDCDecorations
189 ? std::optional<SG::ConstAccessor<unsigned int>>("Status" + m_auxSuffix)
190 : std::nullopt;
191 static auto const zdcFinalEnergyAcc = m_readZDCDecorations
192 ? std::optional<SG::ConstAccessor<float>>("FinalEnergy" + m_auxSuffix)
193 : std::nullopt;
194 static auto const zdcStatusAcc = m_readZDCDecorations
195 ? std::optional<SG::ConstAccessor<unsigned int>>("Status" + m_auxSuffix)
196 : std::nullopt;
197
198 ATH_MSG_DEBUG("Processing modules");
199
200 for (auto const * const zdcModule : moduleContainer) {
201 unsigned int const side = RPDUtils::ZDCSideToSideIndex(zdcModule->zdcSide());
202 if (zdcModule->zdcType() == RPDUtils::ZDCModuleZDCType && zdcModule->zdcModule() == RPDUtils::ZDCModuleEMModule) {
203 // this is a ZDC module and this is an EM module
205 m_EMCalibEnergy->at(side) = (*zdcModuleCalibEnergyAcc)(*zdcModule);
206 m_EMStatus->at(side) = (*zdcModuleStatusAcc)(*zdcModule);
207 }
208 } else if (zdcModule->zdcType() == RPDUtils::ZDCModuleRPDType) {
209 // this is a Run 3 RPD module
210 // (it is assumed that this tool will not be invoked otherwise)
211 //
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());
214 }
215 // channel numbers are fixed in mapping in ZdcConditions, numbered 0-15
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);
220 m_RPDChannelData.at(side).at(row).at(col).xposRel = xposRelAcc(*zdcModule);
221 m_RPDChannelData.at(side).at(row).at(col).yposRel = yposRelAcc(*zdcModule);
222 m_RPDChannelData.at(side).at(row).at(col).row = rowAcc(*zdcModule);
223 m_RPDChannelData.at(side).at(row).at(col).col = colAcc(*zdcModule);
224 if (m_useRPDSumAdc) {
226 m_RPDChannelData.at(side).at(row).at(col).amp = rpdChannelSumAdcCalibAcc(*zdcModule);
227 } else {
228 m_RPDChannelData.at(side).at(row).at(col).amp = rpdChannelSumAdcAcc(*zdcModule);
229 }
230 } else {
232 m_RPDChannelData.at(side).at(row).at(col).amp = rpdChannelMaxADCCalibAcc(*zdcModule);
233 } else {
234 m_RPDChannelData.at(side).at(row).at(col).amp = rpdChannelMaxADCAcc(*zdcModule);
235 }
236 }
237 m_RPDChannelData.at(side).at(row).at(col).pileupFrac = rpdChannelPileupFracAcc(*zdcModule);
238 m_RPDChannelData.at(side).at(row).at(col).status = rpdChannelStatusAcc(*zdcModule);
239 }
240 }
241
242 for (auto const * const zdcSum: moduleSumContainer) {
243 if (zdcSum->zdcSide() == RPDUtils::ZDCSumsGlobalZDCSide) {
244 // skip global sum (it's like the side between sides)
245 continue;
246 }
247 unsigned int const side = RPDUtils::ZDCSideToSideIndex(zdcSum->zdcSide());
248 m_RPDSideStatus.at(side) = rpdSideStatusAcc(*zdcSum);
249 if (m_ZDCSideStatus) m_ZDCSideStatus->at(side) = (*zdcStatusAcc)(*zdcSum);
250 if (m_ZDCFinalEnergy) m_ZDCFinalEnergy->at(side) = (*zdcFinalEnergyAcc)(*zdcSum);
251 }
252
254}
255
258 if (m_ZDCSideStatus->at(side) == 0) {
259 // zdc bad
260 m_centroidStatus.at(side).set(ZDCInvalidBit, true);
261 m_centroidStatus.at(side).set(ValidBit, false);
262 } else {
263 // zdc good
264 if (m_ZDCFinalEnergy->at(side) < m_minZDCEnergy.at(side)) {
265 m_centroidStatus.at(side).set(InsufficientZDCEnergyBit, true);
266 m_centroidStatus.at(side).set(ValidBit, false);
267 }
268 if (m_ZDCFinalEnergy->at(side) > m_maxZDCEnergy.at(side)) {
269 m_centroidStatus.at(side).set(ExcessiveZDCEnergyBit, true);
270 m_centroidStatus.at(side).set(ValidBit, false);
271 }
272 }
273
274 if (m_EMStatus->at(side)[ZDCPulseAnalyzer::FailBit]) {
275 // em bad
276 m_centroidStatus.at(side).set(EMInvalidBit, true);
277 m_centroidStatus.at(side).set(ValidBit, false);
278 } else {
279 // em good
280 if (m_EMCalibEnergy->at(side) < m_minEMEnergy.at(side)) {
281 m_centroidStatus.at(side).set(InsufficientEMEnergyBit, true);
282 m_centroidStatus.at(side).set(ValidBit, false);
283 }
284 if (m_EMCalibEnergy->at(side) > m_maxEMEnergy.at(side)) {
285 m_centroidStatus.at(side).set(ExcessiveEMEnergyBit, true);
286 m_centroidStatus.at(side).set(ValidBit, false);
287 }
288 }
289 }
290
292 m_centroidStatus.at(side).set(PileupBit, true);
293 }
294
295 for (unsigned int row = 0; row < RPDUtils::nRows; row++) {
296 for (unsigned int col = 0; col < RPDUtils::nCols; col++) {
297 if (m_RPDChannelData.at(side).at(row).at(col).pileupFrac > m_pileupMaxFrac.at(side)) {
298 m_centroidStatus.at(side).set(ExcessivePileupBit, true);
299 m_centroidStatus.at(side).set(ValidBit, false);
300 }
301 }
302 }
303
305 m_centroidStatus.at(side).set(RPDInvalidBit, true);
306 m_centroidStatus.at(side).set(ValidBit, false);
307 return false;
308 }
309
310 return true;
311}
312
314 for (unsigned int row = 0; row < RPDUtils::nRows; row++) {
315 for (unsigned int col = 0; col < RPDUtils::nCols; col++) {
316 float subtrAmp {};
317 if (row == RPDUtils::nRows - 1) {
318 // top row -> nothing to subtract
319 subtrAmp = m_RPDChannelData.at(side).at(row).at(col).amp;
320 } else {
321 // other rows -> subtract the tile above this one
322 subtrAmp = m_RPDChannelData.at(side).at(row).at(col).amp - m_RPDChannelData.at(side).at(row + 1).at(col).amp;
323 }
324 m_RPDChannelData.at(side).at(row).at(col).subtrAmp = subtrAmp;
325 m_subtrAmp.at(side).at(m_RPDChannelData.at(side).at(row).at(col).channel) = subtrAmp;
326 m_subtrAmpRowSum.at(side).at(row) += subtrAmp;
327 m_subtrAmpColSum.at(side).at(col) += subtrAmp;
328 m_subtrAmpSum.at(side) += subtrAmp;
329 }
330 }
331
332 if (m_subtrAmpSum.at(side) <= 0) {
333 m_centroidStatus.at(side).set(ZeroSumBit, true);
334 m_centroidStatus.at(side).set(ValidBit, false);
335 return false;
336 }
337
338 for (unsigned int row = 0; row < RPDUtils::nRows; row++) {
339 for (unsigned int col = 0; col < RPDUtils::nCols; col++) {
340 const float &subtrAmp = m_RPDChannelData.at(side).at(row).at(col).subtrAmp;
341 if (subtrAmp < 0 && -subtrAmp/m_subtrAmpSum.at(side) > m_maximumNegativeSubtrAmpFrac.at(side)) {
343 m_centroidStatus.at(side).set(ValidBit, false);
344 }
345 }
346 }
347
348 return true;
349}
350
352 for (unsigned int col = 0; col < RPDUtils::nCols; col++) {
353 m_xCentroidPreGeomCorPreAvgSubtr.at(side) += m_subtrAmpColSum.at(side).at(col)*m_RPDChannelData.at(side).at(0).at(col).xposRel/m_subtrAmpSum.at(side);
354 }
355
356 for (unsigned int row = 0; row < RPDUtils::nRows; row++) {
357 m_yCentroidPreGeomCorPreAvgSubtr.at(side) += m_subtrAmpRowSum.at(side).at(row)*m_RPDChannelData.at(side).at(row).at(0).yposRel/m_subtrAmpSum.at(side);
358 }
359
360 for (unsigned int row = 0; row < RPDUtils::nRows; row++) {
361 if (m_subtrAmpRowSum.at(side).at(row) <= 0) continue;
362 for (unsigned int col = 0; col < RPDUtils::nCols; col++) {
363 m_xRowCentroid.at(side).at(row) += m_RPDChannelData.at(side).at(row).at(col).subtrAmp*m_RPDChannelData.at(side).at(row).at(col).xposRel/m_subtrAmpRowSum.at(side).at(row);
364 }
365 m_centroidStatus.at(side).set(Row0ValidBit + row, true);
366 }
367
368 for (unsigned int col = 0; col < RPDUtils::nCols; col++) {
369 if (m_subtrAmpColSum.at(side).at(col) <= 0) continue;
370 for (unsigned int row = 0; row < RPDUtils::nRows; row++) {
371 m_yColCentroid.at(side).at(col) += m_RPDChannelData.at(side).at(row).at(col).subtrAmp*m_RPDChannelData.at(side).at(row).at(col).yposRel/m_subtrAmpColSum.at(side).at(col);
372 }
373 m_centroidStatus.at(side).set(Col0ValidBit + col, true);
374 }
375}
376
382
384 m_xCentroid.at(side) = m_xCentroidPreAvgSubtr.at(side) - m_avgXCentroid.at(side);
385 m_yCentroid.at(side) = m_yCentroidPreAvgSubtr.at(side) - m_avgYCentroid.at(side);
386}
387
389 auto angle = std::atan2(m_yCentroid.at(side), m_xCentroid.at(side));
390 // our angles are now simply the angle of the centroid in ATLAS coordinates on either side
391 // however, we expect correlated deflection, so we want the difference between the angles
392 // to be small when the centroids are in opposite quadrants of the two RPDs
393 // therefore, we add pi to side A (chosen arbitrarily)
394 if (side == RPDUtils::sideA) angle += std::numbers::pi_v<float>;
395 // also, restrict to [-pi, pi)
396 // we choose this rather than (-pi, pi] for ease of binning the edge case +/- pi
397 if (angle >= std::numbers::pi) angle -= 2*std::numbers::pi_v<float>;
398 m_reactionPlaneAngle.at(side) = angle;
399}
400
401void RpdSubtractCentroidTool::writeAOD(xAOD::ZdcModuleContainer const& moduleSumContainer) const {
402 if (!m_writeAux) return;
403 ATH_MSG_DEBUG("Adding variables with suffix = " + m_auxSuffix);
404
405 // initialize write handles from write handle keys
420
421 for (auto const * const zdcSum: moduleSumContainer) {
422 if (zdcSum->zdcSide() == RPDUtils::ZDCSumsGlobalZDCSide) {
423 // global sum container
424 // event status is bool, but stored as char to save disk space
425 centroidEventValidHandle(*zdcSum) = static_cast<char>(m_eventValid);
426 cosDeltaReactionPlaneAngleHandle(*zdcSum) = m_cosDeltaReactionPlaneAngle;
427 continue;
428 }
429 unsigned int const side = RPDUtils::ZDCSideToSideIndex(zdcSum->zdcSide());
430 centroidStatusHandle(*zdcSum) = static_cast<unsigned int>(m_centroidStatus.at(side).to_ulong());
431 rpdChannelSubtrAmpHandle(*zdcSum) = m_subtrAmp.at(side);
432 rpdSubtrAmpSumHandle(*zdcSum) = m_subtrAmpSum.at(side);
433 xCentroidPreGeomCorPreAvgSubtrHandle(*zdcSum) = m_xCentroidPreGeomCorPreAvgSubtr.at(side);
434 yCentroidPreGeomCorPreAvgSubtrHandle(*zdcSum) = m_yCentroidPreGeomCorPreAvgSubtr.at(side);
435 xCentroidPreAvgSubtrHandle(*zdcSum) = m_xCentroidPreAvgSubtr.at(side);
436 yCentroidPreAvgSubtrHandle(*zdcSum) = m_yCentroidPreAvgSubtr.at(side);
437 xCentroidHandle(*zdcSum) = m_xCentroid.at(side);
438 yCentroidHandle(*zdcSum) = m_yCentroid.at(side);
439 xRowCentroidHandle(*zdcSum) = m_xRowCentroid.at(side);
440 yColCentroidHandle(*zdcSum) = m_yColCentroid.at(side);
441 reactionPlaneAngleHandle(*zdcSum) = m_reactionPlaneAngle.at(side);
442 }
443}
444
445StatusCode RpdSubtractCentroidTool::recoZdcModules(xAOD::ZdcModuleContainer const& moduleContainer, xAOD::ZdcModuleContainer const& moduleSumContainer) {
446 if (moduleContainer.empty()) {
447 // no modules - do nothing
448 return StatusCode::SUCCESS;
449 }
450 reset();
451 switch (readAOD(moduleContainer, moduleSumContainer)) {
453 // do nothing - proceed
454 break;
456 // stop and propagate error to Athena
457 return StatusCode::FAILURE;
459 // stop and tell Athena the event was a success
460 return StatusCode::SUCCESS;
461 }
462 for (auto const side : RPDUtils::sides) {
463 if (!checkZdcRpdValidity(side)) continue; // rpd invalid -> don't calculate centroid
464 if (!subtractRpdAmplitudes(side)) continue; // bad total sum -> don't calculate centroid
466 geometryCorrection(side);
469 m_centroidStatus.at(side).set(HasCentroidBit, true);
470 }
473 }
475 m_eventValid = true; // event is good for analysis
476 }
477 writeAOD(moduleSumContainer);
478 ATH_MSG_DEBUG("Finishing event processing");
479 return StatusCode::SUCCESS;
480}
481
483 if (!m_initialized) {
484 ATH_MSG_WARNING("Tool not initialized!");
485 return StatusCode::FAILURE;
486 }
487 ATH_MSG_DEBUG("Trying to retrieve " << m_ZDCModuleContainerName);
488 xAOD::ZdcModuleContainer const* zdcModules = nullptr;
489 ATH_CHECK(evtStore()->retrieve(zdcModules, m_ZDCModuleContainerName));
490 xAOD::ZdcModuleContainer const* zdcSums = nullptr;
491 ATH_CHECK(evtStore()->retrieve(zdcSums, m_ZDCSumContainerName));
492 ATH_CHECK(recoZdcModules(*zdcModules, *zdcSums));
493 return StatusCode::SUCCESS;
494}
495
496} // namespace ZDC
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
Handle class for reading a decoration on an object.
Handle class for adding a decoration to an object.
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.
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_centroidStatusKey
StatusCode recoZdcModules(const xAOD::ZdcModuleContainer &moduleContainer, const xAOD::ZdcModuleContainer &moduleSumContainer) override
std::array< float, 2 > m_reactionPlaneAngle
the y centroid for each column on each side
std::array< float, 2 > m_xCentroidPreAvgSubtr
y centroid before geomerty correction and before average subtraction (RPD detector coordinates) on ea...
std::array< float, 2 > m_avgYCentroid
average x centroid
RPDUtils::OptionalToolProperty< std::vector< float > > m_forceMinZDCEnergy
bool subtractRpdAmplitudes(unsigned int side)
void geometryCorrection(unsigned int side)
std::optional< std::array< float, 2 > > m_EMCalibEnergy
ZDC final (calibrated) energy on each side.
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
std::array< std::array< std::array< RPDChannelData, RPDUtils::nCols >, RPDUtils::nRows >, 2 > m_RPDChannelData
EM modlue status word on each side.
SubstepStatus
cosine of difference between reaction plane angles of the two sides
RPDUtils::OptionalToolProperty< std::vector< float > > m_forceMaximumNegativeSubtrAmpFrac
SubstepStatus readAOD(xAOD::ZdcModuleContainer const &moduleContainer, xAOD::ZdcModuleContainer const &moduleSumContainer)
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_xCentroidPreGeomCorPreAvgSubtrKey
std::array< float, 2 > m_xCentroid
y centroid after geomerty correction and before average subtraction on each side
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_yCentroidPreGeomCorPreAvgSubtrKey
void writeAOD(xAOD::ZdcModuleContainer const &moduleSumContainer) const
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDChannelSubtrAmpKey
std::array< std::array< float, RPDUtils::nRows >, 2 > m_subtrAmpRowSum
subtracted amplitude for each channel on each side
RPDUtils::OptionalToolProperty< bool > m_forceUseCalibDecorations
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_xRowCentroidKey
RPDUtils::OptionalToolProperty< std::vector< float > > m_forcePileupMaxFrac
std::optional< std::array< unsigned int, 2 > > m_ZDCSideStatus
RPD analysis status word on each side.
std::array< std::vector< float >, 2 > m_subtrAmp
centroid status (valid by default) on each side
std::array< std::vector< float >, 2 > m_yColCentroid
the x centroid for each row on each side
StatusCode initializeKey(std::string const &containerName, SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > &writeHandleKey, std::string const &key)
std::vector< float > m_maximumNegativeSubtrAmpFrac
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_yColCentroidKey
void subtractAverageCentroid(unsigned int side)
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_cosDeltaReactionPlaneAngleKey
RPDUtils::OptionalToolProperty< bool > m_forceUseRPDSumAdc
void calculateDetectorCentroid(unsigned int side)
std::array< float, 2 > m_xCentroidPreGeomCorPreAvgSubtr
subtracted amplitude sum on each side
std::array< float, 2 > m_yCentroidPreGeomCorPreAvgSubtr
x centroid before geomerty correction and before average subtraction (RPD detector coordinates) on ea...
std::array< std::array< float, RPDUtils::nCols >, 2 > m_subtrAmpColSum
subtracted amplitude for each row on each side
std::optional< std::array< std::bitset< ZDCPulseAnalyzer::N_STATUS_BITS >, 2 > > m_EMStatus
EM calibrated energy on each side.
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_centroidEventValidKey
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_yCentroidPreAvgSubtrKey
std::array< float, 2 > m_alignmentYOffset
geometry + crossing angle correction in x (ATLAS coordinates)
static bool anyNonNegative(std::vector< float > const &v)
RPDUtils::OptionalToolProperty< std::vector< float > > m_forceMinEMEnergy
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_reactionPlaneAngleKey
RpdSubtractCentroidTool(const std::string &name)
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_RPDSubtrAmpSumKey
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_xCentroidKey
std::optional< std::array< float, 2 > > m_ZDCFinalEnergy
ZDC analysis status on each side.
void calculateReactionPlaneAngle(unsigned int side)
std::array< float, 2 > m_yCentroidPreAvgSubtr
x centroid after geomerty correction and before average subtraction on each side
std::array< float, 2 > m_subtrAmpSum
subtracted amplitude for each column on each side
StatusCode initialize() override
Dummy implementation of the initialisation function.
RPDUtils::OptionalToolProperty< std::vector< float > > m_forceMaxZDCEnergy
std::array< float, 2 > m_alignmentXOffset
RPD channel data for each channel (first index row, then index column) on each side.
std::array< std::bitset< N_STATUS_BITS >, 2 > m_centroidStatus
event status
float m_cosDeltaReactionPlaneAngle
reaction plane angle on each side
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_xCentroidPreAvgSubtrKey
std::array< float, 2 > m_yCentroid
x centroid after geomerty correction and after average subtraction on each side
RPDUtils::OptionalToolProperty< std::vector< float > > m_forceMaxEMEnergy
std::array< std::vector< float >, 2 > m_xRowCentroid
y centroid after geomerty correction and after average subtraction on each side
std::array< std::bitset< RPDDataAnalyzer::N_STATUS_BITS >, 2 > m_RPDSideStatus
SG::WriteDecorHandleKey< xAOD::ZdcModuleContainer > m_yCentroidKey
std::array< float, 2 > m_avgXCentroid
geometry + crossing angle correction in y (ATLAS coordinates)
bool checkZdcRpdValidity(unsigned int side)
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
@ ForwardDet
The forward detectors.
unsigned int ZDCSideToSideIndex(int const ZDCSide)
Definition RPDUtils.cxx:7
unsigned int constexpr nRows
Definition RPDUtils.h:24
int constexpr ZDCSumsGlobalZDCSide
Definition RPDUtils.h:19
unsigned int constexpr nChannels
Definition RPDUtils.h:23
unsigned int constexpr ZDCModuleRPDType
Definition RPDUtils.h:21
unsigned int constexpr sideC
Definition RPDUtils.h:15
unsigned int constexpr ZDCModuleZDCType
Definition RPDUtils.h:20
unsigned int constexpr sideA
Definition RPDUtils.h:16
unsigned int constexpr nCols
Definition RPDUtils.h:25
std::initializer_list< unsigned int > constexpr sides
Definition RPDUtils.h:17
void helpZero(Range &v)
Definition RPDUtils.h:27
unsigned int constexpr ZDCModuleEMModule
Definition RPDUtils.h:22
std::string vecToString(std::vector< T > const &v)
Definition RPDUtils.cxx:57
ZdcModuleContainer_v1 ZdcModuleContainer