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

Description of a composite particle, i.e. More...

#include <CompositeParticle_v1.h>

Inheritance diagram for xAOD::CompositeParticle_v1:
Collaboration diagram for xAOD::CompositeParticle_v1:

Classes

struct  MT
 Define the enumeration of calculation methods for the transverse mass. More...

Public Types

using TypelessConstAccessor = ConstAuxElement::TypelessConstAccessor
template<class T, class ALLOC = AuxAllocator_t<T>>
using ConstAccessor = SG::ConstAccessor<T, ALLOC>
template<class T, class ALLOC = AuxAllocator_t<T>>
using Decorator = SG::Decorator<T, ALLOC>

Public Member Functions

 CompositeParticle_v1 ()
 Default constructor.
void toPersistent ()
 Function preparing the object to be persistified.
template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::reference_type auxdata (const std::string &name)
 Fetch an aux data variable, as a non-const reference.
template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type auxdata (const std::string &name) const
 Fetch an aux data variable, as a const reference.
template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED bool isAvailableWritable (const std::string &name, const std::string &clsname="")
 Check if an aux variable is available for writing.
void assign (const AuxElement &other, bool warnUnlocked=false)
 Assignment.
const SG::AuxVectorDatacontainer () const
 Return the container holding this element.
SG::AuxVectorDatacontainer ()
 Return the container holding this element.
template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type auxdataConst (const std::string &name) const
 Fetch an aux data variable, as a const reference.
template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type auxdataConst (const std::string &name, const std::string &clsname) const
 Fetch an aux data variable, as a const reference.
template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED bool isAvailableWritableAsDecoration (const std::string &name, const std::string &clsname="") const
 Check if an aux variable is available for writing as a decoration.
template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Decorator< T, ALLOC >::reference_type auxdecor (const std::string &name) const
 Fetch an aux decoration, as a non-const reference.
template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Decorator< T, ALLOC >::reference_type auxdecor (const std::string &name, const std::string &clsname) const
 Fetch an aux decoration, as a non-const reference.
void makePrivateStore ()
 Create a new (empty) private store for this object.
template<class U1>
void makePrivateStore (const U1 &other, bool warnUnlocked=false)
 Create a new private store for this object and copy aux data.
template<class U1>
void makePrivateStore (const U1 *other, bool warnUnlocked=false)
 Create a new private store for this object and copy aux data.
void releasePrivateStore ()
 Release and free any private store associated with this object.
void setStore (const SG::IConstAuxStore *store)
 Set the store associated with this object.
void setStore (SG::IAuxStore *store)
 Set the store associated with this object.
void setStore (const DataLink< SG::IConstAuxStore > &store)
 Set the store associated with this object.
void setConstStore (const SG::IConstAuxStore *store)
 Synonym for setStore with IConstAuxStore.
void setNonConstStore (SG::IAuxStore *store)
 Synonym for setStore with IAuxStore.
bool usingPrivateStore () const
 Test to see if this object is currently using a private store.
bool usingStandaloneStore () const
 Test to see if this object is currently using a standalone store.
void clearCache ()
 Clear the cached aux data pointers.
const SG::auxid_set_tgetAuxIDs () const
 Return a set of identifiers for existing data items for this object.
const SG::auxid_set_tgetDecorIDs () const
 Return a set of identifiers for decorations for this object.
bool hasStore () const
 Return true if this object has an associated store.
bool hasNonConstStore () const
 Return true if this object has an associated non-const store.
bool clearDecorations () const
 Clear all decorations.
bool trackIndices () const
 Return true if index tracking is enabled for this object.
size_t index () const
 Return the index of this element within its container.
Functions implementing additional 4-momentum properties
double px () const
 Get the px momentum component of the particle.
double py () const
 Get the py momentum component of the particle.
double pz () const
 Get the pz momentum component of the particle.
double et () const
 The transverse energy ( \(e_T\)) of the particle.
void setP4 (const FourMom_t &vec)
 Set the 4-vec.
void setPxPyPzE (double px, double py, double pz, double e)
 Set the 4-vec.
void setPx (double px)
 Set the x-component of the momentum.
void setPy (double py)
 Set the y-component of the momentum.
void setPz (double pz)
 Set the z-component of the momentum.
void setE (double e)
 Set the energy.
Functions implementing other particly-type properties
bool hasCharge () const
 Check if this composite particle has its charge set.
float charge () const
 Return the electric charge.
void setCharge (float charge)
 Set the electric charge.
bool hasPdgId () const
 Check if this composite particle has its charge set.
int pdgId () const
 Return the PDG identifier.
void setPdgId (int pdgID)
 Set the PDG identifier.
Functions returning variables that are calculated from 4-momentum

information from constituents.

The 4-momentum is calculated as the sum of 4-momenta of all the constituent particles whos indices are given in the vector. If one of the indices is -1, then missingET will also be used with pz=0 and E=sqrt(mpx*mpx + mpy*mpy).

FourMom_t p4 (const std::vector< int > &partIndices) const
 The total 4-momentum.
FourMom_t p4 (int partIndexA, int partIndexB) const
 Get the four-momentum with two indices.
FourMom_t p4 (int partIndexA, int partIndexB, int partIndexC) const
 Get the four-momentum with three indices.
FourMom_t p4 (int partIndexA, int partIndexB, int partIndexC, int partIndexD) const
 Get the four-momentum with four indices.
double pt (const std::vector< int > &partIndices) const
 The transverse momentum ( \(p_T\))
double eta (const std::vector< int > &partIndices) const
 The pseudorapidity ( \(\eta\))
double phi (const std::vector< int > &partIndices) const
 The azimuthal angle ( \(\phi\))
double m (const std::vector< int > &partIndices) const
 The invariant mass.
double p (const std::vector< int > &partIndices) const
 The total 3-momentum.
double e (const std::vector< int > &partIndices) const
 The total energy.
double rapidity (const std::vector< int > &partIndices) const
 The true rapidity (y)
double px (const std::vector< int > &partIndices) const
 Get the px momentum component.
double py (const std::vector< int > &partIndices) const
 Get the py momentum component.
double pz (const std::vector< int > &partIndices) const
 Get the pz momentum component.
double et (const std::vector< int > &partIndices) const
 The transverse energy ( \(e_T\)) Note that this differs from ( \(p_T\)) for massive particles.
double mt (const std::vector< int > &partIndices, MT::Method method=MT::DEFAULT) const
 Get the transverse mass.
double mt (int partIndexA, int partIndexB=-2, MT::Method method=MT::DEFAULT) const
 Get the transverse mass with only one constituent particle.
Functions implementing handling of constituents
void addPart (const xAOD::IParticle *part, bool updateFourMom=true)
 Add a particle as an additional constituent.
void addPart (const xAOD::IParticleLink &partLink, bool updateFourMom=true)
 Add a particle as an additional constituent.
void addParts (const xAOD::IParticleLinkContainer &partLinkCont, bool updateFourMom=true)
 Add many constituents at the same time Note that the 4-momentum of this CompositeParticle will be updated accordingly, if updateFourMom=true.
void removePart (const xAOD::IParticle *part, bool updateFourMom=true)
 Remove a particle as a constituent from this CompostiteParticle.
void removePart (const xAOD::IParticleLink &partLink, bool updateFourMom=true)
 Remove a particle as a constituent from this CompostiteParticle.
const xAOD::MissingETmissingET () const
 Get the MissingET object that is associated with this CompositeParticle.
void setMissingET (const xAOD::MissingET *met, bool updateFourMom=true)
 Set the MissingET for this CompositeParticle.
void removeMissingET (bool updateFourMom=true)
 Remove the existing MissingET object from this CompositeParticle.
bool contains (const xAOD::MissingET *met) const
 Check if a given xAOD::MissingET object is part of this CompositeParticle.
bool contains (const xAOD::IParticle *part) const
 Check if a given xAOD::IParticle is a constituent.
bool contains (const xAOD::IParticleLink &partLink) const
 Check if a given xAOD::IParticle is a constituent.
std::size_t nParts () const
 Number of constituent particles.
std::size_t nCompParts () const
 Number of constituent CompositeParticles.
std::size_t nPhotons () const
 Number of constituent photons.
std::size_t nTruthPhotons () const
 Number of constituent truth photons.
std::size_t nElectrons () const
 Number of constituent electrons.
std::size_t nTruthElectrons () const
 Number of constituent truth electrons.
std::size_t nMuons () const
 Number of constituent muons.
std::size_t nTruthMuons () const
 Number of constituent truth muons.
std::size_t nTaus () const
 Number of constituent taus.
std::size_t nTruthTaus () const
 Number of constituent truth taus.
std::size_t nLeptons () const
 Number of constituent leptons (electrons, muons, and taus).
std::size_t nTruthLeptons () const
 Number of constituent truth leptons (truth electrons, truth muons, and truth taus).
std::size_t nJets () const
 Number of constituent jets.
std::size_t nTruthParts () const
 Number of constituent xAOD::TruthParticles.
const xAOD::IParticlepart (std::size_t index=0) const
 Get the constituent IParticle number i.
const xAOD::IParticleLinkpartLink (std::size_t index=0) const
 Get the constituent IParticle number i as an ElementLink.
const xAOD::IParticleLinkContainerpartLinks () const
 Get all constituents in one go.
template<typename CONTTYPE>
ConstDataVector< CONTTYPE > * parts () const
 Method to return a DataVector<T>, e.g., a MuonContainer, for all the constituent particles, e.g., of type xAOD::Muon, that this CompositeParticle has.
xAOD::CompositeParticle_v1compPart (const std::vector< int > &partIndices, const std::vector< int > &otherPartIndices=std::vector< int >{}, bool updateFourMom=true) const
 Get a CompositeParticle that is build on the fly from the constituent particles associated to the indices given (missingET is at index=-1).
xAOD::CompositeParticle_v1compPart (int partIndexA, int partIndexB, int partIndexC=-2, bool updateFourMom=true) const
 Get a CompositeParticle that is build on the fly from the constituent particles associated to the indices given (missingET is at index=-1).
const xAOD::CompositeParticle_v1compPart (std::size_t index=0) const
 Get the constituent number i as a CompositeParticle.
const xAOD::Photonphoton (std::size_t index=0) const
 Get the constituent number i as a Photon.
const xAOD::Electronelectron (std::size_t index=0) const
 Get the constituent number i as an Electron.
const xAOD::Muonmuon (std::size_t index=0) const
 Get the constituent number i as an Muon.
const xAOD::TauJettau (std::size_t index=0) const
 Get the constituent number i as a tau.
const xAOD::Jetjet (std::size_t index=0) const
 Get the constituent number i as a Jet.
const xAOD::TruthParticletruthPart (std::size_t index=0) const
 Get the constituent number i as a TruthParticle.
Functions implementing handling of other constituents. These

The constituent iterators are missing for the moment

other particles are stored separetely from the main constituent particles. They will NOT be used to determine the four-momentum of this CompositeParticle. And they will NOT be used for determining the weight (and other properties) of this CompositeParticle. The main idea is that these other particles can be used for keeping track of, e.g., a third lepton to veto on, or sub-threshold jets.

void addOtherPart (const xAOD::IParticle *part)
 Add a particle as an additional other constituent.
void addOtherPart (const xAOD::IParticleLink &partLink)
 Add a particle as an additional other constituent.
void addOtherParts (const xAOD::IParticleLinkContainer &partLinkCont)
 Add many other constituents at the same time.
void removeOtherPart (const xAOD::IParticle *part)
 Remove a particle as an other constituent from this CompostiteParticle.
void removeOtherPart (const xAOD::IParticleLink &partLink)
 Remove a particle as an other constituent from this CompostiteParticle.
bool containsOther (const xAOD::IParticle *part) const
 Check if a given xAOD::IParticle is an other constituent.
bool containsOther (const xAOD::IParticleLink &partLink) const
 Check if a given xAOD::IParticle is an other constituent.
std::size_t nOtherParts () const
 Number of other constituent particles.
std::size_t nOtherCompParts () const
 Number of other constituent CompositeParticles.
std::size_t nOtherPhotons () const
 Number of other constituent photons.
std::size_t nOtherTruthPhotons () const
 Number of other constituent truth photons.
std::size_t nOtherElectrons () const
 Number of other constituent electrons.
std::size_t nOtherTruthElectrons () const
 Number of other constituent truth electrons.
std::size_t nOtherMuons () const
 Number of other constituent muons.
std::size_t nOtherTruthMuons () const
 Number of other constituent truth muons.
std::size_t nOtherTaus () const
 Number of other constituent taus.
std::size_t nOtherTruthTaus () const
 Number of other constituent truth taus.
std::size_t nOtherLeptons () const
 Number of other constituent leptons (electrons, muons, and taus).
std::size_t nOtherTruthLeptons () const
 Number of other constituent truth leptons (truth electrons, truth muons, and truth taus).
std::size_t nOtherJets () const
 Number of other constituent jets.
std::size_t nOtherTruthParts () const
 Number of other constituent xAOD::TruthParticles.
const xAOD::IParticleotherPart (std::size_t index=0) const
 Get the other constituent IParticle number i.
const xAOD::IParticleLinkotherPartLink (std::size_t index=0) const
 Get the other constituent IParticle number i as an ElementLink.
const xAOD::IParticleLinkContainerotherPartLinks () const
 Get all other constituents in one go.
const xAOD::CompositeParticle_v1otherCompPart (std::size_t index=0) const
 Get the other constituent number i as a CompositeParticle.
const xAOD::PhotonotherPhoton (std::size_t index=0) const
 Get the other constituent number i as a Photon.
const xAOD::ElectronotherElectron (std::size_t index=0) const
 Get the other constituent number i as an Electron.
const xAOD::MuonotherMuon (std::size_t index=0) const
 Get the other constituent number i as an Muon.
const xAOD::TauJetotherTau (std::size_t index=0) const
 Get the other constituent number i as a tau.
const xAOD::JetotherJet (std::size_t index=0) const
 Get the other constituent number i as a Jet.
const xAOD::TruthParticleotherTruthPart (std::size_t index=0) const
 Get the other constituent number i as a TruthParticle.
Functions implementing read-only access to auxdata (for python).

The constituent iterators are missing for the moment

This specialization is needed since ROOT 6.02 doesn't yet support C++11 in the TFormula stuff with JIT compilation, see: https://sft.its.cern.ch/jira/browse/ROOT-5083

bool getBool (const std::string &varName) const
 Access to get a variable of type bool (actually, it is stored using type char)
int getInt (const std::string &varName) const
 Access to get a variable of type int.
unsigned int getUInt (const std::string &varName) const
 Access to get a variable of type unsigned int.
float getFloat (const std::string &varName) const
 Access to get a variable of type float.
double getDouble (const std::string &varName) const
 Access to get a variable of type double.
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.

Static Public Attributes

static constexpr bool supportsThinning = true
 Mark that this type supports thinning operations.

Protected Types

template<class T, class ALLOC = AuxAllocator_t<T>>
using Accessor

Protected Member Functions

void setPartLinks (const xAOD::IParticleLinkContainer &constitLinks)
 Set all constituents in one go.
void setOtherPartLinks (const xAOD::IParticleLinkContainer &otherPartLinks)
 Set all other constituents in one go.
const SG::IConstAuxStoregetConstStore () const
 Return the current store, as a const interface.
SG::IAuxStoregetStore () const
 Return the current store, as a non-const interface.
bool noPrivateData () const
 True if this element has no private data.
bool havePrivateData () const
 True if this element currently has private data.
bool hadPrivateData () const
 True if this element had private data before it was added to its current container.

Private Types

enum class  PrivateStoreState : uint8_t { NO_PRIVATE = 0 , HAVE_PRIVATE = 1 , HAD_PRIVATE = 2 }
 The current private data state. More...

Private Member Functions

void releasePrivateStoreForDtor ()
 Out-of-line portion of destructor.
void setIndex (size_t index, SG::AuxVectorData *container)
 Set the index/container for this element.
bool setIndexPrivate (size_t index, SG::AuxVectorData *container)
 Set the index/container for this element.
void makePrivateStore1 (const void *other, bool warnUnlocked)
 Create a new private store for this object and copy aux data.
void makePrivateStore1 (const AuxElement *other, bool warnUnlocked)
 Create a new private store for this object and copy aux data.
AuxElementStandaloneData * setStore1 (const SG::IConstAuxStore *store)
 Set the store associated with this object.
void clearAux ()
 Clear all aux data associated with this element.
void copyAux (const ConstAuxElement &other, bool warnUnlocked=false)
 Copy aux data from another object.
void setNoPrivateData ()
 Record that this element does not have private data.
void setHavePrivateData ()
 Record that this element currently has private data.
void setHadPrivateData ()
 Record that this element used to have private data.

Static Private Member Functions

static void clearAuxHelper (AuxVectorData &container, size_t index)
 Clear all aux data associated with an element.
static void copyAuxHelper (AuxVectorData &container, size_t index, const ConstAuxElement &other, bool warnUnlocked)
 Copy aux data from another object.

Private Attributes

const SG::AuxVectorDatam_container
 The container of which this object is an element.
size_t m_index
 The index of this element within its container.
PrivateStoreState m_privateStoreState

Functions implementing the xAOD::IParticle interface

typedef IParticle::FourMom_t FourMom_t
 Definition of the 4-momentum type.
typedef ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > GenVecFourMom_t
 Base 4 Momentum type (GenVector)
virtual double pt () const
 The transverse momentum ( \(p_T\)) of the particle.
virtual double eta () const
 The pseudorapidity ( \(\eta\)) of the particle.
virtual double phi () const
 The azimuthal angle ( \(\phi\)) of the particle.
virtual double m () const
 The invariant mass of the particle.
virtual double e () const
 The total energy of the particle.
virtual double rapidity () const
 The true rapidity (y) of the particle.
virtual FourMom_t p4 () const
 The full 4-momentum of the particle.
GenVecFourMom_t genvecP4 () const
 The full 4-momentum of the particle : GenVector form Note: can be slower than just p4 for this class; added for consistency.
virtual Type::ObjectType type () const
 The type of the object as a simple enumeration.

Functions returning variables that are calculated from

information from constituents (not only using their 4-momenta).

float weight (const std::vector< std::string > &varNames, const std::vector< int > &partIndices={}) const
 Get the weight for this xAOD::CompositeParticle by providing a vector of variable names that will be looked for.
float weight (const std::string &varNameA) const
 Get the weight for this xAOD::CompositeParticle.
float weight (const std::string &varNameA, const std::string &varNameB) const
float weight (const std::string &varNameA, const std::string &varNameB, const std::string &varNameC) const
float weight (const std::string &varNameA, const std::string &varNameB, const std::string &varNameC, const std::string &varNameD) const
float weight (const std::string &varNameA, const std::string &varNameB, const std::string &varNameC, const std::string &varNameD, const std::string &varNameE) const
float weightHelper (const xAOD::IParticle *part, const xAOD::IParticle::ConstAccessor< float > &varAcc) const
 This is a private helper method to calculate the weight.

Detailed Description

Description of a composite particle, i.e.

a particle that is composed out of several other particles/objects, e.g., a Z boson that consists out of two muons.

Author
Karsten Koeneke karst.nosp@m.en.k.nosp@m.oenek.nosp@m.e@ce.nosp@m.rn.ch
Revision
696023
Date
2015-09-21 19:09:08 +0200 (Mon, 21 Sep 2015)

Definition at line 45 of file CompositeParticle_v1.h.

Member Typedef Documentation

◆ Accessor

template<class T, class ALLOC = AuxAllocator_t<T>>
using SG::AuxElement::Accessor
protectedinherited

Definition at line 572 of file AuxElement.h.

◆ ConstAccessor

template<class T, class ALLOC = AuxAllocator_t<T>>
using SG::AuxElement::ConstAccessor = SG::ConstAccessor<T, ALLOC>
inherited

Definition at line 569 of file AuxElement.h.

◆ Decorator

template<class T, class ALLOC = AuxAllocator_t<T>>
using SG::AuxElement::Decorator = SG::Decorator<T, ALLOC>
inherited

Definition at line 575 of file AuxElement.h.

◆ FourMom_t

Definition of the 4-momentum type.

Definition at line 68 of file CompositeParticle_v1.h.

◆ GenVecFourMom_t

typedef ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > xAOD::CompositeParticle_v1::GenVecFourMom_t

Base 4 Momentum type (GenVector)

Definition at line 74 of file CompositeParticle_v1.h.

◆ TypelessConstAccessor

using SG::AuxElement::TypelessConstAccessor = ConstAuxElement::TypelessConstAccessor
inherited

Definition at line 566 of file AuxElement.h.

Member Enumeration Documentation

◆ PrivateStoreState

enum class SG::IAuxElement::PrivateStoreState : uint8_t
strongprivateinherited

The current private data state.

Enumerator
NO_PRIVATE 
HAVE_PRIVATE 
HAD_PRIVATE 

Definition at line 131 of file IAuxElement.h.

132 {
133 NO_PRIVATE = 0,
134 HAVE_PRIVATE = 1,
135 HAD_PRIVATE = 2,
136 };

Constructor & Destructor Documentation

◆ CompositeParticle_v1()

xAOD::CompositeParticle_v1::CompositeParticle_v1 ( )

Default constructor.

Definition at line 27 of file CompositeParticle_v1.cxx.

28 : IParticle() {
29 }
IParticle()=default

Member Function Documentation

◆ addOtherPart() [1/2]

void xAOD::CompositeParticle_v1::addOtherPart ( const xAOD::IParticle * part)

Add a particle as an additional other constituent.

◆ addOtherPart() [2/2]

void xAOD::CompositeParticle_v1::addOtherPart ( const xAOD::IParticleLink & partLink)

Add a particle as an additional other constituent.

Definition at line 901 of file CompositeParticle_v1.cxx.

901 {
902 // Check if we have a valid ElementLink
903 if ( ! partLink.isValid() ) {
904 // This should not be... throw an error.
905 throw std::runtime_error("Got an invalid ElementLink when adding constituent!");
906 }
907 xAOD::IParticleLinkContainer& otherPartLinks = otherPartLinksAcc( *this );
908
909 // Add the given ElementLink as a constituent of this composite particle
910 otherPartLinks.push_back( partLink );
911 return;
912 }
const xAOD::IParticleLink & partLink(std::size_t index=0) const
Get the constituent IParticle number i as an ElementLink.
const xAOD::IParticleLinkContainer & otherPartLinks() const
Get all other constituents in one go.
IParticleLinkContainer_v1 IParticleLinkContainer
Define the latest version of the IParticleLinkContainer class.

◆ addOtherParts()

void xAOD::CompositeParticle_v1::addOtherParts ( const xAOD::IParticleLinkContainer & partLinkCont)

Add many other constituents at the same time.

Definition at line 916 of file CompositeParticle_v1.cxx.

916 {
917 for ( xAOD::IParticleLinkContainer::const_iterator
918 constitItr = partLinkCont.begin(),
919 constitItrEnd = partLinkCont.end();
920 constitItr != constitItrEnd;
921 ++constitItr ) {
922 const xAOD::IParticleLink& currentLink = *constitItr;
923 this->addOtherPart( currentLink );
924 }
925 return;
926 }
void addOtherPart(const xAOD::IParticle *part)
Add a particle as an additional other constituent.
IParticleLink_v1 IParticleLink
Define the latest version of the IParticleLink class.

◆ addPart() [1/2]

void xAOD::CompositeParticle_v1::addPart ( const xAOD::IParticle * part,
bool updateFourMom = true )

Add a particle as an additional constituent.

Note that the 4-momentum of this CompositeParticle will be updated accordingly, if updateFourMom=true.

◆ addPart() [2/2]

void xAOD::CompositeParticle_v1::addPart ( const xAOD::IParticleLink & partLink,
bool updateFourMom = true )

Add a particle as an additional constituent.

Note that the 4-momentum of this CompositeParticle will be updated accordingly, if updateFourMom=true.

Definition at line 499 of file CompositeParticle_v1.cxx.

499 {
500 // Check if we have a valid ElementLink
501 if ( ! partLink.isValid() ) {
502 // This should not be... throw an error.
503 throw std::runtime_error("Got an invalid ElementLink when adding constituent!");
504 }
505 xAOD::IParticleLinkContainer& constitLinks = partLinksAcc( *this );
506
507 // Update the four-momentum of this composite particle, if requested
508 if ( updateFourMom ) {
509 this->setP4( this->p4() + (*partLink)->p4() );
510 // Cannot add charge automatically as this is NOT part of the xAOD::IParticle interface
511 //this->setCharge( this->charge() + (*partLink)->charge() );
512 }
513
514 // Add the given ElementLink as a constituent of this composite particle
515 constitLinks.push_back( partLink );
516 return;
517 }
virtual FourMom_t p4() const
The full 4-momentum of the particle.
void setP4(const FourMom_t &vec)
Set the 4-vec.

◆ addParts()

void xAOD::CompositeParticle_v1::addParts ( const xAOD::IParticleLinkContainer & partLinkCont,
bool updateFourMom = true )

Add many constituents at the same time Note that the 4-momentum of this CompositeParticle will be updated accordingly, if updateFourMom=true.

Definition at line 521 of file CompositeParticle_v1.cxx.

522 {
523 for ( xAOD::IParticleLinkContainer::const_iterator
524 constitItr = partLinkCont.begin(),
525 constitItrEnd = partLinkCont.end();
526 constitItr != constitItrEnd;
527 ++constitItr ) {
528 const xAOD::IParticleLink& currentLink = *constitItr;
529 this->addPart( currentLink, updateFourMom );
530 }
531 return;
532 }
void addPart(const xAOD::IParticle *part, bool updateFourMom=true)
Add a particle as an additional constituent.

◆ assign()

void SG::AuxElement::assign ( const AuxElement & other,
bool warnUnlocked = false )
inherited

Assignment.

Parameters
otherThe object from which we're assigning.
warnUnlockedIf true, then warn when we skip unlocked decorations.

We don't copy container/index, as assignment doesn't change where this object is. However, if we have aux data, then we copy aux data if we're copying from an object that also has it; otherwise, if we're copying from an object with no aux data, then we clear ours.

◆ auxdata() [1/4]

template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::reference_type SG::AuxElement::auxdata ( const std::string & name)
inherited

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

Parameters
nameName of the aux variable.

This method has to translate from the aux data name to the internal representation each time it is called. Using this method inside of loops is discouraged; instead use the Accessor class.

◆ auxdata() [2/4]

template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type SG::AuxElement::auxdata ( const std::string & name) const
inherited

Fetch an aux data variable, as a const reference.

Parameters
nameName of the aux variable.

This method has to translate from the aux data name to the internal representation each time it is called. Using this method inside of loops is discouraged; instead use the Accessor or ConstAccessor classes.

◆ auxdata() [3/4]

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 }

◆ auxdata() [4/4]

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 }

◆ auxdataConst() [1/2]

template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type SG::AuxElement::auxdataConst ( const std::string & name) const
inherited

Fetch an aux data variable, as a const reference.

Parameters
nameName of the aux variable.

This method has to translate from the aux data name to the internal representation each time it is called. Using this method inside of loops is discouraged; instead use the ConstAccessor class.

◆ auxdataConst() [2/2]

template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Accessor< T, ALLOC >::const_reference_type SG::AuxElement::auxdataConst ( const std::string & name,
const std::string & clsname ) const
inherited

Fetch an aux data variable, as a const reference.

Parameters
nameName of the aux variable.
clsnameThe name of the associated class. May be blank.

This method has to translate from the aux data name to the internal representation each time it is called. Using this method inside of loops is discouraged; instead use the ConstAccessor class.

◆ auxdecor() [1/2]

template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Decorator< T, ALLOC >::reference_type SG::AuxElement::auxdecor ( const std::string & name) const
inherited

Fetch an aux decoration, as a non-const reference.

Parameters
nameName of the aux variable.

This method has to translate from the aux data name to the internal representation each time it is called. Using this method inside of loops is discouraged; instead use the Accessor class.

If the container is locked, this will allow fetching only variables that do not yet exist (in which case they will be marked as decorations) or variables already marked as decorations.

◆ auxdecor() [2/2]

template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED Decorator< T, ALLOC >::reference_type SG::AuxElement::auxdecor ( const std::string & name,
const std::string & clsname ) const
inherited

Fetch an aux decoration, as a non-const reference.

Parameters
nameName of the aux variable.
clsnameThe name of the associated class. May be blank.

This method has to translate from the aux data name to the internal representation each time it is called. Using this method inside of loops is discouraged; instead use the Accessor class.

If the container is locked, this will allow fetching only variables that do not yet exist (in which case they will be marked as decorations) or variables already marked as decorations.

◆ charge()

float xAOD::CompositeParticle_v1::charge ( ) const

Return the electric charge.

Definition at line 182 of file CompositeParticle_v1.cxx.

182 {
183 if ( chargeAcc.isAvailable(*this) ) {
184 // If we have stored the charge with this CompositeParticle, just use it.
185 return chargeAcc(*this);
186 }
187 else {
188 // Otherwise, try to re-calculate it from the constituents
189 float charge = 0.0;
190 // Sum up the charges of all constituents, if all have it
191 std::size_t nParts = this->nParts();
192 for ( std::size_t i=0; i<nParts; ++i ) {
193 const xAOD::IParticle* part = this->part(i);
194 if (!part) {
195 throw std::runtime_error("Got a zero pointer to an xAOD::IParticle!");
196 }
197 if ( chargeAcc.isAvailable(*part) ) {
198 charge += chargeAcc(*part);
199 }
200 else if ( part->type() != xAOD::Type::CompositeParticle ) {
201 // We have an electron
202 const xAOD::CompositeParticle_v1* compPart = static_cast<const xAOD::CompositeParticle_v1*>(part);
203 charge += compPart->charge();
204 }
205 } // End: loop over all constituent particles
206 return charge;
207 }
208 }
const xAOD::IParticle * part(std::size_t index=0) const
Get the constituent IParticle number i.
std::size_t nParts() const
Number of constituent particles.
float charge() const
Return the electric charge.
xAOD::CompositeParticle_v1 * compPart(const std::vector< int > &partIndices, const std::vector< int > &otherPartIndices=std::vector< int >{}, bool updateFourMom=true) const
Get a CompositeParticle that is build on the fly from the constituent particles associated to the ind...
@ CompositeParticle
Particle composed of other particles.
Definition ObjectType.h:95
static const SG::AuxElement::Accessor< float > chargeAcc("charge")

◆ clearAux()

void SG::AuxElement::clearAux ( )
privateinherited

Clear all aux data associated with this element.

If this object has no associated store, this does nothing. If the associated aux data is const, this throws ExcConstAuxData.

Definition at line 580 of file AuxElement.cxx.

581{
582 if (!m_container) return;
584}
static void clearAuxHelper(AuxVectorData &container, size_t index)
Clear all aux data associated with an element.
const SG::AuxVectorData * container() const
Return the container holding this element.
size_t index() const
Return the index of this element within its container.
const SG::AuxVectorData * m_container
The container of which this object is an element.
Definition AuxElement.h:335

◆ clearAuxHelper()

void SG::AuxElement::clearAuxHelper ( AuxVectorData & container,
size_t index )
staticprivateinherited

Clear all aux data associated with an element.

Parameters
containerContainer of the element.
indexIndex of this element within the container.

If the associated aux data is const, this throws ExcConstAuxData.

Definition at line 639 of file AuxElement.cxx.

640{
641 if (!container.hasStore()) return;
642 if (!container.hasNonConstStore()) {
643 throw SG::ExcConstAuxData ("clearAux", SG::null_auxid);
644 }
645
646 SG::AuxTypeRegistry& r = SG::AuxTypeRegistry::instance();
647 for (SG::auxid_t auxid : container.getWritableAuxIDs()) {
648 r.clear (auxid, container, index, 1);
649 }
650}
static AuxTypeRegistry & instance()
Return the singleton registry instance.
int r
Definition globals.cxx:22
static const auxid_t null_auxid
To signal no aux data item.
Definition AuxTypes.h:30
size_t auxid_t
Identifier for a particular aux data item.
Definition AuxTypes.h:27

◆ clearCache()

void SG::AuxElement::clearCache ( )
inherited

Clear the cached aux data pointers.

You should call this any time something changes in the aux store that could invalidate the vector pointers.

Definition at line 339 of file AuxElement.cxx.

340{
341 if (container())
343}
void clearCache()
Clear the cached aux data pointers.

◆ clearDecorations()

bool SG::AuxElement::clearDecorations ( ) const
inherited

Clear all decorations.

Erase all decorations from an associated store, restoring the state to when lock was called.

Returns true if there were any decorations that were cleared, false if the store did not contain any decorations.

Definition at line 428 of file AuxElement.cxx.

429{
430 if (havePrivateData())
431 return m_container->clearDecorations();
432 return false;
433}
bool havePrivateData() const
True if this element currently has private data.

◆ compPart() [1/3]

xAOD::CompositeParticle_v1 * xAOD::CompositeParticle_v1::compPart ( const std::vector< int > & partIndices,
const std::vector< int > & otherPartIndices = std::vector< int >{},
bool updateFourMom = true ) const

Get a CompositeParticle that is build on the fly from the constituent particles associated to the indices given (missingET is at index=-1).

If the second list of idices is given, also the "other" particles will be used in building this CompositeParticle.

◆ compPart() [2/3]

xAOD::CompositeParticle_v1 * xAOD::CompositeParticle_v1::compPart ( int partIndexA,
int partIndexB,
int partIndexC = -2,
bool updateFourMom = true ) const
inline

Get a CompositeParticle that is build on the fly from the constituent particles associated to the indices given (missingET is at index=-1).

This specialization to the above method is needed since ROOT 6.02 doesn't yet support C++11 in the TFormula stuff with JIT compilation, see: https://sft.its.cern.ch/jira/browse/ROOT-5083

Definition at line 418 of file CompositeParticle_v1.h.

419 {
420 if ( partIndexC==-2 ) {
421 return this->compPart( std::vector<int>{partIndexA, partIndexB}, std::vector<int>{}, updateFourMom );
422 }
423 return this->compPart( std::vector<int>{partIndexA, partIndexB, partIndexC}, std::vector<int>{}, updateFourMom );
424 }

◆ compPart() [3/3]

const xAOD::CompositeParticle_v1 * xAOD::CompositeParticle_v1::compPart ( std::size_t index = 0) const
inline

Get the constituent number i as a CompositeParticle.

If the cast to CompositeParticle fails for a constituent, a null pointer is returned.

Definition at line 642 of file CompositeParticle_v1.h.

643{
644 const xAOD::IParticle* ipart = this->part(index);
645 if ( ipart->type() != xAOD::Type::CompositeParticle ){ return 0; }
646 return static_cast<const xAOD::CompositeParticle_v1*>(ipart);
647}
size_t index() const
Return the index of this element within its container.
virtual Type::ObjectType type() const =0
The type of the object as a simple enumeration.

◆ container() [1/2]

SG::AuxVectorData * SG::AuxElement::container ( )
inherited

Return the container holding this element.

◆ container() [2/2]

const SG::AuxVectorData * SG::AuxElement::container ( ) const
inherited

Return the container holding this element.

◆ contains() [1/3]

bool xAOD::CompositeParticle_v1::contains ( const xAOD::IParticle * part) const

Check if a given xAOD::IParticle is a constituent.

Definition at line 687 of file CompositeParticle_v1.cxx.

687 {
688 const xAOD::IParticleLinkContainer& constitLinks = this->partLinks();
689 for ( xAOD::IParticleLinkContainer::const_iterator
690 constitItr = constitLinks.begin(),
691 constitItrEnd = constitLinks.end();
692 constitItr != constitItrEnd;
693 ++constitItr ) {
694 const xAOD::IParticleLink& currentLink = *constitItr;
695 if ( ! currentLink.isValid() ) continue;
696 const xAOD::IParticle* currentPart = *currentLink;
697 if ( part == currentPart ) {
698 return true;
699 }
700 }
701 return false;
702 }
const xAOD::IParticleLinkContainer & partLinks() const
Get all constituents in one go.

◆ contains() [2/3]

bool xAOD::CompositeParticle_v1::contains ( const xAOD::IParticleLink & partLink) const

Check if a given xAOD::IParticle is a constituent.

Definition at line 706 of file CompositeParticle_v1.cxx.

706 {
707 const xAOD::IParticleLinkContainer& constitLinks = this->partLinks();
708 for ( xAOD::IParticleLinkContainer::const_iterator
709 constitItr = constitLinks.begin(),
710 constitItrEnd = constitLinks.end();
711 constitItr != constitItrEnd;
712 ++constitItr ) {
713 const xAOD::IParticleLink& currentLink = *constitItr;
714 if ( partLink == currentLink ) {
715 return true;
716 }
717 }
718 return false;
719 }

◆ contains() [3/3]

bool xAOD::CompositeParticle_v1::contains ( const xAOD::MissingET * met) const

Check if a given xAOD::MissingET object is part of this CompositeParticle.

Definition at line 660 of file CompositeParticle_v1.cxx.

660 {
661 const ElementLink<xAOD::MissingETContainer>& metLink = metLinkAcc(*this);
662 // Check if we have a valid ElementLink. If not, return false. This is
663 // because the given met that we check against obviously exists, meaning
664 // that if it would be the same, the ElementLink should have been valid.
665 if ( ! metLink.isValid() ) {
666 return false;
667 }
668 const xAOD::MissingET* thisMet = *metLink;
669
670 // Check if the pointers are equal
671 if ( thisMet == met ) {
672 return true;
673 }
674
675 // Use the MissingET == operator
676 if ( (*thisMet) == (*met) ) {
677 return true;
678 }
679
680 // Otherwise, return false
681 return false;
682 }
MissingET_v1 MissingET
Version control by type defintion.
static const SG::AuxElement::Accessor< ElementLink< xAOD::MissingETContainer > > metLinkAcc("missingETLink")

◆ containsOther() [1/2]

bool xAOD::CompositeParticle_v1::containsOther ( const xAOD::IParticle * part) const

Check if a given xAOD::IParticle is an other constituent.

Definition at line 975 of file CompositeParticle_v1.cxx.

975 {
977 for ( xAOD::IParticleLinkContainer::const_iterator
978 constitItr = otherPartLinks.begin(),
979 constitItrEnd = otherPartLinks.end();
980 constitItr != constitItrEnd;
981 ++constitItr ) {
982 const xAOD::IParticleLink& currentLink = *constitItr;
983 if ( ! currentLink.isValid() ) continue;
984 const xAOD::IParticle* currentPart = *currentLink;
985 if ( part == currentPart ) {
986 return true;
987 }
988 }
989 return false;
990 }

◆ containsOther() [2/2]

bool xAOD::CompositeParticle_v1::containsOther ( const xAOD::IParticleLink & partLink) const

Check if a given xAOD::IParticle is an other constituent.

Definition at line 994 of file CompositeParticle_v1.cxx.

994 {
996 for ( xAOD::IParticleLinkContainer::const_iterator
997 constitItr = otherPartLinks.begin(),
998 constitItrEnd = otherPartLinks.end();
999 constitItr != constitItrEnd;
1000 ++constitItr ) {
1001 const xAOD::IParticleLink& currentLink = *constitItr;
1002 if ( partLink == currentLink ) {
1003 return true;
1004 }
1005 }
1006 return false;
1007 }

◆ copyAux()

void SG::AuxElement::copyAux ( const ConstAuxElement & other,
bool warnUnlocked = false )
privateinherited

Copy aux data from another object.

Parameters
otherThe object from which to copy.
warnUnlockedIf true, then warn when we skip unlocked decorations.

If this object has no associated store, this does nothing. If the associated aux data is const, this throws ExcConstAuxData.

All aux data items from other are copied to this object. Any aux data items associated with this object that are not present in other are cleared. (If other has no aux data, then all aux data items for this object are cleared.)

Definition at line 600 of file AuxElement.cxx.

602{
603 if (!m_container) return;
604 copyAuxHelper (*container(), index(), other, warnUnlocked);
605}
static void copyAuxHelper(AuxVectorData &container, size_t index, const ConstAuxElement &other, bool warnUnlocked)
Copy aux data from another object.

◆ copyAuxHelper()

void SG::AuxElement::copyAuxHelper ( AuxVectorData & container,
size_t index,
const ConstAuxElement & other,
bool warnUnlocked )
staticprivateinherited

Copy aux data from another object.

Parameters
containerContainer of the element.
indexIndex of this element within the container.
otherThe object from which to copy.
warnUnlockedIf true, then warn when we skip unlocked decorations.

If the associated aux data is const, this throws ExcConstAuxData.

All aux data items from other are copied to this object. Any aux data items associated with this object that are not present in other are cleared. (If other has no aux data, then all aux data items for this object are cleared.)

Definition at line 667 of file AuxElement.cxx.

671{
672 if (!container.hasStore()) return;
673 if (!container.hasNonConstStore())
674 throw SG::ExcConstAuxData ("copyAux");
675
676 const SG::AuxVectorData* ocont = other.container();
677
678 if (!ocont || !ocont->hasStore()) {
680 return;
681 }
682
683#ifndef XAOD_STANDALONE
684 const SG::auxid_set_t& other_decors = ocont->getDecorIDs();
685#endif
686 SG::auxid_set_t other_ids = ocont->getAuxIDs();
687
688 size_t oindex = other.index();
689 SG::AuxTypeRegistry& r = SG::AuxTypeRegistry::instance();
690
691 for (SG::auxid_t auxid : other_ids) {
692#ifndef XAOD_STANDALONE
693 if (other_decors.test (auxid)) {
694 // Don't copy decorations --- another thread may be modifying them.
695 other_ids.reset (auxid);
696 // Warn if we skip a decoration (except for mcEventWeights,
697 // for which this is expected).
698 if (warnUnlocked && r.getName(auxid) != "mcEventWeights") {
699 std::ostringstream ss;
700 ss << "skipped unlocked decoration " << r.getName(auxid)
701 << " (" << auxid << ")";
702 ATHCONTAINERS_WARNING("copyAux", ss.str());
703 }
704 }
705 else
706#endif
707 if (!r.isLinked (auxid)) {
708 r.copy (auxid, container, index, *ocont, oindex, 1);
709 }
710 }
711
712 for (SG::auxid_t auxid : container.getWritableAuxIDs()) {
713 if (!other_ids.test (auxid)) {
714 r.clear (auxid, container, index, 1);
715 }
716 }
717}
static Double_t ss
bool test(bit_t bit) const
Test to see if a bit is set.
const SG::auxid_set_t & getAuxIDs() const
Return a set of identifiers for existing data items in store associated with this object.
const SG::auxid_set_t & getDecorIDs() const
Return a set of identifiers for decorations for this object.
bool hasStore() const
Return true if this object has an associated store.
#define ATHCONTAINERS_WARNING(ctx, msg)
Definition error.h:57

◆ e() [1/2]

double xAOD::CompositeParticle_v1::e ( ) const
virtual

The total energy of the particle.

Implements xAOD::IParticle.

Definition at line 107 of file CompositeParticle_v1.cxx.

107 {
108 return p4().E();
109 }

◆ e() [2/2]

double xAOD::CompositeParticle_v1::e ( const std::vector< int > & partIndices) const

The total energy.

◆ electron()

const xAOD::Electron * xAOD::CompositeParticle_v1::electron ( std::size_t index = 0) const
inline

Get the constituent number i as an Electron.

If the cast to Electron fails for a constituent, a null pointer is returned.

Definition at line 662 of file CompositeParticle_v1.h.

663{
664 const xAOD::IParticle* ipart = this->part(index);
665 if ( ipart->type() != xAOD::Type::Electron ){ return 0; }
666 return static_cast<const xAOD::Electron*>(ipart);
667}
@ Electron
The object is an electron.
Definition ObjectType.h:46
Electron_v1 Electron
Definition of the current "egamma version".

◆ et() [1/2]

double xAOD::CompositeParticle_v1::et ( ) const

The transverse energy ( \(e_T\)) of the particle.

Note that this differs from ( \(p_T\)) for massive particles.

Definition at line 127 of file CompositeParticle_v1.cxx.

127 {
128 return p4().Et();
129 }

◆ et() [2/2]

double xAOD::CompositeParticle_v1::et ( const std::vector< int > & partIndices) const

The transverse energy ( \(e_T\)) Note that this differs from ( \(p_T\)) for massive particles.

◆ eta() [1/2]

double xAOD::CompositeParticle_v1::eta ( ) const
virtual

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

Implements xAOD::IParticle.

Definition at line 48 of file CompositeParticle_v1.cxx.

48 {
49 return p4().Eta();
50 }

◆ eta() [2/2]

double xAOD::CompositeParticle_v1::eta ( const std::vector< int > & partIndices) const

The pseudorapidity ( \(\eta\))

◆ genvecP4()

CompositeParticle_v1::GenVecFourMom_t xAOD::CompositeParticle_v1::genvecP4 ( ) const

The full 4-momentum of the particle : GenVector form Note: can be slower than just p4 for this class; added for consistency.

Definition at line 83 of file CompositeParticle_v1.cxx.

83 {
84 if ( accPx.isAvailable(*this) && accPy.isAvailable(*this)
85 && accPz.isAvailable(*this) && accE.isAvailable(*this) ) {
86 // We have everything stored with this CompositeParticle. Just use it.
87 const double px = static_cast<double>(accPx(*this));
88 const double py = static_cast<double>(accPy(*this));
89 const double pz = static_cast<double>(accPz(*this));
90 const double e = static_cast<double>(accE(*this));
91 return GenVecFourMom_t( px, py, pz, e );
92 }
93 else {
94 // Not everything is stored, we need to re-calculate the p4 based on the constituents.
95 // Create an empty vector such that the subsequent call will use all constituents.
96 const std::vector<int> partIndices;
97 FourMom_t fourmom = p4(partIndices);
98 return GenVecFourMom_t(fourmom.Px(), fourmom.Py(), fourmom.Pz(), fourmom.E());
99 }
100 }
double pz() const
Get the pz momentum component of the particle.
double py() const
Get the py momentum component of the particle.
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
double px() const
Get the px momentum component of the particle.
virtual double e() const
The total energy of the particle.
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > GenVecFourMom_t
Base 4 Momentum type (GenVector)
static const SG::AuxElement::Accessor< float > accPx("px")
static const SG::AuxElement::Accessor< float > accPy("py")
static const SG::AuxElement::Accessor< float > accPz("pz")
static const SG::AuxElement::Accessor< float > accE("e")

◆ getAuxIDs()

const SG::auxid_set_t & SG::AuxElement::getAuxIDs ( ) const
inherited

Return a set of identifiers for existing data items for this object.

If this object has a private or standalone store, then information from that will be returned. Otherwise, if this element is part of a container, then information for the container will be returned. Otherwise, return an empty set.

Definition at line 355 of file AuxElement.cxx.

356{
357#ifdef ATHCONTAINERS_R21_COMPAT
358 if (havePrivateData())
359 return m_container->getConstStore()->getAuxIDs();
360 if (container())
361 return container()->getAuxIDs();
362 static const SG::auxid_set_t null_set;
363 return null_set;
364#else
366#endif
367}
const SG::auxid_set_t & getAuxIDs() const
Return a set of identifiers for existing data items for this object.

◆ getBool()

bool xAOD::CompositeParticle_v1::getBool ( const std::string & varName) const
inline

Access to get a variable of type bool (actually, it is stored using type char)

Definition at line 589 of file CompositeParticle_v1.h.

589 {
590 return SG::ConstAccessor<bool>(varName)(*this);
591 }

◆ getConstStore()

const SG::IConstAuxStore * SG::AuxElement::getConstStore ( ) const
protectedinherited

Return the current store, as a const interface.

This will be non-zero if either a const or non-const store is associated with this object. This will fetch either a private or standalone store.

Definition at line 869 of file AuxElement.cxx.

305{
306 if (havePrivateData()) {
307 return m_container->getConstStore();
308 }
309 return 0;
310}

◆ getDecorIDs()

const SG::auxid_set_t & SG::AuxElement::getDecorIDs ( ) const
inherited

Return a set of identifiers for decorations for this object.

   If this object has a private or standalone store, then information
   from that will be returned.  Otherwise, if this element
   is part of a container, then information for the container
   will be returned.  Otherwise, return an empty set.

Definition at line 378 of file AuxElement.cxx.

379{
380#ifdef ATHCONTAINERS_R21_COMPAT
381 if (havePrivateData())
382 return m_container->getConstStore()->getDecorIDs();
383 if (container())
384 return container()->getDecorIDs();
385 static const SG::auxid_set_t null_set;
386 return null_set;
387#else
389#endif
390}
const SG::auxid_set_t & getDecorIDs() const
Return a set of identifiers for decorations for this object.

◆ getDouble()

double xAOD::CompositeParticle_v1::getDouble ( const std::string & varName) const
inline

Access to get a variable of type double.

Definition at line 609 of file CompositeParticle_v1.h.

609 {
610 return SG::ConstAccessor<double>(varName)(*this);
611 }

◆ getFloat()

float xAOD::CompositeParticle_v1::getFloat ( const std::string & varName) const
inline

Access to get a variable of type float.

Definition at line 604 of file CompositeParticle_v1.h.

604 {
605 return SG::ConstAccessor<float>(varName)(*this);
606 }

◆ getInt()

int xAOD::CompositeParticle_v1::getInt ( const std::string & varName) const
inline

Access to get a variable of type int.

Definition at line 594 of file CompositeParticle_v1.h.

594 {
595 return SG::ConstAccessor<int>(varName)(*this);
596 }

◆ getStore()

SG::IAuxStore * SG::AuxElement::getStore ( ) const
protectedinherited

Return the current store, as a non-const interface.

This will be non-zero if a non-const store is associated with this object. This will fetch either a private or standalone store.

Definition at line 878 of file AuxElement.cxx.

320{
321 if (havePrivateData()) {
322#ifdef ATHCONTAINERS_R21_COMPAT
323 SG::AuxVectorData* container_nc ATLAS_THREAD_SAFE = m_container;
324#else
325 SG::AuxVectorData* container_nc ATLAS_THREAD_SAFE = const_cast<SG::AuxVectorData*>(container());
326#endif
327 return container_nc->getStore();
328 }
329 return 0;
330}
#define ATLAS_THREAD_SAFE

◆ getUInt()

unsigned int xAOD::CompositeParticle_v1::getUInt ( const std::string & varName) const
inline

Access to get a variable of type unsigned int.

Definition at line 599 of file CompositeParticle_v1.h.

599 {
600 return SG::ConstAccessor<unsigned int>(varName)(*this);
601 }

◆ hadPrivateData()

bool SG::IAuxElement::hadPrivateData ( ) const
protectedinherited

True if this element had private data before it was added to its current container.

◆ hasCharge()

setPy setE bool xAOD::CompositeParticle_v1::hasCharge ( ) const

Check if this composite particle has its charge set.

Definition at line 177 of file CompositeParticle_v1.cxx.

177 {
178 return chargeAcc.isAvailable( *this );
179 }

◆ hasNonConstStore()

bool SG::AuxElement::hasNonConstStore ( ) const
inherited

Return true if this object has an associated non-const store.

This will be true for either a private or standalone store.

Definition at line 411 of file AuxElement.cxx.

412{
413 if (havePrivateData())
414 return m_container->hasNonConstStore();
415 return false;
416}

◆ hasPdgId()

bool xAOD::CompositeParticle_v1::hasPdgId ( ) const

Check if this composite particle has its charge set.

Definition at line 217 of file CompositeParticle_v1.cxx.

217 {
218 return pdgAcc.isAvailable( *this );
219 }
static const SG::AuxElement::Accessor< int > pdgAcc("pdgId")

◆ hasStore()

bool SG::AuxElement::hasStore ( ) const
inherited

Return true if this object has an associated store.

This will be true for either a private or standalone store.

Definition at line 398 of file AuxElement.cxx.

399{
400 if (havePrivateData())
401 return m_container->hasStore();
402 return false;
403}

◆ havePrivateData()

bool SG::IAuxElement::havePrivateData ( ) const
protectedinherited

True if this element currently has private data.

◆ index()

size_t SG::IAuxElement::index ( ) const
inherited

Return the index of this element within its container.

Inherited from IAuxElement.

◆ 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 }

◆ isAvailableWritable() [1/2]

template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED bool SG::AuxElement::isAvailableWritable ( const std::string & name,
const std::string & clsname = "" )
inherited

Check if an aux variable is available for writing.

Parameters
nameName of the aux variable.
clsnameThe name of the associated class. May be blank.

This method has to translate from the aux data name to the internal representation each time it is called. Using this method inside of loops is discouraged; instead use the Accessor class.

◆ isAvailableWritable() [2/2]

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 }

◆ isAvailableWritableAsDecoration()

template<class T, class ALLOC = AuxAllocator_t<T>>
XAOD_AUXDATA_DEPRECATED bool SG::AuxElement::isAvailableWritableAsDecoration ( const std::string & name,
const std::string & clsname = "" ) const
inherited

Check if an aux variable is available for writing as a decoration.

Parameters
nameName of the aux variable.
clsnameThe name of the associated class. May be blank.

This method has to translate from the aux data name to the internal representation each time it is called. Using this method inside of loops is discouraged; instead use the Accessor class.

◆ jet()

const xAOD::Jet * xAOD::CompositeParticle_v1::jet ( std::size_t index = 0) const
inline

Get the constituent number i as a Jet.

If the cast to Jet fails for a constituent, a null pointer is returned.

Definition at line 692 of file CompositeParticle_v1.h.

693{
694 const xAOD::IParticle* ipart = this->part(index);
695 if ( ipart->type() != xAOD::Type::Jet ){ return 0; }
696 return static_cast<const xAOD::Jet*>(ipart);
697}
@ Jet
The object is a jet.
Definition ObjectType.h:40
Jet_v1 Jet
Definition of the current "jet version".

◆ m() [1/2]

double xAOD::CompositeParticle_v1::m ( ) const
virtual

The invariant mass of the particle.

Implements xAOD::IParticle.

Definition at line 56 of file CompositeParticle_v1.cxx.

56 {
57 return p4().M();
58 }

◆ m() [2/2]

double xAOD::CompositeParticle_v1::m ( const std::vector< int > & partIndices) const

The invariant mass.

◆ makePrivateStore() [1/3]

void SG::AuxElement::makePrivateStore ( )
inherited

Create a new (empty) private store for this object.

ExcBadPrivateStore will be thrown if this object is already associated with a store.

Definition at line 192 of file AuxElement.cxx.

193{
194 if (m_container) {
195 throw SG::ExcBadPrivateStore ("store already exists");
196 }
197
198 m_container = new SG::AuxElementPrivateData;
201}
void setIndex(size_t index)
Set the index of this element within its container.
void setHavePrivateData()
Record that this element currently has private data.

◆ makePrivateStore() [2/3]

template<class U1>
void SG::AuxElement::makePrivateStore ( const U1 & other,
bool warnUnlocked = false )
inherited

Create a new private store for this object and copy aux data.

Parameters
otherThe object from which aux data should be copied.
warnUnlockedIf true, then warn when we skip unlocked decorations.

ExcBadPrivateStore will be thrown if this object is already associated with a store.

If other is an object that has aux data, then those data will be copied; otherwise, nothing will be done.

◆ makePrivateStore() [3/3]

template<class U1>
void SG::AuxElement::makePrivateStore ( const U1 * other,
bool warnUnlocked = false )
inherited

Create a new private store for this object and copy aux data.

Parameters
otherThe object from which aux data should be copied.
warnUnlockedIf true, then warn when we skip unlocked decorations.

ExcBadPrivateStore will be thrown if this object is already associated with a store.

If other is an object that has aux data, then those data will be copied; otherwise, nothing will be done.

◆ makePrivateStore1() [1/2]

void SG::AuxElement::makePrivateStore1 ( const AuxElement * other,
bool warnUnlocked )
privateinherited

Create a new private store for this object and copy aux data.

Parameters
otherThe object from which aux data should be copied.
warnUnlockedIf true, then warn when we skip unlocked decorations.

ExcBadPrivateStore will be thrown if this object is already associated with a store.

This overload handles the case where other does have aux data.

Definition at line 565 of file AuxElement.cxx.

567{
569 if (other)
570 this->copyAux (*other, warnUnlocked);
571}
void makePrivateStore()
Create a new (empty) private store for this object.
void copyAux(const ConstAuxElement &other, bool warnUnlocked=false)
Copy aux data from another object.

◆ makePrivateStore1() [2/2]

void SG::AuxElement::makePrivateStore1 ( const void * other,
bool warnUnlocked )
privateinherited

Create a new private store for this object and copy aux data.

Parameters
otherThe object from which aux data should be copied.
warnUnlockedIf true, then warn when we skip unlocked decorations.

ExcBadPrivateStore will be thrown if this object is already associated with a store.

This overload handles the case where other does not have aux data.

◆ missingET()

const xAOD::MissingET * xAOD::CompositeParticle_v1::missingET ( ) const

Get the MissingET object that is associated with this CompositeParticle.

If no (valid) MissingET object is associated with this CompositeParticle, a null pointer will be returned

Definition at line 593 of file CompositeParticle_v1.cxx.

593 {
594 if ( !(metLinkAcc.isAvailable(*this)) ) {
595 return nullptr;
596 }
597 const ElementLink<xAOD::MissingETContainer>& metLink = metLinkAcc(*this);
598 // Check if we have a valid ElementLink
599 if ( ! metLink.isValid() ) {
600 return nullptr;
601 }
602 return *metLink;
603 }

◆ mt() [1/2]

double xAOD::CompositeParticle_v1::mt ( const std::vector< int > & partIndices,
MT::Method method = MT::DEFAULT ) const

Get the transverse mass.

Specify which calculation method to use as an optional additional argument.

◆ mt() [2/2]

double xAOD::CompositeParticle_v1::mt ( int partIndexA,
int partIndexB = -2,
MT::Method method = MT::DEFAULT ) const
inline

Get the transverse mass with only one constituent particle.

Specify which calculation method to use as an optional additional argument. This specialization to the above method is needed since ROOT 6.02 doesn't yet support C++11 in the TFormula stuff with JIT compilation, see: https://sft.its.cern.ch/jira/browse/ROOT-5083

Definition at line 205 of file CompositeParticle_v1.h.

205 {
206 if ( partIndexB==-2 ) {
207 return this->mt( std::vector<int>{partIndexA}, method );
208 }
209 return this->mt( std::vector<int>{partIndexA, partIndexB}, method );
210 }
double mt(const std::vector< int > &partIndices, MT::Method method=MT::DEFAULT) const
Get the transverse mass.

◆ muon()

const xAOD::Muon * xAOD::CompositeParticle_v1::muon ( std::size_t index = 0) const
inline

Get the constituent number i as an Muon.

If the cast to Muon fails for a constituent, a null pointer is returned.

Definition at line 672 of file CompositeParticle_v1.h.

673{
674 const xAOD::IParticle* ipart = this->part(index);
675 if ( ipart->type() != xAOD::Type::Muon ){ return 0; }
676 return static_cast<const xAOD::Muon*>(ipart);
677}
@ Muon
The object is a muon.
Definition ObjectType.h:48
Muon_v1 Muon
Reference the current persistent version:

◆ nCompParts()

std::size_t xAOD::CompositeParticle_v1::nCompParts ( ) const

Number of constituent CompositeParticles.

◆ nElectrons()

std::size_t xAOD::CompositeParticle_v1::nElectrons ( ) const

Number of constituent electrons.

◆ nJets()

std::size_t xAOD::CompositeParticle_v1::nJets ( ) const

Number of constituent jets.

◆ nLeptons()

std::size_t xAOD::CompositeParticle_v1::nLeptons ( ) const

Number of constituent leptons (electrons, muons, and taus).

Definition at line 750 of file CompositeParticle_v1.cxx.

750 {
751 return this->nElectrons() + this->nMuons() + this->nTaus();
752 }
std::size_t nElectrons() const
Number of constituent electrons.
std::size_t nMuons() const
Number of constituent muons.
std::size_t nTaus() const
Number of constituent taus.

◆ nMuons()

std::size_t xAOD::CompositeParticle_v1::nMuons ( ) const

Number of constituent muons.

◆ noPrivateData()

bool SG::IAuxElement::noPrivateData ( ) const
protectedinherited

True if this element has no private data.

◆ nOtherCompParts()

std::size_t xAOD::CompositeParticle_v1::nOtherCompParts ( ) const

Number of other constituent CompositeParticles.

◆ nOtherElectrons()

std::size_t xAOD::CompositeParticle_v1::nOtherElectrons ( ) const

Number of other constituent electrons.

◆ nOtherJets()

std::size_t xAOD::CompositeParticle_v1::nOtherJets ( ) const

Number of other constituent jets.

◆ nOtherLeptons()

std::size_t xAOD::CompositeParticle_v1::nOtherLeptons ( ) const

Number of other constituent leptons (electrons, muons, and taus).

Definition at line 1038 of file CompositeParticle_v1.cxx.

1038 {
1039 return this->nOtherElectrons() + this->nOtherMuons() + this->nOtherTaus();
1040 }
std::size_t nOtherMuons() const
Number of other constituent muons.
std::size_t nOtherElectrons() const
Number of other constituent electrons.
std::size_t nOtherTaus() const
Number of other constituent taus.

◆ nOtherMuons()

std::size_t xAOD::CompositeParticle_v1::nOtherMuons ( ) const

Number of other constituent muons.

◆ nOtherParts()

std::size_t xAOD::CompositeParticle_v1::nOtherParts ( ) const

Number of other constituent particles.

Definition at line 1010 of file CompositeParticle_v1.cxx.

1010 {
1011 if( otherPartLinksAcc.isAvailable( *this ) ) {
1012 return otherPartLinksAcc( *this ).size();
1013 }
1014 return 0;
1015 }

◆ nOtherPhotons()

std::size_t xAOD::CompositeParticle_v1::nOtherPhotons ( ) const

Number of other constituent photons.

◆ nOtherTaus()

std::size_t xAOD::CompositeParticle_v1::nOtherTaus ( ) const

Number of other constituent taus.

◆ nOtherTruthElectrons()

std::size_t xAOD::CompositeParticle_v1::nOtherTruthElectrons ( ) const

Number of other constituent truth electrons.

◆ nOtherTruthLeptons()

std::size_t xAOD::CompositeParticle_v1::nOtherTruthLeptons ( ) const

Number of other constituent truth leptons (truth electrons, truth muons, and truth taus).

Definition at line 1065 of file CompositeParticle_v1.cxx.

1065 {
1066 return this->nOtherTruthElectrons() + this->nOtherTruthMuons() + this->nOtherTruthTaus();
1067 }
std::size_t nOtherTruthTaus() const
Number of other constituent truth taus.
std::size_t nOtherTruthMuons() const
Number of other constituent truth muons.
std::size_t nOtherTruthElectrons() const
Number of other constituent truth electrons.

◆ nOtherTruthMuons()

std::size_t xAOD::CompositeParticle_v1::nOtherTruthMuons ( ) const

Number of other constituent truth muons.

◆ nOtherTruthParts()

std::size_t xAOD::CompositeParticle_v1::nOtherTruthParts ( ) const

Number of other constituent xAOD::TruthParticles.

◆ nOtherTruthPhotons()

std::size_t xAOD::CompositeParticle_v1::nOtherTruthPhotons ( ) const

Number of other constituent truth photons.

◆ nOtherTruthTaus()

std::size_t xAOD::CompositeParticle_v1::nOtherTruthTaus ( ) const

Number of other constituent truth taus.

◆ nParts()

std::size_t xAOD::CompositeParticle_v1::nParts ( ) const

Number of constituent particles.

Note that MissingET is NOT counted as a constituent in this context

Definition at line 722 of file CompositeParticle_v1.cxx.

722 {
723 if( partLinksAcc.isAvailable( *this ) ) {
724 return partLinksAcc( *this ).size();
725 }
726 return 0;
727 }

◆ nPhotons()

std::size_t xAOD::CompositeParticle_v1::nPhotons ( ) const

Number of constituent photons.

◆ nTaus()

std::size_t xAOD::CompositeParticle_v1::nTaus ( ) const

Number of constituent taus.

◆ nTruthElectrons()

std::size_t xAOD::CompositeParticle_v1::nTruthElectrons ( ) const

Number of constituent truth electrons.

◆ nTruthLeptons()

std::size_t xAOD::CompositeParticle_v1::nTruthLeptons ( ) const

Number of constituent truth leptons (truth electrons, truth muons, and truth taus).

Definition at line 777 of file CompositeParticle_v1.cxx.

777 {
778 return this->nTruthElectrons() + this->nTruthMuons() + this->nTruthTaus();
779 }
std::size_t nTruthElectrons() const
Number of constituent truth electrons.
std::size_t nTruthTaus() const
Number of constituent truth taus.
std::size_t nTruthMuons() const
Number of constituent truth muons.

◆ nTruthMuons()

std::size_t xAOD::CompositeParticle_v1::nTruthMuons ( ) const

Number of constituent truth muons.

◆ nTruthParts()

std::size_t xAOD::CompositeParticle_v1::nTruthParts ( ) const

Number of constituent xAOD::TruthParticles.

◆ nTruthPhotons()

std::size_t xAOD::CompositeParticle_v1::nTruthPhotons ( ) const

Number of constituent truth photons.

◆ nTruthTaus()

std::size_t xAOD::CompositeParticle_v1::nTruthTaus ( ) const

Number of constituent truth taus.

◆ otherCompPart()

const xAOD::CompositeParticle_v1 * xAOD::CompositeParticle_v1::otherCompPart ( std::size_t index = 0) const
inline

Get the other constituent number i as a CompositeParticle.

If the cast to CompositeParticle fails for a constituent, a null pointer is returned.

Definition at line 713 of file CompositeParticle_v1.h.

714{
715 const xAOD::IParticle* ipart = this->otherPart(index);
716 if ( ipart->type() != xAOD::Type::CompositeParticle ){ return 0; }
717 return static_cast<const xAOD::CompositeParticle_v1*>(ipart);
718}
const xAOD::IParticle * otherPart(std::size_t index=0) const
Get the other constituent IParticle number i.

◆ otherElectron()

const xAOD::Electron * xAOD::CompositeParticle_v1::otherElectron ( std::size_t index = 0) const
inline

Get the other constituent number i as an Electron.

If the cast to Electron fails for a constituent, a null pointer is returned.

Definition at line 733 of file CompositeParticle_v1.h.

734{
735 const xAOD::IParticle* ipart = this->otherPart(index);
736 if ( ipart->type() != xAOD::Type::Electron ){ return 0; }
737 return static_cast<const xAOD::Electron*>(ipart);
738}

◆ otherJet()

const xAOD::Jet * xAOD::CompositeParticle_v1::otherJet ( std::size_t index = 0) const
inline

Get the other constituent number i as a Jet.

If the cast to Jet fails for a constituent, a null pointer is returned.

Definition at line 763 of file CompositeParticle_v1.h.

764{
765 const xAOD::IParticle* ipart = this->otherPart(index);
766 if ( ipart->type() != xAOD::Type::Jet ){ return 0; }
767 return static_cast<const xAOD::Jet*>(ipart);
768}

◆ otherMuon()

const xAOD::Muon * xAOD::CompositeParticle_v1::otherMuon ( std::size_t index = 0) const
inline

Get the other constituent number i as an Muon.

If the cast to Muon fails for a constituent, a null pointer is returned.

Definition at line 743 of file CompositeParticle_v1.h.

744{
745 const xAOD::IParticle* ipart = this->otherPart(index);
746 if ( ipart->type() != xAOD::Type::Muon ){ return 0; }
747 return static_cast<const xAOD::Muon*>(ipart);
748}

◆ otherPart()

const xAOD::IParticle * xAOD::CompositeParticle_v1::otherPart ( std::size_t index = 0) const

Get the other constituent IParticle number i.

Definition at line 1071 of file CompositeParticle_v1.cxx.

1071 {
1072 if ( index >= this->nOtherParts() ) {
1073 return nullptr;
1074 }
1076 if ( ! otherPartLink.isValid() ) {
1077 return nullptr;
1078 }
1079 return *otherPartLink;
1080 }
std::size_t nOtherParts() const
Number of other constituent particles.
const xAOD::IParticleLink & otherPartLink(std::size_t index=0) const
Get the other constituent IParticle number i as an ElementLink.

◆ otherPartLink()

const xAOD::IParticleLink & xAOD::CompositeParticle_v1::otherPartLink ( std::size_t index = 0) const

Get the other constituent IParticle number i as an ElementLink.

Definition at line 1084 of file CompositeParticle_v1.cxx.

1084 {
1085 if ( index >= this->nOtherParts() ) {
1086 static const xAOD::IParticleLink dummy;
1087 return dummy;
1088 }
1089 return otherPartLinks()[ index ];
1090 }

◆ otherPartLinks()

const xAOD::IParticleLinkContainer & xAOD::CompositeParticle_v1::otherPartLinks ( ) const

Get all other constituents in one go.

◆ otherPhoton()

const xAOD::Photon * xAOD::CompositeParticle_v1::otherPhoton ( std::size_t index = 0) const
inline

Get the other constituent number i as a Photon.

If the cast to Photon fails for a constituent, a null pointer is returned.

Definition at line 723 of file CompositeParticle_v1.h.

724{
725 const xAOD::IParticle* ipart = this->otherPart(index);
726 if ( ipart->type() != xAOD::Type::Photon ){ return 0; }
727 return static_cast<const xAOD::Photon*>(ipart);
728}
@ Photon
The object is a photon.
Definition ObjectType.h:47
Photon_v1 Photon
Definition of the current "egamma version".

◆ otherTau()

const xAOD::TauJet * xAOD::CompositeParticle_v1::otherTau ( std::size_t index = 0) const
inline

Get the other constituent number i as a tau.

If the cast to tau fails for a constituent, a null pointer is returned.

Definition at line 753 of file CompositeParticle_v1.h.

754{
755 const xAOD::IParticle* ipart = this->otherPart(index);
756 if ( ipart->type() != xAOD::Type::Tau ){ return 0; }
757 return static_cast<const xAOD::TauJet*>(ipart);
758}
@ Tau
The object is a tau (jet)
Definition ObjectType.h:49
TauJet_v3 TauJet
Definition of the current "tau version".

◆ otherTruthPart()

const xAOD::TruthParticle * xAOD::CompositeParticle_v1::otherTruthPart ( std::size_t index = 0) const
inline

Get the other constituent number i as a TruthParticle.

If the cast to TruthParticle fails for a constituent, a null pointer is returned.

Definition at line 773 of file CompositeParticle_v1.h.

774{
775 const xAOD::IParticle* ipart = this->otherPart(index);
776 if ( ipart->type() != xAOD::Type::TruthParticle ){ return 0; }
777 return static_cast<const xAOD::TruthParticle*>(ipart);
778}
@ TruthParticle
The object is a truth particle.
Definition ObjectType.h:67
TruthParticle_v1 TruthParticle
Typedef to implementation.

◆ p()

double xAOD::CompositeParticle_v1::p ( const std::vector< int > & partIndices) const

The total 3-momentum.

◆ p4() [1/5]

CompositeParticle_v1::FourMom_t xAOD::CompositeParticle_v1::p4 ( ) const
virtual

The full 4-momentum of the particle.

Implements xAOD::IParticle.

Definition at line 64 of file CompositeParticle_v1.cxx.

64 {
65 if ( accPx.isAvailable(*this) && accPy.isAvailable(*this)
66 && accPz.isAvailable(*this) && accE.isAvailable(*this) ) {
67 // We have everything stored with this CompositeParticle. Just use it.
68 const double px = static_cast<double>(accPx(*this));
69 const double py = static_cast<double>(accPy(*this));
70 const double pz = static_cast<double>(accPz(*this));
71 const double e = static_cast<double>(accE(*this));
72 return FourMom_t( px, py, pz, e );
73 }
74 else {
75 // Not everything is stored, we need to re-calculate the p4 based on the constituents.
76 // Create an empty vector such that the subsequent call will use all constituents.
77 const std::vector<int> partIndices;
78 return p4( partIndices );
79 }
80 }

◆ p4() [2/5]

FourMom_t xAOD::CompositeParticle_v1::p4 ( const std::vector< int > & partIndices) const

The total 4-momentum.

◆ p4() [3/5]

FourMom_t xAOD::CompositeParticle_v1::p4 ( int partIndexA,
int partIndexB ) const
inline

Get the four-momentum with two indices.

This specialization to the above method is needed since ROOT 6.02 doesn't yet support C++11 in the TFormula stuff with JIT compilation, see: https://sft.its.cern.ch/jira/browse/ROOT-5083

Definition at line 149 of file CompositeParticle_v1.h.

149 {
150 return this->p4( std::vector<int>{partIndexA, partIndexB} );
151 }

◆ p4() [4/5]

FourMom_t xAOD::CompositeParticle_v1::p4 ( int partIndexA,
int partIndexB,
int partIndexC ) const
inline

Get the four-momentum with three indices.

Definition at line 153 of file CompositeParticle_v1.h.

153 {
154 return this->p4( std::vector<int>{partIndexA, partIndexB, partIndexC} );
155 }

◆ p4() [5/5]

FourMom_t xAOD::CompositeParticle_v1::p4 ( int partIndexA,
int partIndexB,
int partIndexC,
int partIndexD ) const
inline

Get the four-momentum with four indices.

Definition at line 157 of file CompositeParticle_v1.h.

157 {
158 return this->p4( std::vector<int>{partIndexA, partIndexB, partIndexC, partIndexD} );
159 }

◆ part()

const xAOD::IParticle * xAOD::CompositeParticle_v1::part ( std::size_t index = 0) const

Get the constituent IParticle number i.

Definition at line 782 of file CompositeParticle_v1.cxx.

782 {
783 if ( index >= this->nParts() ) {
784 return nullptr;
785 }
786 const xAOD::IParticleLink & constitLink = partLink( index );
787 if ( ! constitLink.isValid() ) {
788 return nullptr;
789 }
790 return *constitLink;
791 }

◆ partLink()

const xAOD::IParticleLink & xAOD::CompositeParticle_v1::partLink ( std::size_t index = 0) const

Get the constituent IParticle number i as an ElementLink.

Definition at line 795 of file CompositeParticle_v1.cxx.

795 {
796 if ( index >= this->nParts() ) {
797 static const xAOD::IParticleLink dummy;
798 return dummy;
799 }
800 return partLinks()[ index ];
801 }

◆ partLinks()

const xAOD::IParticleLinkContainer & xAOD::CompositeParticle_v1::partLinks ( ) const

Get all constituents in one go.

◆ parts()

template<typename CONTTYPE>
ConstDataVector< CONTTYPE > * xAOD::CompositeParticle_v1::parts ( ) const

Method to return a DataVector<T>, e.g., a MuonContainer, for all the constituent particles, e.g., of type xAOD::Muon, that this CompositeParticle has.

This DataVector be a simple SG::VIEW_ELEMENTS container, i.e., it does NOT own the elements, e.g., muons, but has simple pointers to them. However, the user is still required to take care of its memory management by either recording it to StoreGate (and thus transfering ownership), or by deleting this view-container when done with it.

◆ pdgId()

int xAOD::CompositeParticle_v1::pdgId ( ) const

Return the PDG identifier.

◆ phi() [1/2]

double xAOD::CompositeParticle_v1::phi ( ) const
virtual

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

Implements xAOD::IParticle.

Definition at line 52 of file CompositeParticle_v1.cxx.

52 {
53 return p4().Phi();
54 }

◆ phi() [2/2]

double xAOD::CompositeParticle_v1::phi ( const std::vector< int > & partIndices) const

The azimuthal angle ( \(\phi\))

◆ photon()

const xAOD::Photon * xAOD::CompositeParticle_v1::photon ( std::size_t index = 0) const
inline

Get the constituent number i as a Photon.

If the cast to Photon fails for a constituent, a null pointer is returned.

Definition at line 652 of file CompositeParticle_v1.h.

653{
654 const xAOD::IParticle* ipart = this->part(index);
655 if ( ipart->type() != xAOD::Type::Photon ){ return 0; }
656 return static_cast<const xAOD::Photon*>(ipart);
657}

◆ pt() [1/2]

double xAOD::CompositeParticle_v1::pt ( ) const
virtual

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

Implements xAOD::IParticle.

Definition at line 44 of file CompositeParticle_v1.cxx.

44 {
45 return std::hypot( px(), py() );
46 }

◆ pt() [2/2]

double xAOD::CompositeParticle_v1::pt ( const std::vector< int > & partIndices) const

The transverse momentum ( \(p_T\))

◆ px() [1/2]

double xAOD::CompositeParticle_v1::px ( ) const

Get the px momentum component of the particle.

Definition at line 112 of file CompositeParticle_v1.cxx.

112 {
113 return p4().Px();
114 }

◆ px() [2/2]

double xAOD::CompositeParticle_v1::px ( const std::vector< int > & partIndices) const

Get the px momentum component.

◆ py() [1/2]

double xAOD::CompositeParticle_v1::py ( ) const

Get the py momentum component of the particle.

Definition at line 117 of file CompositeParticle_v1.cxx.

117 {
118 return p4().Py();
119 }

◆ py() [2/2]

double xAOD::CompositeParticle_v1::py ( const std::vector< int > & partIndices) const

Get the py momentum component.

◆ pz() [1/2]

double xAOD::CompositeParticle_v1::pz ( ) const

Get the pz momentum component of the particle.

Definition at line 122 of file CompositeParticle_v1.cxx.

122 {
123 return p4().Pz();
124 }

◆ pz() [2/2]

double xAOD::CompositeParticle_v1::pz ( const std::vector< int > & partIndices) const

Get the pz momentum component.

◆ rapidity() [1/2]

double xAOD::CompositeParticle_v1::rapidity ( ) const
virtual

The true rapidity (y) of the particle.

Implements xAOD::IParticle.

Definition at line 60 of file CompositeParticle_v1.cxx.

60 {
61 return p4().Rapidity();
62 }

◆ rapidity() [2/2]

double xAOD::CompositeParticle_v1::rapidity ( const std::vector< int > & partIndices) const

The true rapidity (y)

◆ releasePrivateStore()

void SG::AuxElement::releasePrivateStore ( )
inherited

Release and free any private store associated with this object.

ExcBadPrivateStore will be thrown if this object does not have a private store.

Definition at line 210 of file AuxElement.cxx.

211{
212 if (hadPrivateData()) {
213 // We had a private store, but it was released because this object
214 // was added to a container. Just forget about it.
216 return;
217 }
218
219 if (!havePrivateData() ||
220 !m_container ||
221 typeid(*m_container) != typeid(AuxElementPrivateData))
222 {
223 throw SG::ExcBadPrivateStore ("no private store exists");
224 }
225
228 delete m_container;
229 m_container = 0;
230}
bool hadPrivateData() const
True if this element had private data before it was added to its current container.
void setNoPrivateData()
Record that this element does not have private data.

◆ releasePrivateStoreForDtor()

void SG::AuxElement::releasePrivateStoreForDtor ( )
privateinherited

Out-of-line portion of destructor.

Delete a private store if we have one.

Definition at line 441 of file AuxElement.cxx.

442{
443#ifdef ATHCONTAINERS_R21_COMPAT
444 if (havePrivateData()) {
445 delete m_container;
446 }
447#else
449#endif
450}
void releasePrivateStoreForDtor()
Out-of-line portion of destructor.

◆ removeMissingET()

void xAOD::CompositeParticle_v1::removeMissingET ( bool updateFourMom = true)

Remove the existing MissingET object from this CompositeParticle.

Note that the 4-momentum of this CompositeParticle will be updated accordingly, if updateFourMom=true.

Definition at line 636 of file CompositeParticle_v1.cxx.

636 {
637 const xAOD::MissingET* met = this->missingET();
638 if ( !met ) {
639 // There is no valid MissingET object assigned... nothing can done
640 return;
641 }
642
643 // Update the four-momentum of this composite particle, if requested
644 if ( updateFourMom ) {
646 double metpx = met->mpx();
647 double metpy = met->mpy();
648 metP4.SetPxPyPzE( metpx, metpy, 0.0, std::sqrt(metpx*metpx + metpy*metpy) );
649 this->setP4( this->p4() - metP4 );
650 }
651 // Assign an invalid ElementLink here
652 metLinkAcc(*this) = ElementLink<xAOD::MissingETContainer>();
653 return;
654 }
const xAOD::MissingET * missingET() const
Get the MissingET object that is associated with this CompositeParticle.
TLorentzVector FourMom_t
Definition of the 4-momentum type.
float mpx() const
Returns .
float mpy() const
Returns .

◆ removeOtherPart() [1/2]

void xAOD::CompositeParticle_v1::removeOtherPart ( const xAOD::IParticle * part)

Remove a particle as an other constituent from this CompostiteParticle.

Definition at line 930 of file CompositeParticle_v1.cxx.

930 {
931 // Check if we have a valid pointer
932 if ( !part ) {
933 // This should not be... throw an error.
934 throw std::runtime_error("Got a zero pointer to an xAOD::IParticle when adding constituent!");
935 }
936
937 // Add the ElementLink of the given particle and pass it on
938 const std::size_t partIdx = part->index();
939 const xAOD::IParticleContainer* partCont =
940 static_cast<const xAOD::IParticleContainer*>(part->container());
941 this->removeOtherPart( IParticleLink( *partCont, partIdx ) );
942 return;
943 }
void removeOtherPart(const xAOD::IParticle *part)
Remove a particle as an other constituent from this CompostiteParticle.
DataVector< IParticle > IParticleContainer
Simple convenience declaration of IParticleContainer.

◆ removeOtherPart() [2/2]

void xAOD::CompositeParticle_v1::removeOtherPart ( const xAOD::IParticleLink & partLink)

Remove a particle as an other constituent from this CompostiteParticle.

Definition at line 948 of file CompositeParticle_v1.cxx.

948 {
949 // Check if we have a valid ElementLink
950 if ( ! partLink.isValid() ) {
951 // This should not be... throw an error.
952 throw std::runtime_error("Got an invalid ElementLink when adding constituent!");
953 }
954 xAOD::IParticleLinkContainer& otherPartLinks = otherPartLinksAcc( *this );
955
956 // Find the constituent particle that should be removed
957 for ( xAOD::IParticleLinkContainer::iterator
958 constitItr = otherPartLinks.begin(),
959 constitItrEnd = otherPartLinks.end();
960 constitItr != constitItrEnd;
961 ++constitItr ) {
962 const xAOD::IParticleLink& currentLink = *constitItr;
963 if ( partLink == currentLink ) {
964 // Remove the found link
965 otherPartLinks.erase( constitItr );
966 return;
967 }
968 }
969 return;
970 }

◆ removePart() [1/2]

void xAOD::CompositeParticle_v1::removePart ( const xAOD::IParticle * part,
bool updateFourMom = true )

Remove a particle as a constituent from this CompostiteParticle.

Note that the 4-momentum of this CompositeParticle will be updated accordingly, if updateFourMom=true. If the given IParticle is not already a constituent of this CompositeParticle, nothing happens

Definition at line 536 of file CompositeParticle_v1.cxx.

537 {
538 // Check if we have a valid pointer
539 if ( !part ) {
540 // This should not be... throw an error.
541 throw std::runtime_error("Got a zero pointer to an xAOD::IParticle when adding constituent!");
542 }
543
544 // Add the ElementLink of the given particle and pass it on
545 const std::size_t partIdx = part->index();
546 const xAOD::IParticleContainer* partCont =
547 static_cast<const xAOD::IParticleContainer*>(part->container());
548 this->removePart( IParticleLink( *partCont, partIdx ), updateFourMom );
549 return;
550 }
void removePart(const xAOD::IParticle *part, bool updateFourMom=true)
Remove a particle as a constituent from this CompostiteParticle.

◆ removePart() [2/2]

void xAOD::CompositeParticle_v1::removePart ( const xAOD::IParticleLink & partLink,
bool updateFourMom = true )

Remove a particle as a constituent from this CompostiteParticle.

Note that the 4-momentum of this CompositeParticle will be updated accordingly, if updateFourMom=true. If the given IParticle is not already a constituent of this CompositeParticle, nothing happens

Definition at line 555 of file CompositeParticle_v1.cxx.

556 {
557 // Check if we have a valid ElementLink
558 if ( ! partLink.isValid() ) {
559 // This should not be... throw an error.
560 throw std::runtime_error("Got an invalid ElementLink when adding constituent!");
561 }
562 xAOD::IParticleLinkContainer& constitLinks = partLinksAcc( *this );
563
564 // Find the constituent particle that should be removed
565 for ( xAOD::IParticleLinkContainer::iterator
566 constitItr = constitLinks.begin(),
567 constitItrEnd = constitLinks.end();
568 constitItr != constitItrEnd;
569 ++constitItr ) {
570 const xAOD::IParticleLink& currentLink = *constitItr;
571 if ( partLink == currentLink ) {
572 // Update the four-momentum of this composite particle, if requested
573 if ( updateFourMom ) {
574 this->setP4( this->p4() - (*partLink)->p4() );
575 // Cannot add charge automatically as this is NOT part of the xAOD::IParticle interface
576 //this->setCharge( this->charge() - (*partLink)->charge() );
577 }
578
579 // Remove the found link
580 constitLinks.erase( constitItr );
581 return;
582 }
583 }
584 return;
585 }

◆ setCharge()

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

Set the electric charge.

Definition at line 211 of file CompositeParticle_v1.cxx.

211 {
212 chargeAcc(*this) = charge;
213 return;
214 }

◆ setConstStore()

void SG::AuxElement::setConstStore ( const SG::IConstAuxStore * store)
inherited

Synonym for setStore with IConstAuxStore.

Parameters
storeThe new store.

◆ setE()

void xAOD::CompositeParticle_v1::setE ( double e)

Set the energy.

◆ setHadPrivateData()

void SG::IAuxElement::setHadPrivateData ( )
privateinherited

Record that this element used to have private data.

◆ setHavePrivateData()

void SG::IAuxElement::setHavePrivateData ( )
privateinherited

Record that this element currently has private data.

◆ setIndex()

void SG::AuxElement::setIndex ( size_t index,
SG::AuxVectorData * container )
privateinherited

Set the index/container for this element.

Parameters
indexThe index of this object within the container.
containerThe container holding this object. May be null if this object is being removed from a container.

Usually this simply sets the index and container members of this object. However, in the case where this object has an associated private store, then we need to deal with releasing the store if the object is being added to a container, or making a new store if the object is being removed from a container.

◆ setIndexPrivate()

bool SG::AuxElement::setIndexPrivate ( size_t index,
SG::AuxVectorData * container )
privateinherited

Set the index/container for this element.

Parameters
indexThe index of this object within the container.
containerThe container holding this object. May be null if this object is being removed from a container.

This is called from setIndex when we have a private store to deal with.

Definition at line 505 of file AuxElement.cxx.

506{
507#ifdef ATHCONTAINERS_R21_COMPAT
508 if (hadPrivateData()) {
509 // We had a private store, but it was released because we were added
510 // to a container.
511
512 if (container == 0) {
513 // We're being moved out of the container. Make a new private
514 // store, copy the data, and switch to it.
515 auto privateData = new SG::AuxElementPrivateData;
516 AuxElement to (privateData, 0);
517 to.copyAux (*this);
520 m_container = privateData;
521 return true;
522 }
523 }
524 else if (havePrivateData() &&
525 typeid(*m_container) == typeid(AuxElementPrivateData))
526 {
527 // We currently have a private store.
528
529 if (container != 0 && container != m_container) {
530 // We're being added to a container.
531 // Aux data has already been copied.
532 // Release private store.
535 delete m_container;
537 return false;
538 }
539 }
540 else {
541 // We have a standalone store.
542 throw SG::ExcBadPrivateStore ("Attempt to add/remove a standalone object "
543 "from a container.");
544 }
545
548 return false;
549#else
551#endif
552}
AuxElement()
Default constructor.
bool setIndexPrivate(size_t index, const SG::AuxVectorData *container)
Set the index/container for this element.
void setHadPrivateData()
Record that this element used to have private data.
CONT to(RANGE &&r)
Definition ranges.h:39

◆ setMissingET()

void xAOD::CompositeParticle_v1::setMissingET ( const xAOD::MissingET * met,
bool updateFourMom = true )

Set the MissingET for this CompositeParticle.

Note that the 4-momentum of this CompositeParticle will be updated accordingly, if updateFourMom=true.

Definition at line 608 of file CompositeParticle_v1.cxx.

609 {
610 // Check if we have a valid pointer
611 if ( !met ) {
612 // This should not be... throw an error.
613 throw std::runtime_error("Got a zero pointer to xAOD::MissingET when adding it!");
614 }
615
616 // Update the four-momentum of this composite particle, if requested
617 if ( updateFourMom ) {
619 double metpx = met->mpx();
620 double metpy = met->mpy();
621 metP4.SetPxPyPzE( metpx, metpy, 0.0, std::sqrt(metpx*metpx + metpy*metpy) );
622 this->setP4( this->p4() + metP4 );
623 }
624
625 // Add the given ElementLink as a constituent of this composite particle
626 const std::size_t metIdx = met->index();
627 const xAOD::MissingETContainer* metCont =
628 static_cast<const xAOD::MissingETContainer*>(met->container());
629 metLinkAcc(*this) = ElementLink<xAOD::MissingETContainer>( *metCont, metIdx );
630 return;
631 }

◆ setNonConstStore()

void SG::AuxElement::setNonConstStore ( SG::IAuxStore * store)
inherited

Synonym for setStore with IAuxStore.

Parameters
storeThe new store.

◆ setNoPrivateData()

void SG::IAuxElement::setNoPrivateData ( )
privateinherited

Record that this element does not have private data.

◆ setOtherPartLinks()

void xAOD::CompositeParticle_v1::setOtherPartLinks ( const xAOD::IParticleLinkContainer & otherPartLinks)
protected

Set all other constituents in one go.

◆ setP4()

void xAOD::CompositeParticle_v1::setP4 ( const FourMom_t & vec)

Set the 4-vec.

Definition at line 132 of file CompositeParticle_v1.cxx.

132 {
133 accPx( *this ) = static_cast<float>(vec.Px());
134 accPy( *this ) = static_cast<float>(vec.Py());
135 accPz( *this ) = static_cast<float>(vec.Pz());
136 accE( *this ) = static_cast<float>(vec.E());
137 }
std::vector< size_t > vec

◆ setPartLinks()

void xAOD::CompositeParticle_v1::setPartLinks ( const xAOD::IParticleLinkContainer & constitLinks)
protected

Set all constituents in one go.

Warning: This is meant for usage internal to this class only because no addition of the constituent properties will be done!

◆ setPdgId()

void xAOD::CompositeParticle_v1::setPdgId ( int pdgID)

Set the PDG identifier.

◆ setPx()

void xAOD::CompositeParticle_v1::setPx ( double px)

Set the x-component of the momentum.

◆ setPxPyPzE()

void xAOD::CompositeParticle_v1::setPxPyPzE ( double px,
double py,
double pz,
double e )

Set the 4-vec.

Definition at line 140 of file CompositeParticle_v1.cxx.

143 {
144 static const Accessor< float > acc1( "px" );
145 acc1( *this ) = (float)px;
146 static const Accessor< float > acc2( "py" );
147 acc2( *this ) = (float)py;
148 static const Accessor< float > acc3( "pz" );
149 acc3( *this ) = (float)pz;
150 static const Accessor< float > acc4( "e" );
151 acc4( *this ) = (float)e;
152 }
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572

◆ setPy()

void xAOD::CompositeParticle_v1::setPy ( double py)

Set the y-component of the momentum.

◆ setPz()

void xAOD::CompositeParticle_v1::setPz ( double pz)

Set the z-component of the momentum.

◆ setStore() [1/3]

void SG::AuxElement::setStore ( const DataLink< SG::IConstAuxStore > & store)
inherited

Set the store associated with this object.

Parameters
storeThe new store.

If store is nonzero, this adds a standalone store to the object. The object must not be in a container and must not have a private store. If store is zero, this removes a standalone store.

Parameters
storeLink to the new store.

Definition at line 269 of file AuxElement.cxx.

270{
271 AuxElementStandaloneData* data = setStore1 (store);
272 if (store)
273 data->setStore (store);
274}
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
AuxElementStandaloneData * setStore1(const SG::IConstAuxStore *store)
Set the store associated with this object.

◆ setStore() [2/3]

void SG::AuxElement::setStore ( const SG::IConstAuxStore * store)
inherited

Set the store associated with this object.

Parameters
storeThe new store.

If store is nonzero, this adds a standalone store to the object. The object must not be in a container and must not have a private store. If store is zero, this removes a standalone store.

Definition at line 241 of file AuxElement.cxx.

242{
243 AuxElementStandaloneData* data = setStore1 (store);
244 if (store)
245 data->setStore (store);
246}

◆ setStore() [3/3]

void SG::AuxElement::setStore ( SG::IAuxStore * store)
inherited

Set the store associated with this object.

Parameters
storeThe new store.

If store is nonzero, this adds a standalone store to the object. The object must not be in a container and must not have a private store. If store is zero, this removes a standalone store.

Definition at line 257 of file AuxElement.cxx.

258{
259 AuxElementStandaloneData* data = setStore1 (store);
260 if (store)
261 data->setStore (store);
262}

◆ setStore1()

AuxElementStandaloneData * SG::AuxElement::setStore1 ( const SG::IConstAuxStore * store)
privateinherited

Set the store associated with this object.

Parameters
storeThe new store.

Helper for setStore. Creates the AuxElementStandaloneData object if needed and returns it.

Parameters
storeThe new store.

Helper for setStore. Creates the @x AuxElementStandaloneData object if needed and returns it.

Definition at line 461 of file AuxElement.cxx.

462{
463 if (store) {
464 // Want this object be standalone.
465 if (!m_container) {
466 // Not in a container (and no private store). Make a new object.
467 AuxElementStandaloneData* data = new AuxElementStandaloneData;
470 return data;
471 }
472 if (usingStandaloneStore()) {
473 // Standalone --- return existing object.
474 return static_cast<AuxElementStandaloneData*> (container());
475 }
476 // Otherwise, it's an error.
477 throw ExcBadPrivateStore ("Attempt to attach a standalone store to an "
478 "object in a container or with a private store.");
479 }
480
481 else {
482 // Getting rid of a standalone store.
483 if (usingStandaloneStore()) {
485 delete m_container;
486 m_container = 0;
487 }
488 else if (m_container != 0)
489 throw ExcBadPrivateStore ("Attempt to remove a standalone store from an "
490 "object in a container or with a private store.");
491 return 0;
492 }
493}
bool usingStandaloneStore() const
Test to see if this object is currently using a standalone store.

◆ tau()

const xAOD::TauJet * xAOD::CompositeParticle_v1::tau ( std::size_t index = 0) const
inline

Get the constituent number i as a tau.

If the cast to tau fails for a constituent, a null pointer is returned.

Definition at line 682 of file CompositeParticle_v1.h.

683{
684 const xAOD::IParticle* ipart = this->part(index);
685 if ( ipart->type() != xAOD::Type::Tau ){ return 0; }
686 return static_cast<const xAOD::TauJet*>(ipart);
687}

◆ toPersistent()

void xAOD::CompositeParticle_v1::toPersistent ( )

Function preparing the object to be persistified.

◆ trackIndices()

bool SG::AuxElement::trackIndices ( ) const
inherited

Return true if index tracking is enabled for this object.

Always returns true. Included here to be consistent with AuxVectorBase when standalone objects may be used as template parameters.

◆ truthPart()

const xAOD::TruthParticle * xAOD::CompositeParticle_v1::truthPart ( std::size_t index = 0) const
inline

Get the constituent number i as a TruthParticle.

If the cast to TruthParticle fails for a constituent, a null pointer is returned.

Definition at line 702 of file CompositeParticle_v1.h.

703{
704 const xAOD::IParticle* ipart = this->part(index);
705 if ( ipart->type() != xAOD::Type::TruthParticle ){ return 0; }
706 return static_cast<const xAOD::TruthParticle*>(ipart);
707}

◆ type()

Type::ObjectType xAOD::CompositeParticle_v1::type ( ) const
virtual

The type of the object as a simple enumeration.

Implements xAOD::IParticle.

Definition at line 102 of file CompositeParticle_v1.cxx.

102 {
103 return Type::CompositeParticle;
104 }

◆ usingPrivateStore()

bool SG::AuxElement::usingPrivateStore ( ) const
inherited

Test to see if this object is currently using a private store.

Definition at line 280 of file AuxElement.cxx.

281{
282 return havePrivateData() &&
283 typeid(*m_container) == typeid(AuxElementPrivateData);
284}

◆ usingStandaloneStore()

bool SG::AuxElement::usingStandaloneStore ( ) const
inherited

Test to see if this object is currently using a standalone store.

Test to see if this object is currently using a private store.

Definition at line 290 of file AuxElement.cxx.

291{
292 return havePrivateData() &&
293 typeid(*m_container) == typeid(AuxElementStandaloneData);
294}

◆ weight() [1/6]

float xAOD::CompositeParticle_v1::weight ( const std::string & varNameA) const
inline

Get the weight for this xAOD::CompositeParticle.

This specialization to the above method is needed since ROOT 6.02 doesn't yet support C++11 in the TFormula stuff with JIT compilation, see: https://sft.its.cern.ch/jira/browse/ROOT-5083

Definition at line 239 of file CompositeParticle_v1.h.

239 {
240 return this->weight( std::vector<std::string>{varNameA} );
241 }
float weight(const std::vector< std::string > &varNames, const std::vector< int > &partIndices={}) const
Get the weight for this xAOD::CompositeParticle by providing a vector of variable names that will be ...

◆ weight() [2/6]

float xAOD::CompositeParticle_v1::weight ( const std::string & varNameA,
const std::string & varNameB ) const
inline

Definition at line 242 of file CompositeParticle_v1.h.

243 {
244 return this->weight( std::vector<std::string>{varNameA,varNameB} );
245 }

◆ weight() [3/6]

float xAOD::CompositeParticle_v1::weight ( const std::string & varNameA,
const std::string & varNameB,
const std::string & varNameC ) const
inline

Definition at line 246 of file CompositeParticle_v1.h.

248 {
249 return this->weight( std::vector<std::string>{varNameA,varNameB,varNameC} );
250 }

◆ weight() [4/6]

float xAOD::CompositeParticle_v1::weight ( const std::string & varNameA,
const std::string & varNameB,
const std::string & varNameC,
const std::string & varNameD ) const
inline

Definition at line 251 of file CompositeParticle_v1.h.

254 {
255 return this->weight( std::vector<std::string>{varNameA,varNameB,varNameC,varNameD} );
256 }

◆ weight() [5/6]

float xAOD::CompositeParticle_v1::weight ( const std::string & varNameA,
const std::string & varNameB,
const std::string & varNameC,
const std::string & varNameD,
const std::string & varNameE ) const
inline

Definition at line 257 of file CompositeParticle_v1.h.

261 {
262 return this->weight( std::vector<std::string>{varNameA,varNameB,varNameC,varNameD,varNameE} );
263 }

◆ weight() [6/6]

float xAOD::CompositeParticle_v1::weight ( const std::vector< std::string > & varNames,
const std::vector< int > & partIndices = {} ) const

Get the weight for this xAOD::CompositeParticle by providing a vector of variable names that will be looked for.

These variables, if found, are assumed to be of type float and to hold a multiplicative weight variable. If a given variable name is not found for this xAOD::CompositeParticle, then, the whole constituent tree will be searched for iteratively. The same variable name can be found and used for several constituents. But if a xAOD::CompositeParticle has that variable, the iterative search will not look into the constituents of that xAOD::CompositeParticle. The second, optional, argument is a list of indices such that one can restrict the variable name search to only the given constituent particles.

◆ weightHelper()

float xAOD::CompositeParticle_v1::weightHelper ( const xAOD::IParticle * part,
const xAOD::IParticle::ConstAccessor< float > & varAcc ) const
private

This is a private helper method to calculate the weight.

Member Data Documentation

◆ m_container

const SG::AuxVectorData* SG::ConstAuxElement::m_container
privateinherited

The container of which this object is an element.

Should be null if this object is not within a container, except that it may also point at a private store.

Definition at line 335 of file AuxElement.h.

◆ m_index

size_t SG::IAuxElement::m_index
privateinherited

The index of this element within its container.

Should be 0 if this object is not within a container.

Definition at line 128 of file IAuxElement.h.

◆ m_privateStoreState

PrivateStoreState SG::IAuxElement::m_privateStoreState
privateinherited

Definition at line 137 of file IAuxElement.h.

◆ supportsThinning

bool SG::AuxElement::supportsThinning = true
staticconstexprinherited

Mark that this type supports thinning operations.

See AthContainers/supportsThinning.h and AthenaPoolCnvSvc/T_AthenaPoolCnv.h. Helps guide which pool converter template will be used. If false, the default pool converter will be used rather than the aux store-specific one. Ordinary xAOD type should not touch this, but may be overridden in a derived class to handle certain special cases.

Definition at line 959 of file AuxElement.h.


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