Skip to content
Snippets Groups Projects
Commit fa05805b authored by Walter Lampl's avatar Walter Lampl Committed by Graeme Stewart
Browse files

customize shallow-copy of CaloClusterContainer (xAODCaloEvent-00-01-26)

	* CaloCluster.h: Add overloaed function xAOD::prepareElementForShallowCopy
	  to shallow-copy cluster containers preserving the m_samplingPattern member
	  (ATLASRECTS-3372)
	*  Tag xAODCaloEvent-00-01-26
2016-06-07  scott snyder  <snyder@bnl.gov>

	* Tagging xAODCaloEvent-00-01-25.
	* xAODCaloEvent/versions/CaloCluster_v1.h: Coverity 105538:
	Ignored return value.


Former-commit-id: ab7918b7de91338803a9a44620ac2bbad1475233
parent 6265a987
No related branches found
No related tags found
No related merge requests found
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#include "xAODCaloEvent/CaloCluster.h"
std::unique_ptr<xAOD::CaloCluster> xAOD::prepareElementForShallowCopy(const xAOD::CaloCluster* orgCluster) {
//std::cout << "Executing overloaded version of prepareElementForShallowCopy" << std::endl;
std::unique_ptr<xAOD::CaloCluster> newCluster(new CaloCluster());
newCluster->setSamplingPattern(orgCluster->samplingPattern(),false);
return newCluster;
}
......@@ -4,10 +4,12 @@
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: CaloCluster.h 628097 2014-11-13 09:24:54Z krasznaa $
// $Id: CaloCluster.h 766396 2016-08-04 11:31:11Z wlampl $
#ifndef XAODCALOEVENT_CALOCLUSTER_H
#define XAODCALOEVENT_CALOCLUSTER_H
#include <memory>
// Local include(s):
#include "xAODCaloEvent/versions/CaloCluster_v1.h"
......@@ -15,6 +17,12 @@
namespace xAOD {
/// Define the latest version of the calorimeter cluster class
typedef CaloCluster_v1 CaloCluster;
//Overloaded function to allow shallow-copying CaloClusters, perserving the sampling pattern
//See also xAODCore/ShallowCopy.h
std::unique_ptr<CaloCluster> prepareElementForShallowCopy(const CaloCluster* orgCluster);
}
// Set up a CLID for the object:
......
......@@ -4,7 +4,7 @@
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: CaloCluster_v1.h 749805 2016-05-26 08:03:45Z wlampl $
// $Id: CaloCluster_v1.h 753412 2016-06-07 16:25:07Z ssnyder $
#ifndef XAODCALOEVENT_VERSIONS_CALOCLUSTER_V1_H
#define XAODCALOEVENT_VERSIONS_CALOCLUSTER_V1_H
......@@ -44,8 +44,8 @@ namespace xAOD {
/// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch>
/// @author Walter Lampl <Walter.Lampl@cern.ch>
///
/// $Revision: 749805 $
/// $Date: 2016-05-26 10:03:45 +0200 (Thu, 26 May 2016) $
/// $Revision: 753412 $
/// $Date: 2016-06-07 18:25:07 +0200 (Tue, 07 Jun 2016) $
///
class CaloCluster_v1 : public IParticle {
friend class ::CaloClusterChangeSignalState;
......@@ -734,7 +734,7 @@ namespace xAOD {
inline double CaloCluster_v1::getMomentValue( CaloCluster_v1::MomentType type) const {
double value=-999;
this->retrieveMoment(type,value);
(void)this->retrieveMoment(type,value);
return value;
}
......
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