ATLAS Offline Software
Loading...
Searching...
No Matches
L2CombinedMuon_v1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6// System include(s):
7#include <iostream>
8
9// EDM include(s):
11
12// Local include(s):
17
18namespace xAOD {
19
24
26 //
27 // Implementation of the xAOD::IParticle functions
28 //
29
31 pt )
33 eta )
35 phi )
36
37 double L2CombinedMuon_v1::m() const {
38
40 }
41
42 double L2CombinedMuon_v1::e() const {
43
44 return genvecP4().E();
45 }
46
47 double L2CombinedMuon_v1::rapidity() const {
48
49 return genvecP4().Rapidity();
50 }
51
54 p4.SetPtEtaPhiM( pt(), eta(), phi(),m());
55 return p4;
56 }
57
60 return GenVecFourMom_t(pt(), eta(), phi(), m());
61 }
62
64
65 return Type::L2CombinedMuon;
66 }
67
68 //
70
72 //
73 // Implementation of the 4-momentum setter functions
74 //
75
76 void L2CombinedMuon_v1::setPt( float pt ) {
77
78 static const Accessor< float > acc( "pt" );
79 acc( *this ) = pt;
80 return;
81 }
82
84
85 static const Accessor< float > acc( "eta" );
86 acc( *this ) = eta;
87 return;
88 }
89
91
92 static const Accessor< float > acc( "phi" );
93 acc( *this ) = phi;
94 return;
95 }
96
97 //
99
101 //
102 // Implementation of the LVL2 muon iso specific functions
103 //
104
106 charge, setCharge )
108 strategy, setStrategy )
110 errorFlag, setErrorFlag )
112 matchFlag, setMatchFlag )
114 sigmaPt, setSigmaPt )
115
118 idTrackLink, setIdTrackLink )
119
121
123 acc( "idTrackLink" );
124 if( ! acc.isAvailable( *this ) ) {
125 return nullptr;
126 }
127 const ElementLink< TrackParticleContainer >& el = acc( *this );
128 if( ! el.isValid() ) {
129 return nullptr;
130 }
131 return *el;
132 }
133
136 muSATrackLink, setMuSATrackLink )
137
139
141 acc( "muSATrackLink" );
142 if( ! acc.isAvailable( *this ) ) {
143 return nullptr;
144 }
146 if( ! el.isValid() ) {
147 return nullptr;
148 }
149 return *el;
150 }
151
152 //
154
158std::ostream& operator<< ( std::ostream& out,
159 const xAOD::L2CombinedMuon_v1& mu ) {
160
161 out << "charge: " << mu.charge() << "; ";
162 out << "pt: " << mu.pt() << "; ";
163 out << "phi: " << mu.phi() << "; ";
164 out << "eta: " << mu.eta() << "; ";
165 out << "strategy: " << mu.strategy() << "; ";
166 out << "errorFlag: " << mu.errorFlag() << "; ";
167 out << "matchFlag: " << mu.matchFlag() << "; ";
168 out << "sigmaPt: " << mu.sigmaPt();
169
170 // Return the stream:
171 return out;
172}
173
174
175} // namespace xAOD
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_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.
A number of constexpr particle constants to avoid hardcoding them directly in various places.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
IParticle()=default
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
Class describing combined muon reconstructed in the LVL2 trigger.
virtual double m() const
The invariant mass of the particle.
void setPt(float pt)
Set the transverse momentum ( ) of the muon.
virtual double eta() const
The pseudorapidity ( ) of the particle.
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : internal trig muon type.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
virtual double phi() const
The azimuthal angle ( ) of the particle.
virtual double pt() const
The transverse momentum ( ) of the particle.
TLorentzVector FourMom_t
Definition of the 4-momentum type.
virtual Type::ObjectType type() const
The type of the object as a simple enumeration.
virtual double rapidity() const
The true rapidity (y) of the particle.
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
Base 4 Momentum type for trig muons.
virtual double e() const
The total energy of the particle.
void setPhi(float phi)
Set the azimuthal angle ( ) of the muon.
void setEta(float eta)
Set the pseudorapidity ( ) of the muon.
const xAOD::TrackParticle * idTrack() const
Get the ID track as a bare pointer.
const xAOD::L2StandAloneMuon * muSATrack() const
Get the SA muon as a bare pointer.
constexpr double muonMassInMeV
the mass of the muon (in MeV)
ObjectType
Type of objects that have a representation in the xAOD EDM.
Definition ObjectType.h:32
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setStrategy setMatchFlag ElementLink< TrackParticleContainer >
setStrategy setMatchFlag idTrackLink
setRcore setEtHad setFside pt
AUXSTORE_PRIMITIVE_GETTER_WITH_CAST(Muon_v1, uint8_t, Muon_v1::EnergyLossType, energyLossType) AUXSTORE_PRIMITIVE_SETTER_WITH_CAST(Muon_v1
TrackParticle_v1 TrackParticle
Reference the current persistent version:
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1, float, IP2D_pb, setIP2D_pb) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.
L2StandAloneMuon_v2 L2StandAloneMuon
Define the latest version of the muon SA class.
std::ostream & operator<<(std::ostream &out, const std::pair< FIRST, SECOND > &pair)
Helper print operator.
setStrategy matchFlag
AUXSTORE_OBJECT_SETTER_AND_GETTER(CaloRings_v1, RingSetLinks, ringSetLinks, setRingSetLinks) unsigned CaloRings_v1