94 cout <<
"--------- New Event " <<
fEventNr <<
"--------" << endl;
98 const unsigned int gll =
fTrkArray->GetEntriesFast();
103 vector<unsigned int> trkHn;
104 vector<bool> trk_accept;
107 vector<double> vchi2;
108 for (
unsigned int i = 0;
i < gll;
i++) {
115 for (
unsigned int i = 0;
i < gll;
i++) {
122 TVector3 MomRecLMD(fFittedTrkP.GetPx(), fFittedTrkP.GetPy(),
123 fFittedTrkP.GetPz());
124 MomRecLMD *= 1. / MomRecLMD.Mag();
125 if (
fVerbose > 0) cout <<
"Check Kinematics!" << endl;
129 if (
fVerbose > 0) cout <<
"!BOXThPhFilt!" << endl;
130 double thetaCent = MomRecLMD.Theta() - 0.040;
132 if (abs(thetaCent) > 0.011 || abs(MomRecLMD.Phi()) > 0.25)
134 if (abs(fFittedTrkP.GetX()) > 1000. || abs(fFittedTrkP.GetY()) > 1000)
142 if (
fVerbose > 0) cout <<
"!XThFilt!" << endl;
143 double Xref = -19.1 + 1.12 * 1e3 * MomRecLMD.Theta() +
fdX;
144 double diffX = abs(fFittedTrkP.GetX() - Xref);
146 cout <<
"fFittedTrkP.GetX() = " << fFittedTrkP.GetX()
147 <<
" Xref = " << Xref <<
" diffX = " << diffX << endl;
149 if (diffX > 3.0) dirOK =
false;
154 if (
fVerbose > 0) cout <<
"!YPhFilt!" << endl;
155 double Yref = -0.00651 + 0.045 * 1e3 * MomRecLMD.Phi() +
fdY;
156 double diffY = abs(fFittedTrkP.GetY() - Yref);
158 cout <<
"fFittedTrkP.GetY() = " << fFittedTrkP.GetY()
159 <<
" Yref = " << Yref <<
" diffY = " << diffY << endl;
161 if (diffY > 4.0) dirOK =
false;
169 double chi2 = trkpnd->
GetChi2();
170 vchi2.push_back(chi2);
171 trk_accept.push_back(dirOK);
176 const unsigned int Ntrkcandhits = trkcand->
GetNHits();
177 trkHn.push_back(Ntrkcandhits);
181 for (
int ittr = 0; ittr < 2;
184 for (
unsigned int i = 0;
i < gll;
i++) {
186 if (!trk_accept[
i])
continue;
187 for (
unsigned int j = i + 1; j < gll; j++) {
189 if (!trk_accept[j])
continue;
191 if (trksH0[i] != trksH0[j]) coundduphit--;
192 if (trksH1[i] != trksH1[j]) coundduphit--;
193 if (trksH2[i] != trksH2[j]) coundduphit--;
194 if (trksH3[i] != trksH3[j]) coundduphit--;
196 if (coundduphit > 1) {
197 if (trkHn[i] > trkHn[j]) {
198 trk_accept[
i] =
true;
199 trk_accept[j] =
false;
201 if (trkHn[i] < trkHn[j]) {
202 trk_accept[
i] =
false;
203 trk_accept[j] =
true;
205 if (vchi2[i] > vchi2[j]) {
206 trk_accept[
i] =
false;
207 trk_accept[j] =
true;
209 trk_accept[
i] =
true;
210 trk_accept[j] =
false;
217 cout <<
" trk#" << i <<
": has " << trkHn[
i] <<
"hits; trk#" << j
218 <<
": has " << trkHn[j] <<
" hits" << endl;
219 cout <<
" trk#" << i <<
" has chi2=" << vchi2[
i] <<
" "
220 <<
" trk#" << j <<
" has chi2=" << vchi2[j] << endl;
221 if (trk_accept[i]) cout <<
" trk#" << i <<
" accepted" << endl;
222 if (trk_accept[j]) cout <<
" trk#" << j <<
" accepted" << endl;
226 if (coundduphit > 0 && trkHn[i] == 3 &&
228 if (vchi2[i] > vchi2[j]) {
229 trk_accept[
i] =
false;
230 trk_accept[j] =
true;
232 trk_accept[
i] =
true;
233 trk_accept[j] =
false;
243 for (
unsigned int i = 0; i < gll; i++) {
247 new ((*fTrkOutArray)[rec_trk])
PndTrack(*(trkpnd));
252 cout <<
"Ev#" <<
fEventNr <<
": " << rec_trk <<
" trks saved out of " << gll
255 if (
fVerbose > 2) cout <<
"PndLmdTrksFilterTask::Exec END!" << endl;
TClonesArray * fTrkOutArray
TClonesArray * fTrkCandArray
Int_t GetRefIndex() const
FairTrackParP GetParamFirst()