artdaq_core  v3_04_13
artdaq Namespace Reference

The artdaq namespace. More...

Namespaces

 detail
 artdaq implementation details namespace
 
 TimeUtils
 Namespace to hold useful time-converting functions.
 

Classes

struct  FailIfFull
 ConcurrentQueue policy to throw an exception when the queue is full. More...
 
struct  KeepNewest
 ConcurrentQueue policy to discard oldest elements when the queue is full. More...
 
struct  RejectNewest
 ConcurrentQueue policy to discard new elements when the queue is full. More...
 
class  ConcurrentQueue
 
struct  MonitoredQuantityStats
 struct containing MonitoredQuantity data More...
 
class  MonitoredQuantity
 This class keeps track of statistics for a set of sample values and provides timing information on the samples. More...
 
struct  QuickVec
 A QuickVec behaves like a std::vector, but does no initialization of its data, making it faster at the cost of having to ensure that uninitialized data is not read. More...
 
class  SharedMemoryEventReceiver
 SharedMemoryEventReceiver can receive events (as written by SharedMemoryEventManager) from Shared Memory. More...
 
class  SharedMemoryFragmentManager
 The SharedMemoryFragmentManager is a SharedMemoryManager that deals with Fragment transfers using a SharedMemoryManager. More...
 
class  SharedMemoryManager
 The SharedMemoryManager creates a Shared Memory area which is divided into a number of fixed-size buffers. It provides for multiple readers and multiple writers through a dual semaphore system. More...
 
class  SimpleMemoryReader
 SimpleMemoryReader will continue to read RawEvent objects off the queue until it encounters a null pointer, at which point it stops. More...
 
class  SimpleQueueReader
 SimpleQueueReader will continue to read RawEvent objects off the queue until it encounters a null pointer, at which point it stops. More...
 
class  StatisticsCollection
 A collection of MonitoredQuantity instances describing low-level statistics of the artdaq system. More...
 
class  ContainerFragment
 The artdaq::ContainerFragment class represents a Fragment which contains other Fragments. More...
 
class  ContainerFragmentLoader
 A Read-Write version of the ContainerFragment, used for filling ContainerFragment objects with other Fragment objects. More...
 
class  Fragment
 A Fragment contains the data from one piece of the DAQ system for one event The artdaq::Fragment is the main data storage class in artdaq. Each Fragment represents the data from one piece of the readout, for one artdaq event. BoardReaders create Fragments and send them to the EventBuilders, where they are assembled into artdaq::RawEvent objects. More...
 
class  PackageBuildInfo
 Class holding information about the artdaq package build. More...
 
class  RawEvent
 RawEvent is the artdaq view of a generic event, containing a header and zero or more Fragments. More...
 
class  FragmentGenerator
 Base class for all FragmentGenerators. More...
 
class  SimpleLookupPolicy
 This class is intended to find files using a set lookup order. More...
 

Typedefs

typedef std::shared_ptr< RawEventRawEvent_ptr
 A smart pointer to a RawEvent object. More...
 
typedef
artdaq::ConcurrentQueue
< RawEvent_ptr
RawEventQueue
 A ConcurrentQueue of RawEvent objects.
 
typedef std::shared_ptr
< MonitoredQuantity
MonitoredQuantityPtr
 A shared_ptr to a MonitoredQuantity instance.
 
typedef
detail::RawFragmentHeader::RawDataType 
RawDataType
 The RawDataType (currently a 64-bit integer) is the basic unit of data representation within artdaq More...
 
typedef std::vector< FragmentFragments
 A std::vector of Fragment objects.
 
typedef std::unique_ptr< FragmentFragmentPtr
 A std::unique_ptr to a Fragment object. More...
 
typedef std::list< FragmentPtrFragmentPtrs
 A std::list of FragmentPtrs.
 
typedef std::unique_ptr
< artdaq::FragmentGenerator
makeFunc_t (fhicl::ParameterSet const &ps)
 Constructs a FragmentGenerator instance, and returns a pointer to it. More...
 

Enumerations

enum  ExceptionHandlerRethrow { ExceptionHandlerRethrow::yes, ExceptionHandlerRethrow::no }
 Controls whether the ExceptionHandler will rethrow after printing exception details. More...
 

Functions

RawEventQueuegetGlobalQueue (RawEventQueue::SizeType maxSize=std::numeric_limits< RawEventQueue::SizeType >::max())
 The first thread to call getGlobalQueue() causes the creation of the queue. The queue will be destroyed at static destruction time. More...
 
int SimpleMemoryReaderApp (int argc, char **argv)
 An application which pops items off a RawEventQueue using the SimpleMemoryReader. More...
 
int simpleQueueReaderApp (int argc, char **argv)
 An application which pops items off a RawEventQueue using the SimpleQueueReader. More...
 
bool fragmentSequenceIDCompare (Fragment i, Fragment j)
 Comparator for Fragment objects, based on their sequence_id. More...
 
std::ostream & operator<< (std::ostream &os, Fragment const &f)
 Prints the given Fragment to the stream. More...
 
std::ostream & operator<< (std::ostream &os, RawEvent const &ev)
 Prints the RawEvent to the given stream. More...
 
std::unique_ptr
< FragmentGenerator
makeFragmentGenerator (std::string const &generator_plugin_spec, fhicl::ParameterSet const &ps)
 Instantiates the FragmentGenerator plugin with the given name, using the given ParameterSet. More...
 
std::string generateMessageFacilityConfiguration (char const *progname, bool useConsole=true, bool printDebug=false)
 Create the MessageFacility configuration Fhicl string. More...
 
void configureTRACE (fhicl::ParameterSet &trace_pset)
 Configure TRACE. More...
 
void configureMessageFacility (char const *progname, bool useConsole=true, bool printDebug=false)
 Configure and start the message facility. Provide the program name so that messages will be appropriately tagged. More...
 
std::string setMsgFacAppName (const std::string &appType, unsigned short port)
 Set the message facility application name using the specified application type and port number. More...
 
void ExceptionHandler (ExceptionHandlerRethrow decision, std::string optional_message="")
 The ExceptionHandler class prints out all available information about an excection, then optionally re-throws. More...
 

Detailed Description

The artdaq namespace.

Typedef Documentation

typedef std::unique_ptr<Fragment> artdaq::FragmentPtr

A std::unique_ptr to a Fragment object.

To reduce move or copy operations, most artdaq processing is done using FragmentPtr objects.

Definition at line 53 of file Fragment.hh.

typedef std::unique_ptr<artdaq::FragmentGenerator> artdaq::makeFunc_t(fhicl::ParameterSet const &ps)

Constructs a FragmentGenerator instance, and returns a pointer to it.

Parameters
psParameter set for initializing the FragmentGenerator
Returns
A smart pointer to the FragmentGenerator

Definition at line 17 of file GeneratorMacros.hh.

The RawDataType (currently a 64-bit integer) is the basic unit of data representation within artdaq

The RawDataType (currently a 64-bit integer) is the basic unit of data representation within artdaq Copied from RawFragmentHeader into Fragment

Definition at line 39 of file Fragment.hh.

typedef std::shared_ptr< RawEvent > artdaq::RawEvent_ptr

A smart pointer to a RawEvent object.

A shared_ptr to a RawEvent.

Definition at line 13 of file GlobalQueue.hh.

Enumeration Type Documentation

Controls whether the ExceptionHandler will rethrow after printing exception details.

Enumerator
yes 

Rethrow the exception after sending details to MessageFacility.

no 

Consume the exception and proceed.

Definition at line 11 of file ExceptionHandler.hh.

Function Documentation

void artdaq::configureMessageFacility ( char const *  progname,
bool  useConsole = true,
bool  printDebug = false 
)

Configure and start the message facility. Provide the program name so that messages will be appropriately tagged.

Parameters
prognameThe name of the program
useConsoleShould console output be activated? Default = true
printDebugWhether Debug-level messages should be printed to console. Default = false

Definition at line 257 of file configureMessageFacility.cc.

void artdaq::configureTRACE ( fhicl::ParameterSet &  trace_pset)

Configure TRACE.

Parameters
trace_psetA fhicl::ParameterSet with the contents of the TRACE table

Definition at line 181 of file configureMessageFacility.cc.

void artdaq::ExceptionHandler ( ExceptionHandlerRethrow  decision,
std::string  optional_message = "" 
)

The ExceptionHandler class prints out all available information about an excection, then optionally re-throws.

Parameters
decisionControls whether the ExceptionHandler will rethrow (ExceptionHandlerRethrow::yes) or not (ExceptionHandlerRethow::no)
optional_messageAn optional std::string giving more information about where the exception was originally caught

JCF, 5/28/15

The ExceptionHandler() function is designed to be called within a catch-all block:

try {
// ...Code that might throw an exception...
} catch (...) {
"Optional string providing additional info");
}

Where above, you could switch out artdaq::ExceptionHandlerRethrow::yes with artdaq::ExceptionHandlerRethrow::no, depending on what you wish to do

The details of ExceptionHandler() are as follows:

  • If an optional string is passed to it, use messagefacility to write the string with mf::LogError()
  • Apply a set of different catch-blocks to the original exception, printing out as much information as possible contained within the different exception types (art::Exception, cet::exception, boost::exception and std::exception), again using mf::LogError()
  • If artdaq::ExceptionHandlerRethrow::yes was passed to ExceptionHandler(), re-throw the exception rather than swallow it

Definition at line 13 of file ExceptionHandler.cc.

bool artdaq::fragmentSequenceIDCompare ( Fragment  i,
Fragment  j 
)

Comparator for Fragment objects, based on their sequence_id.

Parameters
iFirst Fragment to compare
jSecond Fragment to comapre
Returns
i.sequenceID() < j.sequenceID()

Definition at line 8 of file Fragment.cc.

std::string artdaq::generateMessageFacilityConfiguration ( char const *  progname,
bool  useConsole = true,
bool  printDebug = false 
)

Create the MessageFacility configuration Fhicl string.

Parameters
prognameThe name of the program
useConsoleShould console output be activated? Default = true
printDebugWhether Debug-level messages should be printed to console. Default = false
Returns
Fhicl string with generated MessageFacility configuration
Exceptions
cet::exceptionif log path or ARTDAQ_LOG_FHICL do not exist

Definition at line 17 of file configureMessageFacility.cc.

RawEventQueue & artdaq::getGlobalQueue ( RawEventQueue::SizeType  maxSize = std::numeric_limits< RawEventQueue::SizeType >::max())

The first thread to call getGlobalQueue() causes the creation of the queue. The queue will be destroyed at static destruction time.

Parameters
maxSizeMaximum number of elements in the queue
Returns
Reference to the global RawEventQueue

Definition at line 10 of file GlobalQueue.cc.

std::unique_ptr< artdaq::FragmentGenerator > artdaq::makeFragmentGenerator ( std::string const &  generator_plugin_spec,
fhicl::ParameterSet const &  ps 
)

Instantiates the FragmentGenerator plugin with the given name, using the given ParameterSet.

Parameters
generator_plugin_specName of the Generator plugin (omit _generator.so)
psThe ParameterSet used to initialize the FragmentGenerator
Returns
A smart pointer to the FragmentGenerator instance

Definition at line 8 of file makeFragmentGenerator.cc.

std::ostream & artdaq::operator<< ( std::ostream &  os,
artdaq::Fragment const &  f 
)
inline

Prints the given Fragment to the stream.

Parameters
osStream to print Fragment to
fFragment to print
Returns
Reference to the stream

Definition at line 1218 of file Fragment.hh.

std::ostream& artdaq::operator<< ( std::ostream &  os,
RawEvent const &  ev 
)
inline

Prints the RawEvent to the given stream.

Parameters
osStream to print RawEvent to
evRawEvent to print
Returns
Stream reference

Definition at line 302 of file RawEvent.hh.

std::string artdaq::setMsgFacAppName ( const std::string &  appType,
unsigned short  port 
)

Set the message facility application name using the specified application type and port number.

Parameters
appTypeApplication name
portXMLRPC port of this application instance
Returns
Name of the application as set for MessageFacility

Definition at line 289 of file configureMessageFacility.cc.

int artdaq::SimpleMemoryReaderApp ( int  argc,
char **  argv 
)

An application which pops items off a RawEventQueue using the SimpleMemoryReader.

Parameters
argcNumber of arguments (OS-provided)
argvArray of argument strings (OS-provided)
Returns
Status code: 0 success, 1 for any error

SimpleMemoryReaderApp is a function that can be used in place of artapp(), to read RawEvent objects from the shared RawEvent queue. Note that it ignores both of its arguments.

Definition at line 12 of file SimpleMemoryReader.cc.

int artdaq::simpleQueueReaderApp ( int  argc,
char **  argv 
)

An application which pops items off a RawEventQueue using the SimpleQueueReader.

Parameters
argcNumber of arguments (OS-provided)
argvArray of argument strings (OS-provided)
Returns
Status code: 0 success, 1 for any error

simpleQueueReaderApp is a function that can be used in place of artapp(), to read RawEvent objects from the shared RawEvent queue. Note that it ignores both of its arguments.

Definition at line 12 of file SimpleQueueReader.cc.