rivet is hosted by Hepforge, IPPP Durham
Rivet  2.7.0
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 
12 namespace Rivet {
13 
14 
45  class JetShape : public Projection {
46  public:
47 
49 
50 
52  JetShape(const JetAlg& jetalg,
53  double rmin, double rmax, size_t nbins,
54  double ptmin=0, double ptmax=MAXDOUBLE,
55  double absrapmin=-MAXDOUBLE, double absrapmax=-MAXDOUBLE,
56  RapScheme rapscheme=RAPIDITY);
57 
59  JetShape(const JetAlg& jetalg, vector<double> binedges,
60  double ptmin=0, double ptmax=MAXDOUBLE,
61  double absrapmin=-MAXDOUBLE, double absrapmax=-MAXDOUBLE,
62  RapScheme rapscheme=RAPIDITY);
63 
66 
68 
69 
71  void clear();
72 
73 
75  void calc(const Jets& jets);
76 
77 
78  public:
79 
80 
82  size_t numBins() const {
83  return _binedges.size() - 1;
84  }
85 
87  size_t numJets() const {
88  return _diffjetshapes.size();
89  }
90 
92  double rMin() const {
93  return _binedges.front();
94  }
95 
97  double rMax() const {
98  return _binedges.back();
99  }
100 
102  double ptMin() const {
103  return _ptcuts.first;
104  }
105 
107  double ptMax() const {
108  return _ptcuts.second;
109  }
110 
112  double rBinMin(size_t rbin) const {
113  assert(inRange(rbin, 0u, numBins()));
114  return _binedges[rbin];
115  }
116 
118  double rBinMax(size_t rbin) const {
119  assert(inRange(rbin, 0u, numBins()));
120  return _binedges[rbin+1];
121  }
122 
124  double rBinMid(size_t rbin) const {
125  assert(inRange(rbin, 0u, numBins()));
126  //cout << _binedges << endl;
127  return (_binedges[rbin] + _binedges[rbin+1])/2.0;
128  }
129 
131  double diffJetShape(size_t ijet, size_t rbin) const {
132  assert(inRange(ijet, 0u, numJets()));
133  assert(inRange(rbin, 0u, numBins()));
134  return _diffjetshapes[ijet][rbin];
135  }
136 
138  double intJetShape(size_t ijet, size_t rbin) const {
139  assert(inRange(ijet, 0u, numJets()));
140  assert(inRange(rbin, 0u, numBins()));
141  double rtn = 0;
142  for (size_t i = 0; i <= rbin; ++i) {
143  rtn += _diffjetshapes[ijet][i];
144  }
145  return rtn;
146  }
147 
149 
150  // /// Return value of \f$ \Psi \f$ (integrated jet shape) at given radius for a \f$ p_T \f$ bin.
151  // /// @todo Remove this external indexing thing
152  // double psi(size_t pTbin) const {
153  // return _PsiSlot[pTbin];
154  // }
155 
156 
157  protected:
158 
160  void project(const Event& e);
161 
163  int compare(const Projection& p) const;
164 
165 
166  private:
167 
169 
170 
172  vector<double> _binedges;
173 
175  pair<double, double> _ptcuts;
176 
178  pair<double, double> _rapcuts;
179 
181  RapScheme _rapscheme;
182 
184 
185 
187 
188 
190  vector< vector<double> > _diffjetshapes;
191 
193 
194  };
195 
196 
197 }
198 
199 #endif
double intJetShape(size_t ijet, size_t rbin) const
Return value of integrated jet shape profile histo bin.
Definition: JetShape.hh:138
Definition: ALICE_2010_I880049.cc:13
double ptMax() const
value.
Definition: JetShape.hh:107
double rBinMin(size_t rbin) const
Central value for bin rbin.
Definition: JetShape.hh:112
double rMin() const
value.
Definition: JetShape.hh:92
double diffJetShape(size_t ijet, size_t rbin) const
Return value of differential jet shape profile histo bin.
Definition: JetShape.hh:131
void project(const Event &e)
Apply the projection to the event.
Definition: JetShape.cc:105
int compare(const Projection &p) const
Compare projections.
Definition: JetShape.cc:39
JetShape(const JetAlg &jetalg, double rmin, double rmax, size_t nbins, double ptmin=0, double ptmax=MAXDOUBLE, double absrapmin=-MAXDOUBLE, double absrapmax=-MAXDOUBLE, RapScheme rapscheme=RAPIDITY)
Constructor from histo range and number of bins.
Definition: JetShape.cc:9
void calc(const Jets &jets)
Do the calculation directly on a supplied collection of Jet objects.
Definition: JetShape.cc:62
size_t numBins() const
Number of equidistant radius bins.
Definition: JetShape.hh:82
double rMax() const
value.
Definition: JetShape.hh:97
Definition: Event.hh:22
double rBinMax(size_t rbin) const
Central value for bin rbin.
Definition: JetShape.hh:118
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:103
static const double MAXDOUBLE
Definition: MathHeader.hh:12
RapScheme
Enum for rapidity variable to be used in calculating , applying rapidity cuts, etc.
Definition: MathHeader.hh:28
void clear()
Reset projection between events.
Definition: JetShape.cc:57
DEFAULT_RIVET_PROJ_CLONE(JetShape)
Clone on the heap.
Base class for all Rivet projections.
Definition: Projection.hh:29
double rBinMid(size_t rbin) const
Central value for bin rbin.
Definition: JetShape.hh:124
double ptMin() const
value.
Definition: JetShape.hh:102
Abstract base class for projections which can return a set of Jets.
Definition: JetAlg.hh:15
size_t numJets() const
Number of jets which passed cuts.
Definition: JetShape.hh:87
Definition: JetShape.hh:45