ATLAS Offline Software
Loading...
Searching...
No Matches
xAOD::Muon_v1 Class Reference

Class describing a Muon. More...

#include <Muon_v1.h>

Inheritance diagram for xAOD::Muon_v1:
Collaboration diagram for xAOD::Muon_v1:

Public Member Functions

 DECLARE_ENUM_OSTREAM (Author)
 inject the enums
 DECLARE_ENUM_OSTREAM (MuonType)
 Pipe the muon type to a string object.
 DECLARE_ENUM_OSTREAM (Quality)
 Pipe the muon quality to a string object.
 DECLARE_ENUM_OSTREAM (TrackParticleType)
 Pipe the track particle to a string object.
 DECLARE_ENUM_OSTREAM (ParamDef)
 The muon parameter to a string object.
 DECLARE_ENUM_OSTREAM (EnergyLossType)
 The muon energy loss to a string object.
 Muon_v1 ()=default
 Default constructor.
 Muon_v1 (const Muon_v1 &rhs)
 Copy constructor.
virtual ~Muon_v1 ()=default
 Destructor.
Muon_v1operator= (const Muon_v1 &rhs)
 Assignment operator.
bool isolationCaloCorrection (float &value, const Iso::IsolationFlavour flavour, const Iso::IsolationCaloCorrection type, const Iso::IsolationCorrectionParameter param) const
 Accessor for Isolation Calo correction.
float isolationCaloCorrection (const Iso::IsolationFlavour flavour, const Iso::IsolationCaloCorrection type, const Iso::IsolationCorrectionParameter param) const
 Accessor to Isolation Calo corrections , this just returns the correction without internaly checking if it exists.
bool setIsolationCaloCorrection (float value, const Iso::IsolationFlavour flavour, const Iso::IsolationCaloCorrection type, const Iso::IsolationCorrectionParameter param)
 set method for Isolation Calo Corrections.
bool isolationTrackCorrection (float &value, const Iso::IsolationFlavour flavour, const Iso::IsolationTrackCorrection type) const
 Accessor for Isolation Track correction.
float isolationTrackCorrection (const Iso::IsolationFlavour flavour, const Iso::IsolationTrackCorrection type) const
 Accessor to Isolation Track corrections , this just returns the correction without internaly checking if it exists.
bool setIsolationTrackCorrection (float value, const Iso::IsolationFlavour flavour, const Iso::IsolationTrackCorrection type)
 Set method for Isolation Track Corrections.
bool isolationCorrectionBitset (std::bitset< 32 > &value, const Iso::IsolationFlavour flavour) const
 Accessor for Isolation corection Bitset.
std::bitset< 32 > isolationCorrectionBitset (const Iso::IsolationFlavour flavour) const
 Accessor to Isolation corection Bitset , this just returns the bitset without internaly checking if it exists.
bool setIsolationCorrectionBitset (uint32_t value, const Iso::IsolationFlavour flavour)
 Set method for Isolation corection Bitset.
const TrackParticleprimaryTrackParticle () const
 Returns a pointer (which should not usually be NULL, but might be if the muon has been stripped of information) to the primary TrackParticle corresponding to the MuonType of this muon.
const ElementLink< TrackParticleContainer > & inDetTrackParticleLink () const
 Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.
const ElementLink< TrackParticleContainer > & muonSpectrometerTrackParticleLink () const
 Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.
const ElementLink< TrackParticleContainer > & combinedTrackParticleLink () const
 Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.
const ElementLink< TrackParticleContainer > & extrapolatedMuonSpectrometerTrackParticleLink () const
 Returns an ElementLink to the Extrapolated Muon Spectrometer TrackParticle used in identification of this muon.
const ElementLink< TrackParticleContainer > & msOnlyExtrapolatedMuonSpectrometerTrackParticleLink () const
 Returns an ElementLink to the MS-only Extrapolated Muon Spectrometer TrackParticle used in identification of this muon.
const ElementLink< TrackParticleContainer > & trackParticleLink (TrackParticleType type) const
 Returns an ElementLink to the TrackParticle used in identification of this muon.
void setTrackParticleLink (TrackParticleType type, const ElementLink< TrackParticleContainer > &link)
 Set method for TrackParticle links.
const TrackParticletrackParticle (TrackParticleType type) const
 Returns a pointer (which can be a nullptr) to the TrackParticle used in identification of this muon.
const ElementLink< CaloClusterContainer > & clusterLink () const
 Returns an ElementLinkto the cluster associated to this muon.
void setClusterLink (const ElementLink< CaloClusterContainer > &link)
 Set method for cluster links.
const CaloClustercluster () const
 Retrieve the associated cluster with a bare pointer.
EnergyLossType energyLossType (void) const
 Energy determined from parametrization or not (measured).
void setEnergyLossType (EnergyLossType type)
 Set method for the type.
const std::vector< ElementLink< MuonSegmentContainer > > & muonSegmentLinks () const
 Returns a vector of ElementLinks to the MuonSegments used to create this Muon.
void setMuonSegmentLinks (const std::vector< ElementLink< MuonSegmentContainer > > &segments)
 Set the vector of ElementLinks to the MuonSegments used to create this Muon.
size_t nMuonSegments () const
 Number of MuonSegments linked to by this Muon.
const MuonSegmentmuonSegment (size_t i) const
 Returns a pointer to the specified MuonSegment.
const ElementLink< MuonSegmentContainer > & muonSegmentLink (size_t i) const
 Returns a link to the specified MuonSegment.

IParticle functions

The transverse momentum ( \(p_T\)) of the particle.

typedef IParticle::FourMom_t FourMom_t
 Definition of the 4-momentum type.
typedef ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
 Base 4 Momentum type for Muon.
virtual double pt () const override
 The transverse momentum ( \(p_T\)) of the particle.
virtual double eta () const override
 The pseudorapidity ( \(\eta\)) of the particle.
virtual double phi () const override
 The azimuthal angle ( \(\phi\)) of the particle.
virtual double m () const override
 The invariant mass of the particle..
virtual double e () const override
 The total energy of the particle.
virtual double rapidity () const override
 The true rapidity (y) of the particle.
void setP4 (double pt, double eta, double phi)
 Set method for IParticle values.
virtual FourMom_t p4 () const override
 The full 4-momentum of the particle.
GenVecFourMom_t genvecP4 () const
 The full 4-momentum of the particle : GenVector.
virtual Type::ObjectType type () const override
 The type of the object as a simple enumeration.

Charge

Returns the charge.

float charge () const
void setCharge (float charge)
 Set the charge (must be the same as primaryTrackParticle() ).

Author

Methods to query the author(s) of this Muon

Todo
  • update and add documentation. Returns the primary author of this Muon.
Author author () const
bool isAuthor (const Author author) const
 Returns 'true' if 'author' is the an author of this muon.
void setAuthor (const Author auth)
 set author
uint16_t allAuthors () const
 Get all the authors of this Muon.
void setAllAuthors (uint16_t authors)
void addAllAuthor (const Author author)
 add author to all authors

Summary information

Return summary information about the muon, such as its MuonType, and the TrackSumary values of the primary TrackParticle.

MuonType muonType () const
void setMuonType (MuonType type)
bool summaryValue (uint8_t &value, const SummaryType information) const
 Accessor for TrackSummary values (in most cases, retrieved from the 'primary' TrackParticle - though it could be stored on the Muon, depending on the job configuration) If 'information' is stored in the primary TrackParticle/Muon and is of the correct templated type T, then the function fills 'value' and returns 'true', otherwise it returns 'false', and does not touch 'value'.
void setSummaryValue (uint8_t value, const SummaryType information)
 Set method for storing TrackSummary SummaryType information on the Muon (see Aux to see which is already defined as static).
bool summaryValue (float &value, const SummaryType information) const
 summaryValue(uint8_t& value, const SummaryType information) const;
bool summaryValue (uint8_t &value, const MuonSummaryType information) const
 Accessor for MuonSummaryType.
void setSummaryValue (uint8_t value, const MuonSummaryType information)
 Set method for MuonSummaryType.
float floatSummaryValue (const SummaryType information) const
 Same as bool summaryValue(float& value, const SummaryType &information) const , but without check (will throw exception if value isn't there) Primarily for use in Python.
uint8_t uint8SummaryValue (const SummaryType information) const
 Same as bool summaryValue(uint8_t& value, const SummaryType &information) const, but without check (will throw exception if value isn't there) Primarily for use in Python.
float uint8MuonSummaryValue (const MuonSummaryType information) const
 Same as bool summaryValue(uint8_t& value, const MuonSummaryType &information) const, but without check (will throw exception if value isn't there) Primarily for use in Python.
bool parameter (float &value, const ParamDef parameter) const
 Get a parameter for this Muon - momentumBalanceSignificance for example.
void setParameter (float value, const ParamDef parameter)
 Set method for parameter values.
float floatParameter (const ParamDef parameter) const
 Same as bool parameter(float& value, const ParamDef &parameter) const, but without check (will throw exception if value isn't there).
bool parameter (int &value, const ParamDef parameter) const
 Get an integer parameter for this Muon - msInnerMatchDOF for example.
void setParameter (int value, const ParamDef parameter)
 Set method for parameter values.
int intParameter (const ParamDef parameter) const
 Same as bool parameter(float& value, const ParamDef &parameter) const, but without check (will throw exception if value isn't there).
Quality quality () const
 Muon CP quality accessors.
void setQuality (const Quality)
bool passesIDCuts () const
 MCP ID hit cuts - get/set the corresponding status bit in the quality decoration.
void setPassesIDCuts (bool)

Isolation information.

bool isolation (float &value, const Iso::IsolationType information) const
 Accessor for Isolation values.
float isolation (const Iso::IsolationType information) const
 Accessor to Isolation values , this just returns the value without internaly checking if it exists.
void setIsolation (float value, const Iso::IsolationType information)
 Set method for Isolation values.

Links

With the following methods you can retrieve links to the objects used to identify this muon - depending on how the muon was built the link may or may not be valid (i.e.

a muon built from a standalone MS track won't have an ID TrackParticle associated to it).

Todo
finish documentation
Add some code here, showing how to properly use the element links
Note
Some links were removed from the "Run-1" AOD::muon, in particular

Returns an ElementLink to the primary TrackParticle corresponding to the MuonType of this muon. This is determined in the following order:

  1. CombinedTrackParticle
  2. InnerDetectorTrackParticle
  3. ExtrapolatedMuonSpectrometerTrackParticle
  4. MSOnlyExtrapolatedMuonSpectrometerTrackParticle
  5. MuonSpectrometerTrackParticle This method can throw a std::runtime_error exception if either the 'muontype' is unknown, or if the type is MuonStandAlone, but there is no available extrapolatedMuonSpectrometerTrackParticleLink or muonSpectrometerTrackParticleLink to return.
const ElementLink< TrackParticleContainer > & primaryTrackParticleLink () const

Functions for getting and setting user properties

template<class T>
XAOD_AUXDATA_DEPRECATED T & auxdata (const std::string &name, const std::string &clsname="")
 Fetch an aux data variable, as a non-const reference.
template<class T>
XAOD_AUXDATA_DEPRECATED const T & auxdata (const std::string &name, const std::string &clsname="") const
 Fetch an aux data variable, as a const reference.
template<class T>
XAOD_AUXDATA_DEPRECATED bool isAvailable (const std::string &name, const std::string &clsname="") const
 Check if a user property is available for reading or not.
template<class T>
XAOD_AUXDATA_DEPRECATED bool isAvailableWritable (const std::string &name, const std::string &clsname="") const
 Check if a user property is available for writing or not.

Detailed Description

Class describing a Muon.

Author
Edward Moyse Edwar.nosp@m.d.Mo.nosp@m.yse@c.nosp@m.ern..nosp@m.ch

Definition at line 48 of file Muon_v1.h.

Member Typedef Documentation

◆ FourMom_t

Definition of the 4-momentum type.

Definition at line 96 of file Muon_v1.h.

◆ GenVecFourMom_t

typedef ROOT::Math::LorentzVector<ROOT::Math::PtEtaPhiM4D<double> > xAOD::Muon_v1::GenVecFourMom_t

Base 4 Momentum type for Muon.

Definition at line 102 of file Muon_v1.h.

Constructor & Destructor Documentation

◆ Muon_v1() [1/2]

xAOD::Muon_v1::Muon_v1 ( )
default

Default constructor.

◆ Muon_v1() [2/2]

xAOD::Muon_v1::Muon_v1 ( const Muon_v1 & rhs)

Copy constructor.

Definition at line 38 of file Muon_v1.cxx.

39 : IParticle(rhs) //IParticle does not have a copy constructor. AuxElement has one with same behavior as default ctor
40 {
41 this->makePrivateStore(rhs);
42 }
IParticle()=default
void makePrivateStore()
Create a new (empty) private store for this object.

◆ ~Muon_v1()

virtual xAOD::Muon_v1::~Muon_v1 ( )
virtualdefault

Destructor.

Member Function Documentation

◆ addAllAuthor()

void xAOD::Muon_v1::addAllAuthor ( const Author author)

add author to all authors

Definition at line 105 of file Muon_v1.cxx.

105 {
106 static const Accessor< uint16_t > acc( "allAuthors" );
107 acc(*this) |= 1<<static_cast<unsigned int>(author);
108 }
Author author() const
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.

◆ allAuthors()

uint16_t xAOD::Muon_v1::allAuthors ( ) const

Get all the authors of this Muon.

For example during overlap checking, the same Muon may have been reconstructed by many different algorithms. This method returns a 16bit number, where each bit represents a muon algorithm, defined as follows (the lowest bit is indicates that something has gone wrong): unknown | MuidCo | STACO | MuTag | MuTagIMO | MuidSA | MuGirl | MuGirlLowBeta | CaloTag | CaloLikelihood | CaloScore | ExtrapolateMuonToIP | MuonCombinedRefit | ExtrapolateMuonToIP | Commissioning

Returns
16-bit word, 1-bit reserved for each muon Algorithm:

◆ author()

Author xAOD::Muon_v1::author ( ) const

◆ auxdata() [1/2]

template<class T>
XAOD_AUXDATA_DEPRECATED T & xAOD::IParticle::auxdata ( const std::string & name,
const std::string & clsname = "" )
inlineinherited

Fetch an aux data variable, as a non-const reference.

This function provides an easy way for users to decorate objects with auxiliary data.

Take note that this function is slow. Should not be used inside time-critical code.

Parameters
nameName of the aux variable
clsnameThe name of the associated class. May be blank
Returns
A modifiable reference to the decoration

Definition at line 98 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

99 {
100
101 return SG::Accessor< T >(name, clsname)(*this);
102 }
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:573

◆ auxdata() [2/2]

template<class T>
XAOD_AUXDATA_DEPRECATED const T & xAOD::IParticle::auxdata ( const std::string & name,
const std::string & clsname = "" ) const
inlineinherited

Fetch an aux data variable, as a const reference.

This function provides an easy way for users to retrieve auxiliary decorations from an object.

Take note that this function is slow. Should not be used inside time-critical code.

Parameters
nameName of the aux variable
clsnameThe name of the associated class. May be blank
Returns
A constant reference to the decoration

Definition at line 118 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

119 {
120
121 return SG::ConstAccessor< T >( name, clsname )( *this );
122 }
SG::ConstAccessor< T, ALLOC > ConstAccessor
Definition AuxElement.h:570

◆ charge()

float xAOD::Muon_v1::charge ( ) const

◆ cluster()

const CaloCluster * xAOD::Muon_v1::cluster ( ) const

Retrieve the associated cluster with a bare pointer.

Definition at line 489 of file Muon_v1.cxx.

489 {
490
491 if (const TrackParticle* idTrack = trackParticle(TrackParticleType::InnerDetectorTrackParticle);
492 idTrack == nullptr) {
493 return nullptr;
494 }
496 }
#define IMPLEMENT_LINK_GETTER(ContType, DECORATOR_NAME)
Definition Muon_v1.cxx:23
const TrackParticle * trackParticle(TrackParticleType type) const
Returns a pointer (which can be a nullptr) to the TrackParticle used in identification of this muon.
Definition Muon_v1.cxx:423
TrackParticle_v1 TrackParticle
Reference the current persistent version:
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.

◆ clusterLink()

const ElementLink< CaloClusterContainer > & xAOD::Muon_v1::clusterLink ( ) const

Returns an ElementLinkto the cluster associated to this muon.

Todo
Why just one?

◆ combinedTrackParticleLink()

const ElementLink< TrackParticleContainer > & xAOD::Muon_v1::combinedTrackParticleLink ( ) const

Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.

◆ DECLARE_ENUM_OSTREAM() [1/6]

xAOD::Muon_v1::DECLARE_ENUM_OSTREAM ( Author )

inject the enums

Pipe the author to a string object

◆ DECLARE_ENUM_OSTREAM() [2/6]

xAOD::Muon_v1::DECLARE_ENUM_OSTREAM ( EnergyLossType )

The muon energy loss to a string object.

◆ DECLARE_ENUM_OSTREAM() [3/6]

xAOD::Muon_v1::DECLARE_ENUM_OSTREAM ( MuonType )

Pipe the muon type to a string object.

◆ DECLARE_ENUM_OSTREAM() [4/6]

xAOD::Muon_v1::DECLARE_ENUM_OSTREAM ( ParamDef )

The muon parameter to a string object.

◆ DECLARE_ENUM_OSTREAM() [5/6]

xAOD::Muon_v1::DECLARE_ENUM_OSTREAM ( Quality )

Pipe the muon quality to a string object.

◆ DECLARE_ENUM_OSTREAM() [6/6]

xAOD::Muon_v1::DECLARE_ENUM_OSTREAM ( TrackParticleType )

Pipe the track particle to a string object.

◆ e()

double xAOD::Muon_v1::e ( ) const
overridevirtual

The total energy of the particle.

Implements xAOD::IParticle.

Definition at line 62 of file Muon_v1.cxx.

62 {
63 // FIXME - optimise?
64 return genvecP4().E();
65 }
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : GenVector.
Definition Muon_v1.cxx:91

◆ energyLossType()

EnergyLossType xAOD::Muon_v1::energyLossType ( void ) const

Energy determined from parametrization or not (measured).

The actual energy loss is returned via

float etCore;
bool hasEnergyLoss = parameter(float& value, const ParamDef parameter)
bool parameter(float &value, const ParamDef parameter) const
Get a parameter for this Muon - momentumBalanceSignificance for example.
Definition Muon_v1.cxx:175

◆ eta()

virtual double xAOD::Muon_v1::eta ( ) const
overridevirtual

The pseudorapidity ( \(\eta\)) of the particle.

Implements xAOD::IParticle.

◆ extrapolatedMuonSpectrometerTrackParticleLink()

const ElementLink< TrackParticleContainer > & xAOD::Muon_v1::extrapolatedMuonSpectrometerTrackParticleLink ( ) const

Returns an ElementLink to the Extrapolated Muon Spectrometer TrackParticle used in identification of this muon.

◆ floatParameter()

float xAOD::Muon_v1::floatParameter ( const ParamDef parameter) const

Same as bool parameter(float& value, const ParamDef &parameter) const, but without check (will throw exception if value isn't there).

Primarily for use in Python.

Definition at line 186 of file Muon_v1.cxx.

186 {
187 float sumVal{0.f};
188 parameter(sumVal, information);
189 return sumVal;
190 }

◆ floatSummaryValue()

float xAOD::Muon_v1::floatSummaryValue ( const SummaryType information) const

Same as bool summaryValue(float& value, const SummaryType &information) const , but without check (will throw exception if value isn't there) Primarily for use in Python.

Definition at line 141 of file Muon_v1.cxx.

141 {
142 const Muon_v1::Accessor< float >* acc = trackSummaryAccessorV1< float >( information );
143 return ( *acc )( *this );
144 }
const SG::AuxElement::Accessor< float > * trackSummaryAccessorV1< float >(xAOD::SummaryType type)

◆ genvecP4()

Muon_v1::GenVecFourMom_t xAOD::Muon_v1::genvecP4 ( ) const

The full 4-momentum of the particle : GenVector.

Definition at line 91 of file Muon_v1.cxx.

91 {
92 return GenVecFourMom_t(pt(), eta(), phi(), m());
93 }
virtual double m() const override
The invariant mass of the particle..
Definition Muon_v1.cxx:67
virtual double pt() const override
The transverse momentum ( ) of the particle.
virtual double eta() const override
The pseudorapidity ( ) of the particle.
virtual double phi() const override
The azimuthal angle ( ) of the particle.
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
Base 4 Momentum type for Muon.
Definition Muon_v1.h:102

◆ inDetTrackParticleLink()

const ElementLink< TrackParticleContainer > & xAOD::Muon_v1::inDetTrackParticleLink ( ) const

Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.

◆ intParameter()

int xAOD::Muon_v1::intParameter ( const ParamDef parameter) const

Same as bool parameter(float& value, const ParamDef &parameter) const, but without check (will throw exception if value isn't there).

Primarily for use in Python.

Definition at line 213 of file Muon_v1.cxx.

213 {
214 int sumValue{0};
215 parameter(sumValue, information);
216 return sumValue;
217 }

◆ isAuthor()

bool xAOD::Muon_v1::isAuthor ( const Author author) const

Returns 'true' if 'author' is the an author of this muon.

Definition at line 110 of file Muon_v1.cxx.

110 {
111 static const Accessor< uint16_t > acc( "allAuthors" );
112 return (acc(*this)& (1<<static_cast<unsigned int>(author)));
113 }

◆ isAvailable()

template<class T>
XAOD_AUXDATA_DEPRECATED bool xAOD::IParticle::isAvailable ( const std::string & name,
const std::string & clsname = "" ) const
inlineinherited

Check if a user property is available for reading or not.

This function should be used to check if a user property which may or may not exist, is set on the object.

Parameters
nameName of the auxiliary variable
clsnameThe name of the associated class. May be blank
Returns
Whether the decoration exists or not

Definition at line 135 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

136 {
137
138 return SG::ConstAccessor< T >(name, clsname).isAvailable(*this);
139 }
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.

◆ isAvailableWritable()

template<class T>
XAOD_AUXDATA_DEPRECATED bool xAOD::IParticle::isAvailableWritable ( const std::string & name,
const std::string & clsname = "" ) const
inlineinherited

Check if a user property is available for writing or not.

This function can be used to check whether it will be possible to set a user property on the object.

Parameters
nameName of the auxiliary variable
clsnameThe name of the associated class. May be blank
Returns
Whether the decoration is possible to set

Definition at line 152 of file Event/xAOD/xAODBase/xAODBase/IParticle.h.

153 {
154
155 return SG::Accessor< T >(name, clsname).isAvailableWritable(*this);
156 }
bool isAvailableWritable(ELT &e) const
Test to see if this variable exists in the store and is writable.

◆ isolation() [1/2]

float xAOD::Muon_v1::isolation ( const Iso::IsolationType information) const

Accessor to Isolation values , this just returns the value without internaly checking if it exists.

Will lead to an exception if the information is not available

Definition at line 269 of file Muon_v1.cxx.

269 {
270 float isoVal{0.f};
271 isolation(isoVal, information);
272 return isoVal;
273 }
bool isolation(float &value, const Iso::IsolationType information) const
Accessor for Isolation values.
Definition Muon_v1.cxx:257

◆ isolation() [2/2]

bool xAOD::Muon_v1::isolation ( float & value,
const Iso::IsolationType information ) const

Accessor for Isolation values.

If 'information' is stored in this xAOD::Muon and is of the correct type, then the function fills 'value' and returns 'true', otherwise it returns 'false', and does not touch 'value'.

Definition at line 257 of file Muon_v1.cxx.

257 {
258 const SG::AuxElement::Accessor< float >* acc = getIsolationAccessor( information );
259
260 if( ! acc || !acc->isAvailable( *this) ){
261 value =0.;
262 return false;
263 }
264 // Retrieve the value:
265 value = ( *acc )( *this );
266 return true;
267 }
const SG::AuxElement::Accessor< float > * getIsolationAccessor(Iso::IsolationType type)
Get the Accessor object for a given isolation type.

◆ isolationCaloCorrection() [1/2]

float xAOD::Muon_v1::isolationCaloCorrection ( const Iso::IsolationFlavour flavour,
const Iso::IsolationCaloCorrection type,
const Iso::IsolationCorrectionParameter param ) const

Accessor to Isolation Calo corrections , this just returns the correction without internaly checking if it exists.

Will lead to an exception if the information is not available

Definition at line 294 of file Muon_v1.cxx.

295 {
296
297 const SG::AuxElement::Accessor< float > acc = getIsolationCorrectionAccessor(flavour,type,param);
298 if( !acc.isAvailable( *this) ) throw std::runtime_error( "Unknown/Unavailable Isolation correction requested" );
299 return acc( *this );
300 }
virtual Type::ObjectType type() const override
The type of the object as a simple enumeration.
Definition Muon_v1.cxx:95
const SG::AuxElement::Accessor< float > getIsolationCorrectionAccessor(Iso::IsolationFlavour type, Iso::IsolationCaloCorrection corr, Iso::IsolationCorrectionParameter param)

◆ isolationCaloCorrection() [2/2]

bool xAOD::Muon_v1::isolationCaloCorrection ( float & value,
const Iso::IsolationFlavour flavour,
const Iso::IsolationCaloCorrection type,
const Iso::IsolationCorrectionParameter param ) const

Accessor for Isolation Calo correction.

If 'information' is stored in this xAOD::Muon and is of the correct type, then the function fills 'value' and returns 'true', otherwise it returns 'false', and does not touch 'value'.

Definition at line 284 of file Muon_v1.cxx.

286 {
287 const SG::AuxElement::Accessor< float > acc = getIsolationCorrectionAccessor(flavour,type,param);
288 if( !acc.isAvailable( *this) ) return false;
289 // Retrieve the value:
290 value = acc( *this );
291 return true;
292 }

◆ isolationCorrectionBitset() [1/2]

std::bitset< 32 > xAOD::Muon_v1::isolationCorrectionBitset ( const Iso::IsolationFlavour flavour) const

Accessor to Isolation corection Bitset , this just returns the bitset without internaly checking if it exists.

Will lead to an exception if the information is not available

Definition at line 340 of file Muon_v1.cxx.

340 {
341 const SG::AuxElement::Accessor< uint32_t > acc = getIsolationCorrectionBitsetAccessor( flavour );
342 if( !acc.isAvailable( *this) ) throw std::runtime_error( "Unknown/Unavailable Isolation BitSet requested" );
343 return std::bitset<32>( acc( *this ) );
344 }
const SG::AuxElement::Accessor< uint32_t > getIsolationCorrectionBitsetAccessor(Iso::IsolationFlavour type)
Returns an accessor for the correction bitset corresponding to this IsolationType.

◆ isolationCorrectionBitset() [2/2]

bool xAOD::Muon_v1::isolationCorrectionBitset ( std::bitset< 32 > & value,
const Iso::IsolationFlavour flavour ) const

Accessor for Isolation corection Bitset.

Definition at line 332 of file Muon_v1.cxx.

332 {
333 const SG::AuxElement::Accessor< uint32_t > acc = getIsolationCorrectionBitsetAccessor( flavour );
334 if( !acc.isAvailable( *this) ) return false;
335 // Retrieve the value:
336 value = std::bitset<32>(acc( *this ));
337 return true;
338 }

◆ isolationTrackCorrection() [1/2]

float xAOD::Muon_v1::isolationTrackCorrection ( const Iso::IsolationFlavour flavour,
const Iso::IsolationTrackCorrection type ) const

Accessor to Isolation Track corrections , this just returns the correction without internaly checking if it exists.

Will lead to an exception if the information is not available

Definition at line 318 of file Muon_v1.cxx.

318 {
319
320 const SG::AuxElement::Accessor< float > acc = getIsolationCorrectionAccessor(flavour,type);
321 if( !acc.isAvailable( *this) ) throw std::runtime_error( "Unknown/Unavailable Isolation correction requested" );
322 return acc( *this );
323 }

◆ isolationTrackCorrection() [2/2]

bool xAOD::Muon_v1::isolationTrackCorrection ( float & value,
const Iso::IsolationFlavour flavour,
const Iso::IsolationTrackCorrection type ) const

Accessor for Isolation Track correction.

Definition at line 310 of file Muon_v1.cxx.

310 {
311 const SG::AuxElement::Accessor< float > acc = getIsolationCorrectionAccessor(flavour,type);
312 if( !acc.isAvailable( *this) ) return false;
313 // Retrieve the value:
314 value = acc( *this );
315 return true;
316 }

◆ m()

double xAOD::Muon_v1::m ( ) const
overridevirtual

The invariant mass of the particle..

Implements xAOD::IParticle.

Definition at line 67 of file Muon_v1.cxx.

67 {
69 }
constexpr double muonMassInMeV
the mass of the muon (in MeV)

◆ msOnlyExtrapolatedMuonSpectrometerTrackParticleLink()

const ElementLink< TrackParticleContainer > & xAOD::Muon_v1::msOnlyExtrapolatedMuonSpectrometerTrackParticleLink ( ) const

Returns an ElementLink to the MS-only Extrapolated Muon Spectrometer TrackParticle used in identification of this muon.

◆ muonSegment()

const MuonSegment * xAOD::Muon_v1::muonSegment ( size_t i) const

Returns a pointer to the specified MuonSegment.

Parameters
iIndex of the MuonSegment requested. If i is not in range (0<i<nMuonSegments()) an exception will be thrown.

Definition at line 524 of file Muon_v1.cxx.

524 {
525 if (i >= nMuonSegments()) {
526 return nullptr;
527 }
529 if (!el.isValid()) {
530 return nullptr;
531 }
532 return *el;
533 }
size_t nMuonSegments() const
Number of MuonSegments linked to by this Muon.
Definition Muon_v1.cxx:506
static setEnergyLossType const SG::AuxElement::Accessor< std::vector< ElementLink< MuonSegmentContainer > > > muonSegmentsAcc("muonSegmentLinks")

◆ muonSegmentLink()

const ElementLink< MuonSegmentContainer > & xAOD::Muon_v1::muonSegmentLink ( size_t i) const

Returns a link to the specified MuonSegment.

Parameters
iIndex of the MuonSegment requested. If i is not in range (0<i<nMuonSegments()) an exception will be thrown.

Definition at line 514 of file Muon_v1.cxx.

514 {
515 // If a Trk::Track link was not set (yet), return a dummy object:
516 // FIXME - maybe
517 if( ! muonSegmentsAcc.isAvailable( *this ) ) {
519 return dummy;
520 }
521 return muonSegmentsAcc(*this).at(i);
522 }

◆ muonSegmentLinks()

const std::vector< ElementLink< MuonSegmentContainer > > & xAOD::Muon_v1::muonSegmentLinks ( ) const

Returns a vector of ElementLinks to the MuonSegments used to create this Muon.

Todo
complete the various calo energy additions (i.e. depositInCalo etc)

◆ muonSpectrometerTrackParticleLink()

const ElementLink< TrackParticleContainer > & xAOD::Muon_v1::muonSpectrometerTrackParticleLink ( ) const

Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.

◆ muonType()

MuonType xAOD::Muon_v1::muonType ( ) const
Todo
Add documentation. Generic accessor to type information.

◆ nMuonSegments()

size_t xAOD::Muon_v1::nMuonSegments ( ) const

Number of MuonSegments linked to by this Muon.

Definition at line 506 of file Muon_v1.cxx.

506 {
507 // If a link was not set (yet), return zero.
508 if( ! muonSegmentsAcc.isAvailable( *this ) ) {
509 return 0;
510 }
511 return muonSegmentsAcc(*this).size();
512 }

◆ operator=()

Muon_v1 & xAOD::Muon_v1::operator= ( const Muon_v1 & rhs)

Assignment operator.

Definition at line 44 of file Muon_v1.cxx.

44 {
45 if(this == &rhs) return *this;
46
47 if( ( ! hasStore() ) && ( ! container() ) ) {
49 }
50 this->IParticle::operator=( rhs );
51
52 return *this;
53 }
IParticle & operator=(const IParticle &)=default
const SG::AuxVectorData * container() const
Return the container holding this element.
bool hasStore() const
Return true if this object has an associated store.

◆ p4()

Muon_v1::FourMom_t xAOD::Muon_v1::p4 ( ) const
overridevirtual

The full 4-momentum of the particle.

Implements xAOD::IParticle.

Definition at line 84 of file Muon_v1.cxx.

84 {
86 p4.SetPtEtaPhiM( pt(), eta(), phi(), m() );
87 return p4;
88 }
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
Definition Muon_v1.h:96
virtual FourMom_t p4() const override
The full 4-momentum of the particle.
Definition Muon_v1.cxx:84

◆ parameter() [1/2]

bool xAOD::Muon_v1::parameter ( float & value,
const ParamDef parameter ) const

Get a parameter for this Muon - momentumBalanceSignificance for example.

Todo
Finish documentation include matchChi2, muonentrancechi2 (instead of outerMatchChi2). Store chi2/dof instead of two? fitChi2 comes from TrackParticle.

Definition at line 175 of file Muon_v1.cxx.

175 {
176 const Muon_v1::Accessor< float >* acc = parameterAccessorV1<float>( information );
177 if( ! acc || ! acc->isAvailable( *this ) ) {
178 value = 0.;
179 return false;
180 }
181 // Retrieve the value:
182 value = ( *acc )( *this );
183 return true;
184 }
const SG::Accessor< T > * parameterAccessorV1(Muon_v1::ParamDef type)
This function holds on to Accessor objects that can be used by each Muon_v1 object at runtime to get/...

◆ parameter() [2/2]

bool xAOD::Muon_v1::parameter ( int & value,
const ParamDef parameter ) const

Get an integer parameter for this Muon - msInnerMatchDOF for example.

Definition at line 202 of file Muon_v1.cxx.

202 {
203 const Muon_v1::Accessor< int >* acc = parameterAccessorV1<int>( information );
204 if( ! acc || ! acc->isAvailable( *this ) ) {
205 value = 0;
206 return false;
207 }
208 // Retrieve the value:
209 value = ( *acc )( *this );
210 return true;
211 }

◆ passesIDCuts()

bool xAOD::Muon_v1::passesIDCuts ( ) const

MCP ID hit cuts - get/set the corresponding status bit in the quality decoration.

Definition at line 242 of file Muon_v1.cxx.

242 {
243 static const Accessor< uint8_t > acc( "quality" );
244 uint8_t temp = acc( *this );
245 // We use 4th bit for 'passesIDCuts'
246 return temp&8;
247 }

◆ phi()

virtual double xAOD::Muon_v1::phi ( ) const
overridevirtual

The azimuthal angle ( \(\phi\)) of the particle.

Implements xAOD::IParticle.

◆ primaryTrackParticle()

const TrackParticle * xAOD::Muon_v1::primaryTrackParticle ( ) const

Returns a pointer (which should not usually be NULL, but might be if the muon has been stripped of information) to the primary TrackParticle corresponding to the MuonType of this muon.

This is determined in the following order:

  1. CombinedTrackParticle
  2. InnerDetectorTrackParticle
  3. ExtrapolatedMuonSpectrometerTrackParticle
  4. MSOnlyExtrapolatedMuonSpectrometerTrackParticle
  5. MuonSpectrometerTrackParticle

Definition at line 396 of file Muon_v1.cxx.

396 {
397 return trackParticle(TrackParticleType::Primary);
398 }

◆ primaryTrackParticleLink()

const ElementLink< TrackParticleContainer > & xAOD::Muon_v1::primaryTrackParticleLink ( ) const

Definition at line 359 of file Muon_v1.cxx.

359 {
360 switch ( muonType() ) {
361 case Combined :
362 case SiliconAssociatedForwardMuon : {
364 } case SegmentTagged :
365 case CaloTagged :
366 return inDetTrackParticleLink();
367 case MuonStandAlone :
368 {
369 // Not checking if links are valid here - this is the job of the client (as per the cases above).
370 // But we DO check that the link is available, so we can check for both types of links.
371
372 static const Accessor< ElementLink< TrackParticleContainer > > acc1( "extrapolatedMuonSpectrometerTrackParticleLink" );
373 if ( acc1.isAvailable( *this ) && acc1( *this ).isValid() ) {
374 return acc1( *this );
375 }
376
377 static const Accessor< ElementLink< TrackParticleContainer > > acc2( "msOnlyExtrapolatedMuonSpectrometerTrackParticleLink" );
378 if ( acc2.isAvailable( *this ) && acc2( *this ).isValid() ) {
379 return acc2( *this );
380 }
381
382 static const Accessor< ElementLink< TrackParticleContainer > > acc3( "muonSpectrometerTrackParticleLink" );
383 if ( acc3.isAvailable( *this ) && acc3( *this ).isValid()) {
384 return acc3( *this );
385 }
386 // We could also just return a dummy EL here, but the link is part of the aux store, and so it might be that something bad has happened...?
387 throw std::runtime_error("Type is MuonStandAlone but no available link to return!");
388 }
389 default:
390 throw std::runtime_error("Unknown primary type - not sure which track particle to return!");
391 }
392 // static ElementLink< TrackParticleContainer > dummy;
393 // return dummy;
394 }
const ElementLink< TrackParticleContainer > & combinedTrackParticleLink() const
Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.
const ElementLink< TrackParticleContainer > & inDetTrackParticleLink() const
Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.
MuonType muonType() const

◆ pt()

virtual double xAOD::Muon_v1::pt ( ) const
overridevirtual

The transverse momentum ( \(p_T\)) of the particle.

Implements xAOD::IParticle.

◆ quality()

Muon_v1::Quality xAOD::Muon_v1::quality ( ) const

Muon CP quality accessors.

These methods get/set the muon's "quality" decoration, which is a bitfield:

  • Bits 0-2 hold the xAOD::Muon::Quality enum (Tight -> VeryLoose).
  • Higher bits may store auxiliary flags (e.g. ID hit-cuts). This decoration is currently populated by MuonSelectionTool (see MCP documentation). get/set the Quality enum in bits 0-2, preserving higher-bit flags

Definition at line 228 of file Muon_v1.cxx.

228 {
229 static const Accessor< uint8_t > acc( "quality" );
230 uint8_t temp = acc( *this );
231 return static_cast<Quality>(temp&3);
232 }

◆ rapidity()

double xAOD::Muon_v1::rapidity ( ) const
overridevirtual

The true rapidity (y) of the particle.

Implements xAOD::IParticle.

Definition at line 80 of file Muon_v1.cxx.

80 {
81 return genvecP4().Rapidity();
82 }

◆ setAllAuthors()

void xAOD::Muon_v1::setAllAuthors ( uint16_t authors)

◆ setAuthor()

void xAOD::Muon_v1::setAuthor ( const Author auth)

set author

◆ setCharge()

void xAOD::Muon_v1::setCharge ( float charge)

Set the charge (must be the same as primaryTrackParticle() ).

◆ setClusterLink()

void xAOD::Muon_v1::setClusterLink ( const ElementLink< CaloClusterContainer > & link)

Set method for cluster links.

◆ setEnergyLossType()

void xAOD::Muon_v1::setEnergyLossType ( EnergyLossType type)

Set method for the type.

◆ setIsolation()

void xAOD::Muon_v1::setIsolation ( float value,
const Iso::IsolationType information )

Set method for Isolation values.

Definition at line 275 of file Muon_v1.cxx.

275 {
276 const SG::AuxElement::Accessor< float >* acc = getIsolationAccessor( information );
277 if( !acc ) {
278 throw std::runtime_error( "Unknown/Unavailable Isolation type requested" );
279 }
280 // Set the value:
281 ( *acc )( *this ) = value;
282 }

◆ setIsolationCaloCorrection()

bool xAOD::Muon_v1::setIsolationCaloCorrection ( float value,
const Iso::IsolationFlavour flavour,
const Iso::IsolationCaloCorrection type,
const Iso::IsolationCorrectionParameter param )

set method for Isolation Calo Corrections.

Definition at line 302 of file Muon_v1.cxx.

303 {
304 const SG::AuxElement::Accessor< float > acc = getIsolationCorrectionAccessor(flavour,type,param);
305 // Set the value:
306 acc( *this ) = value;
307 return true;
308 }

◆ setIsolationCorrectionBitset()

bool xAOD::Muon_v1::setIsolationCorrectionBitset ( uint32_t value,
const Iso::IsolationFlavour flavour )

Set method for Isolation corection Bitset.

Definition at line 346 of file Muon_v1.cxx.

346 {
347 const SG::AuxElement::Accessor< uint32_t > acc = getIsolationCorrectionBitsetAccessor( flavour );
348 // Set the value:
349 acc( *this ) = value;
350 return true;
351 }

◆ setIsolationTrackCorrection()

bool xAOD::Muon_v1::setIsolationTrackCorrection ( float value,
const Iso::IsolationFlavour flavour,
const Iso::IsolationTrackCorrection type )

Set method for Isolation Track Corrections.

Definition at line 325 of file Muon_v1.cxx.

325 {
326 const SG::AuxElement::Accessor< float > acc = getIsolationCorrectionAccessor(flavour,type);
327 // Set the value:
328 acc( *this ) = value;
329 return true;
330 }

◆ setMuonSegmentLinks()

void xAOD::Muon_v1::setMuonSegmentLinks ( const std::vector< ElementLink< MuonSegmentContainer > > & segments)

Set the vector of ElementLinks to the MuonSegments used to create this Muon.

◆ setMuonType()

void xAOD::Muon_v1::setMuonType ( MuonType type)
Todo
  • do we actually need this? Deduce it from other information?

◆ setP4()

void xAOD::Muon_v1::setP4 ( double pt,
double eta,
double phi )

Set method for IParticle values.

Definition at line 71 of file Muon_v1.cxx.

71 {
72 static const Accessor< float > acc1( "pt" );
73 static const Accessor< float > acc2( "eta" );
74 static const Accessor< float > acc3( "phi" );
75 acc1( *this )=pt;
76 acc2( *this )=eta;
77 acc3( *this )=phi;
78 }

◆ setParameter() [1/2]

void xAOD::Muon_v1::setParameter ( float value,
const ParamDef parameter )

Set method for parameter values.

Definition at line 192 of file Muon_v1.cxx.

192 {
193 const Muon_v1::Accessor< float >* acc = parameterAccessorV1<float>( information );
194 if( ! acc ) {
195 throw std::runtime_error("Muon_v1::setParameter - no float accessor for paramdef number: "
196 +std::to_string(information));
197 }
198 // Set the value:
199 ( *acc )( *this ) = value;
200 }

◆ setParameter() [2/2]

void xAOD::Muon_v1::setParameter ( int value,
const ParamDef parameter )

Set method for parameter values.

Definition at line 219 of file Muon_v1.cxx.

219 {
220 const Muon_v1::Accessor< int >* acc = parameterAccessorV1<int>( information );
221 if( ! acc ) {
222 throw std::runtime_error("Muon_v1::setParameter - no int accessor for paramdef number: "+std::to_string(information));
223 }
224 // Set the value:
225 ( *acc )( *this ) = value;
226 }

◆ setPassesIDCuts()

void xAOD::Muon_v1::setPassesIDCuts ( bool value)

Definition at line 249 of file Muon_v1.cxx.

249 {
250 static const Accessor< uint8_t > acc( "quality" );
251 // We use 4th bit for 'passesIDCuts'
252 if (value) acc( *this ) |= 8;
253 else acc( *this ) &= 247;
254 return;
255 }

◆ setQuality()

void xAOD::Muon_v1::setQuality ( const Quality value)

Definition at line 234 of file Muon_v1.cxx.

234 {
235 static const Accessor< uint8_t > acc( "quality" );
236 uint8_t temp = static_cast< uint8_t >(value);
237 acc( *this ) = acc( *this ) & ~(0x7); // Reset the first 3 bits.
238 acc( *this ) |= temp;
239 return;
240 }

◆ setSummaryValue() [1/2]

void xAOD::Muon_v1::setSummaryValue ( uint8_t value,
const MuonSummaryType information )

Set method for MuonSummaryType.

Definition at line 169 of file Muon_v1.cxx.

169 {
170 const auto& acc = muonTrackSummaryAccessorV1( information );
171 // Set the value:
172 acc(*this) = value;
173 }
const SG::Accessor< uint8_t > & muonTrackSummaryAccessorV1(xAOD::MuonSummaryType type)
Helper function for managing MuonTrackSummary Accessor objects.

◆ setSummaryValue() [2/2]

void xAOD::Muon_v1::setSummaryValue ( uint8_t value,
const SummaryType information )

Set method for storing TrackSummary SummaryType information on the Muon (see Aux to see which is already defined as static).

FIXME!

Definition at line 129 of file Muon_v1.cxx.

129 {
130 const Muon_v1::Accessor< uint8_t >* acc = trackSummaryAccessorV1<uint8_t>( information );
131 // Set the value:
132 ( *acc )( *this ) = value;
133 }
const SG::AuxElement::Accessor< uint8_t > * trackSummaryAccessorV1< uint8_t >(xAOD::SummaryType type)

◆ setTrackParticleLink()

void xAOD::Muon_v1::setTrackParticleLink ( TrackParticleType type,
const ElementLink< TrackParticleContainer > & link )

Set method for TrackParticle links.

Definition at line 460 of file Muon_v1.cxx.

460 {
461 switch ( type ) {
462 case InnerDetectorTrackParticle :
463 static const Accessor< ElementLink< TrackParticleContainer > > acc1( "inDetTrackParticleLink" );
464 acc1(*this)=link;
465 break;
466 case MuonSpectrometerTrackParticle :
467 static const Accessor< ElementLink< TrackParticleContainer > > acc2( "muonSpectrometerTrackParticleLink" );
468 acc2(*this)=link;
469 break;
470 case CombinedTrackParticle :
471 static const Accessor< ElementLink< TrackParticleContainer > > acc3( "combinedTrackParticleLink" );
472 acc3(*this)=link;
473 break;
474 case ExtrapolatedMuonSpectrometerTrackParticle :
475 static const Accessor< ElementLink< TrackParticleContainer > > acc4( "extrapolatedMuonSpectrometerTrackParticleLink" );
476 acc4(*this)=link;
477 break;
478 case MSOnlyExtrapolatedMuonSpectrometerTrackParticle :
479 static const Accessor< ElementLink< TrackParticleContainer > > acc5( "msOnlyExtrapolatedMuonSpectrometerTrackParticleLink" );
480 acc5(*this)=link;
481 break;
482 case Primary :
483 default:
484 throw std::runtime_error("Unknown or Primary TrackParticleType - not sure which track particle to set!");
485 }
486 }
pointer & link(pointer p) const
Return a reference to the link for an element.

◆ summaryValue() [1/3]

bool xAOD::Muon_v1::summaryValue ( float & value,
const SummaryType information ) const

summaryValue(uint8_t& value, const SummaryType information) const;

summaryValue(uint8_t& value, const SummaryType information) const;

Definition at line 137 of file Muon_v1.cxx.

137 {
138 return trackParticle(TrackParticleType::Primary)->summaryValue(value,information);
139 }
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.

◆ summaryValue() [2/3]

bool xAOD::Muon_v1::summaryValue ( uint8_t & value,
const MuonSummaryType information ) const

Accessor for MuonSummaryType.

Definition at line 151 of file Muon_v1.cxx.

151 {
152 const auto& acc = muonTrackSummaryAccessorV1( information );
153 if( !acc.isAvailable( *this ) ) {
154 value = 0;
155 return false;
156 }
157 // Retrieve the value:
158 value = acc( *this );
159 return true;
160 }

◆ summaryValue() [3/3]

bool xAOD::Muon_v1::summaryValue ( uint8_t & value,
const SummaryType information ) const

Accessor for TrackSummary values (in most cases, retrieved from the 'primary' TrackParticle - though it could be stored on the Muon, depending on the job configuration) If 'information' is stored in the primary TrackParticle/Muon and is of the correct templated type T, then the function fills 'value' and returns 'true', otherwise it returns 'false', and does not touch 'value'.

See below for an example of how this is intended to be used.

ATH_MSG_INFO("Successfully retrieved the integer value, numberOfInnermostPixelLayerHits");
}
float numberOfCscPhiHits=0.0; //Wrong! This is actually an int too.
if( !myParticle.summaryValue<float>(numberOfCscPhiHits,numberOfCscPhiHits) ){
ATH_MSG_INFO("Types must match!");
}
#define ATH_MSG_INFO(x)
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
Parameters
[in]informationThe information being requested. This is not guaranteed to be stored in all Muons (or primary TrackParticle).
[out]valueOnly filled if this Muon (or its primary TrackParticle) contains 'information', and the types match.
Returns
Returns 'true' if the Muon contains 'information', and its concrete type matches 'value' (templated type T).

Definition at line 118 of file Muon_v1.cxx.

118 {
119 const auto* acc = trackSummaryAccessorV1<uint8_t>( information );
120 if (acc->isAvailable(*this)) {
121 value = (*acc)( *this );
122 return true;
123 }
124 // Okay - fallback: try to get from TrackParticle.
125 const TrackParticle* primTrk = trackParticle(TrackParticleType::Primary);
126 return primTrk->summaryValue(value, information);
127 }

◆ trackParticle()

const TrackParticle * xAOD::Muon_v1::trackParticle ( TrackParticleType type) const

Returns a pointer (which can be a nullptr) to the TrackParticle used in identification of this muon.

Definition at line 423 of file Muon_v1.cxx.

423 {
424 switch ( type ) {
425 using enum TrackParticleType;
426 case Primary : {
427 switch(muonType()) {
428 using enum MuonType;
429 case Combined:
430 case SiliconAssociatedForwardMuon : {
431 return trackParticle(TrackParticleType::CombinedTrackParticle);
432 } case SegmentTagged:
433 case CaloTagged : {
434 return trackParticle(TrackParticleType::InnerDetectorTrackParticle);
435 } case MuonStandAlone : {
436 for (const auto MsType : {ExtrapolatedMuonSpectrometerTrackParticle,
437 MSOnlyExtrapolatedMuonSpectrometerTrackParticle,
438 MuonSpectrometerTrackParticle}) {
439 if (const TrackParticle* msTrk = trackParticle(MsType); msTrk != nullptr) {
440 return msTrk;
441 }
442 }
443 return nullptr;
444 } default: return nullptr;
445 }
446 } case CombinedTrackParticle :
447 IMPLEMENT_LINK_GETTER(TrackParticleContainer, "combinedTrackParticleLink");
448 case InnerDetectorTrackParticle :
449 IMPLEMENT_LINK_GETTER(TrackParticleContainer, "inDetTrackParticleLink");
450 case MuonSpectrometerTrackParticle :
451 IMPLEMENT_LINK_GETTER(TrackParticleContainer, "muonSpectrometerTrackParticleLink");
452 case ExtrapolatedMuonSpectrometerTrackParticle :
453 IMPLEMENT_LINK_GETTER(TrackParticleContainer, "extrapolatedMuonSpectrometerTrackParticleLink");
454 case MSOnlyExtrapolatedMuonSpectrometerTrackParticle :
455 IMPLEMENT_LINK_GETTER(TrackParticleContainer, "msOnlyExtrapolatedMuonSpectrometerTrackParticleLink");
456 }
457 return nullptr;
458 }
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".

◆ trackParticleLink()

const ElementLink< TrackParticleContainer > & xAOD::Muon_v1::trackParticleLink ( TrackParticleType type) const

Returns an ElementLink to the TrackParticle used in identification of this muon.

Definition at line 400 of file Muon_v1.cxx.

400 {
402 switch ( type ) {
403 case Primary :
405 case CombinedTrackParticle : {
407 } case InnerDetectorTrackParticle :{
408 return inDetTrackParticleLink();
409 } case MuonSpectrometerTrackParticle :{
411 } case ExtrapolatedMuonSpectrometerTrackParticle :{
413 } case MSOnlyExtrapolatedMuonSpectrometerTrackParticle : {
415 } default:
416 throw std::runtime_error("Unknown TrackParticleType - not sure which track particle to return!");
417 }
418 // static ElementLink< TrackParticleContainer > dummy;
419 // return dummy;
420
421 }
const ElementLink< TrackParticleContainer > & extrapolatedMuonSpectrometerTrackParticleLink() const
Returns an ElementLink to the Extrapolated Muon Spectrometer TrackParticle used in identification of ...
const ElementLink< TrackParticleContainer > & msOnlyExtrapolatedMuonSpectrometerTrackParticleLink() const
Returns an ElementLink to the MS-only Extrapolated Muon Spectrometer TrackParticle used in identifica...
const ElementLink< TrackParticleContainer > & muonSpectrometerTrackParticleLink() const
Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.
const ElementLink< TrackParticleContainer > & primaryTrackParticleLink() const
Definition Muon_v1.cxx:359

◆ type()

Type::ObjectType xAOD::Muon_v1::type ( ) const
overridevirtual

The type of the object as a simple enumeration.

Implements xAOD::IParticle.

Definition at line 95 of file Muon_v1.cxx.

95 {
96 return Type::Muon;
97 }

◆ uint8MuonSummaryValue()

float xAOD::Muon_v1::uint8MuonSummaryValue ( const MuonSummaryType information) const

Same as bool summaryValue(uint8_t& value, const MuonSummaryType &information) const, but without check (will throw exception if value isn't there) Primarily for use in Python.

Definition at line 162 of file Muon_v1.cxx.

162 {
163 uint8_t sumVal{0};
164 summaryValue(sumVal, information);
165 return sumVal;
166 }
bool summaryValue(uint8_t &value, const SummaryType information) const
Accessor for TrackSummary values (in most cases, retrieved from the 'primary' TrackParticle - though ...
Definition Muon_v1.cxx:118

◆ uint8SummaryValue()

uint8_t xAOD::Muon_v1::uint8SummaryValue ( const SummaryType information) const

Same as bool summaryValue(uint8_t& value, const SummaryType &information) const, but without check (will throw exception if value isn't there) Primarily for use in Python.

Definition at line 146 of file Muon_v1.cxx.

146 {
147 const Muon_v1::Accessor< uint8_t >* acc = trackSummaryAccessorV1< uint8_t >( information );
148 return ( *acc )( *this );
149 }

The documentation for this class was generated from the following files: