Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Functions | Variables
JTRIGGER Namespace Reference

Trigger algorithms and support classes. More...

Classes

class  JBinder2nd
 Auxiliary class to convert binary JMatch operator and given hit to unary match operator. More...
 
struct  JBuildHelper
 Auxiliary class to extend hit building functionality to all DAQ data types. More...
 
class  JBuildL0
 Template L0 hit builder. More...
 
class  JBuildL0< JHitL0 >
 Template specialisation of L0 builder for JHitL0 data type. More...
 
struct  JBuildL1Parameters
 Auxiliary data structure for L1 build parameters. More...
 
class  JBuildL1
 Template L1 hit builder. More...
 
class  JBuildL1< JHitL1 >
 Template specialisation of L1 builder for JHitL1 data type. More...
 
class  JBuildL1< JHitR1 >
 Template specialisation of L1 builder for JHitR1 data type. More...
 
class  JBuildL2
 Template L2 builder. More...
 
class  JBuildL2< JHitL2 >
 Template specialisation of L2 builder for JHitL1 data type. More...
 
class  JBuildL2< JHitR2 >
 Template specialisation of L2 builder for JHitR1 data type. More...
 
class  JClone
 Clone of a container. More...
 
class  JDOMToPMTMaskMap
 
class  JEvent
 Triggered event. More...
 
class  JEventOverlap
 Match of two events considering overlap in time. More...
 
class  JFrame
 Data frame for calibrated hits of one PMT. More...
 
class  JFrameClone
 Clone of JFrame. More...
 
struct  JGetRiseTime
 Auxiliary class for rise time evaluation. More...
 
class  JHit
 Hit data structure. More...
 
struct  JMatch_t
 Auxiliary class to check whether two consecutive hits should be joined. More...
 
class  JHitL0
 Data structure for L0 hit. More...
 
class  JHitL1
 Data structure for L1 hit. More...
 
class  JHitR0
 Reduced data structure for L0 hit. More...
 
class  JHitR1
 Reduced data structure for L1 hit. More...
 
struct  JHitToolkit
 Template definition of hit toolkit. More...
 
struct  JHitToolkit< JHit, false >
 Template specialisation of hit toolkit for JHit class. More...
 
struct  JHitToolkit< JHitR0, false >
 Template specialisation of hit toolkit for JHit class. More...
 
struct  JHitToolkit< JHit_t, true >
 Template specialisation of hit toolkit for any primitive data type. More...
 
class  JMatch
 Function object interface for hit matching. More...
 
class  JMatchHelper
 Auxiliary class to handle pointer to match function. More...
 
class  JMatch1D
 1D match criterion. More...
 
class  JMatch3B
 3D match criterion with road width. More...
 
class  JMatch3D
 3D match criterion. More...
 
class  JMatch3G
 3G match criterion. More...
 
struct  JModuleCounter
 Auxiliary class for counting unique modules. More...
 
struct  JModuleHeader
 Header for Module. More...
 
struct  JParametersHelper
 Wrapper class to share parameters. More...
 
struct  JPMTHeader
 Header for PMT. More...
 
class  JPMTMask
 Auxiliary class for pmt mask. More...
 
class  JPrescaler
 Auxiliary class for prescaling. More...
 
struct  JRunByRun
 Auxiliary class to handle run by run options. More...
 
class  JSummaryRouter
 Router for fast addressing of summary data in JDAQSummaryslice data structure as a function of the optical module identifier. More...
 
class  JSuperFrame1D
 1-dimensional frame with time calibrated data from one optical module. More...
 
class  JSuperFrame2D
 2-dimensional frame with time calibrated data from one optical module. More...
 
class  JSuperFrameClone1D
 Clone of JSuperFrame1D. More...
 
class  JSuperFrameClone2D
 Clone of JSuperFrame2D. More...
 
class  JTimeConverter
 Auxiliary class to convert DAQ/trigger hit time to/from Monte Carlo hit time. More...
 
class  JTimeslice
 Time slice with calibrated data. More...
 
class  JTimesliceClone
 Clone of JTimeslice. More...
 
class  JTimesliceL1
 Auxiliary class to build JDAQTimeslice for L1 timeslice. More...
 
class  JTimesliceRouter
 Router for fast addressing of hits in KM3NETDAQ::JDAQTimeslice data structure as a function of the optical module identifier and time. More...
 
class  JTrigger3D
 General purpose majority trigger. More...
 
class  JTrigger3DMuon
 Muon trigger. More...
 
struct  JTrigger3DMuon_t
 Muon trigger parameters. More...
 
class  JTrigger3DShower
 Shower trigger. More...
 
struct  JTrigger3DShower_t
 Shower trigger parameters. More...
 
class  JTrigger3N
 General purpose muon trigger. More...
 
class  JTriggeredEvent
 Auxiliary class to build JDAQEvent for a triggered event. More...
 
class  JTriggeredHit
 Data structure for triggered hit. More...
 
class  JTriggerException
 General exception. More...
 
class  JTriggerInput
 Data structure for input to trigger algorithm. More...
 
class  JTriggerInterface
 Trigger interface. More...
 
struct  JTriggerBit
 This class is used to map trigger class to trigger bit. More...
 
struct  JAssertBit
 This class will generate a compiler error if trigger bit is out of range. More...
 
struct  JAssertBit< N, true >
 Implementation of a valid trigger bit. More...
 
struct  JAttributes
 Module attributes. More...
 
class  JTriggerMXShower
 Shower trigger. More...
 
struct  JTriggerMXShower_t
 Shower trigger parameters. More...
 
class  JTriggerOutput
 Set of triggered events. More...
 
struct  JL2Parameters
 Data structure for L2 parameters. More...
 
class  JTriggerParameters
 Data structure for all trigger parameters. More...
 

Typedefs

typedef JHitL1 JHitL2
 Type definition of L2 hit. More...
 
typedef JHitR1 JHitR2
 Type definition of R2 hit. More...
 
typedef unsigned int JPMTMask_t
 Type definition of pmt mask. More...
 
typedef unsigned int JTriggerbit_t
 Type definition of trigger bit. More...
 

Functions

template<class JHitIterator_t , class JHit_t >
JHitIterator_t clusterize (JHitIterator_t __begin, JHitIterator_t __end, const JMatch< JHit_t > &match, const int Nmin=1)
 Partition data according given binary match operator. More...
 
template<class JHitIterator_t , class JHit_t >
JHitIterator_t clusterize (JHitIterator_t __begin, JHitIterator_t __end, const JMatch< JHit_t > &match, const int Nmin, std::random_access_iterator_tag)
 Implementation of method clusterize for random access iterators. More...
 
template<class JHitIterator_t , class JHit_t >
JHitIterator_t reverse_clusterize (JHitIterator_t __begin, JHitIterator_t __end, const JMatch< JHit_t > &match)
 Partition data according given binary match operator. More...
 
template<class JHitIterator_t , class JHit_t >
JHitIterator_t reverse_clusterize (JHitIterator_t __begin, JHitIterator_t __end, const JMatch< JHit_t > &match, std::random_access_iterator_tag)
 Implementation of method reverse_clusterize for random access iterators. More...
 
template<class JHitIterator_t , class JComparator_t , class JHit_t >
JHitIterator_t clusterize (JHitIterator_t __begin, JHitIterator_t __end, JComparator_t comparator, const JMatch< JHit_t > &match)
 Select best root hit according given comparator and partition remaining data according given binary match operator and this root hit. More...
 
template<class JHitIterator_t , class JHit_t >
JHitIterator_t clusterizeWeight (JHitIterator_t __begin, JHitIterator_t __end, const JMatch< JHit_t > &match)
 Partition data according given binary match operator. More...
 
template<class JHitIterator_t , class JHit_t >
JHitIterator_t clusterizeWeight (JHitIterator_t __begin, JHitIterator_t __end, const JMatch< JHit_t > &match, std::random_access_iterator_tag)
 Implementation of method clusterizeWeight for random access iterators. More...
 
template<class JHit_t >
bool weightSorter (const JHit_t &first, const JHit_t &second)
 Compare two hits by weight. More...
 
template<class JHit_t >
bool timeSorter (const JHit_t &first, const JHit_t &second)
 Compare two hits by weight. More...
 
template<class JHit_t >
JBinder2nd< JHit_t > JBind2nd (const JMatch< JHit_t > &match, const JHit_t &second)
 Auxiliary method to create JBinder2nd object. More...
 
bool operator< (const JEvent &first, const JEvent &second)
 Less than operator for events. More...
 
JTimeRange getTimeRange (const JEvent &event)
 Get time range (i.e. More...
 
bool operator< (const JHit &first, const JHit &second)
 Less than operator for hits. More...
 
bool operator< (const JHit &hit, const double t1)
 Less than operator for hits. More...
 
bool operator== (const JHit &first, const JHit &second)
 Equal operator for hits. More...
 
double getTime (const JDAQHit &hit, const JCalibration &cal)
 Get calibrated time of DAQ hit. More...
 
double getToT (const JDAQHit &hit, const JCalibration &cal)
 Get calibrated time-over-threshold of DAQ hit. More...
 
template<class JHit_t >
JMatchHelper< JHit_t > make_match (bool(*match)(const JHit_t &, const JHit_t &))
 Auxiliary method to make JMatch object based on pointer to match function. More...
 
JPMTMask_t getPMTMask (const unsigned int bit)
 Convert pmt bit to pmt mask. More...
 
 setTriggerBit (JTrigger3DShower, 1)
 
 setTriggerBit (JTriggerMXShower, 2)
 
 setTriggerBit (JTrigger3DMuon, 4)
 
bool operator< (const JTriggeredHit &first, const JTriggeredHit &second)
 Less than operator for triggered hits. More...
 
bool operator== (const JTriggeredHit &first, const JTriggeredHit &second)
 Equal operator for triggered hits. More...
 
std::ostream & operator<< (std::ostream &out, const JTriggerException &exception)
 Print error message of JTriggerException. More...
 
template<class JTrigger_t >
JTriggerbit_t getTriggerBit ()
 Get the trigger bit. More...
 
template<class JTrigger_t >
JTriggerbit_t getTriggerBit (const JTrigger_t &event)
 Get the trigger bit. More...
 
const char * getTriggerName (JTriggerbit_t bit)
 Get trigger name. More...
 
void setAttributes (const JModule &first, const JModule &second, JAttributes &attributes)
 Set module attributes. More...
 
JTimeRange getTimeRange (const JTriggerParameters &parameters)
 Get time range of snapshot. More...
 

Variables

static const JGetRiseTime getRiseTime
 Function object for rise time evaluation. More...
 
static const unsigned int NUMBER_OF_PMT_BITS = 31
 Number of pmt bits. More...
 

Detailed Description

Trigger algorithms and support classes.

Author
mdejong
rbruijn

Typedef Documentation

Type definition of L2 hit.

Definition at line 20 of file JHitL2.hh.

Type definition of R2 hit.

Definition at line 20 of file JHitR2.hh.

typedef unsigned int JTRIGGER::JPMTMask_t

Type definition of pmt mask.

Definition at line 30 of file JPMTMask.hh.

typedef unsigned int JTRIGGER::JTriggerbit_t

Type definition of trigger bit.

Definition at line 29 of file JTriggerInterface.hh.

Function Documentation

template<class JHitIterator_t , class JHit_t >
JHitIterator_t JTRIGGER::clusterize ( JHitIterator_t  __begin,
JHitIterator_t  __end,
const JMatch< JHit_t > &  match,
const int  Nmin = 1 
)
inline

Partition data according given binary match operator.

The underlying algorithm is known in literature as 'clique'. The result is (likely to be) the maximal sub-set with all elements matched to each other. The complexity is quadratic, i.e. at most (number of elements x number of elements) operations. The algorithm will sort the data such that all clusterized hits are at the front. The return value points the first non clusterized hit.

The template argument JHit_t refers to a data structure which should have the following member methods:

  • double getX(); // [m]
  • double getY(); // [m]
  • double getZ(); // [m]
  • double getT(); // [ns]
Parameters
__beginbegin of data
__endend of data
matchbinary match operator
Nminminimum cluster size
Returns
end of data

Definition at line 45 of file JAlgorithm.hh.

49  {
50  return clusterize(__begin, __end, match, Nmin, typename std::iterator_traits<JHitIterator_t>::iterator_category());
51  }
JHitIterator_t clusterize(JHitIterator_t __begin, JHitIterator_t __end, const JMatch< JHit_t > &match, const int Nmin=1)
Partition data according given binary match operator.
Definition: JAlgorithm.hh:45
template<class JHitIterator_t , class JHit_t >
JHitIterator_t JTRIGGER::clusterize ( JHitIterator_t  __begin,
JHitIterator_t  __end,
const JMatch< JHit_t > &  match,
const int  Nmin,
std::random_access_iterator_tag   
)
inline

Implementation of method clusterize for random access iterators.

Definition at line 58 of file JAlgorithm.hh.

63  {
64  const int N = std::distance(__begin, __end);
65 
66  if (N >= Nmin) {
67 
68  int i, j;
69  int n = N;
70 
71  JHitIterator_t buffer = __begin;
72 
73  // Determine number of associated hits for each hit.
74 
75  std::vector<int> count(N, 1); // Assume always a match with itself.
76 
77  for (i = 0; i != N; ++i) {
78 
79  for (j = i; ++j != N; ) {
80 
81  if (match(buffer[i], buffer[j])) {
82 
83  ++count[i];
84  ++count[j];
85 
86  } else if (n == Nmin) {
87 
88  return __begin;
89  }
90  }
91 
92  if (count[i] < Nmin) {
93 
94  --n;
95 
96  if (n < Nmin) {
97  return __begin;
98  }
99  }
100  }
101 
102  n = N;
103 
104  // Remove hit with the smallest number of associated hits.
105  // This procedure stops when the number of associated hits
106  // is equal to the number of (remaining) hits.
107 
108  for ( ; n >= Nmin; ) {
109 
110  j = 0;
111 
112  for (i = 1; i != n; ++i) {
113  if (count[i] < count[j]) {
114  j = i;
115  }
116  }
117 
118  // Ready?
119 
120  if (count[j] == n) {
121  break;
122  }
123 
124  // Reduce effective size.
125 
126  --n;
127 
128  // Swap the selected hit to end.
129 
130  std::swap(buffer[j], buffer[n]);
131  std::swap(count [j], count [n]);
132 
133  // Decrease number of associated hits for each associated hit.
134 
135  for (i = 0; i != n; ++i) {
136  if (match(buffer[i], buffer[n])) {
137  --count[i];
138  }
139  }
140  }
141 
142  if (n >= Nmin)
143  return __begin + n;
144  else
145  return __begin;
146  }
147 
148  return __begin;
149  }
template<class JHitIterator_t , class JHit_t >
JHitIterator_t JTRIGGER::reverse_clusterize ( JHitIterator_t  __begin,
JHitIterator_t  __end,
const JMatch< JHit_t > &  match 
)
inline

Partition data according given binary match operator.

The underlying algorithm is known in literature as reverse 'clique'. The result is (likely to be) the maximal sub-set with all elements matched to each other. The complexity is quadratic, i.e. at most (number of elements x number of elements) operations. The algorithm will sort the data such that all clusterized hits are at the front. The return value points the first non clusterized hit.

The template argument JHit_t refers to a data structure which should have the following member methods:

  • double getX(); // [m]
  • double getY(); // [m]
  • double getZ(); // [m]
  • double getT(); // [ns]
Parameters
__beginbegin of data
__endend of data
matchbinary match operator
Returns
end of data

Definition at line 173 of file JAlgorithm.hh.

176  {
177  return reverse_clusterize(__begin, __end, match, typename std::iterator_traits<JHitIterator_t>::iterator_category());
178  }
JHitIterator_t reverse_clusterize(JHitIterator_t __begin, JHitIterator_t __end, const JMatch< JHit_t > &match)
Partition data according given binary match operator.
Definition: JAlgorithm.hh:173
template<class JHitIterator_t , class JHit_t >
JHitIterator_t JTRIGGER::reverse_clusterize ( JHitIterator_t  __begin,
JHitIterator_t  __end,
const JMatch< JHit_t > &  match,
std::random_access_iterator_tag   
)
inline

Implementation of method reverse_clusterize for random access iterators.

Definition at line 185 of file JAlgorithm.hh.

189  {
190  const int N = std::distance(__begin, __end);
191 
192  if (N != 0) {
193 
194  int i, j;
195 
196  JHitIterator_t buffer = __begin;
197 
198  // Determine number of associated hits for each hit.
199 
200  std::vector<int> count(N, 1); // Assume always a match with itself.
201 
202  for (i = 0; i != N; ++i) {
203 
204  for (j = 0; j != i; ++j) {
205  if (match(buffer[i], buffer[j])) {
206  ++count[i];
207  ++count[j];
208  }
209  }
210  }
211 
212  // Keep hit with the largest number of associated hits.
213  // This procedure stops when the number of associated hits is equal to one.
214 
215  for (int k = 0; ; ) {
216 
217  j = k;
218 
219  for (i = j; ++i != N; ) {
220  if (count[i] > count[j]) {
221  j = i;
222  }
223  }
224 
225  // Ready?
226 
227  if (count[j] == 1) {
228  return __begin + k;
229  }
230 
231  // Swap the selected hit to begin.
232 
233  std::swap(buffer[j], buffer[k]);
234  std::swap(count [j], count [k]);
235 
236  // Decrease number of associated hits for each associated hit.
237 
238  for (i = k; ++i != N; ) {
239  if (match(buffer[i], buffer[k])) {
240  --count[i];
241  }
242  }
243 
244  // Increase effective size.
245 
246  ++k;
247  }
248  }
249 
250  return __begin;
251  }
template<class JHitIterator_t , class JComparator_t , class JHit_t >
JHitIterator_t JTRIGGER::clusterize ( JHitIterator_t  __begin,
JHitIterator_t  __end,
JComparator_t  comparator,
const JMatch< JHit_t > &  match 
)
inline

Select best root hit according given comparator and partition remaining data according given binary match operator and this root hit.

The complexity is linear, i.e. at most number of elements operations. The complexity is quadratic, i.e. at most (number of elements x number of elements) operations. The algorithm will sort the data such that all clusterized hits are at the front.

Parameters
__beginbegin of data
__endend of data
comparatorcomparator
matchbinary match operator
Returns
end of data

Definition at line 268 of file JAlgorithm.hh.

272  {
273  if (__begin != __end) {
274 
275  std::sort(__begin, __end, comparator);
276 
277  const JHit_t& root = *__begin;
278 
279  return std::partition(++__begin, __end, JBind2nd(match, root));
280 
281  } else {
282 
283  return __end;
284  }
285  }
JBinder2nd< JHit_t > JBind2nd(const JMatch< JHit_t > &match, const JHit_t &second)
Auxiliary method to create JBinder2nd object.
Definition: JBind2nd.hh:70
template<class JHitIterator_t , class JHit_t >
JHitIterator_t JTRIGGER::clusterizeWeight ( JHitIterator_t  __begin,
JHitIterator_t  __end,
const JMatch< JHit_t > &  match 
)
inline

Partition data according given binary match operator.

The underlying algorithm is known in literature as reverse 'clique'. The result is (likely to be) the maximal sub-set with all elements matched to each other. The complexity is quadratic, i.e. at most (number of elements x number of elements) operations. The algorithm will sort the data such that all clusterized hits are at the front. The return value points the first non clusterized hit.

The template argument JHit_t refers to a data structure which should have the following member methods:

  • double getX(); // [m]
  • double getY(); // [m]
  • double getZ(); // [m]
  • double getT(); // [ns]
  • double getW(); // [au]
Parameters
__beginbegin of data
__endend of data
matchbinary match operator
Returns
end of data

Definition at line 310 of file JAlgorithm.hh.

313  {
314  return clusterizeWeight(__begin, __end, match, typename std::iterator_traits<JHitIterator_t>::iterator_category());
315  }
JHitIterator_t clusterizeWeight(JHitIterator_t __begin, JHitIterator_t __end, const JMatch< JHit_t > &match)
Partition data according given binary match operator.
Definition: JAlgorithm.hh:310
template<class JHitIterator_t , class JHit_t >
JHitIterator_t JTRIGGER::clusterizeWeight ( JHitIterator_t  __begin,
JHitIterator_t  __end,
const JMatch< JHit_t > &  match,
std::random_access_iterator_tag   
)
inline

Implementation of method clusterizeWeight for random access iterators.

Definition at line 322 of file JAlgorithm.hh.

326  {
327  if (__begin != __end) {
328 
329  const int N = std::distance(__begin, __end);
330 
331  int i, j;
332 
333  // Determine weight of each hit.
334 
335  std::vector<double> weight(N, 0.0);
336 
337  JHitIterator_t buffer = __begin;
338 
339  for (i = 0; i != N; ++i) {
340 
341  weight[i] += buffer[i].getW();
342 
343  for (j = i; ++j != N; ) {
344 
345  if (match(buffer[i], buffer[j])) {
346 
347  weight[i] += buffer[j].getW();
348  weight[j] += buffer[i].getW();
349  }
350  }
351  }
352 
353  // Remove hit with the smallest weight of associated hits.
354  // This procedure stops when the weight of associated hits
355  // is equal to the maximal weight of (remaining) hits.
356 
357  int n = N;
358  double W;
359 
360  for ( ; ; ) {
361 
362  j = 0;
363  W = weight[j];
364 
365  for (i = 1; i != n; ++i) {
366 
367  if (weight[i] < weight[j]) {
368  j = i;
369  }
370 
371  if (weight[i] > W) {
372  W = weight[i];
373  }
374  }
375 
376  // Ready?
377 
378  if (weight[j] == W) {
379  break;
380  }
381 
382  // Reduce effective size.
383 
384  --n;
385 
386  // Swap the selected hit to end.
387 
388  std::swap(buffer[j], buffer[n]);
389  std::swap(weight[j], weight[n]);
390 
391  // Decrease weight of associated hits for each associated hit.
392 
393  for (i = 0; i != n; ++i) {
394  if (match(buffer[i], buffer[n])) {
395  weight[i] -= buffer[n].getW();
396  }
397  }
398  }
399 
400  return __begin + n;
401 
402  } else {
403 
404  return __end;
405  }
406  }
template<class JHit_t >
bool JTRIGGER::weightSorter ( const JHit_t &  first,
const JHit_t &  second 
)
inline

Compare two hits by weight.

The template argument JHit_t refers to a data structure which should have the following member methods:

  • double getW(); // [a.u.]
Parameters
firstfirst hit
secondsecond hit
Returns
true if first hit has larger weight than second; else false

Definition at line 420 of file JAlgorithm.hh.

421  {
422  return first.getW() > second.getW();
423  }
template<class JHit_t >
bool JTRIGGER::timeSorter ( const JHit_t &  first,
const JHit_t &  second 
)
inline

Compare two hits by weight.

The template argument JHit_t refers to a data structure which should have the following member methods:

  • double getT(); // [a.u.]
Parameters
firstfirst hit
secondsecond hit
Returns
true if first hit earlier than second; else false

Definition at line 437 of file JAlgorithm.hh.

438  {
439  return first.getT() < second.getT();
440  }
template<class JHit_t >
JBinder2nd<JHit_t> JTRIGGER::JBind2nd ( const JMatch< JHit_t > &  match,
const JHit_t &  second 
)
inline

Auxiliary method to create JBinder2nd object.

Parameters
matchmatch operator
secondsecond hit
Returns
JBinder2nd

Definition at line 70 of file JBind2nd.hh.

71  {
72  return JBinder2nd<JHit_t>(match, second);
73  }
Auxiliary class to convert binary JMatch operator and given hit to unary match operator.
Definition: JBind2nd.hh:26
bool JTRIGGER::operator< ( const JEvent first,
const JEvent second 
)
inline

Less than operator for events.

The less than operator is applied to the first hit in the events.

Parameters
firstfirst event
secondsecond event
Returns
true if first event earliear than second; else false

Definition at line 195 of file JEvent.hh.

196  {
197  if (first.empty() || second.empty()) {
198  throw JTriggerException("Comparison with empty event(s).");
199  }
200 
201  return first.begin()->getT() < second.begin()->getT();
202  }
JTimeRange JTRIGGER::getTimeRange ( const JEvent event)
inline

Get time range (i.e.

earlist and latest hit time) of triggered event.

Parameters
eventevent
Returns
time range

Definition at line 26 of file JEventToolkit.hh.

27  {
28  if (!event.empty())
29  return JTimeRange(event.begin()->getT(), event.rbegin()->getT());
30  else
31  return JTimeRange::DEFAULT_RANGE;
32  }
JRange< double > JTimeRange
Type definition for time range.
bool JTRIGGER::operator< ( const JHit first,
const JHit second 
)
inline

Less than operator for hits.

The less than operator is applied to the time of the hits.

Parameters
firstfirst hit
secondsecond hit
Returns
true if first hit earlier; else false

Definition at line 231 of file JHit.hh.

232  {
233  return first.getT() < second.getT();
234  }
double getT() const
Get calibrated time of hit.
Definition: JHit.hh:143
bool JTRIGGER::operator< ( const JHit hit,
const double  t1 
)
inline

Less than operator for hits.

The less than operator is applied to the time of the hits.

Parameters
hithit
t1time [ns]
Returns
true if hit earlier than t; else false

Definition at line 246 of file JHit.hh.

247  {
248  return hit.getT() < t1;
249  }
double getT() const
Get calibrated time of hit.
Definition: JHit.hh:143
bool JTRIGGER::operator== ( const JHit first,
const JHit second 
)
inline

Equal operator for hits.

The equal operator is applied to the time of the hits.

Parameters
firsthit
secondhit
Returns
true if first hit time equal to second hit time; else false

Definition at line 261 of file JHit.hh.

262  {
263  return first.getT() == second.getT();
264  }
double getT() const
Get calibrated time of hit.
Definition: JHit.hh:143
double JTRIGGER::getTime ( const JDAQHit &  hit,
const JCalibration &  cal 
)
inline

Get calibrated time of DAQ hit.

Parameters
hitDAQ hit
calcalibration
Returns
time [ns]

Definition at line 34 of file JHitToolkit.hh.

35  {
36  return getTime(hit.getT(), cal);
37  }
double getTime(const Hit &hit)
Get true time of hit.
double JTRIGGER::getToT ( const JDAQHit &  hit,
const JCalibration &  cal 
)
inline

Get calibrated time-over-threshold of DAQ hit.

Parameters
hitDAQ hit
calcalibration
Returns
time-over-threshold [ns]

Definition at line 47 of file JHitToolkit.hh.

48  {
49  return getToT(hit.getToT(), cal);
50  }
double getToT(const T &tot, const JCalibration &cal)
Get calibrated time-over-threshold of hit.
template<class JHit_t >
JMatchHelper<JHit_t> JTRIGGER::make_match ( bool(*)(const JHit_t &, const JHit_t &)  match)

Auxiliary method to make JMatch object based on pointer to match function.

Parameters
matchpointer to match function
Returns
match object

Definition at line 106 of file JMatch.hh.

107  {
108  return JMatchHelper<JHit_t>(match);
109  }
Auxiliary class to handle pointer to match function.
Definition: JMatch.hh:54
JPMTMask_t JTRIGGER::getPMTMask ( const unsigned int  bit)
inline

Convert pmt bit to pmt mask.

Parameters
bitpmt bit
Returns
pmt mask

Definition at line 45 of file JPMTMask.hh.

46  {
47  if (bit < NUMBER_OF_PMT_BITS)
48  return JPMTMask_t(1) << bit;
49  else
50  return 0;
51  }
unsigned int JPMTMask_t
Type definition of pmt mask.
Definition: JPMTMask.hh:30
static const unsigned int NUMBER_OF_PMT_BITS
Number of pmt bits.
Definition: JPMTMask.hh:36
JTRIGGER::setTriggerBit ( JTrigger3DShower  ,
 
)
JTRIGGER::setTriggerBit ( JTriggerMXShower  ,
 
)
JTRIGGER::setTriggerBit ( JTrigger3DMuon  ,
 
)
bool JTRIGGER::operator< ( const JTriggeredHit first,
const JTriggeredHit second 
)
inline

Less than operator for triggered hits.

The less than operator is applied first to JTRIGGER::JHit and then to the KM3NETDAQ::JDAQPMTIdentifier. Hence, the ordering by JTRIGGER::JHit is maintained. This allows for the use of STL sort() and set_union() algorithms.

Parameters
firstfirst hit
secondsecond hit
Returns
true if first hit earlier or lower PMT identifier if equal; else false

Definition at line 86 of file JTriggeredHit.hh.

87  {
88  if (std::equal_to<JHit>()(first,second))
89  return std::less<JDAQPMTIdentifier>()(first,second);
90  else
91  return std::less<JHit> ()(first,second);
92  }
bool JTRIGGER::operator== ( const JTriggeredHit first,
const JTriggeredHit second 
)
inline

Equal operator for triggered hits.

The equal operator is applied to JTRIGGER::JHit and to the KM3NETDAQ::JDAQPMTIdentifier.

Parameters
firstfirst hit
secondsecond hit
Returns
true if first hit equal second hit; else false

Definition at line 104 of file JTriggeredHit.hh.

105  {
106  return (std::equal_to<JDAQPMTIdentifier>()(first,second) &&
107  std::equal_to<JHit> ()(first,second));
108  }
std::ostream& JTRIGGER::operator<< ( std::ostream &  out,
const JTriggerException exception 
)
inline

Print error message of JTriggerException.

Parameters
outoutput stream
exceptionJTriggerException

Definition at line 60 of file JTriggerException.hh.

61  {
62  return out << exception.what();
63  }
virtual const char * what() const
Get error message.
template<class JTrigger_t >
JTriggerbit_t JTRIGGER::getTriggerBit ( )
inline

Get the trigger bit.

Returns
trigger bit

Definition at line 212 of file JTriggerInterface.hh.

213  {
215  }
This class is used to map trigger class to trigger bit.
template<class JTrigger_t >
JTriggerbit_t JTRIGGER::getTriggerBit ( const JTrigger_t &  event)
inline

Get the trigger bit.

Parameters
eventtriggered event
Returns
trigger bit

Definition at line 225 of file JTriggerInterface.hh.

226  {
228  }
This class is used to map trigger class to trigger bit.
const char* JTRIGGER::getTriggerName ( JTriggerbit_t  bit)
inline

Get trigger name.

param bit trigger bit

Returns
trigger name

Definition at line 237 of file JTriggerInterface.hh.

238  {
240  }
const char * getTriggerName(JTriggerbit_t bit)
Get trigger name.
void JTRIGGER::setAttributes ( const JModule &  first,
const JModule &  second,
JAttributes attributes 
)
inline

Set module attributes.

Parameters
firstfirst module
secondsecond module
attributesmodule attributes

Definition at line 46 of file JTriggerMXShower.hh.

49  {
50  using namespace JMATH;
51  using namespace JTOOLS;
52 
53  typedef JTriggerMXShower_t::JParameters JParameters_t;
54 
55  // get trigger parameters
56 
57  const JParameters_t& parameters = JParametersHelper<JParameters_t>::getParameters();
58 
59  const double d = getDistance(first, second);
60 
61  double t1 = 0.0;
62 
63  if (d <= 0.5 * parameters.DMax_m)
64  t1 = d * getIndexOfRefraction() * getInverseSpeedOfLight() + parameters.TMaxExtra_ns;
65  else if (d <= parameters.DMax_m)
66  t1 = (parameters.DMax_m - d) * getIndexOfRefraction() * getInverseSpeedOfLight() + parameters.TMaxExtra_ns;
67 
68  attributes.Tmin_ns = -t1;
69  attributes.Tmax_ns = +t1;
70  }
double getIndexOfRefraction()
Get average index of refraction of water.
Definition: JConstants.hh:111
Wrapper class to share parameters.
double getDistance(const JFirst_t &first, const JSecond_t &second)
Get distance between objects.
Definition: JMathToolkit.hh:98
double Tmin_ns
minimal time difference [ns]
const double getInverseSpeedOfLight()
Get inverse speed of light.
Definition: JConstants.hh:100
double Tmax_ns
maximal time difference [ns]
JTimeRange JTRIGGER::getTimeRange ( const JTriggerParameters parameters)
inline

Get time range of snapshot.

Parameters
parameterstrigger parameters
Returns
time range [ns]

Definition at line 29 of file JTriggerToolkit.hh.

30  {
31  return JTimeRange(-parameters.TMaxEvent_ns, +parameters.TMaxEvent_ns);
32  }
JRange< double > JTimeRange
Type definition for time range.
double TMaxEvent_ns
maximal time before and after event for snapshot

Variable Documentation

const JGetRiseTime JTRIGGER::getRiseTime
static

Function object for rise time evaluation.

Definition at line 77 of file JGetRiseTime.hh.

const unsigned int JTRIGGER::NUMBER_OF_PMT_BITS = 31
static

Number of pmt bits.

Definition at line 36 of file JPMTMask.hh.