Skip to content
Snippets Groups Projects
Commit bc1ce042 authored by scott snyder's avatar scott snyder Committed by scott snyder
Browse files

ZdcAnalysis: Use Accessor, etc instead of auxdata().

Replace auxdata, etc. with Accessor classes.
Moving to deprecate these usages in the Athena build.
parent 67d15ace
No related branches found
No related tags found
29 merge requests!78241Draft: FPGATrackSim: GenScan code refactor,!78236Draft: Switching Streams https://its.cern.ch/jira/browse/ATR-27417,!78056AFP monitoring: new synchronization and cleaning,!78041AFP monitoring: new synchronization and cleaning,!77990Updating TRT chip masks for L1TRT trigger simulation - ATR-28372,!77733Draft: add new HLT NN JVT, augmented with additional tracking information,!77731Draft: Updates to ZDC reconstruction,!77728Draft: updates to ZDC reconstruction,!77522Draft: sTGC Pad Trigger Emulator,!76725ZdcNtuple: Fix cppcheck warning.,!76611L1CaloFEXByteStream: Fix out-of-bounds array accesses.,!76475Punchthrough AF3 implementation in FastG4,!76474Punchthrough AF3 implementation in FastG4,!76343Draft: MooTrackBuilder: Recalibrate NSW hits in refine method,!75729New implementation of ZDC nonlinear FADC correction.,!75703Draft: Update to HI han config for HLT jets,!75184Draft: Update file heavyions_run.config,!74430Draft: Fixing upper bound for Delayed Jet Triggers,!73963Changing the path of the histograms to "Expert" area,!73875updating ID ART reference plots,!73874AtlasCLHEP_RandomGenerators: Fix cppcheck warnings.,!73449Add muon detectors to DarkJetPEBTLA partial event building,!73343Draft: [TrigEgamma] Add photon ringer chains on bootstrap mechanism,!72336Fixed TRT calibration crash,!72176Draft: Improving L1TopoOnline chain that now gets no-empty plots. Activating it by default,!72012Draft: Separate JiveXMLConfig.py into Config files,!71876Fix MET trigger name in MissingETMonitoring,!71820Draft: Adding new TLA End-Of-Fill (EOF) chains and removing obsolete DIPZ chains,!71359ZdcAnalysis+ZdcRec: Use Accessor, etc instead of auxdata().
/*
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#include "ZdcAnalysis/ZdcAnalysisTool.h"
......@@ -16,6 +16,7 @@
#include <AsgDataHandles/ReadHandle.h>
#include <AsgDataHandles/WriteHandle.h>
#include <AsgDataHandles/WriteDecorHandle.h>
#include "AthContainers/ConstAccessor.h"
namespace ZDC
{
......@@ -1451,6 +1452,9 @@ StatusCode ZdcAnalysisTool::recoZdcModules(const xAOD::ZdcModuleContainer& modul
m_rpdDataAnalyzer.at(1)->reset();
}
static const SG::ConstAccessor<std::vector<uint16_t> > g0dataAcc ("g0data");
static const SG::ConstAccessor<std::vector<uint16_t> > g1dataAcc ("g1data");
const std::vector<unsigned short>* adcUndelayLG = 0;
const std::vector<unsigned short>* adcUndelayHG = 0;
......@@ -1487,18 +1491,11 @@ StatusCode ZdcAnalysisTool::recoZdcModules(const xAOD::ZdcModuleContainer& modul
continue;
}
else {
const std::vector<uint16_t>* vector_p = &(zdcModule->auxdata<std::vector<uint16_t>>("g0data"));
if (!vector_p) {
// This is obviously a problem, generate a non-fatal but serious error and continue
//
ATH_MSG_WARNING("Could not retrieve waveform for side " << side << ", module " << zdcModule->zdcModule() << ", skipping this module");
continue;
}
//
// Pass the data to the RPD analysis tool
//
m_rpdDataAnalyzer.at(side)->loadChannelData(rpdChannel, *vector_p);
m_rpdDataAnalyzer.at(side)->loadChannelData(rpdChannel,
g0dataAcc (*zdcModule));
}
}
else {
......@@ -1507,28 +1504,31 @@ StatusCode ZdcAnalysisTool::recoZdcModules(const xAOD::ZdcModuleContainer& modul
//
if (m_LHCRun==3) // no delay channels, so we drop the index
{
adcUndelayLG = &(zdcModule->auxdata<std::vector<uint16_t>>("g0data")); // g0
adcUndelayHG = &(zdcModule->auxdata<std::vector<uint16_t>>("g1data")); // g1
adcUndelayLG = &g0dataAcc(*zdcModule); // g0
adcUndelayHG = &g1dataAcc(*zdcModule); // g1
}
else if (m_LHCRun==2)
{
if (zdcModule->zdcType() == 1) continue; // skip position sensitive modules
static const SG::ConstAccessor<std::vector<uint16_t> > g0d1dataAcc ("g0d1data");
static const SG::ConstAccessor<std::vector<uint16_t> > g1d1dataAcc ("g1d1data");
static const SG::ConstAccessor<std::vector<uint16_t> > g0d0dataAcc ("g0d0data");
static const SG::ConstAccessor<std::vector<uint16_t> > g1d0dataAcc ("g1d0data");
if (zdcModule->zdcModule() == 0 && m_flipEMDelay) // flip delay/non-delay for 2015 ONLY
{
adcUndelayLG = &(zdcModule->auxdata<std::vector<uint16_t>>("g0d1Data")); // g0d1
adcUndelayHG = &(zdcModule->auxdata<std::vector<uint16_t>>("g1d1Data")); // g1d1
adcDelayLG = &(zdcModule->auxdata<std::vector<uint16_t>>("g0d0Data")); // g0d0
adcDelayHG = &(zdcModule->auxdata<std::vector<uint16_t>>("g1d0Data")); // g1d0
adcUndelayLG = &g0d1dataAcc(*zdcModule); // g0d1
adcUndelayHG = &g1d1dataAcc(*zdcModule); // g1d1
adcDelayLG = &g0d0dataAcc(*zdcModule); // g0d0
adcDelayHG = &g1d0dataAcc(*zdcModule); // g1d0
}
else // nominal configuation
{
adcUndelayLG = &(zdcModule->auxdata<std::vector<uint16_t>>("g0d0Data")); // g0d0
adcUndelayHG = &(zdcModule->auxdata<std::vector<uint16_t>>("g1d0Data")); // g1d0
adcDelayLG = &(zdcModule->auxdata<std::vector<uint16_t>>("g0d1Data")); // g0d1
adcDelayHG = &(zdcModule->auxdata<std::vector<uint16_t>>("g1d1Data")); // g1d1
adcUndelayLG = &g0d0dataAcc(*zdcModule); // g0d0
adcUndelayHG = &g1d0dataAcc(*zdcModule); // g1d0
adcDelayLG = &g0d1dataAcc(*zdcModule); // g0d1
adcDelayHG = &g1d1dataAcc(*zdcModule); // g1d1
}
}
else
......
/*
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#include <sstream>
......@@ -13,6 +13,7 @@
#include "AsgDataHandles/ReadDecorHandle.h"
#include <AsgDataHandles/WriteHandle.h>
#include <AsgDataHandles/WriteDecorHandle.h>
#include "AthContainers/ConstAccessor.h"
namespace ZDC
{
......@@ -323,9 +324,11 @@ ZDCLEDModuleResults ZdcLEDAnalysisTool::processZDCModule(const xAOD::ZdcModule&
{
ATH_MSG_DEBUG("Processing ZDC side, channel = " << module.zdcSide() << ", " << module.zdcModule());
bool doLG = false;
std::vector<uint16_t> HGSamples = module.auxdata<std::vector<uint16_t> >("g1data");
std::vector<uint16_t> LGSamples = module.auxdata<std::vector<uint16_t> >("g0data");
static const SG::ConstAccessor<std::vector<uint16_t> > g1dataAcc ("g1data");
static const SG::ConstAccessor<std::vector<uint16_t> > g0dataAcc ("g0data");
std::vector<uint16_t> HGSamples = g1dataAcc (module);
std::vector<uint16_t> LGSamples = g0dataAcc (module);
std::vector<uint16_t>::const_iterator maxIter = std::max_element(HGSamples.begin(), HGSamples.end());
if (maxIter != HGSamples.end()) {
......@@ -343,7 +346,8 @@ ZDCLEDModuleResults ZdcLEDAnalysisTool::processZDCModule(const xAOD::ZdcModule&
ZDCLEDModuleResults ZdcLEDAnalysisTool::processRPDModule(const xAOD::ZdcModule& module)
{
ATH_MSG_DEBUG("Processing RPD side, channel = " << module.zdcSide() << ", " << module.zdcChannel());
return processModuleData(module.auxdata<std::vector<uint16_t> >("g0data"), m_sampleAnaStartRPD, m_sampleAnaEndRPD, 1);
static const SG::ConstAccessor<std::vector<uint16_t> > g0dataAcc ("g0data");
return processModuleData(g0dataAcc (module), m_sampleAnaStartRPD, m_sampleAnaEndRPD, 1);
}
ZDCLEDModuleResults ZdcLEDAnalysisTool::processModuleData(const std::vector<unsigned short>& data,
......
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