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

Template specialisation of L2 builder for JHitR2 data type. More...

#include <JBuildL2.hh>

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

Public Types

typedef JHitR2 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 > &inputL0, const std::vector< JHit > &inputL2, JOutput_t out) const
 Build hits from calibrated data. More...
 
template<class JOutput_t >
void operator() (const JSuperFrame2D< JHit > &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 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. More...
 
void operator() (const JSuperFrame1D< JHit > &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 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 reset ()
 Reset L2 parameters. More...
 
bool equals (const JL2Parameters &parameters) const
 Equality. More...
 
bool is_valid () const
 Check validity. More...
 
 ClassDef (JL2Parameters, 1)
 
void setPreprocessor (const JPreprocessor::JOption_t option, const match_type &match)
 Set pre-processor. More...
 
JSuperFrame2D< JHit > & 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 > &clone, const JHit &hit) const
 Test if requirements for given hit are satisfied. More...
 

Protected Attributes

std::vector< JHitbufferL1
 

Private Attributes

std::vector< JHitbufferL2
 

Detailed Description

template<>
class JTRIGGER::JBuildL2< JHitR2 >

Template specialisation of L2 builder for JHitR2 data type.

Definition at line 299 of file JBuildL2.hh.

Member Typedef Documentation

◆ value_type

Definition at line 307 of file JBuildL2.hh.

◆ match_type

Definition at line 34 of file JBuild.hh.

Constructor & Destructor Documentation

◆ JBuildL2()

JTRIGGER::JBuildL2< JHitR2 >::JBuildL2 ( const JL2Parameters parameters)
inline

Constructor.

Parameters
parametersL2 parameters

Definition at line 315 of file JBuildL2.hh.

315  :
316  JBuildL2<JHit>(parameters)
317  {}

Member Function Documentation

◆ operator()() [1/14]

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

Build hits from calibrated data.

Only the input hits that satify 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
inputL2input L2 data
outoutput L2 data

Definition at line 333 of file JBuildL2.hh.

336  {
337  const JSuperFrameClone2D<JHit> clone(inputL0);
338 
339  for (typename std::vector<JHit>::const_iterator p = inputL2.begin(); p != inputL2.end(); ++p) {
340 
341  JHitR2 hit(inputL0.getModuleID(),
342  inputL0.getPosition());
343 
344  clone.fast_forward(*p);
345 
346  for (typename JSuperFrameClone2D<JHit>::const_iterator i = clone.begin(); i != clone.end(); ++i) {
347 
348  if (i->getTimeDifference(*p) <= TMaxLocal_ns) {
349 
350  if (hit.getN() == 0)
351  hit.set(i->getJHit());
352  else
353  hit.add(i->getJHit());
354  }
355  }
356 
357  *out = hit;
358  ++out;
359  }
360  }

◆ operator()() [2/14]

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

375  {
376  bufferL2.clear();
377 
378  static_cast<const JBuildL2<JHit>&>(*this)(inputL0, std::back_inserter(bufferL2));
379 
380  (*this)(inputL0, bufferL2, out);
381  }

◆ operator()() [3/14]

template<class JOutput_t >
void JTRIGGER::JBuildL2< JHitR2 >::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 395 of file JBuildL2.hh.

398  {
399  if (!input.empty()) {
400 
401  const JSuperFrame2D<JHit>& bufferL0 = this->demultiplex(input, module);
402 
403  (*this)(bufferL0, out);
404  }
405  }

◆ operator()() [4/14]

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  }

◆ operator()() [5/14]

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() - 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/14]

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  }

◆ operator()() [7/14]

void JTRIGGER::JBuildHelper< JBuildL1< JHit > >::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/14]

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  }

◆ operator()() [9/14]

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

◆ operator()() [10/14]

void JTRIGGER::JBuildHelper< JBuildL2< JHit > >::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/14]

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

◆ isL2()

bool JTRIGGER::JBuildL2< JHit >::isL2 ( const JSuperFrameClone2D< JHit > &  clone,
const JHit hit 
) const
inlineprotectedinherited

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

◆ setPreprocessor()

void JTRIGGER::JBuild< JHit >::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()

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

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

◆ operator()() [12/14]

void JTRIGGER::JBuildHelper< JBuildL2< JHitR2 > >::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()() [13/14]

void JTRIGGER::JBuildHelper< JBuildL2< JHitR2 > >::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()() [14/14]

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

◆ bufferL2

std::vector<JHit> JTRIGGER::JBuildL2< JHitR2 >::bufferL2
mutableprivate

Definition at line 408 of file JBuildL2.hh.

◆ bufferL1

std::vector<JHit > JTRIGGER::JBuildL2< JHit >::bufferL1
mutableprotectedinherited

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

pre-processor option

Definition at line 78 of file JBuild.hh.

◆ match

match criterion

Definition at line 79 of file JBuild.hh.


The documentation for this class was generated from the following file:
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::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::JBuild< JHit >::demultiplex
JSuperFrame2D< JHit > & 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
KM3NETDAQ::JDAQModuleIdentifier::getModuleID
int getModuleID() const
Get module identifier.
Definition: JDAQModuleIdentifier.hh:72
JTRIGGER::JSuperFrameClone2D
Clone of JSuperFrame2D.
Definition: JSuperFrameClone2D.hh:26
JTRIGGER::JHitR1::set
void set(const JHit &hit, const double weight=1.0)
Set hit.
Definition: JHitR1.hh:125
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::JBuildL2< JHitR2 >::bufferL2
std::vector< JHit > bufferL2
Definition: JBuildL2.hh:408
JTRIGGER::JBuildL1Parameters::combine
bool combine
Definition: JBuildL1.hh:75
JTRIGGER::JHitR1
Reduced data structure for L1 hit.
Definition: JHitR1.hh:31
JGEOMETRY3D::JPosition3D::getPosition
const JPosition3D & getPosition() const
Get position.
Definition: JPosition3D.hh:129
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< JHit >::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::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::JBuildL2< JHit >
JTRIGGER::JBuild< JHit >::option
JPreprocessor::JOption_t option
pre-processor option
Definition: JBuild.hh:78