8 |
#include "TrkChi2DeflTimeCut.h" |
#include "TrkChi2DeflTimeCut.h" |
9 |
|
|
10 |
double TrkChi2DeflTimeCut::_GetChi2(PamLevel2 *event) { |
double TrkChi2DeflTimeCut::_GetChi2(PamLevel2 *event) { |
11 |
return event->GetTrack(0)->GetTrkTrack()->chi2; |
// return event->GetTrack(0)->GetTrkTrack()->chi2; |
12 |
|
return (event->GetNTracks(_trkAlg)<=0 ? -1. : event->GetTrack(0,_trkAlg)->GetExtTrack()->chi2); |
13 |
} |
} |
14 |
|
|
15 |
int TrkChi2DeflTimeCut::Check(PamLevel2 *event) { |
int TrkChi2DeflTimeCut::Check(PamLevel2 *event) { |
17 |
double chi2 = _GetChi2(event); |
double chi2 = _GetChi2(event); |
18 |
if (chi2 < 0.) |
if (chi2 < 0.) |
19 |
return 0; |
return 0; |
20 |
Double_t etaMod = fabs(event->GetTrack(0)->GetTrkTrack()->GetDeflection()); |
// Double_t etaMod = fabs(event->GetTrack(0)->GetTrkTrack()->GetDeflection()); |
21 |
|
// Int_t nHitX = event->GetTrack(0)->GetTrkTrack()->GetNX(); |
22 |
|
Double_t etaMod = fabs(event->GetTrack(0,_trkAlg)->GetExtTrack()->GetDeflection()); |
23 |
|
Int_t nHitX = event->GetTrack(0,_trkAlg)->GetExtTrack()->GetNX(); |
24 |
|
|
25 |
|
// cout << " nHitX " << nHitX << endl; |
26 |
|
|
27 |
|
if (nHitX == 3) { |
28 |
|
for (UInt_t i = 0; i < _iDayFirst_nHitX3.size(); i++) { |
29 |
|
_iDayFirst.push_back(_iDayFirst_nHitX3[i]); |
30 |
|
_iDayLast.push_back(_iDayLast_nHitX3[i]); |
31 |
|
for (int iPar=0; iPar<_nPar; iPar++) { |
32 |
|
_p[iPar].push_back(_p_nHitX3[iPar][i]); |
33 |
|
} |
34 |
|
} |
35 |
|
} |
36 |
|
else if (nHitX >= 4) { |
37 |
|
for (UInt_t i = 0; i < _iDayFirst_nHitX4.size(); i++) { |
38 |
|
_iDayFirst.push_back(_iDayFirst_nHitX4[i]); |
39 |
|
_iDayLast.push_back(_iDayLast_nHitX4[i]); |
40 |
|
for (int iPar=0; iPar<_nPar; iPar++) { |
41 |
|
_p[iPar].push_back(_p_nHitX4[iPar][i]); |
42 |
|
} |
43 |
|
} |
44 |
|
} |
45 |
|
else { |
46 |
|
return 0; |
47 |
|
} |
48 |
|
|
49 |
_time.Set(event->GetOrbitalInfo()->absTime, kFALSE, 0, kFALSE); |
_time.Set(event->GetOrbitalInfo()->absTime, kFALSE, 0, kFALSE); |
50 |
// TTimestamp::GetDate() returns date in format YYYYMMDD so to compare it |
// TTimestamp::GetDate() returns date in format YYYYMMDD so to compare it |
51 |
// with 6-digits dates (YYMMDD) we must subtract 20000000 |
// with 6-digits dates (YYMMDD) we must subtract 20000000 |
52 |
|
|
53 |
Int_t iDaySel = (_time.GetDate(kFALSE) - 20000000); // note: GetDate returns an unsigned integer |
Int_t iDaySel = (_time.GetDate(kFALSE) - 20000000); // note: GetDate returns an unsigned integer |
54 |
|
// cout << "day " << iDaySel << endl; |
55 |
|
|
56 |
bool found = false; |
bool found = false; |
57 |
for (UInt_t i = 0; i < _iDayFirst.size(); i++) { |
for (UInt_t i = 0; i < _iDayFirst.size(); i++) { |
69 |
} |
} |
70 |
} |
} |
71 |
|
|
72 |
if (!found) |
if (!found) { |
73 |
|
cout << "not found" << endl; |
74 |
|
cout << endl; |
75 |
return 0; |
return 0; |
76 |
|
} |
77 |
|
|
78 |
|
// for (int iPar=0; iPar<_nPar; iPar++) { |
79 |
|
// cout << " p" << iPar << ": " << _pSel[iPar] << endl; |
80 |
|
// } |
81 |
|
// cout << endl; |
82 |
|
|
83 |
double chi2max; |
double chi2max; |
84 |
|
|