/usr/include/ThePEG/PDT/StandardMatchers.h is in libthepeg-dev 1.8.0-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 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 | // -*- C++ -*-
//
// StandardMatchers.h is a part of ThePEG - Toolkit for HEP Event Generation
// Copyright (C) 1999-2011 Leif Lonnblad
//
// ThePEG is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
#ifndef ThePEG_StandardMatchers_H
#define ThePEG_StandardMatchers_H
// This is the declaration of the AnyMatcher,
#include "Matcher.h"
#include "ThePEG/PDT/EnumParticles.h"
namespace ThePEG {
/** \file StandardMatchers.h
*
* This file declare a set of standard matcher classes. The
* ChargedMatcher, NegativeMatcher, PositiveMatcher, NeutralMatcher,
* BaryonMatcher, MesonMatcher, DiquarkMatcher, LeptonMatcher,
* LightAntiQuarkMatcher, LightQuarkMatcher and
* StandardQCDPartonMatcher classes can be used by themselves (with
* their static functions) or together with the Matcher class to
* define Interfaced objects of the MatcherBase type to be used in the
* Repository. Suitable typedefs are declared for the latter.
*
* @see Matcher
* @see MatcherBase
*/
/**
* A Matcher class which matches any particle.
*/
struct AnyMatcher: public MatcherType {
/** Typedef the class matching the complex conjugate particles. */
typedef AnyMatcher CC;
/** The main static function to check if a given particle type \a pd
matches. */
static bool Check(const ParticleData & pd) {
return bool(pd.id());
}
/** A simplified but unique class name. */
static string className() { return "Any"; }
};
/** Gives a MatcherBase class based on AnyMatcher. */
typedef Matcher<AnyMatcher> MatchAny;
/**
* A Matcher class which matches any charged particle.
*/
struct ChargedMatcher: public MatcherType {
/** Typedef the class matching the complex conjugate particles. */
typedef ChargedMatcher CC;
/** The main static function to check if a given particle type \a pd
matches. */
static bool Check(const ParticleData & pd) {
return PDT::charged(pd.iCharge());
}
/** A simplified but unique class name. */
static string className() { return "Charged"; }
};
/** Gives a MatcherBase class based on ChargedMatcher. */
typedef Matcher<ChargedMatcher> MatchCharged;
struct NegativeMatcher;
/**
* A Matcher class which matches any positively charged particle.
*/
struct PositiveMatcher: public MatcherType {
/** Typedef the class matching the complex conjugate particles. */
typedef NegativeMatcher CC;
/** The main static function to check if a given particle type \a pd
matches. */
static bool Check(const ParticleData & pd) {
return PDT::positive(pd.iCharge());
}
/** A simplified but unique class name. */
static string className() { return "Positive"; }
};
/** Gives a MatcherBase class based on PositiveMatcher. */
typedef Matcher<PositiveMatcher> MatchPositive;
/**
* A Matcher class which matches any uncharged particle.
*/
struct NeutralMatcher: public MatcherType {
/** Typedef the class matching the complex conjugate particles. */
typedef NeutralMatcher CC;
/** The main static function to check if a given particle type \a pd
matches. */
static bool Check(const ParticleData & pd) {
return pd.iCharge() == PDT::Charge0;
}
/** A simplified but unique class name. */
static string className() { return "Neutral"; }
};
/** Gives a MatcherBase class based on NeutralMatcher. */
typedef Matcher<NeutralMatcher> MatchNeutral;
/**
* A Matcher class which matches any negatively charged particle.
*/
struct NegativeMatcher: public MatcherType {
/** Typedef the class matching the complex conjugate particles. */
typedef PositiveMatcher CC;
/** The main static function to check if a given particle type \a pd
matches. */
static bool Check(const ParticleData & pd) {
return PDT::negative(pd.iCharge());
}
/** A simplified but unique class name. */
static string className() { return "Negative"; }
};
/** Gives a MatcherBase class based on NegativeMatcher. */
typedef Matcher<NegativeMatcher> MatchNegative;
/**
* A Matcher class which matches any baryon.
*/
struct BaryonMatcher: public MatcherType {
/** Typedef the class matching the complex conjugate particles. */
typedef BaryonMatcher CC;
/** The main static function to check if a given particle type \a pd
matches. */
static bool Check(const ParticleData & pd) { return Check(pd.id()); }
/** The main static function to check if a given particle with type
\a id matches. */
static bool Check(long id) {
return (id/10)%10 && (id/100)%10 && (id/1000)%10;
}
/** A simplified but unique class name. */
static string className() { return "Baryon"; }
};
/** Gives a MatcherBase class based on BaryonMatcher. */
typedef Matcher<BaryonMatcher> MatchBaryon;
/**
* A Matcher class which matches any meson.
*/
struct MesonMatcher: public MatcherType {
/** Typedef the class matching the complex conjugate particles. */
typedef MesonMatcher CC;
/** The main static function to check if a given particle type \a pd
matches. */
static bool Check(const ParticleData & pd) { return Check(pd.id()); }
/** The main static function to check if a given particle with type
\a id matches. */
static bool Check(long id) {
return (id/10)%10 && (id/100)%10 && (id/1000)%10 == 0;
}
/** A simplified but unique class name. */
static string className() { return "Meson"; }
};
/** Gives a MatcherBase class based on MesonMatcher. */
typedef Matcher<MesonMatcher> MatchMeson;
/**
* A Matcher class which matches any (anti-)diquark.
*/
struct DiquarkMatcher: public MatcherType {
/** Typedef the class matching the complex conjugate particles. */
typedef DiquarkMatcher CC;
/** The main static function to check if a given particle type \a pd
matches. */
static bool Check(const ParticleData & pd) { return Check(pd.id()); }
/** The main static function to check if a given particle with type
\a id matches. */
static bool Check(long id) {
return id/10 && (id/10)%10 == 0 && (id/100)%10 && (id/1000)%10;
}
/** A simplified but unique class name. */
static string className() { return "Diquark"; }
};
/** Gives a MatcherBase class based on DiquarkMatcher. */
typedef Matcher<DiquarkMatcher> MatchDiquark;
/**
* A Matcher class which matches any (anti-)quark.
*/
struct QuarkMatcher: public MatcherType {
/** Typedef the class matching the complex conjugate particles. */
typedef QuarkMatcher CC;
/** The main static function to check if a given particle type \a pd
matches. */
static bool Check(const ParticleData & pd) { return Check(pd.id()); }
/** The main static function to check if a given particle with type
\a id matches. */
static bool Check(long id) {
return id && abs(id) < 10;
}
/** A simplified but unique class name. */
static string className() { return "Quark"; }
};
/** Gives a MatcherBase class based on QuarkMatcher. */
typedef Matcher<QuarkMatcher> MatchQuark;
/**
* A Matcher class which matches any lepton.
*/
struct LeptonMatcher: public MatcherType {
/** Typedef the class matching the complex conjugate particles. */
typedef LeptonMatcher CC;
/** The main static function to check if a given particle type \a pd
matches. */
static bool Check(const ParticleData & pd) { return Check(pd.id()); }
/** The main static function to check if a given particle with type
\a id matches. */
static bool Check(long id) {
return abs(id) > 10 && abs(id) <= 20;
}
/** A simplified but unique class name. */
static string className() { return "Lepton"; }
};
/** Gives a MatcherBase class based on LeptonMatcher. */
typedef Matcher<LeptonMatcher> MatchLepton;
struct LightAntiQuarkMatcher;
/**
* A Matcher class which matches any light quark (d,u or s).
*/
struct LightQuarkMatcher: public MatcherType {
/** Typedef the class matching the complex conjugate particles. */
typedef LightAntiQuarkMatcher CC;
/** The main static function to check if a given particle type \a pd
matches. */
static bool Check(const ParticleData & pd) { return Check(pd.id()); }
/** The main static function to check if a given particle with type
\a id matches. */
static bool Check(long id) {
return id > 0 && id < 4 ;
}
/** A simplified but unique class name. */
static string className() { return "LightQuark"; }
};
/** Gives a MatcherBase class based on LightQuarkMatcher. */
typedef Matcher<LightQuarkMatcher> MatchLightQuark;
/**
* A Matcher class which matches any light anti-quark
* (\f$\bar{\mbox{d}}\f$,\f$\bar{\mbox{u}}\f$ or
* \f$\bar{\mbox{s}}\f$).
*/
struct LightAntiQuarkMatcher: public MatcherType {
/** Typedef the class matching the complex conjugate particles. */
typedef LightQuarkMatcher CC;
/** The main static function to check if a given particle type \a pd
matches. */
static bool Check(const ParticleData & pd) { return Check(pd.id()); }
/** The main static function to check if a given particle with type
\a id matches. */
static bool Check(long id) {
return id < 0 && id > -4 ;
}
/** A simplified but unique class name. */
static string className() { return "LightAntiQuark"; }
};
/** Gives a MatcherBase class based on LightAntiQuarkMatcher. */
typedef Matcher<LightAntiQuarkMatcher> MatchLightAntiQuark;
/**
* A Matcher class which matches any standard QCD parton, ie. gluons
* and quarks up to bottom.
*/
struct StandardQCDPartonMatcher: public MatcherType {
/** Typedef the class matching the complex conjugate particles. */
typedef StandardQCDPartonMatcher CC;
/** The main static function to check if a given particle type \a pd
matches. */
static bool Check(const ParticleData & pd) { return Check(pd.id()); }
/** The main static function to check if a given particle with type
\a id matches. */
static bool Check(long id) {
return id && ( abs(id) <= 5 || id == ParticleID::g );
}
/** A simplified but unique class name. */
static string className() { return "StandardQCDParton"; }
};
/** Gives a MatcherBase class based on StandardQCDPartonMatcher. */
typedef Matcher<StandardQCDPartonMatcher> MatchStandardQCDParton;
/**
* A Matcher class which matches any pseudo scalar meson.
*/
struct PseudoScalarMesonMatcher: public MatcherType {
/** Typedef the class matching the complex conjugate particles. */
typedef PseudoScalarMesonMatcher CC;
/** The main static function to check if a given particle type \a pd
matches. */
static bool Check(const ParticleData & pd) { return Check(pd.id()); }
/** The main static function to check if a given particle with type
\a id matches. */
static bool Check(long id) {
return ( (abs(id)/1000)%1 == 0 && abs(id) > 100 && abs(id)%10 == 1 ) ||
( id == ParticleID::K_L0 || id == ParticleID::K_S0 );
}
/** A simplified but unique class name. */
static string className() { return "PseudoScalarMeson"; }
};
/** Gives a MatcherBase class based on PseudoScalarMesonMatcher. */
typedef Matcher<PseudoScalarMesonMatcher> MatchPseudoScalarMeson;
/**
* A Matcher class which matches any vector meson.
*/
struct VectorMesonMatcher: public MatcherType {
/** Typedef the class matching the complex conjugate particles. */
typedef VectorMesonMatcher CC;
/** The main static function to check if a given particle type \a pd
matches. */
static bool Check(const ParticleData & pd) { return Check(pd.id()); }
/** The main static function to check if a given particle with type
\a id matches. */
static bool Check(long id) {
return (abs(id)/1000)%1 == 0 && abs(id) > 100 && abs(id)%10 == 3;
}
/** A simplified but unique class name. */
static string className() { return "VectorMeson"; }
};
/** Gives a MatcherBase class based on VectorMesonMatcher. */
typedef Matcher<VectorMesonMatcher> MatchVectorMeson;
}
#endif /* ThePEG_StandardMatchers_H */
|