2 #ifndef RIVET_BeamConstraint_HH
3 #define RIVET_BeamConstraint_HH
5 #include "Rivet/Rivet.hh"
6 #include "Rivet/ParticleName.hh"
7 #include "Rivet/Particle.hh"
18 return (allowed == ANY || p == allowed);
24 inline bool compatible(
const PdgIdPair& pair,
const PdgIdPair& allowedpair) {
25 bool oneToOne =
compatible(pair.first, allowedpair.first);
26 bool twoToTwo =
compatible(pair.second, allowedpair.second);
27 bool oneToTwo =
compatible(pair.first, allowedpair.second);
28 bool twoToOne =
compatible(pair.second, allowedpair.first);
29 return (oneToOne && twoToTwo) || (oneToTwo && twoToOne);
35 const PdgIdPair& allowedpair) {
37 ppair.second.pdgId()), allowedpair);
41 const ParticlePair& ppair) {
48 inline bool compatible(
const PdgIdPair& pair,
const set<PdgIdPair>& allowedpairs) {
49 for (set<PdgIdPair>::const_iterator bp = allowedpairs.begin(); bp != allowedpairs.end(); ++bp) {
56 inline set<PdgIdPair>
intersection(
const set<PdgIdPair>& a,
const set<PdgIdPair>& b) {
58 for (set<PdgIdPair>::const_iterator bp = a.begin(); bp != a.end(); ++bp) {
Definition: MC_JetAnalysis.hh:9
set< PdgIdPair > intersection(const set< PdgIdPair > &a, const set< PdgIdPair > &b)
Return the intersection of two sets of {PdgIdPair}s.
Definition: BeamConstraint.hh:56
bool compatible(PdgId p, PdgId allowed)
Definition: BeamConstraint.hh:16
std::pair< PdgId, PdgId > make_pdgid_pair(PdgId a, PdgId b)
Convenience maker of particle ID pairs from PdgIds.
Definition: ParticleName.hh:154