1 | //std |
---|
2 | //#include <stdio.h> |
---|
3 | #include <stdlib.h> |
---|
4 | #include <math.h> |
---|
5 | #include <string.h> |
---|
6 | #include <cmath> |
---|
7 | #include <values.h> |
---|
8 | #include <fstream> |
---|
9 | #include <iostream> |
---|
10 | |
---|
11 | //Globes |
---|
12 | #include <globes/globes.h> |
---|
13 | |
---|
14 | // AIDA : |
---|
15 | #include <AIDA/IAnalysisFactory.h> |
---|
16 | #include <AIDA/ITreeFactory.h> |
---|
17 | #include <AIDA/IHistogramFactory.h> |
---|
18 | #include <AIDA/ITree.h> |
---|
19 | #include <AIDA/ITupleFactory.h> |
---|
20 | #include <AIDA/ITuple.h> |
---|
21 | |
---|
22 | |
---|
23 | |
---|
24 | #define TH12 ( 0.5 * asin(sqrt(0.82)) ) |
---|
25 | #define TH23 ( M_PI/4.0 ) |
---|
26 | #define TH13 ( 0.0 ) |
---|
27 | |
---|
28 | //#define DELTA ( M_PI/2 ) |
---|
29 | #define DELTA ( 0.0 ) |
---|
30 | |
---|
31 | #define DMQ21 8.1e-5 |
---|
32 | #define DMQ31 2.2e-3 |
---|
33 | |
---|
34 | |
---|
35 | |
---|
36 | /**************************************/ |
---|
37 | /* main */ |
---|
38 | /**************************************/ |
---|
39 | |
---|
40 | int main(int argc, char *argv[]) |
---|
41 | { |
---|
42 | //init AIDA for Histo/Tuple |
---|
43 | AIDA::IAnalysisFactory* aida = AIDA_createAnalysisFactory(); |
---|
44 | if(!aida) { |
---|
45 | std::cerr << " AIDA not found." << std::endl; |
---|
46 | return 0; |
---|
47 | } |
---|
48 | |
---|
49 | //ROOT tree : |
---|
50 | AIDA::ITreeFactory* treeFactory = aida->createTreeFactory(); |
---|
51 | std::string opts = "export=root"; |
---|
52 | AIDA::ITree* fTree = |
---|
53 | treeFactory->create("proba.root","root",false,true,opts); |
---|
54 | delete treeFactory; |
---|
55 | |
---|
56 | //Booking Tuple |
---|
57 | AIDA::ITupleFactory* tf = aida->createTupleFactory(*fTree); |
---|
58 | |
---|
59 | int NumberOfColumn = 3; |
---|
60 | std::vector<std::string> column(NumberOfColumn); |
---|
61 | const char* c_column[] = {"channel","theta23","proba"}; |
---|
62 | std::vector<std::string> coltype(NumberOfColumn); |
---|
63 | const char* c_coltype[] = {"int","double","double"}; |
---|
64 | for (int icol = 0; icol<NumberOfColumn; ++icol) { |
---|
65 | column[icol] = c_column[icol]; |
---|
66 | coltype[icol] = c_coltype[icol]; |
---|
67 | } |
---|
68 | |
---|
69 | AIDA::ITuple* myTuple = |
---|
70 | tf->create("SplGlb","Proba",column,coltype); |
---|
71 | |
---|
72 | |
---|
73 | //Init Globes: Attention SPL.glb may be a symbolic link |
---|
74 | glbInit(argv[0]); |
---|
75 | glbInitExperiment("../data/SPL.glb", |
---|
76 | &glb_experiment_list[0], |
---|
77 | &glb_num_of_exps); |
---|
78 | |
---|
79 | double ene = 0.260; //neutrino energy (GeV) |
---|
80 | double baseline = 130.; //baseline (km) |
---|
81 | double theta23;// current value of Theta23 |
---|
82 | double sin2th; // current sin2(theta23) (and not sin2(2theta23)) |
---|
83 | double sin2ThMin = 0.3; |
---|
84 | double sin2ThMax = 0.7; |
---|
85 | double stepSin2Th = 0.01; |
---|
86 | int muonType = 2; //nu_mu init |
---|
87 | int channel; //oscillation channel |
---|
88 | double probaV; //vaccum oscillation probability |
---|
89 | |
---|
90 | glb_params true_values = glbAllocParams(); |
---|
91 | //nu_mu->nu_e: 1; ->nu_mu: 2; ->nu_tau: 3 |
---|
92 | for (channel = 1; channel<=3 ; channel++) { |
---|
93 | for (sin2th = sin2ThMin; sin2th<=sin2ThMax; sin2th += stepSin2Th ) { |
---|
94 | theta23 = asin(sqrt(sin2th)); |
---|
95 | // true values (reference for future Chi2 computations) |
---|
96 | glbDefineParams(true_values, TH12, TH13, theta23, DELTA, DMQ21, DMQ31); |
---|
97 | glbSetOscillationParameters(true_values); |
---|
98 | // glbSetRates(); |
---|
99 | probaV = glbVacuumProbability(muonType,channel,+1,ene,baseline); |
---|
100 | |
---|
101 | //store in Tuple |
---|
102 | myTuple->fill(0,channel); |
---|
103 | myTuple->fill(1,theta23); |
---|
104 | myTuple->fill(2,probaV); |
---|
105 | myTuple->addRow(); |
---|
106 | |
---|
107 | }//loop on sin2th |
---|
108 | }//loop on channel |
---|
109 | |
---|
110 | glbFreeParams(true_values); |
---|
111 | // glbFreeParams(start_values); |
---|
112 | |
---|
113 | //save Tuple |
---|
114 | fTree->commit(); |
---|
115 | delete fTree; |
---|
116 | |
---|
117 | delete aida; |
---|
118 | return 0; |
---|
119 | } |
---|
120 | |
---|
121 | |
---|
122 | |
---|
123 | |
---|
124 | |
---|