Skip to content
Snippets Groups Projects
Commit d98347bc authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Merge branch 'xAODCutFlow_THREAD_CHECKER' into 'master'

xAODCutFlow Thread safety checker 1st pass

See merge request atlas/athena!21204
parents a7e3e835 0ba2aa41
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
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
......@@ -34,7 +34,7 @@ namespace {
unsigned int UtilsHash( const std::string& name ) {
// The helper object:
static HASH_NS::hash< std::string > helper;
static const HASH_NS::hash< std::string > helper;
// Let the helper do the work:
return helper( name );
}
......@@ -52,22 +52,22 @@ namespace xAOD {
// All the static accessors for the auxiliary store
// ======================================================================
static SG::AuxElement::Accessor< unsigned int > nameIdentifierAcc( "nameIdentifier" );
static SG::AuxElement::Accessor< unsigned int > uniqueIdentifierAcc( "uniqueIdentifier" );
static SG::AuxElement::Accessor< std::string > nameAcc( "name" );
static SG::AuxElement::Accessor< std::string > descriptionAcc( "description" );
static SG::AuxElement::Accessor< unsigned int > cutLogicAcc( "cutLogic" );
static SG::AuxElement::Accessor< int > isTopFilterAcc( "isTopFilter" );
static SG::AuxElement::Accessor< int > cycleAcc( "cycle" );
static SG::AuxElement::Accessor< std::string > inputStreamAcc( "inputStream" );
static SG::AuxElement::Accessor< std::vector< std::string > > outputStreamsAcc( "outputStreams" );
static SG::AuxElement::Accessor< xAOD::CutBookkeeperLink_t > parentLinkAcc( "parentLink" );
static SG::AuxElement::Accessor< xAOD::CutBookkeeperLinks_t > childrenLinksAcc( "childrenLinks" );
static SG::AuxElement::Accessor< xAOD::CutBookkeeperLinks_t > othersLinksAcc( "othersLinks" );
static SG::AuxElement::Accessor< xAOD::CutBookkeeperLinks_t > siblingsLinksAcc( "siblingsLinks" );
static SG::AuxElement::Accessor< uint64_t > nAcceptedEventsAcc( "nAcceptedEvents" );
static SG::AuxElement::Accessor< double > sumOfEventWeightsAcc( "sumOfEventWeights" );
static SG::AuxElement::Accessor< double > sumOfEventWeightsSquaredAcc( "sumOfEventWeightsSquared" );
static const SG::AuxElement::Accessor< unsigned int > nameIdentifierAcc( "nameIdentifier" );
static const SG::AuxElement::Accessor< unsigned int > uniqueIdentifierAcc( "uniqueIdentifier" );
static const SG::AuxElement::Accessor< std::string > nameAcc( "name" );
static const SG::AuxElement::Accessor< std::string > descriptionAcc( "description" );
static const SG::AuxElement::Accessor< unsigned int > cutLogicAcc( "cutLogic" );
static const SG::AuxElement::Accessor< int > isTopFilterAcc( "isTopFilter" );
static const SG::AuxElement::Accessor< int > cycleAcc( "cycle" );
static const SG::AuxElement::Accessor< std::string > inputStreamAcc( "inputStream" );
static const SG::AuxElement::Accessor< std::vector< std::string > > outputStreamsAcc( "outputStreams" );
static const SG::AuxElement::Accessor< xAOD::CutBookkeeperLink_t > parentLinkAcc( "parentLink" );
static const SG::AuxElement::Accessor< xAOD::CutBookkeeperLinks_t > childrenLinksAcc( "childrenLinks" );
static const SG::AuxElement::Accessor< xAOD::CutBookkeeperLinks_t > othersLinksAcc( "othersLinks" );
static const SG::AuxElement::Accessor< xAOD::CutBookkeeperLinks_t > siblingsLinksAcc( "siblingsLinks" );
static const SG::AuxElement::Accessor< uint64_t > nAcceptedEventsAcc( "nAcceptedEvents" );
static const SG::AuxElement::Accessor< double > sumOfEventWeightsAcc( "sumOfEventWeights" );
static const SG::AuxElement::Accessor< double > sumOfEventWeightsSquaredAcc( "sumOfEventWeightsSquared" );
// ======================================================================
......@@ -213,7 +213,7 @@ namespace xAOD {
}
void CutBookkeeper_v1::setCycle(int cycle) {
static SG::AuxElement::Accessor< int > cycleAcc( "cycle" );
static const SG::AuxElement::Accessor< int > cycleAcc( "cycle" );
cycleAcc(*this) = cycle;
std::ostringstream str;
str << name() << inputStream() << cycle;
......@@ -263,7 +263,7 @@ namespace xAOD {
}
void CutBookkeeper_v1::addOutputStreamForAllUsed( const std::string& outputstream ) {
void CutBookkeeper_v1::addOutputStreamForAllUsed ATLAS_NOT_THREAD_SAFE (const std::string& outputstream ) {
// First, add the output stream name for this one
this->addOutputStream(outputstream);
......
Event/xAOD/xAODCutFlow
......@@ -16,8 +16,7 @@
// Core include(s):
#include "AthContainers/AuxElement.h"
#include "CxxUtils/checker_macros.h"
namespace xAOD {
/// Description of the class that is used to keep track of event counts.
......@@ -139,7 +138,7 @@ namespace xAOD {
/// Add the name of an output-file stream object for this CutBookkeeper
void addOutputStream( const std::string& outputstream );
/// Add the name of an output-file stream object for this CutBookkeeper
void addOutputStreamForAllUsed( const std::string& outputstream );
void addOutputStreamForAllUsed ATLAS_NOT_THREAD_SAFE ( const std::string& outputstream );
/// Set the names of the output-file stream objects for this CutBookkeeper
void setOutputStreams( const std::vector<std::string>& outputstreams );
......
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