FastJets.hh
// -*- C++ -*-
#ifndef RIVET_FastJets_HH
#define RIVET_FastJets_HH
#include "Rivet/Projection.hh"
#include "Rivet/Projections/JetAlg.hh"
#include "Rivet/Projections/FinalState.hh"
#include "Rivet/Particle.hh"
#include "Rivet/Jet.hh"
#include "fastjet/JetDefinition.hh"
#include "fastjet/AreaDefinition.hh"
#include "fastjet/ClusterSequence.hh"
#include "fastjet/ClusterSequenceArea.hh"
#include "fastjet/PseudoJet.hh"
#include "fastjet/SISConePlugin.hh"
#include "fastjet/CMSIterativeConePlugin.hh"
#include "fastjet/D0RunIIConePlugin.hh"
#include "fastjet/TrackJetPlugin.hh"
#include "fastjet/JadePlugin.hh"
//#include "fastjet/PxConePlugin.hh"
namespace Rivet {
inline Vector3 momentum3(const fastjet::PseudoJet& pj) {
return Vector3(pj.px(), pj.py(), pj.pz());
}
inline FourMomentum momentum(const fastjet::PseudoJet& pj) {
return FourMomentum(pj.E(), pj.px(), pj.py(), pj.pz());
}
typedef vector<fastjet::PseudoJet> PseudoJets;
class FastJets : public JetAlg {
public:
enum JetAlgName { KT, CAM, SISCONE, ANTIKT,
PXCONE,
ATLASCONE, CMSCONE,
CDFJETCLU, CDFMIDPOINT, D0ILCONE,
JADE, DURHAM, TRACKJET };
FastJets(const FinalState& fsp, JetAlgName alg,
double rparameter, double seed_threshold=1.0)
: JetAlg(fsp), _adef(0) { _init1(alg, rparameter, seed_threshold); }
FastJets(const FinalState& fsp, fastjet::JetAlgorithm type,
fastjet::RecombinationScheme recom, double rparameter)
: JetAlg(fsp), _adef(0) { _init2(type, recom, rparameter); }
FastJets(const FinalState& fsp, fastjet::JetDefinition::Plugin* plugin)
: JetAlg(fsp), _adef(0) { _init3(plugin); }
FastJets(const FinalState& fsp, fastjet::JetDefinition::Plugin& plugin)
: JetAlg(fsp), _adef(0) { _init3(&plugin); }
FastJets(JetAlgName alg, double rparameter, double seed_threshold=1.0)
: _adef(0) { _init1(alg, rparameter, seed_threshold); }
FastJets(fastjet::JetAlgorithm type, fastjet::RecombinationScheme recom, double rparameter)
: _adef(0) { _init2(type, recom, rparameter); }
FastJets(fastjet::JetDefinition::Plugin* plugin)
: _adef(0) { _init3(plugin); }
FastJets(fastjet::JetDefinition::Plugin& plugin)
: _adef(0) { _init3(&plugin); }
virtual const Projection* clone() const {
return new FastJets(*this);
}
public:
void reset();
void useJetArea(fastjet::AreaDefinition* adef) {
_adef = adef;
}
size_t numJets(double ptmin = 0.0) const;
size_t size() const {
return numJets();
}
Jets _jets(double ptmin = 0.0) const;
PseudoJets pseudoJets(double ptmin = 0.0) const;
PseudoJets pseudoJetsByPt(double ptmin = 0.0) const {
return sorted_by_pt(pseudoJets(ptmin));
}
PseudoJets pseudoJetsByE(double ptmin = 0.0) const {
return sorted_by_E(pseudoJets(ptmin));
}
PseudoJets pseudoJetsByRapidity(double ptmin = 0.0) const {
return sorted_by_rapidity(pseudoJets(ptmin));
}
const fastjet::ClusterSequence* clusterSeq() const {
return _cseq.get();
}
const fastjet::ClusterSequenceArea* clusterSeqArea() const {
if (_adef == 0) return (fastjet::ClusterSequenceArea*) 0;
return dynamic_cast<fastjet::ClusterSequenceArea*>(_cseq.get());
}
const fastjet::JetDefinition& jetDef() const {
return _jdef;
}
const fastjet::AreaDefinition* areaDef() const {
return _adef;
}
vector<double> ySubJet(const fastjet::PseudoJet& jet) const;
fastjet::PseudoJet splitJet(fastjet::PseudoJet jet, double& last_R) const;
fastjet::PseudoJet filterJet(fastjet::PseudoJet jet, double& stingy_R, const double def_R) const;
private:
Jets _pseudojetsToJets(const PseudoJets& pjets) const;
void _init1(JetAlgName alg, double rparameter, double seed_threshold);
void _init2(fastjet::JetAlgorithm type,
fastjet::RecombinationScheme recom, double rparameter);
void _init3(fastjet::JetDefinition::Plugin* plugin);
protected:
void project(const Event& e);
int compare(const Projection& p) const;
public:
void calc(const ParticleVector& ps);
private:
fastjet::JetDefinition _jdef;
fastjet::AreaDefinition* _adef;
shared_ptr<fastjet::ClusterSequence> _cseq;
shared_ptr<fastjet::JetDefinition::Plugin> _plugin;
mutable map<int, vector<double> > _yscales;
//set<Particle, ParticleBase::byPTAscending> _particles;
map<int, Particle> _particles;
};
}
#endif
Rivet
Definition: MC_JetAnalysis.hh:9
Rivet::FastJets::clusterSeq
const fastjet::ClusterSequence * clusterSeq() const
Return the cluster sequence (FastJet-specific).
Definition: FastJets.hh:147
Rivet::FastJets::FastJets
FastJets(const FinalState &fsp, fastjet::JetDefinition::Plugin &plugin)
Explicitly pass in an externally-constructed plugin (must be heap-allocated, Rivet will delete) ...
Definition: FastJets.hh:79
Rivet::FastJets::FastJets
FastJets(JetAlgName alg, double rparameter, double seed_threshold=1.0)
Same thing as above, but without an FS (for when we want to pass the particles directly to the calc m...
Definition: FastJets.hh:84
Rivet::FastJets::FastJets
FastJets(fastjet::JetDefinition::Plugin &plugin)
Same thing as above, but without an FS (for when we want to pass the particles directly to the calc m...
Definition: FastJets.hh:93
Rivet::FastJets::areaDef
const fastjet::AreaDefinition * areaDef() const
Return the area definition (FastJet-specific). May be null.
Definition: FastJets.hh:164
Rivet::FastJets::numJets
size_t numJets(double ptmin=0.0) const
Number of jets above the cut.
Definition: FastJets.cc:145
Rivet::FastJets::clusterSeqArea
const fastjet::ClusterSequenceArea * clusterSeqArea() const
Return the cluster sequence (FastJet-specific).
Definition: FastJets.hh:152
Rivet::FastJets::pseudoJetsByE
PseudoJets pseudoJetsByE(double ptmin=0.0) const
Get the pseudo jets, ordered by .
Definition: FastJets.hh:137
Rivet::FastJets::project
void project(const Event &e)
Perform the projection on the Event.
Definition: FastJets.cc:82
Rivet::FastJets::useJetArea
void useJetArea(fastjet::AreaDefinition *adef)
Use provided jet area definition.
Definition: FastJets.hh:113
Rivet::FastJets::pseudoJets
PseudoJets pseudoJets(double ptmin=0.0) const
Get the pseudo jets (unordered).
Definition: FastJets.cc:175
Rivet::PseudoJets
vector< fastjet::PseudoJet > PseudoJets
Typedef for a collection of PseudoJets.
Definition: FastJets.hh:39
Rivet::Jets
std::vector< Jet > Jets
Typedef for a collection of Jet objects.
Definition: Jet.hh:177
Rivet::FastJets::FastJets
FastJets(const FinalState &fsp, JetAlgName alg, double rparameter, double seed_threshold=1.0)
Definition: FastJets.hh:66
Rivet::FastJets::ySubJet
vector< double > ySubJet(const fastjet::PseudoJet &jet) const
Get the subjet splitting variables for the given jet.
Definition: FastJets.cc:184
Rivet::momentum3
Vector3 momentum3(const fastjet::PseudoJet &pj)
Make a 3-momentum vector from a FastJet pseudo-jet.
Definition: FastJets.hh:28
Rivet::FastJets
Project out jets found using the FastJet package jet algorithms.
Definition: FastJets.hh:48
Rivet::FastJets::FastJets
FastJets(const FinalState &fsp, fastjet::JetAlgorithm type, fastjet::RecombinationScheme recom, double rparameter)
Native argument constructor, using FastJet alg/scheme enums.
Definition: FastJets.hh:71
Rivet::FastJets::jetDef
const fastjet::JetDefinition & jetDef() const
Return the jet definition (FastJet-specific).
Definition: FastJets.hh:159
Rivet::FastJets::splitJet
fastjet::PseudoJet splitJet(fastjet::PseudoJet jet, double &last_R) const
Split a jet a la PRL100,242001(2008). Based on code from G.Salam, A.Davison.
Definition: FastJets.cc:200
Rivet::FastJets::pseudoJetsByPt
PseudoJets pseudoJetsByPt(double ptmin=0.0) const
Get the pseudo jets, ordered by .
Definition: FastJets.hh:132
Rivet::Event
Definition: Event.hh:22
Rivet::FastJets::FastJets
FastJets(fastjet::JetAlgorithm type, fastjet::RecombinationScheme recom, double rparameter)
Same thing as above, but without an FS (for when we want to pass the particles directly to the calc m...
Definition: FastJets.hh:87
Rivet::FastJets::pseudoJetsByRapidity
PseudoJets pseudoJetsByRapidity(double ptmin=0.0) const
Get the pseudo jets, ordered by rapidity.
Definition: FastJets.hh:142
Rivet::FastJets::clone
virtual const Projection * clone() const
Clone on the heap.
Definition: FastJets.hh:98
Rivet::FastJets::FastJets
FastJets(const FinalState &fsp, fastjet::JetDefinition::Plugin *plugin)
Explicitly pass in an externally-constructed plugin (must be heap-allocated, Rivet will delete) ...
Definition: FastJets.hh:76
Rivet::FastJets::FastJets
FastJets(fastjet::JetDefinition::Plugin *plugin)
Same thing as above, but without an FS (for when we want to pass the particles directly to the calc m...
Definition: FastJets.hh:90
Rivet::FastJets::compare
int compare(const Projection &p) const
Compare projections.
Definition: FastJets.cc:69
Rivet::FastJets::filterJet
fastjet::PseudoJet filterJet(fastjet::PseudoJet jet, double &stingy_R, const double def_R) const
Filter a jet a la PRL100,242001(2008). Based on code from G.Salam, A.Davison.
Definition: FastJets.cc:239
Rivet::FinalState
Project out all final-state particles in an event. Probably the most important projection in Rivet! ...
Definition: FinalState.hh:14
Rivet::FastJets::size
size_t size() const
Number of jets.
Definition: FastJets.hh:121
Rivet::FastJets::reset
void reset()
Reset the projection. Jet def, etc. are unchanged.
Definition: FastJets.cc:138
Rivet::Projection
Base class for all Rivet projections.
Definition: Projection.hh:28
Rivet::Vector3
Three-dimensional specialisation of Vector.
Definition: Vector3.hh:26
Rivet::momentum
FourMomentum momentum(const fastjet::PseudoJet &pj)
Make a 4-momentum vector from a FastJet pseudo-jet.
Definition: FastJets.hh:33
Rivet::FastJets::JetAlgName
JetAlgName
Wrapper enum for selected Fastjet jet algorithms.
Definition: FastJets.hh:52
Rivet::FourMomentum
Specialized version of the FourVector with momentum/energy functionality.
Definition: Vector4.hh:324
Rivet::JetAlg
Abstract base class for projections which can return a set of Jets.
Definition: JetAlg.hh:65
Rivet::FastJets::calc
void calc(const ParticleVector &ps)
Do the calculation locally (no caching).
Definition: FastJets.cc:93