JetShape.hh
// -*- C++ -*-
#ifndef RIVET_JetShape_HH
#define RIVET_JetShape_HH
#include "Rivet/Rivet.hh"
#include "Rivet/Projection.hh"
#include "Rivet/Projections/JetAlg.hh"
#include "Rivet/Particle.hh"
#include "Rivet/Event.hh"
#include "Rivet/Tools/Utils.hh"
namespace Rivet {
class JetShape : public Projection {
public:
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);
JetShape(const JetAlg& jetalg, vector<double> binedges,
double ptmin=0, double ptmax=MAXDOUBLE,
double absrapmin=-MAXDOUBLE, double absrapmax=-MAXDOUBLE,
RapScheme rapscheme=RAPIDITY);
virtual const Projection* clone() const {
return new JetShape(*this);
}
void clear();
void calc(const Jets& jets);
public:
size_t numBins() const {
return _binedges.size() - 1;
}
size_t numJets() const {
return _diffjetshapes.size();
}
double rMin() const {
return _binedges.front();
}
double rMax() const {
return _binedges.back();
}
double ptMin() const {
return _ptcuts.first;
}
double ptMax() const {
return _ptcuts.second;
}
double rBinMin(size_t rbin) const {
assert(inRange(rbin, 0, numBins()));
return _binedges[rbin];
}
double rBinMax(size_t rbin) const {
assert(inRange(rbin, 0, numBins()));
return _binedges[rbin+1];
}
double rBinMid(size_t rbin) const {
assert(inRange(rbin, 0, numBins()));
//cout << _binedges << endl;
return (_binedges[rbin] + _binedges[rbin+1])/2.0;
}
double diffJetShape(size_t ijet, size_t rbin) const {
assert(inRange(ijet, 0, numJets()));
assert(inRange(rbin, 0, numBins()));
return _diffjetshapes[ijet][rbin];
}
double intJetShape(size_t ijet, size_t rbin) const {
assert(inRange(ijet, 0, numJets()));
assert(inRange(rbin, 0, numBins()));
double rtn = 0;
for (size_t i = 0; i <= rbin; ++i) {
rtn += _diffjetshapes[ijet][i];
}
return rtn;
}
// /// Return value of \f$ \Psi \f$ (integrated jet shape) at given radius for a \f$ p_T \f$ bin.
// /// @todo Remove this external indexing thing
// double psi(size_t pTbin) const {
// return _PsiSlot[pTbin];
// }
protected:
void project(const Event& e);
int compare(const Projection& p) const;
private:
vector<double> _binedges;
pair<double, double> _ptcuts;
pair<double, double> _rapcuts;
RapScheme _rapscheme;
vector< vector<double> > _diffjetshapes;
};
}
#endif
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
Definition: MC_JetAnalysis.hh:9
Rivet::JetShape::ptMax
double ptMax() const
value.
Definition: JetShape.hh:109
Rivet::JetShape::rBinMin
double rBinMin(size_t rbin) const
Central value for bin rbin.
Definition: JetShape.hh:114
Rivet::JetShape::clone
virtual const Projection * clone() const
Clone on the heap.
Definition: JetShape.hh:65
Rivet::JetShape::rMin
double rMin() const
value.
Definition: JetShape.hh:94
Rivet::inRange
bool inRange(NUM value, NUM low, NUM high, RangeBoundary lowbound=CLOSED, RangeBoundary highbound=OPEN)
Determine if value is in the range low to high, for floating point numbers.
Definition: MathUtils.hh:109
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::project
void project(const Event &e)
Apply the projection to the event.
Definition: JetShape.cc:105
Rivet::JetShape::compare
int compare(const Projection &p) const
Compare projections.
Definition: JetShape.cc:39
Rivet::JetShape::JetShape
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
Rivet::Jets
std::vector< Jet > Jets
Typedef for a collection of Jet objects.
Definition: Jet.hh:177
Rivet::JetShape::calc
void calc(const Jets &jets)
Do the calculation directly on a supplied collection of Jet objects.
Definition: JetShape.cc:62
Rivet::JetShape::numBins
size_t numBins() const
Number of equidistant radius bins.
Definition: JetShape.hh:84
Rivet::JetShape::rMax
double rMax() const
value.
Definition: JetShape.hh:99
Rivet::Event
Definition: Event.hh:22
Rivet::JetShape::rBinMax
double rBinMax(size_t rbin) const
Central value for bin rbin.
Definition: JetShape.hh:120
Rivet::RapScheme
RapScheme
Enum for rapidity variable to be used in calculating , applying rapidity cuts, etc.
Definition: MathHeader.hh:60
Rivet::JetShape::clear
void clear()
Reset projection between events.
Definition: JetShape.cc:57
Rivet::Projection
Base class for all Rivet projections.
Definition: Projection.hh:28
Rivet::JetShape::rBinMid
double rBinMid(size_t rbin) const
Central value for bin rbin.
Definition: JetShape.hh:126
Rivet::JetShape::ptMin
double ptMin() const
value.
Definition: JetShape.hh:104
Rivet::JetAlg
Abstract base class for projections which can return a set of Jets.
Definition: JetAlg.hh:65
Rivet::JetShape::numJets
size_t numJets() const
Number of jets which passed cuts.
Definition: JetShape.hh:89
Rivet::JetShape
Calculate the jet shape.
Definition: JetShape.hh:45