Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TwoTrackDphiDetaCut.cxx
1/*
2 * TwoTrackDphiDetaCut.cxx
3 *
4 * Created on: 19 kwi 2016
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "TwoTrackDphiDetaCut.h"
10
11#include "Package.h"
12#include "Parameter.h"
13#include "Track.h"
14#include "TwoTrack.h"
15namespace Hal {
16 TwoTrackDphiDetaCut::TwoTrackDphiDetaCut() : TwoTrackCut(2) {
17 SetUnitName("#Delta#phi", 0);
18 SetUnitName("#Delta#eta", 1);
19 }
20
21 Bool_t TwoTrackDphiDetaCut::Pass(TwoTrack* pair) {
22 Double_t px1 = pair->GetTrack1()->GetPx();
23 Double_t py1 = pair->GetTrack1()->GetPy();
24 Double_t px2 = pair->GetTrack2()->GetPx();
25 Double_t py2 = pair->GetTrack2()->GetPy();
26 SetValue(TMath::ATan2(py1, px1) - TMath::ATan2(py2, px2));
27 SetValue(pair->GetTrack1()->GetMomentum().Eta() - pair->GetTrack2()->GetMomentum().Eta(), 1);
28 return AntiValidate();
29 }
30
31 TwoTrackDphiDetaCut::~TwoTrackDphiDetaCut() {}
32
33 TwoTrackDphistarDetaCut::TwoTrackDphistarDetaCut() :
34 TwoTrackCut(2),
35 fMinRad(0.27),
36 fMaxRad(1.4),
37 fPDG(NULL),
38 fMagSign(1.0),
39 fMagField(0.5),
40 fMagScale(0.0),
41 fMagConst(0.150200415) {
42 SetUnitName("#Delta#phi^{*}", 0);
43 SetUnitName("#Delta#eta", 1);
44 }
45
46 void TwoTrackDphistarDetaCut::SetMagSing(Double_t sign) { fMagSign = sign; }
47
48 void TwoTrackDphistarDetaCut::SetMagField(Double_t field) { fMagField = field; }
49
51 Double_t px1 = pair->GetTrack1()->GetPx();
52 Double_t px2 = pair->GetTrack2()->GetPx();
53 Double_t py1 = pair->GetTrack1()->GetPy();
54 Double_t py2 = pair->GetTrack2()->GetPy();
55 Double_t ptv1 = TMath::Sqrt(px1 * px1 + py1 * py1);
56 Double_t ptv2 = TMath::Sqrt(px2 * px2 + py2 * py2);
57 Double_t phi1 = TMath::ATan2(py1, px1);
58 Double_t phi2 = TMath::ATan2(py2, px2);
59 Double_t chg1 = pair->GetTrack1()->GetCharge();
60 Double_t chg2 = pair->GetTrack2()->GetCharge();
61 Double_t rad = fMinRad;
62 // fMagScale = 0.075 (0.15*0.5T) *fMagSign
63 Double_t afsi0b = fMagScale * chg1 * rad / ptv1;
64 Double_t afsi1b = fMagScale * chg2 * rad / ptv2;
65
66 /* if (fabs(afsi0b) >=1.) {
67 return kTRUE;
68 }
69 if (fabs(afsi1b) >=1.) return kTRUE;
70 */
71 Double_t phistar = phi2 - phi1 + TMath::ASin(afsi1b) - TMath::ASin(afsi0b);
72 phistar = TVector2::Phi_mpi_pi(phistar);
73 SetValue(phistar, 0);
74 SetValue(pair->GetTrack1()->GetMomentum().Eta() - pair->GetTrack2()->GetMomentum().Eta(), 1);
75 return AntiValidate();
76 }
77
78 Bool_t TwoTrackDphistarDetaCut::Init(Int_t task_id) {
79 Bool_t stat = TwoTrackCut::Init(task_id);
80 fPDG = TDatabasePDG::Instance();
81 fMagScale = fMagConst * fMagField * fMagSign;
82 return stat;
83 }
84
87 pack->AddObject(new ParameterDouble("Magnetic field (T)", fMagField));
88 pack->AddObject(new ParameterDouble("Magnetic field sign", fMagSign));
89 pack->AddObject(new ParameterDouble("Min TPC radii (m)", fMinRad));
90 return pack;
91 }
92
93 TwoTrackDphistarDetaCut::~TwoTrackDphistarDetaCut() {}
94} // namespace Hal
virtual Bool_t Init(Int_t=0)
Definition Cut.h:346
void SetValue(Double_t val, Int_t i=0)
Definition Cut.h:235
void SetUnitName(TString name, Int_t i=0)
Definition Cut.h:241
Bool_t AntiValidate()
Definition Cut.cxx:55
void AddObject(TObject *object)
Definition Package.cxx:209
Double_t GetPx() const
Definition Track.h:99
const TLorentzVector & GetMomentum() const
Definition Track.h:118
Double_t GetPy() const
Definition Track.h:104
Double_t GetCharge() const
Definition Track.h:184
virtual Package * Report() const
virtual Bool_t Pass(TwoTrack *pair)
virtual Package * Report() const
virtual Bool_t Init(Int_t task_id=0)
Track * GetTrack1() const
Definition TwoTrack.h:75
Track * GetTrack2() const
Definition TwoTrack.h:80