Skip to content
Snippets Groups Projects
Commit 58cc1bfd authored by Nils Krumnack's avatar Nils Krumnack
Browse files

fix duplicate definition error in ParticleJetTools/CopyTruthJetParticles.h

Hopefully very straightforward: If/When the header gets included more
than once then there are multiple definitions.  Making it a local
static variable should fix that.  This also avoids the awkwardness of
having a global variable named `metaDataFlag`, which seems like a
really bad name for a global variable.
parent 73ca7e17
No related branches found
No related tags found
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!40750fix duplicate definition error in ParticleJetTools/CopyTruthJetParticles.h
......@@ -14,11 +14,6 @@
#include <vector>
#include <map>
#include <mutex> // std::call_once, std::once_flag
std::once_flag metaDataFlag;
class CopyTruthJetParticles : public CopyTruthParticles {
ASG_TOOL_CLASS2(CopyTruthJetParticles, CopyTruthParticles, IJetExecuteTool)
public:
......
......@@ -15,6 +15,8 @@
#include "AsgDataHandles/WriteHandle.h"
#include "AsgMessaging/Check.h"
#include <mutex> // std::call_once, std::once_flag
#ifndef XAOD_STANDALONE
// Usage of metadata is for now only possible in Athena...
//#include "CoralBase/AttributeListException.h"
......@@ -256,6 +258,7 @@ int CopyTruthJetParticles::execute() const {
// std::call_once(metaDataFlag,&CopyTruthJetParticles::basicMetaDataCheck,this,barcodeOffset);
// this call happens only once and it modifies m_barcodeOffset
// Note that catching the return value of this is rather complicated, so it throws rather than returning errors
static std::once_flag metaDataFlag;
std::call_once(metaDataFlag,&CopyTruthJetParticles::setBarCodeFromMetaDataCheck, this);
std::vector<const xAOD::TruthParticle*> promptLeptons;
......
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