--- PamCut/TrkCuts/TrkPhSinCut/TrkPhSinCut.cpp 2009/05/27 13:30:08 1.1 +++ PamCut/TrkCuts/TrkPhSinCut/TrkPhSinCut.cpp 2015/03/25 17:38:08 1.3 @@ -11,35 +11,34 @@ int TrkPhSinCut::Check(PamLevel2 *event) { - if (!(event->GetTrkLevel2()->GetNTracks() == 1)) + if (!(event->GetNTracks(trkAlg) == 1)) return 0; // one track exists (physical or not) + // selection of the physical track (see TrkId below) event->SetSortingMethod(_sortingMethod); - pamTrack = event->GetTrack(0); - - // NOTE: pamtrack is null pointer if no physical track is selected; this is a redundant check to find bugs in the level2 (at least one physical track should always be present, given that GetNTracks()=1 according to the previous cut). - if (!pamTrack) - return 0; // redundant check - - trkTrack = pamTrack->GetTrkTrack(); + PamTrack *pamTrack = event->GetTrack(0,trkAlg); +// PamTrack *pamTrack = event->GetTrackOld(0); +// event->GetTrack(0,trkAlg)->Copy(*pamTrack); //fondamentale per i tagli successivi?!?! + +// return 0; + + + ExtTrack* trkTrack = pamTrack->GetExtTrack(); +// TrkTrack* trkTrack = pamTrack->GetTrkTrack(); + if(!trkTrack)return 0; + + // Check if good clusters have meaningful energy releases + for (unsigned int ip = 0; ip < 6; ip++) { + if (trkTrack->XGood(ip) == 1 && trkTrack->GetDEDX(ip, 0) <= 0.) + trkTrack->xgood[ip] = 0; // Set it to bad + if (trkTrack->YGood(ip) == 1 && trkTrack->GetDEDX(ip, 1) <= 0.) + trkTrack->ygood[ip] = 0; // Set it to bad + } if (!(trkTrack->nstep < 100 && trkTrack->chi2 > 0.)) return 0; // check that the track is meaningful -// int imatch=0; - - // identification of TRK-track TOF-index (this index is generally different from TRK-track TRK-index) - iTrackTof = -1000; - for (int i=0; iGetToFLevel2()->ntrk(); i++) { - if ( event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == trkTrack->GetSeqNo() ) { - iTrackTof = i; -// cout << "trkseqno " << event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno << " TOF track id " << i << endl; -// imatch++; - break; - } - } - return CUTOK; }