/usr/include/Rivet/BeamConstraint.hh is in librivet-dev 1.8.3-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | // -*- C++ -*-
#ifndef RIVET_BeamConstraint_HH
#define RIVET_BeamConstraint_HH
#include "Rivet/Rivet.hh"
#include "Rivet/ParticleName.hh"
#include "Rivet/Particle.hh"
#include <iostream>
namespace Rivet {
/// Find whether ParticleName @a p is compatible with the
/// template ParticleName @a allowed. Effectively this is
/// asking whether @a p is a subset of @a allowed.
inline bool compatible(PdgId p, PdgId allowed) {
//assert(p != ANY);
return (allowed == ANY || p == allowed);
}
/// Find whether PdgIdPair @a pair is compatible with the template
/// PdgIdPair @a allowedpair. This assesses whether either of the
/// two possible pairings of @a pair's constituents is compatible.
inline bool compatible(const PdgIdPair& pair, const PdgIdPair& allowedpair) {
bool oneToOne = compatible(pair.first, allowedpair.first);
bool twoToTwo = compatible(pair.second, allowedpair.second);
bool oneToTwo = compatible(pair.first, allowedpair.second);
bool twoToOne = compatible(pair.second, allowedpair.first);
return (oneToOne && twoToTwo) || (oneToTwo && twoToOne);
}
/// Check particle compatibility of Particle pairs
inline bool compatible(const ParticlePair& ppair,
const PdgIdPair& allowedpair) {
return compatible(make_pdgid_pair(ppair.first.pdgId(),
ppair.second.pdgId()), allowedpair);
}
/// Check particle compatibility of Particle pairs (for symmetric completeness)
inline bool compatible(const PdgIdPair& allowedpair,
const ParticlePair& ppair) {
return compatible(ppair, allowedpair);
}
/// Find whether a PdgIdPair @a pair is compatible with at least one template
/// beam pair in a set @a allowedpairs.
inline bool compatible(const PdgIdPair& pair, const set<PdgIdPair>& allowedpairs) {
for (set<PdgIdPair>::const_iterator bp = allowedpairs.begin(); bp != allowedpairs.end(); ++bp) {
if (compatible(pair, *bp)) return true;
}
return false;
}
/// Return the intersection of two sets of {PdgIdPair}s.
inline set<PdgIdPair> intersection(const set<PdgIdPair>& a, const set<PdgIdPair>& b) {
set<PdgIdPair> ret;
for (set<PdgIdPair>::const_iterator bp = a.begin(); bp != a.end(); ++bp) {
if (compatible(*bp, b)) ret.insert(*bp);
}
return ret;
}
}
#endif
|