/[PAMELA software]/PamCut/TofCuts/TofBetaRangeCut/TofBetaRangeCut.cpp
ViewVC logotype

Diff of /PamCut/TofCuts/TofBetaRangeCut/TofBetaRangeCut.cpp

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

revision 1.1 by pam-fi, Wed May 27 13:30:09 2009 UTC revision 1.2 by pam-fi, Wed Mar 25 17:38:08 2015 UTC
# Line 11  Line 11 
11    
12  int TofBetaRangeCut::Check(PamLevel2 *event) {  int TofBetaRangeCut::Check(PamLevel2 *event) {
13    
14    int iTrackTof=0; // index initialized (default) to 0 (TOF stand-alone track)  //    float _beta = 0.;
15      //  cout << _trackTof <<endl;
16    if (! (_trackTof==0) ) {  
17      iTrackTof=*_trackTof;      if(!event->GetToFLevel2())return 0;
18    }  
19        ToFTrkVar *trackTof = NULL;
20    
21        if(_trkId<0 ){
22            trackTof = event->GetToFLevel2()->GetToFStoredTrack(_trkId); //standalone      
23        }else{
24            if( event->GetNTracks(_trkAlg) <= _trkId ){
25                cout << "TofBetaRangeCut: trk.ID = "<<_trkId<<", trk.ALG = "<<_trkAlg<<" _BUT_ n.tracks = "<<event->GetNTracks(_trkAlg)<<endl;
26                cout << "TofBetaRangeCut: inconsistent cut!!!"<<endl;
27                return 0;
28            }
29            trackTof = event->GetTrack(_trkId,_trkAlg)->GetToFTrack();
30        }
31    
32        if(!trackTof){
33            cout << "TofBetaRangeCut: ToFTrkVar obj pt = "<<trackTof<<endl;      
34            return 0;
35        }
36    ///////////////////////////
37    
38        beta = trackTof->CalcBeta(_resMax,_qualCut,_chi2Cut);
39    
   float _beta = event->GetToFLevel2()->CalcBeta(iTrackTof,_resMax,_qualCut,_chi2Cut);  
40    
41    if( ! (_minBeta < _beta && _beta < _maxBeta) ) {      if( ! (_minBeta < beta && beta < _maxBeta) ) {
42      return 0;          return 0;
43    }      }
44    
45    return CUTOK;      return CUTOK;
46        
47  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.23