Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
JTRIGGER::JBuildL2< JElement_t > Class Template Reference

Template L2 builder. More...

#include <JBuildL2.hh>

Inheritance diagram for JTRIGGER::JBuildL2< JElement_t >:
JTRIGGER::JL2Parameters JTRIGGER::JHitToolkit< JElement_t > JTRIGGER::JBuildHelper< JBuildL2< JElement_t > > TObject

Public Types

typedef JElement_t value_type
 

Public Member Functions

 JBuildL2 (const int numberOfHits, const double Tmax_ns, const double ctMin)
 Constructor. More...
 
 JBuildL2 (const JL2Parameters &parameters)
 Constructor. More...
 
template<template< class, class > class JContainer_t, class JAllocator_t , class JOutput_t >
void operator() (const JSuperFrame2D< JElement_t > &super_frame, const JContainer_t< JElement_t, JAllocator_t > &input, JOutput_t out) const
 Build hits from calibrated data. More...
 
template<class JOutput_t >
void operator() (const JSuperFrame2D< JElement_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 reset ()
 Reset L2 parameters. More...
 
bool equals (const JL2Parameters &parameters) const
 Equality. More...
 
bool is_valid () const
 Check validity. More...
 
 ClassDef (JL2Parameters, 1)
 
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...
 

Protected Member Functions

bool isL2 (const JElement_t &hit) const
 Test if requirements for given hit are satisfied. More...
 

Protected Attributes

JSuperFrameClone2D< JElement_t > clone
 

Detailed Description

template<class JElement_t>
class JTRIGGER::JBuildL2< JElement_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 47 of file JBuildL2.hh.

Member Typedef Documentation

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

Definition at line 56 of file JBuildL2.hh.

Constructor & Destructor Documentation

template<class JElement_t>
JTRIGGER::JBuildL2< JElement_t >::JBuildL2 ( const int  numberOfHits,
const double  Tmax_ns,
const double  ctMin 
)
inline

Constructor.

Parameters
numberOfHitsminimal number of hits
Tmax_nsmaximal time difference [ns]
ctMinminimal cosine space angle between PMT axes

Definition at line 66 of file JBuildL2.hh.

68  :
70  {}
double ctMin
minimal cosine space angle between PMT axes
JL2Parameters()
Default constructor.
int numberOfHits
minimal number of hits
template<class JElement_t>
JTRIGGER::JBuildL2< JElement_t >::JBuildL2 ( const JL2Parameters parameters)
inline

Constructor.

Parameters
parametersL2 parameters

Definition at line 78 of file JBuildL2.hh.

78  :
79  JL2Parameters(parameters)
80  {}
JL2Parameters()
Default constructor.

Member Function Documentation

template<class JElement_t>
template<template< class, class > class JContainer_t, class JAllocator_t , class JOutput_t >
void JTRIGGER::JBuildL2< JElement_t >::operator() ( const JSuperFrame2D< JElement_t > &  super_frame,
const JContainer_t< JElement_t, JAllocator_t > &  input,
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
super_frameinput L0 data
inputinput L1 data
outoutput L2 data

Definition at line 96 of file JBuildL2.hh.

99  {
100  clone = super_frame;
101 
102  for (typename JContainer_t<JElement_t, JAllocator_t>::const_iterator __p = input.begin(); __p != input.end(); ++__p) {
103 
104  clone.fast_forward(*__p);
105 
106  if (isL2(*__p)) {
107  *out = *__p;
108  ++out;
109  }
110  }
111  }
JSuperFrameClone2D< JElement_t > clone
Definition: JBuildL2.hh:193
bool isL2(const JElement_t &hit) const
Test if requirements for given hit are satisfied.
Definition: JBuildL2.hh:166
template<class JElement_t>
template<class JOutput_t >
void JTRIGGER::JBuildL2< JElement_t >::operator() ( const JSuperFrame2D< JElement_t > &  input,
JOutput_t  out 
) const
inline

Build hits from calibrated data.

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

Parameters
inputinput L0 data
outoutput L2 data

Definition at line 125 of file JBuildL2.hh.

126  {
127  using namespace std;
128 
129  vector <JElement_t> buffer;
130  JBuildL1<JElement_t> build(this->TMaxLocal_ns, true);
131 
132  build(input, back_inserter(buffer));
133 
134  (*this)(input, buffer, out);
135  }
Template L1 hit builder.
Definition: JBuildL1.hh:76
double TMaxLocal_ns
maximal time difference [ns]
template<class JElement_t>
template<class JOutput_t >
void JTRIGGER::JBuildL2< JElement_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 149 of file JBuildL2.hh.

152  {
153  if (!input.empty()) {
154  (*this)(JSuperFrame2D<JElement_t>::demultiplex(input, module), out);
155  }
156  }
static JSuperFrame2D< JElement_t > demultiplex
Demultiplexer.
template<class JElement_t>
bool JTRIGGER::JBuildL2< JElement_t >::isL2 ( const JElement_t &  hit) const
inlineprotected

Test if requirements for given hit are satisfied.

The internal iterators should be set before this test operation.

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

Definition at line 166 of file JBuildL2.hh.

167  {
168  for (typename JSuperFrameClone2D<JElement_t>::const_iterator i = clone.begin(); i != clone.end(); ++i) {
169 
170  if (this->getTimeDifference(hit,*(i->get())) <= TMaxLocal_ns) {
171 
172  int n = 1;
173 
174  for (typename JSuperFrameClone2D<JElement_t>::const_iterator j = i; ++j != clone.end(); ) {
175 
176  if (this->getTimeDifference(hit,*(j->get())) <= TMaxLocal_ns) {
177 
178  if (JMATH::getDot(i->getDirection(), j->getDirection()) >= ctMin) {
179 
180  if (++n >= numberOfHits) {
181  return true;
182  }
183  }
184  }
185  }
186  }
187  }
188 
189  return false;
190  }
std::vector< value_type >::const_iterator const_iterator
double ctMin
minimal cosine space angle between PMT axes
int numberOfHits
minimal number of hits
double getDot(const JFirst_t &first, const JSecond_t &second)
Get dot product of objects.
JSuperFrameClone2D< JElement_t > clone
Definition: JBuildL2.hh:193
double TMaxLocal_ns
maximal time difference [ns]
void JTRIGGER::JL2Parameters::reset ( )
inlineinherited

Reset L2 parameters.

Definition at line 71 of file JTriggerParameters.hh.

72  {
73  numberOfHits = 0;
74  TMaxLocal_ns = 0.0;
75  ctMin = 1.0;
76  }
double ctMin
minimal cosine space angle between PMT axes
int numberOfHits
minimal number of hits
double TMaxLocal_ns
maximal time difference [ns]
bool JTRIGGER::JL2Parameters::equals ( const JL2Parameters parameters) const
inlineinherited

Equality.

Parameters
parametersL2 parameters
Returns
true if equals; else false

Definition at line 85 of file JTriggerParameters.hh.

86  {
87  return (this->numberOfHits == parameters.numberOfHits &&
88  this->TMaxLocal_ns == parameters.TMaxLocal_ns &&
89  this->ctMin == parameters.ctMin);
90  }
double ctMin
minimal cosine space angle between PMT axes
int numberOfHits
minimal number of hits
double TMaxLocal_ns
maximal time difference [ns]
bool JTRIGGER::JL2Parameters::is_valid ( ) const
inlineinherited

Check validity.

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

Definition at line 98 of file JTriggerParameters.hh.

99  {
100  return !this->equals(JL2Parameters());
101  }
bool equals(const JL2Parameters &parameters) const
Equality.
JL2Parameters()
Default constructor.
JTRIGGER::JL2Parameters::ClassDef ( JL2Parameters  ,
 
)
inherited
void JTRIGGER::JBuildHelper< JBuildL2< JElement_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  }
void JTRIGGER::JBuildHelper< JBuildL2< JElement_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  }
Structure to store the ToT mean and standard deviation of the hits produced by a nanobeacon in a sour...
void JTRIGGER::JBuildHelper< JBuildL2< JElement_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  }
Structure to store the ToT mean and standard deviation of the hits produced by a nanobeacon in a sour...

Member Data Documentation

template<class JElement_t>
JSuperFrameClone2D<JElement_t> JTRIGGER::JBuildL2< JElement_t >::clone
mutableprotected

Definition at line 193 of file JBuildL2.hh.

int JTRIGGER::JL2Parameters::numberOfHits
inherited

minimal number of hits

Definition at line 106 of file JTriggerParameters.hh.

double JTRIGGER::JL2Parameters::TMaxLocal_ns
inherited

maximal time difference [ns]

Definition at line 107 of file JTriggerParameters.hh.

double JTRIGGER::JL2Parameters::ctMin
inherited

minimal cosine space angle between PMT axes

Definition at line 108 of file JTriggerParameters.hh.


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