Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
JTRIGGER::JDAQHitToTSelector Struct Reference

Auxiliary class to select DAQ hits based on time-over-treshold value. More...

#include <JDAQHitToTSelector.hh>

Inheritance diagram for JTRIGGER::JDAQHitToTSelector:
JLANG::JClonable< JClonable_t, JDerived_t > JTOOLS::JRange< JDAQHit::JTOT_t > JTOOLS::JPair< JKey_t, JValue_t > JLANG::JEquals< JFirst_t, JSecond_t > JMATH::JMath< JFirst_t, JSecond_t >

Public Types

typedef JDAQHit::JTOT_t JTOT_t
 
typedef JTOOLS::JRange< JTOT_trange_type
 
typedef JClonable< JClonable_t >
::clone_type 
clone_type
 
typedef JLANG::JClass
< JDAQHit::JTOT_t >
::argument_type 
argument_type
 
typedef JKey_t key_type
 
typedef JValue_t mapped_type
 

Public Member Functions

 JDAQHitToTSelector ()
 Default constructor. More...
 
 JDAQHitToTSelector (const JTOT_t tot_min, const JTOT_t tot_max)
 Constructor. More...
 
virtual bool operator() (const JDAQHit &hit) const
 DAQ hit selection. More...
 
virtual clone_type clone () const
 Get clone of this object. More...
 
const range_typegetRange () const
 Get range. More...
 
void setRange (const range_type &range)
 Set range. More...
 
void setRange (argument_type x, argument_type y)
 Set lower and upper limit. More...
 
void setRange (R first, R second)
 Set range. More...
 
void setRange (iterator_type __begin, iterator_type __end, result_type value_type::*member)
 Set lower and upper limit according to minimal and maximal value in input data, respectively. More...
 
void setRange (iterator_type __begin, iterator_type __end, result_type(value_type::*function)() const)
 Set lower and upper limit according to minimal and maximal value in input data, respectively. More...
 
JDAQHit::JTOT_t getLowerLimit () const
 Get lower limit. More...
 
JDAQHit::JTOT_t getUpperLimit () const
 Get upper limit. More...
 
void setLowerLimit (argument_type x)
 Set lower limit. More...
 
void setUpperLimit (argument_type y)
 Set upper limit. More...
 
void fixLowerLimit (argument_type x)
 Fix lower limit. More...
 
void fixUpperLimit (argument_type y)
 Fix upper limit. More...
 
bool equals (const range_type &range) const
 Equal method. More...
 
JDAQHit::JTOT_t getLength () const
 Get length (difference between upper and lower limit). More...
 
void setLength (argument_type length)
 Set length (difference between upper and lower limit). More...
 
bool is_valid () const
 Check validity of range. More...
 
bool operator() (argument_type x) const
 Test whether value is inside range. More...
 
JDAQHit::JTOT_t constrain (argument_type x) const
 Constrain value to range. More...
 
JDAQHit::JTOT_t mod (argument_type x) const
 Modulo value with respect to range. More...
 
bool overlap (const range_type &range) const
 Test overlap with given range. More...
 
range_type include (argument_type x)
 Include given value to range. More...
 
range_typejoin (const range_type &range)
 Join ranges. More...
 
range_typecombine (const range_type &range)
 Combine ranges. More...
 
range_typeadd (argument_type x)
 Add offset. More...
 
range_typeadd (const range_type &range)
 Add offsets. More...
 
range_typesub (argument_type x)
 Subtract offset. More...
 
range_typesub (const range_type &range)
 Subtract offsets. More...
 
range_typemul (const double factor)
 Multiply range. More...
 
JFirst_t & mul (const JSecond_t &object)
 Multiply with object. More...
 
range_typediv (const double factor)
 Divide range. More...
 
JDAQHit::JTOT_t getN (const double R) const
 Get expected number of occurances of given rate within this interval. More...
 
const key_typegetKey () const
 
const mapped_typegetValue () const
 
mapped_typegetValue ()
 

Static Public Member Functions

static JDAQHit::JTOT_t getMinimum ()
 Get minimum possible value. More...
 
static JDAQHit::JTOT_t getMaximum ()
 Get maximum possible value. More...
 

Public Attributes

std::less< JDAQHit::JTOT_tcompare
 Function object. More...
 
JKey_t first
 
JValue_t second
 

Static Public Attributes

static const JRange
< JDAQHit::JTOT_t, std::less
< JDAQHit::JTOT_t > > 
DEFAULT_RANGE
 Default range. More...
 

Protected Member Functions

void setRange (R first, R second, const JLANG::JBool< false > &option)
 Set range. More...
 
void setRange (R first, R second, const JLANG::JBool< true > &option)
 Set range. More...
 

Detailed Description

Auxiliary class to select DAQ hits based on time-over-treshold value.

Definition at line 25 of file JDAQHitToTSelector.hh.

Member Typedef Documentation

Definition at line 29 of file JDAQHitToTSelector.hh.

Definition at line 30 of file JDAQHitToTSelector.hh.

template<class JClonable_t, class JDerived_t = JNullType>
typedef JClonable<JClonable_t>::clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone_type
inherited

Definition at line 61 of file JClonable.hh.

Definition at line 42 of file JRange.hh.

template<class JKey_t, class JValue_t>
typedef JKey_t JTOOLS::JPair< JKey_t, JValue_t >::key_type
inherited

Definition at line 32 of file JPair.hh.

template<class JKey_t, class JValue_t>
typedef JValue_t JTOOLS::JPair< JKey_t, JValue_t >::mapped_type
inherited

Definition at line 33 of file JPair.hh.

Constructor & Destructor Documentation

JTRIGGER::JDAQHitToTSelector::JDAQHitToTSelector ( )
inline

Default constructor.

Definition at line 36 of file JDAQHitToTSelector.hh.

36  :
37  range_type(0, std::numeric_limits<JTOT_t>::max())
38  {}
JTOOLS::JRange< JTOT_t > range_type
JTRIGGER::JDAQHitToTSelector::JDAQHitToTSelector ( const JTOT_t  tot_min,
const JTOT_t  tot_max 
)
inline

Constructor.

Parameters
tot_minminimal time-over-threshold
tot_maxmaximal time-over-threshold

Definition at line 47 of file JDAQHitToTSelector.hh.

47  :
48  range_type(tot_min, tot_max)
49  {}
JTOOLS::JRange< JTOT_t > range_type

Member Function Documentation

virtual bool JTRIGGER::JDAQHitToTSelector::operator() ( const JDAQHit hit) const
inlinevirtual

DAQ hit selection.

Parameters
hitDAQ hit
Returns
true to select; else false

Definition at line 58 of file JDAQHitToTSelector.hh.

59  {
60  return static_cast<const range_type&>(*this)(hit.getToT());
61  }
JTOT_t getToT() const
Get time-over-threshold.
Definition: JDAQHit.hh:97
JTOOLS::JRange< JTOT_t > range_type
template<class JClonable_t, class JDerived_t = JNullType>
virtual clone_type JLANG::JClonable< JClonable_t, JDerived_t >::clone ( ) const
inlinevirtualinherited
const range_type& JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::getRange ( ) const
inlineinherited

Get range.

Returns
range

Definition at line 128 of file JRange.hh.

129  {
130  return static_cast<const range_type&>(*this);
131  }
JRange< JDAQHit::JTOT_t, std::less< JDAQHit::JTOT_t > > range_type
Definition: JRange.hh:41
void JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::setRange ( const range_type range)
inlineinherited

Set range.

Parameters
rangerange

Definition at line 139 of file JRange.hh.

140  {
141  static_cast<range_type&>(*this) = range;
142  }
JRange< JDAQHit::JTOT_t, std::less< JDAQHit::JTOT_t > > range_type
Definition: JRange.hh:41
void JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::setRange ( argument_type  x,
argument_type  y 
)
inlineinherited

Set lower and upper limit.

Parameters
xlower limit
yupper limit

Definition at line 151 of file JRange.hh.

152  {
153  this->first = x;
154  this->second = y;
155  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
void JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::setRange ( R  first,
R  second 
)
inlineinherited

Set range.


The arguments could be values or iterators.

Parameters
firstfirst
secondsecond

Definition at line 166 of file JRange.hh.

167  {
168  using namespace JLANG;
169 
171  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
Auxiliary template class for type bool.
Definition: JBool.hh:20
Data structure to check whether given data type is an iterator.
Definition: JClass.hh:62
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:139
void JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::setRange ( iterator_type  __begin,
iterator_type  __end,
result_type value_type::*  member 
)
inlineinherited

Set lower and upper limit according to minimal and maximal value in input data, respectively.

Parameters
__beginbegin of data
__endend of data
memberpointer to data member

Definition at line 182 of file JRange.hh.

183  {
185 
186  for (iterator_type i = __begin; i != __end; ++i) {
187  include((*i).*member);
188  }
189  }
range_type include(argument_type x)
Include given value to range.
Definition: JRange.hh:399
static JDAQHit::JTOT_t getMinimum()
Get minimum possible value.
Definition: JRange.hh:548
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:139
static JDAQHit::JTOT_t getMaximum()
Get maximum possible value.
Definition: JRange.hh:559
void JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::setRange ( iterator_type  __begin,
iterator_type  __end,
result_type(value_type::*)() const  function 
)
inlineinherited

Set lower and upper limit according to minimal and maximal value in input data, respectively.

Parameters
__beginbegin of data
__endend of data
functionpointer to member method

Definition at line 200 of file JRange.hh.

201  {
203 
204  for (iterator_type i = __begin; i != __end; ++i) {
205  include(((*i).*function)());
206  }
207  }
range_type include(argument_type x)
Include given value to range.
Definition: JRange.hh:399
static JDAQHit::JTOT_t getMinimum()
Get minimum possible value.
Definition: JRange.hh:548
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:139
static JDAQHit::JTOT_t getMaximum()
Get maximum possible value.
Definition: JRange.hh:559
void JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::setRange ( R  first,
R  second,
const JLANG::JBool< false > &  option 
)
inlineprotectedinherited

Set range.

Parameters
firstfirst
secondsecond
optionfalse

Definition at line 590 of file JRange.hh.

591  {
593  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:139
JLANG::JClass< JDAQHit::JTOT_t >::argument_type argument_type
Definition: JRange.hh:42
void JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::setRange ( R  first,
R  second,
const JLANG::JBool< true > &  option 
)
inlineprotectedinherited

Set range.

Parameters
firstfirst
secondsecond
optiontrue

Definition at line 604 of file JRange.hh.

605  {
607 
608  for (R i = first; i != second; ++i) {
609  include(*i);
610  }
611  }
range_type include(argument_type x)
Include given value to range.
Definition: JRange.hh:399
JValue_t second
Definition: JPair.hh:129
static JDAQHit::JTOT_t getMinimum()
Get minimum possible value.
Definition: JRange.hh:548
JKey_t first
Definition: JPair.hh:128
void setRange(const range_type &range)
Set range.
Definition: JRange.hh:139
static JDAQHit::JTOT_t getMaximum()
Get maximum possible value.
Definition: JRange.hh:559
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:40
JDAQHit::JTOT_t JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::getLowerLimit ( ) const
inlineinherited

Get lower limit.

Returns
lower limit

Definition at line 215 of file JRange.hh.

216  {
217  return this->first;
218  }
JKey_t first
Definition: JPair.hh:128
JDAQHit::JTOT_t JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::getUpperLimit ( ) const
inlineinherited

Get upper limit.

Returns
upper limit

Definition at line 226 of file JRange.hh.

227  {
228  return this->second;
229  }
JValue_t second
Definition: JPair.hh:129
void JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::setLowerLimit ( argument_type  x)
inlineinherited

Set lower limit.

Parameters
xlower limit

Definition at line 237 of file JRange.hh.

238  {
239  this->first = x;
240  }
JKey_t first
Definition: JPair.hh:128
void JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::setUpperLimit ( argument_type  y)
inlineinherited

Set upper limit.

Parameters
yupper limit

Definition at line 248 of file JRange.hh.

249  {
250  this->second = y;
251  }
JValue_t second
Definition: JPair.hh:129
void JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::fixLowerLimit ( argument_type  x)
inlineinherited

Fix lower limit.

The range is shifted to the given lower limit.

Parameters
xlower limit

Definition at line 261 of file JRange.hh.

262  {
263  this->second += x - this->first;
264  this->first = x;
265  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
void JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::fixUpperLimit ( argument_type  y)
inlineinherited

Fix upper limit.

The range is shifted to the given upper limit.

Parameters
yupper limit

Definition at line 275 of file JRange.hh.

276  {
277  this->first += y - this->second;
278  this->second = y;
279  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
bool JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::equals ( const range_type range) const
inlineinherited

Equal method.

Parameters
rangerange
Returns
true if this module range equal to given module range; else false

Definition at line 288 of file JRange.hh.

289  {
290  return (!this->compare(this->getLowerLimit(), range.getLowerLimit()) &&
291  !this->compare(range.getLowerLimit(), this->getLowerLimit()) &&
292  !this->compare(this->getUpperLimit(), range.getUpperLimit()) &&
293  !this->compare(range.getUpperLimit(), this->getUpperLimit()));
294  }
JDAQHit::JTOT_t getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
std::less< JDAQHit::JTOT_t > compare
Function object.
Definition: JRange.hh:579
JDAQHit::JTOT_t getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
JDAQHit::JTOT_t JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::getLength ( ) const
inlineinherited

Get length (difference between upper and lower limit).

Returns
length

Definition at line 302 of file JRange.hh.

303  {
304  return getUpperLimit() - getLowerLimit();
305  }
JDAQHit::JTOT_t getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
JDAQHit::JTOT_t getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
void JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::setLength ( argument_type  length)
inlineinherited

Set length (difference between upper and lower limit).

Parameters
lengthlength

Definition at line 313 of file JRange.hh.

314  {
315  setUpperLimit(getLowerLimit() + length);
316  }
JDAQHit::JTOT_t getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
void setUpperLimit(argument_type y)
Set upper limit.
Definition: JRange.hh:248
bool JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::is_valid ( ) const
inlineinherited

Check validity of range.

Returns
true if lower limit less than or equal to upper limit; else false

Definition at line 324 of file JRange.hh.

325  {
326  return !compare(getUpperLimit(), getLowerLimit());
327  }
JDAQHit::JTOT_t getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
std::less< JDAQHit::JTOT_t > compare
Function object.
Definition: JRange.hh:579
JDAQHit::JTOT_t getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
bool JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::operator() ( argument_type  x) const
inlineinherited

Test whether value is inside range.

Parameters
xvalue
Returns
true if lower limit <= value <= upper limit; else false

Definition at line 336 of file JRange.hh.

337  {
338  return (!compare(x, getLowerLimit()) &&
339  !compare(getUpperLimit(), x));
340  }
JDAQHit::JTOT_t getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
std::less< JDAQHit::JTOT_t > compare
Function object.
Definition: JRange.hh:579
JDAQHit::JTOT_t getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
JDAQHit::JTOT_t JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::constrain ( argument_type  x) const
inlineinherited

Constrain value to range.


This method returns the original value if it is in this range, else lower limit if value < lower limit or upper limit if value > upper limit.

Parameters
xvalue
Returns
lower limit <= x <= upper limit

Definition at line 351 of file JRange.hh.

352  {
353  if (compare(x, getLowerLimit())) { return getLowerLimit(); }
354  if (compare(getUpperLimit(), x)) { return getUpperLimit(); }
355 
356  return x;
357  }
JDAQHit::JTOT_t getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
std::less< JDAQHit::JTOT_t > compare
Function object.
Definition: JRange.hh:579
JDAQHit::JTOT_t getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
JDAQHit::JTOT_t JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::mod ( argument_type  x) const
inlineinherited

Modulo value with respect to range.


Parameters
xvalue
Returns
lower limit <= x <= upper limit

Definition at line 366 of file JRange.hh.

367  {
368  if (compare(x, getLowerLimit()))
369  return x + getLength() * floor((getUpperLimit() - x) / getLength());
370  else if (compare(getUpperLimit(), x))
371  return x - getLength() * floor((x - getLowerLimit()) / getLength());
372  else
373  return x;
374  }
JDAQHit::JTOT_t getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
std::less< JDAQHit::JTOT_t > compare
Function object.
Definition: JRange.hh:579
JDAQHit::JTOT_t getLength() const
Get length (difference between upper and lower limit).
Definition: JRange.hh:302
JDAQHit::JTOT_t getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
bool JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::overlap ( const range_type range) const
inlineinherited

Test overlap with given range.


The result is equivalent to join(range).is_valid().

Parameters
rangerange
Returns
true if there is a non-zero overlap; else false

Definition at line 384 of file JRange.hh.

385  {
386  return (compare(getLowerLimit(), range.getUpperLimit()) &&
387  compare(range.getLowerLimit(), getUpperLimit()));
388  }
JDAQHit::JTOT_t getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
std::less< JDAQHit::JTOT_t > compare
Function object.
Definition: JRange.hh:579
JDAQHit::JTOT_t getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
range_type JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::include ( argument_type  x)
inlineinherited

Include given value to range.


The new lower limit is the minimim of the original lower limit and given value and
the new upper limit is the maximum of the original upper limit and given value;

Parameters
xvalue
Returns
range

Definition at line 399 of file JRange.hh.

400  {
401  if (compare(x, getLowerLimit())) { setLowerLimit(x); }
402  if (compare(getUpperLimit(), x)) { setUpperLimit(x); }
403 
404  return *this;
405  }
JDAQHit::JTOT_t getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
std::less< JDAQHit::JTOT_t > compare
Function object.
Definition: JRange.hh:579
void setUpperLimit(argument_type y)
Set upper limit.
Definition: JRange.hh:248
JDAQHit::JTOT_t getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
void setLowerLimit(argument_type x)
Set lower limit.
Definition: JRange.hh:237
range_type& JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::join ( const range_type range)
inlineinherited

Join ranges.


The new lower limit is the maximim of the two lower limits and
the new upper limit is the minimum of the two upper limits.
This operation results in an equal or smaller range and may result in an unphysical range (i.e. lower limit > upper limit).

Parameters
rangerange

Definition at line 417 of file JRange.hh.

418  {
419  if (compare(getLowerLimit(), range.getLowerLimit())) { setLowerLimit(range.getLowerLimit()); }
420  if (compare(range.getUpperLimit(), getUpperLimit())) { setUpperLimit(range.getUpperLimit()); }
421 
422  return *this;
423  }
JDAQHit::JTOT_t getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
std::less< JDAQHit::JTOT_t > compare
Function object.
Definition: JRange.hh:579
void setUpperLimit(argument_type y)
Set upper limit.
Definition: JRange.hh:248
JDAQHit::JTOT_t getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
void setLowerLimit(argument_type x)
Set lower limit.
Definition: JRange.hh:237
range_type& JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::combine ( const range_type range)
inlineinherited

Combine ranges.


The new lower limit is the minimim of the two lower limits and
the new upper limit is the maximum of the two upper limits.
This operation results in an equal or larger range.

Parameters
rangerange

Definition at line 434 of file JRange.hh.

435  {
436  if (compare(range.getLowerLimit(), getLowerLimit())) { setLowerLimit(range.getLowerLimit()); }
437  if (compare(getUpperLimit(), range.getUpperLimit())) { setUpperLimit(range.getUpperLimit()); }
438 
439  return *this;
440  }
JDAQHit::JTOT_t getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
std::less< JDAQHit::JTOT_t > compare
Function object.
Definition: JRange.hh:579
void setUpperLimit(argument_type y)
Set upper limit.
Definition: JRange.hh:248
JDAQHit::JTOT_t getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
void setLowerLimit(argument_type x)
Set lower limit.
Definition: JRange.hh:237
range_type& JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::add ( argument_type  x)
inlineinherited

Add offset.

Parameters
xoffset

Definition at line 448 of file JRange.hh.

449  {
450  this->first += x;
451  this->second += x;
452 
453  return *this;
454  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
range_type& JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::add ( const range_type range)
inlineinherited

Add offsets.


The new lower limit is the sum of the two lower limits and
the new upper limit is the sum of the two upper limits.

Parameters
rangeoffset

Definition at line 478 of file JRange.hh.

479  {
480  this->first += range.getLowerLimit();
481  this->second += range.getUpperLimit();
482 
483  return *this;
484  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
range_type& JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::sub ( argument_type  x)
inlineinherited

Subtract offset.

Parameters
xoffset

Definition at line 462 of file JRange.hh.

463  {
464  this->first -= x;
465  this->second -= x;
466 
467  return *this;
468  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
range_type& JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::sub ( const range_type range)
inlineinherited

Subtract offsets.


The new lower limit is the difference of the two lower limits and
the new upper limit is the difference of the two upper limits.

Parameters
rangeoffset

Definition at line 494 of file JRange.hh.

495  {
496  this->first -= range.getLowerLimit();
497  this->second -= range.getUpperLimit();
498 
499  return *this;
500  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
range_type& JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::mul ( const double  factor)
inlineinherited

Multiply range.

Parameters
factorfactor

Definition at line 508 of file JRange.hh.

509  {
510  this->first *= factor;
511  this->second *= factor;
512 
513  return *this;
514  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
template<class JFirst_t, class JSecond_t = JNullType>
JFirst_t& JMATH::JMath< JFirst_t, JSecond_t >::mul ( const JSecond_t &  object)
inlineinherited

Multiply with object.

Parameters
objectobject
Returns
result object

Definition at line 273 of file JMath.hh.

274  {
275  return static_cast<JFirst_t&>(*this) = JCalculator<JFirst_t>::calculator.mul(static_cast<const JFirst_t&>(*this), object);
276  }
Auxiliary class for arithmetic operations on objects.
Definition: JCalculator.hh:18
range_type& JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::div ( const double  factor)
inlineinherited

Divide range.

Parameters
factorfactor

Definition at line 522 of file JRange.hh.

523  {
524  this->first /= factor;
525  this->second /= factor;
526 
527  return *this;
528  }
JValue_t second
Definition: JPair.hh:129
JKey_t first
Definition: JPair.hh:128
JDAQHit::JTOT_t JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::getN ( const double  R) const
inlineinherited

Get expected number of occurances of given rate within this interval.

Parameters
Rrate
Returns
expectation value

Definition at line 537 of file JRange.hh.

538  {
539  return R * (getUpperLimit() - getLowerLimit());
540  }
JDAQHit::JTOT_t getLowerLimit() const
Get lower limit.
Definition: JRange.hh:215
JDAQHit::JTOT_t getUpperLimit() const
Get upper limit.
Definition: JRange.hh:226
then usage $script[distance] fi case set_variable R
Definition: JDrawLED.sh:40
static JDAQHit::JTOT_t JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::getMinimum ( )
inlinestaticinherited

Get minimum possible value.

Returns
minimum possible value

Definition at line 548 of file JRange.hh.

549  {
550  return JMATH::JLimits<T>::min();
551  }
float min()
Definition: JLimits.hh:96
static JDAQHit::JTOT_t JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::getMaximum ( )
inlinestaticinherited

Get maximum possible value.

Returns
maximum possible value

Definition at line 559 of file JRange.hh.

560  {
561  return JMATH::JLimits<T>::max();
562  }
template<class JKey_t, class JValue_t>
const key_type& JTOOLS::JPair< JKey_t, JValue_t >::getKey ( ) const
inlineinherited

Definition at line 123 of file JPair.hh.

123 { return this->first; }
JKey_t first
Definition: JPair.hh:128
template<class JKey_t, class JValue_t>
const mapped_type& JTOOLS::JPair< JKey_t, JValue_t >::getValue ( ) const
inlineinherited

Definition at line 124 of file JPair.hh.

124 { return this->second; }
JValue_t second
Definition: JPair.hh:129
template<class JKey_t, class JValue_t>
mapped_type& JTOOLS::JPair< JKey_t, JValue_t >::getValue ( )
inlineinherited

Definition at line 126 of file JPair.hh.

126 { return this->second; }
JValue_t second
Definition: JPair.hh:129

Member Data Documentation

const JRange<JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > > JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::DEFAULT_RANGE
staticinherited

Default range.

This range corresponds to an unphysical range.

Definition at line 569 of file JRange.hh.

std::less<JDAQHit::JTOT_t > JTOOLS::JRange< JDAQHit::JTOT_t , std::less<JDAQHit::JTOT_t > >::compare
inherited

Function object.

Parameters
firstfirst argument
secondsecond argument
Returns
true if first < second; else false

Definition at line 579 of file JRange.hh.

template<class JKey_t, class JValue_t>
JKey_t JTOOLS::JPair< JKey_t, JValue_t >::first
inherited

Definition at line 128 of file JPair.hh.

template<class JKey_t, class JValue_t>
JValue_t JTOOLS::JPair< JKey_t, JValue_t >::second
inherited

Definition at line 129 of file JPair.hh.


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