  | 
  
    ATLAS Offline Software
    
   | 
 
 
 
 
Go to the documentation of this file.
    8 #ifndef XAODPARTICLEEVENT_VERSIONS_COMPOSITEPARTICLE_V1_H 
    9 #define XAODPARTICLEEVENT_VERSIONS_COMPOSITEPARTICLE_V1_H 
   19 #include "AthLinks/ElementLink.h" 
   33 #include "Math/Vector4D.h" 
   55     virtual double           pt() 
const;
 
   57     virtual double           eta() 
const;
 
   59     virtual double           phi() 
const;
 
   61     virtual double           m() 
const;
 
   63     virtual double           e() 
const;
 
   74     typedef ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > 
GenVecFourMom_t;
 
  150       return this->
p4( std::vector<int>{partIndexA, partIndexB} );
 
  153     inline FourMom_t p4( 
int partIndexA, 
int partIndexB, 
int partIndexC )
 const {
 
  154       return this->
p4( std::vector<int>{partIndexA, partIndexB, partIndexC} );
 
  157     inline FourMom_t p4( 
int partIndexA, 
int partIndexB, 
int partIndexC, 
int partIndexD )
 const {
 
  158       return this->
p4( std::vector<int>{partIndexA, partIndexB, partIndexC, partIndexD} );
 
  162     double pt( 
const std::vector<int>& partIndices ) 
const;
 
  164     double eta( 
const std::vector<int>& partIndices ) 
const;
 
  166     double phi( 
const std::vector<int>& partIndices ) 
const;
 
  168     double m( 
const std::vector<int>& partIndices ) 
const;
 
  170     double p( 
const std::vector<int>& partIndices ) 
const;
 
  172     double e( 
const std::vector<int>& partIndices ) 
const;
 
  174     double rapidity( 
const std::vector<int>& partIndices ) 
const;
 
  177     double px( 
const std::vector<int>& partIndices ) 
const;
 
  179     double py( 
const std::vector<int>& partIndices ) 
const;
 
  181     double pz( 
const std::vector<int>& partIndices ) 
const;
 
  184     double et( 
const std::vector<int>& partIndices ) 
const;
 
  206       if ( partIndexB==-2 ) {
 
  207         return this->
mt( std::vector<int>{partIndexA}, 
method );
 
  209       return this->
mt( std::vector<int>{partIndexA, partIndexB}, 
method );
 
  231     float weight( 
const std::vector<std::string>& varNames,
 
  232                   const std::vector<int>& partIndices={} ) 
const;
 
  239     inline float weight( 
const std::string& varNameA )
 const {
 
  240       return this->
weight( std::vector<std::string>{varNameA} );
 
  242     inline float weight( 
const std::string& varNameA,
 
  243                          const std::string& varNameB )
 const {
 
  244       return this->
weight( std::vector<std::string>{varNameA,varNameB} );
 
  246     inline float weight( 
const std::string& varNameA,
 
  247                          const std::string& varNameB,
 
  248                          const std::string& varNameC )
 const {
 
  249       return this->
weight( std::vector<std::string>{varNameA,varNameB,varNameC} );
 
  251     inline float weight( 
const std::string& varNameA,
 
  252                          const std::string& varNameB,
 
  253                          const std::string& varNameC,
 
  254                          const std::string& varNameD )
 const {
 
  255       return this->
weight( std::vector<std::string>{varNameA,varNameB,varNameC,varNameD} );
 
  257     inline float weight( 
const std::string& varNameA,
 
  258                          const std::string& varNameB,
 
  259                          const std::string& varNameC,
 
  260                          const std::string& varNameD,
 
  261                          const std::string& varNameE )
 const {
 
  262       return this->
weight( std::vector<std::string>{varNameA,varNameB,varNameC,varNameD,varNameE} );
 
  294                    bool updateFourMom=
true );
 
  340     std::size_t 
nParts() 
const;
 
  399     template<
typename CONTTYPE>
 
  409                                           const std::vector<int>& otherPartIndices=std::vector<int>{},
 
  410                                           bool updateFourMom=true ) 
const;
 
  419                                           bool updateFourMom=
true )
 const {
 
  420       if ( partIndexC==-2 ) {
 
  421         return this->
compPart( std::vector<int>{partIndexA, partIndexB}, std::vector<int>{}, updateFourMom );
 
  423       return this->
compPart( std::vector<int>{partIndexA, partIndexB, partIndexC}, std::vector<int>{}, updateFourMom );
 
  696   return static_cast<const xAOD::Jet*
>(ipart);
 
  767   return static_cast<const xAOD::Jet*
>(ipart);
 
  783 #endif // XAODPARTICLEEVENT_VERSIONS_COMPOSITEPARTICLE_V1_H 
  
std::size_t nParts() const
Number of constituent particles.
 
const xAOD::Muon * otherMuon(std::size_t index=0) const
Get the other constituent number i as an Muon.
 
const xAOD::Photon * photon(std::size_t index=0) const
Get the constituent number i as a Photon.
 
virtual double m() const
The invariant mass of the particle.
 
std::size_t nJets() const
Number of constituent jets.
 
float getFloat(const std::string &varName) const
Access to get a variable of type float.
 
void setPy(double py)
Set the y-component of the momentum.
 
const xAOD::TruthParticle * truthPart(std::size_t index=0) const
Get the constituent number i as a TruthParticle.
 
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
 
Electron_v1 Electron
Definition of the current "egamma version".
 
const xAOD::IParticleLink & partLink(std::size_t index=0) const
Get the constituent IParticle number i as an ElementLink.
 
std::size_t nOtherTruthElectrons() const
Number of other constituent truth electrons.
 
float weight(const std::string &varNameA, const std::string &varNameB, const std::string &varNameC) const
 
FourMom_t p4(const std::vector< int > &partIndices) const
The total 4-momentum.
 
virtual FourMom_t p4() const
The full 4-momentum of the particle.
 
float weight(const std::string &varNameA, const std::string &varNameB) const
 
DataVector adapter that acts like it holds const pointers.
 
const xAOD::TruthParticle * otherTruthPart(std::size_t index=0) const
Get the other constituent number i as a TruthParticle.
 
double et() const
The transverse energy ( ) of the particle.
 
ConstDataVector< CONTTYPE > * parts() const
Method to return a DataVector<T>, e.g., a MuonContainer, for all the constituent particles,...
 
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > GenVecFourMom_t
Base 4 Momentum type (GenVector)
 
const xAOD::Electron * electron(std::size_t index=0) const
Get the constituent number i as an Electron.
 
bool containsOther(const xAOD::IParticle *part) const
Check if a given xAOD::IParticle is an other constituent.
 
std::size_t nTaus() const
Number of constituent taus.
 
std::size_t nOtherParts() const
Number of other constituent particles.
 
bool contains(const xAOD::MissingET *met) const
Check if a given xAOD::MissingET object is part of this CompositeParticle.
 
virtual double e() const
The total energy of the particle.
 
virtual double rapidity() const
The true rapidity (y) of the particle.
 
virtual Type::ObjectType type() const =0
The type of the object as a simple enumeration.
 
IParticleLinkContainer_v1 IParticleLinkContainer
Define the latest version of the IParticleLinkContainer class.
 
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
 
const xAOD::IParticleLinkContainer & partLinks() const
Get all constituents in one go.
 
std::vector< size_t > vec
 
Helper class to provide constant type-safe access to aux data.
 
double py() const
Get the py momentum component of the particle.
 
std::size_t nOtherTruthTaus() const
Number of other constituent truth taus.
 
std::size_t nTruthParts() const
Number of constituent xAOD::TruthParticles.
 
void setCharge(float charge)
Set the electric charge.
 
double py(const std::vector< int > &partIndices) const
Get the py momentum component.
 
std::size_t nOtherTruthParts() const
Number of other constituent xAOD::TruthParticles.
 
const xAOD::CompositeParticle_v1 * otherCompPart(std::size_t index=0) const
Get the other constituent number i as a CompositeParticle.
 
void addPart(const xAOD::IParticle *part, bool updateFourMom=true)
Add a particle as an additional constituent.
 
Class providing the definition of the 4-vector interface.
 
std::size_t nOtherMuons() const
Number of other constituent muons.
 
void setPx(double px)
Set the x-component of the momentum.
 
void removeMissingET(bool updateFourMom=true)
Remove the existing MissingET object from this CompositeParticle.
 
bool getBool(const std::string &varName) const
Access to get a variable of type bool (actually, it is stored using type char)
 
const xAOD::Muon * muon(std::size_t index=0) const
Get the constituent number i as an Muon.
 
double phi(const std::vector< int > &partIndices) const
The azimuthal angle ( )
 
float weight(const std::string &varNameA) const
Get the weight for this xAOD::CompositeParticle.
 
const xAOD::IParticle * part(std::size_t index=0) const
Get the constituent IParticle number i.
 
virtual double pt() const
The transverse momentum ( ) of the particle.
 
TLorentzVector FourMom_t
Definition of the 4-momentum type.
 
float weight(const std::string &varNameA, const std::string &varNameB, const std::string &varNameC, const std::string &varNameD, const std::string &varNameE) const
 
std::size_t nOtherPhotons() const
Number of other constituent photons.
 
CompositeParticle_v1 CompositeParticle
Define the latest version of the composite particle class.
 
FourMom_t p4(int partIndexA, int partIndexB) const
Get the four-momentum with two indices.
 
float weightHelper(const xAOD::IParticle *part, const xAOD::IParticle::ConstAccessor< float > &varAcc) const
This is a private helper method to calculate the weight.
 
virtual double phi() const
The azimuthal angle ( ) of the particle.
 
std::size_t nOtherCompParts() const
Number of other constituent CompositeParticles.
 
void addOtherParts(const xAOD::IParticleLinkContainer &partLinkCont)
Add many other constituents at the same time.
 
void setPartLinks(const xAOD::IParticleLinkContainer &constitLinks)
Set all constituents in one go.
 
void setPxPyPzE(double px, double py, double pz, double e)
Set the 4-vec.
 
double et(const std::vector< int > &partIndices) const
The transverse energy ( ) Note that this differs from ( ) for massive particles.
 
double mt(const std::vector< int > &partIndices, MT::Method method=MT::DEFAULT) const
Get the transverse mass.
 
double getDouble(const std::string &varName) const
Access to get a variable of type double.
 
void setPdgId(int pdgID)
Set the PDG identifier.
 
double e(const std::vector< int > &partIndices) const
The total energy.
 
string varName
end cluster ToT and charge
 
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 upd...
 
Class describing a truth particle in the MC record.
 
Class describing a tau jet.
 
double pz(const std::vector< int > &partIndices) const
Get the pz momentum component.
 
std::size_t nMuons() const
Number of constituent muons.
 
FourMom_t p4(int partIndexA, int partIndexB, int partIndexC, int partIndexD) const
Get the four-momentum with four indices.
 
const xAOD::Jet * otherJet(std::size_t index=0) const
Get the other constituent number i as a Jet.
 
TruthParticle_v1 TruthParticle
Typedef to implementation.
 
Description of a composite particle, i.e.
 
Principal data object for Missing ET.
 
void removeOtherPart(const xAOD::IParticle *part)
Remove a particle as an other constituent from this CompostiteParticle.
 
std::size_t nTruthLeptons() const
Number of constituent truth leptons (truth electrons, truth muons, and truth taus).
 
std::size_t nElectrons() const
Number of constituent electrons.
 
std::size_t nOtherTaus() const
Number of other constituent taus.
 
const xAOD::TauJet * otherTau(std::size_t index=0) const
Get the other constituent number i as a tau.
 
std::size_t nOtherTruthMuons() const
Number of other constituent truth muons.
 
CompositeParticle_v1()
Default constructor.
 
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : GenVector form Note: can be slower than just p4 for this class;...
 
std::size_t nLeptons() const
Number of constituent leptons (electrons, muons, and taus).
 
double pt(const std::vector< int > &partIndices) const
The transverse momentum ( )
 
double pz() const
Get the pz momentum component of the particle.
 
xAOD::CompositeParticle_v1 * compPart(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 ind...
 
const xAOD::Photon * otherPhoton(std::size_t index=0) const
Get the other constituent number i as a Photon.
 
virtual Type::ObjectType type() const
The type of the object as a simple enumeration.
 
std::size_t nPhotons() const
Number of constituent photons.
 
const xAOD::IParticleLinkContainer & otherPartLinks() const
Get all other constituents in one go.
 
double px(const std::vector< int > &partIndices) const
Get the px momentum component.
 
double px() const
Get the px momentum component of the particle.
 
FourMom_t p4(int partIndexA, int partIndexB, int partIndexC) const
Get the four-momentum with three indices.
 
virtual double eta() const
The pseudorapidity ( ) of the particle.
 
const xAOD::TauJet * tau(std::size_t index=0) const
Get the constituent number i as a tau.
 
std::size_t nOtherLeptons() const
Number of other constituent leptons (electrons, muons, and taus).
 
double p(const std::vector< int > &partIndices) const
The total 3-momentum.
 
void addOtherPart(const xAOD::IParticle *part)
Add a particle as an additional other constituent.
 
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...
 
double rapidity(const std::vector< int > &partIndices) const
The true rapidity (y)
 
Photon_v1 Photon
Definition of the current "egamma version".
 
const xAOD::Electron * otherElectron(std::size_t index=0) const
Get the other constituent number i as an Electron.
 
struct TBPatternUnitContext Muon
 
float charge() const
Return the electric charge.
 
std::size_t nTruthElectrons() const
Number of constituent truth electrons.
 
void setPz(double pz)
Set the z-component of the momentum.
 
const xAOD::IParticleLink & otherPartLink(std::size_t index=0) const
Get the other constituent IParticle number i as an ElementLink.
 
std::size_t nOtherElectrons() const
Number of other constituent electrons.
 
const xAOD::Jet * jet(std::size_t index=0) const
Get the constituent number i as a Jet.
 
std::size_t nTruthMuons() const
Number of constituent truth muons.
 
DataVector adapter that acts like it holds const pointers.
 
void setMissingET(const xAOD::MissingET *met, bool updateFourMom=true)
Set the MissingET for this CompositeParticle.
 
int pdgId() const
Return the PDG identifier.
 
double eta(const std::vector< int > &partIndices) const
The pseudorapidity ( )
 
void removePart(const xAOD::IParticle *part, bool updateFourMom=true)
Remove a particle as a constituent from this CompostiteParticle.
 
std::size_t nOtherJets() const
Number of other constituent jets.
 
std::size_t nOtherTruthLeptons() const
Number of other constituent truth leptons (truth electrons, truth muons, and truth taus).
 
double mt(int partIndexA, int partIndexB=-2, MT::Method method=MT::DEFAULT) const
Get the transverse mass with only one constituent particle.
 
void setOtherPartLinks(const xAOD::IParticleLinkContainer &otherPartLinks)
Set all other constituents in one go.
 
std::size_t nOtherTruthPhotons() const
Number of other constituent truth photons.
 
@ Tau
The object is a tau (jet)
 
std::size_t nCompParts() const
Number of constituent CompositeParticles.
 
float weight(const std::string &varNameA, const std::string &varNameB, const std::string &varNameC, const std::string &varNameD) const
 
Helper class to provide constant type-safe access to aux data.
 
bool hasCharge() const
Check if this composite particle has its charge set.
 
void setP4(const FourMom_t &vec)
Set the 4-vec.
 
double m(const std::vector< int > &partIndices) const
The invariant mass.
 
ObjectType
Type of objects that have a representation in the xAOD EDM.
 
Define the enumeration of calculation methods for the transverse mass.
 
const xAOD::IParticle * otherPart(std::size_t index=0) const
Get the other constituent IParticle number i.
 
void toPersistent()
Function preparing the object to be persistified.
 
int getInt(const std::string &varName) const
Access to get a variable of type int.
 
Jet_v1 Jet
Definition of the current "jet version".
 
std::size_t nTruthPhotons() const
Number of constituent truth photons.
 
std::size_t nTruthTaus() const
Number of constituent truth taus.
 
const xAOD::MissingET * missingET() const
Get the MissingET object that is associated with this CompositeParticle.
 
bool hasPdgId() const
Check if this composite particle has its charge set.
 
unsigned int getUInt(const std::string &varName) const
Access to get a variable of type unsigned int.
 
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 ...
 
void setE(double e)
Set the energy.