Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TwoTrackRadialDistanceCut.cxx
1/*
2 * TwoTrackRadialDistanceCut.cxx
3 *
4 * Created on: 04-05-2022
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "TwoTrackRadialDistanceCut.h"
10
11#include "ExpTrack.h"
12#include "Helix.h"
13#include "TwoTrack.h"
14namespace Hal {
15 TwoTrackRadialDistanceCut::TwoTrackRadialDistanceCut() : TwoTrackCut(1), fPDG(NULL) {
16 SetUnitName("#pi^{*}_{min}");
17 fMagSign = 1.0;
18 fMagField = 0.5;
19 fMaxRad = 1.33;
20 fMinRad = 0.34;
21 fMagConst = 0.15;
22 }
23
24 Bool_t TwoTrackRadialDistanceCut::Pass(TwoTrack* pair) {
25 Double_t px1 = pair->GetTrack1()->GetPx();
26 Double_t px2 = pair->GetTrack2()->GetPx();
27 Double_t py1 = pair->GetTrack1()->GetPy();
28 Double_t py2 = pair->GetTrack2()->GetPy();
29 Double_t ptv1 = TMath::Sqrt(px1 * px1 + py1 * py1);
30 Double_t ptv2 = TMath::Sqrt(px2 * px2 + py2 * py2);
31 Double_t phi1 = TMath::ATan2(py1, px1);
32 Double_t phi2 = TMath::ATan2(py2, px2);
33 Double_t chg1 = pair->GetTrack1()->GetCharge();
34 Double_t chg2 = pair->GetTrack2()->GetCharge();
35 Double_t rad = fMinRad;
36
37 Double_t phistar_min = 10E+6;
38 const Helix& hel1 = ((ExpTrackHelix*) pair->GetTrack1())->GetHelix();
39 const Helix& hel2 = ((ExpTrackHelix*) pair->GetTrack2())->GetHelix();
40 for (rad = fMinRad; rad < fMaxRad; rad += 0.01) {
41 Double_t dps = (phi2 - phi1 + (TMath::ASin(-0.075 * chg2 * fMagSign * rad / ptv2))
42 - (TMath::ASin(-0.075 * chg1 * fMagSign * rad / ptv1)));
43 Double_t s1, s2;
44 Double_t S1, S2;
45 hel1.PathLength(rad * 100, s1, s2);
46 S1 = TMath::Min(s1, s2);
47 hel2.PathLength(rad * 100, s1, s2);
48 S2 = TMath::Min(s1, s2);
49 TVector3 pos1 = hel1.EvalPos(S1);
50 TVector3 pos2 = hel2.EvalPos(S2);
51 Double_t dps2 = pos1.Phi() - pos2.Phi();
52 dps2 = TVector2::Phi_mpi_pi(dps2) / TMath::DegToRad();
53 dps = TVector2::Phi_mpi_pi(dps) / TMath::DegToRad();
54 if (TMath::Abs(dps) < TMath::Abs(phistar_min)) { phistar_min = dps; }
55 }
56 SetValue(phistar_min);
57 if (phistar_min <= GetMin(0) || phistar_min >= GetMax(0)) {
58 ForcedUpdate(kTRUE);
59 return kTRUE;
60 } else {
61 ForcedUpdate(kFALSE);
62 return kFALSE;
63 }
64 }
65
66 void TwoTrackRadialDistanceCut::SetRadius(Double_t min, Double_t max) {
67 fMinRad = min;
68 fMaxRad = max;
69 }
70
71 void TwoTrackRadialDistanceCut::SetMagFiled(Double_t field) { fMagField = field; }
72
73 void TwoTrackRadialDistanceCut::SetMagFieldSign(Double_t sign) { fMagSign = sign; }
74
75 Bool_t TwoTrackRadialDistanceCut::Init(Int_t task_id) {
76 Bool_t stat = TwoTrackCut::Init(task_id);
77 fPDG = TDatabasePDG::Instance();
78 fMagConst = fMagConst * fMagField;
79 return stat;
80 }
81
82 TwoTrackRadialDistanceCut::~TwoTrackRadialDistanceCut() {
83 // TODO Auto-generated destructor stub
84 }
85} // namespace Hal
void PathLength(Double_t r, Double_t &s1, Double_t &s2) const
Definition Helix.h:40
TVector3 EvalPos(Double_t s) const
Definition Helix.h:121
Double_t GetPx() const
Definition Track.h:99
Double_t GetPy() const
Definition Track.h:104
Double_t GetCharge() const
Definition Track.h:184
Track * GetTrack1() const
Definition TwoTrack.h:75
Track * GetTrack2() const
Definition TwoTrack.h:80