/[PAMELA software]/PamCut/TrkCuts/TrkPhSinCut/TrkPhSinCut.cpp
ViewVC logotype

Diff of /PamCut/TrkCuts/TrkPhSinCut/TrkPhSinCut.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by pam-fi, Wed May 27 13:30:08 2009 UTC revision 1.3 by pam-fi, Wed Mar 25 17:38:08 2015 UTC
# Line 11  Line 11 
11    
12  int TrkPhSinCut::Check(PamLevel2 *event) {  int TrkPhSinCut::Check(PamLevel2 *event) {
13    
14    if (!(event->GetTrkLevel2()->GetNTracks() == 1))    if (!(event->GetNTracks(trkAlg) == 1))
15      return 0; // one track exists (physical or not)      return 0; // one track exists (physical or not)
16    
17      
18    // selection of the physical track (see TrkId below)    // selection of the physical track (see TrkId below)
19    event->SetSortingMethod(_sortingMethod);    event->SetSortingMethod(_sortingMethod);
20    pamTrack = event->GetTrack(0);    PamTrack *pamTrack = event->GetTrack(0,trkAlg);
21    //  PamTrack *pamTrack = event->GetTrackOld(0);
22    // 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).  //  event->GetTrack(0,trkAlg)->Copy(*pamTrack); //fondamentale per i tagli successivi?!?!
23    if (!pamTrack)  
24      return 0; // redundant check  //  return 0;
25    
26    trkTrack = pamTrack->GetTrkTrack();  
27      ExtTrack* trkTrack = pamTrack->GetExtTrack();
28    //  TrkTrack* trkTrack = pamTrack->GetTrkTrack();
29      if(!trkTrack)return 0;
30    
31      // Check if good clusters have meaningful energy releases
32      for (unsigned int ip = 0; ip < 6; ip++) {
33        if (trkTrack->XGood(ip) == 1 && trkTrack->GetDEDX(ip, 0) <= 0.)
34          trkTrack->xgood[ip] = 0; // Set it to bad
35        if (trkTrack->YGood(ip) == 1 && trkTrack->GetDEDX(ip, 1) <= 0.)
36          trkTrack->ygood[ip] = 0; // Set it to bad
37      }
38    
39    if (!(trkTrack->nstep < 100 && trkTrack->chi2 > 0.))    if (!(trkTrack->nstep < 100 && trkTrack->chi2 > 0.))
40      return 0; // check that the track is meaningful      return 0; // check that the track is meaningful
41    
 //  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; i<event->GetToFLevel2()->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;  
     }  
   }  
   
42    return CUTOK;    return CUTOK;
43    
44  }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.23