BuildDependencies.C 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. #include <TFile.h>
  2. #include <TGraphErrors.h>
  3. #include <TMultiGraph.h>
  4. #include <TCanvas.h>
  5. #include <TH1.h>
  6. #include <TString.h>
  7. #include <TMath.h>
  8. #include <TLegend.h>
  9. //_________________
  10. void BuildDependencies() {
  11. const Char_t *mInFileName[2];
  12. TFile *mInFile[2];
  13. mInFileName[0] = "oKaonHBT_auau200_pid2.root";
  14. mInFileName[1] = "oPionHBT_auau200_pid2.root";
  15. for(Int_t i=0; i<2; i++) {
  16. mInFile[i] = TFile::Open(mInFileName[i]);
  17. }
  18. TFile *mOutFile = new TFile("oHBTdep_auau200_pid2.root","recreate");
  19. ///////////////////////
  20. // Au+Au //
  21. ///////////////////////
  22. TGraphErrors *mMultDepGrErr[2][3]; //Type, Charge
  23. TGraphErrors *mMultKtGrErr[2][3][7]; //Type, Charge, Cenrality
  24. TGraphErrors *mMultMtGrErr[2][3][7]; //Type, Charge, Cenrality
  25. //Loop over files and graphs
  26. for(Int_t iFile=0; iFile<2; iFile++) {
  27. for(Int_t iCharge=0; iCharge<3; iCharge++) {
  28. mMultDepGrErr[iFile][iCharge] = (TGraphErrors*)mInFile[iFile]
  29. ->Get(Form("gMultDepRadiiGrErr_%d",iCharge));
  30. if(iFile == 0) {
  31. mMultDepGrErr[iFile][iCharge]->SetName(Form("gKaonMultDepRadiiGrErr_%d",iCharge));
  32. }
  33. else {
  34. mMultDepGrErr[iFile][iCharge]->SetName(Form("gPionMultDepRadiiGrErr_%d",iCharge));
  35. }
  36. for(Int_t iCent=0; iCent<7; iCent++) {
  37. mMultKtGrErr[iFile][iCharge][iCent] = (TGraphErrors*)mInFile[iFile]
  38. ->Get(Form("gMultKtDepRadiiGrErr_%d_%d",iCharge,(iCent+2)));
  39. mMultMtGrErr[iFile][iCharge][iCent] = (TGraphErrors*)mInFile[iFile]
  40. ->Get(Form("gMultKtDepRadiiMtGrErr_%d_%d",iCharge,(iCent+2)));
  41. if(iFile == 0) {
  42. mMultKtGrErr[iFile][iCharge][iCent]->
  43. SetName(Form("gKaonMultKtDepRadiiGrErr_%d_%d",iCharge,(iCent+2)));
  44. mMultMtGrErr[iFile][iCharge][iCent]->
  45. SetName(Form("gKaonMultMtDepRadiiGrErr_%d_%d",iCharge,(iCent+2)));
  46. }
  47. else {
  48. mMultKtGrErr[iFile][iCharge][iCent]->
  49. SetName(Form("gPionMultKtDepRadiiGrErr_%d_%d",iCharge,(iCent+2)));
  50. mMultMtGrErr[iFile][iCharge][iCent]->
  51. SetName(Form("gPionMultMtDepRadiiGrErr_%d_%d",iCharge,(iCent+2)));
  52. }
  53. } //for(Int_t iCent=2; iCent<9; iCent++)
  54. } //for(Int_t iCharge=0; iCharge<3; iCharge++)
  55. } //for(Int_t iFile=0; iFile<2; iFile++)
  56. TMultiGraph *mgMultDep = new TMultiGraph;
  57. for(Int_t iFile=0; iFile<2; iFile++) {
  58. mgMultDep->Add(mMultDepGrErr[iFile][2]);
  59. }
  60. TMultiGraph *mgMultKtDep = new TMultiGraph;
  61. TMultiGraph *mgMultMtDep = new TMultiGraph;
  62. TMultiGraph *mgMultMtSumDep = new TMultiGraph;
  63. for(Int_t iFile=0; iFile<2; iFile++) {
  64. //Separate charges
  65. for(Int_t iCharge=0; iCharge<2; iCharge++) {
  66. for(Int_t iCent=0; iCent<7; iCent++) {
  67. if(iFile == 0) {
  68. mgMultKtDep->Add(mMultKtGrErr[iFile][iCharge][iCent]);
  69. }
  70. mgMultMtDep->Add(mMultMtGrErr[iFile][iCharge][iCent]);
  71. }
  72. }
  73. //Sum of charges
  74. for(Int_t iCent=0; iCent<7; iCent++) {
  75. mgMultMtSumDep->Add(mMultMtGrErr[iFile][2][iCent]);
  76. }
  77. }
  78. Double_t mCentrality[9] = {15,31,58,98,157,234,335,430,482};
  79. Double_t mCentralityErr[9] = {0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1};
  80. Double_t mCentralityRad[9] = {1.78, 2.13, 2.45, 2.77, 3.13, 3.45, 3.78, 3.93, 4.04};
  81. Double_t mCentralityRadErr[9] = {0.03, 0.04, 0.03, 0.05, 0.04, 0.04, 0.05, 0.06, 0.05};
  82. TGraphErrors *mCentrSysErrTGr = new TGraphErrors(9, mCentrality, mCentralityRad,
  83. mCentralityErr, mCentralityRadErr);
  84. mCentrSysErrTGr->SetMarkerStyle(20);
  85. mCentrSysErrTGr->SetMarkerColor(1);
  86. mCentrSysErrTGr->SetLineWidth(2);
  87. //mgMultDep->Add(mCentrSysErrTGr);
  88. TCanvas *cCentDep = new TCanvas("cCentDep","cCentDep",800,600);
  89. mgMultDep->Draw("AP");
  90. mCentrSysErrTGr->Draw("[]");
  91. TCanvas *cCentKtDep = new TCanvas("cCentKtDep","cCentKtDep",800, 600);
  92. mgMultKtDep->Draw("AP");
  93. TCanvas *cCentMtDep = new TCanvas("cCentMtDep","cCentMtDep",800,600);
  94. mgMultMtDep->Draw("AP");
  95. TCanvas *cCentMtSumDep = new TCanvas("cCentMtSumDep","cCentMtSumDep",800.600);
  96. mgMultMtSumDep->Draw("APL");
  97. /*
  98. ///////////////////////
  99. // pp //
  100. ///////////////////////
  101. Double_t mKaonRadiiKtVal[4] = { 1.24, 1.14, 1.12, 1.16};
  102. Double_t mKaonRadiiKtValErr[4] = {0.11, 0.10, 0.11, 0.08};
  103. Double_t mKaonKtVal[4] = {0.21, 0.35, 0.45, 0.66};
  104. Double_t mKaonKtValErr[4] = {0.01, 0.01, 0.01, 0.01};
  105. Double_t mKaonMtVal[4];
  106. Double_t KAON_MASS_SQR = 0.24371698;
  107. for(Int_t i=0; i<4; i++) {
  108. mKaonMtVal[i] = TMath::Sqrt(KAON_MASS_SQR + mKaonKtVal[i]);
  109. }
  110. TGraphErrors *mKaonMtRadii = new TGraphErrors(4, mKaonMtVal, mKaonRadiiKtVal,
  111. mKaonKtValErr, mKaonRadiiKtValErr);
  112. mKaonMtRadii->SetName(Form("mKaonMtRadii"));
  113. Double_t mPionRadiiKtVal[4] = {1.32, 1.26, 1.18, 1.05};
  114. Double_t mPionRadiiKtValErr[4] = {0.02, 0.02, 0.02, 0.03};
  115. Double_t mPionKtVal[4] = {0.25, 0.35, 0.45, 0.6};
  116. Double_t mPionKtValErr[4] = {0.01, 0.01, 0.01, 0.01};
  117. Double_t mPionMtVal[4];
  118. Double_t PION_MASS_SQR = 0.0194797;
  119. for(Int_t i=0; i<4; i++) {
  120. mPionMtVal[i] = TMath::Sqrt(PION_MASS_SQR + mPionKtVal[i]);
  121. }
  122. TGraphErrors *mPionMtRadii = new TGraphErrors(4, mPionMtVal, mPionRadiiKtVal,
  123. mPionKtValErr, mPionRadiiKtValErr);
  124. mPionMtRadii->SetName(Form("mPionMtRadii"));
  125. TMultiGraph *mgSmallMtDep = new TMultiGraph;
  126. mgSmallMtDep->Add(mKaonMtRadii);
  127. mgSmallMtDep->Add(mPionMtRadii);
  128. TCanvas *cSmallMtDep = new TCanvas("cSmallMtDep","cSmallMtDep",800,600);
  129. mgSmallMtDep->Draw("AP");
  130. */
  131. cCentDep->Write();
  132. cCentKtDep->Write();
  133. cCentMtDep->Write();
  134. cCentMtSumDep->Draw();
  135. mOutFile->Write();
  136. mOutFile->Close();
  137. }