Public Types |
Public Member Functions |
Protected Member Functions |
Protected Attributes |
Private Types |
Private Attributes |
Friends
VetoedFinalState Class Reference FS modifier to exclude classes of particles from the final state. More...
Detailed DescriptionFS modifier to exclude classes of particles from the final state. Definition at line 11 of file VetoedFinalState.hh. Member Typedef Documentation
Typedef for a pair of back-to-back cuts. Definition at line 16 of file VetoedFinalState.hh.
Definition at line 173 of file ParticleFinder.hh.
Typedef for a veto on a composite particle mass. Definition at line 22 of file VetoedFinalState.hh.
Definition at line 172 of file ParticleFinder.hh.
Definition at line 171 of file VetoedFinalState.hh.
Typedef for a vetoing entry. Definition at line 19 of file VetoedFinalState.hh. Constructor & Destructor Documentation
Default constructor. Definition at line 28 of file VetoedFinalState.hh. { setName("VetoedFinalState"); addProjection(FinalState(), "FS"); }
Constructor with specific FinalState. Definition at line 34 of file VetoedFinalState.hh. { setName("VetoedFinalState"); addProjection(fsp, "FS"); }
You can add a map of ID plus a pair containing Definition at line 42 of file VetoedFinalState.hh. : _vetoCodes(vetocodes) { setName("VetoedFinalState"); addProjection(FinalState(), "FS"); }
You can add a map of ID plus a pair containing Definition at line 52 of file VetoedFinalState.hh. : _vetoCodes(vetocodes) { setName("VetoedFinalState"); addProjection(fsp, "FS"); } Member Function Documentation
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)); }
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);
}
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.
Add a veto on composite masses within a given width. The composite mass is composed of nProducts decay products @ todo might we want to specify a range of pdg ids for the decay products? Definition at line 115 of file VetoedFinalState.hh. { double halfWidth = 0.5*width; BinaryCut massRange(mass - halfWidth, mass + halfWidth); _compositeVetoes.insert(make_pair(nProducts, massRange)); _nCompositeDecays.insert(nProducts); return *this; }
Veto the decay products of particle with pdg id
Definition at line 126 of file VetoedFinalState.hh. { _parentVetoes.insert(id); return *this; }
Add a colliding beam pair. Definition at line 108 of file Projection.hh. { _beamPairs.insert(PdgIdPair(beam1, beam2)); return *this; }
Register a contained projection (user-facing version)
Definition at line 157 of file ProjectionApplier.hh. { return declareProjection(proj, name); }
Add a particle ID and Definition at line 75 of file VetoedFinalState.hh. { BinaryCut ptrange(ptmin, ptmax); _vetoCodes.insert(make_pair(id, ptrange)); return *this; }
Add a particle ID to veto (all Definition at line 98 of file VetoedFinalState.hh. { BinaryCut ptrange(0.0, numeric_limits<double>::max()); _vetoCodes.insert(make_pair(id, ptrange)); return *this; }
Veto particles from a supplied final state. Definition at line 145 of file VetoedFinalState.hh. { const string name = "FS_" + to_str(_vetofsnames.size()); addProjection(fs, name); _vetofsnames.insert(name); return *this; }
Add a particle/antiparticle pair to veto in a given Definition at line 83 of file VetoedFinalState.hh. { addVetoDetail(id, ptmin, ptmax); addVetoDetail(-id, ptmin, ptmax); return *this; }
Add a particle/antiparticle pair to veto. Given a single ID, both the particle and its corresponding antiparticle (for all Definition at line 91 of file VetoedFinalState.hh.
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); }
Apply the supplied projection on event evt.
Definition at line 74 of file ProjectionApplier.hh. { return pcast<PROJ>(_applyProjection(evt, proj)); }
Apply the supplied projection on event evt.
Definition at line 86 of file ProjectionApplier.hh. { return pcast<PROJ>(_applyProjection(evt, proj)); }
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; }
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.
Clone on the heap. Implements Projection.
Compare projections.
Reimplemented from FinalState. Definition at line 7 of file VetoedFinalState.cc. { const PCmp fscmp = mkNamedPCmp(p, "FS"); if (fscmp != EQUIVALENT) return fscmp; /// @todo We can do better than this... if (_vetofsnames.size() != 0) return UNDEFINED; const VetoedFinalState& other = dynamic_cast<const VetoedFinalState&>(p); return \ cmp(_vetoCodes, other._vetoCodes) || cmp(_compositeVetoes, other._compositeVetoes) || cmp(_parentVetoes, other._parentVetoes); }
Register a contained projection (user-facing version)
Definition at line 151 of file ProjectionApplier.hh. { return declareProjection(proj, name); }
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
Definition at line 142 of file ProjectionApplier.hh. { const Projection& reg = _declareProjection(proj, name); const PROJ& rtn = dynamic_cast<const PROJ&>(reg); return rtn; }
Clone on the heap. Clone on the heap.
Is this final state empty? Definition at line 41 of file ParticleFinder.hh. { return particles().empty(); }
Template-usable interface common to JetAlg. Definition at line 176 of file ParticleFinder.hh. { return particles(); }
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); }
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); }
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); }
Get the contained projections, including recursion. Definition at line 43 of file ProjectionApplier.hh. { return getProjHandler().getChildProjections(*this, ProjectionHandler::DEEP); }
Get a reference to the ProjectionHandler for this thread. Definition at line 122 of file ProjectionApplier.hh. { return _projhandler; }
Definition at line 44 of file ParticleFinder.hh. { return particles().empty(); }
Mark object as owned by the _projhandler
Definition at line 111 of file ProjectionApplier.hh. { _owned = true; }
Shortcut to make a named Cmp<Projection> comparison with the Definition at line 47 of file Projection.cc. { return pcmp(*this, otherparent, pname); }
Shortcut to make a named Cmp<Projection> comparison with the
Definition at line 51 of file Projection.cc. { return pcmp(*this, otherparent, pname); }
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.
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.
Definition at line 80 of file ParticleFinder.hh.
Get the final-state particles, ordered by decreasing
Definition at line 116 of file ParticleFinder.hh.
Get the final-state particles, ordered by decreasing
Definition at line 124 of file ParticleFinder.hh. { return particles(c, cmpMomByEt); }
Get the final-state particles, ordered by increasing
Definition at line 132 of file ParticleFinder.hh. { return particles(c, cmpMomByEta); }
Get the final-state particles, ordered by increasing
Definition at line 140 of file ParticleFinder.hh. { return particles(c, cmpMomByAbsEta); }
Get the final-state particles, ordered by increasing
Definition at line 156 of file ParticleFinder.hh. { return particles(c, cmpMomByAbsRap); }
Get the final-state particles, ordered by decreasing
Definition at line 108 of file ParticleFinder.hh.
Get the final-state particles, ordered by decreasing 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); }
Get the final-state particles, ordered by decreasing 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); }
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 20 of file VetoedFinalState.cc. { const FinalState& fs = applyProjection<FinalState>(e, "FS"); _theParticles.clear(); _theParticles.reserve(fs.particles().size()); foreach (const Particle& p, fs.particles()) { if (getLog().isActive(Log::TRACE)) { vector<long> codes; for (VetoDetails::const_iterator code = _vetoCodes.begin(); code != _vetoCodes.end(); ++code) { codes.push_back(code->first); } const string codestr = "{ " + join(codes) + " }"; MSG_TRACE(p.pid() << " vs. veto codes = " << codestr << " (" << codes.size() << ")"); } VetoDetails::iterator iter = _vetoCodes.find(p.pid()); if (iter == _vetoCodes.end()) { MSG_TRACE("Storing with PDG code = " << p.pid() << ", pT = " << p.pT()); _theParticles.push_back(p); } else { // This particle code is listed as a possible veto... check pT. // Make sure that the pT range is sensible: BinaryCut ptrange = iter->second; assert(ptrange.first <= ptrange.second); stringstream rangess; if (ptrange.first < numeric_limits<double>::max()) rangess << ptrange.second; rangess << " - "; if (ptrange.second < numeric_limits<double>::max()) rangess << ptrange.second; MSG_TRACE("ID = " << p.pid() << ", pT range = " << rangess.str()); stringstream debugline; debugline << "with PDG code = " << p.pid() << " pT = " << p.pT(); if (p.pT() < ptrange.first || p.pT() > ptrange.second) { MSG_TRACE("Storing " << debugline.str()); _theParticles.push_back(p); } else { MSG_TRACE("Vetoing " << debugline.str()); } } } set<Particles::iterator> toErase; for (set<int>::iterator nIt = _nCompositeDecays.begin(); nIt != _nCompositeDecays.end() && !_theParticles.empty(); ++nIt) { map<set<Particles::iterator>, FourMomentum> oldMasses; map<set<Particles::iterator>, FourMomentum> newMasses; set<Particles::iterator> start; start.insert(_theParticles.begin()); oldMasses.insert(pair<set<Particles::iterator>, FourMomentum> (start, _theParticles.begin()->momentum())); for (int nParts = 1; nParts != *nIt; ++nParts) { for (map<set<Particles::iterator>, FourMomentum>::iterator mIt = oldMasses.begin(); mIt != oldMasses.end(); ++mIt) { Particles::iterator pStart = *(mIt->first.rbegin()); for (Particles::iterator pIt = pStart + 1; pIt != _theParticles.end(); ++pIt) { FourMomentum cMom = mIt->second + pIt->momentum(); set<Particles::iterator> pList(mIt->first); pList.insert(pIt); newMasses[pList] = cMom; } } oldMasses = newMasses; newMasses.clear(); } for (map<set<Particles::iterator>, FourMomentum>::iterator mIt = oldMasses.begin(); mIt != oldMasses.end(); ++mIt) { double mass2 = mIt->second.mass2(); if (mass2 >= 0.0) { double mass = sqrt(mass2); for (CompositeVeto::iterator cIt = _compositeVetoes.lower_bound(*nIt); cIt != _compositeVetoes.upper_bound(*nIt); ++cIt) { BinaryCut massRange = cIt->second; if (mass < massRange.second && mass > massRange.first) { for (set<Particles::iterator>::iterator lIt = mIt->first.begin(); lIt != mIt->first.end(); ++lIt) { toErase.insert(*lIt); } } } } } } for (set<Particles::iterator>::reverse_iterator p = toErase.rbegin(); p != toErase.rend(); ++p) { _theParticles.erase(*p); } // Remove particles whose parents match entries in the parent veto PDG ID codes list /// @todo There must be a nice way to do this -- an STL algorithm (or we provide a nicer wrapper) foreach (PdgId vetoid, _parentVetoes) { for (Particles::iterator ip = _theParticles.begin(); ip != _theParticles.end(); ++ip) { const GenVertex* startVtx = ip->genParticle()->production_vertex(); if (startVtx == NULL) continue; // Loop over parents and test their IDs /// @todo Could use any() here? foreach (const GenParticle* parent, Rivet::particles(startVtx, HepMC::ancestors)) { if (vetoid == parent->pdg_id()) { ip = _theParticles.erase(ip); --ip; //< Erase this _theParticles entry break; } } } } // Now veto on the FS foreach (const string& ifs, _vetofsnames) { const FinalState& vfs = applyProjection<FinalState>(e, ifs); const Particles& vfsp = vfs.particles(); for (Particles::iterator icheck = _theParticles.begin(); icheck != _theParticles.end(); ++icheck) { if (icheck->genParticle() == NULL) continue; bool found = false; for (Particles::const_iterator ipart = vfsp.begin(); ipart != vfsp.end(); ++ipart){ if (ipart->genParticle() == NULL) continue; MSG_TRACE("Comparing barcode " << icheck->genParticle()->barcode() << " with veto particle " << ipart->genParticle()->barcode()); if (ipart->genParticle()->barcode() == icheck->genParticle()->barcode()){ found = true; break; } } if (found) { _theParticles.erase(icheck); --icheck; } } } }
Clear the list of particle IDs and ranges to veto. Definition at line 138 of file VetoedFinalState.hh. { _vetoCodes.clear(); return *this; }
Used by derived classes to set their name. Definition at line 121 of file Projection.hh.
Set the list of particle IDs and Definition at line 132 of file VetoedFinalState.hh. { _vetoCodes = ids; return *this; }
Access the projected final-state particles. Definition at line 38 of file ParticleFinder.hh. { return particles().size(); }
Get the list of particle IDs and Definition at line 69 of file VetoedFinalState.hh. { return _vetoCodes; }
Veto all neutrinos (convenience method) Definition at line 105 of file VetoedFinalState.hh. { addVetoPairId(PID::NU_E); addVetoPairId(PID::NU_MU); addVetoPairId(PID::NU_TAU); return *this; } Friends And Related Function Documentation
The Cmp specialization for Projection is a friend. Definition at line 36 of file Projection.hh.
Event is a friend. Definition at line 33 of file Projection.hh. Member Data Documentation
Flag to forbid projection registration in analyses until the init phase. Definition at line 176 of file ProjectionApplier.hh.
Composite particle masses to veto. Definition at line 168 of file VetoedFinalState.hh. The kinematic cuts cuts. Definition at line 192 of file ParticleFinder.hh.
Definition at line 169 of file VetoedFinalState.hh.
Set of decaying particle IDs to veto. Definition at line 174 of file VetoedFinalState.hh.
The found particles returned by the particles() methods. Definition at line 195 of file ParticleFinder.hh.
The final-state particles. Definition at line 165 of file VetoedFinalState.hh.
Set of finalstate to be vetoed. Definition at line 177 of file VetoedFinalState.hh. The documentation for this class was generated from the following files: Generated on Tue Dec 13 2016 16:32:50 for The Rivet MC analysis system by ![]() |