![]() |
ENSDF++ 1.1
An easy, fast and simple way to run querys towards the ENSDF database, written in C++.
|
Source file for the small program ParticleInstablePrinter. More...
#include "ParticleInstablePrinter.h"
Go to the source code of this file.
Functions | |
int | main () |
Main function in this short program. |
Source file for the small program ParticleInstablePrinter.
The purpose of the ParticleInstablePrinter is to print particle instable isotopes to a file in order to display these in a nucleid chart.
Definition in file ParticleInstablePrinter.cpp.
int main | ( | ) |
Main function in this short program.
The main test function and program entry point.
Main function.
Definition at line 4 of file ParticleInstablePrinter.cpp.
References HalfLifeEstimator::estimateHalfLife(), MassObject::getMassExcess(), MassTable::getMassObject(), MassTable::getMassObjects(), NEUTRONMASS, NULL, PROTONMASS, and ExperimentalValue::value.
{ 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(); for(list<MassObject>::iterator it = myList.begin(); it!=myList.end(); it++) { double VL = it->getAtomicMass().value; double HL1 = 1E99, HL2 = 1E99, HL3 = 1E99, HL4 = 1E99, HL5=1E99; bool alphaInstable = false; try { HL1 = myMassTable.getMassObject(it->getNukleid().getZ()-1, it->getNukleid().getA()-1).getAtomicMass().value + PROTONMASS; } catch(DataFileException) {} try { HL2 = myMassTable.getMassObject(it->getNukleid().getZ(), it->getNukleid().getA()-1).getAtomicMass().value + NEUTRONMASS; } catch(DataFileException) {} try { HL3 = myMassTable.getMassObject(it->getNukleid().getZ(), it->getNukleid().getA()-2).getAtomicMass().value + 2*NEUTRONMASS; } catch(DataFileException) {} try { HL4 = myMassTable.getMassObject(it->getNukleid().getZ()-1, it->getNukleid().getA()-2).getAtomicMass().value + NEUTRONMASS + PROTONMASS; } catch(DataFileException) {} try { HL5 = myMassTable.getMassObject(it->getNukleid().getZ()-2, it->getNukleid().getA()-2).getAtomicMass().value + 2*PROTONMASS; } catch(DataFileException) {} try { double aAlpha = -1E99; double aMyself = it->getMassExcess().value; aAlpha = myMassTable.getMassObject(it->getNukleid().getZ() - 2,it->getNukleid().getA()-4).getMassExcess().value + myMassTable.getMassObject(2,4).getMassExcess().value; HalfLifeEstimator myEstimator; alphaInstable = (myEstimator.estimateHalfLife((aMyself-aAlpha)/1E3, it->getNukleid().getA(), it->getNukleid().getZ()) < 1E-9); } catch(DataFileException) { //do nothing... } if(VL>HL1 || VL>HL2 || VL>HL3 || VL>HL4 || VL>HL5 || alphaInstable) 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; }