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