Jpp  master_rocky-43-ge265d140c
the software that should make you happy
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
JDETECTOR::JTransferFunction1D< JAbscissa_t, JOrdinate_t > Class Template Referenceabstract

Auxiliary class for a non-linear transfer function of TDC inside FPGA. More...

#include <JCLBDefaultSimulator.hh>

Inheritance diagram for JDETECTOR::JTransferFunction1D< JAbscissa_t, JOrdinate_t >:
JTOOLS::JPolintFunction1D< 0, JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t >, JTOOLS::JGridCollection, JOrdinate_t > JTOOLS::JPolintFunction< N, JElement_t, JCollection_t, JResult_t, JDistance_t > JTOOLS::JFunction1D< JArgument_t, JResult_t > JTOOLS::JFunctional< JArgument_t, JResult_t >

Public Types

typedef JTOOLS::JPolintFunction1D< 0, JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t >, JTOOLS::JGridCollection, JOrdinate_t > JFunction1D_t
 
typedef JTOOLS::JGridCollection< JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t >, JDistance< typename JElement_t::abscissa_type > > collection_type
 
typedef collection_type::abscissa_type abscissa_type
 
typedef collection_type::ordinate_type ordinate_type
 
typedef collection_type::value_type value_type
 
typedef collection_type::distance_type distance_type
 
typedef collection_type::const_iterator const_iterator
 
typedef collection_type::const_reverse_iterator const_reverse_iterator
 
typedef collection_type::iterator iterator
 
typedef collection_type::reverse_iterator reverse_iterator
 
typedef JFunction1D< abscissa_type, JOrdinate_t > function_type
 
typedef function_type::argument_type argument_type
 
typedef function_type::result_type result_type
 
typedef function_type::JExceptionHandler exceptionhandler_type
 
enum  { NUMBER_OF_DIMENSIONS = 1 }
 
typedef JFunctional< JArgument_t, JResult_t > functional_type
 
typedef JSupervisor supervisor_type
 

Public Member Functions

 JTransferFunction1D ()
 Default constructor. More...
 
template<class T >
void set (const int nx, const JAbscissa_t Xmin, const JAbscissa_t Xmax, T __begin, T __end)
 Set the non-linearity function. More...
 
JOrdinate_t operator() (const JAbscissa_t x) const
 Get the function value including non-linearity. More...
 
result_type operator() (const argument_type x) const
 Function value evaluation. More...
 
virtual result_type evaluate (const argument_type *pX) const =0
 Recursive function value evaluation. More...
 
JSupervisor getSupervisor () const
 Get supervisor. More...
 
const JExceptionHandlergetExceptionHandler () const
 Get exception handler. More...
 
void setExceptionHandler (const JSupervisor &supervisor)
 Set the supervisor for handling of exceptions. More...
 

Static Public Member Functions

static result_type getValue (const JFunctional &function, const argument_type *pX)
 Recursive function value evaluation. More...
 
static JClass< result_type >::argument_type getValue (typename JClass< result_type >::argument_type value, const argument_type *pX)
 Termination of recursive function value evaluation. More...
 

Protected Attributes

JSupervisor supervisor
 

Detailed Description

template<class JAbscissa_t, class JOrdinate_t>
class JDETECTOR::JTransferFunction1D< JAbscissa_t, JOrdinate_t >

Auxiliary class for a non-linear transfer function of TDC inside FPGA.

Definition at line 28 of file JCLBDefaultSimulator.hh.

Member Typedef Documentation

◆ JFunction1D_t

template<class JAbscissa_t , class JOrdinate_t >
typedef JTOOLS::JPolintFunction1D<0, JTOOLS::JElement2D<JAbscissa_t, JOrdinate_t>, JTOOLS::JGridCollection, JOrdinate_t> JDETECTOR::JTransferFunction1D< JAbscissa_t, JOrdinate_t >::JFunction1D_t

Definition at line 39 of file JCLBDefaultSimulator.hh.

◆ collection_type

typedef JTOOLS::JGridCollection <JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t > , JDistance<typename JElement_t::abscissa_type> > JTOOLS::JPolintFunction1D< N, JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t > , JTOOLS::JGridCollection , JOrdinate_t , JDistance<typename JElement_t::abscissa_type> >::collection_type
inherited

Definition at line 1098 of file JPolint.hh.

◆ abscissa_type

typedef collection_type::abscissa_type JTOOLS::JPolintFunction1D< N, JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t > , JTOOLS::JGridCollection , JOrdinate_t , JDistance<typename JElement_t::abscissa_type> >::abscissa_type
inherited

Definition at line 1100 of file JPolint.hh.

◆ ordinate_type

typedef collection_type::ordinate_type JTOOLS::JPolintFunction1D< N, JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t > , JTOOLS::JGridCollection , JOrdinate_t , JDistance<typename JElement_t::abscissa_type> >::ordinate_type
inherited

Definition at line 1101 of file JPolint.hh.

◆ value_type

typedef collection_type::value_type JTOOLS::JPolintFunction1D< N, JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t > , JTOOLS::JGridCollection , JOrdinate_t , JDistance<typename JElement_t::abscissa_type> >::value_type
inherited

Definition at line 1102 of file JPolint.hh.

◆ distance_type

typedef collection_type::distance_type JTOOLS::JPolintFunction1D< N, JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t > , JTOOLS::JGridCollection , JOrdinate_t , JDistance<typename JElement_t::abscissa_type> >::distance_type
inherited

Definition at line 1103 of file JPolint.hh.

◆ const_iterator

typedef collection_type::const_iterator JTOOLS::JPolintFunction1D< N, JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t > , JTOOLS::JGridCollection , JOrdinate_t , JDistance<typename JElement_t::abscissa_type> >::const_iterator
inherited

Definition at line 1105 of file JPolint.hh.

◆ const_reverse_iterator

typedef collection_type::const_reverse_iterator JTOOLS::JPolintFunction1D< N, JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t > , JTOOLS::JGridCollection , JOrdinate_t , JDistance<typename JElement_t::abscissa_type> >::const_reverse_iterator
inherited

Definition at line 1106 of file JPolint.hh.

◆ iterator

typedef collection_type::iterator JTOOLS::JPolintFunction1D< N, JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t > , JTOOLS::JGridCollection , JOrdinate_t , JDistance<typename JElement_t::abscissa_type> >::iterator
inherited

Definition at line 1107 of file JPolint.hh.

◆ reverse_iterator

typedef collection_type::reverse_iterator JTOOLS::JPolintFunction1D< N, JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t > , JTOOLS::JGridCollection , JOrdinate_t , JDistance<typename JElement_t::abscissa_type> >::reverse_iterator
inherited

Definition at line 1108 of file JPolint.hh.

◆ function_type

typedef JFunction1D<abscissa_type, JOrdinate_t > JTOOLS::JPolintFunction1D< N, JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t > , JTOOLS::JGridCollection , JOrdinate_t , JDistance<typename JElement_t::abscissa_type> >::function_type
inherited

Definition at line 1110 of file JPolint.hh.

◆ argument_type

typedef function_type::argument_type JTOOLS::JPolintFunction1D< N, JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t > , JTOOLS::JGridCollection , JOrdinate_t , JDistance<typename JElement_t::abscissa_type> >::argument_type
inherited

Definition at line 1112 of file JPolint.hh.

◆ result_type

typedef function_type::result_type JTOOLS::JPolintFunction1D< N, JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t > , JTOOLS::JGridCollection , JOrdinate_t , JDistance<typename JElement_t::abscissa_type> >::result_type
inherited

Definition at line 1113 of file JPolint.hh.

◆ exceptionhandler_type

typedef function_type::JExceptionHandler JTOOLS::JPolintFunction1D< N, JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t > , JTOOLS::JGridCollection , JOrdinate_t , JDistance<typename JElement_t::abscissa_type> >::exceptionhandler_type
inherited

Definition at line 1114 of file JPolint.hh.

◆ functional_type

template<class JArgument_t , class JResult_t >
typedef JFunctional<JArgument_t, JResult_t> JTOOLS::JFunction1D< JArgument_t, JResult_t >::functional_type
inherited

Definition at line 337 of file JFunctional.hh.

◆ supervisor_type

template<class JArgument_t , class JResult_t >
typedef JSupervisor JTOOLS::JFunctional< JArgument_t, JResult_t >::supervisor_type
inherited

Definition at line 89 of file JFunctional.hh.

Member Enumeration Documentation

◆ anonymous enum

template<class JArgument_t , class JResult_t >
anonymous enum
inherited
Enumerator
NUMBER_OF_DIMENSIONS 

Definition at line 335 of file JFunctional.hh.

Constructor & Destructor Documentation

◆ JTransferFunction1D()

template<class JAbscissa_t , class JOrdinate_t >
JDETECTOR::JTransferFunction1D< JAbscissa_t, JOrdinate_t >::JTransferFunction1D ( )
inline

Default constructor.

Definition at line 45 of file JCLBDefaultSimulator.hh.

46  {}

Member Function Documentation

◆ set()

template<class JAbscissa_t , class JOrdinate_t >
template<class T >
void JDETECTOR::JTransferFunction1D< JAbscissa_t, JOrdinate_t >::set ( const int  nx,
const JAbscissa_t  Xmin,
const JAbscissa_t  Xmax,
__begin,
__end 
)
inline

Set the non-linearity function.

Parameters
nxnumber of elements
Xminlower limit
Xmaxupper limit
__beginbegin of weights
__endend of weights

Definition at line 59 of file JCLBDefaultSimulator.hh.

64  {
65  // make CDF
66 
67  const int N = std::distance(__begin, __end);
68 
70 
71  for (T i = __begin; i != __end; ++i) {
72  X.push_back(*i);
73  }
74 
75  for (int i = 0, j = 1; j != N; ++i, ++j) {
76  X[j] += X[i];
77  }
78 
79  for (int i = 0; i != N; ++i) {
80  X[i] /= X[N-1];
81  }
82 
83 
85 
86  for (typename JFunction1D_t::iterator i = this->begin(); i != this->end(); ++i) {
87 
88  int j = 0;
89 
90  while (j != N && Xmin + X[j] * (Xmax - Xmin) < i->getX()) {
91  ++j;
92  }
93 
94  i->getY() = (JOrdinate_t) (Xmin + j * (Xmax - Xmin) / N);
95  }
96 
97  JFunction1D_t::compile();
98  }
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
void configure(const T &value, const JAbstractCollection< JAbscissa_t > &bounds, JBool< false > option)
Configuration of value.
JGrid< JAbscissa_t > make_grid(const int nx, const JAbscissa_t Xmin, const JAbscissa_t Xmax)
Helper method for JGrid.
Definition: JGrid.hh:209
int j
Definition: JPolint.hh:792

◆ operator()() [1/2]

template<class JAbscissa_t , class JOrdinate_t >
JOrdinate_t JDETECTOR::JTransferFunction1D< JAbscissa_t, JOrdinate_t >::operator() ( const JAbscissa_t  x) const
inline

Get the function value including non-linearity.

Parameters
xabscissa value
Returns
function value

Definition at line 107 of file JCLBDefaultSimulator.hh.

108  {
109  const long long int n = (long long int) (x / (this->getXmax() - this->getXmin()));
110  const JAbscissa_t x1 = x - n * (this->getXmax() - this->getXmin());
111 
112  return (JOrdinate_t) (x - x1) + JFunction1D_t::operator()(x1);
113  }
const int n
Definition: JPolint.hh:786

◆ operator()() [2/2]

template<class JArgument_t , class JResult_t >
result_type JTOOLS::JFunction1D< JArgument_t, JResult_t >::operator() ( const argument_type  x) const
inlineinherited

Function value evaluation.

Parameters
xargument value
Returns
function value

Definition at line 348 of file JFunctional.hh.

349  {
350  return this->evaluate(&x);
351  }
virtual result_type evaluate(const argument_type *pX) const =0
Recursive function value evaluation.

◆ evaluate()

template<class JArgument_t , class JResult_t >
virtual result_type JTOOLS::JFunctional< JArgument_t, JResult_t >::evaluate ( const argument_type pX) const
pure virtualinherited

Recursive function value evaluation.

Parameters
pXpointer to abscissa values
Returns
function value

Implemented in JTOOLS::JSplineMap< JKey_t, JValue_t, JMap_t, JResult_t, JDistance_t >, JTOOLS::JSplineMap< JKey_t, JValue_t, JGridMap, JResultType< JValue_t >::result_type, JDistance< JKey_t > >, JTOOLS::JSplineMap< JKey_t, JValue_t, JMap, JResultDerivative< JResultType< JValue_t >::result_type >, JDistance< JKey_t > >, JTOOLS::JSplineMap< JKey_t, JValue_t, JMap, JResultType< JValue_t >::result_type, JDistance< JKey_t > >, JTOOLS::JSplineMap< JKey_t, JValue_t, JGridMap, JResultDerivative< JResultType< JValue_t >::result_type >, JDistance< JKey_t > >, JTOOLS::JSplineFunction< JElement_t, JCollection_t, JResultPDF< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >, JTOOLS::JSplineFunction< JElement_t, JCollection_t, JResultDerivative< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >, JTOOLS::JSplineFunction< JElement_t, JCollection_t, typename JResultType< typename JElement_t::ordinate_type >::result_type, JDistance_t >, JTOOLS::JPolintFunction< N, JElement_t, JCollection_t, JResultHesse< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >, JTOOLS::JPolintFunction< N, JElement_t, JCollection_t, JResultDerivative< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >, JTOOLS::JPolintFunction< N, JElement_t, JCollection_t, JResultPolynome< M, typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >, JTOOLS::JPolintFunction< N, JElement_t, JCollection_t, JResultPDF< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >, JTOOLS::JPolintFunction< 1, JElement_t, JCollection_t, typename JResultType< typename JElement_t::ordinate_type >::result_type, JDistance_t >, JTOOLS::JPolintFunction< 0, JElement_t, JCollection_t, typename JResultType< typename JElement_t::ordinate_type >::result_type, JDistance_t >, JTOOLS::JPolintFunction< N, JElement_t, JCollection_t, typename JResultType< typename JElement_t::ordinate_type >::result_type, JDistance_t >, JTOOLS::JPolfitFunction< N, M, JElement_t, JCollection_t, JResult_t, JDistance_t >, JTOOLS::JPolfitFunction< N, M, JElement_t, JCollection_t, typename JElement_t::ordinate_type, JDistance< typename JElement_t::abscissa_type > >, JTOOLS::JHermiteSplineMap< JKey_t, JValue_t, JMap_t, JResult_t, JDistance_t >, JTOOLS::JHermiteSplineFunction< JElement_t, JCollection_t, JResultPDF< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >, JTOOLS::JHermiteSplineFunction< JElement_t, JCollection_t, JResultDerivative< typename JResultType< typename JElement_t::ordinate_type >::result_type >, JDistance_t >, JTOOLS::JHermiteSplineFunction< JElement_t, JCollection_t, typename JResultType< typename JElement_t::ordinate_type >::result_type, JDistance_t >, JTOOLS::JFunctionObject1D< JArgument_t, JResult_t >, JTOOLS::JExternalFunction1D< JArgument_t, JResult_t >, and JTOOLS::JConstantFunction1D< JArgument_t, JResult_t >.

◆ getValue() [1/2]

template<class JArgument_t , class JResult_t >
static result_type JTOOLS::JFunctional< JArgument_t, JResult_t >::getValue ( const JFunctional< JArgument_t, JResult_t > &  function,
const argument_type pX 
)
inlinestaticinherited

Recursive function value evaluation.

Parameters
functionfunction
pXpointer to abscissa values

Definition at line 107 of file JFunctional.hh.

109  {
110  return function.evaluate(pX);
111  }

◆ getValue() [2/2]

template<class JArgument_t , class JResult_t >
static JClass<result_type>::argument_type JTOOLS::JFunctional< JArgument_t, JResult_t >::getValue ( typename JClass< result_type >::argument_type  value,
const argument_type pX 
)
inlinestaticinherited

Termination of recursive function value evaluation.

Parameters
valueresult
pXpointer to abscissa values

Definition at line 121 of file JFunctional.hh.

123  {
124  return value;
125  }

◆ getSupervisor()

template<class JArgument_t , class JResult_t >
JSupervisor JTOOLS::JFunctional< JArgument_t, JResult_t >::getSupervisor ( ) const
inlineinherited

Get supervisor.

Returns
supervisor

Definition at line 281 of file JFunctional.hh.

282  {
283  return supervisor;
284  }
JSupervisor supervisor
Definition: JFunctional.hh:310

◆ getExceptionHandler()

template<class JArgument_t , class JResult_t >
const JExceptionHandler& JTOOLS::JFunctional< JArgument_t, JResult_t >::getExceptionHandler ( ) const
inlineinherited

Get exception handler.

Returns
exception handler

Definition at line 292 of file JFunctional.hh.

293  {
294  return *supervisor;
295  }

◆ setExceptionHandler()

template<class JArgument_t , class JResult_t >
void JTOOLS::JFunctional< JArgument_t, JResult_t >::setExceptionHandler ( const JSupervisor supervisor)
inlineinherited

Set the supervisor for handling of exceptions.

Parameters
supervisorsupervisor

Definition at line 303 of file JFunctional.hh.

304  {
305  this->supervisor = supervisor;
306  }

Member Data Documentation

◆ supervisor

template<class JArgument_t , class JResult_t >
JSupervisor JTOOLS::JFunctional< JArgument_t, JResult_t >::supervisor
protectedinherited

Definition at line 310 of file JFunctional.hh.


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