MarlinTPC  1.2.0
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
marlintpc::PulseFinderTester Class Reference

A class which is friend of PulseFinder so it can access the protected members for testing. More...

#include <PulseFinderTester.h>

Classes

struct  CandidateProperties
 A reference consists of a vector of IteratorProperties structs and the corresponding begin and end iterators of the data vectors. More...
 
struct  IteratorProperties
 A helper struct to store the distance to the begin iterator and the value which should be at the iterator position. More...
 
struct  PulseProperties
 A struct to store the pulse properties we are checking. More...
 

Public Member Functions

 PulseFinderTester ()
 The constructor.
 
 ~PulseFinderTester ()
 The destructor.
 
int runAllTests ()
 Run all tests and return the number of failed tests. More...
 

Protected Member Functions

bool evaluateBruteSearchResult (std::vector< std::pair< std::vector< float >::const_iterator, std::vector< float >::const_iterator > > const &bruteSearchResult, std::vector< IteratorProperties > const &referenceValues, std::vector< float >::const_iterator beginIterator, std::vector< float >::const_iterator endIterator)
 this function gets the search result of the brute search and compares it to the reference values given. More...
 
bool evaluateSplitResult (std::vector< PulseFinder::InternalSplitPulse > const &splitResult, std::vector< IteratorProperties > const &referenceValues, std::vector< float >::const_iterator beginIterator, std::vector< float >::const_iterator endIterator)
 
bool evaluatePulseCandidate (std::vector< std::pair< TrackerDataImpl *, int > > candidates, std::vector< CandidateProperties > const &referenceCandidateProperties)
 
bool evaluatePulses (std::vector< TrackerPulse * > const &pulses, std::vector< PulseProperties > const &referencePulseProperties)
 
bool evaluatePlateauCutoff (std::vector< TrackerPulse * > const &pulses, std::vector< std::pair< size_t, size_t > > const &referencePositions, EVENT::FloatVec const &referenceADCValues)
 Compare the adc values in the pulses to the referenceADCValues. More...
 

Protected Attributes

PulseFinder_pulseFinder
 
PulseFinder_pulseFinderPrePostPlateau
 
float _readoutFrequency
 The reference value. Has to be returned correctly.
 

Detailed Description

A class which is friend of PulseFinder so it can access the protected members for testing.

Member Function Documentation

bool marlintpc::PulseFinderTester::evaluateBruteSearchResult ( std::vector< std::pair< std::vector< float >::const_iterator, std::vector< float >::const_iterator > > const &  bruteSearchResult,
std::vector< IteratorProperties > const &  referenceValues,
std::vector< float >::const_iterator  beginIterator,
std::vector< float >::const_iterator  endIterator 
)
protected

this function gets the search result of the brute search and compares it to the reference values given.

Returns true if all values are ok.

Referenced by runAllTests().

bool marlintpc::PulseFinderTester::evaluatePlateauCutoff ( std::vector< TrackerPulse * > const &  pulses,
std::vector< std::pair< size_t, size_t > > const &  referencePositions,
EVENT::FloatVec const &  referenceADCValues 
)
protected

Compare the adc values in the pulses to the referenceADCValues.

The positions (first and last sample) are given in the referencePositions. As usual the last sample points to the position after the last sample in the pulse. Only to be used with plateau pulses (checks on the flag and requires the spectrum to be saved).

Referenced by runAllTests().

int marlintpc::PulseFinderTester::runAllTests ( )

Run all tests and return the number of failed tests.

This is the variance, which is not the error. No idea how to calculate it correctly float referenceTimeErrorDerivativeMethod = sqrt( 20*20*(6.-meanBin)*(6.-meanBin)

  • 100*100*(7.-meanBin)*(7.-meanBin)
  • 55*55*(8.-meanBin)*(8.-meanBin) ) / (20.+100.+55.)* 1E3 / _readoutFrequency; //conversion to ns
Todo:
: PulseFinderTester: calculate correct time error and test it
Todo:
: PulseFinderTester: calculate correct charge error and test it
Todo:
: PulseFinderTester: calculate expected charge fit value and test it

References marlintpc::PulseFinder::_noiseValuePedestalWidthFactor, _readoutFrequency, marlintpc::PulseFinder::brutePulseSearch(), marlintpc::PulseFinder::calcPulseChargeMaxQ(), marlintpc::PulseFinder::calcPulseChargeSumQ(), marlintpc::PulseFinder::calcPulseTimeAtMaximum(), marlintpc::PulseFinder::calcPulseTimeCentreOfGravity(), marlintpc::PulseFinder::calcPulseTimeFirstBinAboveThreshold(), marlintpc::PulseFinder::calcPulseTimeInflexionPoint(), marlintpc::PulseFinder::calculatePulseWithFit(), evaluateBruteSearchResult(), evaluatePlateauCutoff(), marlintpc::PulseFinder::findPulseCandidates(), marlintpc::PulseFinder::findPulses(), marlintpc::PulseFinder::getPedestalWidth(), marlintpc::PulseFinder::setForceSpectrumSave(), and marlintpc::PulseFinder::splitMultiplePulses().


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