-
Notifications
You must be signed in to change notification settings - Fork 3
/
testDB.cxx
43 lines (33 loc) · 901 Bytes
/
testDB.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Test for isotope data base
//
// Carsten Krauss April 2012
//
#include "iostream"
#include "fstream"
#include "time.h"
#include "TH1I.h"
#include "TNamed.h"
#include "TCanvas.h"
#include "TFile.h"
#include "MCA_data.h"
using namespace std;
int main(int argc, char **name){
// if (argc<2) {
// cerr << " give argument!" << endl;
// return -1;
// }
IsotopeDB base;
base.InitFromFile("isotopedb.txt");
cout << " Found " << base.GetNumberOfIsotopes() << " isotopes in database" << endl;
//for (int i = 11 ; i < 12 ; i++){
for (int i = 0 ; i < base.GetNumberOfIsotopes() ; i++){
Isotope Is = base.GetIsotopeByNumber(i);
cout << Is.GetName() << endl;
double E, I;
for (int y = 0; y < Is.GetNumberOfLines() ; y++){
Is.GetEnergyAndIntensityByIntensity(y,E,I);
cout << " ---> " << I << " " << E << " keV" << endl;
}
}
return 0;
}