hej is hosted by Hepforge, IPPP Durham
HEJ 2.1.4
High energy resummation for hadron colliders
Loading...
Searching...
No Matches
Particle.hh
Go to the documentation of this file.
1
9#pragma once
10
11#include <utility>
12#include <vector>
13
14#include "fastjet/PseudoJet.hh"
15
16#include "HEJ/PDG_codes.hh"
17#include "HEJ/optional.hh"
18
19namespace HEJ {
20
21 using Colour = std::pair<int,int>;
22
24 struct Particle {
28 fastjet::PseudoJet p;
31
33 double rapidity() const{
34 return p.rapidity();
35 }
37 double perp() const{
38 return p.perp();
39 }
41 double pt() const{
42 return perp();
43 }
45 double px() const{
46 return p.px();
47 }
49 double py() const{
50 return p.py();
51 }
53 double pz() const{
54 return p.pz();
55 }
57 double E() const{
58 return p.E();
59 }
61 double m() const{
62 return p.m();
63 }
64 };
65
67
74 template<class FourVector>
75 bool operator()(FourVector const & p1, FourVector const & p2){
76 return p1.rapidity() < p2.rapidity();
77 }
78 };
79
81
87 struct pz_less{
88 template<class FourVector>
89 bool operator()(FourVector const & p1, FourVector const & p2){
90 return p1.pz() < p2.pz();
91 }
92 };
93
95 inline
96 std::vector<fastjet::PseudoJet> to_PseudoJet(
97 std::vector<Particle> const & v
98 ){
99 std::vector<fastjet::PseudoJet> result;
100 result.reserve(v.size());
101 for(auto && sp: v) result.emplace_back(sp.p);
102 return result;
103 }
104
106 inline
107 constexpr bool is_parton(Particle const & p){
108 return is_parton(p.type);
109 }
110
112 inline
113 constexpr bool is_quark(Particle const & p){
114 return is_quark(p.type);
115 }
116
118 inline
119 constexpr bool is_antiquark(Particle const & p){
120 return is_antiquark(p.type);
121 }
122
124 inline
125 constexpr bool is_anyquark(Particle const & p){
126 return is_anyquark(p.type);
127 }
128
134 inline
135 constexpr bool is_lepton(Particle const & p){
136 return is_lepton(p.type);
137 }
138
144 inline
145 constexpr bool is_antilepton(Particle const & p){
146 return is_antilepton(p.type);
147 }
148
154 inline
155 constexpr bool is_anylepton(Particle const & p){
156 return is_anylepton(p.type);
157 }
158
164 inline
165 constexpr bool is_neutrino(Particle const & p){
166 return is_neutrino(p.type);
167 }
168
174 inline
175 constexpr bool is_antineutrino(Particle const & p){
176 return is_antineutrino(p.type);
177 }
178
184 inline
185 constexpr bool is_anyneutrino(Particle const & p){
186 return is_anyneutrino(p.type);
187 }
188
190 inline
191 constexpr bool is_AWZ_boson(Particle const & particle){
192 return is_AWZ_boson(particle.type);
193 }
194
196 inline
197 constexpr bool is_AWZH_boson(Particle const & particle){
198 return is_AWZH_boson(particle.type);
199 }
200
202 inline
203 std::vector<Particle> filter_partons(
204 std::vector<Particle> const & v
205 ){
206 std::vector<Particle> result;
207 result.reserve(v.size());
208 std::copy_if(
209 begin(v), end(v), std::back_inserter(result),
210 [](Particle const & p){ return is_parton(p); }
211 );
212 return result;
213 }
214
216 inline
217 std::vector<Particle> filter_AWZH_bosons(
218 std::vector<Particle> const & v
219 ){
220 std::vector<Particle> result;
221 std::copy_if(
222 begin(v), end(v), std::back_inserter(result),
223 [](Particle const & p){ return is_AWZH_boson(p); }
224 );
225 return result;
226 }
227} // namespace HEJ
Contains the Particle IDs of all relevant SM particles.
ParticleID
The possible particle identities. We use PDG IDs as standard.
Definition: PDG_codes.hh:23
@ unspecified
Unspecified type, should never be used!, debug only.
Definition: PDG_codes.hh:25
Main HEJ 2 Namespace.
Definition: mainpage.dox:1
constexpr bool is_antineutrino(Particle const &p)
Function to determine if particle is an antineutrino.
Definition: Particle.hh:175
constexpr bool is_parton(Particle const &p)
Check if a particle is a parton, i.e. quark, antiquark, or gluon.
Definition: Particle.hh:107
constexpr bool is_antiquark(Particle const &p)
Check if a particle is an anti-quark.
Definition: Particle.hh:119
std::pair< int, int > Colour
Definition: Particle.hh:21
std::vector< Particle > filter_partons(std::vector< Particle > const &v)
Extract all partons from a vector of particles.
Definition: Particle.hh:203
constexpr bool is_lepton(Particle const &p)
Function to determine if particle is a lepton.
Definition: Particle.hh:135
constexpr bool is_quark(Particle const &p)
Check if a particle is a quark.
Definition: Particle.hh:113
std::vector< Particle > filter_AWZH_bosons(std::vector< Particle > const &v)
Extract all AWZH bosons from a vector of particles.
Definition: Particle.hh:217
constexpr bool is_anylepton(Particle const &p)
Function to determine if particle is an (anti-)lepton.
Definition: Particle.hh:155
fastjet::PseudoJet to_PseudoJet(CLHEP::HepLorentzVector const &mom)
Definition: LorentzVector.hh:88
constexpr bool is_anyneutrino(Particle const &p)
Function to determine if particle is an (anti-)neutrino.
Definition: Particle.hh:185
constexpr bool is_AWZH_boson(Particle const &particle)
Check if a particle is a photon, W, Z, or Higgs boson.
Definition: Particle.hh:197
boost::optional< T > optional
Definition: optional.hh:23
constexpr bool is_antilepton(Particle const &p)
Function to determine if particle is an antilepton.
Definition: Particle.hh:145
constexpr bool is_neutrino(Particle const &p)
Function to determine if particle is a neutrino.
Definition: Particle.hh:165
constexpr bool is_anyquark(Particle const &p)
Check if a particle is a quark or anit-quark.
Definition: Particle.hh:125
constexpr bool is_AWZ_boson(Particle const &particle)
Check if a particle is a photon, W or Z boson.
Definition: Particle.hh:191
Defines the optional type.
Class representing a particle.
Definition: Particle.hh:24
double rapidity() const
get rapidity
Definition: Particle.hh:33
double py() const
get momentum in y direction
Definition: Particle.hh:49
fastjet::PseudoJet p
particle momentum
Definition: Particle.hh:28
optional< Colour > colour
(optional) colour & anti-colour
Definition: Particle.hh:30
double px() const
get momentum in x direction
Definition: Particle.hh:45
double E() const
get energy
Definition: Particle.hh:57
ParticleID type
particle type
Definition: Particle.hh:26
double pz() const
get momentum in z direction
Definition: Particle.hh:53
double m() const
get mass
Definition: Particle.hh:61
double perp() const
get transverse momentum
Definition: Particle.hh:37
double pt() const
get transverse momentum
Definition: Particle.hh:41
Functor to compare momenta in z direction.
Definition: Particle.hh:87
bool operator()(FourVector const &p1, FourVector const &p2)
Definition: Particle.hh:89
Functor to compare rapidities.
Definition: Particle.hh:73
bool operator()(FourVector const &p1, FourVector const &p2)
Definition: Particle.hh:75