Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
Femto1DCFAnaMapMC.cxx
1/*
2 * Femto1DCFAnaMapMC.cxx
3 *
4 * Created on: 2 kwi 2018
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9
10#include "Femto1DCFAnaMapMC.h"
11
12
13#include <TAxis.h>
14#include <TDatabasePDG.h>
15#include <TFile.h>
16#include <TH1.h>
17#include <TH2.h>
18#include <TLorentzVector.h>
19#include <TMath.h>
20#include <TParticlePDG.h>
21#include <TRandom.h>
22#include <TVector3.h>
23
24#include "DividedHisto.h"
25#include "Femto1DCF.h"
26#include "FemtoPair.h"
27#include "FemtoSourceModel.h"
28
29namespace Hal {
30 Femto1DCFAnaMapMC::Femto1DCFAnaMapMC() : Femto1DMapGenerator() {}
31
32 Femto1DCFAnaMapMC::~Femto1DCFAnaMapMC() {}
33
34 void Femto1DCFAnaMapMC::Run(Int_t pairs_per_bin) {
35 Double_t* kstar = new Double_t[fMap->GetNum()->GetNbinsX() + 1];
36 Double_t* kfill = new Double_t[fMap->GetNum()->GetNbinsX() + 1];
37 for (int i = 1; i <= fMap->GetNum()->GetNbinsX(); i++) {
38 kstar[i] = fMap->GetNum()->GetXaxis()->GetBinCenter(i);
39 kfill[i] = kstar[i];
40 if (fKinematics == Femto::EKinematics::kLCMS) { kstar[i] = kstar[i] * 0.5; }
41 }
42 TVector3 boost(0.1, 0.1, 0.1);
43
44 for (int ikst = 1; ikst <= fMap->GetNum()->GetNbinsX(); ikst++) {
45 Double_t E1 = TMath::Sqrt(fMass12 + kstar[ikst] * kstar[ikst]);
46 Double_t E2 = TMath::Sqrt(fMass22 + kstar[ikst] * kstar[ikst]);
47 Double_t px, py, pz;
48 gRandom->Sphere(px, py, pz, kstar[ikst]);
49 TLorentzVector p1(px, py, pz, E1);
50 TLorentzVector p2(-px, -py, -pz, E2);
51 p1.Boost(boost);
52 p2.Boost(boost);
53 fPair->SetTrueMomenta1(p1.X(), p1.Y(), p1.Z(), p1.T());
54 fPair->SetTrueMomenta2(p2.X(), p2.Y(), p2.Z(), p2.T());
55 for (int r_bin = 0; r_bin < fRBins; r_bin++) {
56 Double_t R = fRadiiBins[r_bin];
57 fGenerator->GetSourceModel()->SetRadius(R);
58 for (int i = 0; i < pairs_per_bin; i++) {
59 fGenerator->GenerateFreezoutCooordinates(fPair);
60 Double_t weight = fWeight->GenerateWeight(fPair);
61 ((TH2*) fMap->GetNum())->Fill(kfill[ikst], R, weight);
62 ((TH2*) fMap->GetDen())->Fill(kfill[ikst], R, 1);
63 }
64 }
65 }
66 delete[] kfill;
67 delete[] kstar;
68 }
69
70 Bool_t Femto1DCFAnaMapMC::Init() {
71 Bool_t res = Femto1DMapGenerator::Init();
72 return res;
73 }
74} // namespace Hal