BmnRoot
26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Toggle main menu visibility
Loading...
Searching...
No Matches
CbmKFTrErrMCPoints.cxx
Go to the documentation of this file.
1
/*
2
*====================================================================
3
*
4
* CBM KF Track Quality
5
*
6
* Authors: M.Zyzak
7
*
8
* e-mail :
9
*
10
*====================================================================
11
*
12
* KF Fit performance
13
*
14
*====================================================================
15
*/
16
#include "
CbmKFTrErrMCPoints.h
"
17
18
#include "CbmKF.h"
19
#include "CbmMCTrack.h"
20
21
#include <algorithm>
22
23
CbmKFTrErrMCPoints::CbmKFTrErrMCPoints
()
24
:
StsArray
()
25
,
MvdArray
()
26
,
StsHitsArray
()
27
,
MvdHitsArray
()
28
{}
29
30
int
CbmKFTrErrMCPoints::GetNConsMCStations
()
31
{
32
if
((
GetNMvdPoints
() +
GetNStsPoints
()) < 1)
33
return
0;
34
// TODO get station number of the point using methods of the point class!
35
float
zStation[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
36
vector<int> iStations;
37
for
(
int
iMvd = 0; iMvd <
GetNMvdPoints
(); ++iMvd) {
38
iStations.push_back(
GetMvdPoint
(iMvd)->GetStationNr() - 1);
39
// std::cout << GetMvdPoint(iMvd)->GetStationNr() << " " << GetMvdPoint(iMvd)->GetZ() << std::endl;
40
}
41
for
(
int
iSts = 0; iSts <
GetNStsPoints
(); ++iSts) {
42
int
stNumber = -1;
43
for
(
int
iSt = 0; iSt < 8; iSt++)
44
if
(
TMath::Abs
(zStation[iSt] -
GetStsPoint
(iSts)->GetZ()) < 2.5)
45
stNumber = iSt;
46
if
(stNumber >= 0)
47
iStations.push_back(stNumber +
CbmKF::Instance
()->GetNMvdStations());
48
}
49
50
std::sort(iStations.begin(), iStations.end());
51
52
int
nMaxConsStations = 1;
53
int
nConsStations = 1;
54
int
iPrevSt = iStations[0];
55
for
(
unsigned
int
iP = 1; iP < iStations.size(); iP++) {
56
if
((iStations[iP] - iPrevSt) == 1) {
57
nConsStations++;
58
iPrevSt = iStations[iP];
59
}
else
if
((iStations[iP] - iPrevSt) > 1) {
60
if
(nConsStations > nMaxConsStations)
61
nMaxConsStations = nConsStations;
62
nConsStations = 1;
63
iPrevSt = iStations[iP];
64
}
65
}
66
if
(nConsStations > nMaxConsStations)
67
nMaxConsStations = nConsStations;
68
69
return
nMaxConsStations;
70
}
71
72
int
CbmKFTrErrMCPoints::GetNConsHitStations
()
73
{
74
if
((
GetNMvdHits
() +
GetNStsHits
()) < 1)
75
return
0;
76
// TODO get station number of the point using methods of the point class!
77
vector<int> iStations;
78
for
(
int
iMvd = 0; iMvd <
GetNMvdHits
(); ++iMvd) {
79
iStations.push_back(
GetMvdHit
(iMvd)->GetStationNr() - 1);
80
// std::cout << GetMvdHit(iMvd)->GetStationNr() << " " << GetMvdHit(iMvd)->GetZ() << std::endl;
81
}
82
for
(
int
iSts = 0; iSts <
GetNStsHits
(); ++iSts)
83
iStations.push_back(
GetStsHit
(iSts)->GetStationNr() - 1 +
CbmKF::Instance
()->GetNMvdStations());
84
85
std::sort(iStations.begin(), iStations.end());
86
87
int
nMaxConsStations = 1;
88
int
nConsStations = 1;
89
int
iPrevSt = iStations[0];
90
for
(
unsigned
int
iP = 1; iP < iStations.size(); iP++) {
91
if
((iStations[iP] - iPrevSt) == 1) {
92
nConsStations++;
93
iPrevSt = iStations[iP];
94
}
else
if
((iStations[iP] - iPrevSt) > 1) {
95
if
(nConsStations > nMaxConsStations)
96
nMaxConsStations = nConsStations;
97
nConsStations = 1;
98
iPrevSt = iStations[iP];
99
}
100
}
101
if
(nConsStations > nMaxConsStations)
102
nMaxConsStations = nConsStations;
103
104
return
nMaxConsStations;
105
}
106
107
int
CbmKFTrErrMCPoints::GetNHitStations
()
108
{
109
if
((
GetNMvdHits
() +
GetNStsHits
()) < 1)
110
return
0;
111
// TODO get station number of the point using methods of the point class!
112
vector<int> iStations;
113
for
(
int
iMvd = 0; iMvd <
GetNMvdHits
(); ++iMvd) {
114
iStations.push_back(
GetMvdHit
(iMvd)->GetStationNr() - 1);
115
// std::cout << GetMvdHit(iMvd)->GetStationNr() << " " << GetMvdHit(iMvd)->GetZ() << std::endl;
116
}
117
for
(
int
iSts = 0; iSts <
GetNStsHits
(); ++iSts)
118
iStations.push_back(
GetStsHit
(iSts)->GetStationNr() - 1 +
CbmKF::Instance
()->GetNMvdStations());
119
120
std::sort(iStations.begin(), iStations.end());
121
122
int
nStations = 1;
123
int
iPrevSt = iStations[0];
124
for
(
unsigned
int
iP = 1; iP < iStations.size(); iP++) {
125
if
((iStations[iP] - iPrevSt) >= 1) {
126
nStations++;
127
iPrevSt = iStations[iP];
128
}
129
}
130
131
return
nStations;
132
}
133
134
int
CbmKFTrErrMCPoints::GetNMaxMCPointsOnStation
()
135
{
136
if
((
GetNMvdPoints
() +
GetNStsPoints
()) < 1)
137
return
0;
138
// TODO get station number of the point using methods of the point class!
139
float
zStation[8] = {30., 40., 50., 60., 70., 80., 90., 100.};
140
vector<int> iStations;
141
for
(
int
iMvd = 0; iMvd <
GetNMvdPoints
(); ++iMvd) {
142
iStations.push_back(
GetMvdPoint
(iMvd)->GetStationNr() - 1);
143
// std::cout << GetMvdPoint(iMvd)->GetStationNr() << " " << GetMvdPoint(iMvd)->GetZ() << std::endl;
144
}
145
for
(
int
iSts = 0; iSts <
GetNStsPoints
(); ++iSts) {
146
int
stNumber = -1;
147
for
(
int
iSt = 0; iSt < 8; iSt++)
148
if
(
TMath::Abs
(zStation[iSt] -
GetStsPoint
(iSts)->GetZ()) < 2.5)
149
stNumber = iSt;
150
if
(stNumber >= 0)
151
iStations.push_back(stNumber +
CbmKF::Instance
()->GetNMvdStations());
152
}
153
154
std::sort(iStations.begin(), iStations.end());
155
156
int
nMaxMCPointsOnStation = 1;
157
int
nMCPointsOnStation = 1;
158
int
iPrevSt = iStations[0];
159
for
(
unsigned
int
iP = 1; iP < iStations.size(); iP++) {
160
if
((iStations[iP] - iPrevSt) == 0) {
161
nMCPointsOnStation++;
162
iPrevSt = iStations[iP];
163
}
else
{
164
if
(nMCPointsOnStation > nMaxMCPointsOnStation)
165
nMaxMCPointsOnStation = nMCPointsOnStation;
166
nMCPointsOnStation = 1;
167
iPrevSt = iStations[iP];
168
}
169
}
170
171
return
nMaxMCPointsOnStation;
172
}
173
174
Bool_t
CbmKFTrErrMCPoints::IsReconstructable
(
CbmMCTrack
* mcTr,
int
MinNStations,
int
PerformanceMode,
float
MinRecoMom)
175
{
176
Bool_t
f = 1;
177
178
// reject very slow tracks from analysis
179
f &= (mcTr->
GetP
() > MinRecoMom);
180
// detected at least in 4 stations
181
if
(PerformanceMode == 3)
182
f &= (
GetNConsMCStations
() >= MinNStations);
// L1-MC
183
if
(PerformanceMode == 2)
184
f &= (
GetNHitStations
() >= MinNStations);
// QA definition
185
if
(PerformanceMode == 1)
186
f &= (
GetNConsHitStations
() >= MinNStations);
// L1 definition
187
188
// maximul 4 layers for a station.
189
f &= (
GetNMaxMCPointsOnStation
() <= 4);
190
191
return
f;
192
}
CbmKFTrErrMCPoints.h
Bool_t
bool Bool_t
CbmKFTrErrMCPoints::StsHitsArray
vector< CbmStsHit * > StsHitsArray
Definition
CbmKFTrErrMCPoints.h:76
CbmKFTrErrMCPoints::GetStsPoint
CbmStsPoint * GetStsPoint(Int_t i)
Definition
CbmKFTrErrMCPoints.h:41
CbmKFTrErrMCPoints::GetNStsHits
int GetNStsHits() const
Definition
CbmKFTrErrMCPoints.h:52
CbmKFTrErrMCPoints::GetNConsHitStations
int GetNConsHitStations()
Definition
CbmKFTrErrMCPoints.cxx:72
CbmKFTrErrMCPoints::GetNHitStations
int GetNHitStations()
Definition
CbmKFTrErrMCPoints.cxx:107
CbmKFTrErrMCPoints::MvdHitsArray
vector< CbmMvdHit * > MvdHitsArray
Definition
CbmKFTrErrMCPoints.h:77
CbmKFTrErrMCPoints::GetStsHit
CbmStsHit * GetStsHit(Int_t i)
Definition
CbmKFTrErrMCPoints.h:44
CbmKFTrErrMCPoints::GetNMaxMCPointsOnStation
int GetNMaxMCPointsOnStation()
Definition
CbmKFTrErrMCPoints.cxx:134
CbmKFTrErrMCPoints::StsArray
vector< CbmStsPoint * > StsArray
Definition
CbmKFTrErrMCPoints.h:73
CbmKFTrErrMCPoints::IsReconstructable
Bool_t IsReconstructable(CbmMCTrack *mcTr, int MinNStations, int PerformanceMode, float MinRecoMom)
Definition
CbmKFTrErrMCPoints.cxx:174
CbmKFTrErrMCPoints::GetMvdPoint
CbmMvdPoint * GetMvdPoint(Int_t i)
Definition
CbmKFTrErrMCPoints.h:40
CbmKFTrErrMCPoints::GetNMvdHits
int GetNMvdHits() const
Definition
CbmKFTrErrMCPoints.h:51
CbmKFTrErrMCPoints::GetNMvdPoints
int GetNMvdPoints() const
Definition
CbmKFTrErrMCPoints.h:49
CbmKFTrErrMCPoints::GetNStsPoints
int GetNStsPoints() const
Definition
CbmKFTrErrMCPoints.h:50
CbmKFTrErrMCPoints::CbmKFTrErrMCPoints
CbmKFTrErrMCPoints()
Definition
CbmKFTrErrMCPoints.cxx:23
CbmKFTrErrMCPoints::MvdArray
vector< CbmMvdPoint * > MvdArray
Definition
CbmKFTrErrMCPoints.h:74
CbmKFTrErrMCPoints::GetNConsMCStations
int GetNConsMCStations()
Definition
CbmKFTrErrMCPoints.cxx:30
CbmKFTrErrMCPoints::GetMvdHit
CbmMvdHit * GetMvdHit(Int_t i)
Definition
CbmKFTrErrMCPoints.h:43
CbmKF::Instance
static CbmKF * Instance()
Definition
CbmKF.h:34
CbmMCTrack
CbmMCTrack.h.
Definition
CbmMCTrack.h:26
CbmMCTrack::GetP
Double_t GetP() const
Definition
CbmMCTrack.h:68
TMath::Abs
Double_t Abs(Double_t d)
reconstruction
KF
KFQA
CbmKFTrErrMCPoints.cxx
Generated on
for BmnRoot by
1.17.0