MpdCalculator.h 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #ifndef MPD_CALCULATOR_H
  2. #define MPD_CALCULATOR_H
  3. #include "utility.h"
  4. class MpdCalculator
  5. {
  6. private:
  7. TString inFileName;
  8. TString outFileName;
  9. TChain *inChain;
  10. TFile *outFile;
  11. TFile *dcaFile;
  12. TH1F *h_pt[NcentralityBinsRes][_N_SORTS], *h_eta[NcentralityBinsRes][_N_SORTS], *h_phi[NcentralityBinsRes][_N_SORTS];//
  13. TH1F *h_pt_mc[NcentralityBinsRes][_N_SORTS], *h_eta_mc[NcentralityBinsRes][_N_SORTS], *h_phi_mc[NcentralityBinsRes][_N_SORTS];//
  14. TH1F *h_pt_after[NcentralityBinsRes][_N_SORTS], *h_eta_after[NcentralityBinsRes][_N_SORTS], *h_phi_after[NcentralityBinsRes][_N_SORTS];//
  15. TH1F *h_pt_mc_after[NcentralityBinsRes][_N_SORTS], *h_eta_mc_after[NcentralityBinsRes][_N_SORTS], *h_phi_mc_after[NcentralityBinsRes][_N_SORTS];//
  16. TH2F *h2_pt_vs_eta[NcentralityBinsRes][_N_SORTS], *h2_pt_vs_phi[NcentralityBinsRes][_N_SORTS], *h2_phi_vs_eta[NcentralityBinsRes][_N_SORTS];//
  17. TH2F *h2_pt_vs_eta_after[NcentralityBinsRes][_N_SORTS], *h2_pt_vs_phi_after[NcentralityBinsRes][_N_SORTS], *h2_phi_vs_eta_after[NcentralityBinsRes][_N_SORTS];//
  18. TH1F *h_nhits_TPC, *h_nhits_TPC_after, *h_multiplicity , *h_multiplicity_before, *h_impact_parameter;//
  19. TH2F *h2_energy_ZDC_vs_multiplicity[_N_ARM];//
  20. TH2F *h2_energyZDC_L_vs_energy_ZDC_R;//
  21. TH2F *h2_b_vs_centrality;
  22. TH1F *h_energy_ZDC_total[_N_ARM];//
  23. TH1F *h_DCA_primary[Ndim][NptBins][NetaBins], *h_DCA_secondary[Ndim][NptBins][NetaBins], *h_DCA_all[Ndim][NptBins][NetaBins];
  24. //TF1 *f_dca[Ndim][NptBins][NetaBins];
  25. TF1 *f_pt_fit[Ndim][NetaBins];
  26. TH1F *h_pt_PID_efficiency_before[NetaBins];
  27. TH1F *h_pt_PID_efficiency_after[NetaBins];
  28. TH1F *h_pt_PID_efficiency_after_sorts[NetaBins][_N_SORTS];
  29. TH2F* h2_flow_wrt_RP_vs_pt[NcentralityBinsFlow][_N_HARM];
  30. TH2F* h2_flow_wrt_full_vs_pt_divided[NcentralityBinsFlow][_N_HARM][_N_HARM][_N_METHOD];
  31. TH2F* h2_b_vs_multiplicity;
  32. TProfile *p_Res2Psi_vs_b[_N_HARM][_N_HARM][_N_METHOD];//
  33. TProfile *p_true_Res_vs_b[_N_HARM][_N_HARM][_N_METHOD];//
  34. TProfile *p_true_Res_half_vs_b[_N_ARM][_N_HARM][_N_HARM][_N_METHOD];//
  35. TProfile *p_qx_vs_b[_N_ARM][_N_HARM][_N_METHOD];//
  36. TProfile *p_qy_vs_b[_N_ARM][_N_HARM][_N_METHOD];//
  37. TProfile *p_flow_wrt_full_vs_centrality[_N_HARM][_N_HARM][_N_METHOD], *p_flow_wrt_full_vs_pt[NcentralityBinsFlow][_N_HARM][_N_HARM][_N_METHOD], *p_flow_wrt_full_vs_eta[NcentralityBinsFlow][_N_HARM][_N_HARM][_N_METHOD], *p_flow_wrt_full_vs_rapidity[NcentralityBinsFlow][_N_HARM][_N_HARM][_N_METHOD];
  38. TProfile *p_flow_wrt_full_vs_centrality_divided[_N_HARM][_N_HARM][_N_METHOD], *p_flow_wrt_full_vs_pt_divided[NcentralityBinsFlow][_N_HARM][_N_HARM][_N_METHOD], *p_flow_wrt_full_vs_eta_divided[NcentralityBinsFlow][_N_HARM][_N_HARM][_N_METHOD], *p_flow_wrt_full_vs_rapidity_divided[NcentralityBinsFlow][_N_HARM][_N_HARM][_N_METHOD];
  39. TProfile *p_flow_wrt_RP_vs_centrality[_N_HARM], *p_flow_wrt_RP_vs_pt[NcentralityBinsFlow][_N_HARM], *p_flow_wrt_RP_vs_eta[NcentralityBinsFlow][_N_HARM], *p_flow_wrt_RP_vs_rapidity[NcentralityBinsFlow][_N_HARM];
  40. TProfile *p_momenta_resolution[_N_SORTS];
  41. TProfile *p_b_vs_multiplicity, *p_b_vs_energy;
  42. TH2F *h2_b_vs_energy;
  43. Float_t b_mc;
  44. Int_t centrality_tpc_mpd;
  45. Long64_t n_tracks_mc;
  46. Long64_t n_tracks_mpd;
  47. Long64_t k_tracks_mpd;
  48. Float_t signed_pt_mpd[_MAX_TRACKS];
  49. Float_t pt_mc[_MAX_TRACKS];
  50. Float_t eta_mpd[_MAX_TRACKS];
  51. Int_t n_hits_mpd[_MAX_TRACKS];
  52. Float_t phi_mpd[_MAX_TRACKS];
  53. Float_t theta_mpd[_MAX_TRACKS];
  54. Float_t tof_beta_mpd[_MAX_TRACKS];
  55. Long64_t id_from_mc_mpd[_MAX_TRACKS];
  56. Int_t mother_ID_mc[_MAX_TRACKS];
  57. Int_t PDG_code_mc[_MAX_TRACKS];
  58. Float_t phiEP_mc;
  59. Float_t ZDC_energy_mpd[_N_MODULES_TOTAL];
  60. Float_t chi2_mpd[_MAX_TRACKS];
  61. Float_t eta_mc[_MAX_TRACKS];
  62. Float_t px_mc[_MAX_TRACKS];
  63. Float_t py_mc[_MAX_TRACKS];
  64. Float_t pz_mc[_MAX_TRACKS];
  65. Float_t energy_mc[_MAX_TRACKS];
  66. Float_t q_vectors_mpd[_N_QCOMP][_N_HARM][_N_METHOD][_N_ARM];
  67. Float_t q_norm_mpd[_N_HARM][_N_METHOD][_N_ARM];
  68. Float_t eta_match_mc_mpd[_MAX_TRACKS];
  69. Float_t phi_match_mc_mpd[_MAX_TRACKS];
  70. Float_t signed_pt_match_mc_mpd[_MAX_TRACKS];
  71. Float_t DCA_x_mpd[_MAX_TRACKS];
  72. Float_t DCA_y_mpd[_MAX_TRACKS];
  73. Float_t DCA_z_mpd[_MAX_TRACKS];
  74. Float_t pid_tpc_prob_pion_mpd[_MAX_TRACKS];
  75. Float_t pid_tpc_prob_kaon_mpd[_MAX_TRACKS];
  76. Float_t pid_tpc_prob_proton_mpd[_MAX_TRACKS];
  77. Float_t TOF_flag_mpd[_MAX_TRACKS];
  78. Double_t GetPsiHalfTpc(EPParticle* event_plane_buffer, Int_t buffer_size, Int_t sign, Int_t harm, Double_t &Qx, Double_t &Qy); //if sign == 1 then its positive pseudorapidity and all weights are positive
  79. Double_t GetPsiHalfZdc(Float_t* zdc_energy, Int_t zdc_ID, Int_t n, Double_t &qx, Double_t &qy);
  80. Double_t GetPsiFullTpc(EPParticle* event_plane_buffer, Int_t buffer_size, Int_t harm);
  81. Double_t GetPsiFullZdc(Float_t* zdc_energy, Int_t n);
  82. Double_t GetTotalMomenta(EPParticle* event_plane_buffer, Int_t buffer_size, Int_t sign);
  83. void GetQsTpc(EPParticle* event_plane_buffer, Int_t buffer_size, Int_t sign, Int_t harm, Double_t &Qx, Double_t &Qy);
  84. void GetQsZdc(Float_t* zdc_energy, Int_t zdc_ID, Int_t harm, Double_t &Qx, Double_t &Qy);
  85. Double_t GetTotalEnergy(Float_t* zdc_energy, Int_t zdc_ID);
  86. bool FlowCut(Float_t eta, Float_t pt, Int_t pdg, Int_t goal);
  87. public:
  88. MpdCalculator(TString inFileName, TString outFileName, TString dcaFileName);
  89. void FillTPC(Int_t centrality_bin, EPParticle *event_plane_buffer, Int_t ep_particle_count, Float_t weightB);
  90. void FillZDC(Int_t centrality_bin, Float_t *ZDC_energy_mpd, Float_t weightB);
  91. void CalculateResolutions(Int_t nevents = 0);
  92. void CalculateFlow(Int_t nevents, TString fitFile);
  93. void Write();
  94. Int_t GetCentralityBinRes(Int_t multiplicity);
  95. Int_t GetCentralityBinFlow(Int_t multiplicity);
  96. Int_t GetMultiplicityTPC();
  97. int GetPtBin(Float_t pt);
  98. int GetEtaBin(Float_t eta);
  99. };
  100. #endif