Jpp
Public Member Functions | Static Public Member Functions | List of all members
JTRIGGER::JHitToolkit< JHit_t, true > Struct Template Reference

Template specialisation of hit toolkit for any primitive data type. More...

#include <JHitToolkit.hh>

Public Member Functions

const JHitToolkit< JHit_t, true > & getToolkit () const
 Get toolkit. More...
 
bool operator() (const JHit_t first, const JHit_t second) const
 Compare time of two hits. More...
 

Static Public Member Functions

static double getT (const JHit_t hit)
 Get time of hit. More...
 
static double getToT (const JHit_t &hit)
 Get time-over-threshold of hit. More...
 
static JHit getJHit (const JHit_t hit)
 Construct JHit. More...
 
static JHit_t getHit (const JDAQHit &hit, const JCalibration &cal)
 Construct hit. More...
 
static JHit_t getEndMarker ()
 Get end marker. More...
 
static JHit_t getTimeDifference (const JHit_t first, const JHit_t second)
 Get time difference between two hits. More...
 
static JHit_t join (const JHit_t &first, const JHit_t &second)
 Join two hits. More...
 

Detailed Description

template<class JHit_t>
struct JTRIGGER::JHitToolkit< JHit_t, true >

Template specialisation of hit toolkit for any primitive data type.

Definition at line 248 of file JHitToolkit.hh.

Member Function Documentation

◆ getToolkit()

template<class JHit_t >
const JHitToolkit<JHit_t, true>& JTRIGGER::JHitToolkit< JHit_t, true >::getToolkit ( ) const
inline

Get toolkit.

Returns
this hit toolkit

Definition at line 255 of file JHitToolkit.hh.

256  {
257  return *this;
258  }

◆ getT()

template<class JHit_t >
static double JTRIGGER::JHitToolkit< JHit_t, true >::getT ( const JHit_t  hit)
inlinestatic

Get time of hit.

Parameters
hithit
Returns
time of hit [ns]

Definition at line 267 of file JHitToolkit.hh.

268  {
269  return hit;
270  }

◆ getToT()

template<class JHit_t >
static double JTRIGGER::JHitToolkit< JHit_t, true >::getToT ( const JHit_t &  hit)
inlinestatic

Get time-over-threshold of hit.

Parameters
hithit
Returns
0

Definition at line 279 of file JHitToolkit.hh.

280  {
281  return 0.0;
282  }

◆ getJHit()

template<class JHit_t >
static JHit JTRIGGER::JHitToolkit< JHit_t, true >::getJHit ( const JHit_t  hit)
inlinestatic

Construct JHit.

Parameters
hithit
Returns
hit

Definition at line 291 of file JHitToolkit.hh.

292  {
293  return JHit(getT(hit), getToT(hit));
294  }

◆ getHit()

template<class JHit_t >
static JHit_t JTRIGGER::JHitToolkit< JHit_t, true >::getHit ( const JDAQHit hit,
const JCalibration cal 
)
inlinestatic

Construct hit.

Parameters
hitDAQ hit
calcalibration
Returns
hit

Definition at line 304 of file JHitToolkit.hh.

305  {
306  return getTime(hit, cal);
307  }

◆ getEndMarker()

template<class JHit_t >
static JHit_t JTRIGGER::JHitToolkit< JHit_t, true >::getEndMarker ( )
inlinestatic

Get end marker.

Returns
latest possible hit

Definition at line 315 of file JHitToolkit.hh.

316  {
317  return std::numeric_limits<JHit_t>::max();
318  }

◆ getTimeDifference()

template<class JHit_t >
static JHit_t JTRIGGER::JHitToolkit< JHit_t, true >::getTimeDifference ( const JHit_t  first,
const JHit_t  second 
)
inlinestatic

Get time difference between two hits.

Parameters
firstfirst hit
secondsecond hit
Returns
time second hit - time first hit [ns]

Definition at line 328 of file JHitToolkit.hh.

329  {
330  return second - first;
331  }

◆ operator()()

template<class JHit_t >
bool JTRIGGER::JHitToolkit< JHit_t, true >::operator() ( const JHit_t  first,
const JHit_t  second 
) const
inline

Compare time of two hits.

Parameters
firstfirst value [ns]
secondsecond value [ns]
Returns
true if second hit later; else false

Definition at line 341 of file JHitToolkit.hh.

342  {
343  return first < second;
344  }

◆ join()

template<class JHit_t >
static JHit_t JTRIGGER::JHitToolkit< JHit_t, true >::join ( const JHit_t &  first,
const JHit_t &  second 
)
inlinestatic

Join two hits.

Note that this method returns the first hit as-is.

Parameters
firstfirst hit
secondsecond hit
Returns
joined hit

Definition at line 356 of file JHitToolkit.hh.

357  {
358  return first;
359  }

The documentation for this struct was generated from the following file:
JTRIGGER::getTime
double getTime(const JDAQHit &hit, const JCalibration &cal)
Get calibrated time of DAQ hit.
Definition: JHitToolkit.hh:34
JTRIGGER::JHitToolkit< JHit_t, true >::getT
static double getT(const JHit_t hit)
Get time of hit.
Definition: JHitToolkit.hh:267
JTRIGGER::JHit
Hit data structure.
Definition: JHit.hh:22
JTRIGGER::JHitToolkit< JHit_t, true >::getToT
static double getToT(const JHit_t &hit)
Get time-over-threshold of hit.
Definition: JHitToolkit.hh:279