CbmRoot
Loading...
Searching...
No Matches
HalCbmBasicTrackCuts.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 "HalCbmNHitsCut.h"
7#include "HalCbmTofCut.h"
8
9#include <TString.h>
10
11#include <Hal/Cut.h>
12#include <Hal/CutMonitorRequest.h>
13#include <Hal/TrackChargeCut.h>
14#include <Hal/TrackChi2Cut.h>
15#include <Hal/TrackDCACut.h>
16#include <Hal/TrackEtaCut.h>
17#include <Hal/TrackPCut.h>
18#include <Hal/TrackPtCut.h>
19
20
22 : fKinPt("Hal::TrackPtCut", 0, 100, 0, 4)
23 , fKinEta("Hal::TrackEtaCut", 0, 200, -2, 4)
24 , fTofP("Hal::TrackPCut", 0, 200, 0, 2)
25 , fTofM2("HalCbmTofCut", 0, 100, -0.1, 1.2)
26 , fHits("HalCbmNHitsCut", 0, 12, 0.5, 12.5)
27 , fHitsSts("HalCbmNHitsCut", 2, 10, -0.5, 9.5)
28 , fChi2("Hal::TrackChi2Cut", 0, 100, 0, 25)
29 , fDCAxy("Hal::TrackDCACut", 1, 100, 0, 10)
30 , fDCAz("Hal::TrackDCACut", 2, 100, -5, 5)
31{
32 AddCut(Hal::TrackChargeCut()); //0
33 AddCut(HalCbmNHitsCut()); //1
34 AddCut(Hal::TrackChi2Cut()); //2
35 AddCut(Hal::TrackPCut()); //3
36 AddCut(Hal::TrackPtCut()); //4
37 AddCut(Hal::TrackEtaCut()); //5
38 AddCut(Hal::TrackDCACut()); //6
39 AddCut(HalCbmTofCut()); //7
40}
41
42Hal::TrackChargeCut* HalCbmBasicTrackCuts::GetChargeCut() const { return (Hal::TrackChargeCut*) this->CutAt(0); }
43
45
46Hal::TrackChi2Cut* HalCbmBasicTrackCuts::GetChi2Cut() const { return (Hal::TrackChi2Cut*) this->CutAt(2); }
47
48Hal::TrackPCut* HalCbmBasicTrackCuts::GetPCut() const { return (Hal::TrackPCut*) this->CutAt(3); }
49
50Hal::TrackPtCut* HalCbmBasicTrackCuts::GetPtCut() const { return (Hal::TrackPtCut*) this->CutAt(4); }
51
52Hal::TrackEtaCut* HalCbmBasicTrackCuts::GetEtaCut() const { return (Hal::TrackEtaCut*) this->CutAt(5); }
53
54Hal::TrackDCACut* HalCbmBasicTrackCuts::GetDCACut() const { return (Hal::TrackDCACut*) this->CutAt(6); }
55
57{
58 //Hal::HistogramAxisConf requestHits(bins, min, max);
59 TString option = opt;
60 if (Hal::Std::FindParam(option, "all")) {
61 AddCutMonitorRequest(fHits);
62 AddCutMonitorRequest(fHitsSts);
63 AddCutMonitorRequest(fChi2);
64 AddCutMonitorRequest(fKinEta, fKinPt);
65 AddCutMonitorRequest(fTofP, fTofM2);
66 AddCutMonitorRequest(fDCAz, fDCAxy);
67 return;
68 }
69 if (Hal::Std::FindParam(option, "chi2")) AddCutMonitorRequest(fChi2);
70 if (Hal::Std::FindParam(option, "hits")) AddCutMonitorRequest(fHits);
71 if (Hal::Std::FindParam(option, "hits_sts")) AddCutMonitorRequest(fHitsSts);
72 if (Hal::Std::FindParam(option, "tof")) AddCutMonitorRequest(fTofP, fTofM2);
73 if (Hal::Std::FindParam(option, "dca")) AddCutMonitorRequest(fDCAz, fDCAxy);
74}
75
76void HalCbmBasicTrackCuts::SetCharge(Int_t charge) { GetChargeCut()->SetMinAndMax(charge); }
77
78void HalCbmBasicTrackCuts::SetNHits(Int_t min, Int_t max) { GetNHitsCut()->SetMinMax(min, max); }
79
80void HalCbmBasicTrackCuts::SetNMvdHits(Int_t min, Int_t max) { GetNHitsCut()->SetMinMax(min, max, 1); }
81
82void HalCbmBasicTrackCuts::SetNStsHits(Int_t min, Int_t max) { GetNHitsCut()->SetMinMax(min, max, 2); }
83
84void HalCbmBasicTrackCuts::SetNTrdHits(Int_t min, Int_t max) { GetNHitsCut()->SetMinMax(min, max, 3); }
85
86void HalCbmBasicTrackCuts::SetPt(Double_t min, Double_t max) { GetPtCut()->SetMinMax(min, max); }
87
88void HalCbmBasicTrackCuts::SetEta(Double_t min, Double_t max) { GetEtaCut()->SetMinMax(min, max); }
89
90void HalCbmBasicTrackCuts::SetM2(Double_t min, Double_t max) { GetTofCut()->SetMinMax(min, max); }
91
92void HalCbmBasicTrackCuts::SetDCAXY(Double_t min, Double_t max)
93{
94 GetDCACut()->SetMinMax(min, max, GetDCACut()->DCAxy());
95}
96
97void HalCbmBasicTrackCuts::SetDCAZ(Double_t min, Double_t max)
98{
99 GetDCACut()->SetMinMax(min, max, GetDCACut()->DCAz());
100}
101
102void HalCbmBasicTrackCuts::SetTofMonitorPAxis(Int_t nbins, Double_t min, Double_t max)
103{
104 fTofP.SetAxis(nbins, min, max);
105}
106
107void HalCbmBasicTrackCuts::SetTofMonitorM2Axis(Int_t nbins, Double_t min, Double_t max)
108{
109 fTofM2.SetAxis(nbins, min, max);
110}
111
112void HalCbmBasicTrackCuts::SetPtEtaMonitorPtAxis(Int_t nbins, Double_t min, Double_t max)
113{
114 fKinPt.SetAxis(nbins, min, max);
115}
116
117void HalCbmBasicTrackCuts::SetPtEtaMonitorEtaAxis(Int_t nbins, Double_t min, Double_t max)
118{
119 fKinEta.SetAxis(nbins, min, max);
120}
121
122void HalCbmBasicTrackCuts::SetNHitsMonitorAxis(Int_t nbins, Double_t min, Double_t max)
123{
124 fHits.SetAxis(nbins, min, max);
125}
126
127void HalCbmBasicTrackCuts::SetChi2MonitorAxis(Int_t nbins, Double_t min, Double_t max)
128{
129 fChi2.SetAxis(nbins, min, max);
130}
131
132void HalCbmBasicTrackCuts::SetDCAMonitorZAxis(Int_t nbins, Double_t min, Double_t max)
133{
134 fDCAz.SetAxis(nbins, min, max);
135}
136
137void HalCbmBasicTrackCuts::SetDCAMonitorXYAxis(Int_t nbins, Double_t min, Double_t max)
138{
139 fDCAxy.SetAxis(nbins, min, max);
140}
141
142HalCbmTofCut* HalCbmBasicTrackCuts::GetTofCut() const { return (HalCbmTofCut*) this->CutAt(7); }
143
145{
146 if (val)
148 else
149 GetTofCut()->SetMinMax(0, 1, 1);
150}
151
153
154void HalCbmBasicTrackCuts::SetChi2(Double_t min, Double_t max) { GetChi2Cut()->SetMinMax(min, max); };
Hal::TrackDCACut * GetDCACut() const
Hal::TrackChi2Cut * GetChi2Cut() const
Hal::TrackPtCut * GetPtCut() const
void SetM2(Double_t min, Double_t max)
void SetDCAZ(Double_t min, Double_t max)
Hal::CutMonAxisConf fChi2
void SetDCAXY(Double_t min, Double_t max)
void SetNTrdHits(Int_t min, Int_t max)
Hal::CutMonAxisConf fDCAxy
void SetTofMonitorM2Axis(Int_t nbins, Double_t min, Double_t max)
void SetDCAMonitorZAxis(Int_t nbins, Double_t min, Double_t max)
Hal::CutMonAxisConf fKinPt
virtual void AddAllCutMonitorRequests(Option_t *opt)
void SetPtEtaMonitorPtAxis(Int_t nbins, Double_t min, Double_t max)
void SetEta(Double_t min, Double_t max)
Hal::CutMonAxisConf fTofM2
Hal::TrackPCut * GetPCut() const
void AcceptOnlyWithTofHit(Bool_t val)
Hal::TrackChargeCut * GetChargeCut() const
HalCbmNHitsCut * GetNHitsCut() const
Hal::CutMonAxisConf fHitsSts
void SetNStsHits(Int_t min, Int_t max)
void SetDCAMonitorXYAxis(Int_t nbins, Double_t min, Double_t max)
void SetChi2(Double_t min, Double_t max)
void SetPt(Double_t min, Double_t max)
Hal::CutMonAxisConf fHits
void SetNHits(Int_t min, Int_t max)
void SetNHitsMonitorAxis(Int_t nbins, Double_t min, Double_t max)
Hal::CutMonAxisConf fTofP
HalCbmTofCut * GetTofCut() const
Hal::CutMonAxisConf fDCAz
Hal::CutMonAxisConf fKinEta
void SetCharge(Int_t charge)
void SetPtEtaMonitorEtaAxis(Int_t nbins, Double_t min, Double_t max)
void SetTofMonitorPAxis(Int_t nbins, Double_t min, Double_t max)
Hal::TrackEtaCut * GetEtaCut() const
void SetNMvdHits(Int_t min, Int_t max)
void SetChi2MonitorAxis(Int_t nbins, Double_t min, Double_t max)
void AcceptTracksOnlyWithToF()