Jpp
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
JTRIGGER::JBuildL2< JHit_t > Class Template Reference

Template L2 builder. More...

#include <JBuildL2.hh>

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

Public Types

typedef JHit_t value_type
 
typedef JMatch< value_typematch_type
 

Public Member Functions

 JBuildL2 (const JL2Parameters &parameters)
 Constructor. More...
 
template<class JOutput_t >
void operator() (const JSuperFrame2D< JHit_t > &inputL0, const std::vector< JHit_t > &inputL1, JOutput_t out) const
 Build hits from calibrated data. More...
 
template<class JOutput_t >
void operator() (const JSuperFrame2D< JHit_t > &inputL0, 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 reset ()
 Reset L2 parameters. More...
 
bool equals (const JL2Parameters &parameters) const
 Equality. More...
 
bool is_valid () const
 Check validity. More...
 
 ClassDef (JL2Parameters, 1)
 
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...
 
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, 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. More...
 
JSuperFrame2D< JHit_t > & demultiplex (const JDAQSuperFrame &input, const JModule &module) const
 Demultiplex and pre-process DAQ super frame. 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, 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...
 

Public Attributes

int numberOfHits
 minimal number of hits More...
 
double TMaxLocal_ns
 maximal time difference [ns] More...
 
double ctMin
 minimal cosine space angle between PMT axes More...
 
double TMax_ns
 
bool combine
 
JPreprocessor::JOption_t option
 pre-processor option More...
 
JLANG::JSharedPointer< match_typematch
 match criterion More...
 

Protected Member Functions

bool isL2 (const JSuperFrameClone2D< JHit_t > &clone, const JHit_t &hit) const
 Test if requirements for given hit are satisfied. More...
 

Protected Attributes

std::vector< JHit_t > bufferL1
 

Detailed Description

template<class JHit_t>
class JTRIGGER::JBuildL2< JHit_t >

Template L2 builder.

An L2 hit is a local coincidence between two or more hits from different PMTs within the same optical module satisfying:

Definition at line 45 of file JBuildL2.hh.

Member Typedef Documentation

◆ value_type

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

Definition at line 54 of file JBuildL2.hh.

◆ match_type

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

Definition at line 34 of file JBuild.hh.

Constructor & Destructor Documentation

◆ JBuildL2()

template<class JHit_t>
JTRIGGER::JBuildL2< JHit_t >::JBuildL2 ( const JL2Parameters parameters)
inline

Constructor.

Parameters
parametersL2 parameters

Definition at line 62 of file JBuildL2.hh.

62  :
63  JL2Parameters (parameters),
64  JBuildL1<JHit_t>(parameters)
65  {}

Member Function Documentation

◆ operator()() [1/11]

template<class JHit_t>
template<class JOutput_t >
void JTRIGGER::JBuildL2< JHit_t >::operator() ( const JSuperFrame2D< JHit_t > &  inputL0,
const std::vector< JHit_t > &  inputL1,
JOutput_t  out 
) const
inline

Build hits from calibrated data.

Only the input hits that satisfy the predefined requirements are copied from input to output.
The requirements are checked using the calibrated data of each PMT inside the same module. The input data should be time sorted. The output data are time sorted.

Parameters
inputL0input L0 data
inputL1input L1 data
outoutput L2 data

Definition at line 81 of file JBuildL2.hh.

84  {
85  const JSuperFrameClone2D<JHit_t> clone(inputL0);
86 
87  for (typename std::vector<JHit_t>::const_iterator p = inputL1.begin(); p != inputL1.end(); ++p) {
88 
89  clone.fast_forward(*p);
90 
91  if (isL2(clone,*p)) {
92  *out = *p;
93  ++out;
94  }
95  }
96  }

◆ operator()() [2/11]

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

Build hits from calibrated data.

The calibrated data of each PMT inside the optical module are used to build L2 coincidences. The predefined requirements are then checked using the same calibrated data of each PMT. The output data are time sorted.

Parameters
inputL0input L0 data
outoutput L2 data

Definition at line 110 of file JBuildL2.hh.

111  {
112  bufferL1.clear();
113 
114  static_cast<const JBuildL1<JHit_t>&>(*this)(inputL0, std::back_inserter(bufferL1));
115 
116  (*this)(inputL0, bufferL1, out);
117  }

◆ operator()() [3/11]

template<class JHit_t>
template<class JOutput_t >
void JTRIGGER::JBuildL2< JHit_t >::operator() ( const JDAQSuperFrame input,
const JModule module,
JOutput_t  out 
) const
inline

Build hits from DAQ data.

The time calibration is applied and the requirements are applied to the calibrated data. The output data are time sorted.

Parameters
inputDAQ super frame
modulemodule
outoutput L2 data

Definition at line 131 of file JBuildL2.hh.

134  {
135  if (!input.empty()) {
136  (*this)(this->demultiplex(input, module), out);
137  }
138  }

◆ isL2()

template<class JHit_t>
bool JTRIGGER::JBuildL2< JHit_t >::isL2 ( const JSuperFrameClone2D< JHit_t > &  clone,
const JHit_t &  hit 
) const
inlineprotected

Test if requirements for given hit are satisfied.


The internal iterators of the cloned L0 data should be set before this test operation.

Parameters
cloneL0 data
hitL1 hit
Returns
true is L2 condition is satisfied; else false

Definition at line 149 of file JBuildL2.hh.

150  {
151  using namespace JPP;
152 
153  for (typename JSuperFrameClone2D<JHit_t>::const_iterator i = clone.begin(); i != clone.end(); ++i) {
154 
155  if (this->getTimeDifference(hit,*(i->get())) <= TMaxLocal_ns) {
156 
157  int n = 1;
158 
159  for (typename JSuperFrameClone2D<JHit_t>::const_iterator j = i; ++j != clone.end(); ) {
160 
161  if (this->getTimeDifference(hit,*(j->get())) <= TMaxLocal_ns) {
162 
163  if (getDot(i->getDirection(), j->getDirection()) >= ctMin) {
164 
165  if (++n >= numberOfHits) {
166  return true;
167  }
168  }
169  }
170  }
171  }
172  }
173 
174  return false;
175  }

◆ reset()

void JTRIGGER::JL2Parameters::reset ( )
inlineinherited

Reset L2 parameters.

Definition at line 72 of file JTriggerParameters.hh.

73  {
74  numberOfHits = 0;
75  TMaxLocal_ns = 0.0;
76  ctMin = 1.0;
77  }

◆ equals()

bool JTRIGGER::JL2Parameters::equals ( const JL2Parameters parameters) const
inlineinherited

Equality.

Parameters
parametersL2 parameters
Returns
true if equals; else false

Definition at line 86 of file JTriggerParameters.hh.

87  {
88  return (this->numberOfHits == parameters.numberOfHits &&
89  this->TMaxLocal_ns == parameters.TMaxLocal_ns &&
90  this->ctMin == parameters.ctMin);
91  }

◆ is_valid()

bool JTRIGGER::JL2Parameters::is_valid ( ) const
inlineinherited

Check validity.

Returns
true if not-equal to default value; else false

Definition at line 99 of file JTriggerParameters.hh.

100  {
101  return !this->equals(JL2Parameters());
102  }

◆ ClassDef()

JTRIGGER::JL2Parameters::ClassDef ( JL2Parameters  ,
 
)
inherited

◆ operator()() [4/11]

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
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  }

◆ operator()() [5/11]

template<class JHit_t>
template<class JOutput_t >
void JTRIGGER::JBuildL1< JHit_t >::operator() ( const JSuperFrame1D< JHit_t > &  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() - 1; // remove end marker
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  }

◆ operator()() [6/11]

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  }

◆ operator()() [7/11]

void JTRIGGER::JBuildHelper< JBuildL1< JHit_t > >::operator() ( const JDAQEvent event,
const JModuleRouter router,
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()() [8/11]

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  }

◆ setPreprocessor()

template<class JHit_t>
void JTRIGGER::JBuild< JHit_t >::setPreprocessor ( const JPreprocessor::JOption_t  option,
const match_type match 
)
inlineinherited

Set pre-processor.

Parameters
optionoption
matchmatch criterion

Definition at line 52 of file JBuild.hh.

53  {
54  this->option = option;
55  this->match.reset(match.clone());
56  }

◆ demultiplex()

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 66 of file JBuild.hh.

68  {
70 
71  if (match.is_valid()) {
72  buffer.preprocess(option, *match);
73  }
74 
75  return buffer;
76  }

◆ operator()() [9/11]

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

◆ operator()() [10/11]

void JTRIGGER::JBuildHelper< JBuildL2< JHit_t > >::operator() ( const JDAQEvent event,
const JModuleRouter router,
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()() [11/11]

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

Member Data Documentation

◆ bufferL1

template<class JHit_t>
std::vector<JHit_t> JTRIGGER::JBuildL2< JHit_t >::bufferL1
mutableprotected

Definition at line 178 of file JBuildL2.hh.

◆ numberOfHits

int JTRIGGER::JL2Parameters::numberOfHits
inherited

minimal number of hits

Definition at line 107 of file JTriggerParameters.hh.

◆ TMaxLocal_ns

double JTRIGGER::JL2Parameters::TMaxLocal_ns
inherited

maximal time difference [ns]

Definition at line 108 of file JTriggerParameters.hh.

◆ ctMin

double JTRIGGER::JL2Parameters::ctMin
inherited

minimal cosine space angle between PMT axes

Definition at line 109 of file JTriggerParameters.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

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

pre-processor option

Definition at line 78 of file JBuild.hh.

◆ match

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

match criterion

Definition at line 79 of file JBuild.hh.


The documentation for this class was generated from the following file:
JTRIGGER::JSuperFrame1D::multiplex
static JSuperFrame1D< JElement_t, JAllocator_t > multiplex
Multiplexer.
Definition: JSuperFrame1D.hh:136
JTRIGGER::JSuperFrame2D::preprocess
void preprocess(JPreprocessor::JOption_t option, const match_type &match)
Pre-process data.
Definition: JSuperFrame2D.hh:136
JTRIGGER::JL2Parameters::numberOfHits
int numberOfHits
minimal number of hits
Definition: JTriggerParameters.hh:107
JTRIGGER::JBuildL1
Template L1 hit builder.
Definition: JBuildL1.hh:85
JTRIGGER::JSuperFrame1D
1-dimensional frame with time calibrated data from one optical module.
Definition: JSuperFrame1D.hh:35
JTOOLS::n
const int n
Definition: JPolint.hh:628
std::vector
Definition: JSTDTypes.hh:12
JTRIGGER::JSuperFrame2D::demultiplex
static JSuperFrame2D< JElement_t, JAllocator_t > demultiplex
Demultiplexer.
Definition: JSuperFrame2D.hh:161
JTRIGGER::JBuild::demultiplex
JSuperFrame2D< JHit_t > & demultiplex(const JDAQSuperFrame &input, const JModule &module) const
Demultiplex and pre-process DAQ super frame.
Definition: JBuild.hh:66
JTOOLS::j
int j
Definition: JPolint.hh:634
JTRIGGER::JSuperFrameClone2D
Clone of JSuperFrame2D.
Definition: JSuperFrameClone2D.hh:26
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JTRIGGER::JL2Parameters::ctMin
double ctMin
minimal cosine space angle between PMT axes
Definition: JTriggerParameters.hh:109
JTRIGGER::JBuildL1Parameters::combine
bool combine
Definition: JBuildL1.hh:75
JTRIGGER::JBuildL2::bufferL1
std::vector< JHit_t > bufferL1
Definition: JBuildL2.hh:178
JTRIGGER::JSuperFrameClone2D::const_iterator
std::vector< value_type >::const_iterator const_iterator
Definition: JSuperFrameClone2D.hh:36
JLANG::JSharedPointer::reset
virtual void reset()
Reset pointer.
Definition: JSharedPointer.hh:171
JTRIGGER::JBuild::match
JLANG::JSharedPointer< match_type > match
match criterion
Definition: JBuild.hh:79
JTRIGGER::JL2Parameters::JL2Parameters
JL2Parameters()
Default constructor.
Definition: JTriggerParameters.hh:39
JASTRONOMY::getDot
double getDot(const JNeutrinoDirection &first, const JNeutrinoDirection &second)
Dot product.
Definition: JAstronomy.hh:409
JTRIGGER::JBuildL2::isL2
bool isL2(const JSuperFrameClone2D< JHit_t > &clone, const JHit_t &hit) const
Test if requirements for given hit are satisfied.
Definition: JBuildL2.hh:149
JTRIGGER::JSuperFrame2D
2-dimensional frame with time calibrated data from one optical module.
Definition: JSuperFrame2D.hh:41
JTRIGGER::JBuildL1Parameters::TMax_ns
double TMax_ns
Definition: JBuildL1.hh:74
JTRIGGER::JL2Parameters::equals
bool equals(const JL2Parameters &parameters) const
Equality.
Definition: JTriggerParameters.hh:86
JTRIGGER::JL2Parameters::TMaxLocal_ns
double TMaxLocal_ns
maximal time difference [ns]
Definition: JTriggerParameters.hh:108
JLANG::JAbstractPointer::is_valid
bool is_valid() const
Check validity of pointer.
Definition: JAbstractPointer.hh:83
JTRIGGER::JBuild::option
JPreprocessor::JOption_t option
pre-processor option
Definition: JBuild.hh:78