9 #ifndef ThePEG_ACDCSampler_H
10 #define ThePEG_ACDCSampler_H
13 #include "ThePEG/Handlers/SamplerBase.h"
14 #include "ThePEG/ACDC/ACDCGen.h"
15 #include "ThePEG/Handlers/StandardEventHandler.h"
16 #include "ThePEG/Repository/RandomGenerator.h"
17 #include "ThePEG/Repository/UseRandom.h"
18 #include "ThePEG/Utilities/SimplePhaseSpace.xh"
203 struct ACDCStillCompensating:
public Exception {};
207 struct EventInitNoXSec:
public InitException {};
212 struct EventLoopException:
public Exception {};
240 struct BaseClassTrait<ACDCSampler,1>:
public ClassTraitsType {
250 struct ClassTraits<ACDCSampler>:
public ClassTraitsBase<ACDCSampler> {
254 static string className() {
return "ThePEG::ACDCSampler"; }
259 static string library() {
return "ACDCSampler.so"; }
267 namespace ACDCGenerator {
275 struct ACDCFncTraits<ThePEG::
tStdEHPtr>:
public ACDCTraitsType {
282 static inline double value(
const tStdEHPtr & eh,
const DVector & x) {
283 using namespace ThePEG::Units;
285 return eh->dSigDR(x)/nanobarn;
287 catch ( ThePEG::ImpossibleKinematics & v ) {
290 catch ( std::exception & e ) {
304 struct ACDCRandomTraits<ThePEG::UseRandom>:
public ACDCTraitsType {
311 static inline double rnd(UseRandom *) {
return UseRandom::rnd(); }
316 static inline double rnd(UseRandom * r,
double xl,
double xu) {
317 return xl + (xu - xl)*rnd(r);
331 template <
typename InputIterator,
typename OutputIterator>
332 static inline void rnd(UseRandom * r,
333 InputIterator l, InputIterator lend,
334 InputIterator u, OutputIterator res) {
335 for ( ; l != lend; ++l ) *res++ = *l + (*u++ - *l)*rnd(r);
342 template <
typename OutputIterator>
343 static inline void rnd(UseRandom * r,
int D, OutputIterator res) {
344 for (
int d = 0;
d < D; ++
d ) *res++ = rnd(r);
350 static inline bool rndBool(UseRandom,
double x) {
351 return UseRandom::rndbool(x);
357 static inline bool rndBool(UseRandom *,
double x,
double y) {
358 return UseRandom::rndbool(x, y);
364 static inline long rndInt(UseRandom *,
long x) {
365 return UseRandom::irnd(x);