CbmRoot
Loading...
Searching...
No Matches
HalCbmDeltaPhiDeltaThetaCut.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
22{
23 SetUnitName("#Delta#phi^{*} [rad]", 0);
24 SetUnitName("#Delta#eta^{*} []", 1);
25}
26
28{
29 TVector3 mom1, mom2;
30 HalCbmHbtTrack* tr1 = static_cast<HalCbmHbtTrack*>(pair->GetTrack1());
31 HalCbmHbtTrack* tr2 = static_cast<HalCbmHbtTrack*>(pair->GetTrack2());
32 tr1->CalculateAtR(fR);
33 tr2->CalculateAtR(fR);
34 mom1 = tr1->GetMomAtCustom();
35 mom2 = tr2->GetMomAtCustom();
36 SetValue(mom1.Phi() - mom2.Phi(), 0); //dleta phi
37 SetValue(mom1.Theta() - mom2.Theta(), 1);
38 if (GetValue(0) > GetMin(0) && GetValue(0) < GetMax(0) && GetValue(1) > GetMin(1) && GetValue(1) < GetMax(1)) {
39 return ForcedUpdate(kFALSE);
40 }
41 return ForcedUpdate(kTRUE);
42}
43
45{
46 TVector3 mom1, mom2;
47 HalCbmTrack* tr1 = static_cast<HalCbmTrack*>(pair->GetTrack1());
48 HalCbmTrack* tr2 = static_cast<HalCbmTrack*>(pair->GetTrack2());
49 CbmHelix& h1 = tr1->GetHelix();
50 CbmHelix& h2 = tr2->GetHelix();
51 h1.Eval(fR + tr1->GetEvent()->GetVertex()->Z(), mom1);
52 h2.Eval(fR + tr2->GetEvent()->GetVertex()->Z(), mom2);
53 SetValue(mom1.Phi() - mom2.Phi(), 0); //dleta phi
54 SetValue(mom1.Theta() - mom2.Theta(), 1);
55 if (GetValue(0) > GetMin(0) && GetValue(0) < GetMax(0) && GetValue(1) > GetMin(1) && GetValue(1) < GetMax(1)) {
56 return ForcedUpdate(kFALSE);
57 }
58 return ForcedUpdate(kTRUE);
59}
60
61//===============================================================================
63{
64 Hal::Package* pack = HalCbmPairCut::Report();
65 pack->AddObject(new Hal::ParameterDouble("R", fR));
66 return pack;
67}
68
71{
72 if (this == &other) return *this;
74 fDataType = other.fDataType;
75 return *this;
76}
77
79
81{
82 SetUnitName("#Delta#phi [rad]", 0);
83 SetUnitName("#Delta#eta [rad]", 1);
84}
85
86Bool_t HalCbmDeltaPhiDeltaThetaCut::Pass(Hal::TwoTrack* pair)
87{
88 Hal::Track* tr1 = static_cast<Hal::Track*>(pair->GetTrack1());
89 Hal::Track* tr2 = static_cast<Hal::Track*>(pair->GetTrack2());
90 SetValue(tr1->GetMomentum().Phi() - tr2->GetMomentum().Phi(), 0);
91 SetValue(tr1->GetMomentum().Theta() - tr2->GetMomentum().Theta(), 1);
92 if (GetValue(0) > GetMin(0) && GetValue(0) < GetMax(0) && GetValue(1) > GetMin(1) && GetValue(1) < GetMax(1)) {
93 return ForcedUpdate(kFALSE);
94 }
95 return ForcedUpdate(kTRUE);
96}
97
99
100//===============================================================================
101
103{
104 for (int i = 0; i < 9; i++) {
105 SetUnitName(Form("#Delta#phi^{*}_{lay%i} [rad]", i), i * 2);
106 SetUnitName(Form("#Delta#eta^{*}_{lay%i} [AU]", i), i * 2 + 1);
107 SetMinMax(1, -1, i * 2);
108 SetMinMax(1, -1, i * 2 + 1);
109 }
110 SetUnitName("#Delta#phi_{min}^{*} [rad]", 18);
111 SetUnitName("#Delta#eta_{min}^{*} [AU]", 19);
112 SetUnitName("#Delta#phi_{max}^{*} [rad]", 20);
113 SetUnitName("#Delta#eta_{max}^{*} [AU]", 21);
114 for (int i = 18; i < 22; i++) {
115 SetMinMax(1, -1, i);
116 }
117}
118
120{
121 TVector3 mom1, mom2;
122 TVector3 pos1, pos2;
123 HalCbmHbtTrack* tr1 = static_cast<HalCbmHbtTrack*>(pair->GetTrack1());
124 HalCbmHbtTrack* tr2 = static_cast<HalCbmHbtTrack*>(pair->GetTrack2());
125 Double_t phiMin = 9E+9, etaMin = 9e+9;
126 Double_t phiMax = 0, etaMax = 0;
127
128 for (int i = 0; i < 9; i++) {
129 mom1 = tr1->GetMomAtPlane(i);
130 mom2 = tr2->GetMomAtPlane(i);
131 pos1 = tr1->GetPosAtPlane(i);
132 pos2 = tr2->GetPosAtPlane(i);
133 Double_t dphi = TVector2::Phi_mpi_pi(mom1.Phi() - mom2.Phi());
134 Double_t deta = mom1.Theta() - mom2.Theta();
135
136 SetValue(dphi, 2 * i);
137 SetValue(deta, 2 * i + 1);
138 if (TMath::Abs(dphi) < TMath::Abs(phiMin)) phiMin = dphi;
139 if (TMath::Abs(deta) < TMath::Abs(etaMin)) etaMin = deta;
140
141 if (TMath::Abs(dphi) > TMath::Abs(phiMax)) phiMax = dphi;
142 if (TMath::Abs(deta) > TMath::Abs(etaMax)) etaMax = deta;
143 }
144 SetValue(phiMin, 18);
145 SetValue(etaMin, 19);
146 SetValue(phiMax, 20);
147 SetValue(etaMax, 21);
148 Int_t passed = 0;
149 for (int i = 0; i < 22; i++) {
150 if (GetValue(i) > GetMin(i) && GetValue(i) < GetMax(i)) passed++;
151 }
152 if (passed != 0) return ForcedUpdate(kFALSE);
153 return ForcedUpdate(kTRUE);
154}
155
157{
158 TVector3 mom1, mom2;
159 HalCbmTrack* tr1 = static_cast<HalCbmTrack*>(pair->GetTrack1());
160 HalCbmTrack* tr2 = static_cast<HalCbmTrack*>(pair->GetTrack2());
161 CbmHelix& h1 = tr1->GetHelix();
162 CbmHelix& h2 = tr2->GetHelix();
163 Double_t phiMin = 9E+9, etaMin = 9e+9;
164 Double_t phiMax = 0, etaMax = 0;
165 const Double_t R[9] = {20, 30, 40, 50, 60, 70, 80, 90, 100};
166
167 for (int i = 0; i < 9; i++) {
168 h1.Eval(R[i] + tr1->GetEvent()->GetVertex()->Z(), mom1);
169 h2.Eval(R[i] + tr2->GetEvent()->GetVertex()->Z(), mom2);
170 Double_t dphi = TVector2::Phi_mpi_pi(mom1.Phi() - mom2.Phi());
171 Double_t deta = mom1.Theta() - mom2.Theta();
172
173 SetValue(dphi, 2 * i);
174 SetValue(deta, 2 * i + 1);
175 if (TMath::Abs(dphi) < TMath::Abs(phiMin)) phiMin = dphi;
176 if (TMath::Abs(deta) < TMath::Abs(etaMin)) etaMin = deta;
177
178 if (TMath::Abs(dphi) > TMath::Abs(phiMax)) phiMax = dphi;
179 if (TMath::Abs(deta) > TMath::Abs(etaMax)) etaMax = deta;
180 }
181 SetValue(phiMin, 18);
182 SetValue(etaMin, 19);
183 SetValue(phiMax, 20);
184 SetValue(etaMax, 21);
185 Int_t passed = 0;
186 for (int i = 0; i < 22; i++) {
187 if (GetValue(i) > GetMin(i) && GetValue(i) < GetMax(i)) passed++;
188 }
189 if (passed != 0) return ForcedUpdate(kFALSE);
190 return ForcedUpdate(kTRUE);
191}
192
193
195{
196 Hal::Package* pack = HalCbmPairCut::Report();
197 pack->AddObject(new Hal::ParameterDouble("R", fR));
198 return pack;
199}
200
203{
204 if (this == &other) return *this;
206 fDataType = other.fDataType;
207 return *this;
208}
209
211
212//===============================================================================
TVector3 Eval(Double_t z)
Definition CbmHelix.cxx:31
HalCbmDeltaPhiDeltaThetaStarCutLayers & operator=(const HalCbmDeltaPhiDeltaThetaStarCutLayers &other)
virtual Bool_t PassAnaTree(Hal::TwoTrack *pair)
virtual Bool_t PassHbt(Hal::TwoTrack *pair)
virtual Bool_t PassHbt(Hal::TwoTrack *pair)
HalCbmDeltaPhiDeltaThetaStarCut & operator=(const HalCbmDeltaPhiDeltaThetaStarCut &other)
virtual Bool_t PassAnaTree(Hal::TwoTrack *pair)
const TVector3 & GetMomAtCustom() const
const TVector3 & GetMomAtPlane(Int_t plane) const
void CalculateAtR(Double_t R)
const TVector3 & GetPosAtPlane(Int_t plane) const
HalCbm::EFormatType fDataType
HalCbmPairCut & operator=(const HalCbmPairCut &other)
CbmHelix & GetHelix()
Definition HalCbmTrack.h:38