LossyFinalState< FILTER > Class Template Reference Templated FS projection which can lose some of the supplied particles. More...
Detailed Descriptiontemplate<typename FILTER>
|
typedef Particles collection_type [inherited] |
Definition at line 173 of file ParticleFinder.hh.
typedef Particle entity_type [inherited] |
Definition at line 172 of file ParticleFinder.hh.
LossyFinalState | ( | const FinalState & | fsp, |
FILTER | filter | ||
) | [inline] |
Constructor from FinalState.
Definition at line 24 of file LossyFinalState.hh.
: _filter(filter) { setName("LossyFinalState"); addProjection(fsp, "FS"); }
LossyFinalState | ( | FILTER | filter, |
double | mineta = -MAXDOUBLE , |
||
double | maxeta = MAXDOUBLE , |
||
double | minpt = 0.0 |
||
) | [inline] |
Stand-alone constructor. Initialises the base FinalState projection.
Definition at line 32 of file LossyFinalState.hh.
: _filter(filter) { setName("LossyFinalState"); addProjection(FinalState(mineta, maxeta, minpt), "FS"); }
virtual ~LossyFinalState | ( | ) | [inline, virtual] |
const Projection & _applyProjection | ( | const Event & | evt, |
const std::string & | name | ||
) | const [protected, inherited] |
Non-templated version of string-based applyProjection, to work around header dependency issue.
Definition at line 22 of file ProjectionApplier.cc.
{ return evt.applyProjection(getProjection(name)); }
const Projection & _applyProjection | ( | const Event & | evt, |
const Projection & | proj | ||
) | const [protected, inherited] |
Non-templated version of proj-based applyProjection, to work around header dependency issue.
Definition at line 28 of file ProjectionApplier.cc.
{
return evt.applyProjection(proj);
}
const Projection & _declareProjection | ( | const Projection & | proj, |
const std::string & | name | ||
) | [protected, inherited] |
Untemplated function to do the work...
Definition at line 34 of file ProjectionApplier.cc.
{ if (!_allowProjReg) { cerr << "Trying to register projection '" << proj.name() << "' before init phase in '" << this->name() << "'." << endl; exit(2); } const Projection& reg = getProjHandler().registerProjection(*this, proj, name); return reg; }
Decide if a particle is to be accepted or not.
Decide if a particle is to be accepted or not.
Reimplemented in FinalPartons.
Definition at line 75 of file FinalState.cc.
Projection& addPdgIdPair | ( | PdgId | beam1, |
PdgId | beam2 | ||
) | [inline, inherited] |
Add a colliding beam pair.
Definition at line 108 of file Projection.hh.
{ _beamPairs.insert(PdgIdPair(beam1, beam2)); return *this; }
const PROJ& addProjection | ( | const PROJ & | proj, |
const std::string & | name | ||
) | [inline, protected, inherited] |
Register a contained projection (user-facing version)
Definition at line 157 of file ProjectionApplier.hh.
{ return declareProjection(proj, name); }
const PROJ& apply | ( | const Event & | evt, |
const Projection & | proj | ||
) | const [inline, inherited] |
Apply the supplied projection on event evt (user-facing alias).
Definition at line 80 of file ProjectionApplier.hh.
{ return applyProjection<PROJ>(evt, proj); }
Apply the supplied projection on event evt (user-facing alias).
Definition at line 92 of file ProjectionApplier.hh.
{ return applyProjection<PROJ>(evt, proj); }
Apply the supplied projection on event evt (user-facing alias).
Definition at line 104 of file ProjectionApplier.hh.
{ return applyProjection<PROJ>(evt, name); }
const PROJ& applyProjection | ( | const Event & | evt, |
const Projection & | proj | ||
) | const [inline, inherited] |
Apply the supplied projection on event evt.
Definition at line 74 of file ProjectionApplier.hh.
{ return pcast<PROJ>(_applyProjection(evt, proj)); }
const PROJ& applyProjection | ( | const Event & | evt, |
const PROJ & | proj | ||
) | const [inline, inherited] |
Apply the supplied projection on event evt.
Definition at line 86 of file ProjectionApplier.hh.
{ return pcast<PROJ>(_applyProjection(evt, proj)); }
const PROJ& applyProjection | ( | const Event & | evt, |
const std::string & | name | ||
) | const [inline, inherited] |
Apply the named projection on event evt.
Definition at line 98 of file ProjectionApplier.hh.
{ return pcast<PROJ>(_applyProjection(evt, name)); }
Return the allowed beam pairs on which this projection can operate, not including recursion. Derived classes should ensure that all contained projections are registered in the _projections set for the beam constraint chaining to work.
Definition at line 35 of file Projection.cc.
{ set<PdgIdPair> ret = _beamPairs; set<ConstProjectionPtr> projs = getProjections(); for (set<ConstProjectionPtr>::const_iterator ip = projs.begin(); ip != projs.end(); ++ip) { ConstProjectionPtr p = *ip; getLog() << Log::TRACE << "Proj addr = " << p << endl; if (p) ret = intersection(ret, p->beamPairs()); } return ret; }
bool before | ( | const Projection & | p | ) | const [inherited] |
Determine whether this object should be ordered before the object p given as argument. If p is of a different class than this, the before() function of the corresponding type_info objects is used. Otherwise, if the objects are of the same class, the virtual compare(const Projection &) will be returned.
Definition at line 24 of file Projection.cc.
virtual unique_ptr<Projection> clone | ( | ) | const [pure virtual, inherited] |
Clone on the heap.
Implements Projection.
int compare | ( | const Projection & | p | ) | const [inline, protected, virtual] |
Compare projections.
Reimplemented from FinalState.
Definition at line 65 of file LossyFinalState.hh.
{ const LossyFinalState<FILTER>& other = pcast< LossyFinalState<FILTER> >(p); const int fscmp = mkNamedPCmp(other, "FS"); if (fscmp) return fscmp; return _filter.compare(other._filter); }
const PROJ& declare | ( | const PROJ & | proj, |
const std::string & | name | ||
) | [inline, protected, inherited] |
Register a contained projection (user-facing version)
Definition at line 151 of file ProjectionApplier.hh.
{ return declareProjection(proj, name); }
const PROJ& declareProjection | ( | const PROJ & | proj, |
const std::string & | name | ||
) | [inline, protected, inherited] |
Register a contained projection.
The type of the argument is used to instantiate a new projection internally: this new object is applied to events rather than the argument object. Hence you are advised to only use locally-scoped Projection objects in your Projection and Analysis constructors, and to avoid polymorphism (e.g. handling ConcreteProjection
via a pointer or reference to type Projection
) since this will screw up the internal type management.
Definition at line 142 of file ProjectionApplier.hh.
{ const Projection& reg = _declareProjection(proj, name); const PROJ& rtn = dynamic_cast<const PROJ&>(reg); return rtn; }
DEFAULT_RIVET_PROJ_CLONE | ( | FinalState | ) | [inherited] |
Clone on the heap.
DEFAULT_RIVET_PROJ_CLONE | ( | LossyFinalState< FILTER > | ) |
Clone on the heap.
bool empty | ( | ) | const [inline, inherited] |
Is this final state empty?
Definition at line 41 of file ParticleFinder.hh.
{ return particles().empty(); }
const collection_type& entities | ( | ) | const [inline, inherited] |
Template-usable interface common to JetAlg.
Definition at line 176 of file ParticleFinder.hh.
{ return particles(); }
const PROJ& get | ( | const std::string & | name | ) | const [inline, inherited] |
Get the named projection, specifying return type via a template argument (user-facing alias).
Definition at line 57 of file ProjectionApplier.hh.
{ return getProjection<PROJ>(name); }
Get a Log object based on the getName() property of the calling projection object.
Reimplemented from ProjectionApplier.
Definition at line 115 of file Projection.hh.
{ string logname = "Rivet.Projection." + name(); return Log::getLog(logname); }
const PROJ& getProjection | ( | const std::string & | name | ) | const [inline, inherited] |
Get the named projection, specifying return type via a template argument.
Definition at line 50 of file ProjectionApplier.hh.
{ const Projection& p = getProjHandler().getProjection(*this, name); return pcast<PROJ>(p); }
const Projection& getProjection | ( | const std::string & | name | ) | const [inline, inherited] |
Get the named projection (non-templated, so returns as a reference to a Projection base class).
Definition at line 61 of file ProjectionApplier.hh.
{ return getProjHandler().getProjection(*this, name); }
std::set<ConstProjectionPtr> getProjections | ( | ) | const [inline, inherited] |
Get the contained projections, including recursion.
Definition at line 43 of file ProjectionApplier.hh.
{ return getProjHandler().getChildProjections(*this, ProjectionHandler::DEEP); }
ProjectionHandler& getProjHandler | ( | ) | const [inline, protected, inherited] |
Get a reference to the ProjectionHandler for this thread.
Definition at line 122 of file ProjectionApplier.hh.
{ return _projhandler; }
bool isEmpty | ( | ) | const [inline, inherited] |
Definition at line 44 of file ParticleFinder.hh.
{ return particles().empty(); }
void markAsOwned | ( | ) | const [inline, inherited] |
Mark object as owned by the _projhandler
Definition at line 111 of file ProjectionApplier.hh.
{ _owned = true; }
Cmp< Projection > mkNamedPCmp | ( | const Projection & | otherparent, |
const std::string & | pname | ||
) | const [protected, inherited] |
Shortcut to make a named Cmp<Projection> comparison with the *this
object automatically passed as one of the parent projections.
Definition at line 47 of file Projection.cc.
{ return pcmp(*this, otherparent, pname); }
Cmp< Projection > mkPCmp | ( | const Projection & | otherparent, |
const std::string & | pname | ||
) | const [protected, inherited] |
Shortcut to make a named Cmp<Projection> comparison with the *this
object automatically passed as one of the parent projections.
Definition at line 51 of file Projection.cc.
{ return pcmp(*this, otherparent, pname); }
virtual std::string name | ( | ) | const [inline, virtual, inherited] |
Get the name of the projection.
Implements ProjectionApplier.
Definition at line 102 of file Projection.hh.
{ return _name; }
Get the final-state particles in no particular order, with no cuts.
Definition at line 35 of file ParticleFinder.hh.
{ return _theParticles; }
Get the final-state particles, with optional cuts.
Definition at line 50 of file ParticleFinder.hh.
Particles particles | ( | F | sorter, |
const Cut & | c = Cuts::open() |
||
) | const [inline, inherited] |
Want to add a general filtering function, but that clashes with the sorting functor... SFINAE?
Use a std::function instead of typename F?
Get the final-state particles, ordered by supplied sorting function object.
Definition at line 70 of file ParticleFinder.hh.
Get the final-state particles, ordered by supplied sorting function object.
Can't this be a const Cut& arg?
Use a std::function instead of typename F?
Definition at line 80 of file ParticleFinder.hh.
Particles particlesByE | ( | const Cut & | c = Cuts::open() | ) | const [inline, inherited] |
Get the final-state particles, ordered by decreasing .
Definition at line 116 of file ParticleFinder.hh.
Particles particlesByEt | ( | const Cut & | c = Cuts::open() | ) | const [inline, inherited] |
Get the final-state particles, ordered by decreasing .
Definition at line 124 of file ParticleFinder.hh.
{ return particles(c, cmpMomByEt); }
Particles particlesByEta | ( | const Cut & | c = Cuts::open() | ) | const [inline, inherited] |
Get the final-state particles, ordered by increasing .
Definition at line 132 of file ParticleFinder.hh.
{ return particles(c, cmpMomByEta); }
Particles particlesByModEta | ( | const Cut & | c = Cuts::open() | ) | const [inline, inherited] |
Get the final-state particles, ordered by increasing .
Definition at line 140 of file ParticleFinder.hh.
{ return particles(c, cmpMomByAbsEta); }
Particles particlesByModRapidity | ( | const Cut & | c = Cuts::open() | ) | const [inline, inherited] |
Get the final-state particles, ordered by increasing .
Definition at line 156 of file ParticleFinder.hh.
{ return particles(c, cmpMomByAbsRap); }
Particles particlesByP | ( | const Cut & | c = Cuts::open() | ) | const [inline, inherited] |
Get the final-state particles, ordered by decreasing .
Definition at line 108 of file ParticleFinder.hh.
Particles particlesByPt | ( | const Cut & | c = Cuts::open() | ) | const [inline, inherited] |
Get the final-state particles, ordered by decreasing and with optional cuts.
This is a very common use-case, so is available as syntatic sugar for particles(c, cmpMomByPt).
Definition at line 88 of file ParticleFinder.hh.
{ return particles(c, cmpMomByPt); }
Particles particlesByPt | ( | double | ptmin | ) | const [inline, inherited] |
Get the final-state particles, ordered by decreasing and with a cut on minimum
.
This is a very common use-case, so is available as syntatic sugar for particles(Cuts::pT >= ptmin, cmpMomByPt).
Definition at line 95 of file ParticleFinder.hh.
{ return particles(Cuts::pT >= ptmin, cmpMomByPt); }
Particles particlesByRapidity | ( | const Cut & | c = Cuts::open() | ) | const [inline, inherited] |
Get the final-state particles, ordered by increasing .
Definition at line 148 of file ParticleFinder.hh.
{ return particles(c, cmpMomByRap); }
Apply the projection on the supplied event.
Reimplemented from FinalState.
Definition at line 54 of file LossyFinalState.hh.
{ const FinalState& fs = applyProjection<FinalState>(e, "FS"); getLog() << Log::DEBUG << "Pre-loss number of FS particles = " << fs.particles().size() << endl; _theParticles.clear(); std::remove_copy_if(fs.particles().begin(), fs.particles().end(), std::back_inserter(_theParticles), _filter); getLog() << Log::DEBUG << "Filtered number of FS particles = " << _theParticles.size() << endl; }
void setName | ( | const std::string & | name | ) | [inline, inherited] |
Used by derived classes to set their name.
Definition at line 121 of file Projection.hh.
size_t size | ( | ) | const [inline, inherited] |
Access the projected final-state particles.
Definition at line 38 of file ParticleFinder.hh.
{ return particles().size(); }
friend class Cmp< Projection > [friend, inherited] |
The Cmp specialization for Projection is a friend.
Definition at line 36 of file Projection.hh.
friend class Event [friend, inherited] |
Event is a friend.
Definition at line 33 of file Projection.hh.
bool _allowProjReg [protected, inherited] |
Flag to forbid projection registration in analyses until the init phase.
Definition at line 176 of file ProjectionApplier.hh.
The kinematic cuts cuts.
Definition at line 192 of file ParticleFinder.hh.
FILTER _filter [protected] |
Filtering object: must support operator(const Particle&) and compare(const Filter&)
Definition at line 76 of file LossyFinalState.hh.
Particles _theParticles [protected, inherited] |
The found particles returned by the particles() methods.
Definition at line 195 of file ParticleFinder.hh.