Skip to content
Snippets Groups Projects
Commit e8407109 authored by Tadej Novak's avatar Tadej Novak
Browse files

Merge branch 'earlynull.AthContainers-20240518' into 'main'

AthContainers: Early exit from Factory operations for 0 elements.

See merge request !71504
parents 9bbd656c b492005f
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,!71504AthContainers: Early exit from Factory operations for 0 elements.
/*
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
/**
* @file AthContainers/tools/AuxTypeVectorFactory.icc
......@@ -168,6 +168,7 @@ AuxTypeVectorFactoryImpl<T, ALLOC>::copyImpl (SG::auxid_t auxid,
size_t src_index,
size_t n) const -> vector_value_type*
{
if (n == 0) return nullptr;
auto dstptr = reinterpret_cast<vector_value_type*>(dst.getDataArray (auxid));
if (&src == &dst) {
// Source and destination containers are the same.
......@@ -263,6 +264,7 @@ void AuxTypeVectorFactoryImpl<T, ALLOC>::swap (SG::auxid_t auxid,
AuxVectorData& b, size_t bindex,
size_t n) const
{
if (n == 0) return;
auto aptr = reinterpret_cast<vector_value_type*>(a.getDataArray (auxid));
auto bptr = &a == &b ? aptr : reinterpret_cast<vector_value_type*>(b.getDataArray (auxid));
for (size_t i = 0; i < n; i++) {
......@@ -284,6 +286,7 @@ void AuxTypeVectorFactoryImpl<T, ALLOC>::clear (SG::auxid_t auxid,
size_t dst_index,
size_t n) const
{
if (n == 0) return;
auto ptr = reinterpret_cast<vector_value_type*>(dst.getDataArray (auxid));
std::fill (ptr+dst_index, ptr+dst_index+n, SG::Zero<vector_value_type>::zero());
}
......
......@@ -481,6 +481,7 @@ char* RootAuxVectorFactory::copyImpl (SG::auxid_t auxid,
size_t src_index,
size_t n) const
{
if (n == 0) return nullptr;
size_t eltsz = m_type.getSize();
char* dstptr = reinterpret_cast<char*> (dst.getDataArray (auxid));
if (&src == &dst) {
......@@ -586,6 +587,7 @@ void RootAuxVectorFactory::swap (SG::auxid_t auxid,
AuxVectorData& b, size_t bindex,
size_t n) const
{
if (n == 0) return;
void* aptr = a.getDataArray (auxid);
void* bptr = &a == &b ? aptr : b.getDataArray (auxid);
m_type.swapRange (aptr, aindex, bptr, bindex, n);
......@@ -603,6 +605,7 @@ void RootAuxVectorFactory::clear (SG::auxid_t auxid,
AuxVectorData& dst, size_t dst_index,
size_t n) const
{
if (n == 0) return;
m_type.clearRange (dst.getDataArray (auxid), dst_index, n);
}
......
// Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
// Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
// ROOT include(s):
#include <TClass.h>
......@@ -78,6 +78,8 @@ namespace xAOD {
const SG::AuxVectorData& src, size_t src_index,
size_t n ) const {
if (n == 0) return;
// The size of one element in memory:
const size_t eltsz = m_proxy->GetIncrement();
......@@ -137,6 +139,8 @@ namespace xAOD {
SG::AuxVectorData& b, size_t bindex,
size_t n ) const {
if (n == 0) return;
// The size of one element in memory:
const size_t eltsz = m_proxy->GetIncrement();
......@@ -192,6 +196,8 @@ namespace xAOD {
size_t dst_index,
size_t n ) const {
if (n == 0) return;
// The size of one element in memory:
const size_t eltsz = m_proxy->GetIncrement();
......
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