HackAnalysis  2
Jet.h
1 // -*- C++ -*-
2 //
3 // This file is part of HEPUtils -- https://bitbucket.org/andybuckley/heputils
4 // Copyright (C) 2013-2017 Andy Buckley <andy.buckley@cern.ch>
5 //
6 // Embedding of HEPUtils code in other projects is permitted provided this
7 // notice is retained and the HEPUtils namespace and include path are changed.
8 //
9 
10 // Duly: HEPUtils namespace changed to HEP.
11 #pragma once
12 
13 #include "MathUtils.h"
14 #include "Vectors.h"
15 
16 namespace HEP {
17 
18 
21  class Jet {
22 
24 
25  protected: // to allow inheritance, instead of private
29  bool _isB, _isC;
31 
32 
33  public:
34 
36 
37 
39  Jet(const P4& mom, bool isB=false, bool isC=false)
40  : _p4(mom), _isB(isB), _isC(isC) { }
41 
43  Jet(double px, double py, double pz, double E, bool isB=false, bool isC=false)
44  : _p4(px, py, pz, E), _isB(isB), _isC(isC) { }
45 
47 
48 
50 
51 
52  operator const P4& () const { return mom(); }
53 
54  operator const P4* () const { return &mom(); }
55 
57 
58 
60 
61 
63  const P4& mom() const { return _p4; }
65  void set_mom(const P4& p4) { _p4 = p4; }
66 
67 
69  double mass() { return _p4.m(); }
71  void set_mass(double mass) { _p4.setM(mass); }
72 
73 
75  double eta() const { return mom().eta(); }
76 
78  double abseta() const { return mom().abseta(); }
79 
81  double rap() const { return mom().rap(); }
82 
84  double absrap() const { return mom().absrap(); }
85 
87  double phi() const { return mom().phi(); }
88 
90  double E() const { return mom().E(); }
91 
93  double pT2() const { return mom().pT2(); }
94 
96  double pT() const { return mom().pT(); }
97 
99 
100 
102 
103 
105  bool btag() const { return _isB; }
107  void set_btag(bool isb) { _isB = isb; }
108 
111  bool ctag() const { return /* !btag() && */ _isC; }
113  void set_ctag(bool isc) { _isC = isc; }
114 
116 
118 
119  };
120 
121 
123  inline bool _cmpPtDesc(const Jet* a, const Jet* b) {
124  return a->pT2() >= b->pT2();
125  }
126 
127 
128 }
Definition: Jet.h:21
double abseta() const
Get the abs pseudorapidity.
Definition: Jet.h:78
double eta() const
Get the pseudorapidity.
Definition: Jet.h:75
const P4 & mom() const
Get the 4 vector.
Definition: Jet.h:63
void set_ctag(bool isc)
Set CTag value.
Definition: Jet.h:113
double mass()
Get the mass (of the 4 vector)
Definition: Jet.h:69
double pT() const
Get the squared transverse momentum.
Definition: Jet.h:96
void set_btag(bool isb)
Set BTag value.
Definition: Jet.h:107
bool _isB
B and C tags.
Definition: Jet.h:29
bool ctag() const
Definition: Jet.h:111
void set_mom(const P4 &p4)
Set the 4 vector.
Definition: Jet.h:65
bool btag() const
Is this particle tagged as a b?
Definition: Jet.h:105
double phi() const
Get the azimuthal angle.
Definition: Jet.h:87
P4 _p4
Momentum vector.
Definition: Jet.h:27
Jet(const P4 &mom, bool isB=false, bool isC=false)
Constructor for a light jet without explicit constituents.
Definition: Jet.h:39
double absrap() const
Get the abs rapidity.
Definition: Jet.h:84
double pT2() const
Get the squared transverse momentum.
Definition: Jet.h:93
Jet(double px, double py, double pz, double E, bool isB=false, bool isC=false)
"Cartesian" constructor
Definition: Jet.h:43
void set_mass(double mass)
Set the mass (of the 4 vector)
Definition: Jet.h:71
double E() const
Get the energy.
Definition: Jet.h:90
double rap() const
Get the rapidity.
Definition: Jet.h:81
A 4-momentum class for vectors.
Definition: Vectors.h:45
double eta() const
Get the spatial vector pseudorapidity.
Definition: Vectors.h:465
double absrap() const
Get the 4-momentum absolute rapidity.
Definition: Vectors.h:471
double pT() const
Get the transverse momentum (same as rho)
Definition: Vectors.h:453
double phi() const
Get the spatial phi.
Definition: Vectors.h:461
double m() const
Get m.
Definition: Vectors.h:414
double pT2() const
Get the transverse momentum squared (same as rho2)
Definition: Vectors.h:451
double abseta() const
Get the spatial vector absolute pseudorapidity.
Definition: Vectors.h:467
P4 & setM(double mass)
Set the mass // Mark: preserve momentum, update energy.
Definition: Vectors.h:174
double rap() const
Get the 4-momentum rapidity.
Definition: Vectors.h:469
Modified by Mark Goodsell goodsell@lpthe.jussieu.fr
Definition: ATLAS_SUSY_2018_16.cc:27
bool _cmpPtDesc(const Jet *a, const Jet *b)
Function/functor for container<const Jet*> sorting (cf. std::less)
Definition: Jet.h:123