CbmRoot
Loading...
Searching...
No Matches
HalCbmDeltaPhiDeltaThetaStarMinCut.cxx
Go to the documentation of this file.
1/* Copyright (C) 2023-2023 Warsaw University of Technology, Warsaw
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Daniel Wielanek [committer] */
5
6#include "CbmHelix.h"
7#include "HalCbmHbtTrack.h"
8#include "HalCbmTrack.h"
9
10#include <TLorentzVector.h>
11#include <TVector3.h>
12
13#include <Hal/Cut.h>
14#include <Hal/Event.h>
15#include <Hal/Package.h>
16#include <Hal/Parameter.h>
17#include <Hal/Std.h>
18#include <Hal/Track.h>
19#include <Hal/TwoTrack.h>
20
21
23{
24 TVector3 mom1, mom2;
25 HalCbmHbtTrack* tr1 = static_cast<HalCbmHbtTrack*>(pair->GetTrack1());
26 HalCbmHbtTrack* tr2 = static_cast<HalCbmHbtTrack*>(pair->GetTrack2());
27
28 Double_t phiMin = 1E+9;
29 Double_t etaMin = 1E+9;
30 for (int i = 0; i < 8; i++) {
31 mom1 = tr1->GetMomAtPlane(i + 1);
32 mom2 = tr2->GetMomAtPlane(i + 1);
33 Double_t dphi = TVector2::Phi_mpi_pi(mom1.Phi() - mom2.Phi());
34 if (TMath::Abs(dphi) < TMath::Abs(phiMin)) phiMin = dphi;
35 etaMin = TMath::Min(TMath::Abs(mom1.Eta() - mom2.Eta()), etaMin);
36 }
37
38 SetValue(mom1.Phi() - mom2.Phi(), 0); //dleta phi
39 SetValue(mom1.Theta() - mom2.Theta(), 1);
40 if (GetValue(0) > GetMin(0) && GetValue(0) < GetMax(0) && GetValue(1) > GetMin(1) && GetValue(1) < GetMax(1)) {
41 return ForcedUpdate(kFALSE);
42 }
43 return ForcedUpdate(kTRUE);
44}
45
47{
48 TVector3 mom1, mom2;
49 HalCbmTrack* tr1 = static_cast<HalCbmTrack*>(pair->GetTrack1());
50 HalCbmTrack* tr2 = static_cast<HalCbmTrack*>(pair->GetTrack2());
51 CbmHelix& h1 = tr1->GetHelix();
52 CbmHelix& h2 = tr2->GetHelix();
53 Double_t phiMin = 1E+9;
54 Double_t etaMin = 1E+9;
55 const Double_t R[8] = {30, 40, 50, 60, 70, 80, 90, 100};
56 for (int i = 0; i < 8; i++) {
57 h1.Eval(R[i] + tr1->GetEvent()->GetVertex()->Z(), mom1);
58 h2.Eval(R[i] + tr2->GetEvent()->GetVertex()->Z(), mom2);
59 Double_t dphi = TVector2::Phi_mpi_pi(mom1.Phi() - mom2.Phi());
60 if (TMath::Abs(dphi) < TMath::Abs(phiMin)) phiMin = dphi;
61 etaMin = TMath::Min(TMath::Abs(mom1.Eta() - mom2.Eta()), etaMin);
62 }
63
64 SetValue(phiMin, 0); //dleta phi
65 SetValue(etaMin, 1);
66
67
68 if (GetValue(0) > GetMin(0) && GetValue(0) < GetMax(0) && GetValue(1) > GetMin(1) && GetValue(1) < GetMax(1)) {
69 return ForcedUpdate(kFALSE);
70 }
71 return ForcedUpdate(kTRUE);
72}
73
75{
76 SetUnitName("#Delta#phi^{*}_{min}", 0);
77 SetUnitName("#Delta#eta^{*}_{min}", 1);
78 SetMinMax(0, 0, 0);
79 SetMinMax(0, 0, 1);
80}
TVector3 Eval(Double_t z)
Definition CbmHelix.cxx:31
const TVector3 & GetMomAtPlane(Int_t plane) const
CbmHelix & GetHelix()
Definition HalCbmTrack.h:38