Rivet API documentation

Rivet 4.1.3
Particle.hh
1// -*- C++ -*-
2#ifndef RIVET_Particle_HH
3#define RIVET_Particle_HH
4
5#include "Rivet/Particle.fhh"
6#include "Rivet/ParticleBase.hh"
7#include "Rivet/Config/RivetCommon.hh"
8#include "Rivet/Math/LorentzTrans.hh"
9#include "Rivet/Tools/Cuts.hh"
10#include "Rivet/Tools/RivetFastJet.hh"
11#include "Rivet/Tools/Utils.hh"
12// NOTE: Rivet/Tools/ParticleUtils.hh included at the end
13
14namespace Rivet {
15
16
21 class Particles : public std::vector<Particle> {
22 public:
23
24 using base = std::vector<Particle>; //< using-declarations don't like template syntax
25 using base::base; //< import base-class constructors
26 Particles();
27 Particles(const std::vector<Particle>& vps);
28 FourMomenta moms() const;
29 PseudoJets pseudojets() const;
30 operator FourMomenta() const {
31 return moms();
32 }
33 operator PseudoJets() const {
34 return pseudojets();
35 }
36 Particles& operator+=(const Particle& p);
37 Particles& operator+=(const Particles& ps);
38 };
39
40 Particles operator+(const Particles& a, const Particles& b);
41
43 typedef std::pair<Particle, Particle> ParticlePair;
44
45
47
48
50 class Particle : public ParticleBase {
51 public:
52
55
59 : ParticleBase(), _original(nullptr), _id(PID::ANY), _isDirect(4, std::make_pair(false, false)) { }
60
63 const FourMomentum& mom,
64 const FourVector& pos = FourVector(),
65 ConstGenParticlePtr gp = nullptr)
66 : ParticleBase(),
67 _original(gp),
68 _id(pid),
69 _momentum(mom),
70 _origin(pos),
71 _isDirect(4, std::make_pair(false, false)) { }
72
74 Particle(PdgId pid, const FourMomentum& mom, ConstGenParticlePtr gp, const FourVector& pos = FourVector())
75 : Particle(pid, mom, pos, gp) { }
76
78 Particle(ConstGenParticlePtr gp)
79 : ParticleBase(),
80 _original(gp),
81 _id(gp->pdg_id()),
82 _momentum(gp->momentum()),
83 _isDirect(4, std::make_pair(false, false)) {
84 ConstGenVertexPtr vprod = gp->production_vertex();
85 if (vprod != nullptr) {
86 setOrigin(vprod->position().t(), vprod->position().x(), vprod->position().y(), vprod->position().z());
87 }
88 }
89
91 Particle(const RivetHepMC::GenParticle& gp)
92 : Particle(HepMCUtils::getParticlePtr(gp)) { }
93
95
96
99
101 const FourMomentum& momentum() const {
102 return _momentum;
103 }
104
107 _momentum = momentum;
108 return *this;
109 }
110
112 Particle& setMomentum(double E, double px, double py, double pz) {
113 _momentum = FourMomentum(E, px, py, pz);
114 return *this;
115 }
116
119
121
122
125
128 const FourVector& origin() const {
129 return _origin;
130 }
131
132 Particle& setOrigin(const FourVector& position) {
133 _origin = position;
134 return *this;
135 }
136
137 Particle& setOrigin(double t, double x, double y, double z) {
138 _origin = FourMomentum(t, x, y, z);
139 return *this;
140 }
141
143
145
146
149
157 const Vector3 v0 = origin().vector3();
158 const Vector3 phat = p3().unit();
159 const double a = phat.perpVec().dot(v0.perpVec()) / phat.perp2();
160 const Vector3 rtn = v0 - a * phat;
161 return rtn;
162 }
163
164
165 double impactParam(bool signedip = false) const {
166 const Vector3 closestApproachVector = closestApproach();
167 double ip_trans = closestApproachVector.perp();
168
169 if (!signedip) return ip_trans;
170 const Vector3 productionVertexVector = origin().vector3();
171 const Vector3 particleMomentumVector = momentum().vector3();
172 const Vector3 displacementVector = productionVertexVector - closestApproachVector;
173 const double sign = displacementVector.dot(particleMomentumVector) > 0 ? 1.0 : -1.0;
174 return sign * ip_trans;
175 }
176
177
179
181
182
185
187 virtual fastjet::PseudoJet pseudojet() const {
188 return fastjet::PseudoJet(mom().px(), mom().py(), mom().pz(), mom().E());
189 }
190
192 operator PseudoJet() const {
193 return pseudojet();
194 }
195
196
198 Particle& setGenParticle(ConstGenParticlePtr gp) {
199 _original = gp;
200 return *this;
201 }
202
204 ConstGenParticlePtr genParticle() const {
205 return _original;
206 }
207
210 explicit operator ConstGenParticlePtr() const {
211 return genParticle();
212 }
213
215
216
219
221 PdgId pid() const {
222 return _id;
223 }
224
225 PdgId abspid() const {
226 return std::abs(_id);
227 }
228
230
231
234
236 double charge() const {
237 return PID::charge(pid());
238 }
239
241 double abscharge() const {
242 return PID::abscharge(pid());
243 }
244
246 int charge3() const {
247 return PID::charge3(pid());
248 }
249
251 int abscharge3() const {
252 return PID::abscharge3(pid());
253 }
254
256 bool isCharged() const {
257 return charge3() != 0;
258 }
259
261
262
265
267 bool isHadron() const {
268 return PID::isHadron(pid());
269 }
270
272 bool isMeson() const {
273 return PID::isMeson(pid());
274 }
275
277 bool isBaryon() const {
278 return PID::isBaryon(pid());
279 }
280
282 bool isLepton() const {
283 return PID::isLepton(pid());
284 }
285
287 bool isChargedLepton() const {
288 return PID::isChargedLepton(pid());
289 }
290
292 bool isNeutrino() const {
293 return PID::isNeutrino(pid());
294 }
295
297 bool hasBottom() const {
298 return PID::hasBottom(pid());
299 }
300
302 bool hasCharm() const {
303 return PID::hasCharm(pid());
304 }
305
306 // /// Does this (hadron) contain an s quark?
307 bool hasStrange() const {
308 return PID::hasStrange(pid());
309 }
310
312 bool isVisible() const;
313
315 bool isParton() const {
316 return PID::isParton(pid());
317 }
318
320
321
324
326 virtual void setConstituents(const Particles& cs, bool setmom = false);
327
329 virtual void addConstituent(const Particle& c, bool addmom = false);
330
332 virtual void addConstituents(const Particles& cs, bool addmom = false);
333
334
336 bool isComposite() const {
337 return !constituents().empty();
338 }
339
340
345 const Particles& constituents() const {
346 return _constituents;
347 }
348
352 const Particles constituents(const ParticleSorter& sorter) const {
353 return sortBy(constituents(), sorter);
354 }
355
359 const Particles constituents(const Cut& c) const {
360 return select(constituents(), c);
361 }
362
366 const Particles constituents(const Cut& c, const ParticleSorter& sorter) const {
367 return sortBy(constituents(c), sorter);
368 }
369
373 const Particles constituents(const ParticleSelector& selector) const {
374 return select(constituents(), selector);
375 }
376
380 const Particles constituents(const ParticleSelector& selector, const ParticleSorter& sorter) const {
381 return sortBy(constituents(selector), sorter);
382 }
383
384
389
393 const Particles rawConstituents(const ParticleSorter& sorter) const {
394 return sortBy(rawConstituents(), sorter);
395 }
396
400 const Particles rawConstituents(const Cut& c) const {
401 return select(rawConstituents(), c);
402 }
403
407 const Particles rawConstituents(const Cut& c, const ParticleSorter& sorter) const {
408 return sortBy(rawConstituents(c), sorter);
409 }
410
414 const Particles rawConstituents(const ParticleSelector& selector) const {
415 return select(rawConstituents(), selector);
416 }
417
421 const Particles rawConstituents(const ParticleSelector& selector, const ParticleSorter& sorter) const {
422 return sortBy(rawConstituents(selector), sorter);
423 }
424
426
427
430
436 bool isPhysical(bool include_beams = false) const;
437
442 bool hasPhysicalAncestor(const Cut& c = Cuts::OPEN) const;
443
449 Particles parents(const Cut& c = Cuts::OPEN) const;
450
456 Particles parents(const ParticleSelector& f) const {
457 return select(parents(), f);
458 }
459
465 bool hasParentWith(const ParticleSelector& f) const {
466 return !parents(f).empty();
467 }
468
473 bool hasParentWith(const Cut& c) const;
474
480 bool hasParentWithout(const ParticleSelector& f) const {
481 return hasParentWith([&](const Particle& p) { return !f(p); });
482 }
483
488 bool hasParentWithout(const Cut& c) const;
489
490
497 Particles ancestors(const Cut& c = Cuts::OPEN, bool only_physical = true) const;
498
505 Particles ancestors(const ParticleSelector& f, bool only_physical = true) const {
506 return select(ancestors(Cuts::OPEN, only_physical), f);
507 }
508
514 bool hasAncestorWith(const ParticleSelector& f, bool only_physical = true) const {
515 return !ancestors(f, only_physical).empty();
516 }
517
522 bool hasAncestorWith(const Cut& c, bool only_physical = true) const;
523
529 bool hasAncestorWithout(const ParticleSelector& f, bool only_physical = true) const {
530 return hasAncestorWith([&](const Particle& p) { return !f(p); }, only_physical);
531 }
532
537 bool hasAncestorWithout(const Cut& c, bool only_physical = true) const;
538
544 bool fromBottom() const;
545
554 bool fromCharm() const;
555
556 // /// @brief Determine whether the particle is from a s-hadron decay
557 // ///
558 // /// @note If a hadron contains b or c quarks as well as strange it is
559 // /// considered a b or c hadron, but NOT a strange hadron.
560 // ///
561 // /// @note This question is valid in MC, but may not be perfectly answerable
562 // /// experimentally -- use this function with care when replicating
563 // /// experimental analyses!
564 // bool fromStrange() const;
565
571 bool fromHadron() const;
572
578 bool fromTau(bool prompt_taus_only = false) const;
579
585 bool fromPromptTau() const {
586 return fromTau(true);
587 }
588
594 bool fromHadronicTau(bool prompt_taus_only = false) const;
595
606 bool isDirect(bool allow_from_direct_tau = false, bool allow_from_direct_mu = false) const;
607
609 bool isPrompt(bool allow_from_prompt_tau = false, bool allow_from_prompt_mu = false) const {
610 return isDirect(allow_from_prompt_tau, allow_from_prompt_mu);
611 }
612
614
615
618
620 bool isStable() const;
621
623
624
626 Particles children(const Cut& c = Cuts::OPEN) const;
627
629 Particles children(const ParticleSelector& f) const {
630 return select(children(), f);
631 }
632
638 bool hasChildWith(const ParticleSelector& f) const {
639 return !children(f).empty();
640 }
641
646 bool hasChildWith(const Cut& c) const;
647
653 bool hasChildWithout(const ParticleSelector& f) const {
654 return hasChildWith([&](const Particle& p) { return !f(p); });
655 }
656
661 bool hasChildWithout(const Cut& c) const;
662
663
665 Particles allDescendants(const Cut& c = Cuts::OPEN, bool remove_duplicates = true) const;
666
668 Particles allDescendants(const ParticleSelector& f, bool remove_duplicates = true) const {
669 return select(allDescendants(Cuts::OPEN, remove_duplicates), f);
670 }
671
677 bool hasDescendantWith(const ParticleSelector& f, bool remove_duplicates = true) const {
678 return !allDescendants(f, remove_duplicates).empty();
679 }
680
685 bool hasDescendantWith(const Cut& c, bool remove_duplicates = true) const;
686
692 bool hasDescendantWithout(const ParticleSelector& f, bool remove_duplicates = true) const {
693 return hasDescendantWith([&](const Particle& p) { return !f(p); }, remove_duplicates);
694 }
695
700 bool hasDescendantWithout(const Cut& c, bool remove_duplicates = true) const;
701
702
707 Particles stableDescendants(const Cut& c = Cuts::OPEN) const;
708
710 Particles stableDescendants(const ParticleSelector& f) const {
711 return select(stableDescendants(), f);
712 }
713
719 bool hasStableDescendantWith(const ParticleSelector& f) const {
720 return !stableDescendants(f).empty();
721 }
722
727 bool hasStableDescendantWith(const Cut& c) const;
728
734 bool hasStableDescendantWithout(const ParticleSelector& f) const {
735 return hasStableDescendantWith([&](const Particle& p) { return !f(p); });
736 }
737
742 bool hasStableDescendantWithout(const Cut& c) const;
743
744
748 double flightLength() const;
749
751
752
755
757 inline bool isFirstWith(const ParticleSelector& f) const {
758 if (!f(*this)) return false; //< This doesn't even meet f, let alone being the last to do so
759 if (any(parents(), f)) return false; //< If a direct parent has this property, this isn't the first
760 return true;
761 }
762
764 inline bool isFirstWithout(const ParticleSelector& f) const {
765 return isFirstWith([&](const Particle& p) { return !f(p); });
766 }
767
769 inline bool isLastWith(const ParticleSelector& f) const {
770 if (!f(*this)) return false; //< This doesn't even meet f, let alone being the last to do so
771 if (any(children(), f)) return false; //< If a child has this property, this isn't the last
772 return true;
773 }
774
776 inline bool isLastWithout(const ParticleSelector& f) const {
777 return isLastWith([&](const Particle& p) { return !f(p); });
778 }
779
781
782
785
789 bool isSame(const Particle& other) const {
790 if (pid() != other.pid()) return false;
791 if (!isZero((mom() - other.mom()).mod())) return false;
792 if (!isZero((origin() - other.origin()).mod())) return false;
793 return true;
794 }
795
797
798
799 protected:
800
802 ConstGenParticlePtr _original;
803
805 Particles _constituents;
806
808 PdgId _id;
809
811 FourMomentum _momentum;
812
814 FourVector _origin;
815
818 mutable std::vector<std::pair<bool, bool>> _isDirect;
819 };
820
821
824
826 std::ostream& operator<<(std::ostream& os, const Particle& p);
827
829 std::ostream& operator<<(std::ostream& os, const ParticlePair& pp);
830
832
833
834}
835
836
837#include "Rivet/Tools/ParticleUtils.hh"
838
839#endif
Specialized version of the FourVector with momentum/energy functionality.
Definition Vector4.hh:363
Specialisation of VectorN to a general (non-momentum) Lorentz 4-vector.
Definition Vector4.hh:32
Vector3 vector3() const
Get the spatial part of the 4-vector as a 3-vector.
Definition Vector4.hh:219
Object implementing Lorentz transform calculations and boosts.
Definition LorentzTrans.hh:21
double py() const
y component of momentum.
Definition ParticleBase.hh:190
const FourMomentum & mom() const
Get the equivalent momentum four-vector (const) (alias).
Definition ParticleBase.hh:39
double p() const
Get the 3-momentum magnitude directly.
Definition ParticleBase.hh:168
ParticleBase()
Default constructor.
Definition ParticleBase.hh:17
ThreeMomentum p3() const
Get the 3-momentum directly.
Definition ParticleBase.hh:164
double pz() const
z component of momentum.
Definition ParticleBase.hh:194
double px() const
x component of momentum.
Definition ParticleBase.hh:186
double E() const
Get the energy directly.
Definition ParticleBase.hh:59
Particle representation, either from a HepMC::GenEvent or reconstructed.
Definition Particle.hh:50
Particle & setMomentum(double E, double px, double py, double pz)
Set the momentum via components.
Definition Particle.hh:112
bool isHadron() const
Is this a hadron?
Definition Particle.hh:267
Particles allDescendants(const ParticleSelector &f, bool remove_duplicates=true) const
Get a list of all the descendants from the current particle (with selector function).
Definition Particle.hh:668
const Particles constituents(const ParticleSelector &selector, const ParticleSorter &sorter) const
Direct constituents of this particle, filtered and sorted by functors.
Definition Particle.hh:380
const Particles rawConstituents(const ParticleSorter &sorter) const
Fundamental constituents of this particle, sorted by a functor.
Definition Particle.hh:393
bool hasStableDescendantWithout(const ParticleSelector &f) const
Definition Particle.hh:734
virtual fastjet::PseudoJet pseudojet() const
Converter to FastJet3 PseudoJet.
Definition Particle.hh:187
bool hasChildWith(const ParticleSelector &f) const
Definition Particle.hh:638
Vector3 closestApproach() const
Find the point of closest approach (and hence the impact parameter) to the primary vertex.
Definition Particle.hh:156
bool isDirect(bool allow_from_direct_tau=false, bool allow_from_direct_mu=false) const
Shorthand definition of 'promptness' based on set definition flags.
bool hasDescendantWith(const Cut &c, bool remove_duplicates=true) const
virtual void addConstituent(const Particle &c, bool addmom=false)
Add a single direct constituent to this particle.
bool isPrompt(bool allow_from_prompt_tau=false, bool allow_from_prompt_mu=false) const
Alias for isDirect.
Definition Particle.hh:609
bool hasAncestorWith(const ParticleSelector &f, bool only_physical=true) const
Definition Particle.hh:514
Particles rawConstituents() const
Fundamental constituents of this particle.
bool hasAncestorWith(const Cut &c, bool only_physical=true) const
const Particles constituents(const Cut &c, const ParticleSorter &sorter) const
Direct constituents of this particle, sorted by a functor.
Definition Particle.hh:366
virtual void addConstituents(const Particles &cs, bool addmom=false)
Add direct constituents to this particle.
bool fromBottom() const
Determine whether the particle is from a b-hadron decay.
bool hasParentWithout(const Cut &c) const
bool isNeutrino() const
Is this a neutrino?
Definition Particle.hh:292
bool isSame(const Particle &other) const
Definition Particle.hh:789
const Particles rawConstituents(const ParticleSelector &selector, const ParticleSorter &sorter) const
Fundamental constituents of this particle, filtered and sorted by functors.
Definition Particle.hh:421
Particle & setOrigin(const FourVector &position)
Set the origin position.
Definition Particle.hh:132
Particle()
Definition Particle.hh:58
const Particles & constituents() const
Direct constituents of this particle, returned by reference.
Definition Particle.hh:345
bool hasChildWithout(const Cut &c) const
bool hasParentWith(const ParticleSelector &f) const
Definition Particle.hh:465
bool isLepton() const
Is this a lepton?
Definition Particle.hh:282
bool isChargedLepton() const
Is this a charged lepton?
Definition Particle.hh:287
bool hasParentWith(const Cut &c) const
bool hasBottom() const
Does this (hadron) contain a b quark?
Definition Particle.hh:297
bool hasChildWithout(const ParticleSelector &f) const
Definition Particle.hh:653
bool isCharged() const
Is this Particle charged?
Definition Particle.hh:256
bool isMeson() const
Is this a meson?
Definition Particle.hh:272
bool isPhysical(bool include_beams=false) const
Is this particle recorded as physically meaningful in the event record?
bool isLastWith(const ParticleSelector &f) const
Determine whether a particle is the last in a decay chain to meet the function requirement.
Definition Particle.hh:769
Particles ancestors(const Cut &c=Cuts::OPEN, bool only_physical=true) const
const Particles constituents(const ParticleSelector &selector) const
Direct constituents of this particle, filtered by a selection functor.
Definition Particle.hh:373
double abscharge() const
The absolute charge of this Particle.
Definition Particle.hh:241
bool isFirstWith(const ParticleSelector &f) const
Determine whether a particle is the first in a decay chain to meet the function requirement.
Definition Particle.hh:757
bool hasDescendantWith(const ParticleSelector &f, bool remove_duplicates=true) const
Definition Particle.hh:677
bool hasStableDescendantWith(const Cut &c) const
PdgId pid() const
This Particle's PDG ID code.
Definition Particle.hh:221
bool isLastWithout(const ParticleSelector &f) const
Determine whether a particle is the last in a decay chain not to meet the function requirement.
Definition Particle.hh:776
Particles ancestors(const ParticleSelector &f, bool only_physical=true) const
Definition Particle.hh:505
Particle(const RivetHepMC::GenParticle &gp)
Constructor from a HepMC GenParticle reference.
Definition Particle.hh:91
const Particles constituents(const Cut &c) const
Direct constituents of this particle, filtered by a Cut.
Definition Particle.hh:359
double flightLength() const
bool fromHadron() const
Determine whether the particle is from a hadron decay.
bool hasAncestorWithout(const Cut &c, bool only_physical=true) const
bool hasChildWith(const Cut &c) const
const Particles rawConstituents(const ParticleSelector &selector) const
Fundamental constituents of this particle, filtered by a selection functor.
Definition Particle.hh:414
double charge() const
The charge of this Particle.
Definition Particle.hh:236
bool hasPhysicalAncestor(const Cut &c=Cuts::OPEN) const
Does this (outgoing) particle have physically meaningful (outgoing) parents in the event record?
Particles allDescendants(const Cut &c=Cuts::OPEN, bool remove_duplicates=true) const
Get a list of all the descendants from the current particle (with optional selection Cut).
bool fromTau(bool prompt_taus_only=false) const
Determine whether the particle is from a tau decay.
Particle & setGenParticle(ConstGenParticlePtr gp)
Set a const pointer to the original GenParticle.
Definition Particle.hh:198
bool hasParentWithout(const ParticleSelector &f) const
Definition Particle.hh:480
Particle & transformBy(const LorentzTransform &lt)
Apply an active Lorentz transform to this particle.
Particles parents(const Cut &c=Cuts::OPEN) const
int abscharge3() const
Three times the absolute charge of this Particle (i.e. integer multiple of smallest quark charge).
Definition Particle.hh:251
Particles stableDescendants(const ParticleSelector &f) const
Get a list of all the stable descendants from the current particle (with selector function).
Definition Particle.hh:710
bool isComposite() const
Determine if this Particle is a composite of other Rivet Particles.
Definition Particle.hh:336
Particle & setOrigin(double t, double x, double y, double z)
Set the origin position via components.
Definition Particle.hh:137
bool fromPromptTau() const
Determine whether the particle is from a prompt tau decay.
Definition Particle.hh:585
bool hasCharm() const
Does this (hadron) contain a c quark?
Definition Particle.hh:302
bool fromHadronicTau(bool prompt_taus_only=false) const
Determine whether the particle is from a tau which decayed hadronically.
bool isFirstWithout(const ParticleSelector &f) const
Determine whether a particle is the first in a decay chain not to meet the function requirement.
Definition Particle.hh:764
bool isStable() const
Whether this particle is stable according to the generator.
const FourMomentum & momentum() const
The momentum.
Definition Particle.hh:101
Particle(ConstGenParticlePtr gp)
Constructor from a HepMC GenParticle pointer.
Definition Particle.hh:78
const Particles rawConstituents(const Cut &c, const ParticleSorter &sorter) const
Fundamental constituents of this particle, sorted by a functor.
Definition Particle.hh:407
bool hasDescendantWithout(const Cut &c, bool remove_duplicates=true) const
Particles children(const ParticleSelector &f) const
Get a list of the direct descendants from the current particle (with selector function).
Definition Particle.hh:629
Particle(PdgId pid, const FourMomentum &mom, ConstGenParticlePtr gp, const FourVector &pos=FourVector())
Constructor from PID, momentum, and a GenParticle for relational links.
Definition Particle.hh:74
PdgId abspid() const
Absolute value of the PDG ID code.
Definition Particle.hh:225
const Particles rawConstituents(const Cut &c) const
Fundamental constituents of this particle, filtered by a Cut.
Definition Particle.hh:400
Particles parents(const ParticleSelector &f) const
Definition Particle.hh:456
Particles children(const Cut &c=Cuts::OPEN) const
Get a list of the direct descendants from the current particle (with optional selection Cut).
bool isVisible() const
Is this particle potentially visible in a detector?
bool hasDescendantWithout(const ParticleSelector &f, bool remove_duplicates=true) const
Definition Particle.hh:692
const Particles constituents(const ParticleSorter &sorter) const
Direct constituents of this particle, sorted by a functor.
Definition Particle.hh:352
bool fromCharm() const
Determine whether the particle is from a c-hadron decay.
bool hasStableDescendantWithout(const Cut &c) const
bool isBaryon() const
Is this a baryon?
Definition Particle.hh:277
Particles stableDescendants(const Cut &c=Cuts::OPEN) const
ConstGenParticlePtr genParticle() const
Get a const pointer to the original GenParticle.
Definition Particle.hh:204
bool hasStableDescendantWith(const ParticleSelector &f) const
Definition Particle.hh:719
bool isParton() const
Is this a parton? (Hopefully not very often... fiducial FTW).
Definition Particle.hh:315
int charge3() const
Three times the charge of this Particle (i.e. integer multiple of smallest quark charge).
Definition Particle.hh:246
bool hasAncestorWithout(const ParticleSelector &f, bool only_physical=true) const
Definition Particle.hh:529
Particle(PdgId pid, const FourMomentum &mom, const FourVector &pos=FourVector(), ConstGenParticlePtr gp=nullptr)
Constructor from PID and momentum.
Definition Particle.hh:62
Particle & setMomentum(const FourMomentum &momentum)
Set the momentum.
Definition Particle.hh:106
virtual void setConstituents(const Particles &cs, bool setmom=false)
Set direct constituents of this particle.
const FourVector & origin() const
Definition Particle.hh:128
Specialised vector of Particle objects.
Definition Particle.hh:21
Three-dimensional specialisation of Vector.
Definition Vector3.hh:39
double perp() const
Synonym for polarRadius.
Definition Vector3.hh:191
double perp2() const
Synonym for polarRadius2.
Definition Vector3.hh:178
Vector3 unit() const
Synonym for unitVec.
Definition Vector3.hh:154
double dot(const Vector3 &v) const
Dot-product with another vector.
Definition Vector3.hh:124
Vector3 perpVec() const
Synonym for polarVec.
Definition Vector3.hh:165
bool any(const CONTAINER &c)
Return true if x is true for any x in container c, otherwise false.
Definition Utils.hh:364
Jets select(const Jets &jets, const Cut &c)
Filter a jet collection in-place to the subset that passes the supplied Cut.
Definition JetUtils.hh:183
int abscharge3(int pid)
Return the absolute value of 3 times the EM charge.
Definition ParticleIdUtils.hh:1025
double charge(int pid)
Return the EM charge (as floating point).
Definition ParticleIdUtils.hh:1030
double abscharge(int pid)
Return the EM charge (as floating point).
Definition ParticleIdUtils.hh:1035
int charge3(int pid)
Three times the EM charge (as integer).
Definition ParticleIdUtils.hh:936
bool isParton(int pid)
Determine if the PID is that of a parton (quark or gluon).
Definition ParticleIdUtils.hh:198
bool isNeutrino(int pid)
Determine if the PID is that of a neutrino.
Definition ParticleIdUtils.hh:235
bool isChargedLepton(int pid)
Determine if the PID is that of a charged lepton.
Definition ParticleIdUtils.hh:224
bool isLepton(int pid)
Definition ParticleIdUtils.hh:433
bool hasBottom(int pid)
Does this particle contain a bottom quark?
Definition ParticleIdUtils.hh:689
bool hasStrange(int pid)
Does this particle contain a strange quark?
Definition ParticleIdUtils.hh:681
bool hasCharm(int pid)
Does this particle contain a charm quark?
Definition ParticleIdUtils.hh:685
bool isBaryon(int pid)
Check to see if this is a valid baryon.
Definition ParticleIdUtils.hh:337
bool isMeson(int pid)
Check to see if this is a valid meson.
Definition ParticleIdUtils.hh:314
bool isHadron(int pid)
Definition ParticleIdUtils.hh:415
MOMS sortBy(const MOMS &pbs, const CMP &cmp)
Sort a container of momenta by cmp and return by value for const inputs.
Definition Vector4.hh:1428
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:819
Definition RivetHepMC.hh:52
Definition LHCbCommon.hh:9
constexpr std::enable_if_t< std::is_arithmetic_v< NUM >, int > sign(NUM val)
Find the sign of a number.
Definition MathUtils.hh:295
std::ostream & operator<<(std::ostream &os, const AnalysisInfo &ai)
Stream an AnalysisInfo as a text description.
Definition AnalysisInfo.hh:463
std::enable_if_t< std::is_floating_point_v< NUM >, bool > isZero(NUM val, double tolerance=1e-8)
Compare a number to zero.
Definition MathUtils.hh:23
std::pair< Particle, Particle > ParticlePair
Typedef for a pair of Particle objects.
Definition Particle.hh:43
std::vector< PseudoJet > PseudoJets
Definition RivetFastJet.hh:30
STL namespace.