ATLAS Offline Software
Loading...
Searching...
No Matches
TrackCaloCluster_v1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4// $Id: TrackCaloCluster_v1.cxx $
5
6// Misc includes
7#include <bitset>
8#include <vector>
9
10// EDM include(s):
12
13// Local include(s):
15
16namespace xAOD {
17
19
21
22 double TrackCaloCluster_v1::e() const {
23 return genvecP4().E();
24 }
25
27 return genvecP4().Rapidity();
28 }
29
35
38 p4.SetPtEtaPhiM( pt(), eta(), phi(), m() );
39 return p4;
40 }
41
45
46 Type::ObjectType TrackCaloCluster_v1::type() const {
47 return Type::TrackCaloCluster;
48 }
49
52 trackParticleLink,
53 setTrackParticleLink)
54
56 // The accessor:
58 if( !acc.isAvailable( *this ) ) {
59 return nullptr;
60 }
61 if( !acc( *this ).isValid() ) {
62 return nullptr;
63 }
64 return *(acc( *this ));
65 }
66
67 AUXSTORE_OBJECT_SETTER_AND_GETTER( TrackCaloCluster_v1,
69 caloClusterLinks,
70 setCaloClusterLinks)
71
72 void TrackCaloCluster_v1::setParameters(float pt, float eta, float phi, float m, TrackCaloCluster_v1::Taste taste,
74 const std::vector< ElementLink< xAOD::CaloClusterContainer > >& clusters) {
75
76 static const Accessor< float > acc1( "pt" );
77 acc1( *this ) = pt;
78 static const Accessor< float > acc2( "eta" );
79 acc2( *this ) = eta;
80 static const Accessor< float > acc3( "phi" );
81 acc3( *this ) = phi;
82 static const Accessor< float > acc4( "m" );
83 acc4( *this ) = m;
84
85 static const Accessor< int > acc( "taste" );
86 acc( *this ) = (int)taste;
87
88 setTrackParticleLink(particle);
89 setCaloClusterLinks(clusters);
90
91 }
92
93
94
95} // namespace xAOD
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define AUXSTORE_PRIMITIVE_GETTER_WITH_CAST(CL, PERSTYPE, TRANSTYPE, NAME)
Macro creating a getter function with a type conversion.
#define AUXSTORE_PRIMITIVE_GETTER(CL, TYPE, NAME)
Macro creating the reader function for a primitive auxiliary property.
#define AUXSTORE_OBJECT_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of complex auxiliary properties.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
IParticle()=default
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
Class describing a TrackCaloCluster.
virtual double m() const
The invariant mass of the particle..
ROOT::Math::LorentzVector< ROOT::Math::PtEtaPhiM4D< double > > GenVecFourMom_t
Base 4 Momentum type (GenVector version)
virtual Type::ObjectType type() const
The type of the object as a simple enumeration.
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : GenVector version.
virtual double phi() const
The azimuthal angle ( ) of the particle (has range to .)
virtual int taste() const
The taste of the particle.
Taste
Type of TrackCaloCluster - Charged - Neutral - Combined.
virtual double pt() const
The transverse momentum ( ) of the particle.
virtual double eta() const
The pseudorapidity ( ) of the particle.
void setCaloClusterLinks(const std::vector< ElementLink< xAOD::CaloClusterContainer > > &caloClusterLinks)
Set the links to the CaloClusters.
const xAOD::TrackParticle * trackParticle() const
Returns a pointer (which can be NULL) to the xAOD::TrackParticle associated with this TrackCaloCluste...
virtual double rapidity() const
The true rapidity (y) of the particle.
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
virtual FourMom_t p4() const
The full 4-momentum of the particle.
virtual double e() const
The total energy of the particle.
void setTrackParticleLink(const ElementLink< xAOD::TrackParticleContainer > &particle)
Set the link to the TrackParticle.
void setParameters(float pt, float eta, float phi, float m, TrackCaloCluster_v1::Taste taste, const ElementLink< xAOD::TrackParticleContainer > &particle, const std::vector< ElementLink< xAOD::CaloClusterContainer > > &clusters)
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setRcore setEtHad setFside pt
TrackParticle_v1 TrackParticle
Reference the current persistent version:
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.