FRIBParallelanalysis
1.0
FrameworkforMPIParalleldataanalysisatFRIB
|
#include <SpecTclWorker.h>
Public Member Functions | |
CSpecTclWorker (AbstractApplication &app) | |
virtual | ~CSpecTclWorker () |
std::string | addProcessor (CEventProcessor *pProcessor, const char *name=nullptr) |
void | removeEventProcessor (CEventProcessor *pProcessor) |
void | removeEventProcessor (const char *name) |
virtual void | initializeUserCode (int argc, char **argv, AbstractApplication &app) |
virtual void | unpackData (const void *pData) |
virtual std::string | getInputFilename (int argc, char **argv) |
Public Member Functions inherited from frib::analysis::CMPIRawToParametersWorker | |
CMPIRawToParametersWorker (AbstractApplication &App) | |
virtual | ~CMPIRawToParametersWorker () |
virtual void | operator() (int argc, char **argv) |
The generic parallel processing framework supports a worker class that can have its function call operator (operator()) invoked for each ring item in a work block. CSpecTclWorker extends this class to provide an analysis pipeline much like SpecTcl for ported EventProcessors.
The point is to provde the capability to import unpacking/analysis code from SpecTcl easily into this framework drastically speeding up the initial processing of event data.
Note NSCLDAQ 11.x and later are the only formats supported.
frib::analysis::CSpecTclWorker::CSpecTclWorker | ( | AbstractApplication & | app | ) |
constructor
|
virtual |
destructor Note that the event processor ownership is retained by the client so we leave them alone. We do need to delete our props for the SpecTcl objects
std::string frib::analysis::CSpecTclWorker::addProcessor | ( | CEventProcessor * | pProcessor, |
const char * | name = nullptr |
||
) |
addProcessor Append an event processor to the end of the logical event processing pipeline.
pProcessor | - Pointer to the event processor object. This storage remains owned/managed by the caller. |
name | - If the name is nullptr (the default) a new, unique one is generated. |
|
virtual |
getInputFilename Default implementation - argv[1] is the input filename. If it does not exist, std::invalid_argument is thrown.
argc,argv | - the command line. |
std::invalid_argument | - see above. |
|
virtual |
initializeUserCode Use getInputFilename to get the name of the input file and call OnInitialize and OnEventSourceOpen for all elements of the pipeline. If any element returns kfFalse, our abort is even stronger than SpecTcl's throwing a std::runtime_error.
argc,argv | - command parameters. |
app | - application reference. |
Reimplemented from frib::analysis::CMPIRawToParametersWorker.
void frib::analysis::CSpecTclWorker::removeEventProcessor | ( | CEventProcessor * | pProcessor | ) |
removeEventProcessor Remove an event processor specified by a pointer to it.
pProcessor | - pointer to the one to remove. |
std::logic_error | - no such processor. |
void frib::analysis::CSpecTclWorker::removeEventProcessor | ( | const char * | name | ) |
removeEventProcessor Removes an event processor given its name.
name | name of the event processor. |
std::logic_error | - no such processor. |
|
virtual |
unpackData Called for each ring item. Invokes the event processor pipeline element operator()'s. On a failure, the event is reset to empty and processing continues with the next event.
pData | - pointer to the ring item. |
Implements frib::analysis::CMPIRawToParametersWorker.