Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TwoTrackFemtoPRFCut.cxx
1/*
2 * TwoTrackFemtoPRFCut.cxx
3 *
4 * Created on: 25 lis 2016
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "TwoTrackFemtoPRFCut.h"
10
11#include "DataFormatManager.h"
12#include "Event.h"
13#include "McTrack.h"
14#include "TwoTrack.h"
15namespace Hal {
16 TwoTrackFemtoPRFCut::TwoTrackFemtoPRFCut() : TwoTrackCut(2) {
17 SetUnitName("k*", 0);
18 SetUnitName("r*", 1);
19 }
20
21 Bool_t TwoTrackFemtoPRFCut::Pass(TwoTrack* pair) {
22 McTrack* tr1 = (McTrack*) pair->GetTrack1();
23 McTrack* tr2 = (McTrack*) pair->GetTrack2();
24 Double_t x, y, z;
25 fP1.SetPxPyPzE(tr1->GetPx(), tr1->GetPy(), tr1->GetPz(), tr1->GetE());
26 const TLorentzVector& fr1 = tr1->GetFreezoutPosition();
27 fX1.SetXYZT(fr1.X(), fr1.Y(), fr1.Z(), fr1.T());
28 switch (pair->GetPairType()) {
29 case TwoTrack::kHemishpere: {
30 const TLorentzVector& fr2 = tr2->GetFreezoutPosition();
31 fX2.SetXYZT(-fr2.X(), -fr2.Y(), fr2.Z(), fr2.T());
32 fP2.SetXYZT(-tr2->GetPx(), -tr2->GetPy(), tr2->GetPz(), tr2->GetE());
33 } break;
34 case TwoTrack::kRotated: {
35 const TLorentzVector& fr2 = tr2->GetFreezoutPosition();
36 fX2.SetXYZT(-fr2.X(), -fr2.Y(), -fr2.Z(), fr2.T());
37 fP2.SetXYZT(-tr2->GetPx(), -tr2->GetPy(), -tr2->GetPz(), tr2->GetE());
38 } break;
39 default: {
40 const TLorentzVector& fr2 = tr2->GetFreezoutPosition();
41 fX2.SetXYZT(fr2.X(), fr2.Y(), fr2.Z(), fr2.T());
42 fP2.SetXYZT(tr2->GetPx(), tr2->GetPy(), tr2->GetPz(), tr2->GetE());
43 } break;
44 }
45 Compute();
46
47 x = fX1.X() - fX2.X();
48 y = fX1.Y() - fX2.Y();
49 z = fX1.Z() - fX2.Z();
50
51 Double_t r = TMath::Sqrt(x * x + y * y + z * z);
52 Double_t k = TMath::Abs(fP1.P());
53 // if(fP1.X()<0) k = -k;
54
55 SetValue(k, 0);
56 SetValue(r, 1);
57 return Validate();
58 }
59
60 void TwoTrackFemtoPRFCut::Compute() {
61 TLorentzVector P = fP1 + fP2;
62 Double_t vz = P.Pz() / P.E();
63 P.Boost(0, 0, -vz); //
64 Double_t phi = P.Phi();
65 // bost in out direction
66 Double_t beta = P.Pt() / P.E();
67 fP1.Boost(0, 0, -vz);
68 fP1.RotateZ(-phi);
69 fP1.Boost(-beta, 0, 0);
70 // bost in out direction
71 fX1.Boost(0, 0, -vz);
72 fX2.Boost(0, 0, -vz);
73 // rotation
74 fX1.RotateZ(-phi);
75 fX2.RotateZ(-phi);
76 fX1.Boost(-beta, 0, 0);
77 fX2.Boost(-beta, 0, 0);
78 }
79
80 Bool_t TwoTrackFemtoPRFCut::Init(Int_t task_id) {
81 if (TwoTrackCut::Init() == kFALSE) return kFALSE;
82 const Event* ev = DataFormatManager::Instance()->GetFormat(task_id, EFormatDepth::kBuffered);
83 if (ev->InheritsFrom("Hal::McEvent")) {
84 return kTRUE;
85 } else {
86 return kFALSE;
87 }
88 }
89
90 TwoTrackFemtoPRFCut::~TwoTrackFemtoPRFCut() {}
91} // namespace Hal
const TLorentzVector & GetFreezoutPosition() const
Definition McTrack.h:35
Double_t GetPz() const
Definition Track.h:109
Double_t GetPx() const
Definition Track.h:99
Double_t GetPy() const
Definition Track.h:104
Double_t GetE() const
Definition Track.h:114
PairType GetPairType() const
Definition TwoTrack.h:70
Track * GetTrack1() const
Definition TwoTrack.h:75
Track * GetTrack2() const
Definition TwoTrack.h:80