Rivet: /Users/chrisg/software/rivet/include/Rivet/Projections/JetShape.hh Source File

| Rivet 3.1.9

JetShape.hh
1// -*- C++ -*-
2#ifndef RIVET_JetShape_HH
3#define RIVET_JetShape_HH
4
5#include "Rivet/Config/RivetCommon.hh"
6#include "Rivet/Projection.hh"
7#include "Rivet/Projections/JetAlg.hh"
8#include "Rivet/Particle.hh"
9#include "Rivet/Event.hh"
10#include "Rivet/Tools/Utils.hh"
11
12namespace Rivet {
13
14
44 class JetShape : public Projection {
45 public:
46
49
51 JetShape(const JetAlg& jetalg,
52 double rmin, double rmax, size_t nbins,
53 double ptmin=0, double ptmax=DBL_MAX,
54 double absrapmin=-DBL_MAX, double absrapmax=-DBL_MAX,
55 RapScheme rapscheme=RAPIDITY);
56
58 JetShape(const JetAlg& jetalg, vector<double> binedges,
59 double ptmin=0, double ptmax=DBL_MAX,
60 double absrapmin=-DBL_MAX, double absrapmax=-DBL_MAX,
61 RapScheme rapscheme=RAPIDITY);
62
64 DEFAULT_RIVET_PROJ_CLONE(JetShape);
65
67
69 using Projection::operator =;
70
71
73 void clear();
74
75
77 void calc(const Jets& jets);
78
79
80 public:
81
82
84 size_t numBins() const {
85 return _binedges.size() - 1;
86 }
87
89 size_t numJets() const {
90 return _diffjetshapes.size();
91 }
92
94 double rMin() const {
95 return _binedges.front();
96 }
97
99 double rMax() const {
100 return _binedges.back();
101 }
102
104 double ptMin() const {
105 return _ptcuts.first;
106 }
107
109 double ptMax() const {
110 return _ptcuts.second;
111 }
112
114 double rBinMin(size_t rbin) const {
115 assert(inRange(rbin, 0u, numBins()));
116 return _binedges[rbin];
117 }
118
120 double rBinMax(size_t rbin) const {
121 assert(inRange(rbin, 0u, numBins()));
122 return _binedges[rbin+1];
123 }
124
126 double rBinMid(size_t rbin) const {
127 assert(inRange(rbin, 0u, numBins()));
128 //cout << _binedges << '\n';
129 return (_binedges[rbin] + _binedges[rbin+1])/2.0;
130 }
131
133 double diffJetShape(size_t ijet, size_t rbin) const {
134 assert(inRange(ijet, 0u, numJets()));
135 assert(inRange(rbin, 0u, numBins()));
136 return _diffjetshapes[ijet][rbin];
137 }
138
140 double intJetShape(size_t ijet, size_t rbin) const {
141 assert(inRange(ijet, 0u, numJets()));
142 assert(inRange(rbin, 0u, numBins()));
143 double rtn = 0;
144 for (size_t i = 0; i <= rbin; ++i) {
145 rtn += _diffjetshapes[ijet][i];
146 }
147 return rtn;
148 }
149
151
152 // /// Return value of \f$ \Psi \f$ (integrated jet shape) at given radius for a \f$ p_T \f$ bin.
153 // /// @todo Remove this external indexing thing
154 // double psi(size_t pTbin) const {
155 // return _PsiSlot[pTbin];
156 // }
157
158
159 protected:
160
162 void project(const Event& e);
163
165 CmpState compare(const Projection& p) const;
166
167
168 protected:
169
172
174 vector<double> _binedges;
175
177 pair<double, double> _ptcuts;
178
180 pair<double, double> _rapcuts;
181
183 RapScheme _rapscheme;
184
186
187
190
192 vector< vector<double> > _diffjetshapes;
193
195
196 };
197
198
199}
200
201#endif
Rivet::Event
Representation of a HepMC event, and enabler of Projection caching.
Definition Event.hh:22
Rivet::JetFinder
Abstract base class for projections which can return a set of Jets.
Definition JetFinder.hh:15
Rivet::JetShape
Calculate transverse jet profiles.
Definition JetShape.hh:44
Rivet::JetShape::rMax
double rMax() const
value.
Definition JetShape.hh:99
Rivet::JetShape::rMin
double rMin() const
value.
Definition JetShape.hh:94
Rivet::JetShape::ptMin
double ptMin() const
value.
Definition JetShape.hh:104
Rivet::JetShape::diffJetShape
double diffJetShape(size_t ijet, size_t rbin) const
Return value of differential jet shape profile histo bin.
Definition JetShape.hh:133
Rivet::JetShape::rBinMin
double rBinMin(size_t rbin) const
Central value for bin rbin.
Definition JetShape.hh:114
Rivet::JetShape::intJetShape
double intJetShape(size_t ijet, size_t rbin) const
Return value of integrated jet shape profile histo bin.
Definition JetShape.hh:140
Rivet::JetShape::DEFAULT_RIVET_PROJ_CLONE
DEFAULT_RIVET_PROJ_CLONE(JetShape)
Clone on the heap.
Rivet::JetShape::numJets
size_t numJets() const
Number of jets which passed cuts.
Definition JetShape.hh:89
Rivet::JetShape::compare
CmpState compare(const Projection &p) const
Compare projections.
Rivet::JetShape::project
void project(const Event &e)
Apply the projection to the event.
Rivet::JetShape::JetShape
JetShape(const JetAlg &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.
Rivet::JetShape::JetShape
JetShape(const JetAlg &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.
Rivet::JetShape::numBins
size_t numBins() const
Number of equidistant radius bins.
Definition JetShape.hh:84
Rivet::JetShape::clear
void clear()
Reset projection between events.
Rivet::JetShape::rBinMax
double rBinMax(size_t rbin) const
Central value for bin rbin.
Definition JetShape.hh:120
Rivet::JetShape::calc
void calc(const Jets &jets)
Do the calculation directly on a supplied collection of Jet objects.
Rivet::JetShape::rBinMid
double rBinMid(size_t rbin) const
Central value for bin rbin.
Definition JetShape.hh:126
Rivet::JetShape::ptMax
double ptMax() const
value.
Definition JetShape.hh:109
Rivet::Jets
Specialised vector of Jet objects.
Definition Jet.hh:23
Rivet::Projection
Base class for all Rivet projections.
Definition Projection.hh:29
Rivet::Kin::p
double p(const ParticleBase &p)
Unbound function access to p.
Definition ParticleBaseUtils.hh:684
Rivet
Definition MC_Cent_pPb.hh:10
Rivet::inRange
std::enable_if< std::is_arithmetic< N1 >::value &&std::is_arithmetic< N2 >::value &&std::is_arithmetic< N3 >::value, bool >::type 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:133
Rivet::RapScheme
RapScheme
Enum for rapidity variable to be used in calculating , applying rapidity cuts, etc.
Definition MathConstants.hh:46