List of all members | Classes | Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | Friends
mdet::Channel::Discriminator Class Reference

Helper class encapsulating the discriminator response logic. More...

#include <Channel.h>

Classes

class  Callable
 Callback interface wrapping the access to the underlying functor providing the input pulse. More...
 
class  Proxy
 Templated specialization of the mdet::Channel::Discriminator::Callable interface. More...
 
struct  Root
 

Public Types

typedef
RawRootsContainer::const_iterator 
AtThresholdConstIterator
 Iterator over the times when the input signal reaches the threshold level. More...
 

Public Member Functions

AtThresholdConstIterator AtThresholdBegin () const
 Begin iterator over times. More...
 
AtThresholdConstIterator AtThresholdEnd () const
 End iterator over times. More...
 
 Discriminator (const Discriminator &d)
 Copy. More...
 
double GetOverThresholdTimeSpan () const
 Return the total time span over the discrimination threshold. More...
 
double operator() (double t) const
 Evaluate the discriminator output given the input pulse. More...
 
double operator() (double *x, double *p) const
 Evaluate the difference with the threshold. More...
 

Private Types

typedef std::vector< double > RawRootsContainer
 
typedef std::vector< RootRootContainer
 Container for the roots (time + output). More...
 
typedef
RootContainer::const_iterator 
RootIterator
 Iterator over our roots struct. More...
 

Private Member Functions

double ApplySaturation (double v) const
 Compute the final output for a given difference agains the threshold. More...
 
template<class Iterator >
double ComputeBorderTime (Iterator beg, Iterator end, double time) const
 Helper templated function to calculate the times that define the total span. More...
 
double ComputeOutput (double signReferenceTime, double deltaTime, double prevOutput) const
 Compute final output for a give time difference. More...
 
template<class Functor >
 Discriminator (const Channel &c, const Functor &f, double beginTime, double endTime)
 Templated constructor with the generic functor. More...
 
void Init ()
 Perform initialization. More...
 
bool OverThreshold (double t) const
 Check input agains threshold. More...
 

Private Attributes

double fBeginTime
 Define the relevant interval start time. More...
 
const ChannelfChannel
 The channel where to apply the discrimination. More...
 
double fEndTime
 Define the relevant interval final time. More...
 
const std::unique_ptr< CallablefInputPulse
 The input pulse where to apply the discrimination. More...
 
RawRootsContainer fRawRoots
 Plain root value (only times). More...
 
RootContainer fRoots
 Once and for all calculate the roots given the input pulse. More...
 
double fTransitionTime
 Maximum time required to switch between states. More...
 

Friends

class Channel
 Allow construction. More...
 

Detailed Description

Helper class encapsulating the discriminator response logic.

This class has access to the mdet::Channel from which it was contructed; and the incoming analog pulse for which the output of the discrimination stage of the tandem mdet::FrontEnd / mdet::Channel.

Note that, tough being copy-constructibles, these objecs are not assignable due to the existance of a member reference. Having that, the compiler generated assignement operator is ill formed: "error: non-static reference member ‘...’, can't use default assignment operator"

See Also
mdet::Channel::GetThresHold
mdet::Channel::MakeDiscriminator
std::auto_ptr

Definition at line 59 of file MDetector/Channel.h.

Member Typedef Documentation

typedef RawRootsContainer::const_iterator mdet::Channel::Discriminator::AtThresholdConstIterator

Iterator over the times when the input signal reaches the threshold level.

This method is mainly provided for information and diagnosis; it's not meant to be used by client code to determine the output signal of the discriminator: for that matters, used the operator() that precisely determines that.

Definition at line 165 of file MDetector/Channel.h.

typedef std::vector<double> mdet::Channel::Discriminator::RawRootsContainer
private

Definition at line 154 of file MDetector/Channel.h.

typedef std::vector<Root> mdet::Channel::Discriminator::RootContainer
private

Container for the roots (time + output).

Definition at line 146 of file MDetector/Channel.h.

typedef RootContainer::const_iterator mdet::Channel::Discriminator::RootIterator
private

Iterator over our roots struct.

Definition at line 148 of file MDetector/Channel.h.

Constructor & Destructor Documentation

mdet::Channel::Discriminator::Discriminator ( const Discriminator d)

Copy.

Definition at line 492 of file MDetector/Channel.cc.

template<class Functor >
mdet::Channel::Discriminator::Discriminator ( const Channel c,
const Functor &  f,
double  beginTime,
double  endTime 
)
inlineprivate

Templated constructor with the generic functor.

Definition at line 215 of file MDetector/Channel.h.

References Init().

Member Function Documentation

double mdet::Channel::Discriminator::ApplySaturation ( double  v) const
private

Compute the final output for a given difference agains the threshold.

Definition at line 370 of file MDetector/Channel.cc.

References fChannel, mdet::Channel::GetDiscriminatorHiLevel(), and mdet::Channel::GetDiscriminatorLowLevel().

Referenced by ComputeOutput().

Channel::Discriminator::AtThresholdConstIterator mdet::Channel::Discriminator::AtThresholdBegin ( ) const
Channel::Discriminator::AtThresholdConstIterator mdet::Channel::Discriminator::AtThresholdEnd ( ) const
template<class Iterator >
double mdet::Channel::Discriminator::ComputeBorderTime ( Iterator  beg,
Iterator  end,
double  time 
) const
private

Helper templated function to calculate the times that define the total span.

Definition at line 576 of file MDetector/Channel.cc.

double mdet::Channel::Discriminator::ComputeOutput ( double  signReferenceTime,
double  deltaTime,
double  prevOutput 
) const
private
double mdet::Channel::Discriminator::GetOverThresholdTimeSpan ( ) const

Return the total time span over the discrimination threshold.

The total time span is defined to be the maximum time span between two instants where the input signal crosses (way up) the threshold. If the input never crosses the threshold (ie output is always at logical zero level) then the time is defined to be zero. If the input signal is already (still) over the threshold at the beginning (the end), then this time, the initial (final) one, is used as the earliest (latest) time with which compute the total time span. Note that it doesn't matter in the middle the input signal goes again under the threshold.

Definition at line 621 of file MDetector/Channel.cc.

Referenced by MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::ProcessPulses(), and MdCounterSimulatorAG::MdCounterSimulator::ProcessPulses().

void mdet::Channel::Discriminator::Init ( void  )
private
double mdet::Channel::Discriminator::operator() ( double  t) const

Evaluate the discriminator output given the input pulse.

Parameters
tThe time at which the output has to be evaluted.

Definition at line 503 of file MDetector/Channel.cc.

References mdet::Channel::Discriminator::Root::fTime.

double mdet::Channel::Discriminator::operator() ( double *  x,
double *  p 
) const

Evaluate the difference with the threshold.

That's the difference between operator()(double) and the threshold from the channel.

This method follows the arity required by Root classes.

Definition at line 631 of file MDetector/Channel.cc.

bool mdet::Channel::Discriminator::OverThreshold ( double  t) const
private

Check input agains threshold.

Definition at line 363 of file MDetector/Channel.cc.

References fChannel, fInputPulse, and mdet::Channel::GetThreshold().

Referenced by ComputeOutput().

Friends And Related Function Documentation

friend class Channel
friend

Allow construction.

Definition at line 138 of file MDetector/Channel.h.

Member Data Documentation

double mdet::Channel::Discriminator::fBeginTime
private

Define the relevant interval start time.

Definition at line 254 of file MDetector/Channel.h.

Referenced by Init().

const Channel& mdet::Channel::Discriminator::fChannel
private

The channel where to apply the discrimination.

Definition at line 248 of file MDetector/Channel.h.

Referenced by ApplySaturation(), ComputeOutput(), Init(), and OverThreshold().

double mdet::Channel::Discriminator::fEndTime
private

Define the relevant interval final time.

Definition at line 256 of file MDetector/Channel.h.

Referenced by Init().

const std::unique_ptr<Callable> mdet::Channel::Discriminator::fInputPulse
private

The input pulse where to apply the discrimination.

Definition at line 250 of file MDetector/Channel.h.

Referenced by Init(), and OverThreshold().

RawRootsContainer mdet::Channel::Discriminator::fRawRoots
private

Plain root value (only times).

Definition at line 260 of file MDetector/Channel.h.

Referenced by AtThresholdBegin(), AtThresholdEnd(), and Init().

RootContainer mdet::Channel::Discriminator::fRoots
private

Once and for all calculate the roots given the input pulse.

Definition at line 258 of file MDetector/Channel.h.

Referenced by Init().

double mdet::Channel::Discriminator::fTransitionTime
private

Maximum time required to switch between states.

Definition at line 252 of file MDetector/Channel.h.

Referenced by ComputeOutput().


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

, generated on Tue Sep 26 2023.