Changeset 13614


Ignore:
Timestamp:
05/09/12 13:01:35 (13 years ago)
Author:
Jens Buss
Message:
add removeRegionWithToFlatSlope
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/rootmacros/zerosearch.C

    r13582 r13614  
    2121
    2222vector<Region> * ZeroPositions = new vector<Region>;
    23 Region currentRegion = {0, 0, 0, 0.0, 0, 0};
     23Region currentRegion = {0, 0, 0, 0.0, 0, 0.0, 0.0, 0};
    2424    if (step < 1){
    2525        if (VerbosityLevel > 0)
     
    510510
    511511        reg->halfRisingEdgePos = result;
     512
    512513        reg->distanceEdgeToMax = reg->maxPos - result;
     514        reg->interceptRisingEdge = intercept;
    513515        reg->slopeOfRisingEdge = slope;
    514516    }
    515517    return regions.size();
    516518}
     519
     520size_t removeRegionWithToFlatSlope(
     521    vector<Region> &regions,
     522    float minSlope,
     523    int VerbosityLevel)
     524{
     525    vector<Region>::iterator it = regions.begin();
     526    while( it != regions.end() )
     527    {
     528        if (it->slopeOfRisingEdge < minSlope ) {
     529            if (VerbosityLevel > 3){
     530                cout << "removing max " << it->maxVal << "\t";
     531                cout << " @ " << it->maxPos << "\t";
     532                cout << endl;
     533            }
     534            it = regions.erase( it ) ;
     535        }else
     536            ++it;
     537    }
     538
     539    return regions.size();
     540}
Note: See TracChangeset for help on using the changeset viewer.