1 #ifndef _mdet_Channel_h
2 #define _mdet_Channel_h
4 #include <mdet/MDetectorComponent.h>
6 #include <utl/Validated.h>
14 struct ComponentUpdater;
100 template<
class Functor>
214 template<
class Functor>
243 double ComputeOutput(
double signReferenceTime,
double deltaTime,
double prevOutput)
const;
245 template<
class Iterator>
352 template <
class Functor>
354 MakeDiscriminator(
const Functor& inputPulse,
double beginTime,
double endTime)
513 friend struct det::ComponentUpdater;
double ComputeOutput(double signReferenceTime, double deltaTime, double prevOutput) const
Compute final output for a give time difference.
AtThresholdConstIterator AtThresholdBegin() const
Begin iterator over times.
static const char *const kComponentName
utl::Validated< double > fSlewRate
utl::Validated< double > fResponseTime
utl::Validated< double > fSignalShiftStdDev
utl::Validated< double > fLowCutoffFrequency
utl::Validated< double > fDiscriminatorLowLevel
const FrontEnd & fFrontEnd
const Channel & fChannel
The channel where to apply the discrimination.
bool OverThreshold(double t) const
Check input agains threshold.
Callback interface wrapping the access to the underlying functor providing the input pulse...
virtual double operator()(double t) const =0
Define the interface via which we will make the calls.
Defines within it the common (templated) type for muon detector hierarchy components.
double GetInitialIntervalLength() const
Lenght of the intervals (in time) in which divide the whole interval where roots are looked for...
void Init()
Perform initialization.
double operator()(double t) const
Define the interface via which we will make the calls.
unsigned int GetMaxNumberOfErrors() const
Maximum number of errors admited without loggin when solving the equation threshold == input...
RawRootsContainer fRawRoots
Plain root value (only times).
double ComputeSignalShift() const
Computes a signal shift value according this Channel's characteristics (and, particularly, to the distribution of these values).
double GetFeedbackResistance() const
The resistance within the feedback loop.
Helper class encapsulating the discriminator response logic.
const FrontEnd & GetFrontEnd() const
The shared common-to-all-channels electronic frontend of this channel.
Electronic front-end for the modules.
double ComputeBorderTime(Iterator beg, Iterator end, double time) const
Helper templated function to calculate the times that define the total span.
double fTransitionTime
Maximum time required to switch between states.
virtual ~Callable()
The deletion of the objects will be made through a Callable*.
RootContainer fRoots
Once and for all calculate the roots given the input pulse.
double GetResponseTime() const
Response time of the discriminator associated with the channel.
Discriminator(const Channel &c, const Functor &f, double beginTime, double endTime)
Templated constructor with the generic functor.
double GetHighCutoffFrequency() const
Hi end of frequency response.
utl::Validated< double > fThreshold
utl::Validated< double > fSignalShiftMean
double GetDCGain() const
A dimensionless quantity signaling the DC gain.
friend void boost::checked_delete(T *) BOOST_NOEXCEPT
Friendship for destruction.
double GetSlewRate() const
Voltage change per time unit.
Channel(int cId, const det::VManager::IndexMap &parentMap, const FrontEnd &parent)
Constructs the electronic channel.
double fTime
The x value (that's the root of the equation input == threshold).
std::complex< double > ComputeTransfer(double freq) const
Computes the circuit transfer function at the given frequency.
utl::Validated< int > fMaxNumberOfErrors
Discriminator const
Create a fresh discriminator.
static const char *const kComponentId
utl::Validated< int > fIterationsNumber
double fOutput
The y value (that's the output voltage while in the associated time).
Templated specialization of the mdet::Channel::Discriminator::Callable interface. ...
utl::Validated< double > fAbsoluteError
RawRootsContainer::const_iterator AtThresholdConstIterator
Iterator over the times when the input signal reaches the threshold level.
double GetDiscriminatorLowLevel() const
Target voltage when the signal is lower than the threshold.
std::vector< Root > RootContainer
Container for the roots (time + output).
virtual Callable * Clone() const =0
To allow proper copy semantics (see implemetation).
utl::Validated< double > fDCGain
double GetSignalShiftMean() const
Retrieves the mean shift.
double GetSignalShiftStdDev() const
The standard deviation of the shift.
double fBeginTime
Define the relevant interval start time.
double GetOverThresholdTimeSpan() const
Return the total time span over the discrimination threshold.
double GetInvertingInputResistance() const
The resistance attached to the inverting input.
unsigned int GetIterationsNumber() const
Number of iterations allowed for the root finding procedures.
AtThresholdConstIterator AtThresholdEnd() const
End iterator over times.
std::map< std::string, std::string > IndexMap
std::vector< double > RawRootsContainer
const std::unique_ptr< Callable > fInputPulse
The input pulse where to apply the discrimination.
double GetLowCutoffFrequency() const
Low end of frequency response.
double GetAbsoluteError() const
Absolute error for root finding.
utl::Validated< double > fFeedbackResistance
double operator()(double t) const
Evaluate the discriminator output given the input pulse.
std::complex< double > ComputeFrequencyFactor(double freq, double freqLimit) const
Helper method to compute the factor (in the transfer function) that depends on frequency.
RootContainer::const_iterator RootIterator
Iterator over our roots struct.
double ApplySaturation(double v) const
Compute the final output for a given difference agains the threshold.
utl::Validated< double > fHighCutoffFrequency
utl::Validated< double > fInvertingInputResistance
utl::Validated< double > fInitialIntervalLength
Type
The type of file that we are acutally opening.
~Channel()
Destructor (!).
double GetThreshold() const
Discrimination threshold.
double fEndTime
Define the relevant interval final time.
utl::Validated< double > fDiscriminatorHiLevel
Discriminator(const Discriminator &d)
Copy.
double GetDiscriminatorHiLevel() const
Target voltage when the signal is higher than the threshold.
The child the information from the parent upon construction.