Rivet API documentation

Rivet 4.1.3
JetShape.hh
1// -*- C++ -*-
2#ifndef RIVET_JetShape_HH
3#define RIVET_JetShape_HH
4
5#include "Rivet/Event.hh"
6#include "Rivet/Particle.hh"
7#include "Rivet/Projection.hh"
8#include "Rivet/Config/RivetCommon.hh"
9#include "Rivet/Projections/JetFinder.hh"
10#include "Rivet/Tools/Utils.hh"
11
12namespace Rivet {
13
14
44 class JetShape : public Projection {
45 public:
46
49
51 JetShape(const JetFinder& jetalg,
52 double rmin,
53 double rmax,
54 size_t nbins,
55 double ptmin = 0,
56 double ptmax = DBL_MAX,
57 double absrapmin = -DBL_MAX,
58 double absrapmax = -DBL_MAX,
59 RapScheme rapscheme = RAPIDITY);
60
62 JetShape(const JetFinder& jetalg,
63 vector<double> binedges,
64 double ptmin = 0,
65 double ptmax = DBL_MAX,
66 double absrapmin = -DBL_MAX,
67 double absrapmax = -DBL_MAX,
68 RapScheme rapscheme = RAPIDITY);
69
72
74
76 using Projection::operator=;
77
78
80 void clear();
81
82
84 void calc(const Jets& jets);
85
86
87 public:
88
89
91 size_t numBins() const {
92 return _binedges.size() - 1;
93 }
94
96 size_t numJets() const {
97 return _diffjetshapes.size();
98 }
99
101 double rMin() const {
102 return _binedges.front();
103 }
104
106 double rMax() const {
107 return _binedges.back();
108 }
109
111 double ptMin() const {
112 return _ptcuts.first;
113 }
114
116 double ptMax() const {
117 return _ptcuts.second;
118 }
119
121 double rBinMin(size_t rbin) const {
122 assert(inRange(rbin, 0u, numBins()));
123 return _binedges[rbin];
124 }
125
127 double rBinMax(size_t rbin) const {
128 assert(inRange(rbin, 0u, numBins()));
129 return _binedges[rbin + 1];
130 }
131
133 double rBinMid(size_t rbin) const {
134 assert(inRange(rbin, 0u, numBins()));
135 //cout << _binedges << '\n';
136 return (_binedges[rbin] + _binedges[rbin + 1]) / 2.0;
137 }
138
140 double diffJetShape(size_t ijet, size_t rbin) const {
141 assert(inRange(ijet, 0u, numJets()));
142 assert(inRange(rbin, 0u, numBins()));
143 return _diffjetshapes[ijet][rbin];
144 }
145
147 double intJetShape(size_t ijet, size_t rbin) const {
148 assert(inRange(ijet, 0u, numJets()));
149 assert(inRange(rbin, 0u, numBins()));
150 double rtn = 0;
151 for (size_t i = 0; i <= rbin; ++i) {
152 rtn += _diffjetshapes[ijet][i];
153 }
154 return rtn;
155 }
156
158
159 // /// Return value of \f$ \Psi \f$ (integrated jet shape) at given radius for a \f$ p_T \f$ bin.
160 // /// @todo Remove this external indexing thing
161 // double psi(size_t pTbin) const {
162 // return _PsiSlot[pTbin];
163 // }
164
165
166 protected:
167
169 void project(const Event& e);
170
172 CmpState compare(const Projection& p) const;
173
174
175 protected:
176
179
181 vector<double> _binedges;
182
184 pair<double, double> _ptcuts;
185
187 pair<double, double> _rapcuts;
188
190 RapScheme _rapscheme;
191
193
194
197
199 vector<vector<double>> _diffjetshapes;
200
202 };
203
204
205}
206
207#endif
Abstract base class for projections which can return a set of Jets.
Definition JetFinder.hh:42
double rMax() const
value.
Definition JetShape.hh:106
double rMin() const
value.
Definition JetShape.hh:101
double ptMin() const
value.
Definition JetShape.hh:111
JetShape(const JetFinder &jetalg, double rmin, double rmax, size_t nbins, double ptmin=0, double ptmax=DBL_MAX, double absrapmin=-DBL_MAX, double absrapmax=-DBL_MAX, RapScheme rapscheme=RAPIDITY)
Constructor from histo range and number of bins.
double diffJetShape(size_t ijet, size_t rbin) const
Return value of differential jet shape profile histo bin.
Definition JetShape.hh:140
double rBinMin(size_t rbin) const
Central value for bin rbin.
Definition JetShape.hh:121
double intJetShape(size_t ijet, size_t rbin) const
Return value of integrated jet shape profile histo bin.
Definition JetShape.hh:147
JetShape(const JetFinder &jetalg, vector< double > binedges, double ptmin=0, double ptmax=DBL_MAX, double absrapmin=-DBL_MAX, double absrapmax=-DBL_MAX, RapScheme rapscheme=RAPIDITY)
Constructor from vector of bin edges.
size_t numJets() const
Number of jets which passed cuts.
Definition JetShape.hh:96
CmpState compare(const Projection &p) const
Compare projections.
RIVET_DEFAULT_PROJ_CLONE(JetShape)
Clone on the heap.
void project(const Event &e)
Apply the projection to the event.
size_t numBins() const
Number of equidistant radius bins.
Definition JetShape.hh:91
void clear()
Reset projection between events.
double rBinMax(size_t rbin) const
Central value for bin rbin.
Definition JetShape.hh:127
void calc(const Jets &jets)
Do the calculation directly on a supplied collection of Jet objects.
double rBinMid(size_t rbin) const
Central value for bin rbin.
Definition JetShape.hh:133
double ptMax() const
value.
Definition JetShape.hh:116
Specialised vector of Jet objects.
Definition Jet.hh:21
Projection()
The default constructor.
friend class Event
Event is a friend.
Definition Projection.hh:33
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:819
Definition LHCbCommon.hh:9
RapScheme
Enum for rapidity variable to be used in calculating , applying rapidity cuts, etc.
Definition MathConstants.hh:46
std::enable_if_t< std::is_arithmetic_v< N1 > &&std::is_arithmetic_v< N2 > &&std::is_arithmetic_v< N3 >, bool > inRange(N1 value, N2 low, N3 high, RangeBoundary lowbound=CLOSED, RangeBoundary highbound=OPEN)
Determine if value is in the range low to high, for floating point numbers.
Definition MathUtils.hh:147