Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TrackDeltaMomCut.cxx
1/*
2 * TrackDeltaMomCut.cxx
3 *
4 * Created on: 28 gru 2018
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "TrackDeltaMomCut.h"
10
11#include "Track.h"
12
13#include <TLorentzVector.h>
14
15namespace Hal{
16TrackDeltaPtCut::TrackDeltaPtCut() : TrackDeltaMomCut(1) { SetUnitName("#Deltap_{T} [GeV/c]"); }
17
18Bool_t TrackDeltaPtCut::Pass(Track* track) {
19 if (!GetMom(track)) {
20 SetValue(-1E+9);
21 return ForcedUpdate(kFALSE);
22 }
23 Double_t pT_reco = fTrackRe->GetMomentum().Pt();
24 Double_t pT_mc = fTrackIm->GetMomentum().Pt();
25 SetValue(pT_mc - pT_reco);
26 return Validate();
27}
28
29TrackDeltaPtCut::~TrackDeltaPtCut() {}
30
31/*-----------------------------------------------------------------------------------------------------------*/
32
33TrackDeltaPCut::TrackDeltaPCut() : TrackDeltaMomCut(1) { SetUnitName("#Deltap [GeV/c]"); }
34
36 if (!GetMom(track)) {
37 SetValue(-1E+9);
38 return ForcedUpdate(kFALSE);
39 }
40 Double_t p_mc = fTrackIm->GetMomentum().P();
41 Double_t p_reco = fTrackRe->GetMomentum().P();
42 SetValue(p_mc - p_reco);
43 return Validate();
44}
45
46TrackDeltaPCut::~TrackDeltaPCut() {}
47
48/*-----------------------------------------------------------------------------------------------------------*/
49
50TrackDeltaPzCut::TrackDeltaPzCut() : TrackDeltaMomCut() { SetUnitName("#Deltap_{z} [GeV/c]"); }
51
53 if (!GetMom(track)) {
54 SetValue(-1E+9);
55 return ForcedUpdate(kFALSE);
56 }
57 Double_t p_mc = fTrackIm->GetMomentum().Pz();
58 Double_t p_reco = fTrackRe->GetMomentum().Pz();
59 SetValue(p_mc - p_reco);
60 return Validate();
61}
62
63TrackDeltaPzCut::~TrackDeltaPzCut() {}
64
65/*-----------------------------------------------------------------------------------------------------------*/
66
67TrackDeltaPhiCut::TrackDeltaPhiCut() : TrackDeltaMomCut(1) {
68 SetUnitName("#Delta#phi");
69 SetMinMax(-TMath::Pi(), TMath::Pi());
70}
71
73 if (!GetMom(track)) {
74 SetValue(-1E+9);
75 return ForcedUpdate(kFALSE);
76 }
77 Double_t p_mc = fTrackIm->GetMomentum().Phi();
78 Double_t p_reco = fTrackRe->GetMomentum().Phi();
79 SetValue(TVector2::Phi_mpi_pi(p_mc - p_reco));
80 return Validate();
81}
82
83TrackDeltaPhiCut::~TrackDeltaPhiCut() {}
84
85/*-----------------------------------------------------------------------------------------------------------*/
86
87TrackDeltaThetaCut::TrackDeltaThetaCut() : TrackDeltaMomCut(1) {
88 SetUnitName("#Delta#theta");
89 SetMinMax(-TMath::PiOver2(), TMath::PiOver2());
90}
91
93 if (!GetMom(track)) {
94 SetValue(-1E+9);
95 return ForcedUpdate(kFALSE);
96 }
97 Double_t p_mc = fTrackIm->GetMomentum().Theta();
98 Double_t p_reco = fTrackRe->GetMomentum().Theta();
99 SetValue(TVector2::Phi_mpi_pi(p_mc - p_reco));
100 return Validate();
101}
102
103TrackDeltaThetaCut::~TrackDeltaThetaCut() {}
104
105/*-----------------------------------------------------------------------------------------------------------*/
106
107TrackDeltaVectPtCut::TrackDeltaVectPtCut() { SetUnitName("#Deltap_{T} [GeV/c]"); }
108
110 if (!GetMom(track)) {
111 SetValue(-1E+9);
112 return ForcedUpdate(kFALSE);
113 }
114 SetValue(fDiff.Pt());
115 return Validate();
116}
117
118TrackDeltaVectPtCut::~TrackDeltaVectPtCut() {}
119
120/*-----------------------------------------------------------------------------------------------------------*/
121
122TrackDeltaVectPCut::TrackDeltaVectPCut() { SetUnitName("#Deltap [GeV/c]"); }
123
125 if (!GetMom(track)) {
126 SetValue(-1E+9);
127 return ForcedUpdate(kFALSE);
128 }
129 SetValue(fDiff.P());
130 return Validate();
131}
132
133TrackDeltaVectPCut::~TrackDeltaVectPCut() {}
134
135/*-----------------------------------------------------------------------------------------------------------*/
136
137TrackDeltaVectPhiCut::TrackDeltaVectPhiCut() {
138 SetUnitName("#Delta#phi");
139 SetMinMax(-TMath::Pi(), TMath::Pi());
140}
141
143 if (!GetMom(track)) {
144 SetValue(-1E+9);
145 return ForcedUpdate(kFALSE);
146 }
147 SetValue(fDiff.Phi());
148 return Validate();
149}
150
151TrackDeltaVectPhiCut::~TrackDeltaVectPhiCut() {}
152
153/*-----------------------------------------------------------------------------------------------------------*/
154
155TrackDeltaVectThetaCut::TrackDeltaVectThetaCut() {
156 SetUnitName("#Delta#theta");
157 SetMinMax(-TMath::PiOver2(), TMath::PiOver2());
158}
159
161 if (!GetMom(track)) {
162 SetValue(-1E+9);
163 return ForcedUpdate(kFALSE);
164 }
165 SetValue(fDiff.Theta());
166 return Validate();
167}
168
169TrackDeltaVectThetaCut::~TrackDeltaVectThetaCut() {}
170}
void SetMinMax(Double_t min, Double_t max, Int_t i=0)
Definition Cut.cxx:93
Bool_t ForcedUpdate(Bool_t state)
Definition Cut.cxx:79
void SetValue(Double_t val, Int_t i=0)
Definition Cut.h:235
Bool_t Validate()
Definition Cut.cxx:43
void SetUnitName(TString name, Int_t i=0)
Definition Cut.h:241
Bool_t GetMom(Track *track)
Bool_t Pass(Track *track)
Bool_t Pass(Track *track)
Bool_t Pass(Track *track)
Bool_t Pass(Track *track)
Bool_t Pass(Track *track)
Bool_t Pass(Track *track)
const TLorentzVector & GetMomentum() const
Definition Track.h:118