/[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.2 by pam-fi, Thu Jul 8 14:00:32 2010 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    //  event->GetTrack(0,trkAlg)->Copy(*pamTrack); //fondamentale per i tagli successivi?!?!
23    
24    // 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).  //  return 0;
   if (!pamTrack)  
     return 0; // redundant check  
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    // Check if good clusters have meaningful energy releases
32    for (unsigned int ip = 0; ip < 6; ip++) {    for (unsigned int ip = 0; ip < 6; ip++) {
# Line 35  int TrkPhSinCut::Check(PamLevel2 *event) Line 39  int TrkPhSinCut::Check(PamLevel2 *event)
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    
   // 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;  
       break;  
     }  
   }  
   
42    return CUTOK;    return CUTOK;
43    
44  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.23