Jpp  18.2.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
JTRIGGER::JHit Class Reference

Hit data structure. More...

#include <JHit.hh>

Inheritance diagram for JTRIGGER::JHit:
JTRIGGER::JHitL0 JTRIGGER::JHitR0 JTRIGGER::JHitR1 JTRIGGER::JTriggeredHit JRECONSTRUCTION::JHitW0

Public Member Functions

 JHit ()
 Default constructor. More...
 
 JHit (const double t_ns)
 Constructor. More...
 
 JHit (const double t_ns, const double tot_ns)
 Constructor. More...
 
template<class T >
 JHit (T __begin, T __end)
 Get combined hit. More...
 
const JHitgetHit () const
 Get hit. More...
 
 operator double () const
 Type conversion. More...
 
double getT () const
 Get calibrated time of hit. More...
 
double getToT () const
 Get calibrated time over threshold of hit. More...
 
double getT1 () const
 Get leading edge of hit. More...
 
double getT2 () const
 Get trailing edge of hit. More...
 
void join (const JHit &hit)
 Join hit. More...
 

Static Public Member Functions

static bool getSlewing ()
 Get slewing option. More...
 
static void setSlewing (const bool slewing)
 Set slewing option. More...
 

Static Protected Member Functions

static bool & get_slewing ()
 Get reference to slewing parameter. More...
 

Protected Attributes

double t
 time of leading edge [ns] More...
 
double tot
 time-over-threshold [ns] More...
 

Detailed Description

Hit data structure.

Definition at line 22 of file JTrigger/JHit.hh.

Constructor & Destructor Documentation

JTRIGGER::JHit::JHit ( )
inline

Default constructor.

Definition at line 28 of file JTrigger/JHit.hh.

28  :
29  t(0.0),
30  tot(0.0)
31  {}
double t
time of leading edge [ns]
double tot
time-over-threshold [ns]
JTRIGGER::JHit::JHit ( const double  t_ns)
inline

Constructor.

Parameters
t_nscalibrated time of hit [ns]

Definition at line 39 of file JTrigger/JHit.hh.

39  :
40  t(t_ns),
41  tot(0.0)
42  {}
double t
time of leading edge [ns]
double tot
time-over-threshold [ns]
JTRIGGER::JHit::JHit ( const double  t_ns,
const double  tot_ns 
)
inline

Constructor.

Parameters
t_nscalibrated time of hit [ns]
tot_nstime over threshold of hit [ns]

Definition at line 50 of file JTrigger/JHit.hh.

50  :
51  t(t_ns),
52  tot(tot_ns)
53  {}
double t
time of leading edge [ns]
double tot
time-over-threshold [ns]
template<class T >
JTRIGGER::JHit::JHit ( T  __begin,
T  __end 
)
inline

Get combined hit.

Note that:

  • leading edge of this hit is set to the earliest leading edge of the all hits;
  • trailing edge of this hit is set to the latest trailing edge of the all hits;

It is assumed that the template class has the following methods:

     getT();
     getToT();

which should return the time and time over threshold, respectively.

Parameters
__beginbegin of hits
__endend of hits

Definition at line 74 of file JTrigger/JHit.hh.

74  :
75  t(0.0),
76  tot(0.0)
77  {
78  if (__begin != __end) {
79 
80  double t1 = __begin->getT1();
81  double t2 = __begin->getT2();
82 
83  for (T i = __begin; ++i != __end; ) {
84  if (t1 > i->getT1()) { t1 = i->getT1(); }
85  if (t2 < i->getT2()) { t2 = i->getT2(); }
86  }
87 
88  this->t = t1;
89  this->tot = t2 - t1;
90  }
91  }
double t
time of leading edge [ns]
double getT2() const
Get trailing edge of hit.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
double tot
time-over-threshold [ns]

Member Function Documentation

const JHit& JTRIGGER::JHit::getHit ( ) const
inline

Get hit.

Returns
hit

Definition at line 99 of file JTrigger/JHit.hh.

100  {
101  return static_cast<const JHit&>(*this);
102  }
Hit data structure.
static bool JTRIGGER::JHit::getSlewing ( )
inlinestatic

Get slewing option.

Returns
slewing option

Definition at line 110 of file JTrigger/JHit.hh.

111  {
112  return get_slewing();
113  }
static bool & get_slewing()
Get reference to slewing parameter.
static void JTRIGGER::JHit::setSlewing ( const bool  slewing)
inlinestatic

Set slewing option.

Parameters
slewingslewing option

Definition at line 121 of file JTrigger/JHit.hh.

122  {
123  get_slewing() = slewing;
124  }
static bool & get_slewing()
Get reference to slewing parameter.
then $JPP_DIR examples JDetector JSlewing P slewing
Definition: JSlewing.sh:43
JTRIGGER::JHit::operator double ( ) const
inline

Type conversion.

Returns
time [ns]

Definition at line 132 of file JTrigger/JHit.hh.

133  {
134  return t;
135  }
double t
time of leading edge [ns]
double JTRIGGER::JHit::getT ( ) const
inline

Get calibrated time of hit.

Returns
time [ns]

Definition at line 143 of file JTrigger/JHit.hh.

144  {
145  if (!getSlewing())
146  return t;
147  else
148  return t - getRiseTime(tot);
149  }
static bool getSlewing()
Get slewing option.
double t
time of leading edge [ns]
static const JGetRiseTime getRiseTime
Function object for rise time evaluation.
double tot
time-over-threshold [ns]
double JTRIGGER::JHit::getToT ( ) const
inline

Get calibrated time over threshold of hit.

Returns
time over threshold [ns]

Definition at line 157 of file JTrigger/JHit.hh.

158  {
159  return tot;
160  }
double tot
time-over-threshold [ns]
double JTRIGGER::JHit::getT1 ( ) const
inline

Get leading edge of hit.

Note that no slewing correction is applied.

Returns
time [ns]

Definition at line 170 of file JTrigger/JHit.hh.

171  {
172  return t;
173  }
double t
time of leading edge [ns]
double JTRIGGER::JHit::getT2 ( ) const
inline

Get trailing edge of hit.

Note that no slewing correction is applied.

Returns
time [ns]

Definition at line 183 of file JTrigger/JHit.hh.

184  {
185  return t + tot;
186  }
double t
time of leading edge [ns]
double tot
time-over-threshold [ns]
void JTRIGGER::JHit::join ( const JHit hit)
inline

Join hit.

Note that:

  • leading edge of this hit is maintained;
  • time over threshold of this hit is set to the difference between the trailing edge of given hit and leading edge of this hit;
Parameters
hithit

Definition at line 198 of file JTrigger/JHit.hh.

199  {
200  this->tot = hit.getT2() - this->getT1();
201  }
double getT1() const
Get leading edge of hit.
double getT2() const
Get trailing edge of hit.
double tot
time-over-threshold [ns]
static bool& JTRIGGER::JHit::get_slewing ( )
inlinestaticprotected

Get reference to slewing parameter.

Returns
reference to slewing parameter

Definition at line 213 of file JTrigger/JHit.hh.

214  {
215  static bool slewing = true;
216 
217  return slewing;
218  }
then $JPP_DIR examples JDetector JSlewing P slewing
Definition: JSlewing.sh:43

Member Data Documentation

double JTRIGGER::JHit::t
protected

time of leading edge [ns]

Definition at line 204 of file JTrigger/JHit.hh.

double JTRIGGER::JHit::tot
protected

time-over-threshold [ns]

Definition at line 205 of file JTrigger/JHit.hh.


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