xAOD::CompositeParticle_v1 Class Reference

#include <CompositeParticle_v1.h>

Inheritance diagram for xAOD::CompositeParticle_v1:
xAOD::IParticle SG::AuxElement SG::IAuxElement

List of all members.

Classes

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

Public Member Functions

 CompositeParticle_v1 ()
 Default constructor.
void toPersistent ()
 Function preparing the object to be persistified.
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
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).



const FourMom_tp4 (const std::vector< int > &partIndices) const
 The total 4-momentum.
const FourMom_tp4 (int partIndexA, int partIndexB) const
const FourMom_tp4 (int partIndexA, int partIndexB, int partIndexC) const
 Get the four-momentum with three indices.
const FourMom_tp4 (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
double mt (const std::vector< int > &partIndices, MT::Method method=MT::DEFAULT) const
double mt (int partIndexA, int partIndexB=-2, MT::Method method=MT::DEFAULT) const
Functions implementing handling of constituents



void 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.
void 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.
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. 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.
void 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.
const xAOD::MissingETmissingET () 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.
void 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.
void 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.
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
std::size_t nCompParts () const
 Number of constituent CompositeParticles.
std::size_t nPhotons () const
 Number of constituent photons.
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.
std::size_t nLeptons () const
 Number of constituent leptons (electrons, muons, and 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::IParticleLinkContainer
partLinks () const
 Get all constituents in one go.
template<typename CONTTYPE >
ConstDataVector< CONTTYPE > * parts () const
xAOD::CompositeParticle_v1compPart (const std::vector< int > &partIndices, const std::vector< int > &otherPartIndices=std::vector< int >{}, bool updateFourMom=true) const
xAOD::CompositeParticle_v1compPart (int partIndexA, int partIndexB, int partIndexC=-2, bool updateFourMom=true) const
const xAOD::CompositeParticle_v1compPart (std::size_t index=0) const
const xAOD::Photonphoton (std::size_t index=0) const
const xAOD::Electronelectron (std::size_t index=0) const
const xAOD::Muonmuon (std::size_t index=0) const
const xAOD::TauJettau (std::size_t index=0) const
const xAOD::Jetjet (std::size_t index=0) const
const xAOD::TruthParticletruthPart (std::size_t index=0) const
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 nOtherElectrons () const
 Number of other constituent electrons.
std::size_t nOtherMuons () const
 Number of other constituent muons.
std::size_t nOtherTaus () const
 Number of other constituent taus.
std::size_t nOtherLeptons () const
 Number of other constituent leptons (electrons, muons, and 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::IParticleLinkContainer
otherPartLinks () const
 Get all other constituents in one go.
const xAOD::CompositeParticle_v1otherCompPart (std::size_t index=0) const
const xAOD::PhotonotherPhoton (std::size_t index=0) const
const xAOD::ElectronotherElectron (std::size_t index=0) const
const xAOD::MuonotherMuon (std::size_t index=0) const
const xAOD::TauJetotherTau (std::size_t index=0) const
const xAOD::JetotherJet (std::size_t index=0) const
const xAOD::TruthParticleotherTruthPart (std::size_t index=0) const
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.

Protected Member Functions

void setPartLinks (const xAOD::IParticleLinkContainer &constitLinks)
 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!
void setOtherPartLinks (const xAOD::IParticleLinkContainer &otherPartLinks)
 Set all other constituents in one go.

Functions implementing the xAOD::IParticle interface



typedef IParticle::FourMom_t FourMom_t
 Definition of the 4-momentum type.
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 const FourMom_tp4 () const
 The full 4-momentum of the particle.
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
float weight (const std::string &varNameA) const
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

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 <karsten.koeneke@cern.ch>
Revision
696023
Date
2015-09-21 19:09:08 +0200 (Mon, 21 Sep 2015)

Member Function Documentation

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.

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

xAOD::CompositeParticle_v1* xAOD::CompositeParticle_v1::compPart ( const std::vector< int > &  partIndices  ) 

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.

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.

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.

double xAOD::CompositeParticle_v1::et (  )  const

The transverse energy ($e_T$) of the particle. Note that this differs from ($p_T$) for massive particles.

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.

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

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.

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.

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

Number of constituent particles. Note that MissingET is NOT counted as a constituent in this context

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.

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.

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.

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.

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.

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.

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.

const 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

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

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.

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.

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.

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.

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

float xAOD::CompositeParticle_v1::weight ( const std::vector< std::string > &  varNames  ) 

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.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 1 Dec 2017 for RootCore Packages by  doxygen 1.6.1