JetShape.hh
Go to the documentation of this file.00001
00002 #ifndef RIVET_JetShape_HH
00003 #define RIVET_JetShape_HH
00004
00005 #include "Rivet/Rivet.hh"
00006 #include "Rivet/Projection.hh"
00007 #include "Rivet/Projections/JetAlg.hh"
00008 #include "Rivet/Particle.hh"
00009 #include "Rivet/Event.hh"
00010 #include "Rivet/Tools/Utils.hh"
00011
00012 namespace Rivet {
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 class JetShape : public Projection {
00046 public:
00047
00048
00049
00050
00051
00052 JetShape(const JetAlg& jetalg,
00053 double rmin, double rmax, size_t nbins,
00054 double ptmin=0, double ptmax=MAXDOUBLE,
00055 double absrapmin=-MAXDOUBLE, double absrapmax=-MAXDOUBLE,
00056 RapScheme rapscheme=RAPIDITY);
00057
00058
00059 JetShape(const JetAlg& jetalg, vector<double> binedges,
00060 double ptmin=0, double ptmax=MAXDOUBLE,
00061 double absrapmin=-MAXDOUBLE, double absrapmax=-MAXDOUBLE,
00062 RapScheme rapscheme=RAPIDITY);
00063
00064
00065 virtual const Projection* clone() const {
00066 return new JetShape(*this);
00067 }
00068
00069
00070
00071
00072
00073 void clear();
00074
00075
00076
00077 void calc(const Jets& jets);
00078
00079
00080 public:
00081
00082
00083
00084 size_t numBins() const {
00085 return _binedges.size() - 1;
00086 }
00087
00088
00089 size_t numJets() const {
00090 return _diffjetshapes.size();
00091 }
00092
00093
00094 double rMin() const {
00095 return _binedges.front();
00096 }
00097
00098
00099 double rMax() const {
00100 return _binedges.back();
00101 }
00102
00103
00104 double ptMin() const {
00105 return _ptcuts.first;
00106 }
00107
00108
00109 double ptMax() const {
00110 return _ptcuts.second;
00111 }
00112
00113
00114 double rBinMin(size_t rbin) const {
00115 assert(inRange(rbin, 0, numBins()));
00116 return _binedges[rbin];
00117 }
00118
00119
00120 double rBinMax(size_t rbin) const {
00121 assert(inRange(rbin, 0, numBins()));
00122 return _binedges[rbin+1];
00123 }
00124
00125
00126 double rBinMid(size_t rbin) const {
00127 assert(inRange(rbin, 0, numBins()));
00128
00129 return (_binedges[rbin] + _binedges[rbin+1])/2.0;
00130 }
00131
00132
00133 double diffJetShape(size_t ijet, size_t rbin) const {
00134 assert(inRange(ijet, 0, numJets()));
00135 assert(inRange(rbin, 0, numBins()));
00136 return _diffjetshapes[ijet][rbin];
00137 }
00138
00139
00140 double intJetShape(size_t ijet, size_t rbin) const {
00141 assert(inRange(ijet, 0, numJets()));
00142 assert(inRange(rbin, 0, numBins()));
00143 double rtn = 0;
00144 for (size_t i = 0; i <= rbin; ++i) {
00145 rtn += _diffjetshapes[ijet][i];
00146 }
00147 return rtn;
00148 }
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159 protected:
00160
00161
00162 void project(const Event& e);
00163
00164
00165 int compare(const Projection& p) const;
00166
00167
00168 private:
00169
00170
00171
00172
00173
00174 vector<double> _binedges;
00175
00176
00177 pair<double, double> _ptcuts;
00178
00179
00180 pair<double, double> _rapcuts;
00181
00182
00183 RapScheme _rapscheme;
00184
00185
00186
00187
00188
00189
00190
00191
00192 vector< vector<double> > _diffjetshapes;
00193
00194
00195
00196 };
00197
00198
00199 }
00200
00201 #endif