Mixed Data Coincidence Analysis Software 1.0
A program to analyze files produced by the EventMixer software.
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes
GammaLine Class Reference

List of all members.

Public Member Functions

 GammaLine (float tol, float bgTol)
void addCoincidenceIfValid (pair< EventHit *, EventHit * > toAdd)
 Add a coincidence if it should be done.
float getBackgroundMean ()
 Get mean value of background.
float getBackgroundSTD ()
 Get standard deviation of background.

Public Attributes

float gamma
 Gamma energy.
float probability
 Probability.
vector< pair< EventHit
*, EventHit * > > 
coincidences
 Coincidences (valid) added to this gamma line.

Private Member Functions

float AbsVal (float toAbs)
 Absolute value.
void addBackground (float bg)
float standardDeviation (vector< float > toDeviate)
 Compute standard deviation.
float meanValue (vector< float > toMean)
 Compute mean value.
float sum (vector< float > toSum)
 Sum.

Private Attributes

float tolerance
 Tolerance.
float bgTolerance
 Background tolerance.
vector< float > background
 Background events.

Detailed Description

Definition at line 21 of file GammaLine.hh.


Constructor & Destructor Documentation

GammaLine::GammaLine ( float  tol,
float  bgTol 
)
Parameters:
tolTolerance when adding a gamma energy.
bgTolBackground tolerance when adding that energy.

Definition at line 3 of file GammaLine.cc.

References background.

  :tolerance(tol), bgTolerance(bgTol)
{
  for(float i = tol-bgTol; i<=tol+bgTol; i+=2*tol)
    {
      background.push_back(0);
    }
}

Member Function Documentation

float GammaLine::AbsVal ( float  toAbs) [private]

Absolute value.

Parameters:
toAbsValue to take abs of

Definition at line 36 of file GammaLine.cc.

Referenced by addCoincidenceIfValid().

{
  if(toAbs<0)
    return -toAbs;
  return toAbs;
}
void GammaLine::addBackground ( float  bg) [private]
Parameters:
bgOnly add valid background, plz.

Definition at line 12 of file GammaLine.cc.

References background, bgTolerance, and tolerance.

Referenced by addCoincidenceIfValid().

{
  for(unsigned int i = 0; i<background.size(); i++)
    {
      if((tolerance-bgTolerance+i*tolerance)>bg)
        {
          ++background[i];
          return;
        }
    }
}
void GammaLine::addCoincidenceIfValid ( pair< EventHit *, EventHit * >  toAdd)

Add a coincidence if it should be done.

Parameters:
toAddThe coincidence to add.

Definition at line 24 of file GammaLine.cc.

References AbsVal(), addBackground(), bgTolerance, coincidences, gamma, and tolerance.

{
  if(AbsVal(toAdd.second->Ge-gamma)<tolerance)
    {
      coincidences.push_back(toAdd);
    }
  if(AbsVal(toAdd.second->Ge-gamma)<bgTolerance)
    {
      addBackground(toAdd.second->Ge);
    }
}
float GammaLine::standardDeviation ( vector< float >  toDeviate) [private]

Compute standard deviation.

Parameters:
toDeviateTo deviate...

Definition at line 44 of file GammaLine.cc.

References meanValue().

Referenced by getBackgroundSTD().

{
  if(toDeviate.size()<2)
    return 0;
  float mean = meanValue(toDeviate);
  float stdev = 0;
  for(vector<float>::iterator it = toDeviate.begin(); it!=toDeviate.end(); it++)
    {
      stdev+=pow(*it-mean,2);
    }
  stdev/=(toDeviate.size()-1);
  return sqrt(stdev);
}
float GammaLine::sum ( vector< float >  toSum) [private]

Sum.

Parameters:
toSumElements to sum.

Definition at line 64 of file GammaLine.cc.

Referenced by meanValue().

{
  float sum = 0;
  for(vector<float>::iterator it = toSum.begin(); it!=toSum.end(); it++)
    {
      sum+=*it;
    }
  return sum;
}

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines

Back to the main page of the Precalibrated Ion Beam Identification Detector project

Created by Rikard Lundmark