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< Root > | RootContainer |
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 Channel & | fChannel |
The channel where to apply the discrimination. More... | |
double | fEndTime |
Define the relevant interval final time. More... | |
const std::unique_ptr< Callable > | fInputPulse |
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... | |
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"
Definition at line 59 of file MDetector/Channel.h.
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.
|
private |
Definition at line 154 of file MDetector/Channel.h.
|
private |
Container for the roots (time + output).
Definition at line 146 of file MDetector/Channel.h.
|
private |
Iterator over our roots struct.
Definition at line 148 of file MDetector/Channel.h.
mdet::Channel::Discriminator::Discriminator | ( | const Discriminator & | d | ) |
Copy.
Definition at line 492 of file MDetector/Channel.cc.
|
inlineprivate |
Templated constructor with the generic functor.
Definition at line 215 of file MDetector/Channel.h.
References Init().
|
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 |
Begin iterator over times.
Definition at line 403 of file MDetector/Channel.cc.
References fRawRoots.
Referenced by MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::ProcessPulses(), and MdCounterSimulatorAG::MdCounterSimulator::ProcessPulses().
Channel::Discriminator::AtThresholdConstIterator mdet::Channel::Discriminator::AtThresholdEnd | ( | ) | const |
End iterator over times.
Definition at line 410 of file MDetector/Channel.cc.
References fRawRoots.
Referenced by MdOptoElectronicSimulatorAG::MdOptoElectronicSimulator::ProcessPulses(), and MdCounterSimulatorAG::MdCounterSimulator::ProcessPulses().
|
private |
Helper templated function to calculate the times that define the total span.
Definition at line 576 of file MDetector/Channel.cc.
|
private |
Compute final output for a give time difference.
Definition at line 382 of file MDetector/Channel.cc.
References ApplySaturation(), fChannel, fTransitionTime, mdet::Channel::GetDiscriminatorHiLevel(), mdet::Channel::GetDiscriminatorLowLevel(), mdet::Channel::GetSlewRate(), and OverThreshold().
Referenced by Init().
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().
|
private |
Perform initialization.
Definition at line 417 of file MDetector/Channel.cc.
References ComputeOutput(), det::DetectorComponent< C, ManagerProvider >::f, fBeginTime, fChannel, fEndTime, fInputPulse, mdet::Channel::Discriminator::Root::fOutput, fRawRoots, fRoots, mdet::Channel::Discriminator::Root::fTime, mdet::Channel::GetAbsoluteError(), mdet::Channel::GetDiscriminatorLowLevel(), mdet::Channel::GetInitialIntervalLength(), mdet::Channel::GetThreshold(), and max.
Referenced by Discriminator().
double mdet::Channel::Discriminator::operator() | ( | double | t | ) | const |
Evaluate the discriminator output given the input pulse.
t | The 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.
|
private |
Check input agains threshold.
Definition at line 363 of file MDetector/Channel.cc.
References fChannel, fInputPulse, and mdet::Channel::GetThreshold().
Referenced by ComputeOutput().
|
friend |
Allow construction.
Definition at line 138 of file MDetector/Channel.h.
|
private |
Define the relevant interval start time.
Definition at line 254 of file MDetector/Channel.h.
Referenced by Init().
The channel where to apply the discrimination.
Definition at line 248 of file MDetector/Channel.h.
Referenced by ApplySaturation(), ComputeOutput(), Init(), and OverThreshold().
|
private |
Define the relevant interval final time.
Definition at line 256 of file MDetector/Channel.h.
Referenced by Init().
The input pulse where to apply the discrimination.
Definition at line 250 of file MDetector/Channel.h.
Referenced by Init(), and OverThreshold().
|
private |
Plain root value (only times).
Definition at line 260 of file MDetector/Channel.h.
Referenced by AtThresholdBegin(), AtThresholdEnd(), and Init().
|
private |
Once and for all calculate the roots given the input pulse.
Definition at line 258 of file MDetector/Channel.h.
Referenced by Init().
|
private |
Maximum time required to switch between states.
Definition at line 252 of file MDetector/Channel.h.
Referenced by ComputeOutput().