PamCut: TrkCuts/TrkPhSinCut/TrkPhSinCut.cpp Source File

- Main Page
- Classes
- Files

- File List
- File Members

# TrkCuts/TrkPhSinCut/TrkPhSinCut.cpp

Go to the documentation of this file.

    00001 /*
    00002  * TrkPhSinCut.cpp
    00003  *
    00004  *  Created on: 13-mar-2009
    00005  *      Author: Sergio Ricciarini, Nicola Mori
    00006  */
    00007
    00010 #include "TrkPhSinCut.h"
    00011
    00012 int TrkPhSinCut::Check(PamLevel2 *event) {
    00013
    00014   if (!(event->GetTrkLevel2()->GetNTracks() == 1))
    00015     return 0; // one track exists (physical or not)
    00016
    00017   // selection of the physical track (see TrkId below)
    00018   event->SetSortingMethod(_sortingMethod);
    00019   pamTrack = event->GetTrack(0);
    00020
    00021   // 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).
    00022   if (!pamTrack)
    00023     return 0; // redundant check
    00024
    00025   trkTrack = pamTrack->GetTrkTrack();
    00026
    00027   if (!(trkTrack->nstep < 100 && trkTrack->chi2 > 0.))
    00028     return 0; // check that the track is meaningful
    00029
    00030 //  int imatch=0;
    00031
    00032     // identification of TRK-track TOF-index (this index is generally different from TRK-track TRK-index)
    00033   iTrackTof = -1000;
    00034   for (int i=0; i<event->GetToFLevel2()->ntrk(); i++) {
    00035     if ( event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == trkTrack->GetSeqNo() ) {
    00036       iTrackTof = i;
    00037 //      cout << "trkseqno " << event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno << " TOF track id " << i << endl;
    00038 //      imatch++;
    00039       break;
    00040     }
    00041   }
    00042
    00043   return CUTOK;
    00044
    00045 }