7#include "AthLinks/ElementLink.h"
13#include "Math/Vector4D.h"
15using ROOT::Math::PtEtaPhiMVector ;
26 return PtEtaPhiMVector(
pt(),
eta(),
phi(),
m() ).E();
30 return PtEtaPhiMVector(
pt(),
eta(),
phi(),
m() ).Rapidity();
69 return Type::FlowElement;
78 setChargedObjectLinks)
84 if(elV.size() != wV.size() ){
85 throw std::runtime_error(
"FlowElement::setChargedObjectLinks : Can not set vectors of links and weights with different sizes");
96 std::vector<const xAOD::IParticle*>
result;
97 result.reserve( elV.size() );
98 for(
const auto& el: elV ){
99 result.push_back( el.isValid() ? *el :
nullptr ) ;
108 std::vector< std::pair<const xAOD::IParticle*,float> >
result;
109 result.reserve( elV.size() );
111 for(
const auto& el: elV ){
112 result.emplace_back( el.isValid() ? *el :
nullptr , 1. ) ;
115 for(
size_t i=0;i<elV.size();i++){
117 result.emplace_back(p , wV[i] );
130 return elV[i].isValid()? *(elV[i]) : nullptr ;
137 if( elV[i].
isValid() )
return { *(elV[i]), wV[i] } ;
138 else return {
nullptr, wV[i] } ;
152 if(elV.size() != wV.size() ){
153 throw std::runtime_error(
"FlowElement::setOtherObjectLinks : Can not set vectors of links and weights with different sizes");
165 std::vector<const xAOD::IParticle*>
result;
166 result.reserve( elV.size() );
167 for(
const auto& el: elV ){
168 result.push_back( el.isValid() ? *el :
nullptr ) ;
177 std::vector< std::pair<const xAOD::IParticle*,float> >
result;
178 result.reserve( elV.size() );
180 for(
const auto& el: elV ){
181 result.emplace_back( el.isValid() ? *el :
nullptr , 1. ) ;
184 for(
size_t i=0;i<elV.size();i++){
186 result.emplace_back(p , wV[i] );
199 return elV[i].isValid()? *(elV[i]) : nullptr ;
206 if( elV[i].
isValid() )
return { *(elV[i]), wV[i] };
207 else return {
nullptr, wV[i] } ;
Scalar eta() const
pseudorapidity method
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
#define AUXSTORE_PRIMITIVE_GETTER_WITH_CAST(CL, PERSTYPE, TRANSTYPE, NAME)
Macro creating a getter 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.
SG::Accessor< T, ALLOC > Accessor
A detector object made of other lower level object(s)
std::size_t nChargedObjects() const
std::size_t nOtherObjects() const
std::vector< const xAOD::IParticle * > chargedObjects() const
virtual double rapidity() const override
The true rapidity (y) of the particle.
std::vector< const xAOD::IParticle * > otherObjects() const
const std::vector< float > & chargedObjectWeights() const
virtual double pt() const override
void setP4(float pt, float eta, float phi, float m)
virtual double m() const override
The invariant mass of the particle.
bool isMatchedToPV(MatchedPVType vxtype=HardScatter) const
const std::vector< ElementLink< IParticleContainer > > & otherObjectLinks() const
virtual double phi() const override
The azimuthal angle ( ) of the particle.
MatchedPVType
Enum to encode high-level information on the vertex associated to this FlowElement.
const std::vector< ElementLink< IParticleContainer > > & chargedObjectLinks() const
Access to the EL.
virtual double eta() const override
The pseudorapidity ( ) of the particle.
signal_t signalType() const
std::vector< std::pair< const xAOD::IParticle *, float > > otherObjectsAndWeights() const
void setChargedObjectLinks(const std::vector< ElementLink< IParticleContainer > > &elV)
std::pair< const xAOD::IParticle *, float > chargedObjectAndWeight(std::size_t i) const
TLorentzVector FourMom_t
Definition of the 4-momentum type.
const std::vector< float > & otherObjectWeights() const
const xAOD::IParticle * chargedObject(std::size_t i) const
virtual Type::ObjectType type() const override
The type of the object as a simple enumeration.
void setOtherObjectLinks(const std::vector< ElementLink< IParticleContainer > > &elV)
virtual double e() const override
The total energy of the particle.
const xAOD::IParticle * otherObject(std::size_t i) const
std::vector< std::pair< const xAOD::IParticle *, float > > chargedObjectsAndWeights() const
virtual FourMom_t p4() const override
The full 4-momentum of the particle.
std::pair< const xAOD::IParticle *, float > otherObjectAndWeight(std::size_t i) const
Class providing the definition of the 4-vector interface.
SG::Accessor< T, ALLOC > Accessor
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
setRcore setEtHad setFside pt
setBGCode setTAP setLVL2ErrorBits bool