EvtKinFactory.h File Reference

#include "TObject.h"
#include <string>
#include <map>

Go to the source code of this file.

Classes

class  EvtKinFactory
 Create FluxGenerator and InteractionGenerator objects. More...

Defines

#define REGISTERFLUX(CLASS)
#define REGISTERFLAVOR(CLASS)
#define REGISTERINTERACTION(CLASS)

Define Documentation

#define REGISTERFLAVOR ( CLASS   ) 
Value:
static const string FLAVOR_NAME = "" #CLASS "";          \
 namespace {                                              \
    FlavorModifier* CreateFlavor() { return new CLASS; }  \
    bool registered = EvtKinFactory::Instance().          \
      RegisterFlavor(FLAVOR_NAME, CreateFlavor);          \
}

Definition at line 111 of file EvtKinFactory.h.

#define REGISTERFLUX ( CLASS   ) 
Value:
static const std::string FLUX_NAME = "" #CLASS "";   \
  namespace {                                          \
    FluxGenerator* CreateFlux() { return new CLASS; }  \
    bool registered = EvtKinFactory::Instance().       \
      RegisterFlux(FLUX_NAME, CreateFlux);             \
  }

macro to help register the classes use unamed namespace to make it hidden to everything else

To use, for a flux "MyFlux" that derives from FluxGenerator put the following lines in MyFlux.cxx: include "EventKinematics/EvtKinFactory.h" REGISTERFLUX(MyFlux)

Similarly for an InteractionGenerator.

Definition at line 103 of file EvtKinFactory.h.

#define REGISTERINTERACTION ( CLASS   ) 
Value:
static const std::string INTER_NAME = "" #CLASS "";                \
  namespace {                                                        \
    InteractionGenerator* CreateInteraction() { return new CLASS; }  \
    bool registered = EvtKinFactory::Instance().                     \
      RegisterInteraction(INTER_NAME, CreateInteraction);            \
  }

Definition at line 119 of file EvtKinFactory.h.


Generated on 3 Dec 2018 for loon by  doxygen 1.6.1