FRIBParallelanalysis  1.0
FrameworkforMPIParalleldataanalysisatFRIB
Public Member Functions | List of all members
frib::analysis::CSpecTclWorker Class Reference

#include <SpecTclWorker.h>

Inheritance diagram for frib::analysis::CSpecTclWorker:
Inheritance graph
[legend]
Collaboration diagram for frib::analysis::CSpecTclWorker:
Collaboration graph
[legend]

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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CSpecTclWorker()

frib::analysis::CSpecTclWorker::CSpecTclWorker ( AbstractApplication app)

constructor

  • initialize the index used to assign names to unnamed processors.
  • Create the dummy decoder, analyzer and event to pass into the pipeline elements.

◆ ~CSpecTclWorker()

frib::analysis::CSpecTclWorker::~CSpecTclWorker ( )
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

Member Function Documentation

◆ addProcessor()

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.

Parameters
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.
Returns
std::string - name of the event processor.

◆ getInputFilename()

std::string frib::analysis::CSpecTclWorker::getInputFilename ( int  argc,
char **  argv 
)
virtual

getInputFilename Default implementation - argv[1] is the input filename. If it does not exist, std::invalid_argument is thrown.

Parameters
argc,argv- the command line.
Returns
std::string
Exceptions
std::invalid_argument- see above.

◆ initializeUserCode()

void frib::analysis::CSpecTclWorker::initializeUserCode ( int  argc,
char **  argv,
AbstractApplication app 
)
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.

Parameters
argc,argv- command parameters.
app- application reference.

Reimplemented from frib::analysis::CMPIRawToParametersWorker.

◆ removeEventProcessor() [1/2]

void frib::analysis::CSpecTclWorker::removeEventProcessor ( CEventProcessor pProcessor)

removeEventProcessor Remove an event processor specified by a pointer to it.

Parameters
pProcessor- pointer to the one to remove.
Exceptions
std::logic_error- no such processor.

◆ removeEventProcessor() [2/2]

void frib::analysis::CSpecTclWorker::removeEventProcessor ( const char *  name)

removeEventProcessor Removes an event processor given its name.

Parameters
namename of the event processor.
Exceptions
std::logic_error- no such processor.

◆ unpackData()

void frib::analysis::CSpecTclWorker::unpackData ( const void *  pData)
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.

Parameters
pData- pointer to the ring item.

Implements frib::analysis::CMPIRawToParametersWorker.


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