--- PamCut/TofCuts/TofBetaRangeCut/TofBetaRangeCut.cpp 2009/05/27 13:30:09 1.1.1.1 +++ PamCut/TofCuts/TofBetaRangeCut/TofBetaRangeCut.cpp 2015/03/25 17:38:08 1.2 @@ -11,18 +11,37 @@ int TofBetaRangeCut::Check(PamLevel2 *event) { - int iTrackTof=0; // index initialized (default) to 0 (TOF stand-alone track) - - if (! (_trackTof==0) ) { - iTrackTof=*_trackTof; - } +// float _beta = 0.; +// cout << _trackTof <GetToFLevel2())return 0; + + ToFTrkVar *trackTof = NULL; + + if(_trkId<0 ){ + trackTof = event->GetToFLevel2()->GetToFStoredTrack(_trkId); //standalone + }else{ + if( event->GetNTracks(_trkAlg) <= _trkId ){ + cout << "TofBetaRangeCut: trk.ID = "<<_trkId<<", trk.ALG = "<<_trkAlg<<" _BUT_ n.tracks = "<GetNTracks(_trkAlg)<GetTrack(_trkId,_trkAlg)->GetToFTrack(); + } + + if(!trackTof){ + cout << "TofBetaRangeCut: ToFTrkVar obj pt = "<CalcBeta(_resMax,_qualCut,_chi2Cut); - float _beta = event->GetToFLevel2()->CalcBeta(iTrackTof,_resMax,_qualCut,_chi2Cut); - if( ! (_minBeta < _beta && _beta < _maxBeta) ) { - return 0; - } + if( ! (_minBeta < beta && beta < _maxBeta) ) { + return 0; + } - return CUTOK; + return CUTOK; }