MarlinMT  0.1.0
marlinmt::ProcessorApi Class Reference

#include <ProcessorApi.h>

Classes

class  Book
 group function for booking More...
 

Public Member Functions

 ProcessorApi ()=delete
 
 ~ProcessorApi ()=delete
 

Static Public Member Functions

static void registerForRandomSeeds (Processor *const proc)
 Register the processor to get random seeds. More...
 
static unsigned int getRandomSeed (const Processor *const proc, EventStore *event)
 Get a random seed from the event. More...
 
static void setReturnValue (const Processor *const proc, EventStore *event, bool value)
 Set the processor return value. More...
 
static void setReturnValue (const Processor *const proc, EventStore *event, const std::string &name, bool value)
 Set the named processor return value. More...
 
static bool isFirstEvent (EventStore *event)
 Whether the event is the first event to be processed. More...
 
template<typename HANDLER >
static const HANDLER * geometry (const Processor *const proc)
 Get the geometry handle as a given type. More...
 
static void skipCurrentEvent (const Processor *const proc)
 Notify the application to skip the current event processing and go directly to the next event by skipping next processors in the sequence. More...
 
static void abort (const Processor *const proc, const std::string &reason)
 Abort program execution properly. More...
 

Detailed Description

Definition at line 34 of file ProcessorApi.h.

Constructor & Destructor Documentation

◆ ProcessorApi()

marlinmt::ProcessorApi::ProcessorApi ( )
delete

◆ ~ProcessorApi()

marlinmt::ProcessorApi::~ProcessorApi ( )
delete

Member Function Documentation

◆ abort()

void marlinmt::ProcessorApi::abort ( const Processor *const  proc,
const std::string &  reason 
)
static

Abort program execution properly.

Parameters
procthe processor initiating the abort call
reasonthe reason why the processor aborts the program

Definition at line 366 of file ProcessorApi.cc.

References marlinmt::Component::log(), and MARLINMT_STOP_PROCESSING.

Referenced by marlinmt::LCIOOutputProcessor::processEvent().

◆ geometry()

template<typename HANDLER >
const HANDLER * marlinmt::ProcessorApi::geometry ( const Processor *const  proc)
inlinestatic

Get the geometry handle as a given type.

Parameters
procthe processor accessing the geometry

Definition at line 463 of file ProcessorApi.h.

References marlinmt::Component::application(), marlinmt::GeometryManager::geometry(), and marlinmt::Application::geometryManager().

◆ getRandomSeed()

unsigned int marlinmt::ProcessorApi::getRandomSeed ( const Processor *const  proc,
EventStore event 
)
static

Get a random seed from the event.

Your processor must have been registered beforehand using registerForRandomSeeds()

Parameters
procthe processor instance
eventthe current event from which to get random seeds

Definition at line 323 of file ProcessorApi.cc.

References MARLINMT_THROW.

Referenced by marlinmt::CPUCrunchingProcessor::processEvent().

◆ isFirstEvent()

bool marlinmt::ProcessorApi::isFirstEvent ( EventStore event)
static

Whether the event is the first event to be processed.

WARNING! Use this method with caution in multi-threading mode. The first event is the first that has been pushed in the scheduler queue, maybe not the first one received in Processor::processEvent(). Don't rely on this method to initialize data on first event, but rather use the init() method for that purpose.

Parameters
eventthe event to test

Definition at line 353 of file ProcessorApi.cc.

Referenced by marlinmt::TestProcessor::processEvent().

◆ registerForRandomSeeds()

void marlinmt::ProcessorApi::registerForRandomSeeds ( Processor *const  proc)
static

Register the processor to get random seeds.

Parameters
procthe processor to register

Definition at line 317 of file ProcessorApi.cc.

References marlinmt::RandomSeedManager::addEntry(), marlinmt::Component::application(), and marlinmt::Application::randomSeedManager().

Referenced by marlinmt::CPUCrunchingProcessor::init().

◆ setReturnValue() [1/2]

void marlinmt::ProcessorApi::setReturnValue ( const Processor *const  proc,
EventStore event,
bool  value 
)
static

Set the processor return value.

Parameters
procthe processor instance
eventthe event to which the condition is attached
valuethe processor return value

Definition at line 333 of file ProcessorApi.cc.

References MARLINMT_THROW.

Referenced by marlinmt::EventSelectorProcessor::processEvent(), and marlinmt::TestProcessor::processEvent().

◆ setReturnValue() [2/2]

void marlinmt::ProcessorApi::setReturnValue ( const Processor *const  proc,
EventStore event,
const std::string &  name,
bool  value 
)
static

Set the named processor return value.

Parameters
procthe processor instance
eventthe event to which the condition is attached
namethe name of the return value
valuethe processor return value

Definition at line 343 of file ProcessorApi.cc.

References MARLINMT_THROW.

◆ skipCurrentEvent()

void marlinmt::ProcessorApi::skipCurrentEvent ( const Processor *const  proc)
static

Notify the application to skip the current event processing and go directly to the next event by skipping next processors in the sequence.

Parameters
procthe processor instance initiating the call

Definition at line 359 of file ProcessorApi.cc.

References marlinmt::Component::log(), and MARLINMT_SKIP_EVENT.


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