diff --git a/Event/xAOD/xAODBPhys/Root/BPhysHelper.cxx b/Event/xAOD/xAODBPhys/Root/BPhysHelper.cxx index 8add2398cebcaad6b617ebe77806b610e622a32b..77b7a1cba7c8270082ca1c1c70ad5504dc6aaa1f 100644 --- a/Event/xAOD/xAODBPhys/Root/BPhysHelper.cxx +++ b/Event/xAOD/xAODBPhys/Root/BPhysHelper.cxx @@ -32,7 +32,7 @@ typedef std::vector<MuonLink> MuonLinkVector; /*****************************************************************************/ #define GET_PV( name ) \ { \ - static SG::AuxElement::Accessor<VertexLink> pvLinkAcc(name); \ + static const SG::AuxElement::Accessor<VertexLink> pvLinkAcc(name); \ if(!pvLinkAcc.isAvailable(*m_b)) { \ return 0; \ } \ @@ -45,7 +45,7 @@ typedef std::vector<MuonLink> MuonLinkVector; /*****************************************************************************/ #define SET_PV( name, pv, vertexContainer ) \ { \ - static SG::AuxElement::Decorator<VertexLink> pvLinkDecor(name); \ + static const SG::AuxElement::Decorator<VertexLink> pvLinkDecor(name); \ VertexLink vertexLink; \ if(pv) { \ vertexLink.setElement(pv); \ @@ -58,28 +58,28 @@ typedef std::vector<MuonLink> MuonLinkVector; /*****************************************************************************/ #define GET_FLOAT(name) \ { \ - static SG::AuxElement::Accessor<float> floatAcc(name); \ + static const SG::AuxElement::Accessor<float> floatAcc(name); \ if(!floatAcc.isAvailable(*m_b)) return -9999999.; \ return floatAcc(*m_b); \ } /*****************************************************************************/ #define SET_FLOAT( name, val) \ { \ - static SG::AuxElement::Decorator<float> floatDec(name); \ + static const SG::AuxElement::Decorator<float> floatDec(name); \ floatDec(*m_b) = val; \ return true; \ } /*****************************************************************************/ #define GET_INT(name) \ { \ - static SG::AuxElement::Accessor<int> intAcc(name); \ + static const SG::AuxElement::Accessor<int> intAcc(name); \ if(!intAcc.isAvailable(*m_b)) return -9999999; \ return intAcc(*m_b); \ } /*****************************************************************************/ #define SET_INT( name, val) \ { \ - static SG::AuxElement::Decorator<int> intDec(name); \ + static const SG::AuxElement::Decorator<int> intDec(name); \ intDec(*m_b) = val; \ return true; \ } @@ -284,9 +284,9 @@ bool xAOD::BPhysHelper::setRefTrks(const std::vector<float>& px, m_cachedRefTracks.clear(); // create decorators - static SG::AuxElement::Decorator< std::vector<float> > refTrackPxDeco("RefTrackPx"); - static SG::AuxElement::Decorator< std::vector<float> > refTrackPyDeco("RefTrackPy"); - static SG::AuxElement::Decorator< std::vector<float> > refTrackPzDeco("RefTrackPz"); + static const SG::AuxElement::Decorator< std::vector<float> > refTrackPxDeco("RefTrackPx"); + static const SG::AuxElement::Decorator< std::vector<float> > refTrackPyDeco("RefTrackPy"); + static const SG::AuxElement::Decorator< std::vector<float> > refTrackPzDeco("RefTrackPz"); // store the elements: refTrackPxDeco(*m_b) = px; @@ -466,7 +466,7 @@ bool xAOD::BPhysHelper::setMuons(const std::vector<const xAOD::Muon*>& muons, m_cachedMuons.clear(); // Create muon links decorator - static SG::AuxElement::Decorator<MuonLinkVector> muonLinksDecor("MuonLinks"); + static const SG::AuxElement::Decorator<MuonLinkVector> muonLinksDecor("MuonLinks"); // create tmp vector of muon links MuonLinkVector muonLinks; @@ -548,7 +548,7 @@ bool xAOD::BPhysHelper::setPrecedingVertices(const std::vector<const xAOD::Verte m_cachedPrecedingVertices.clear(); // Create preceding vertex links decorator - static SG::AuxElement::Decorator<VertexLinkVector> precedingVertexLinksDecor("PrecedingVertexLinks"); + static const SG::AuxElement::Decorator<VertexLinkVector> precedingVertexLinksDecor("PrecedingVertexLinks"); // create tmp vector of preceding vertex links VertexLinkVector precedingVertexLinks; @@ -629,7 +629,7 @@ bool xAOD::BPhysHelper::setCascadeVertices(const std::vector<const xAOD::Vertex* m_cachedCascadeVertices.clear(); // Create cascade vertex links decorator - static SG::AuxElement::Decorator<VertexLinkVector> cascadeVertexLinksDecor("CascadeVertexLinks"); + static const SG::AuxElement::Decorator<VertexLinkVector> cascadeVertexLinksDecor("CascadeVertexLinks"); // create tmp vector of cascade vertex links VertexLinkVector cascadeVertexLinks; @@ -982,9 +982,9 @@ bool xAOD::BPhysHelper::cacheRefTracks() m_cachedRefTracks.clear(); // Create auxiliary branches accessors - static SG::AuxElement::Accessor< std::vector<float> > refTrackPxAcc("RefTrackPx"); - static SG::AuxElement::Accessor< std::vector<float> > refTrackPyAcc("RefTrackPy"); - static SG::AuxElement::Accessor< std::vector<float> > refTrackPzAcc("RefTrackPz"); + static const SG::AuxElement::Accessor< std::vector<float> > refTrackPxAcc("RefTrackPx"); + static const SG::AuxElement::Accessor< std::vector<float> > refTrackPyAcc("RefTrackPy"); + static const SG::AuxElement::Accessor< std::vector<float> > refTrackPzAcc("RefTrackPz"); // check if branches are available: if(!refTrackPxAcc.isAvailable(*m_b) || @@ -1026,7 +1026,7 @@ bool xAOD::BPhysHelper::cacheMuons() m_cachedMuons.clear(); // Create auxiliary branches accessors - static SG::AuxElement::Accessor<MuonLinkVector> muonLinksAcc("MuonLinks"); + static const SG::AuxElement::Accessor<MuonLinkVector> muonLinksAcc("MuonLinks"); // check if branch exists if(!muonLinksAcc.isAvailable(*m_b)) { @@ -1071,7 +1071,7 @@ bool xAOD::BPhysHelper::cachePrecedingVertices() m_cachedPrecedingVertices.clear(); // Create auxiliary branches accessors - static SG::AuxElement::Accessor<VertexLinkVector> precedingVertexLinksAcc("PrecedingVertexLinks"); + static const SG::AuxElement::Accessor<VertexLinkVector> precedingVertexLinksAcc("PrecedingVertexLinks"); // check if branch exists if(!precedingVertexLinksAcc.isAvailable(*m_b)) { @@ -1116,7 +1116,7 @@ bool xAOD::BPhysHelper::cacheCascadeVertices() m_cachedCascadeVertices.clear(); // Create auxiliary branches accessors - static SG::AuxElement::Accessor<VertexLinkVector> cascadeVertexLinksAcc("CascadeVertexLinks"); + static const SG::AuxElement::Accessor<VertexLinkVector> cascadeVertexLinksAcc("CascadeVertexLinks"); // check if branch exists if(!cascadeVertexLinksAcc.isAvailable(*m_b)) { diff --git a/Event/xAOD/xAODBPhys/xAODBPhys/ATLAS_CHECK_THREAD_SAFETY b/Event/xAOD/xAODBPhys/xAODBPhys/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..76a491e9f118a3ec04656ab100f3581a08ceb3f5 --- /dev/null +++ b/Event/xAOD/xAODBPhys/xAODBPhys/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Event/xAOD/xAODBPhys diff --git a/Event/xAOD/xAODBTagging/CMakeLists.txt b/Event/xAOD/xAODBTagging/CMakeLists.txt index 7716fad847c1e4243d94d3e9b7e8d22e3c7114cd..4e166259db4799962bf4d5ba73784c51462a906f 100644 --- a/Event/xAOD/xAODBTagging/CMakeLists.txt +++ b/Event/xAOD/xAODBTagging/CMakeLists.txt @@ -13,13 +13,14 @@ atlas_depends_on_subdirs( Event/xAOD/xAODBase Event/xAOD/xAODCore Event/xAOD/xAODTracking - Control/AthLinks ) + Control/AthLinks + Control/CxxUtils) # Component(s) in the package: atlas_add_library( xAODBTagging xAODBTagging/*.h xAODBTagging/versions/*.h Root/*.cxx PUBLIC_HEADERS xAODBTagging - LINK_LIBRARIES AthContainers AthLinks xAODBase xAODCore xAODTracking ) + LINK_LIBRARIES AthContainers AthLinks xAODBase xAODCore xAODTracking CxxUtils) atlas_add_dictionary( xAODBTaggingDict xAODBTagging/xAODBTaggingDict.h diff --git a/Event/xAOD/xAODBTagging/Root/BTagVertexAccessors_v1.h b/Event/xAOD/xAODBTagging/Root/BTagVertexAccessors_v1.h index 1376af944079e85fc3c35fe84f5249efabd130de..0f90a1a6af6ab38764d5b2bf5af12f4269d857d5 100644 --- a/Event/xAOD/xAODBTagging/Root/BTagVertexAccessors_v1.h +++ b/Event/xAOD/xAODBTagging/Root/BTagVertexAccessors_v1.h @@ -4,7 +4,6 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: BTaggingAccessors_v1.h 584372 2014-02-20 10:51:12Z jerdmann $ #ifndef XAOD_BTAGGINGACCESSORS_V1_H #define XAOD_BTAGGINGACCESSORS_V1_H diff --git a/Event/xAOD/xAODBTagging/Root/BTagVertex_v1.cxx b/Event/xAOD/xAODBTagging/Root/BTagVertex_v1.cxx index d46cf323157c252e5956398717ead8ec6352fdc3..112feb312bbf52dfe3357fccfdbdd7cc9ac514e4 100644 --- a/Event/xAOD/xAODBTagging/Root/BTagVertex_v1.cxx +++ b/Event/xAOD/xAODBTagging/Root/BTagVertex_v1.cxx @@ -23,18 +23,7 @@ namespace xAOD { AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( BTagVertex_v1, float, pv_compatibility, setPV_compatibility ) AUXSTORE_OBJECT_SETTER_AND_GETTER( BTagVertex_v1, std::vector<float>, compToOtherSV, setCompToOtherSV) - /*static SG::AuxElement::Accessor< std::vector< ElementLink< xAOD::BTagVertexContainer > > >reco_vertexLinkAcc( "reco_vertexLink" ); - - const std::vector<ElementLink<xAOD::BTagVertexContainer> >& BTagVertex_v1::reco_vertexLink() const { - return reco_vertexLinkAcc( *this ); - } - - void BTagVertex_v1::setReco_vertexLink(const std::vector<ElementLink<xAOD::BTagVertexContainer> >& value) { - reco_vertexLinkAcc( *this ) = value; - return; - }*/ - - + // Implementation of accessors for the constituent tracks AUXSTORE_OBJECT_SETTER_AND_GETTER( BTagVertex_v1, std::vector<float>, track_chi2, setTrack_chi2) @@ -43,7 +32,7 @@ namespace xAOD { AUXSTORE_OBJECT_SETTER_AND_GETTER( BTagVertex_v1, std::vector<float>, track_refPy, setTrack_refPy) AUXSTORE_OBJECT_SETTER_AND_GETTER( BTagVertex_v1, std::vector<float>, track_refPz, setTrack_refPz) - static SG::AuxElement::Accessor<std::vector< ElementLink< xAOD::TrackParticleContainer > > > track_linkAcc( "track_links" ); + static const SG::AuxElement::Accessor<std::vector< ElementLink< xAOD::TrackParticleContainer > > > track_linkAcc( "track_links" ); const std::vector<ElementLink<xAOD::TrackParticleContainer> >& BTagVertex_v1::track_links() const { return track_linkAcc( *this ); diff --git a/Event/xAOD/xAODBTagging/Root/BTaggingAccessors_v1.cxx b/Event/xAOD/xAODBTagging/Root/BTaggingAccessors_v1.cxx index 75a331718555f9e2bd6c789e1298c374ae450e14..589f3adaf31a2e39a0e847d44ccb66a06bfdcd5b 100644 --- a/Event/xAOD/xAODBTagging/Root/BTaggingAccessors_v1.cxx +++ b/Event/xAOD/xAODBTagging/Root/BTaggingAccessors_v1.cxx @@ -15,14 +15,14 @@ #define DEFINE_ACCESSOR(TYPE, NAME ) \ case xAOD::NAME: \ { \ - static SG::AuxElement::Accessor< TYPE > a( #NAME ); \ + static const SG::AuxElement::Accessor< TYPE > a( #NAME ); \ return &a; \ } \ break; namespace xAOD { - SG::AuxElement::Accessor< int >* taggerInfoAccessorV1int(BTagInfo info ) + const SG::AuxElement::Accessor< int >* taggerInfoAccessorV1int(BTagInfo info ) { switch( info ) { DEFINE_ACCESSOR( int, SV0_NGTinJet ); @@ -44,7 +44,7 @@ namespace xAOD { } } - SG::AuxElement::Accessor< float >* taggerInfoAccessorV1float(BTagInfo info ) + const SG::AuxElement::Accessor< float >* taggerInfoAccessorV1float(BTagInfo info ) { switch( info ) { DEFINE_ACCESSOR( float, SV0_masssvx ); @@ -65,7 +65,7 @@ namespace xAOD { } } - SG::AuxElement::Accessor< uint8_t >* taggerInfoAccessorV1uint8_t(BTagInfo info ) + const SG::AuxElement::Accessor< uint8_t >* taggerInfoAccessorV1uint8_t(BTagInfo info ) { switch( info ) { //DEFINE_ACCESSOR( uint8_t, IP2D_isFromV0 ); @@ -77,7 +77,7 @@ namespace xAOD { } } - SG::AuxElement::Accessor< std::string >* taggerInfoAccessorV1string(BTagInfo info ) + const SG::AuxElement::Accessor< std::string >* taggerInfoAccessorV1string(BTagInfo info ) { switch( info ) { //DEFINE_ACCESSOR( std::string, IP2D_gradeName ); @@ -89,7 +89,7 @@ namespace xAOD { } } - SG::AuxElement::Accessor< std::vector<int> >* taggerInfoAccessorV1vectorOfInts(BTagInfo info ) + const SG::AuxElement::Accessor< std::vector<int> >* taggerInfoAccessorV1vectorOfInts(BTagInfo info ) { switch( info ) { DEFINE_ACCESSOR( std::vector<int>, IP2D_gradeOfTracks ); @@ -101,7 +101,7 @@ namespace xAOD { } } - SG::AuxElement::Accessor< std::vector<float> >* taggerInfoAccessorV1vectorOfFloats(BTagInfo info ) + const SG::AuxElement::Accessor< std::vector<float> >* taggerInfoAccessorV1vectorOfFloats(BTagInfo info ) { switch( info ) { DEFINE_ACCESSOR( std::vector<float>, IP3D_valD0wrtPVofTracks ); @@ -123,7 +123,7 @@ namespace xAOD { } } - SG::AuxElement::Accessor< std::vector<bool> >* taggerInfoAccessorV1vectorOfBools(BTagInfo info ) + const SG::AuxElement::Accessor< std::vector<bool> >* taggerInfoAccessorV1vectorOfBools(BTagInfo info ) { switch( info ) { DEFINE_ACCESSOR( std::vector<bool>, IP3D_flagFromV0ofTracks ); diff --git a/Event/xAOD/xAODBTagging/Root/BTaggingAccessors_v1.h b/Event/xAOD/xAODBTagging/Root/BTaggingAccessors_v1.h index 6a157c2f60b943ca8234cda192a74d6683b0dbe0..434b93d611e92bf34cf39c8cc688fa98a15814bb 100644 --- a/Event/xAOD/xAODBTagging/Root/BTaggingAccessors_v1.h +++ b/Event/xAOD/xAODBTagging/Root/BTaggingAccessors_v1.h @@ -24,13 +24,13 @@ namespace xAOD { /// This function holds on to Accessor objects that can be used by each /// BTagging_v1 object at runtime to get/set detail values on themselves. - SG::AuxElement::Accessor< int >* taggerInfoAccessorV1int(BTagInfo info); - SG::AuxElement::Accessor< float >* taggerInfoAccessorV1float(BTagInfo info); - SG::AuxElement::Accessor< uint8_t >* taggerInfoAccessorV1uint8_t(BTagInfo info); - SG::AuxElement::Accessor< std::string >* taggerInfoAccessorV1string(BTagInfo info); - SG::AuxElement::Accessor< std::vector<int> >* taggerInfoAccessorV1vectorOfInts(BTagInfo info); - SG::AuxElement::Accessor< std::vector<float> >* taggerInfoAccessorV1vectorOfFloats(BTagInfo info); - SG::AuxElement::Accessor< std::vector<bool> >* taggerInfoAccessorV1vectorOfBools(BTagInfo info); + const SG::AuxElement::Accessor< int >* taggerInfoAccessorV1int(BTagInfo info); + const SG::AuxElement::Accessor< float >* taggerInfoAccessorV1float(BTagInfo info); + const SG::AuxElement::Accessor< uint8_t >* taggerInfoAccessorV1uint8_t(BTagInfo info); + const SG::AuxElement::Accessor< std::string >* taggerInfoAccessorV1string(BTagInfo info); + const SG::AuxElement::Accessor< std::vector<int> >* taggerInfoAccessorV1vectorOfInts(BTagInfo info); + const SG::AuxElement::Accessor< std::vector<float> >* taggerInfoAccessorV1vectorOfFloats(BTagInfo info); + const SG::AuxElement::Accessor< std::vector<bool> >* taggerInfoAccessorV1vectorOfBools(BTagInfo info); } // namespace xAOD diff --git a/Event/xAOD/xAODBTagging/Root/BTagging_v1.cxx b/Event/xAOD/xAODBTagging/Root/BTagging_v1.cxx index 4e8e0017117a424bfe1efe1deb8179e279da1089..a6e35bb23c6645e65e8a4c668df30ae537f03110 100644 --- a/Event/xAOD/xAODBTagging/Root/BTagging_v1.cxx +++ b/Event/xAOD/xAODBTagging/Root/BTagging_v1.cxx @@ -29,9 +29,9 @@ namespace xAOD { setSV0_significance3D ) // The accessor object(s): - static SG::AuxElement::Accessor< BTagging_v1::TPELVec_t > + static const SG::AuxElement::Accessor< BTagging_v1::TPELVec_t > sv0TPAcc1( "SV0_TrackParticles" ); - static SG::AuxElement::Accessor< BTagging_v1::TPELVec_t > + static const SG::AuxElement::Accessor< BTagging_v1::TPELVec_t > sv0TPAcc2( "SV0_TrackParticleLinks" ); const BTagging_v1::TPELVec_t& BTagging_v1::SV0_TrackParticleLinks() const { @@ -102,9 +102,9 @@ namespace xAOD { setSV1_pc ) // The accessor object(s): - static SG::AuxElement::Accessor< BTagging_v1::TPELVec_t > + static const SG::AuxElement::Accessor< BTagging_v1::TPELVec_t > sv1TPAcc1( "SV1_TrackParticles" ); - static SG::AuxElement::Accessor< BTagging_v1::TPELVec_t > + static const SG::AuxElement::Accessor< BTagging_v1::TPELVec_t > sv1TPAcc2( "SV1_TrackParticleLinks" ); const BTagging_v1::TPELVec_t& BTagging_v1::SV1_TrackParticleLinks() const { @@ -175,9 +175,9 @@ namespace xAOD { setIP2D_pc ) // The accessor object(s): - static SG::AuxElement::Accessor< BTagging_v1::TPELVec_t > + static const SG::AuxElement::Accessor< BTagging_v1::TPELVec_t > ip2dTPAcc1( "IP2D_TrackParticles" ); - static SG::AuxElement::Accessor< BTagging_v1::TPELVec_t > + static const SG::AuxElement::Accessor< BTagging_v1::TPELVec_t > ip2dTPAcc2( "IP2D_TrackParticleLinks" ); const BTagging_v1::TPELVec_t& BTagging_v1::IP2D_TrackParticleLinks() const { @@ -249,9 +249,9 @@ namespace xAOD { setIP3D_pc ) // The accessor object(s): - static SG::AuxElement::Accessor< BTagging_v1::TPELVec_t > + static const SG::AuxElement::Accessor< BTagging_v1::TPELVec_t > ip3dTPAcc1( "IP3D_TrackParticles" ); - static SG::AuxElement::Accessor< BTagging_v1::TPELVec_t > + static const SG::AuxElement::Accessor< BTagging_v1::TPELVec_t > ip3dTPAcc2( "IP3D_TrackParticleLinks" ); const BTagging_v1::TPELVec_t& BTagging_v1::IP3D_TrackParticleLinks() const { @@ -410,7 +410,7 @@ namespace xAOD { bool BTagging_v1::taggerInfo( int& value, const BTagInfo info ) const { - Accessor< int >* acc = taggerInfoAccessorV1int( info ); + const Accessor< int >* acc = taggerInfoAccessorV1int( info ); if( ! acc ) return false; if( ! acc->isAvailable( *this ) ) return false; value = ( *acc )( *this ); @@ -419,7 +419,7 @@ namespace xAOD { bool BTagging_v1::taggerInfo( float& value, const BTagInfo info) const { - Accessor< float >* acc = taggerInfoAccessorV1float( info ); + const Accessor< float >* acc = taggerInfoAccessorV1float( info ); if( ! acc ) return false; if( ! acc->isAvailable( *this ) ) return false; value = ( *acc )( *this ); @@ -428,7 +428,7 @@ namespace xAOD { bool BTagging_v1::taggerInfo( bool& value, const BTagInfo info ) const { - Accessor< uint8_t >* acc = taggerInfoAccessorV1uint8_t( info ); + const Accessor< uint8_t >* acc = taggerInfoAccessorV1uint8_t( info ); if( ! acc ) return false; if( ! acc->isAvailable( *this ) ) return false; value = ( *acc )( *this ); @@ -438,7 +438,7 @@ namespace xAOD { bool BTagging_v1::taggerInfo( std::string& value, const BTagInfo info ) const { - Accessor< std::string >* acc = taggerInfoAccessorV1string( info ); + const Accessor< std::string >* acc = taggerInfoAccessorV1string( info ); if( ! acc ) return false; if( ! acc->isAvailable( *this ) ) return false; value = ( *acc )( *this ); @@ -448,7 +448,7 @@ namespace xAOD { bool BTagging_v1::taggerInfo( std::vector<int>& value, const BTagInfo info ) const { - Accessor< std::vector<int> >* acc = taggerInfoAccessorV1vectorOfInts( info ); + const Accessor< std::vector<int> >* acc = taggerInfoAccessorV1vectorOfInts( info ); if( ! acc ) return false; if( ! acc->isAvailable( *this ) ) return false; value = ( *acc )( *this ); @@ -458,7 +458,7 @@ namespace xAOD { bool BTagging_v1::taggerInfo( std::vector<float>& value, const BTagInfo info ) const { - Accessor< std::vector<float> >* acc = taggerInfoAccessorV1vectorOfFloats( info ); + const Accessor< std::vector<float> >* acc = taggerInfoAccessorV1vectorOfFloats( info ); if( ! acc ) return false; if( ! acc->isAvailable( *this ) ) return false; value = ( *acc )( *this ); @@ -468,7 +468,7 @@ namespace xAOD { bool BTagging_v1::taggerInfo( std::vector<bool>& value, const BTagInfo info ) const { - Accessor< std::vector<bool> >* acc = taggerInfoAccessorV1vectorOfBools( info ); + const Accessor< std::vector<bool> >* acc = taggerInfoAccessorV1vectorOfBools( info ); if( ! acc ) return false; if( ! acc->isAvailable( *this ) ) return false; value = ( *acc )( *this ); @@ -477,7 +477,7 @@ namespace xAOD { void BTagging_v1::setTaggerInfo( int value, const BTagInfo info ) { - Accessor< int >* acc = taggerInfoAccessorV1int( info ); + const Accessor< int >* acc = taggerInfoAccessorV1int( info ); if( ! acc ) return; ( *acc )( *this ) = value; return; @@ -485,7 +485,7 @@ namespace xAOD { void BTagging_v1::setTaggerInfo( float value, const BTagInfo info ) { - Accessor< float >* acc = taggerInfoAccessorV1float( info ); + const Accessor< float >* acc = taggerInfoAccessorV1float( info ); if( ! acc ) return; ( *acc )( *this ) = value; return; @@ -493,7 +493,7 @@ namespace xAOD { void BTagging_v1::setTaggerInfo( bool value, const BTagInfo info ) { - Accessor< uint8_t >* acc = taggerInfoAccessorV1uint8_t( info ); + const Accessor< uint8_t >* acc = taggerInfoAccessorV1uint8_t( info ); if( ! acc ) return; ( *acc )( *this ) = uint8_t(value); return; @@ -502,7 +502,7 @@ namespace xAOD { void BTagging_v1::setTaggerInfo( const std::string& value, const BTagInfo info ) { - Accessor< std::string >* acc = taggerInfoAccessorV1string( info ); + const Accessor< std::string >* acc = taggerInfoAccessorV1string( info ); if( ! acc ) return; ( *acc )( *this ) = value; return; @@ -511,7 +511,7 @@ namespace xAOD { void BTagging_v1::setTaggerInfo( const std::vector<int>& value, const BTagInfo info ) { - Accessor< std::vector<int> >* acc = taggerInfoAccessorV1vectorOfInts( info ); + const Accessor< std::vector<int> >* acc = taggerInfoAccessorV1vectorOfInts( info ); if( ! acc ) return; ( *acc )( *this ) = value; return; @@ -520,7 +520,7 @@ namespace xAOD { void BTagging_v1::setTaggerInfo( const std::vector<float>& value, const BTagInfo info ) { - Accessor< std::vector<float> >* acc = taggerInfoAccessorV1vectorOfFloats( info ); + const Accessor< std::vector<float> >* acc = taggerInfoAccessorV1vectorOfFloats( info ); if( ! acc ) return; ( *acc )( *this ) = value; return; @@ -529,7 +529,7 @@ namespace xAOD { void BTagging_v1::setTaggerInfo( const std::vector<bool>& value, const BTagInfo info ) { - Accessor< std::vector<bool> >* acc = taggerInfoAccessorV1vectorOfBools( info ); + const Accessor< std::vector<bool> >* acc = taggerInfoAccessorV1vectorOfBools( info ); if( ! acc ) return; ( *acc )( *this ) = value; return; @@ -543,7 +543,7 @@ namespace xAOD { static std::map<std::string, SG::AuxElement::Accessor<BTagging_v1::VxELVec_t> > DynVxELVec; static std::map<std::string, SG::AuxElement::Accessor<BTagging_v1::BTagVxELVec_t> > DynBTagVxELVec; - void BTagging_v1::toPersistent() { + void BTagging_v1::toPersistent ATLAS_NOT_REENTRANT () { TPELVec_t::iterator itr; TPELVec_t::iterator end; @@ -584,14 +584,13 @@ namespace xAOD { for(; dyniter != DynTPELVec.end(); ++dyniter){ - if( dyniter->second.isAvailableWritable( *this ) ) { - itr = dyniter->second( *this ).begin(); - end = dyniter->second( *this ).end(); - for( ; itr != end; ++itr ) { + if( dyniter->second.isAvailableWritable( *this ) ) { + itr = dyniter->second( *this ).begin(); + end = dyniter->second( *this ).end(); + for( ; itr != end; ++itr ) { itr->toPersistent(); - } - } - + } + } } @@ -602,14 +601,13 @@ namespace xAOD { for(; dynvxiter != DynVxELVec.end(); ++dynvxiter){ - if( dynvxiter->second.isAvailableWritable( *this ) ) { - vxitr = dynvxiter->second( *this ).begin(); - vxend = dynvxiter->second( *this ).end(); - for( ; vxitr != vxend; ++vxitr ) { + if( dynvxiter->second.isAvailableWritable( *this ) ) { + vxitr = dynvxiter->second( *this ).begin(); + vxend = dynvxiter->second( *this ).end(); + for( ; vxitr != vxend; ++vxitr ) { vxitr->toPersistent(); - } - } - + } + } } BTagVxELVec_t::iterator btagvxitr; @@ -619,46 +617,43 @@ namespace xAOD { for(; dynbtagvxiter != DynBTagVxELVec.end(); ++dynbtagvxiter){ - if( dynbtagvxiter->second.isAvailableWritable( *this ) ) { - btagvxitr = dynbtagvxiter->second( *this ).begin(); - btagvxend = dynbtagvxiter->second( *this ).end(); - for( ; btagvxitr != btagvxend; ++btagvxitr ) { + if( dynbtagvxiter->second.isAvailableWritable( *this ) ) { + btagvxitr = dynbtagvxiter->second( *this ).begin(); + btagvxend = dynbtagvxiter->second( *this ).end(); + for( ; btagvxitr != btagvxend; ++btagvxitr ) { btagvxitr->toPersistent(); - } - } - + } + } } - - return; } - void BTagging_v1::setDynTPELName( const std::string &taggername, + void BTagging_v1::setDynTPELName ATLAS_NOT_REENTRANT ( const std::string &taggername, const std::string &variablename) { std::string varname = taggername+ "_" + variablename; - Accessor< TPELVec_t > acc( varname ); + const Accessor< TPELVec_t > acc( varname ); DynTPELVec.insert(std::make_pair(varname,acc)); return; } - void BTagging_v1::setDynVxELName( const std::string &taggername, + void BTagging_v1::setDynVxELName ATLAS_NOT_REENTRANT ( const std::string &taggername, const std::string &variablename) { std::string varname = taggername+ "_" + variablename; - Accessor< VxELVec_t > acc( varname ); + const Accessor< VxELVec_t > acc( varname ); DynVxELVec.insert(std::make_pair(varname,acc)); return; } - void BTagging_v1::setDynBTagVxELName( const std::string &taggername, + void BTagging_v1::setDynBTagVxELName ATLAS_NOT_REENTRANT ( const std::string &taggername, const std::string &variablename) { std::string varname = taggername+ "_" + variablename; - Accessor< BTagVxELVec_t > acc( varname ); + const Accessor< BTagVxELVec_t > acc( varname ); DynBTagVxELVec.insert(std::make_pair(varname,acc)); return; } diff --git a/Event/xAOD/xAODBTagging/Root/SecVtxHelper.cxx b/Event/xAOD/xAODBTagging/Root/SecVtxHelper.cxx index d1ad5b50511485dddf6a68dc14d2c067c8990de0..b611cfbd3376e0c0eea45ae0df228c1b1873e887 100644 --- a/Event/xAOD/xAODBTagging/Root/SecVtxHelper.cxx +++ b/Event/xAOD/xAODBTagging/Root/SecVtxHelper.cxx @@ -7,7 +7,7 @@ // get variable mass float xAOD::SecVtxHelper::VertexMass(const xAOD::Vertex* vtx){ - static SG::AuxElement::Accessor<float> a("mass"); + static const SG::AuxElement::Accessor<float> a("mass"); if(!a.isAvailable(*vtx)){ std::cout << "ERROR: Failed to get mass" << std::endl; return 0; @@ -16,13 +16,13 @@ } // set variable mass void xAOD::SecVtxHelper::setVertexMass(xAOD::Vertex * vtx, float val){ - static SG::AuxElement::Accessor<float> a("mass"); + static const SG::AuxElement::Accessor<float> a("mass"); a(*vtx)=val; } // get variable energyFraction float xAOD::SecVtxHelper::EnergyFraction(const xAOD::Vertex* vtx){ - static SG::AuxElement::Accessor<float> a("energyFraction"); + static const SG::AuxElement::Accessor<float> a("energyFraction"); if(!a.isAvailable(*vtx)){ std::cout << "ERROR: Failed to get energyFraction" << std::endl; return 0; @@ -31,13 +31,13 @@ } // set variable energyFraction void xAOD::SecVtxHelper::setEnergyFraction(xAOD::Vertex * vtx, float val){ - static SG::AuxElement::Accessor<float> a("energyFraction"); + static const SG::AuxElement::Accessor<float> a("energyFraction"); a(*vtx)=val; } // int xAOD::SecVtxHelper::VtxNtrk(const xAOD::Vertex* vtx){ - static SG::AuxElement::Accessor<int> a("ntrk"); + static const SG::AuxElement::Accessor<int> a("ntrk"); if(!a.isAvailable(*vtx)){ std::cout << "ERROR: Failed to get ntrk" << std::endl; return 0; @@ -46,12 +46,12 @@ } // void xAOD::SecVtxHelper::setVtxNtrk(xAOD::Vertex * vtx, int val){ - static SG::AuxElement::Accessor<int> a("ntrk"); + static const SG::AuxElement::Accessor<int> a("ntrk"); a(*vtx)=val; } // float xAOD::SecVtxHelper::Vtxpt(const xAOD::Vertex* vtx){ - static SG::AuxElement::Accessor<float> a("pt"); + static const SG::AuxElement::Accessor<float> a("pt"); if(!a.isAvailable(*vtx)){ std::cout << "ERROR: Failed to get pt" << std::endl; return 0; @@ -60,12 +60,12 @@ } // void xAOD::SecVtxHelper::setVtxpt(xAOD::Vertex * vtx, float val){ - static SG::AuxElement::Accessor<float> a("pt"); + static const SG::AuxElement::Accessor<float> a("pt"); a(*vtx)=val; } // float xAOD::SecVtxHelper::Vtxeta(const xAOD::Vertex* vtx){ - static SG::AuxElement::Accessor<float> a("eta"); + static const SG::AuxElement::Accessor<float> a("eta"); if(!a.isAvailable(*vtx)){ std::cout << "ERROR: Failed to get eta" << std::endl; return 0; @@ -74,12 +74,12 @@ } // void xAOD::SecVtxHelper::setVtxeta(xAOD::Vertex * vtx, float val){ - static SG::AuxElement::Accessor<float> a("eta"); + static const SG::AuxElement::Accessor<float> a("eta"); a(*vtx)=val; } // float xAOD::SecVtxHelper::Vtxphi(const xAOD::Vertex* vtx){ - static SG::AuxElement::Accessor<float> a("phi"); + static const SG::AuxElement::Accessor<float> a("phi"); if(!a.isAvailable(*vtx)){ std::cout << "ERROR: Failed to get phi" << std::endl; return 0; @@ -88,12 +88,12 @@ } // void xAOD::SecVtxHelper::setVtxphi(xAOD::Vertex * vtx, float val){ - static SG::AuxElement::Accessor<float> a("phi"); + static const SG::AuxElement::Accessor<float> a("phi"); a(*vtx)=val; } // float xAOD::SecVtxHelper::VtxnormDist(const xAOD::Vertex* vtx){ - static SG::AuxElement::Accessor<float> a("normDist"); + static const SG::AuxElement::Accessor<float> a("normDist"); if(!a.isAvailable(*vtx)){ std::cout << "ERROR: Failed to get normDist" << std::endl; return 0; @@ -102,7 +102,7 @@ } // void xAOD::SecVtxHelper::setVtxnormDist(xAOD::Vertex * vtx, float val){ - static SG::AuxElement::Accessor<float> a("normDist"); + static const SG::AuxElement::Accessor<float> a("normDist"); a(*vtx)=val; } diff --git a/Event/xAOD/xAODBTagging/xAODBTagging/ATLAS_CHECK_THREAD_SAFETY b/Event/xAOD/xAODBTagging/xAODBTagging/ATLAS_CHECK_THREAD_SAFETY new file mode 100644 index 0000000000000000000000000000000000000000..b1733632912be99265350fcc9f1e599e1c1a629e --- /dev/null +++ b/Event/xAOD/xAODBTagging/xAODBTagging/ATLAS_CHECK_THREAD_SAFETY @@ -0,0 +1 @@ +Event/xAOD/xAODBTagging diff --git a/Event/xAOD/xAODBTagging/xAODBTagging/versions/BTagging_v1.h b/Event/xAOD/xAODBTagging/xAODBTagging/versions/BTagging_v1.h index 2148d4e1eae96c04d7cf24a3d191dfc5f3d861c1..ab8c1eb577fcc839d8b35dfb9d36ce15100f148a 100644 --- a/Event/xAOD/xAODBTagging/xAODBTagging/versions/BTagging_v1.h +++ b/Event/xAOD/xAODBTagging/xAODBTagging/versions/BTagging_v1.h @@ -23,6 +23,7 @@ #include <vector> #include <string> #include <iostream> +#include "CxxUtils/checker_macros.h" namespace xAOD { @@ -299,13 +300,13 @@ namespace xAOD { /// @} ///@name xAOD::BTagging helper for ElementLink Persistification - void toPersistent(); + void toPersistent ATLAS_NOT_REENTRANT (); - void setDynTPELName(const std::string &taggername, + void setDynTPELName ATLAS_NOT_REENTRANT (const std::string &taggername, const std::string &variablename); - void setDynVxELName(const std::string &taggername, + void setDynVxELName ATLAS_NOT_REENTRANT (const std::string &taggername, const std::string &variablename); - void setDynBTagVxELName(const std::string &taggername, + void setDynBTagVxELName ATLAS_NOT_REENTRANT (const std::string &taggername, const std::string &variablename);