diff --git a/Event/xAOD/xAODMuon/Root/MuonAccessors_v1.h b/Event/xAOD/xAODMuon/Root/MuonAccessors_v1.h index 50113dea52a385f3b2ea7be2b8894bf2e4ea2770..377a51af2db7fa6a903d791bcf16c570530294e5 100644 --- a/Event/xAOD/xAODMuon/Root/MuonAccessors_v1.h +++ b/Event/xAOD/xAODMuon/Root/MuonAccessors_v1.h @@ -1,10 +1,9 @@ // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -// $Id: MuonAccessors_v1.h 647346 2015-02-17 10:24:03Z emoyse $ #ifndef XAODMUON_MUONACCESSORS_V1_H #define XAODMUON_MUONACCESSORS_V1_H @@ -22,7 +21,7 @@ namespace xAOD { /// Muon_v1 object at runtime to get/set parameter values on themselves. /// template <class T> - SG::AuxElement::Accessor< T >* + const SG::AuxElement::Accessor< T >* parameterAccessorV1( Muon_v1::ParamDef type ); } // namespace xAOD diff --git a/Event/xAOD/xAODMuon/Root/MuonAccessors_v1.icc b/Event/xAOD/xAODMuon/Root/MuonAccessors_v1.icc index 3e68c495ab7ddba86e2307b34dcb503f0c0f1ffd..abfac21bec19bf3b90544300d19103cbbf89c780 100644 --- a/Event/xAOD/xAODMuon/Root/MuonAccessors_v1.icc +++ b/Event/xAOD/xAODMuon/Root/MuonAccessors_v1.icc @@ -1,10 +1,9 @@ // Dear emacs, this is -*- c++ -*- /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -// $Id: MuonAccessors_v1.icc 745098 2016-05-05 15:47:04Z wleight $ // System include(s): #include <iostream> @@ -13,7 +12,7 @@ #define DEFINE_ACCESSOR(TYPE, NAME ) \ case xAOD::Muon_v1::NAME: \ { \ - static SG::AuxElement::Accessor< TYPE > a( #NAME ); \ + static const SG::AuxElement::Accessor< TYPE > a( #NAME ); \ return &a; \ } \ break; @@ -22,12 +21,12 @@ namespace xAOD { // Generic case. Maybe return warning? template<class T> - SG::AuxElement::Accessor< T >* + const SG::AuxElement::Accessor< T >* parameterAccessorV1( Muon_v1::ParamDef /*type*/ ) {} template<> - SG::AuxElement::Accessor< float >* + const SG::AuxElement::Accessor< float >* parameterAccessorV1<float>( Muon_v1::ParamDef type ) { switch( type ) { DEFINE_ACCESSOR( float, spectrometerFieldIntegral ); @@ -45,11 +44,8 @@ namespace xAOD { DEFINE_ACCESSOR( float, midAngle ); DEFINE_ACCESSOR( float, msInnerMatchChi2 ); DEFINE_ACCESSOR( float, msOuterMatchChi2 ); - // DEFINE_ACCESSOR( float, msInnerMatchDOF ); These ParamDefs are INT and defined below. - // DEFINE_ACCESSOR( float, msOuterMatchDOF ); DEFINE_ACCESSOR( float, meanDeltaADCCountsMDT ); DEFINE_ACCESSOR( float, CaloLRLikelihood ); - // DEFINE_ACCESSOR( float, CaloMuonIDTag ); INT DEFINE_ACCESSOR( float, FSR_CandidateEnergy ); DEFINE_ACCESSOR( float, EnergyLoss ); DEFINE_ACCESSOR( float, ParamEnergyLoss ); @@ -58,13 +54,7 @@ namespace xAOD { DEFINE_ACCESSOR( float, ParamEnergyLossSigmaPlus ); DEFINE_ACCESSOR( float, ParamEnergyLossSigmaMinus ); DEFINE_ACCESSOR( float, MeasEnergyLossSigma ); - //DEFINE_ACCESSOR( float, d0_sa ); - //DEFINE_ACCESSOR( float, z0_sa ); - //DEFINE_ACCESSOR( float, phi0_sa ); - //DEFINE_ACCESSOR( float, theta_sa ); - //DEFINE_ACCESSOR( float, qOverP_sa ); - //DEFINE_ACCESSOR( float, Eloss_sa ); - default: + default: std::cerr << "xAOD::Muon::parameterAccessorV1 ERROR Unknown float ParamDef (" << type << ") requested."; if (type == Muon_v1::msInnerMatchDOF || type == Muon_v1::msOuterMatchDOF || type == Muon_v1::CaloMuonIDTag) @@ -75,7 +65,7 @@ namespace xAOD { } template<> - SG::AuxElement::Accessor< int >* + const SG::AuxElement::Accessor< int >* parameterAccessorV1<int>( Muon_v1::ParamDef type ) { switch( type ) { DEFINE_ACCESSOR( int, msInnerMatchDOF ); diff --git a/Event/xAOD/xAODMuon/Root/MuonSegment_v1.cxx b/Event/xAOD/xAODMuon/Root/MuonSegment_v1.cxx index 8654645844c17301c8af84daf553a429ad39f663..b87274d5b88fd4303504da80fbb71c6112190372 100644 --- a/Event/xAOD/xAODMuon/Root/MuonSegment_v1.cxx +++ b/Event/xAOD/xAODMuon/Root/MuonSegment_v1.cxx @@ -1,8 +1,7 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -// $Id: MuonSegment_v1.cxx 612402 2014-08-19 07:28:08Z htorres $ // EDM include(s): #include "xAODCore/AuxStoreAccessorMacros.h" @@ -21,11 +20,11 @@ namespace xAOD { AUXSTORE_PRIMITIVE_GETTER( MuonSegment_v1, float, z ) void MuonSegment_v1::setPosition(float x, float y, float z) { - static Accessor< float > acc1( "x" ); + static const Accessor< float > acc1( "x" ); acc1( *this ) = x; - static Accessor< float > acc2( "y" ); + static const Accessor< float > acc2( "y" ); acc2( *this ) = y; - static Accessor< float > acc3( "z" ); + static const Accessor< float > acc3( "z" ); acc3( *this ) = z; } @@ -34,11 +33,11 @@ namespace xAOD { AUXSTORE_PRIMITIVE_GETTER( MuonSegment_v1, float, pz ) void MuonSegment_v1::setDirection(float px, float py, float pz) { - static Accessor< float > acc1( "px" ); + static const Accessor< float > acc1( "px" ); acc1( *this ) = px; - static Accessor< float > acc2( "py" ); + static const Accessor< float > acc2( "py" ); acc2( *this ) = py; - static Accessor< float > acc3( "pz" ); + static const Accessor< float > acc3( "pz" ); acc3( *this ) = pz; } @@ -46,9 +45,9 @@ namespace xAOD { AUXSTORE_PRIMITIVE_GETTER( MuonSegment_v1, float, t0error ) void MuonSegment_v1::setT0Error(float t0, float t0error) { - static Accessor< float > acc1( "t0" ); + static const Accessor< float > acc1( "t0" ); acc1( *this ) = t0; - static Accessor< float > acc2( "t0error" ); + static const Accessor< float > acc2( "t0error" ); acc2( *this ) = t0error; } @@ -56,9 +55,9 @@ namespace xAOD { AUXSTORE_PRIMITIVE_GETTER( MuonSegment_v1, float, numberDoF ) void MuonSegment_v1::setFitQuality(float chiSquared, float numberDoF) { - static Accessor< float > acc1( "chiSquared" ); + static const Accessor< float > acc1( "chiSquared" ); acc1( *this ) = chiSquared; - static Accessor< float > acc2( "numberDoF" ); + static const Accessor< float > acc2( "numberDoF" ); acc2( *this ) = numberDoF; } @@ -68,13 +67,13 @@ namespace xAOD { AUXSTORE_PRIMITIVE_GETTER_WITH_CAST( MuonSegment_v1, int, Muon::MuonStationIndex::TechnologyIndex, technology ) void MuonSegment_v1::setIdentifier(int sector, Muon::MuonStationIndex::ChIndex chamberIndex, int etaIndex, Muon::MuonStationIndex::TechnologyIndex technology) { - static Accessor< int > acc1( "sector" ); + static const Accessor< int > acc1( "sector" ); acc1( *this ) = sector; - static Accessor< int > acc2( "chamberIndex" ); + static const Accessor< int > acc2( "chamberIndex" ); acc2( *this ) = static_cast<int>(chamberIndex); - static Accessor< int > acc3( "etaIndex" ); + static const Accessor< int > acc3( "etaIndex" ); acc3( *this ) = etaIndex; - static Accessor< int > acc4( "technology" ); + static const Accessor< int > acc4( "technology" ); acc4( *this ) = static_cast<int>(technology); } @@ -83,11 +82,11 @@ namespace xAOD { AUXSTORE_PRIMITIVE_GETTER( MuonSegment_v1, int , nTrigEtaLayers ) void MuonSegment_v1::setNHits(int nPrecisionHits, int nPhiLayers, int nTrigEtaLayers) { - static Accessor< int > acc1( "nPrecisionHits" ); + static const Accessor< int > acc1( "nPrecisionHits" ); acc1( *this ) = nPrecisionHits; - static Accessor< int > acc2( "nPhiLayers" ); + static const Accessor< int > acc2( "nPhiLayers" ); acc2( *this ) = nPhiLayers; - static Accessor< int > acc3( "nTrigEtaLayers" ); + static const Accessor< int > acc3( "nTrigEtaLayers" ); acc3( *this ) = nTrigEtaLayers; } diff --git a/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.cxx b/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.cxx index 5b356d7a414d76371cb5b11cf4ed37a887df1104..0da68c9354b5ab6c2e6fddd69accb075a806b42c 100644 --- a/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.cxx +++ b/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.cxx @@ -14,14 +14,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< uint8_t >* + const SG::AuxElement::Accessor< uint8_t >* muonTrackSummaryAccessorV1( xAOD::MuonSummaryType type ) { switch( type ) { @@ -105,23 +105,23 @@ namespace xAOD { DEFINE_ACCESSOR( uint8_t, etaLayer3TGCHoles ); DEFINE_ACCESSOR( uint8_t, etaLayer4TGCHoles ); - DEFINE_ACCESSOR( uint8_t, innerClosePrecisionHits ); - DEFINE_ACCESSOR( uint8_t, middleClosePrecisionHits ); - DEFINE_ACCESSOR( uint8_t, outerClosePrecisionHits ); - DEFINE_ACCESSOR( uint8_t, extendedClosePrecisionHits ); + DEFINE_ACCESSOR( uint8_t, innerClosePrecisionHits ); + DEFINE_ACCESSOR( uint8_t, middleClosePrecisionHits ); + DEFINE_ACCESSOR( uint8_t, outerClosePrecisionHits ); + DEFINE_ACCESSOR( uint8_t, extendedClosePrecisionHits ); - DEFINE_ACCESSOR( uint8_t, innerOutBoundsPrecisionHits ); + DEFINE_ACCESSOR( uint8_t, innerOutBoundsPrecisionHits ); DEFINE_ACCESSOR( uint8_t, middleOutBoundsPrecisionHits ); - DEFINE_ACCESSOR( uint8_t, outerOutBoundsPrecisionHits ); + DEFINE_ACCESSOR( uint8_t, outerOutBoundsPrecisionHits ); DEFINE_ACCESSOR( uint8_t, extendedOutBoundsPrecisionHits ); - DEFINE_ACCESSOR( uint8_t, combinedTrackOutBoundsPrecisionHits ); + DEFINE_ACCESSOR( uint8_t, combinedTrackOutBoundsPrecisionHits ); - DEFINE_ACCESSOR( uint8_t, isEndcapGoodLayers ); - DEFINE_ACCESSOR( uint8_t, isSmallGoodSectors ); + DEFINE_ACCESSOR( uint8_t, isEndcapGoodLayers ); + DEFINE_ACCESSOR( uint8_t, isSmallGoodSectors ); - DEFINE_ACCESSOR( uint8_t, cscEtaHits ); - DEFINE_ACCESSOR( uint8_t, cscUnspoiledEtaHits ); + DEFINE_ACCESSOR( uint8_t, cscEtaHits ); + DEFINE_ACCESSOR( uint8_t, cscUnspoiledEtaHits ); default: std::cerr << "xAOD::MuonTrackParticle_v1 ERROR Unknown MuonSummaryType (" diff --git a/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.h b/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.h index a5a6c6c4c762add6e08e8e4de1857b7729c030de..520d0d371855cf026063732a31facae753d1413a 100644 --- a/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.h +++ b/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.h @@ -21,7 +21,7 @@ namespace xAOD { /// This function holds on to Accessor objects that can be used by each /// TrackParticle_v1 object at runtime to get/set summary values on themselves. /// - SG::AuxElement::Accessor< uint8_t >* + const SG::AuxElement::Accessor< uint8_t >* muonTrackSummaryAccessorV1( xAOD::MuonSummaryType type ); } // namespace xAOD diff --git a/Event/xAOD/xAODMuon/Root/Muon_v1.cxx b/Event/xAOD/xAODMuon/Root/Muon_v1.cxx index fe3a6c0e8b00efb5e603ff168f0e30bd29acf635..b0f77f4218bbbfd90e4b57fae10ac33e00180605 100644 --- a/Event/xAOD/xAODMuon/Root/Muon_v1.cxx +++ b/Event/xAOD/xAODMuon/Root/Muon_v1.cxx @@ -1,8 +1,7 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -// $Id: Muon_v1.cxx 792230 2017-01-15 06:03:39Z ssnyder $ // Misc includes #include <vector> @@ -67,9 +66,9 @@ namespace xAOD { } void Muon_v1::setP4(double pt, double eta, double phi) { - static Accessor< float > acc1( "pt" ); - static Accessor< float > acc2( "eta" ); - static Accessor< float > acc3( "phi" ); + static const Accessor< float > acc1( "pt" ); + static const Accessor< float > acc2( "eta" ); + static const Accessor< float > acc3( "phi" ); acc1( *this )=pt; acc2( *this )=eta; acc3( *this )=phi; @@ -107,12 +106,12 @@ namespace xAOD { void Muon_v1::addAllAuthor ( const Author author ){ - static Accessor< uint16_t > acc( "allAuthors" ); + static const Accessor< uint16_t > acc( "allAuthors" ); acc(*this) |= 1<<static_cast<unsigned int>(author); } bool Muon_v1::isAuthor ( const Author author ) const{ - static Accessor< uint16_t > acc( "allAuthors" ); + static const Accessor< uint16_t > acc( "allAuthors" ); return (acc(*this)& (1<<static_cast<unsigned int>(author))); } @@ -160,7 +159,7 @@ namespace xAOD { } bool Muon_v1::summaryValue(uint8_t& value, const MuonSummaryType information) const { - Muon_v1::Accessor< uint8_t >* acc = muonTrackSummaryAccessorV1( information ); + const Muon_v1::Accessor< uint8_t >* acc = muonTrackSummaryAccessorV1( information ); if( ! acc ) return false; if( ! acc->isAvailable( *this ) ) return false; @@ -170,19 +169,19 @@ namespace xAOD { } float Muon_v1::uint8MuonSummaryValue(const MuonSummaryType information) const{ - Muon_v1::Accessor< uint8_t >* acc = muonTrackSummaryAccessorV1( information ); + const Muon_v1::Accessor< uint8_t >* acc = muonTrackSummaryAccessorV1( information ); return ( *acc )( *this ); } void Muon_v1::setSummaryValue(uint8_t value, const MuonSummaryType information) { - Muon_v1::Accessor< uint8_t >* acc = muonTrackSummaryAccessorV1( information ); + const Muon_v1::Accessor< uint8_t >* acc = muonTrackSummaryAccessorV1( information ); // Set the value: ( *acc )( *this ) = value; } bool Muon_v1::parameter(float& value, const Muon_v1::ParamDef information) const { - xAOD::Muon_v1::Accessor< float >* acc = parameterAccessorV1<float>( information ); + const xAOD::Muon_v1::Accessor< float >* acc = parameterAccessorV1<float>( information ); if( ! acc ) return false; if( ! acc->isAvailable( *this ) ) return false; @@ -192,12 +191,12 @@ namespace xAOD { } float xAOD::Muon_v1::floatParameter(xAOD::Muon_v1::ParamDef information) const{ - xAOD::Muon_v1::Accessor< float >* acc = parameterAccessorV1<float>( information ); + const xAOD::Muon_v1::Accessor< float >* acc = parameterAccessorV1<float>( information ); return ( *acc )( *this ); } void Muon_v1::setParameter(float value, const Muon_v1::ParamDef information){ - xAOD::Muon_v1::Accessor< float >* acc = parameterAccessorV1<float>( information ); + const xAOD::Muon_v1::Accessor< float >* acc = parameterAccessorV1<float>( information ); if( ! acc ) throw std::runtime_error("Muon_v1::setParameter - no float accessor for paramdef number: "+std::to_string(information)); // Set the value: @@ -205,7 +204,7 @@ namespace xAOD { } bool Muon_v1::parameter(int& value, const Muon_v1::ParamDef information) const { - xAOD::Muon_v1::Accessor< int >* acc = parameterAccessorV1<int>( information ); + const xAOD::Muon_v1::Accessor< int >* acc = parameterAccessorV1<int>( information ); if( ! acc ) return false; if( ! acc->isAvailable( *this ) ) return false; @@ -215,12 +214,12 @@ namespace xAOD { } int xAOD::Muon_v1::intParameter(xAOD::Muon_v1::ParamDef information) const{ - xAOD::Muon_v1::Accessor< int >* acc = parameterAccessorV1<int>( information ); + const xAOD::Muon_v1::Accessor< int >* acc = parameterAccessorV1<int>( information ); return ( *acc )( *this ); } void Muon_v1::setParameter(int value, const Muon_v1::ParamDef information){ - xAOD::Muon_v1::Accessor< int >* acc = parameterAccessorV1<int>( information ); + const xAOD::Muon_v1::Accessor< int >* acc = parameterAccessorV1<int>( information ); if( ! acc ) throw std::runtime_error("Muon_v1::setParameter - no int accessor for paramdef number: "+std::to_string(information)); // Set the value: @@ -228,13 +227,13 @@ namespace xAOD { } xAOD::Muon_v1::Quality Muon_v1::quality() const { - static Accessor< uint8_t > acc( "quality" ); + static const Accessor< uint8_t > acc( "quality" ); uint8_t temp = acc( *this ); return static_cast<Quality>(temp&3); } void Muon_v1::setQuality(xAOD::Muon_v1::Quality value) { - static Accessor< uint8_t > acc( "quality" ); + static const Accessor< uint8_t > acc( "quality" ); uint8_t temp = static_cast< uint8_t >(value); acc( *this ) = acc( *this ) & ~(0x7); // Reset the first 3 bits. acc( *this ) |= temp; @@ -242,14 +241,14 @@ namespace xAOD { } bool Muon_v1::passesIDCuts() const { - static Accessor< uint8_t > acc( "quality" ); + static const Accessor< uint8_t > acc( "quality" ); uint8_t temp = acc( *this ); // We use 4th bit for 'passesIDCuts' return temp&8; } void Muon_v1::setPassesIDCuts(bool value) { - static Accessor< uint8_t > acc( "quality" ); + static const Accessor< uint8_t > acc( "quality" ); // We use 4th bit for 'passesIDCuts' if (value) acc( *this ) |= 8; else acc( *this ) &= 247; @@ -257,14 +256,14 @@ namespace xAOD { } bool Muon_v1::passesHighPtCuts() const { - static Accessor< uint8_t > acc( "quality" ); + static const Accessor< uint8_t > acc( "quality" ); uint8_t temp = acc( *this ); // We use 5th bit for 'passesHighPtCuts' return temp&16; } void Muon_v1::setPassesHighPtCuts(bool value) { - static Accessor< uint8_t > acc( "quality" ); + static const Accessor< uint8_t > acc( "quality" ); // We use 5th bit for 'passesHighPtCuts' if (value) acc( *this ) |= 16; else acc( *this ) &= 239; @@ -394,17 +393,17 @@ bool Muon_v1::isolationCaloCorrection( float& value, const Iso::IsolationFlavou // Not checking if links are valid here - this is the job of the client (as per the cases above). // But we DO check that the link is available, so we can check for both types of links. - static Accessor< ElementLink< TrackParticleContainer > > acc1( "extrapolatedMuonSpectrometerTrackParticleLink" ); + static const Accessor< ElementLink< TrackParticleContainer > > acc1( "extrapolatedMuonSpectrometerTrackParticleLink" ); if ( acc1.isAvailable( *this ) && acc1( *this ).isValid() ) { return acc1( *this ); } - static Accessor< ElementLink< TrackParticleContainer > > acc2( "msOnlyExtrapolatedMuonSpectrometerTrackParticleLink" ); + static const Accessor< ElementLink< TrackParticleContainer > > acc2( "msOnlyExtrapolatedMuonSpectrometerTrackParticleLink" ); if ( acc2.isAvailable( *this ) && acc2( *this ).isValid() ) { return acc2( *this ); } - static Accessor< ElementLink< TrackParticleContainer > > acc3( "muonSpectrometerTrackParticleLink" ); + static const Accessor< ElementLink< TrackParticleContainer > > acc3( "muonSpectrometerTrackParticleLink" ); if ( acc3.isAvailable( *this ) && acc3( *this ).isValid()) { return acc3( *this ); } @@ -425,7 +424,7 @@ bool Muon_v1::isolationCaloCorrection( float& value, const Iso::IsolationFlavou case Combined: case SiliconAssociatedForwardMuon : { - static Accessor< ElementLink< TrackParticleContainer > > acc( "combinedTrackParticleLink" ); + static const Accessor< ElementLink< TrackParticleContainer > > acc( "combinedTrackParticleLink" ); if( ! acc.isAvailable( *this ) ) return 0; const ElementLink< TrackParticleContainer >& link = acc( *this ); @@ -436,7 +435,7 @@ bool Muon_v1::isolationCaloCorrection( float& value, const Iso::IsolationFlavou case SegmentTagged: case CaloTagged : { - static Accessor< ElementLink< TrackParticleContainer > > acc( "inDetTrackParticleLink" ); + static const Accessor< ElementLink< TrackParticleContainer > > acc( "inDetTrackParticleLink" ); if( ! acc.isAvailable( *this ) ) return 0; const ElementLink< TrackParticleContainer >& link = acc( *this ); @@ -447,21 +446,21 @@ bool Muon_v1::isolationCaloCorrection( float& value, const Iso::IsolationFlavou case MuonStandAlone : { // Want to return link to extrapolated MS track particle if possible. - static Accessor< ElementLink< TrackParticleContainer > > acc1( "extrapolatedMuonSpectrometerTrackParticleLink" ); + static const Accessor< ElementLink< TrackParticleContainer > > acc1( "extrapolatedMuonSpectrometerTrackParticleLink" ); if ( acc1.isAvailable( *this ) ) { const ElementLink< TrackParticleContainer >& link = acc1( *this ); if ( link.isValid() ) return *link; } //if no, maybe the MS-only extrapolated track particle? - static Accessor< ElementLink< TrackParticleContainer > > acc2( "msOnlyExtrapolatedMuonSpectrometerTrackParticleLink" ); + static const Accessor< ElementLink< TrackParticleContainer > > acc2( "msOnlyExtrapolatedMuonSpectrometerTrackParticleLink" ); if ( acc2.isAvailable( *this ) ) { const ElementLink< TrackParticleContainer >& link = acc2( *this ); if ( link.isValid() ) return *link; } // Try fallback (non-extrapolated MS track particle)... - static Accessor< ElementLink< TrackParticleContainer > > acc3( "muonSpectrometerTrackParticleLink" ); + static const Accessor< ElementLink< TrackParticleContainer > > acc3( "muonSpectrometerTrackParticleLink" ); if ( acc3.isAvailable( *this ) ) { const ElementLink< TrackParticleContainer >& link = acc3( *this ); if ( link.isValid() ) return *link; @@ -526,23 +525,23 @@ bool Muon_v1::isolationCaloCorrection( float& value, const Iso::IsolationFlavou void Muon_v1::setTrackParticleLink(TrackParticleType type, const ElementLink< TrackParticleContainer >& link){ switch ( type ) { case InnerDetectorTrackParticle : - static Accessor< ElementLink< TrackParticleContainer > > acc1( "inDetTrackParticleLink" ); + static const Accessor< ElementLink< TrackParticleContainer > > acc1( "inDetTrackParticleLink" ); acc1(*this)=link; break; case MuonSpectrometerTrackParticle : - static Accessor< ElementLink< TrackParticleContainer > > acc2( "muonSpectrometerTrackParticleLink" ); + static const Accessor< ElementLink< TrackParticleContainer > > acc2( "muonSpectrometerTrackParticleLink" ); acc2(*this)=link; break; case CombinedTrackParticle : - static Accessor< ElementLink< TrackParticleContainer > > acc3( "combinedTrackParticleLink" ); + static const Accessor< ElementLink< TrackParticleContainer > > acc3( "combinedTrackParticleLink" ); acc3(*this)=link; break; case ExtrapolatedMuonSpectrometerTrackParticle : - static Accessor< ElementLink< TrackParticleContainer > > acc4( "extrapolatedMuonSpectrometerTrackParticleLink" ); + static const Accessor< ElementLink< TrackParticleContainer > > acc4( "extrapolatedMuonSpectrometerTrackParticleLink" ); acc4(*this)=link; break; case MSOnlyExtrapolatedMuonSpectrometerTrackParticle : - static Accessor< ElementLink< TrackParticleContainer > > acc5( "msOnlyExtrapolatedMuonSpectrometerTrackParticleLink" ); + static const Accessor< ElementLink< TrackParticleContainer > > acc5( "msOnlyExtrapolatedMuonSpectrometerTrackParticleLink" ); acc5(*this)=link; break; case Primary : @@ -554,7 +553,7 @@ bool Muon_v1::isolationCaloCorrection( float& value, const Iso::IsolationFlavou AUXSTORE_OBJECT_SETTER_AND_GETTER( Muon_v1, ElementLink<CaloClusterContainer>, clusterLink, setClusterLink) const CaloCluster* Muon_v1::cluster() const { - static Accessor< ElementLink< TrackParticleContainer > > acc( "inDetTrackParticleLink" ); + static const Accessor< ElementLink< TrackParticleContainer > > acc( "inDetTrackParticleLink" ); if( ! acc.isAvailable( *this ) ) { return 0; } @@ -580,7 +579,7 @@ bool Muon_v1::isolationCaloCorrection( float& value, const Iso::IsolationFlavou AUXSTORE_OBJECT_SETTER_AND_GETTER( Muon_v1, std::vector< ElementLink< xAOD::MuonSegmentContainer > >, muonSegmentLinks, setMuonSegmentLinks) - static SG::AuxElement::Accessor< std::vector< ElementLink< MuonSegmentContainer > > > muonSegmentsAcc( "muonSegmentLinks" ); + static const SG::AuxElement::Accessor< std::vector< ElementLink< MuonSegmentContainer > > > muonSegmentsAcc( "muonSegmentLinks" ); size_t Muon_v1::nMuonSegments() const { // If a link was not set (yet), return zero. if( ! muonSegmentsAcc.isAvailable( *this ) ) { diff --git a/Event/xAOD/xAODMuon/Root/SlowMuon_v1.cxx b/Event/xAOD/xAODMuon/Root/SlowMuon_v1.cxx index 659b4540c21a64f4343ca33b2613000ff76353a9..89a6db2d18e62ad0f37ac3d5c0319ce7827cdb70 100644 --- a/Event/xAOD/xAODMuon/Root/SlowMuon_v1.cxx +++ b/Event/xAOD/xAODMuon/Root/SlowMuon_v1.cxx @@ -29,13 +29,13 @@ namespace xAOD { AUXSTORE_PRIMITIVE_GETTER( SlowMuon_v1, int, rpcBetaDof ) void SlowMuon_v1::setRpcInfo(float rpcBetaAvg, float rpcBetaRms, float rpcBetaChi2, int rpcBetaDof) { - static Accessor< float > acc1( "rpcBetaAvg" ); + static const Accessor< float > acc1( "rpcBetaAvg" ); acc1( *this ) = rpcBetaAvg; - static Accessor< float > acc2( "rpcBetaRms" ); + static const Accessor< float > acc2( "rpcBetaRms" ); acc2( *this ) = rpcBetaRms; - static Accessor< float > acc3( "rpcBetaChi2" ); + static const Accessor< float > acc3( "rpcBetaChi2" ); acc3( *this ) = rpcBetaChi2; - static Accessor< int > acc4( "rpcBetaDof" ); + static const Accessor< int > acc4( "rpcBetaDof" ); acc4( *this ) = rpcBetaDof; } @@ -45,13 +45,13 @@ namespace xAOD { AUXSTORE_PRIMITIVE_GETTER( SlowMuon_v1, int, mdtBetaDof ) void SlowMuon_v1::setMdtInfo(float mdtBetaAvg, float mdtBetaRms, float mdtBetaChi2, int mdtBetaDof) { - static Accessor< float > acc1( "mdtBetaAvg" ); + static const Accessor< float > acc1( "mdtBetaAvg" ); acc1( *this ) = mdtBetaAvg; - static Accessor< float > acc2( "mdtBetaRms" ); + static const Accessor< float > acc2( "mdtBetaRms" ); acc2( *this ) = mdtBetaRms; - static Accessor< float > acc3( "mdtBetaChi2" ); + static const Accessor< float > acc3( "mdtBetaChi2" ); acc3( *this ) = mdtBetaChi2; - static Accessor< int > acc4( "mdtBetaDof" ); + static const Accessor< int > acc4( "mdtBetaDof" ); acc4( *this ) = mdtBetaDof; } @@ -61,13 +61,13 @@ namespace xAOD { AUXSTORE_PRIMITIVE_GETTER( SlowMuon_v1, int, caloBetaDof ) void SlowMuon_v1::setCaloInfo(float caloBetaAvg, float caloBetaRms, float caloBetaChi2, int caloBetaDof) { - static Accessor< float > acc1( "caloBetaAvg" ); + static const Accessor< float > acc1( "caloBetaAvg" ); acc1( *this ) = caloBetaAvg; - static Accessor< float > acc2( "caloBetaRms" ); + static const Accessor< float > acc2( "caloBetaRms" ); acc2( *this ) = caloBetaRms; - static Accessor< float > acc3( "caloBetaChi2" ); + static const Accessor< float > acc3( "caloBetaChi2" ); acc3( *this ) = caloBetaChi2; - static Accessor< int > acc4( "caloBetaDof" ); + static const Accessor< int > acc4( "caloBetaDof" ); acc4( *this ) = caloBetaDof; }