Updates for many plotting macros
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / macros / Makec3EAfile.C
CommitLineData
cbf4f1cb 1#include <math.h>
2#include <time.h>
3#include <stdio.h>
4#include <stdlib.h>
5#include <Riostream.h>
6
7#include "TVector2.h"
8#include "TFile.h"
9#include "TString.h"
10#include "TF1.h"
11#include "TH1.h"
12#include "TH2.h"
13#include "TH3.h"
14#include "TProfile.h"
15#include "TProfile2D.h"
16#include "TMath.h"
17#include "TText.h"
18#include "TRandom3.h"
19#include "TArray.h"
20#include "TLegend.h"
21#include "TStyle.h"
22#include "TMinuit.h"
23#include "TCanvas.h"
24#include "TPad.h"
25
26#define BohrR 1963.6885
27#define FmToGeV 0.19733 // conversion to fm
28#define PI 3.1415926
29#define masspiC 0.1395702 // pi+ mass (GeV/c^2)
30
31using namespace std;
32
33
34
35void Makec3EAfile(){
36
57e5b35f 37 int FT=0;// 0(EW) or 1(LG)
38
cbf4f1cb 39 TFile *infile;
40 TMinuit *fit;
41 //
57e5b35f 42 TH3D *PbPbEA = new TH3D("PbPbEA","",6,0.5,6.5, 4,0.5,4.5, 50,-0.5,49.5);// Rcoh type, parNum, Gindex
cbf4f1cb 43 PbPbEA->SetDirectory(0);
44 //
57e5b35f 45 TH3D *pPbEA = new TH3D("pPbEA","",6,0.5,6.5, 4,0.5,4.5, 50,-0.5,49.5);
cbf4f1cb 46 pPbEA->SetDirectory(0);
47 //
57e5b35f 48 TH3D *ppEA = new TH3D("ppEA","",6,0.5,6.5, 4,0.5,4.5, 50,-0.5,49.5);
cbf4f1cb 49 ppEA->SetDirectory(0);
50 //
51
52
53
54
55 //
56 //////////////////////////////
57 double value=0, value_e=0;
58 //
57e5b35f 59 for(int Gindex=0; Gindex<=25; Gindex++){
cbf4f1cb 60 // PbPb
57e5b35f 61 for(int RT=0; RT<6; RT++){// Rcoh type
cbf4f1cb 62
63 TString *name1 = new TString("FitFiles/FitFile_CT0_FT");
64 *name1 += FT;
57e5b35f 65 name1->Append("_R");
66 *name1 += RT;
cbf4f1cb 67 name1->Append("_G");
68 *name1 += Gindex;
69 name1->Append(".root");
70 infile = new TFile(name1->Data(),"READ");
71 fit = (TMinuit*)infile->Get("MyMinuit_c3");
72 for(int parNum=0; parNum<4; parNum++){
73 fit->GetParameter(parNum+1, value,value_e);
57e5b35f 74 PbPbEA->SetBinContent(RT+1, parNum+1, Gindex+1, value);
cbf4f1cb 75 }
76 infile->Close();
77
78 //
79 // pPb
80 TString *name1 = new TString("FitFiles/FitFile_CT1_FT");
81 *name1 += FT;
57e5b35f 82 name1->Append("_R");
83 *name1 += RT;
cbf4f1cb 84 name1->Append("_G");
85 *name1 += Gindex;
86 name1->Append(".root");
87 infile = new TFile(name1->Data(),"READ");
88 fit = (TMinuit*)infile->Get("MyMinuit_c3");
89 for(int parNum=0; parNum<4; parNum++){
90 fit->GetParameter(parNum+1, value,value_e);
57e5b35f 91 pPbEA->SetBinContent(RT+1, parNum+1, Gindex+1, value);
cbf4f1cb 92 }
93 infile->Close();
94 //
95 //
96 TString *name1 = new TString("FitFiles/FitFile_CT2_FT");
97 *name1 += FT;
57e5b35f 98 name1->Append("_R");
99 *name1 += RT;
cbf4f1cb 100 name1->Append("_G");
101 *name1 += Gindex;
102 name1->Append(".root");
103 infile = new TFile(name1->Data(),"READ");
104 fit = (TMinuit*)infile->Get("MyMinuit_c3");
105 for(int parNum=0; parNum<4; parNum++){
106 fit->GetParameter(parNum+1, value,value_e);
57e5b35f 107 ppEA->SetBinContent(RT+1, parNum+1, Gindex+1, value);
cbf4f1cb 108 }
109 infile->Close();
110 }
111 }
112 // blank for the rest
57e5b35f 113 for(int Gindex=26; Gindex<50; Gindex++){
114 for(int RT=0; RT<6; RT++){// EW or LG
cbf4f1cb 115 for(int parNum=0; parNum<4; parNum++){
57e5b35f 116 PbPbEA->SetBinContent(RT+1, parNum+1, Gindex+1, PbPbEA->GetBinContent(RT+1, parNum+1, 26));
117 pPbEA->SetBinContent(RT+1, parNum+1, Gindex+1, pPbEA->GetBinContent(RT+1, parNum+1, 26));
118 ppEA->SetBinContent(RT+1, parNum+1, Gindex+1, ppEA->GetBinContent(RT+1, parNum+1, 26));
cbf4f1cb 119 }
120 }
121 }
122
123 // Convert Lam_3 to proper EA normalization
124 for(int Gindex=0; Gindex<50; Gindex++){
57e5b35f 125 for(int RT=0; RT<6; RT++){// EW or LG
126 PbPbEA->SetBinContent(RT+1, 1, Gindex+1, pow(PbPbEA->GetBinContent(RT+1, 1, Gindex+1), 1/3.));
127 pPbEA->SetBinContent(RT+1, 1, Gindex+1, pow(pPbEA->GetBinContent(RT+1, 1, Gindex+1), 1/3.));
128 ppEA->SetBinContent(RT+1, 1, Gindex+1, pow(ppEA->GetBinContent(RT+1, 1, Gindex+1), 1/3.));
cbf4f1cb 129 }
130 }
131
132
133 TFile *outfile=new TFile("c3EAfile_temp.root","RECREATE");
134 PbPbEA->Write();
135 pPbEA->Write();
136 ppEA->Write();
137 //
138 outfile->Close();
139
140
141}