Particle Class Reference

#include <Particle.hh>

Inheritance diagram for Particle:

Inheritance graph
[legend]

Collaboration diagram for Particle:

Collaboration graph
[legend]

List of all members.


Detailed Description

Representation of particles from a HepMC::GenEvent.

Definition at line 16 of file Particle.hh.


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.
long pdgId () const
 The PDG ID code for this Particle.
const FourMomentummomentum () const
 The momentum of this Particle.
ParticlesetMomentum (const FourMomentum &momentum)
 Set the momentum 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.
long _id
 The PDG ID code for this Particle.
FourMomentum _momentum
 The momentum of this projection of the Particle.

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.

00022       : ParticleBase(),
00023         _original(0), _id(0), _momentum()
00024     { }

Particle ( PdgId  pid,
const FourMomentum mom 
) [inline]

Constructor without GenParticle.

Definition at line 27 of file Particle.hh.

00028       : ParticleBase(),
00029         _original(0), _id(pid), _momentum(mom)
00030     { }

Particle ( const GenParticle &  gp  )  [inline]

Constructor from a HepMC GenParticle.

Definition at line 33 of file Particle.hh.

00034       : ParticleBase(),
00035         _original(&gp), _id(gp.pdg_id()),
00036         _momentum(gp.momentum())
00037     { }


Member Function Documentation

const GenParticle& genParticle (  )  const [inline]

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 DISLepton::project().

00050                                 {
00051       return bool(_original);
00052     }

long 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(), STAR_2008_S7869363::analyze(), STAR_2006_S6860818::analyze(), STAR_2006_S6500200::analyze(), PDG_HADRON_MULTIPLICITIES_RATIOS::analyze(), PDG_HADRON_MULTIPLICITIES::analyze(), OPAL_1998_S3780481::analyze(), OPAL_1993_S2692198::analyze(), MC_WJETS::analyze(), MC_SUSY::analyze(), H1_1994_S2919893::analyze(), DELPHI_1995_S3137023::analyze(), D0_2008_S7837160::analyze(), D0_1998_S3711838::analyze(), CDF_2008_S7541902::analyze(), CDF_2008_S7540469::analyze(), CDF_1993_S2742446::analyze(), CDF_1991_S2313472::analyze(), BELLE_2006_S6265367::analyze(), ALEPH_1996_S3486095::analyze(), Rivet::chargedParticleFilter(), Rivet::hadronFilter(), 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::PID::isLepton(), Rivet::PID::isMeson(), Rivet::PID::isNucleus(), Rivet::PID::isPentaquark(), Rivet::PID::isRhadron(), Rivet::PID::isSUSY(), Rivet::PID::jSpin(), Rivet::PID::lSpin(), ZFinder::project(), WFinder::project(), VetoedFinalState::project(), NeutralFinalState::project(), InvMassFinalState::project(), IdentifiedFinalState::project(), DISLepton::project(), ClusteredPhotons::project(), ChargedLeptons::project(), Rivet::PID::sSpin(), and Rivet::PID::threeCharge().

00056                        {
00057       return _id;
00058     }

const FourMomentum& momentum (  )  const [inline, virtual]

The momentum of this Particle.

Implements ParticleBase.

Definition at line 62 of file Particle.hh.

References Particle::_momentum.

Referenced by SVertex::_applyVtxTrackCuts(), CDF_2004_S5839831::_calcTransCones(), FinalState::accept(), UA5_1986_S1583476::analyze(), UA5_1982_S875503::analyze(), UA1_1990_S2044935::analyze(), STAR_2009_UE_HELEN::analyze(), STAR_2008_S7993412::analyze(), STAR_2008_S7869363::analyze(), STAR_2006_S6860818::analyze(), STAR_2006_S6500200::analyze(), SFM_1984_S1178091::analyze(), OPAL_1998_S3780481::analyze(), OPAL_1993_S2692198::analyze(), MC_ZZJETS::analyze(), MC_ZJETS::analyze(), MC_WWJETS::analyze(), MC_WJETS::analyze(), MC_TTBAR::analyze(), MC_SUSY::analyze(), MC_PHOTONJETUE::analyze(), MC_PHOTONJETS::analyze(), MC_LEADINGJETS::analyze(), MC_HJETS::analyze(), MC_GENERIC::analyze(), MC_DIPHOTON::analyze(), MC_DIJET::analyze(), H1_2000_S4129130::analyze(), H1_1994_S2919893::analyze(), DELPHI_1995_S3137023::analyze(), D0_2010_S8570965::analyze(), D0_2009_S8349509::analyze(), D0_2008_S7863608::analyze(), D0_2008_S7837160::analyze(), D0_2008_S7719523::analyze(), D0_2006_S6438750::analyze(), D0_1998_S3711838::analyze(), CDF_2009_S8436959::analyze(), CDF_2009_S8233977::analyze(), CDF_2008_S8095620::analyze(), CDF_2008_S7541902::analyze(), CDF_2008_S7540469::analyze(), CDF_2008_LEADINGJETS::analyze(), CDF_2006_S6653332::analyze(), CDF_2005_S6080774::analyze(), CDF_2004_S5839831::analyze(), CDF_2002_S4796047::analyze(), CDF_2001_S4751469::analyze(), CDF_1993_S2742446::analyze(), CDF_1991_S2313472::analyze(), CDF_1990_S2089246::analyze(), CDF_1988_S1865951::analyze(), BELLE_2006_S6265367::analyze(), ATLAS_2010_S8591806::analyze(), ALEPH_2004_S5765862::analyze(), ALEPH_1996_S3486095::analyze(), ALEPH_1996_S3196992::analyze(), Thrust::calc(), Sphericity::calc(), FastJets::calc(), Rivet::cmpParticleByAscAbsPseudorapidity(), Rivet::cmpParticleByAscAbsRapidity(), Rivet::cmpParticleByAscE(), Rivet::cmpParticleByAscEt(), Rivet::cmpParticleByAscPseudorapidity(), Rivet::cmpParticleByAscPt(), Rivet::cmpParticleByAscRapidity(), Rivet::cmpParticleByDescAbsPseudorapidity(), Rivet::cmpParticleByDescAbsRapidity(), Rivet::cmpParticleByDescPseudorapidity(), Rivet::cmpParticleByDescRapidity(), Rivet::cmpParticleByE(), Rivet::cmpParticleByEt(), Rivet::cmpParticleByPt(), Particle::mass(), STARRandomFilter::operator()(), ALEPH_1996_S3196992::particleInJet(), ZFinder::project(), WFinder::project(), VetoedFinalState::project(), TriggerUA5::project(), TriggerCDFRun2::project(), TriggerCDFRun0Run1::project(), TotalVisibleMomentum::project(), SVertex::project(), NeutralFinalState::project(), JetShape::project(), InvMassFinalState::project(), Hemispheres::project(), FinalStateHCM::project(), DISLepton::project(), DISKinematics::project(), and ClusteredPhotons::project().

00062                                          {
00063       return _momentum;
00064     }

Particle& setMomentum ( const FourMomentum momentum  )  [inline]

Set the momentum of this Particle.

Definition at line 68 of file Particle.hh.

References Particle::_momentum.

Referenced by ZFinder::project(), and FinalStateHCM::project().

00068                                                         {
00069       _momentum = momentum;
00070       return *this;
00071     }

double mass (  )  const [inline]

The mass of this Particle.

Definition at line 75 of file Particle.hh.

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

00075                         {
00076       return momentum().mass();
00077     }

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().

00007                                                {
00008     GenVertex* prodVtx = genParticle().production_vertex();
00009     if (prodVtx == 0) return false;
00010     foreach (const GenParticle* ancestor, particles(prodVtx, HepMC::ancestors)) {
00011       if (ancestor->pdg_id() == pdg_id) return true;
00012     }
00013     return false;
00014   }


Member Data Documentation

const GenParticle* _original [private]

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

Definition at line 97 of file Particle.hh.

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

long _id [private]

The PDG ID code for this Particle.

Definition at line 100 of file Particle.hh.

Referenced by Particle::pdgId().

The momentum of this projection of the Particle.

Definition at line 103 of file Particle.hh.

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


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