Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JTRIGGER::JBuildL1< JHitL1 > Class Reference

Template specialisation of L1 builder for JHitL1 data type. More...

#include <JBuildL1.hh>

Inheritance diagram for JTRIGGER::JBuildL1< JHitL1 >:
JTRIGGER::JBuildL1< JHit > JTRIGGER::JBuildHelper< JBuildL1< JHitL1 > > JTRIGGER::JBuildL1Parameters JTRIGGER::JBuildHelper< JBuildL1< JHit > > JTRIGGER::JBuild< JHit > JTRIGGER::JHitToolkit< JHit > JMONITOR::JClusterBuilder

Public Types

typedef JHitL1 value_type
 
typedef JMatch< value_typematch_type
 
typedef JDAQHitSelector selector_type
 

Public Member Functions

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

Public Attributes

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

Private Attributes

std::vector< JHitbuffer
 

Detailed Description

Template specialisation of L1 builder for JHitL1 data type.

Definition at line 197 of file JBuildL1.hh.

Member Typedef Documentation

◆ value_type

Definition at line 205 of file JBuildL1.hh.

◆ match_type

JMatch<value_type> JTRIGGER::JBuild< JHit >::match_type
inherited

Definition at line 39 of file JBuild.hh.

◆ selector_type

JDAQHitSelector JTRIGGER::JBuild< JHit >::selector_type
inherited

Definition at line 40 of file JBuild.hh.

Constructor & Destructor Documentation

◆ JBuildL1()

JTRIGGER::JBuildL1< JHitL1 >::JBuildL1 ( const JBuildL1Parameters & parameters)
inline

Constructor.

Parameters
parametersbuild L1 parameters

Definition at line 213 of file JBuildL1.hh.

213 :
214 JBuildL1<JHit>(parameters)
215 {}
Template L1 hit builder.
Definition JBuildL1.hh:90

Member Function Documentation

◆ operator()() [1/10]

template<class JOutput_t >
void JTRIGGER::JBuildL1< JHitL1 >::operator() ( const JSuperFrame2D< JHit > & 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 227 of file JBuildL1.hh.

228 {
229 const JSuperFrameClone2D<JHit> clone(input);
230
231 buffer.clear();
232
233 static_cast<const JBuildL1<JHit>&>(*this)(input, std::back_inserter(buffer));
234
235 for (typename std::vector<JHit>::const_iterator p = buffer.begin(); p != buffer.end(); ++p) {
236
237 JHitL1 hit(input.getModuleID());
238
239 for (typename JSuperFrameClone2D<JHit>::const_iterator i = clone.begin(); i != clone.end(); ++i) {
240
241 for (typename JSuperFrameClone2D<JHit>::value_type::const_iterator q = i->fast_forward(*p); this->getTimeDifference(*p,*q) <= TMax_ns; ++q) {
242
243 hit.push_back(JHitL0(i->getPMTIdentifier(),
244 i->getAxis(),
245 *q));
246 }
247 }
248
249 *out = hit.sort();
250 ++out;
251 }
252 }
std::vector< JHit > buffer
Definition JBuildL1.hh:276
Data structure for L0 hit.
Definition JHitL0.hh:31
Data structure for L1 hit.
Definition JHitL1.hh:37
std::vector< value_type >::const_iterator const_iterator
void fast_forward(argument_type hit) const
Increment the internal iterators until the lower bounds corresponding to the time of the given hit.

◆ operator()() [2/10]

template<class JOutput_t >
void JTRIGGER::JBuildL1< JHitL1 >::operator() ( const JDAQSuperFrame & input,
const JModule & module,
JOutput_t out ) const
inline

Build hits from uncalibrated DAQ data.

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

Parameters
inputDAQ super frame
modulemodule
outoutput L1 data

Definition at line 266 of file JBuildL1.hh.

269 {
270 if (!input.empty()) {
271 (*this)(this->demultiplex(input, module), out);
272 }
273 }
bool empty() const
Definition JDAQFrame.hh:181
JSuperFrame2D< JHit > & demultiplex(const JDAQSuperFrame &input, const JModule &module) const
Definition JBuild.hh:103

◆ operator()() [3/10]

void JTRIGGER::JBuildL1< JHit >::operator() ( typename JSuperFrame2D< JHit >::const_iterator __begin,
typename JSuperFrame2D< JHit >::const_iterator __end,
JOutput_t out ) const
inlineinherited

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.

◆ operator()() [4/10]

void JTRIGGER::JBuildL1< JHit >::operator() ( const JSuperFrame1D< JHit > & input,
JOutput_t out ) const
inlineinherited

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:791
double getTimeDifference(const JDAQChronometer &first, const JDAQChronometer &second)
Get time difference between two chronometers.

◆ operator()() [5/10]

void JTRIGGER::JBuildHelper< JBuildL1< JHit > >::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 }
bool hasModule(const JObjectID &id) const
Has module.
const JModule & getModule(const JObjectID &id) const
Get module parameters.

◆ operator()() [6/10]

void JTRIGGER::JBuildHelper< JBuildL1< JHit > >::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 }

◆ operator()() [7/10]

void JTRIGGER::JBuildHelper< JBuildL1< JHit > >::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 }

◆ setPreprocessor()

void JTRIGGER::JBuild< JHit >::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 }
virtual void reset() override
Reset pointer.
JPreprocessor::JOption_t option
Definition JBuild.hh:115
JLANG::JSharedPointer< match_type > match
Definition JBuild.hh:116

◆ resetPreprocessor()

void JTRIGGER::JBuild< JHit >::resetPreprocessor ( )
inlineinherited

Reset pre-processor of consecutive hits.

Definition at line 69 of file JBuild.hh.

70 {
72 this->match.reset();
73 }
@ none_t
no pre-processing

◆ setDAQHitSelector()

void JTRIGGER::JBuild< JHit >::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 }
JLANG::JSharedPointer< selector_type > selector
Definition JBuild.hh:117

◆ resetDAQHitSelector()

void JTRIGGER::JBuild< JHit >::resetDAQHitSelector ( )
inlineinherited

Reset DAQ hit selector.

Definition at line 90 of file JBuild.hh.

91 {
92 this->selector.reset(new JDAQHitDefaultSelector());
93 }
Default class to select DAQ hits.

◆ demultiplex()

JSuperFrame2D< JHit > & JTRIGGER::JBuild< JHit >::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 }
bool is_valid() const
Check validity of pointer.
2-dimensional frame with time calibrated data from one optical module.
static JSuperFrame2D< JElement_t, JAllocator_t > demultiplex
Demultiplexer.
void preprocess(JPreprocessor::JOption_t option, const match_type &match)
Pre-process data.

◆ operator()() [8/10]

void JTRIGGER::JBuildHelper< JBuildL1< JHitL1 > >::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 }

◆ operator()() [9/10]

void JTRIGGER::JBuildHelper< JBuildL1< JHitL1 > >::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 }

◆ operator()() [10/10]

void JTRIGGER::JBuildHelper< JBuildL1< JHitL1 > >::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 }

Member Data Documentation

◆ buffer

std::vector<JHit> JTRIGGER::JBuildL1< JHitL1 >::buffer
mutableprivate

Definition at line 276 of file JBuildL1.hh.

◆ TMax_ns

double JTRIGGER::JBuildL1Parameters::TMax_ns
inherited

Definition at line 74 of file JBuildL1.hh.

◆ combine

bool JTRIGGER::JBuildL1Parameters::combine
inherited

Definition at line 75 of file JBuildL1.hh.

◆ option

pre-processor option

Definition at line 115 of file JBuild.hh.

◆ match

pre-processor match criterion

Definition at line 116 of file JBuild.hh.

◆ selector

DAQ hit selector.

Definition at line 117 of file JBuild.hh.


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