GGS(GenericGEANT4Simulation)Software  2.6.3
 All Data Structures Namespaces Files Functions Variables Typedefs Macros
Macros
GGSMCPluginMacros.h File Reference
#include "montecarlo/scoring/manager/GGSScoringManager.h"
#include "montecarlo/scoring/manager/GGSScoringManagerMessenger.h"
#include "G4UImessenger.hh"
#include "G4UIcommand.hh"
#include "montecarlo/useractions/manager/GGSUserActionsManager.h"
#include "montecarlo/generators/manager/GGSGeneratorActionsManager.h"
Include dependency graph for GGSMCPluginMacros.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define PhysicsListPlugin(plClass)
 Macro for automatic definition of physics list builder function. More...
 
#define RegisterSD(sdClassName)
 Macro for registration of sensitive detector classes. More...
 
#define RegisterUA(uaClassName)
 Macro for registration of user actions classes. More...
 
#define RegisterGA(gaClassName, gaName)
 Macro for registration of user generator actions. More...
 

Detailed Description

Useful macros for MC plugin creation.

Definition in file GGSMCPluginMacros.h.

Macro Definition Documentation

#define PhysicsListPlugin (   plClass)
Value:
extern "C" G4VUserPhysicsList* PhysicsListBuilder() { \
return new plClass(); \
} \
extern "C" void PhysicsListDestroyer(plClass* p) { \
delete p; \
}

Macro for automatic definition of physics list builder function.

Definition at line 14 of file GGSMCPluginMacros.h.

#define RegisterGA (   gaClassName,
  gaName 
)
Value:
G4VUserPrimaryGeneratorAction* gaClassName##Builder(){ \
return new gaClassName(); \
}\
class gaClassName##Proxy { \
public: \
gaClassName##Proxy(){ \
GGSGeneratorActionsManager::GetInstance().RegisterGABuilder(#gaName, gaClassName##Builder); \
} \
}; \
gaClassName##Proxy proxyFor##gaClassName##Builder

Macro for registration of user generator actions.

Definition at line 71 of file GGSMCPluginMacros.h.

#define RegisterSD (   sdClassName)
Value:
G4VSensitiveDetector* sdClassName##Builder(G4String name){ \
return new sdClassName(name); \
}\
void sdClassName##Destroyer(sdClassName *p){ \
delete p; \
}\
class sdClassName##Proxy { \
public: \
sdClassName##Proxy(){ \
GGSScoringManager::GetInstance().RegisterSDClass(#sdClassName, sdClassName##Builder); \
} \
};\
sdClassName##Proxy proxyFor##sdClassName
static GGSScoringManager & GetInstance()
Singleton getter.
void RegisterSDClass(const G4String &className, G4VSensitiveDetector *(*sdBuilder)(G4String))
Class registration method (class factory approach).
GGSScoringManagerMessenger * GetMessenger()
Getter for messenger.
void CreateAddCommand(const G4String &sdClassName)
Creates the command to add the specified sensitive detector class to logical volumes.

Macro for registration of sensitive detector classes.

Definition at line 26 of file GGSMCPluginMacros.h.

#define RegisterUA (   uaClassName)
Value:
class uaClassName##Builder: public G4UImessenger { \
public: \
uaClassName##Builder(){ \
_buildCmd = new G4UIcommand("/GGS/userActions/add" #uaClassName, this); \
_buildCmd->SetGuidance("Adds the uaClassName action"); \
_buildCmd->AvailableForStates(G4State_PreInit, G4State_Idle); \
} \
~uaClassName##Builder(){ \
delete _buildCmd; \
} \
void SetNewValue(G4UIcommand* command, G4String){ \
if (command == _buildCmd) { \
} \
} \
private: \
G4UIcommand* _buildCmd; \
}; \
uaClassName##Builder proxyFor##uaClassName##Builder
void AddAction(GGSUserAction *userAction)
Adds a general user action.
static GGSUserActionsManager * GetInstance()
Get the singleton instance.

Macro for registration of user actions classes.

Definition at line 47 of file GGSMCPluginMacros.h.