Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
PairDeltaQinvCut.cxx
1/*
2 * PairDeltaQinvCut.cxx
3 *
4 * Created on: 12 lis 2018
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#include "PairDeltaQinvCut.h"
10
11#include "ComplexTrack.h"
12#include "Track.h"
13#include "TwoTrack.h"
14
15namespace Hal {
16 PairDeltaQinvCut::PairDeltaQinvCut() : TwoTrackCut(2) {
17 SetUnitName("#DeltaQ_{inv} [GeV.c]", Absolute());
18 SetUnitName("#DeltaQ_{inv} [%]", Relative());
19 SetMinMax(-1E+9, 1E+9, Absolute());
20 SetMinMax(-1000, 1000, Relative());
21 fMass1 = fMass2 = 0.139;
22 }
23
24 Bool_t PairDeltaQinvCut::Pass(TwoTrack* pair) {
25 ComplexTrack* z1 = (ComplexTrack*) pair->GetTrack1();
26 ComplexTrack* z2 = (ComplexTrack*) pair->GetTrack2();
27 Track* re1 = z1->GetRealTrack();
28 Track* re2 = z2->GetRealTrack();
29 Track* mc1 = z1->GetImgTrack();
30 Track* mc2 = z2->GetImgTrack();
31 if (mc1 == NULL || mc2 == NULL) {
32 SetValue(1E+9, Absolute());
33 SetValue(1E+9, Relative());
34 return ForcedUpdate(kFALSE);
35 }
36 Double_t q_im = Q(mc1, mc2);
37 Double_t q_re = Q(re1, re2);
38 Double_t delta = q_re - q_im;
39 SetValue(delta, Absolute());
40 SetValue(delta / q_im * 100.0, Relative());
41 return Validate();
42 }
43
44 Double_t PairDeltaQinvCut::Q(Track* tr1, Track* tr2) const {
45 Double_t px = tr1->GetPx() - tr2->GetPx();
46 Double_t py = tr1->GetPy() - tr2->GetPy();
47 Double_t pz = tr1->GetPz() - tr2->GetPz();
48 Double_t p1 = tr1->GetPx() * tr1->GetPx() + tr1->GetPy() * tr1->GetPy() + tr1->GetPz() * tr1->GetPz();
49 Double_t p2 = tr2->GetPx() * tr2->GetPx() + tr2->GetPy() * tr2->GetPy() + tr2->GetPz() * tr2->GetPz();
50 Double_t e1 = TMath::Sqrt(p1 + fMass1);
51 Double_t e2 = TMath::Sqrt(p2 + fMass2);
52 Double_t e = e1 - e2;
53 return TMath::Sqrt(TMath::Abs((e * e - px * px - py * py - pz * pz)));
54 }
55
56 Bool_t PairDeltaQinvCut::Init(Int_t task_id) {
57 fMass1 = fMass1 * fMass1;
58 fMass2 = fMass2 * fMass2;
59 return TwoTrackCut::Init(task_id);
60 }
61
62 PairDeltaQinvCut::~PairDeltaQinvCut() {}
63} // namespace Hal
Double_t GetPz() const
Definition Track.h:109
Double_t GetPx() const
Definition Track.h:99
Double_t GetPy() const
Definition Track.h:104
Track * GetTrack1() const
Definition TwoTrack.h:75
Track * GetTrack2() const
Definition TwoTrack.h:80