rivet is hosted by Hepforge, IPPP Durham
Particle Class Reference

Representation of particles from a HepMC::GenEvent. More...

#include <Particle.hh>

Inheritance diagram for Particle:
Collaboration diagram for Particle:

List of all members.

Public Member Functions

 Particle ()
 Particle (PdgId pid, const FourMomentum &mom)
 Constructor without GenParticle.
 Particle (const GenParticle &gp)
 Constructor from a HepMC GenParticle.
const GenParticle & genParticle () const
 Get a const reference to the original GenParticle.
bool hasGenParticle () const
 Check if the particle corresponds to a GenParticle.
PdgId pdgId () const
 The PDG ID code for this Particle.
ParticlesetMomentum (const FourMomentum &momentum)
 Set the momentum of this Particle.
const FourMomentummomentum () const
 The momentum of this Particle.
double energy () const
 The energy of this Particle.
double mass () const
 The mass of this Particle.
bool hasAncestor (PdgId pdg_id) const
 Check whether a given PID is found in the GenParticle's ancestor list.

Private Attributes

const GenParticle * _original
 A pointer to the original GenParticle from which this Particle is projected.
PdgId _id
 The PDG ID code for this Particle.
FourMomentum _momentum
 The momentum of this projection of the Particle.

Detailed Description

Representation of particles from a HepMC::GenEvent.

Definition at line 16 of file Particle.hh.


Constructor & Destructor Documentation

Particle ( ) [inline]

Default constructor.

Deprecated:
A particle without info is useless. This only exists to keep STL containers happy.

Definition at line 21 of file Particle.hh.

      : ParticleBase(),
        _original(0), _id(0), _momentum()
    { }
Particle ( PdgId  pid,
const FourMomentum mom 
) [inline]

Constructor without GenParticle.

Definition at line 27 of file Particle.hh.

      : ParticleBase(),
        _original(0), _id(pid), _momentum(mom)
    { }
Particle ( const GenParticle &  gp) [inline]

Constructor from a HepMC GenParticle.

Definition at line 33 of file Particle.hh.

      : ParticleBase(),
        _original(&gp), _id(gp.pdg_id()),
        _momentum(gp.momentum())
    { }

Member Function Documentation

double energy ( ) const [inline]

The energy of this Particle.

Definition at line 73 of file Particle.hh.

References FourMomentum::E(), and Particle::momentum().

                          {
      return momentum().E();
    }
bool hasAncestor ( PdgId  pdg_id) const

Check whether a given PID is found in the GenParticle's ancestor list.

Definition at line 7 of file Particle.cc.

References Particle::genParticle(), and Rivet::particles().

Referenced by ALICE_2011_S8909580::analyze(), ALICE_2011_S8945144::analyze(), and CMS_2011_S8978280::analyze().

                                               {
    GenVertex* prodVtx = genParticle().production_vertex();
    if (prodVtx == 0) return false;
    foreach (const GenParticle* ancestor, particles(prodVtx, HepMC::ancestors)) {
      if (ancestor->pdg_id() == pdg_id) return true;
    }
    return false;
  }
bool hasGenParticle ( ) const [inline]

Check if the particle corresponds to a GenParticle.

Definition at line 50 of file Particle.hh.

References Particle::_original.

Referenced by FinalState::accept(), LHCB_2010_S8758301::getLongestLivedAncestor(), LHCB_2011_I917009::getMotherLifeTimeSum(), and DISLepton::project().

                                {
      return bool(_original);
    }
double mass ( ) const [inline]

The mass of this Particle.

Definition at line 78 of file Particle.hh.

References FourMomentum::mass(), and Particle::momentum().

Referenced by ALICE_2011_S8945144::analyze().

                        {
      return momentum().mass();
    }
const FourMomentum& momentum ( ) const [inline, virtual]

The momentum of this Particle.

Implements ParticleBase.

Definition at line 68 of file Particle.hh.

References Particle::_momentum.

Referenced by CDF_2004_S5839831::_calcTransCones(), FinalState::accept(), ClusteredLepton::addPhoton(), BABAR_2005_S6181155::analyze(), CLEO_2004_S5809304::analyze(), BABAR_2007_S6895344::analyze(), BELLE_2001_S4598261::analyze(), BELLE_2006_S6265367::analyze(), ARGUS_1993_S2653028::analyze(), BABAR_2007_S7266081::analyze(), ATLAS_2011_I894867::analyze(), OPAL_1994_S2927284::analyze(), ARGUS_1993_S2789213::analyze(), ARGUS_1993_S2669951::analyze(), H1_2000_S4129130::analyze(), OPAL_1993_S2692198::analyze(), SLD_2004_S5693039::analyze(), CMS_2010_S8656010::analyze(), TOTEM_2012_I1115294::analyze(), ATLAS_2010_S8591806::analyze(), LHCF_2012_I1115479::analyze(), OPAL_1998_S3780481::analyze(), ALICE_2011_S8909580::analyze(), SLD_1999_S3743934::analyze(), ALICE_2011_S8945144::analyze(), STAR_2008_S7993412::analyze(), OPAL_1995_S3198391::analyze(), OPAL_1997_S3608263::analyze(), OPAL_2000_S4418603::analyze(), ALEPH_2002_S4823664::analyze(), H1_1994_S2919893::analyze(), OPAL_1996_S3257789::analyze(), OPAL_1998_S3702294::analyze(), DELPHI_1999_S3960137::analyze(), CMS_QCD_10_024::analyze(), UA5_1982_S875503::analyze(), CDF_2005_S6080774::analyze(), CMS_2010_S8547297::analyze(), CMS_2011_S8978280::analyze(), DELPHI_1995_S3137023::analyze(), ATLAS_2011_S9002537::analyze(), MC_DIPHOTON::analyze(), ATLAS_2011_S8994773::analyze(), CDF_1988_S1865951::analyze(), CDF_1990_S2089246::analyze(), ATLAS_2010_CONF_2010_049::analyze(), ALICE_2010_S8706239::analyze(), CDF_1993_S2742446::analyze(), CDF_2008_S7540469::analyze(), OPAL_2002_S5361494::analyze(), CDF_2009_S8436959::analyze(), CDF_2012_NOTE10874::analyze(), SLD_1996_S3398250::analyze(), CMS_2011_S8973270::analyze(), DELPHI_2000_S4328825::analyze(), CMS_2011_S9215166::analyze(), MC_ZJETS::analyze(), OPAL_1998_S3749908::analyze(), SFM_1984_S1178091::analyze(), LHCB_2011_I919315::analyze(), MC_DIJET::analyze(), MC_HJETS::analyze(), OPAL_1997_S3396100::analyze(), STAR_2006_S6500200::analyze(), D0_2006_S6438750::analyze(), ALICE_2010_S8625980::analyze(), MC_IDENTIFIED::analyze(), MC_LEADJETUE::analyze(), ALEPH_1996_S3196992::analyze(), CDF_2009_S8233977::analyze(), UA5_1986_S1583476::analyze(), D0_2010_S8570965::analyze(), MC_PHOTONJETS::analyze(), MC_PHOTONS::analyze(), STAR_2006_S6860818::analyze(), CMS_2012_I1107658::analyze(), CMS_2011_S8884919::analyze(), MC_WJETS::analyze(), ATLAS_2012_I1082009::analyze(), LHCB_2010_S8758301::analyze(), CDF_2008_S8095620::analyze(), CMS_2011_S9120041::analyze(), ATLAS_2012_I946427::analyze(), STAR_2009_UE_HELEN::analyze(), CDF_2006_S6653332::analyze(), ALEPH_1999_S4193598::analyze(), UA1_1990_S2044935::analyze(), MC_PHOTONJETUE::analyze(), CDF_2008_S7541902::analyze(), ATLAS_2012_I1183818::analyze(), CDF_2010_S8591881_QCD::analyze(), ATLAS_2012_CONF_2012_104::analyze(), CDF_2008_LEADINGJETS::analyze(), ATLAS_2011_S9108483::analyze(), TASSO_1990_S2148048::analyze(), ATLAS_2012_I1190891::analyze(), LHCB_2011_I917009::analyze(), MC_GENERIC::analyze(), D0_2008_S7719523::analyze(), ATLAS_2012_I1126136::analyze(), ATLAS_2012_I1186556::analyze(), ATLAS_2011_S9212183::analyze(), MC_TTBAR::analyze(), ATLAS_2011_S9120807::analyze(), STAR_2008_S7869363::analyze(), ATLAS_2012_CONF_2012_105::analyze(), ATLAS_2010_S8914702::analyze(), ATLAS_2011_CONF_2011_098::analyze(), CDF_2001_S4751469::analyze(), ATLAS_2012_CONF_2012_103::analyze(), ATLAS_2012_I1112263::analyze(), ATLAS_2012_I1125961::analyze(), ATLAS_2012_I1117704::analyze(), ATLAS_2012_I1095236::analyze(), ATLAS_2012_CONF_2012_001::analyze(), ATLAS_2011_I926145::analyze(), ATLAS_2012_CONF_2012_109::analyze(), ATLAS_2012_I1180197::analyze(), ATLAS_2011_S8983313::analyze(), ATLAS_2011_CONF_2011_090::analyze(), ATLAS_2011_S9019561::analyze(), ATLAS_2010_S8894728::analyze(), ATLAS_2010_S8919674::analyze(), ATLAS_2012_CONF_2012_153::analyze(), MC_SUSY::analyze(), ATLAS_2011_S9212353::analyze(), ATLAS_2012_I943401::analyze(), ATLAS_2011_S9225137::analyze(), MC_VH2BB::analyze(), ATLAS_2011_S9041966::analyze(), ATLAS_2012_I1093738::analyze(), ALEPH_1996_S3486095::analyze(), ATLAS_2012_I1094568::analyze(), ALEPH_2004_S5765862::analyze(), ATLAS_2011_I944826::analyze(), DELPHI_1996_S3430090::analyze(), CDF_2004_S5839831::analyze(), BeamThrust::calc(), InvMassFinalState::calc(), FParameter::calc(), JetShape::calc(), Spherocity::calc(), Thrust::calc(), Sphericity::calc(), FastJets::calc(), Rivet::cmpParticleByAscAbsPseudorapidity(), Rivet::cmpParticleByAscAbsRapidity(), Rivet::cmpParticleByAscE(), Rivet::cmpParticleByAscEt(), Rivet::cmpParticleByAscP(), Rivet::cmpParticleByAscPseudorapidity(), Rivet::cmpParticleByAscPt(), Rivet::cmpParticleByAscRapidity(), Rivet::cmpParticleByDescAbsPseudorapidity(), Rivet::cmpParticleByDescAbsRapidity(), Rivet::cmpParticleByDescPseudorapidity(), Rivet::cmpParticleByDescRapidity(), Rivet::cmpParticleByE(), Rivet::cmpParticleByEt(), Rivet::cmpParticleByP(), Rivet::cmpParticleByPt(), Rivet::deltaEta(), Rivet::deltaPhi(), Rivet::deltaR(), Particle::energy(), ATLAS_2012_I1084540::fillMap(), ATLAS_2010_S8918562::fillPtEtaNch(), ATLAS_2012_I1091481::getPionEnergy(), ATLAS_2012_I1091481::getSeta(), Jet::hadronicEnergy(), Particle::mass(), Jet::neutralEnergy(), STARRandomFilter::operator()(), ALEPH_1996_S3196992::particleInJet(), CentralEtHCM::project(), DISLepton::project(), DISKinematics::project(), TriggerCDFRun2::project(), TriggerCDFRun0Run1::project(), DISFinalState::project(), NeutralFinalState::project(), ClusteredPhotons::project(), TriggerUA5::project(), LeptonClusters::project(), LeadingParticlesFinalState::project(), MissingMomentum::project(), Hemispheres::project(), ZFinder::project(), WFinder::project(), VetoedFinalState::project(), and Particle::setMomentum().

                                         {
      return _momentum;
    }
PdgId pdgId ( ) const [inline]

The PDG ID code for this Particle.

Definition at line 56 of file Particle.hh.

References Particle::_id.

Referenced by Rivet::PID::abspid(), BABAR_2005_S6181155::analyze(), BABAR_2007_S6895344::analyze(), BELLE_2001_S4598261::analyze(), BELLE_2006_S6265367::analyze(), CLEO_2004_S5809304::analyze(), ARGUS_1993_S2653028::analyze(), BABAR_2007_S7266081::analyze(), ARGUS_1993_S2789213::analyze(), OPAL_1994_S2927284::analyze(), ARGUS_1993_S2669951::analyze(), PDG_HADRON_MULTIPLICITIES::analyze(), PDG_HADRON_MULTIPLICITIES_RATIOS::analyze(), OPAL_1993_S2692198::analyze(), SLD_2004_S5693039::analyze(), CMS_2010_S8656010::analyze(), LHCF_2012_I1115479::analyze(), OPAL_1998_S3780481::analyze(), ALICE_2011_S8945144::analyze(), SLD_1999_S3743934::analyze(), ALICE_2011_S8909580::analyze(), OPAL_1997_S3608263::analyze(), OPAL_2000_S4418603::analyze(), OPAL_1995_S3198391::analyze(), H1_1994_S2919893::analyze(), ALEPH_2002_S4823664::analyze(), OPAL_1998_S3702294::analyze(), DELPHI_1999_S3960137::analyze(), OPAL_1996_S3257789::analyze(), CMS_2011_S8978280::analyze(), DELPHI_1995_S3137023::analyze(), CMS_2010_S8547297::analyze(), CDF_1993_S2742446::analyze(), OPAL_2002_S5361494::analyze(), CMS_2011_S8973270::analyze(), DELPHI_2000_S4328825::analyze(), CDF_2008_S7540469::analyze(), SLD_1996_S3398250::analyze(), OPAL_1998_S3749908::analyze(), LHCB_2011_I919315::analyze(), STAR_2006_S6500200::analyze(), MC_IDENTIFIED::analyze(), OPAL_1997_S3396100::analyze(), STAR_2006_S6860818::analyze(), CMS_2011_S8884919::analyze(), MC_WJETS::analyze(), ATLAS_2012_I1082009::analyze(), LHCB_2010_S8758301::analyze(), ALEPH_1999_S4193598::analyze(), CDF_2008_S7541902::analyze(), ATLAS_2012_I1183818::analyze(), ATLAS_2012_CONF_2012_104::analyze(), LHCB_2011_I917009::analyze(), ATLAS_2012_I1126136::analyze(), STAR_2008_S7869363::analyze(), ATLAS_2012_I1095236::analyze(), ATLAS_2012_I1180197::analyze(), ATLAS_2012_CONF_2012_109::analyze(), ATLAS_2012_CONF_2012_153::analyze(), MC_SUSY::analyze(), ALEPH_1996_S3486095::analyze(), ATLAS_2011_I944826::analyze(), DELPHI_1996_S3430090::analyze(), InvMassFinalState::calc(), Rivet::chargedParticleFilter(), Jet::containsBottom(), Jet::containsCharm(), Jet::containsParticleId(), Rivet::hadronFilter(), Jet::hadronicEnergy(), Rivet::PID::hasBottom(), Rivet::PID::hasCharm(), Rivet::PID::hasDown(), Rivet::PID::hasStrange(), Rivet::PID::hasTop(), Rivet::PID::hasUp(), LeadingParticlesFinalState::inList(), Rivet::PID::isBaryon(), Rivet::PID::isDiQuark(), Rivet::PID::isHadron(), Rivet::isInvisibleFilter(), Rivet::PID::isLepton(), Rivet::PID::isMeson(), Rivet::PID::isNucleus(), Rivet::PID::isPentaquark(), Rivet::PID::isRhadron(), Rivet::PID::isSUSY(), Rivet::PID::jSpin(), Rivet::PID::lSpin(), Jet::neutralEnergy(), Rivet::nonHadronFilter(), ChargedLeptons::project(), DISLepton::project(), NeutralFinalState::project(), ClusteredPhotons::project(), ZFinder::project(), IdentifiedFinalState::project(), WFinder::project(), VetoedFinalState::project(), Rivet::PID::sSpin(), and Rivet::PID::threeCharge().

                        {
      return _id;
    }
Particle& setMomentum ( const FourMomentum momentum) [inline]

Set the momentum of this Particle.

Definition at line 62 of file Particle.hh.

References Particle::_momentum, and Particle::momentum().

Referenced by ClusteredLepton::addPhoton(), and DISFinalState::project().

                                                        {
      _momentum = momentum;
      return *this;
    }

Member Data Documentation

PdgId _id [private]

The PDG ID code for this Particle.

Definition at line 103 of file Particle.hh.

Referenced by Particle::pdgId().

The momentum of this projection of the Particle.

Definition at line 106 of file Particle.hh.

Referenced by Particle::momentum(), and Particle::setMomentum().

const GenParticle* _original [private]

A pointer to the original GenParticle from which this Particle is projected.

Definition at line 100 of file Particle.hh.

Referenced by Particle::genParticle(), and Particle::hasGenParticle().


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