Belle II Software  release-08-01-10
StepLimits Class Reference

Helper to store different limits on the stepsize for the RKTRackRep. More...

#include <StepLimits.h>

Collaboration diagram for StepLimits:

Public Member Functions

 StepLimits (const StepLimits &)=default
 
StepLimitsoperator= (const StepLimits &other)
 
double getLimit (StepLimitType type) const
 Get limit of type. If that limit has not yet been set, return max double value.
 
double getLimitSigned (StepLimitType type) const
 
std::pair< StepLimitType, double > getLowestLimit (double margin=1.E-3) const
 Get the lowest limit. More...
 
double getLowestLimitVal (double margin=1.E-3) const
 Get the unsigned numerical value of the lowest limit.
 
double getLowestLimitSignedVal (double margin=1.E-3) const
 Get the numerical value of the lowest limit, signed with #stepSign_.
 
char getStepSign () const
 
void reduceLimit (StepLimitType type, double value)
 absolute of value will be taken! If limit is already lower, it will stay.
 
void setLimit (StepLimitType type, double value)
 absolute of value will be taken! If limit is already lower, it will be set to value anyway.
 
void setStepSign (char signedVal)
 sets #stepSign_ to sign of signedVal
 
void setStepSign (double signedVal)
 sets #stepSign_ to sign of signedVal
 
void removeLimit (StepLimitType type)
 
void reset ()
 
void Print ()
 

Private Attributes

std::vector< double > limits_
 
signed char stepSign_
 

Static Private Attributes

static const double maxLimit_ = 99.E99
 

Detailed Description

Helper to store different limits on the stepsize for the RKTRackRep.

Definition at line 54 of file StepLimits.h.

Member Function Documentation

◆ getLowestLimit()

std::pair< StepLimitType, double > getLowestLimit ( double  margin = 1.E-3) const

Get the lowest limit.

If hard limits are there, medium limits can be exceeded by up to margin (default margin is 0.1, i.e. medium limits can be exceeded by up to 10%). If no limit has been set yet, return std::pair<stp_noLimit, std::numeric_limits<double>::max>.

Definition at line 44 of file StepLimits.cc.

44  {
45 
46  double lowest(maxLimit_);
47  unsigned int iLowest(0);
48 
49  for (unsigned int i=1; i<ENUM_NR_ITEMS; ++i) {
50 
51  // lowest hard limit may exceed lowest soft limit by up to #margin
52  if (i == int(stp_sMaxArg))
53  lowest *= (1+margin);
54 
55  if (limits_[i] < lowest) {
56  lowest = limits_[i];
57  iLowest = i;
58  }
59  }
60 
61  return std::pair<StepLimitType, double>(static_cast<StepLimitType>(iLowest), lowest);
62 }

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