Jpp 19.3.0-rc.3
the software that should make you happy
Loading...
Searching...
No Matches
JTRIGGER::JBuildHelper< JBuild_t > Struct Template Reference

Auxiliary class to extend hit building functionality to all DAQ data types. More...

#include <JBuildHelper.hh>

Public Member Functions

template<class JOutput_t >
void operator() (const JDAQTimeslice &timeslice, const JModuleRouter &router, JOutput_t out) const
 Build hits from uncalibrated DAQ data.
 
template<class JOutput_t >
void operator() (const JDAQEvent &event, const JModuleRouter &router, const bool snapshot, JOutput_t out) const
 Build hits from uncalibrated DAQ data.
 
template<class JOutput_t >
void operator() (const JDAQEvent &event, const JModuleRouter &router, JOutput_t out) const
 Build hits from uncalibrated DAQ data.
 

Detailed Description

template<class JBuild_t>
struct JTRIGGER::JBuildHelper< JBuild_t >

Auxiliary class to extend hit building functionality to all DAQ data types.


The implementation of this functionality is based on a static cast of the given template parameter (known as "curiously recurring template pattern").
The template parameter should refer to a class which provides for an implementation of the following operator:

     template<class JOutput_t>
     void operator()(const JDAQSuperFrame& super_frame,
                     const JModule&        module,
                     JOutput_t             out) const

where out refers to an STL compatible output iterator.
The data type of the JBuild_t class corresponds to the pointed-to element of the output iterator.

Definition at line 44 of file JBuildHelper.hh.

Member Function Documentation

◆ operator()() [1/3]

template<class JBuild_t >
template<class JOutput_t >
void JTRIGGER::JBuildHelper< JBuild_t >::operator() ( const JDAQTimeslice & timeslice,
const JModuleRouter & router,
JOutput_t out ) const
inline

Build hits from uncalibrated DAQ data.

The time calibration is applied. Note that the output data are not time sorted.

Parameters
timesliceDAQ time slice
routermodule router
outoutput data

Definition at line 57 of file JBuildHelper.hh.

60 {
61 for (JDAQTimeslice::const_iterator i = timeslice.begin(); i != timeslice.end(); ++i) {
62 if (router.hasModule(i->getModuleID())) {
63 static_cast<const JBuild_t&>(*this)(*i, router.getModule(i->getModuleID()), out);
64 }
65 }
66 }
bool hasModule(const JObjectID &id) const
Has module.
const JModule & getModule(const JObjectID &id) const
Get module parameters.

◆ operator()() [2/3]

template<class JBuild_t >
template<class JOutput_t >
void JTRIGGER::JBuildHelper< JBuild_t >::operator() ( const JDAQEvent & event,
const JModuleRouter & router,
const bool snapshot,
JOutput_t out ) const
inline

Build hits from uncalibrated DAQ data.

The time calibration is applied. Note that the output data are not time sorted.

Parameters
eventDAQ event
routermodule router
snapshotuse shapshot hits (else use triggered hits)
outoutput data

Definition at line 81 of file JBuildHelper.hh.

85 {
86 static_cast<const JBuild_t&>(*this)(JDAQTimeslice(event, snapshot), router, out);
87 }

◆ operator()() [3/3]

template<class JBuild_t >
template<class JOutput_t >
void JTRIGGER::JBuildHelper< JBuild_t >::operator() ( const JDAQEvent & event,
const JModuleRouter & router,
JOutput_t out ) const
inline

Build hits from uncalibrated DAQ data.

The snapshot data of the DAQ event are used. The time calibration is applied. Note that the output data are not time sorted.

Parameters
eventDAQ event
routermodule router
outoutput data

Definition at line 102 of file JBuildHelper.hh.

105 {
106 static_cast<const JBuild_t&>(*this)(JDAQTimeslice(event, true), router, out);
107 }

The documentation for this struct was generated from the following file: