Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TrackDeltaMomentumCut.cxx
1/*
2 * TrackDeltaCut.cxx
3 *
4 * Created on: 20 gru 2017
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "TrackDeltaMomentumCut.h"
10
11#include "ComplexTrack.h"
12#include "DataFormatManager.h"
13#include "Track.h"
14
15#include <iostream>
16
17namespace Hal {
18 TrackDeltaMomentumCut::TrackDeltaMomentumCut(Int_t params) : TrackCut(params), fTrackRe(nullptr), fTrackIm(nullptr) {
19 if (params == 5) {
20 SetUnitName("#Deltap_{T} [GeV/c]", Pt());
21 SetUnitName("#Delta#phi [rad]", Phi());
22 SetUnitName("#Delta#theta [GeV/c]", Theta());
23 SetUnitName("#Deltap_{z} [GeV/c]", Pz());
24 SetUnitName("#Deltap [GeV/c]", P());
25 SetMinMax(-TMath::Pi(), TMath::Pi(), Phi());
26 SetMinMax(-TMath::PiOver2(), TMath::PiOver2(), Theta());
27 SetMinMax(-1E+6, 1E+6, P());
28 SetMinMax(-1E+6, 1E+6, Pt());
29 SetMinMax(-1E+6, 1E+6, Pz());
30 }
31 }
32
33 Bool_t TrackDeltaMomentumCut::Init(Int_t format_id) {
34 if (FormatInhertis("Hal::ComplexEvent", format_id)) { return kTRUE; }
35 return kFALSE;
36 }
37
38 TrackDeltaMomentumCut::~TrackDeltaMomentumCut() {}
39
40 /*-----------------------------------------------------------------------------------------------------------*/
41
42 TrackDeltaMomCut::TrackDeltaMomCut(Int_t params) : TrackDeltaMomentumCut(params) {}
43
45 if (!GetMom(track)) {
46 SetValue(-1E+9);
47 return ForcedUpdate(kFALSE);
48 }
49 SetValue(fTrackIm->GetMomentum().P() - fTrackRe->GetMomentum().P(), P());
50 SetValue(fTrackIm->GetMomentum().Pt() - fTrackRe->GetMomentum().Pt(), Pt());
51 SetValue(fTrackIm->GetMomentum().Pz() - fTrackRe->GetMomentum().Pz(), Pz());
52 SetValue(TVector2::Phi_mpi_pi(fTrackIm->GetMomentum().Phi() - fTrackRe->GetMomentum().Phi()), Phi());
53 SetValue(fTrackIm->GetMomentum().Theta() - fTrackRe->GetMomentum().Theta(), Theta());
54 Double_t p_mc = fTrackIm->GetMomentum().P();
55 Double_t p_reco = fTrackRe->GetMomentum().P();
56 SetValue(p_mc - p_reco);
57 return Validate();
58 }
59
61 ComplexTrack* tr = (ComplexTrack*) track;
62 fTrackRe = tr->GetRealTrack();
63 fTrackIm = tr->GetImgTrack();
64 if (fTrackIm == NULL) return kFALSE;
65 return kTRUE;
66 }
67
68 TrackDeltaMomCut::~TrackDeltaMomCut() {}
69
70 /*-----------------------------------------------------------------------------------------------------------*/
71
72 TrackDeltaVectMomCut::TrackDeltaVectMomCut(Int_t params) : TrackDeltaMomentumCut(params) {}
73
75 ComplexTrack* tr = (ComplexTrack*) track;
76 Track* real = tr->GetRealTrack();
77 Track* im = tr->GetImgTrack();
78 if (im == NULL) return kFALSE;
79 fDiff = im->GetMomentum() - real->GetMomentum();
80 return kTRUE;
81 }
82
84 if (!GetMom(track)) {
85 SetValue(-1E+9);
86 return ForcedUpdate(kFALSE);
87 }
88 SetValue(fDiff.P(), P());
89 SetValue(fDiff.Pt(), Pt());
90 SetValue(fDiff.Pz(), Pz());
91 SetValue(fDiff.Phi(), Phi());
92 SetValue(fDiff.Theta(), Theta());
93 return Validate();
94 }
95
96 TrackDeltaVectMomCut::~TrackDeltaVectMomCut() {}
97} // namespace Hal
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
Bool_t GetMom(Track *track)
virtual Bool_t Pass(Track *track)
virtual Bool_t Pass(Track *track)
const TLorentzVector & GetMomentum() const
Definition Track.h:118