Jpp  17.3.0-rc.1
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | List of all members
JTRIGGER::JBuildL1< JHit_t > Class Template Reference

Template L1 hit builder. More...

#include <JBuildL1.hh>

Inheritance diagram for JTRIGGER::JBuildL1< JHit_t >:
JTRIGGER::JBuildL1Parameters JTRIGGER::JBuildHelper< JBuildL1< JHit_t > > JTRIGGER::JBuild< JHit_t > JTRIGGER::JHitToolkit< JHit_t > JTRIGGER::JBuildL2< JHit_t >

Public Types

typedef JHit_t value_type
 
typedef JMatch< value_typematch_type
 
typedef JDAQHitSelector selector_type
 

Public Member Functions

 JBuildL1 (const JBuildL1Parameters &parameters)
 Constructor. More...
 
template<class JOutput_t >
void operator() (const JSuperFrame2D< JHit_t > &input, JOutput_t out) const
 Build hits from calibrated data. More...
 
template<class JOutput_t >
void operator() (typename JSuperFrame2D< JHit_t >::const_iterator __begin, typename JSuperFrame2D< JHit_t >::const_iterator __end, JOutput_t out) const
 Build hits from set of frames with calibrated data. More...
 
template<class JOutput_t >
void operator() (const JSuperFrame1D< JHit_t > &input, JOutput_t out) const
 Build hits from calibrated data. More...
 
template<class JOutput_t >
void operator() (const JDAQSuperFrame &input, const JModule &module, JOutput_t out) const
 Build hits from DAQ data. More...
 
void operator() (const JDAQTimeslice &timeslice, const JModuleRouter &router, JOutput_t out) const
 Build hits from uncalibrated DAQ data. More...
 
void operator() (const JDAQEvent &event, const JModuleRouter &router, const bool snapshot, JOutput_t out) const
 Build hits from uncalibrated DAQ data. More...
 
void operator() (const JDAQEvent &event, const JModuleRouter &router, JOutput_t out) const
 Build hits from uncalibrated DAQ data. More...
 
void setPreprocessor (const JPreprocessor::JOption_t option, const match_type &match)
 Set pre-processor of consecutive hits. More...
 
void resetPreprocessor ()
 Reset pre-processor of consecutive hits. More...
 
void setDAQHitSelector (const JDAQHitSelector &selector)
 Set DAQ hit selector. More...
 
void resetDAQHitSelector ()
 Reset DAQ hit selector. More...
 
JSuperFrame2D< JHit_t > & demultiplex (const JDAQSuperFrame &input, const JModule &module) const
 Demultiplex and pre-process DAQ super frame. More...
 

Public Attributes

double TMax_ns
 
bool combine
 
JPreprocessor::JOption_t option
 pre-processor option More...
 
JLANG::JSharedPointer< match_typematch
 pre-processor match criterion More...
 
JLANG::JSharedPointer
< selector_type
selector
 DAQ hit selector. More...
 

Detailed Description

template<class JHit_t>
class JTRIGGER::JBuildL1< JHit_t >

Template L1 hit builder.

An L1 hit is a local coincidence between two hits within the same optical module.

Definition at line 85 of file JBuildL1.hh.

Member Typedef Documentation

template<class JHit_t>
typedef JHit_t JTRIGGER::JBuildL1< JHit_t >::value_type

Definition at line 95 of file JBuildL1.hh.

template<class JHit_t>
typedef JMatch<value_type> JTRIGGER::JBuild< JHit_t >::match_type
inherited

Definition at line 39 of file JBuild.hh.

template<class JHit_t>
typedef JDAQHitSelector JTRIGGER::JBuild< JHit_t >::selector_type
inherited

Definition at line 40 of file JBuild.hh.

Constructor & Destructor Documentation

template<class JHit_t>
JTRIGGER::JBuildL1< JHit_t >::JBuildL1 ( const JBuildL1Parameters parameters)
inline

Constructor.

Parameters
parametersbuild L1 parameters

Definition at line 103 of file JBuildL1.hh.

103  :
104  JBuildL1Parameters(parameters)
105  {}
JBuildL1Parameters(const double Tmax_ns, const bool combine)
Constructor.
Definition: JBuildL1.hh:45

Member Function Documentation

template<class JHit_t>
template<class JOutput_t >
void JTRIGGER::JBuildL1< JHit_t >::operator() ( const JSuperFrame2D< JHit_t > &  input,
JOutput_t  out 
) const
inline

Build hits from calibrated data.

The output data are time sorted.

Parameters
inputinput L0 data
outoutput L1 data

Definition at line 117 of file JBuildL1.hh.

118  {
119  (*this)(input.begin(), input.end(), out);
120  }
template<class JHit_t>
template<class JOutput_t >
void JTRIGGER::JBuildL1< JHit_t >::operator() ( typename JSuperFrame2D< JHit_t >::const_iterator  __begin,
typename JSuperFrame2D< JHit_t >::const_iterator  __end,
JOutput_t  out 
) const
inline

Build hits from set of frames with calibrated data.

The output data are time sorted.

Parameters
__beginbegin of input L0 data
__endend of input L0 data
outoutput L1 data

Definition at line 133 of file JBuildL1.hh.

136  {
137  (*this)(JSuperFrame1D<JHit_t>::multiplex(__begin, __end), out);
138  }
static JSuperFrame1D< JElement_t, JAllocator_t > multiplex
Multiplexer.
template<class JHit_t>
template<class JOutput_t >
void JTRIGGER::JBuildL1< JHit_t >::operator() ( const JSuperFrame1D< JHit_t > &  input,
JOutput_t  out 
) const
inline

Build hits from calibrated data.

The output data are time sorted.

Parameters
inputinput L0 data
outoutput L1 data

Definition at line 150 of file JBuildL1.hh.

151  {
152  int n = input.size();
153 
154  for (typename JSuperFrame1D<JHit_t>::const_iterator q = input.begin(), p = q++; n != 0; ++q, --n) {
155 
156  if (this->getTimeDifference(*p,*q) <= TMax_ns) {
157 
158  *out = *p;
159  ++out;
160 
161  if (combine) {
162  for (++q, --n; this->getTimeDifference(*p,*q) <= TMax_ns; ++q, --n) {}
163  }
164  }
165 
166  p = q;
167  }
168  }
1-dimensional frame with time calibrated data from one optical module.
const int n
Definition: JPolint.hh:697
double getTimeDifference(const JDAQChronometer &first, const JDAQChronometer &second)
Get time difference between two chronometers.
template<class JHit_t>
template<class JOutput_t >
void JTRIGGER::JBuildL1< JHit_t >::operator() ( const JDAQSuperFrame input,
const JModule module,
JOutput_t  out 
) const
inline

Build hits from DAQ data.

The time calibration is applied. The output data are time sorted.

Parameters
inputDAQ super frame
modulemodule
outoutput L1 data

Definition at line 182 of file JBuildL1.hh.

185  {
186  if (!input.empty()) {
187  (*this)(this->demultiplex(input, module), out);
188  }
189  }
bool empty() const
Definition: JDAQFrame.hh:180
JSuperFrame2D< JHit_t > & demultiplex(const JDAQSuperFrame &input, const JModule &module) const
Demultiplex and pre-process DAQ super frame.
Definition: JBuild.hh:103
void JTRIGGER::JBuildHelper< JBuildL1< JHit_t > >::operator() ( const JDAQTimeslice timeslice,
const JModuleRouter router,
JOutput_t  out 
) const
inlineinherited

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  }
const JModule & getModule(const JObjectID &id) const
Get module parameters.
bool hasModule(const JObjectID &id) const
Has module.
void JTRIGGER::JBuildHelper< JBuildL1< JHit_t > >::operator() ( const JDAQEvent event,
const JModuleRouter router,
const bool  snapshot,
JOutput_t  out 
) const
inlineinherited

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  }
Data time slice.
void JTRIGGER::JBuildHelper< JBuildL1< JHit_t > >::operator() ( const JDAQEvent event,
const JModuleRouter router,
JOutput_t  out 
) const
inlineinherited

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  }
Data time slice.
template<class JHit_t>
void JTRIGGER::JBuild< JHit_t >::setPreprocessor ( const JPreprocessor::JOption_t  option,
const match_type match 
)
inlineinherited

Set pre-processor of consecutive hits.

Parameters
optionoption
matchmatch criterion

Definition at line 59 of file JBuild.hh.

60  {
61  this->option = option;
62  this->match.reset(match.clone());
63  }
JPreprocessor::JOption_t option
pre-processor option
Definition: JBuild.hh:115
JLANG::JSharedPointer< match_type > match
pre-processor match criterion
Definition: JBuild.hh:116
virtual void reset() override
Reset pointer.
template<class JHit_t>
void JTRIGGER::JBuild< JHit_t >::resetPreprocessor ( )
inlineinherited

Reset pre-processor of consecutive hits.

Definition at line 69 of file JBuild.hh.

70  {
72  this->match.reset();
73  }
JPreprocessor::JOption_t option
pre-processor option
Definition: JBuild.hh:115
JLANG::JSharedPointer< match_type > match
pre-processor match criterion
Definition: JBuild.hh:116
virtual void reset() override
Reset pointer.
template<class JHit_t>
void JTRIGGER::JBuild< JHit_t >::setDAQHitSelector ( const JDAQHitSelector selector)
inlineinherited

Set DAQ hit selector.

Parameters
selectorDAQ hit selector

Definition at line 81 of file JBuild.hh.

82  {
83  this->selector.reset(selector.clone());
84  }
virtual clone_type clone() const override
Get clone of this object.
Definition: JClonable.hh:69
template<class JHit_t>
void JTRIGGER::JBuild< JHit_t >::resetDAQHitSelector ( )
inlineinherited

Reset DAQ hit selector.

Definition at line 90 of file JBuild.hh.

91  {
92  this->selector.reset(new JDAQHitDefaultSelector());
93  }
JLANG::JSharedPointer< selector_type > selector
DAQ hit selector.
Definition: JBuild.hh:117
Default class to select DAQ hits.
template<class JHit_t>
JSuperFrame2D<JHit_t>& JTRIGGER::JBuild< JHit_t >::demultiplex ( const JDAQSuperFrame input,
const JModule module 
) const
inlineinherited

Demultiplex and pre-process DAQ super frame.

Parameters
inputDAQ super frame
modulemodule data
Returns
2D super frame

Definition at line 103 of file JBuild.hh.

105  {
107 
108  if (match.is_valid()) {
109  buffer.preprocess(option, *match);
110  }
111 
112  return buffer;
113  }
JPreprocessor::JOption_t option
pre-processor option
Definition: JBuild.hh:115
JLANG::JSharedPointer< selector_type > selector
DAQ hit selector.
Definition: JBuild.hh:117
JLANG::JSharedPointer< match_type > match
pre-processor match criterion
Definition: JBuild.hh:116
bool is_valid() const
Check validity of pointer.
void preprocess(JPreprocessor::JOption_t option, const match_type &match)
Pre-process data.
static JSuperFrame2D< JElement_t, JAllocator_t > demultiplex
Demultiplexer.
2-dimensional frame with time calibrated data from one optical module.

Member Data Documentation

double JTRIGGER::JBuildL1Parameters::TMax_ns
inherited

Definition at line 74 of file JBuildL1.hh.

bool JTRIGGER::JBuildL1Parameters::combine
inherited

Definition at line 75 of file JBuildL1.hh.

template<class JHit_t>
JPreprocessor::JOption_t JTRIGGER::JBuild< JHit_t >::option
inherited

pre-processor option

Definition at line 115 of file JBuild.hh.

template<class JHit_t>
JLANG::JSharedPointer<match_type> JTRIGGER::JBuild< JHit_t >::match
inherited

pre-processor match criterion

Definition at line 116 of file JBuild.hh.

template<class JHit_t>
JLANG::JSharedPointer<selector_type> JTRIGGER::JBuild< JHit_t >::selector
inherited

DAQ hit selector.

Definition at line 117 of file JBuild.hh.


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