--- PamCut/TrkCuts/TrkChi2DeflTimeCut/TrkChi2DeflTimeCut.cpp 2009/11/12 16:41:43 1.2 +++ PamCut/TrkCuts/TrkChi2DeflTimeCut/TrkChi2DeflTimeCut.cpp 2010/02/19 15:14:37 1.3 @@ -16,42 +16,31 @@ double chi2 = _GetChi2(event); if (chi2 < 0.) return 0; - Double_t eta2 = event->GetTrack(0)->GetTrkTrack()->GetDeflection(); //Sign doesn't matter - eta2 *= eta2; // Now eta2 is deflection^2 - -#ifdef DEBUGPAMCUT - - h_trk_chi2_defl[0]->Fill(event->GetTrack(0)->GetTrkTrack()->GetDeflection(), pow(chi2,0.25)); - -#endif + Double_t etaMod = fabs(event->GetTrack(0)->GetTrkTrack()->GetDeflection()); _time.Set(event->GetOrbitalInfo()->absTime, kFALSE, 0, kFALSE); // TTimestamp::GetDate() returns date in format YYYYMMDD so to compare it - // with 4-digits dates (YYMM) we must subtract 20000000 and then divide by 100 (divide by integer) + // with 6-digits dates (YYMMDD) we must subtract 20000000 - Int_t iMonthSel = (_time.GetDate(kFALSE) - 20000000)/100; // note: GetDate returns an unsigned integer + Int_t iDaySel = (_time.GetDate(kFALSE) - 20000000); // note: GetDate returns an unsigned integer - for (UInt_t i=0; i<_iMonth.size(); i++) { - if (_iMonth[i]==iMonthSel) { + for (UInt_t i=0; i<_iDayFirst.size(); i++) { + if (_iDayFirst[i]<=iDaySel && iDaySel<=_iDayLast[i]) { _p0sel=_p0[i]; _p1sel=_p1[i]; _p2sel=_p2[i]; -// cout << "FOUND: month " << iMonthSel << endl; -// cout << _p0sel << " " << _p1sel << " " << _p2sel << endl; + _p3sel=_p3[i]; +// cout << "FOUND: day " << iDaySel << endl; +// cout << _iDayFirst[i] << " " << _iDayLast[i] << endl; +// cout << _p0sel << " " << _p1sel << " " << _p2sel << " " << _p3sel << endl; break; } + return 0; } - - if (chi2 > _p0sel + _p1sel * eta2 + _p2sel * eta2 * eta2) { + if (chi2 > _p0sel + _p1sel * pow(etaMod,_p2sel) * (1.+ pow(_p3sel*etaMod,2) ) ){ return 0; } -#ifdef DEBUGPAMCUT - - h_trk_chi2_defl[1]->Fill(event->GetTrack(0)->GetTrkTrack()->GetDeflection(), pow(chi2,0.25)); - -#endif - return CUTOK; }