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