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

List of all members.

Public Member Functions

 GammaEnergyChart (char *gammaFile, int minA=-100000, int maxA=1000000, int minZ=-100000, int maxZ=1000000, float tol=3E-3, float bgTol=5E-2)
 Constructor, constructs the object.
 ~GammaEnergyChart ()
 Destructor, destroys the object.
void addCoincidence (pair< EventHit *, EventHit * > toAdd, float epsilon)
 Adds a gamma line.
map< pair< int, int >, vector
< GammaLine * > > * 
getGammaLines ()

Private Attributes

map< pair< int, int >, vector
< GammaLine * > > * 
myGammaLines
 Gamma data from text file. Key is <A, Z>, value is a vector with gamma lines.

Detailed Description

Definition at line 23 of file GammaEnergyChart.hh.


Constructor & Destructor Documentation

GammaEnergyChart::GammaEnergyChart ( char *  gammaFile,
int  minA = -100000,
int  maxA = 1000000,
int  minZ = -100000,
int  maxZ = 1000000,
float  tol = 3E-3,
float  bgTol = 5E-2 
)

Constructor, constructs the object.

Parameters:
gammaFileFile containing gamma data of interesting nuclides.
minADiscard A below this value.
maxADiscard A above this value.
minZDiscard Z below this value.
maxZDiscard Z above this value.

Definition at line 15 of file GammaEnergyChart.cc.

References myGammaLines.

{  
  FILE * myFileStream = fopen(gammaFile,"r");
  if(myFileStream==NULL)
    {
      fprintf (stderr,"Could not open input event file %s, exiting.", gammaFile);
      exit(1);
    }
  myGammaLines = new map<pair<int, int>, vector<GammaLine*> >;
  //Read in all gamma lines
  while(!feof(myFileStream))
    {
      int tempA, tempZ;
      float tempGamma, tempProb;
      fscanf(myFileStream, "%d %d %e %e", &tempA, &tempZ, &tempGamma, &tempProb);
      tempGamma/=1000;
      if(!(tempA< minA || tempA > maxA || tempZ < minZ || tempZ > maxZ))
        {
          (*myGammaLines)[make_pair(tempA, tempZ)].push_back(new GammaLine(tol, bgTol));
          (*myGammaLines)[make_pair(tempA, tempZ)].back()->gamma = tempGamma;
          (*myGammaLines)[make_pair(tempA, tempZ)].back()->probability = tempProb;
        }
    }
}

Member Function Documentation

void GammaEnergyChart::addCoincidence ( pair< EventHit *, EventHit * >  toAdd,
float  epsilon 
)

Adds a gamma line.

Parameters:
toAddThe eventhit to add.
epsilonTolerance of energy.

Definition at line 40 of file GammaEnergyChart.cc.

References myGammaLines.

Referenced by GammaIdentifier::addCoincidence().

{
  for(map< pair< int , int > , vector < GammaLine * > > ::iterator it = 
        myGammaLines->begin(); it!=myGammaLines->end(); it++)
    {
      for(vector<GammaLine*>::iterator ig = it->second.begin(); ig!=it->second.end(); ig++)
        {
          //cout << (*ig)->gamma << "  " << toAdd.second->Ge << "  " << abs((*ig)->gamma-toAdd.second->Ge) << " " << (*ig)->gamma-toAdd.second->Ge << " EPS: " << epsilon << endl;
          (*ig)->addCoincidenceIfValid(toAdd);
        }
    }
}

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