Skip to content
Snippets Groups Projects
Commit 320edb6a authored by Duc Ta's avatar Duc Ta
Browse files

Merge branch 'main-coverity-ZDC_SimEvent' into '24.0'

24.0-coverity-ZDC_SimEvent

See merge request atlas/athena!69135
parents a37e95c5 53ce6976
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
// Class header
......@@ -169,7 +169,7 @@ void ZDC_FiberSD::EndOfAthenaEvent()
m_HitColl = std::make_unique<ZDC_SimFiberHit_Collection>(m_HitColl.name());
for(auto hit : m_hitMap){
m_HitColl->Emplace(hit.second);
m_HitColl->Emplace(*(hit.second));
}
......
/*
Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ZDC_SD_ZDC_FIBER_SD_H
......@@ -14,6 +14,7 @@
// STL header
#include <string>
#include <map>
#include <gtest/gtest_prod.h>
// G4 needed classes
......
......@@ -40,15 +40,11 @@ class ZDC_SimFiberHit
{
}
/**
* @brief Copy constructor
*/
ZDC_SimFiberHit(const ZDC_SimFiberHit *right) : ZDC_SimFiberHit(*right){};
Identifier getID () const { return m_ID; }
double getEdep () const { return m_Edep; }
int getNPhotons() const { return m_Nphotons; }
/**
* @brief Assignment operator
*/
......@@ -110,17 +106,11 @@ class ZDC_SimFiberHit
m_Edep += h.m_Edep;
}
void Add(ZDC_SimFiberHit *h){
Add(*h);
}
bool Equals(const ZDC_SimFiberHit& h) const {
return (m_ID == h.m_ID);
};
bool Equals(const ZDC_SimFiberHit* h) const {
return Equals (*h);
}
private:
......
......@@ -284,13 +284,13 @@ void ZDC_PileUpTool::addEmptyWaveforms(xAOD::ZdcModuleContainer *zdcModuleContai
for(int mod = 0; mod < 4; mod++){
if(!zdcFound[side][mod]){
ATH_MSG_DEBUG("ZDC_PileUpTool::addEmptyWaveforms Creating empty waveform for ZDC side " << side << " module " << mod);
createAndStoreWaveform(new ZDC_SimFiberHit( m_ZdcID->channel_id(side, mod, ZdcIDType::SINGLECHANNEL, 0), 0, 0), rndEngine, zdcModuleContainer);
createAndStoreWaveform(ZDC_SimFiberHit( m_ZdcID->channel_id(side, mod, ZdcIDType::SINGLECHANNEL, 0), 0, 0), rndEngine, zdcModuleContainer);
}
}
for(int channel = 0; channel < 16; channel++){
if(!rpdFound[side][channel] && m_doRPD){
ATH_MSG_DEBUG("ZDC_PileUpTool::addEmptyWaveforms Creating empty waveform for RPD side " << side << " channel " << channel);
createAndStoreWaveform(new ZDC_SimFiberHit( m_ZdcID->channel_id(side, 4, ZdcIDType::MULTICHANNEL, channel), 0, 0), rndEngine, zdcModuleContainer);
createAndStoreWaveform(ZDC_SimFiberHit( m_ZdcID->channel_id(side, 4, ZdcIDType::MULTICHANNEL, channel), 0, 0), rndEngine, zdcModuleContainer);
}
}
}
......@@ -333,7 +333,7 @@ TimedHitCollection<ZDC_SimFiberHit> ZDC_PileUpTool::doZDClightGuideCuts(const ZD
//Make sure the hit exists before attempting to insert it
//If it doesn't we will take care of this module in addEmptyWaveforms
if(newHits[side][module]){
newCollection->Insert(newHits[side][module]);
newCollection->Insert(*(newHits[side][module]));
}
}
}
......
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