Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
TrackBoostedMomentaCuts.cxx
1/*
2 * TrackBoosteMomentaCuts.cxx
3 *
4 * Created on: 2 sie 2019
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "TrackBoostedMomentaCuts.h"
10
11#include "ComplexTrack.h"
12#include "McTrack.h"
13#include "Track.h"
14#include <TLorentzVector.h>
15
16
17namespace Hal {
18 TrackBoostedPCut::TrackBoostedPCut() : TrackCut(1) { SetUnitName("P_{boosted} [GeV/c]"); }
19
20 Bool_t TrackBoostedPCut::Pass(Track* track) {
21 TLorentzVector mom = track->GetMomentum();
22 mom.SetXYZM(track->GetPx(), track->GetPy(), track->GetPz(), track->GetMass());
23 mom.Boost(fBoost);
24 SetValue(mom.P());
25 return Validate();
26 }
27
28 TrackBoostedDeltaPCut::TrackBoostedDeltaPCut() : TrackCut(1) { SetUnitName("#DeltaP_{boosted} [GeV/c]"); }
29
30 Bool_t TrackBoostedDeltaPCut::Init(Int_t format_id) {
31 fInit = kTRUE;
32 return FormatInhertis("Hal::ComplexEvent", format_id);
33 }
34
36 ComplexTrack* tr = (ComplexTrack*) track;
37 Track* re_tr = tr->GetRealTrack();
38 Track* im_tr = tr->GetImgTrack();
39 TLorentzVector re_mom, im_mom;
40 im_mom = im_tr->GetMomentum();
41 re_mom.SetXYZM(re_tr->GetPx(), re_tr->GetPy(), re_tr->GetPz(), im_tr->GetMass());
42 re_mom.Boost(fBoost);
43 im_mom.Boost(fBoost);
44 SetValue(re_mom.P() - im_mom.P());
45 return Validate();
46 }
47
48 TrackBoostedKinematcisCut::TrackBoostedKinematcisCut() : TrackCut(7) {
49 SetUnitName("Px_{boosted} [GeV/c]", Px());
50 SetUnitName("Py_{boosted} [GeV/c]", Py());
51 SetUnitName("Pz_{boosted} [GeV/c]", Pz());
52 SetUnitName("Pt_{boosted} [GeV/c]", Pt());
53 SetUnitName("P_{boosted} [GeV/c]", P());
54 SetUnitName("#eta_{boosted} []", Eta());
55 SetUnitName("Y_{boosted} []", Rapidity());
56 }
57
59 McTrack* mc = (McTrack*) track;
60 TLorentzVector vec = mc->GetMomentum();
61 vec.Boost(fBoost);
62 SetValue(vec.Px(), Px());
63 SetValue(vec.Py(), Py());
64 SetValue(vec.Pz(), Pz());
65 SetValue(vec.Pt(), Pt());
66 SetValue(vec.P(), P());
67 SetValue(vec.Eta(), Eta());
68 SetValue(vec.Rapidity(), Rapidity());
69 return Validate();
70 }
71
72 Bool_t TrackBoostedKinematcisCut::Init(Int_t format_id) {
73 fInit = kTRUE;
74 if (FormatInhertis("Hal::McEvent", format_id)) { return kTRUE; }
75 return kFALSE;
76 }
77
78 TrackBoostedKinematcisCut::~TrackBoostedKinematcisCut() {}
79} // namespace Hal
Bool_t FormatInhertis(TString format, Int_t format_id, EFormatDepth depth=EFormatDepth::kAll) const
Definition Cut.cxx:202
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 fInit
Definition Cut.h:79
virtual Bool_t Pass(Track *track)
virtual Bool_t Pass(Track *track)
Double_t GetPz() const
Definition Track.h:109
Double_t GetPx() const
Definition Track.h:99
Double_t GetMass() const
Definition Track.h:179
const TLorentzVector & GetMomentum() const
Definition Track.h:118
Double_t GetPy() const
Definition Track.h:104