ENSDF++ 1.1
An easy, fast and simple way to run querys towards the ENSDF database, written in C++.
Functions
MassPrinter.cpp File Reference

Source file for the MassPrinter class. More...

#include "MassPrinter.h"

Go to the source code of this file.

Functions

int main ()
 Main function in this short program.

Detailed Description

Source file for the MassPrinter class.

Author:
Rikard Lundmark

Purpose

The purpose of the MassPrinter is to print the masses of all isotopes in the mass.mas03 file, in order to prepare a nucleid chart.

Definition in file MassPrinter.cpp.


Function Documentation

int main ( )

Main function in this short program.

The main test function and program entry point.

Main function.

Definition at line 3 of file MassPrinter.cpp.

References MassTable::getMassObjects(), and NULL.

{
  int thisVariableIsOnlyUsedToAvoidCompilerWarnings = 0;
  printf("Loading nucleid mass table..."); fflush(stdout);
  MassTable myMassTable("../ENSDF_MASSTABLE/mass.mas03");
  printf("done\n");
  printf("Enter output file name: "); fflush(stdout); fflush(stdin);
  char * myD = new char[255];
  thisVariableIsOnlyUsedToAvoidCompilerWarnings=scanf("%s", myD);
  FILE * myFile = fopen(myD, "w");
  if(myFile==NULL)
    {
      perror("File could not be opened.");
      return 1;
    }
  list<MassObject> myList = myMassTable.getMassObjects();
  fprintf(myFile, "0 1 n\n");
  for(list<MassObject>::iterator it = myList.begin(); it!=myList.end(); it++)
    {
      fprintf(myFile, "%d %d %s\n", it->getNukleid().getZ(), it->getNukleid().getA(), it->getNukleid().getElement().c_str());
    }
  fclose(myFile);
  printf("File successfully created, finishing.\n");
  return 0;
}
 All Classes Files Functions Variables Enumerations Enumerator Defines

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

Created by Rikard Lundmark