31 #include "fastjet/ClusterSequenceStructure.hh"
32 #include "fastjet/Error.hh"
33 #include "fastjet/PseudoJet.hh"
34 #include "fastjet/ClusterSequence.hh"
36 #include "fastjet/ClusterSequenceAreaBase.hh"
40 FASTJET_BEGIN_NAMESPACE
44 ClusterSequenceStructure::~ClusterSequenceStructure(){
45 if (_associated_cs != NULL
46 && _associated_cs->will_delete_self_when_unused()) {
55 _associated_cs->signal_imminent_self_deletion();
56 delete _associated_cs;
67 bool ClusterSequenceStructure::has_valid_cluster_sequence()
const{
68 return (_associated_cs != NULL);
73 const ClusterSequence* ClusterSequenceStructure::associated_cluster_sequence()
const{
74 return _associated_cs;
85 throw Error(
"you requested information about the internal structure of a jet, but its associated ClusterSequence has gone out of scope.");
86 return _associated_cs;
101 return validated_cs()->has_partner(reference, partner);
111 return validated_cs()->has_child(reference, child);
121 return validated_cs()->has_parents(reference, parent1, parent2);
129 bool ClusterSequenceStructure::object_in_jet(
const PseudoJet &reference,
const PseudoJet &jet)
const{
131 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.");
135 return validated_cs()->object_in_jet(reference, jet);
143 bool ClusterSequenceStructure::has_constituents()
const{
144 if (!has_associated_cluster_sequence())
145 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.");
153 vector<PseudoJet> ClusterSequenceStructure::constituents(
const PseudoJet &reference)
const{
154 return validated_cs()->constituents(reference);
161 bool ClusterSequenceStructure::has_exclusive_subjets()
const{
162 if (!has_associated_cluster_sequence())
163 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.");
179 std::vector<PseudoJet> ClusterSequenceStructure::exclusive_subjets (
const PseudoJet &reference,
const double & dcut)
const {
180 return validated_cs()->exclusive_subjets(reference, dcut);
189 int ClusterSequenceStructure::n_exclusive_subjets(
const PseudoJet &reference,
const double & dcut)
const {
190 return validated_cs()->n_exclusive_subjets(reference, dcut);
201 std::vector<PseudoJet> ClusterSequenceStructure::exclusive_subjets_up_to (
const PseudoJet &reference,
int nsub)
const {
202 return validated_cs()->exclusive_subjets_up_to(reference, nsub);
210 double ClusterSequenceStructure::exclusive_subdmerge(
const PseudoJet &reference,
int nsub)
const {
211 return validated_cs()->exclusive_subdmerge(reference, nsub);
220 double ClusterSequenceStructure::exclusive_subdmerge_max(
const PseudoJet &reference,
int nsub)
const {
221 return validated_cs()->exclusive_subdmerge_max(reference, nsub);
234 bool ClusterSequenceStructure::has_pieces(
const PseudoJet &reference)
const{
236 return has_parents(reference, dummy1, dummy2);
244 vector<PseudoJet> ClusterSequenceStructure::pieces(
const PseudoJet &reference)
const{
246 vector<PseudoJet> res;
247 if (has_parents(reference, j1, j2)){
266 if (csab == NULL)
throw Error(
"you requested jet-area related information, but the PseudoJet does not have associated area information.");
271 bool ClusterSequenceStructure::has_area()
const{
272 if (! has_associated_cluster_sequence())
return false;
273 return (dynamic_cast<const ClusterSequenceAreaBase*>(_associated_cs) != NULL);
278 double ClusterSequenceStructure::area(
const PseudoJet &reference)
const{
279 return validated_csab()->
area(reference);
285 double ClusterSequenceStructure::area_error(
const PseudoJet &reference)
const{
286 return validated_csab()->area_error(reference);
297 bool ClusterSequenceStructure::is_pure_ghost(
const PseudoJet &reference)
const{
305 FASTJET_END_NAMESPACE
virtual double area(const PseudoJet &) const
return the area associated with the given jet; this base class returns 0.
base class that sets interface for extensions of ClusterSequence that provide information about the a...
base class corresponding to errors that can be thrown by FastJet
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)
bool has_associated_cluster_sequence() const
returns true if this PseudoJet has an associated ClusterSequence.
Class to contain pseudojets, including minimal information of use to jet-clustering routines...
virtual PseudoJet area_4vector() const
return the jet 4-vector area.