a templated extension of PseudoJet that carries extra information More...
#include <PseudoJetPlusInfo.hh>
Public Member Functions | |
PseudoJetPlusInfo (const PseudoJet &pj, const TExtraInfo &ei) | |
ctor with full initialisation | |
PseudoJetPlusInfo (const PseudoJet &pj) | |
copy ctor from PseudoJet this version requires that the ExtraInfo pointer is dynamic-castable onto a pointer to TExtraInfo before making te copy If no extra info is present, just discard it | |
const TExtraInfo * | extra_info () const |
retrieve a pointer to the extra information |
a templated extension of PseudoJet that carries extra information
a class that carries the PseudoJet together with some extra info though you could live with the PseudoJet::_extra_info which is already in PseudoJet, this class is mostly a helper that deals with the association of a generic extra info (derived PsseudoJet::ExtraInfo) to a PseudoJet
WARNING: the template parameter T (i.e. your specific extra info type) has to be derived from PseudoJet::ExtraInfo (this is mostly related to the use of dynamic_casts that we have adopted as a safe-keeper against misuse of pointers)
Definition at line 57 of file PseudoJetPlusInfo.hh.
fastjet::PseudoJetPlusInfo< TExtraInfo >::PseudoJetPlusInfo | ( | const PseudoJet & | pj, | |
const TExtraInfo & | ei | |||
) | [inline] |
ctor with full initialisation
pj | the underlying PseudoJet | |
ei | the extra information |
Definition at line 62 of file PseudoJetPlusInfo.hh.
: PseudoJet(pj){ const ExtraInfo * extra_info_ptr = extra_info(); if (!extra_info_ptr) { extra_info_shared().reset(new TExtraInfo(ei)); } else if (dynamic_cast<const TExtraInfo*>(extra_info_ptr)) { // then this is already a valid PseudoJetPlusInfo // don't do anything } else { // we already have an info but of wrong type! throw ("invalid extra_info for initialising PseudoJetPlusInfo"); } }