1 #ifndef __JDETECTOR__JCLBDEFAULTSIMULATOR__
2 #define __JDETECTOR__JCLBDEFAULTSIMULATOR__
19 namespace JDETECTOR {}
20 namespace JPP {
using namespace JDETECTOR; }
27 template<
class JAbscissa_t,
class JOrdinate_t>
30 JTOOLS::JElement2D<JAbscissa_t, JOrdinate_t>,
31 JTOOLS::JGridCollection,
59 void set(
const int nx,
60 const JAbscissa_t Xmin,
61 const JAbscissa_t Xmax,
71 for (
T i = __begin; i != __end; ++i) {
75 for (
int i = 0,
j = 1;
j !=
N; ++i, ++
j) {
79 for (
int i = 0; i !=
N; ++i) {
90 while (j != N && Xmin + X[j] * (Xmax - Xmin) < i->getX()) {
94 i->getY() = (JOrdinate_t) (Xmin + j * (Xmax - Xmin) /
N);
97 JFunction1D_t::compile();
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());
112 return (JOrdinate_t) (x - x1) + JFunction1D_t::operator()(x1);
152 const double Tmin_ns = 0.0;
153 const double Tmax_ns = 4.0;
155 const double W[] = { 0.2413,
160 getTDC.
set(4000, Tmin_ns, Tmax_ns, W, W +
sizeof(W)/
sizeof(W[0]));
174 const JTOT_t tot_ns)
const override
The elements in a collection are sorted according to their abscissa values and a given distance opera...
Interface to mimic hit ordering effects due to state machine inside CLB.
std::vector< T >::difference_type distance(typename std::vector< T >::const_iterator first, typename PhysicsEvent::const_iterator< T > second)
Specialisation of STL distance.
JTOOLS::JPolintFunction1D< 0, JTOOLS::JElement2D< JAbscissa_t, JOrdinate_t >, JTOOLS::JGridCollection, JOrdinate_t > JFunction1D_t
JTDC()
Default constructor.
JTDC_t getT() const
Get time.
JPMT_t getPMT() const
Get PMT.
unsigned int JTDC_t
leading edge [ns]
Auxiliary class to mimic hit ordering effects due to state machine inside CLB.
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
JOrdinate_t operator()(const JAbscissa_t x) const
Get the function value including non-linearity.
JTransferFunction1D< double, JTDC_t > getTDC
TDC non-linearity function.
do set_variable OUTPUT_DIRECTORY $WORKDIR T
then break fi done getCenter read X Y Z let X
General purpose class for a collection of sorted elements.
JTransferFunction1D()
Default constructor.
virtual bool maybeSwapped(const JDAQHit &first, const JDAQHit &second) const override
Test whether two consecutive hits may be swapped.
virtual JDAQHit makeHit(const JPMT_t pmt, const double t_ns, const JTOT_t tot_ns) const override
Make DAQ hit.
alias put_queue eval echo n
Auxiliary class for a non-linear transfer function of TDC inside FPGA.
JCLBDefaultSimulator(const JDAQHit::JTDC_t Tmax=0)
Constructor.
void set(const int nx, const JAbscissa_t Xmin, const JAbscissa_t Xmax, T __begin, T __end)
Set the non-linearity function.
Implementation of non-linearity of TDC.
JStateMachine(const JDAQHit::JTDC_t Tmax)
Constructor.
then usage $script[input file[working directory[option]]] nWhere option can be N