Anp::CountAboveBelow Struct Reference

#include <FillSnarl.h>

List of all members.

Public Member Functions

 CountAboveBelow ()
 CountAboveBelow (float threshold_, const std::vector< std::pair< short, short > > &ivec)
void operator() (const Strip &strip)
unsigned int GetNAbove () const
unsigned int GetNBelow () const
double GetMeanAbove () const
double GetMeanBelow () const

Private Attributes

std::vector< std::pair< short,
short > > 
ignorevec
float threshold
unsigned int nabove
unsigned int nbelow
double sumabove
double sumbelow

Detailed Description

Definition at line 68 of file FillSnarl.h.


Constructor & Destructor Documentation

Anp::CountAboveBelow::CountAboveBelow (  ) 

Definition at line 239 of file FillSnarl.cxx.

00240    :ignorevec(),
00241     threshold(-1.0),
00242     nabove(0),
00243     nbelow(0),
00244     sumabove(0.0),
00245     sumbelow(0.0)
00246 {
00247 }

Anp::CountAboveBelow::CountAboveBelow ( float  threshold_,
const std::vector< std::pair< short, short > > &  ivec 
)

Member Function Documentation

double Anp::CountAboveBelow::GetMeanAbove (  )  const

Definition at line 298 of file FillSnarl.cxx.

References nabove, and sumabove.

Referenced by Anp::FillSnarl::Run().

00299 {
00300    if(nabove > 0)
00301    {
00302       return sumabove/static_cast<double>(nabove);
00303    }
00304 
00305    return 0.0;
00306 }

double Anp::CountAboveBelow::GetMeanBelow (  )  const

Definition at line 309 of file FillSnarl.cxx.

References nbelow, and sumbelow.

Referenced by Anp::FillSnarl::Run().

00310 {
00311    if(nbelow > 0)
00312    {
00313       return sumbelow/static_cast<double>(nbelow);
00314    }
00315 
00316    return 0.0;
00317 }

unsigned int Anp::CountAboveBelow::GetNAbove (  )  const

Definition at line 285 of file FillSnarl.cxx.

References nabove.

Referenced by Anp::FillSnarl::Run().

00286 {
00287    return nabove;
00288 }

unsigned int Anp::CountAboveBelow::GetNBelow (  )  const

Definition at line 291 of file FillSnarl.cxx.

References nbelow.

Referenced by Anp::FillSnarl::Run().

00292 {
00293    return nbelow;
00294 }

void Anp::CountAboveBelow::operator() ( const Strip strip  ) 

Definition at line 261 of file FillSnarl.cxx.

References find(), Anp::Strip::GetPlane(), Anp::Strip::GetStrip(), ignorevec, nabove, nbelow, Anp::Strip::SigCor(), sumabove, sumbelow, and threshold.

00262 {
00263    assert(!(threshold < 0.0) && "logic error");
00264       
00265    const pair<short, short> plane_strip(strip.GetPlane(), strip.GetStrip());
00266 
00267    if(std::find(ignorevec.begin(), ignorevec.end(), plane_strip) != ignorevec.end())
00268    {
00269       return;
00270    }
00271 
00272    if(strip.SigCor() > threshold)
00273    {
00274       ++nabove;
00275       sumabove += strip.SigCor();
00276    }
00277    else
00278    {
00279       ++nbelow;
00280       sumbelow += strip.SigCor();
00281    }
00282 }


Member Data Documentation

std::vector<std::pair<short,short> > Anp::CountAboveBelow::ignorevec [private]

Definition at line 85 of file FillSnarl.h.

Referenced by operator()().

unsigned int Anp::CountAboveBelow::nabove [private]

Definition at line 88 of file FillSnarl.h.

Referenced by GetMeanAbove(), GetNAbove(), and operator()().

unsigned int Anp::CountAboveBelow::nbelow [private]

Definition at line 89 of file FillSnarl.h.

Referenced by GetMeanBelow(), GetNBelow(), and operator()().

Definition at line 91 of file FillSnarl.h.

Referenced by GetMeanAbove(), and operator()().

Definition at line 92 of file FillSnarl.h.

Referenced by GetMeanBelow(), and operator()().

Definition at line 87 of file FillSnarl.h.

Referenced by operator()().


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

Generated on 25 Apr 2018 for loon by  doxygen 1.6.1