-
Notifications
You must be signed in to change notification settings - Fork 3
/
activity_special.cxx
60 lines (45 loc) · 1.4 KB
/
activity_special.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// 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 "TApplication.h"
#include "TFile.h"
#include "TKey.h"
#include "MCA_data.h"
using namespace std;
int main(int argc, char **argv){
// if (argc<2) {
// cerr << " give argument!" << endl;
// return -1;
// }
if (argc<3) {
cerr << " give name of two _cal.root files as argument! first is the sample, the second should be the background file to be subtracted. Also give the calibration file used to get the detector efficienciy information. " << endl;
return -1;
}
IsotopeDB base;
base.InitFromFile("isotopedb.txt");
cout << " Found " << base.GetNumberOfIsotopes() << " isotopes in database" << endl;
TApplication t("app",0,0);
TFile y1(argv[1]);
TFile y2(argv[2]);
if (y1.IsZombie() || y2.IsZombie()) return (-1);
GeAnalyse a;
CalMCA_data* data1 = (CalMCA_data*)((TKey*)y1.GetListOfKeys()->First())->ReadObj();
CalMCA_data* data2 = (CalMCA_data*)((TKey*)y2.GetListOfKeys()->First())->ReadObj();
GeCalibrate *cal = 0;
if (argc==4){
TFile yc(argv[3]);
cout << " using "<<argv[3]<<" file for calibration." << endl;
// yc.ls();
cal = (GeCalibrate*) yc.Get("GeCalibrate;1");
}
a.ActivityDeterminationSpecial(data1,data2,base,cal);
t.Run();
return 0;
}