1 |
pam-fi |
1.1 |
/* |
2 |
|
|
* TofBetaRangeCut.cpp |
3 |
|
|
* |
4 |
|
|
* Created on: 10-apr-2009 |
5 |
|
|
* Author: Sergio Ricciarini, Nicola Mori |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
/*! @file TofBetaRangeCut.cpp The TofBetaRangeCut class implementation file */ |
9 |
|
|
|
10 |
|
|
#include "TofBetaRangeCut.h" |
11 |
|
|
|
12 |
|
|
int TofBetaRangeCut::Check(PamLevel2 *event) { |
13 |
|
|
|
14 |
pam-fi |
1.2 |
// float _beta = 0.; |
15 |
|
|
// cout << _trackTof <<endl; |
16 |
|
|
|
17 |
|
|
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 |
pam-fi |
1.1 |
|
40 |
|
|
|
41 |
pam-fi |
1.2 |
if( ! (_minBeta < beta && beta < _maxBeta) ) { |
42 |
|
|
return 0; |
43 |
|
|
} |
44 |
pam-fi |
1.1 |
|
45 |
pam-fi |
1.2 |
return CUTOK; |
46 |
pam-fi |
1.1 |
|
47 |
|
|
} |