4 #include "Rivet/Tools/Cuts.fhh" 15 template <
typename ClassToCheck>
16 bool accept(
const ClassToCheck&)
const;
20 template <
typename ClassToCheck>
21 bool operator () (
const ClassToCheck& x)
const {
return accept(x); }
27 virtual std::string
toString()
const = 0;
35 virtual bool _accept(
const CuttableBase&)
const = 0;
41 inline bool operator == (
const Cut& a,
const Cut& b) {
return *a == b; }
48 enum Quantity { pT=0, pt=0, Et=1, et=1, E=2, energy=2,
49 mass, rap, absrap, eta, abseta, phi,
50 pid,
abspid, charge, abscharge, charge3, abscharge3, pz };
55 extern const Cut& OPEN;
56 extern const Cut& NOCUT;
60 Cut range(
Quantity,
double m,
double n);
61 inline Cut ptIn(
double m,
double n) {
return range(pT, m,n); }
62 inline Cut etIn(
double m,
double n) {
return range(Et, m,n); }
63 inline Cut energyIn(
double m,
double n) {
return range(energy, m,n); }
64 inline Cut massIn(
double m,
double n) {
return range(mass, m,n); }
65 inline Cut rapIn(
double m,
double n) {
return range(rap, m,n); }
66 inline Cut absrapIn(
double m,
double n) {
return range(absrap, m,n); }
67 inline Cut etaIn(
double m,
double n) {
return range(eta, m,n); }
68 inline Cut absetaIn(
double m,
double n) {
return range(abseta, m,n); }
86 inline Cut operator != (
Cuts::Quantity qty,
int i) {
return qty != double(i); }
89 inline Cut operator < (
Cuts::Quantity qty,
int i) {
return qty < double(i); }
90 inline Cut operator > (
Cuts::Quantity qty,
int i) {
return qty > double(i); }
91 inline Cut operator <= (
Cuts::Quantity qty,
int i) {
return qty <= double(i); }
92 inline Cut operator >= (
Cuts::Quantity qty,
int i) {
return qty >= double(i); }
103 Cut
operator && (
const Cut & aptr,
const Cut & bptr);
106 Cut
operator || (
const Cut & aptr,
const Cut & bptr);
111 Cut
operator & (
const Cut & aptr,
const Cut & bptr);
113 Cut
operator | (
const Cut & aptr,
const Cut & bptr);
117 Cut
operator ^ (
const Cut & aptr,
const Cut & bptr);
123 inline std::ostream&
operator << (std::ostream& os,
const Cut& cptr) {
124 os << cptr->toString();
Definition: MC_Cent_pPb.hh:10
Cut operator&(const Cut &aptr, const Cut &bptr)
Logical AND operation on two cuts.
Cut operator~(const Cut &cptr)
Logical NOT operation on a cut.
Cut operator!(const Cut &cptr)
Logical NOT operation on a cut.
Cut operator^(const Cut &aptr, const Cut &bptr)
Logical XOR operation on two cuts.
const Cut & open()
Fully open cut singleton, accepts everything.
int pid(const Particle &p)
Unbound function access to PID code.
Definition: ParticleUtils.hh:23
bool operator==(const Cut &a, const Cut &b)
Compare two cuts for equality, forwards to the cut-specific implementation.
Definition: Cuts.hh:41
Cut operator||(const Cut &aptr, const Cut &bptr)
Cut operator&&(const Cut &aptr, const Cut &bptr)
int abspid(const Particle &p)
Unbound function access to abs PID code.
Definition: ParticleUtils.hh:26
Quantity
Available categories of cut objects.
Definition: Cuts.hh:48
std::string toString(const AnalysisInfo &ai)
String representation.
std::ostream & operator<<(std::ostream &os, const AnalysisInfo &ai)
Stream an AnalysisInfo as a text description.
Definition: AnalysisInfo.hh:348
Cut operator|(const Cut &aptr, const Cut &bptr)
Logical OR operation on two cuts.