31#include "fastjet/config.h"
32#include "fastjet/ClusterSequenceStructure.hh"
33#include "fastjet/Error.hh"
34#include "fastjet/PseudoJet.hh"
35#include "fastjet/ClusterSequence.hh"
37#include "fastjet/ClusterSequenceAreaBase.hh"
41FASTJET_BEGIN_NAMESPACE
45ClusterSequenceStructure::~ClusterSequenceStructure(){
49 if (_associated_cs != NULL
50 && _associated_cs->will_delete_self_when_unused()) {
59 _associated_cs->signal_imminent_self_deletion();
60 delete _associated_cs;
72bool ClusterSequenceStructure::has_valid_cluster_sequence()
const{
73 return (_associated_cs != NULL);
78const ClusterSequence* ClusterSequenceStructure::associated_cluster_sequence()
const{
79 return _associated_cs;
90 throw Error(
"you requested information about the internal structure of a jet, but its associated ClusterSequence has gone out of scope.");
91 return _associated_cs;
106 return validated_cs()->has_partner(reference, partner);
116 return validated_cs()->has_child(reference, child);
126 return validated_cs()->has_parents(reference, parent1, parent2);
136 throw Error(
"you requested information about the internal structure of a jet, but it is not associated with a ClusterSequence or its associated ClusterSequence has gone out of scope.");
140 return validated_cs()->object_in_jet(reference, jet);
148bool ClusterSequenceStructure::has_constituents()
const{
149 if (!has_associated_cluster_sequence())
150 throw Error(
"you requested information about the internal structure of a jet, but it is not associated with a ClusterSequence or its associated ClusterSequence has gone out of scope.");
158vector<PseudoJet> ClusterSequenceStructure::constituents(
const PseudoJet &reference)
const{
159 return validated_cs()->constituents(reference);
166bool ClusterSequenceStructure::has_exclusive_subjets()
const{
167 if (!has_associated_cluster_sequence())
168 throw Error(
"you requested information about the internal structure of a jet, but it is not associated with a ClusterSequence or its associated ClusterSequence has gone out of scope.");
184std::vector<PseudoJet> ClusterSequenceStructure::exclusive_subjets (
const PseudoJet &reference,
const double & dcut)
const {
185 return validated_cs()->exclusive_subjets(reference, dcut);
194int ClusterSequenceStructure::n_exclusive_subjets(
const PseudoJet &reference,
const double & dcut)
const {
195 return validated_cs()->n_exclusive_subjets(reference, dcut);
206std::vector<PseudoJet> ClusterSequenceStructure::exclusive_subjets_up_to (
const PseudoJet &reference,
int nsub)
const {
207 return validated_cs()->exclusive_subjets_up_to(reference, nsub);
215double ClusterSequenceStructure::exclusive_subdmerge(
const PseudoJet &reference,
int nsub)
const {
216 return validated_cs()->exclusive_subdmerge(reference, nsub);
225double ClusterSequenceStructure::exclusive_subdmerge_max(
const PseudoJet &reference,
int nsub)
const {
226 return validated_cs()->exclusive_subdmerge_max(reference, nsub);
239bool ClusterSequenceStructure::has_pieces(
const PseudoJet &reference)
const{
241 return has_parents(reference, dummy1, dummy2);
249vector<PseudoJet> ClusterSequenceStructure::pieces(
const PseudoJet &reference)
const{
251 vector<PseudoJet> res;
252 if (has_parents(reference, j1, j2)){
271 if (csab == NULL)
throw Error(
"you requested jet-area related information, but the PseudoJet does not have associated area information.");
276bool ClusterSequenceStructure::has_area()
const{
277 if (! has_associated_cluster_sequence())
return false;
283double ClusterSequenceStructure::area(
const PseudoJet &reference)
const{
284 return validated_csab()->
area(reference);
290double ClusterSequenceStructure::area_error(
const PseudoJet &reference)
const{
291 return validated_csab()->area_error(reference);
302bool ClusterSequenceStructure::is_pure_ghost(
const PseudoJet &reference)
const{
base class that sets interface for extensions of ClusterSequence that provide information about the a...
virtual double area(const PseudoJet &) const
return the area associated with the given jet; this base class returns 0.
base class corresponding to errors that can be thrown by FastJet
Class to contain pseudojets, including minimal information of use to jet-clustering routines.
virtual bool is_pure_ghost() const
true if this jet is made exclusively of ghosts.
const ClusterSequence * associated_cluster_sequence() const
get a (const) pointer to the parent ClusterSequence (NULL if inexistent)
virtual PseudoJet area_4vector() const
return the jet 4-vector area.
bool has_associated_cluster_sequence() const
returns true if this PseudoJet has an associated ClusterSequence.