23#define IMPLEMENT_LINK_GETTER(ContType, DECORATOR_NAME) \
25 static const SG::Accessor<ElementLink<ContType>> acc{DECORATOR_NAME}; \
26 if (!acc.isAvailable(*this)) { \
29 const auto& link = acc(*this); \
30 if (!link.isValid()){ \
41 this->makePrivateStore(rhs);
45 if(
this == &rhs)
return *
this;
47 if( ( ! hasStore() ) && ( ! container() ) ) {
72 static const Accessor< float > acc1(
"pt" );
73 static const Accessor< float > acc2(
"eta" );
74 static const Accessor< float > acc3(
"phi" );
106 static const Accessor< uint16_t >
acc(
"allAuthors" );
107 acc(*
this) |= 1<<
static_cast<unsigned int>(
author);
111 static const Accessor< uint16_t >
acc(
"allAuthors" );
112 return (
acc(*
this)& (1<<
static_cast<unsigned int>(
author)));
120 if (
acc->isAvailable(*
this)) {
121 value = (*acc)( *this );
132 ( *acc )( *this ) = value;
143 return ( *
acc )( *this );
148 return ( *
acc )( *this );
153 if( !
acc.isAvailable( *
this ) ) {
158 value =
acc( *
this );
177 if( !
acc || !
acc->isAvailable( *
this ) ) {
182 value = ( *acc )( *this );
195 throw std::runtime_error(
"Muon_v1::setParameter - no float accessor for paramdef number: "
196 +std::to_string(information));
199 ( *acc )( *this ) = value;
204 if( !
acc || !
acc->isAvailable( *
this ) ) {
209 value = ( *acc )( *this );
222 throw std::runtime_error(
"Muon_v1::setParameter - no int accessor for paramdef number: "+std::to_string(information));
225 ( *acc )( *this ) = value;
229 static const Accessor< uint8_t >
acc(
"quality" );
231 return static_cast<Quality
>(temp&3);
235 static const Accessor< uint8_t >
acc(
"quality" );
237 acc( *
this ) =
acc( *
this ) & ~(0x7);
238 acc( *
this ) |= temp;
243 static const Accessor< uint8_t >
acc(
"quality" );
250 static const Accessor< uint8_t >
acc(
"quality" );
252 if (value)
acc( *
this ) |= 8;
253 else acc( *
this ) &= 247;
260 if( !
acc || !
acc->isAvailable( *
this) ){
265 value = ( *acc )( *this );
278 throw std::runtime_error(
"Unknown/Unavailable Isolation type requested" );
281 ( *acc )( *this ) = value;
288 if( !
acc.isAvailable( *
this) )
return false;
290 value =
acc( *
this );
298 if( !
acc.isAvailable( *
this) )
throw std::runtime_error(
"Unknown/Unavailable Isolation correction requested" );
306 acc( *
this ) = value;
312 if( !
acc.isAvailable( *
this) )
return false;
314 value =
acc( *
this );
321 if( !
acc.isAvailable( *
this) )
throw std::runtime_error(
"Unknown/Unavailable Isolation correction requested" );
328 acc( *
this ) = value;
334 if( !
acc.isAvailable( *
this) )
return false;
336 value = std::bitset<32>(
acc( *
this ));
342 if( !
acc.isAvailable( *
this) )
throw std::runtime_error(
"Unknown/Unavailable Isolation BitSet requested" );
343 return std::bitset<32>(
acc( *
this ) );
349 acc( *
this ) = value;
362 case SiliconAssociatedForwardMuon : {
364 }
case SegmentTagged :
367 case MuonStandAlone :
372 static const Accessor< ElementLink< TrackParticleContainer > > acc1(
"extrapolatedMuonSpectrometerTrackParticleLink" );
373 if ( acc1.isAvailable( *
this ) && acc1( *this ).isValid() ) {
374 return acc1( *
this );
377 static const Accessor< ElementLink< TrackParticleContainer > > acc2(
"msOnlyExtrapolatedMuonSpectrometerTrackParticleLink" );
378 if ( acc2.isAvailable( *
this ) && acc2( *this ).isValid() ) {
379 return acc2( *
this );
382 static const Accessor< ElementLink< TrackParticleContainer > > acc3(
"muonSpectrometerTrackParticleLink" );
383 if ( acc3.isAvailable( *
this ) && acc3( *this ).isValid()) {
384 return acc3( *
this );
387 throw std::runtime_error(
"Type is MuonStandAlone but no available link to return!");
390 throw std::runtime_error(
"Unknown primary type - not sure which track particle to return!");
405 case CombinedTrackParticle : {
407 }
case InnerDetectorTrackParticle :{
409 }
case MuonSpectrometerTrackParticle :{
411 }
case ExtrapolatedMuonSpectrometerTrackParticle :{
413 }
case MSOnlyExtrapolatedMuonSpectrometerTrackParticle : {
416 throw std::runtime_error(
"Unknown TrackParticleType - not sure which track particle to return!");
425 using enum TrackParticleType;
430 case SiliconAssociatedForwardMuon : {
431 return trackParticle(TrackParticleType::CombinedTrackParticle);
432 }
case SegmentTagged:
434 return trackParticle(TrackParticleType::InnerDetectorTrackParticle);
435 }
case MuonStandAlone : {
436 for (
const auto MsType : {ExtrapolatedMuonSpectrometerTrackParticle,
437 MSOnlyExtrapolatedMuonSpectrometerTrackParticle,
438 MuonSpectrometerTrackParticle}) {
444 }
default:
return nullptr;
446 }
case CombinedTrackParticle :
448 case InnerDetectorTrackParticle :
450 case MuonSpectrometerTrackParticle :
452 case ExtrapolatedMuonSpectrometerTrackParticle :
454 case MSOnlyExtrapolatedMuonSpectrometerTrackParticle :
462 case InnerDetectorTrackParticle :
463 static const Accessor< ElementLink< TrackParticleContainer > > acc1(
"inDetTrackParticleLink" );
466 case MuonSpectrometerTrackParticle :
467 static const Accessor< ElementLink< TrackParticleContainer > > acc2(
"muonSpectrometerTrackParticleLink" );
470 case CombinedTrackParticle :
471 static const Accessor< ElementLink< TrackParticleContainer > > acc3(
"combinedTrackParticleLink" );
474 case ExtrapolatedMuonSpectrometerTrackParticle :
475 static const Accessor< ElementLink< TrackParticleContainer > > acc4(
"extrapolatedMuonSpectrometerTrackParticleLink" );
478 case MSOnlyExtrapolatedMuonSpectrometerTrackParticle :
479 static const Accessor< ElementLink< TrackParticleContainer > > acc5(
"msOnlyExtrapolatedMuonSpectrometerTrackParticleLink" );
484 throw std::runtime_error(
"Unknown or Primary TrackParticleType - not sure which track particle to set!");
492 idTrack ==
nullptr) {
Scalar eta() const
pseudorapidity method
#define AUXSTORE_PRIMITIVE_GETTER_WITH_CAST(CL, PERSTYPE, TRANSTYPE, NAME)
Macro creating a getter function with a type conversion.
#define AUXSTORE_PRIMITIVE_SETTER_WITH_CAST(CL, PERSTYPE, TRANSTYPE, NAME, SETTER)
Macro creating a setter function with a type conversion.
#define AUXSTORE_OBJECT_GETTER(CL, TYPE, NAME)
Macro creating the reader function for a complex auxiliary property.
#define AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of primitive auxiliary properties.
#define AUXSTORE_OBJECT_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of complex auxiliary properties.
#define IMPLEMENT_LINK_GETTER(ContType, DECORATOR_NAME)
A number of constexpr particle constants to avoid hardcoding them directly in various places.
ElementLink implementation for ROOT usage.
Helper class to provide type-safe access to aux data.
IParticle & operator=(const IParticle &)=default
const ElementLink< TrackParticleContainer > & combinedTrackParticleLink() const
Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.
bool setIsolationCorrectionBitset(uint32_t value, const Iso::IsolationFlavour flavour)
Set method for Isolation corection Bitset.
const ElementLink< MuonSegmentContainer > & muonSegmentLink(size_t i) const
Returns a link to the specified MuonSegment.
Muon_v1()=default
Default constructor.
void setPassesIDCuts(bool)
bool summaryValue(uint8_t &value, const SummaryType information) const
Accessor for TrackSummary values (in most cases, retrieved from the 'primary' TrackParticle - though ...
const ElementLink< TrackParticleContainer > & trackParticleLink(TrackParticleType type) const
Returns an ElementLink to the 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.
virtual double m() const override
The invariant mass of the particle..
void setTrackParticleLink(TrackParticleType type, const ElementLink< TrackParticleContainer > &link)
Set method for TrackParticle links.
bool setIsolationCaloCorrection(float value, const Iso::IsolationFlavour flavour, const Iso::IsolationCaloCorrection type, const Iso::IsolationCorrectionParameter param)
set method for Isolation Calo Corrections.
const ElementLink< TrackParticleContainer > & extrapolatedMuonSpectrometerTrackParticleLink() const
Returns an ElementLink to the Extrapolated Muon Spectrometer TrackParticle used in identification of ...
float floatSummaryValue(const SummaryType information) const
Same as bool summaryValue(float& value, const SummaryType &information) const , but without check (wi...
bool passesIDCuts() const
MCP ID hit cuts - get/set the corresponding status bit in the quality decoration.
void addAllAuthor(const Author author)
add author to all authors
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
float uint8MuonSummaryValue(const MuonSummaryType information) const
Same as bool summaryValue(uint8_t& value, const MuonSummaryType &information) const,...
const MuonSegment * muonSegment(size_t i) const
Returns a pointer to the specified MuonSegment.
virtual double pt() const override
The transverse momentum ( ) of the particle.
bool isAuthor(const Author author) const
Returns 'true' if 'author' is the an author of this muon.
virtual double eta() const override
The pseudorapidity ( ) of the particle.
virtual double e() const override
The total energy of the particle.
bool parameter(float &value, const ParamDef parameter) const
Get a parameter for this Muon - momentumBalanceSignificance for example.
uint8_t uint8SummaryValue(const SummaryType information) const
Same as bool summaryValue(uint8_t& value, const SummaryType &information) const, but without check (w...
bool isolationCaloCorrection(float &value, const Iso::IsolationFlavour flavour, const Iso::IsolationCaloCorrection type, const Iso::IsolationCorrectionParameter param) const
Accessor for Isolation Calo correction.
const ElementLink< TrackParticleContainer > & msOnlyExtrapolatedMuonSpectrometerTrackParticleLink() const
Returns an ElementLink to the MS-only Extrapolated Muon Spectrometer TrackParticle used in identifica...
void setParameter(float value, const ParamDef parameter)
Set method for parameter values.
bool isolation(float &value, const Iso::IsolationType information) const
Accessor for Isolation values.
const TrackParticle * trackParticle(TrackParticleType type) const
Returns a pointer (which can be a nullptr) to the TrackParticle used in identification of this muon.
Muon_v1 & operator=(const Muon_v1 &rhs)
Assignment operator.
float floatParameter(const ParamDef parameter) const
Same as bool parameter(float& value, const ParamDef ¶meter) const, but without check (will throw ...
bool isolationTrackCorrection(float &value, const Iso::IsolationFlavour flavour, const Iso::IsolationTrackCorrection type) const
Accessor for Isolation Track correction.
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : GenVector.
void setQuality(const Quality)
int intParameter(const ParamDef parameter) const
Same as bool parameter(float& value, const ParamDef ¶meter) const, but without check (will throw ...
virtual double phi() const override
The azimuthal angle ( ) of the particle.
const TrackParticle * primaryTrackParticle() const
Returns a pointer (which should not usually be NULL, but might be if the muon has been stripped of in...
size_t nMuonSegments() const
Number of MuonSegments linked to by this Muon.
virtual double rapidity() const override
The true rapidity (y) of the particle.
virtual Type::ObjectType type() const override
The type of the object as a simple enumeration.
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
Base 4 Momentum type for Muon.
virtual FourMom_t p4() const override
The full 4-momentum of the particle.
void setP4(double pt, double eta, double phi)
Set method for IParticle values.
void setIsolation(float value, const Iso::IsolationType information)
Set method for Isolation values.
Quality quality() const
Muon CP quality accessors.
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.
MuonType muonType() const
const ElementLink< TrackParticleContainer > & muonSpectrometerTrackParticleLink() const
Returns an ElementLink to the InnerDetector TrackParticle used in identification of this muon.
const CaloCluster * cluster() const
Retrieve the associated cluster with a bare pointer.
const ElementLink< TrackParticleContainer > & primaryTrackParticleLink() const
void setSummaryValue(uint8_t value, const SummaryType information)
Set method for storing TrackSummary SummaryType information on the Muon (see Aux to see which is alre...
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
constexpr double muonMassInMeV
the mass of the muon (in MeV)
IsolationType
Overall enumeration for isolation types in xAOD files.
IsolationFlavour
Enumeration for different ways of calculating isolation in xAOD files.
IsolationCorrectionParameter
IsolationCaloCorrection
Enumeration for different ways of correcting isolation in xAOD files.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
static setEnergyLossType const SG::AuxElement::Accessor< std::vector< ElementLink< MuonSegmentContainer > > > muonSegmentsAcc("muonSegmentLinks")
setStrategy setMatchFlag ElementLink< TrackParticleContainer >
const SG::AuxElement::Accessor< uint32_t > getIsolationCorrectionBitsetAccessor(Iso::IsolationFlavour type)
Returns an accessor for the correction bitset corresponding to this IsolationType.
setRcore setEtHad setFside pt
AUXSTORE_PRIMITIVE_SETTER_WITH_CAST(CompositeParticle_v1, float, double, px, setPx) AUXSTORE_PRIMITIVE_SETTER_WITH_CAST(CompositeParticle_v1
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
const SG::AuxElement::Accessor< float > * trackSummaryAccessorV1< float >(xAOD::SummaryType type)
const SG::AuxElement::Accessor< uint8_t > * trackSummaryAccessorV1< uint8_t >(xAOD::SummaryType type)
MuonSegmentContainer_v1 MuonSegmentContainer
Definition of the current "MuonSegment container version".
TrackParticle_v1 TrackParticle
Reference the current persistent version:
const SG::AuxElement::Accessor< float > getIsolationCorrectionAccessor(Iso::IsolationFlavour type, Iso::IsolationCaloCorrection corr, Iso::IsolationCorrectionParameter param)
const SG::Accessor< uint8_t > & muonTrackSummaryAccessorV1(xAOD::MuonSummaryType type)
Helper function for managing MuonTrackSummary Accessor objects.
const SG::AuxElement::Accessor< float > * getIsolationAccessor(Iso::IsolationType type)
Get the Accessor object for a given isolation type.
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/...
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
setBGCode setTAP setLVL2ErrorBits bool
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
AUXSTORE_OBJECT_SETTER_AND_GETTER(CaloRings_v1, RingSetLinks, ringSetLinks, setRingSetLinks) unsigned CaloRings_v1
MuonSegment_v1 MuonSegment
Reference the current persistent version:
SummaryType
Enumerates the different types of information stored in Summary.
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.
MuonSummaryType
Enumerates the different types of information stored in Summary.