| 1 | // file zerosearch.h | 
|---|
| 2 | #ifndef __ZEROSEARCH_H | 
|---|
| 3 | #define __ZEROSEARCH_H | 
|---|
| 4 |  | 
|---|
| 5 | #include "Region.h" | 
|---|
| 6 | #include <vector> | 
|---|
| 7 |  | 
|---|
| 8 | std::vector<Region> *zerosearch( | 
|---|
| 9 | std::vector<float> &input, | 
|---|
| 10 | int edge = 1,                       // search for transitions on rising edge=1, -1:falling | 
|---|
| 11 | unsigned int step = 4,                      // search in steps of step | 
|---|
| 12 | int VerbosityLevel = 1  // 1 means ... just normal warings are output. | 
|---|
| 13 | ); | 
|---|
| 14 |  | 
|---|
| 15 | size_t ShiftRegionBy( | 
|---|
| 16 | std::vector<Region> &src, | 
|---|
| 17 | int Shift, | 
|---|
| 18 | int VerbosityLevel=0); | 
|---|
| 19 |  | 
|---|
| 20 | size_t EnlargeRegion(std::vector<Region> &src, | 
|---|
| 21 | int Left, | 
|---|
| 22 | int Right, | 
|---|
| 23 | int VerbosityLevel=0); | 
|---|
| 24 |  | 
|---|
| 25 | size_t findAbsMaxInRegions( | 
|---|
| 26 | std::vector<Region> ®ions, | 
|---|
| 27 | std::vector<float> &data, | 
|---|
| 28 | int VerbosityLevel=0); | 
|---|
| 29 |  | 
|---|
| 30 | bool compMaxPosOfRegions (Region a, Region b); | 
|---|
| 31 |  | 
|---|
| 32 | size_t removeEqualMaxima( | 
|---|
| 33 | std::vector<Region> ®ions, | 
|---|
| 34 | int VerbosityLevel=0); | 
|---|
| 35 |  | 
|---|
| 36 | size_t removeRegionOnFallingEdge( | 
|---|
| 37 | std::vector<Region> ®ions, | 
|---|
| 38 | unsigned int FallingEdgeWidth = 100, | 
|---|
| 39 | int VerbosityLevel=0); | 
|---|
| 40 |  | 
|---|
| 41 |  | 
|---|
| 42 | size_t removeRegionWithMaxOnEdge( | 
|---|
| 43 | std::vector<Region> ®ions, | 
|---|
| 44 | unsigned int EdgeWidth=3, | 
|---|
| 45 | int VerbosityLevel=0); | 
|---|
| 46 |  | 
|---|
| 47 | size_t removeMaximaBelow( | 
|---|
| 48 | std::vector<Region> ®ions, | 
|---|
| 49 | float threshold = 2.0, | 
|---|
| 50 | int VerbosityLevel=0); | 
|---|
| 51 |  | 
|---|
| 52 | size_t removeMaximaAbove( | 
|---|
| 53 | std::vector<Region> ®ions, | 
|---|
| 54 | float threshold= 14.0, | 
|---|
| 55 | int VerbosityLevel=0); | 
|---|
| 56 |  | 
|---|
| 57 | size_t removeRegionWithToFlatSlope( | 
|---|
| 58 | std::vector<Region> ®ions, | 
|---|
| 59 | float minSlope=0, | 
|---|
| 60 | int VerbosityLevel=0); | 
|---|
| 61 |  | 
|---|
| 62 | Region FindAbsMax( | 
|---|
| 63 | std::vector<Region> ®ions, | 
|---|
| 64 | int VerbosityLevel=0); | 
|---|
| 65 |  | 
|---|
| 66 | size_t calcCFDPositions( | 
|---|
| 67 | vector<Region>  ®ions, | 
|---|
| 68 | vector<float>   &cfd_data | 
|---|
| 69 | ); | 
|---|
| 70 |  | 
|---|
| 71 | // Calculate the position (sample) of a pulses half maximum | 
|---|
| 72 | size_t findTimeOfHalfMaxLeft( | 
|---|
| 73 | std::vector<Region> ®ions, | 
|---|
| 74 | std::vector<float> &data, | 
|---|
| 75 | float baseline = -0.5, | 
|---|
| 76 | int beginRisingEdge = 5, | 
|---|
| 77 | int endRisingEdge = 10, | 
|---|
| 78 | int VerbosityLevel = 1); | 
|---|
| 79 |  | 
|---|
| 80 | // Get the derived arrival times in terms of the position of selected pulses | 
|---|
| 81 | // position of the peak | 
|---|
| 82 | size_t GetMaxPositions( | 
|---|
| 83 | vector<Region>  ®ions, | 
|---|
| 84 | vector<int>     &positions, | 
|---|
| 85 | int VerbosityLevel); | 
|---|
| 86 |  | 
|---|
| 87 | // Get the derived arrival times in terms of the position of selected pulses | 
|---|
| 88 | // rising edges | 
|---|
| 89 | size_t GetEdgePositions( | 
|---|
| 90 | vector<Region>  ®ions, | 
|---|
| 91 | vector<int>     &positions, | 
|---|
| 92 | int VerbosityLevel); | 
|---|
| 93 |  | 
|---|
| 94 |  | 
|---|
| 95 | #endif | 
|---|