List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Private Member Functions | Private Attributes
MyPyModuleNS::MyPyModule Class Reference

Basic example module to call a Python script. More...

#include <MyPyModule.h>

Inheritance diagram for MyPyModuleNS::MyPyModule:
Inheritance graph
[legend]

Public Types

enum  ResultFlag { eSuccess, eFailure, eBreakLoop, eContinueLoop }
 Flag returned by module methods to the RunController. More...
 
enum  VersionInfoType {
  eFilename = 1, eRevisionNumber = 2, eDate = 3, eTime = 4,
  eLastEditor = 5
}
 Different types of version info that can be retrieved from GetVersionInfo. More...
 

Public Member Functions

fwk::VModule::ResultFlag Finish () override
 Finish: invoked at end of the run (NOT end of the event) More...
 
utl::StopwatchGetStopwatch ()
 
const utl::StopwatchGetStopwatch () const
 
std::string GetVersionInfo (const VersionInfoType v) const
 Retrieve different sorts of module version info. More...
 
fwk::VModule::ResultFlag Init () override
 Initialize: invoked at beginning of run (NOT beginning of event) More...
 
void InitTiming ()
 
fwk::VModule::ResultFlag Run (evt::Event &event) override
 Run: invoked once per event. More...
 
ResultFlag RunWithTiming (evt::Event &event)
 

Static Public Member Functions

static std::string GetResultFlagByName (const ResultFlag flag)
 

Protected Types

enum  InfoLevel { eInfoNone = 0, eInfoFinal = 1, eInfoIntermediate = 2, eInfoDebug = 3 }
 

Private Member Functions

 REGISTER_MODULE ("MyPyModule", MyPyModule)
 

Private Attributes

std::string fFilename
 
int fInfoLevel = 0
 
pybind11::object fMainClass
 
pybind11::module_ fModule
 

Detailed Description

Basic example module to call a Python script.

Author
Steffen Hahn
Date
20 Sep 2021

Definition at line 27 of file MyPyModule.h.

Member Enumeration Documentation

enum fwk::VModule::InfoLevel
protectedinherited
Enumerator
eInfoNone 
eInfoFinal 
eInfoIntermediate 
eInfoDebug 

Definition at line 125 of file VModule.h.

enum fwk::VModule::ResultFlag
inherited

Flag returned by module methods to the RunController.

Enumerator
eSuccess 

Report success to RunController.

eFailure 

Report failure to RunController, causing RunController to terminate execution.

eBreakLoop 

Break current loop. It works for nested loops too!

eContinueLoop 

Skip remaining modules in the current loop and continue with next iteration of the loop.

Definition at line 60 of file VModule.h.

Different types of version info that can be retrieved from GetVersionInfo.

Enumerator
eFilename 
eRevisionNumber 
eDate 
eTime 
eLastEditor 

Definition at line 110 of file VModule.h.

Member Function Documentation

VModule::ResultFlag MyPyModuleNS::MyPyModule::Finish ( )
overridevirtual

Finish: invoked at end of the run (NOT end of the event)

This method is for things that should be done at the end of the run (for example, closing files or writing out histograms) {You must override this method in your concrete module}

Implements fwk::VModule.

Definition at line 71 of file MyPyModule.cc.

References io::eSuccess, and INFO.

std::string fwk::VModule::GetResultFlagByName ( const ResultFlag  flag)
staticinherited
utl::Stopwatch& fwk::VModule::GetStopwatch ( )
inlineinherited

Definition at line 106 of file VModule.h.

References fwk::VModule::fStopwatch.

const utl::Stopwatch& fwk::VModule::GetStopwatch ( ) const
inlineinherited

Definition at line 107 of file VModule.h.

References fwk::VModule::fStopwatch.

std::string fwk::VModule::GetVersionInfo ( const VersionInfoType  v) const
inherited
VModule::ResultFlag MyPyModuleNS::MyPyModule::Init ( )
overridevirtual

Initialize: invoked at beginning of run (NOT beginning of event)

This method is for things that should be done once at the beginning of a run (for example, booking histograms, performing calculations that need to be done only once, initializing parameters) {You must override this method in your concrete module}

Implements fwk::VModule.

Definition at line 25 of file MyPyModule.cc.

References io::eSuccess, utl::Branch::GetChild(), utl::Branch::GetData(), fwk::CentralConfig::GetTopBranch(), and INFO.

void fwk::VModule::InitTiming ( )
inlineinherited

Definition at line 95 of file VModule.h.

References fwk::VModule::fStopwatch, and utl::Stopwatch::Reset().

MyPyModuleNS::MyPyModule::REGISTER_MODULE ( "MyPyModule"  ,
MyPyModule   
)
private
VModule::ResultFlag MyPyModuleNS::MyPyModule::Run ( evt::Event event)
overridevirtual

Run: invoked once per event.

This method is for things that should be done once per event {You must override this method in your concrete module}

Implements fwk::VModule.

Definition at line 47 of file MyPyModule.cc.

References io::eSuccess, utl::m2, and result.

ResultFlag fwk::VModule::RunWithTiming ( evt::Event event)
inlineinherited

Member Data Documentation

std::string MyPyModuleNS::MyPyModule::fFilename
private

Definition at line 37 of file MyPyModule.h.

int MyPyModuleNS::MyPyModule::fInfoLevel = 0
private

Definition at line 36 of file MyPyModule.h.

pybind11::object MyPyModuleNS::MyPyModule::fMainClass
private

Definition at line 40 of file MyPyModule.h.

pybind11::module_ MyPyModuleNS::MyPyModule::fModule
private

Definition at line 39 of file MyPyModule.h.


The documentation for this class was generated from the following files:

, generated on Tue Sep 26 2023.