1 |
/* |
2 |
* TofBetaRigHCut.cpp |
3 |
* |
4 |
* Created on: 13-mar-2009 |
5 |
* Author: Sergio Ricciarini, Nicola Mori |
6 |
*/ |
7 |
|
8 |
/*! @file TofBetaRigHCut.cpp The TofBetaRigHCut class implementation file */ |
9 |
|
10 |
#include "TofBetaRigHCut.h" |
11 |
|
12 |
int TofBetaRigHCut::Check(PamLevel2 *event) { |
13 |
|
14 |
TrkTrack *trkTrack = event->GetTrack(0)->GetTrkTrack(); |
15 |
|
16 |
Int_t seqno = trkTrack->GetSeqNo(); |
17 |
Int_t ntrack_tof = 0; |
18 |
for (Int_t i = 0; i < event->GetToFLevel2()->ntrk(); i++) { |
19 |
if (event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == seqno) |
20 |
ntrack_tof = i; |
21 |
} |
22 |
Float_t betaModTof = fabs(event->GetToFLevel2()->CalcBeta(ntrack_tof, 10., 10., 20.)); // beta[12] |
23 |
|
24 |
// Float_t rigMod = _mass*fabs(beta)*pow((1-pow(beta,2)),-0.5)/abs(_charge); |
25 |
|
26 |
Int_t _charge=1; |
27 |
Float_t _mass_p=0.93827203; // GeV (pdg.web.cern.ch) |
28 |
Float_t _mass_d=1.99846; // GeV (www.nndc.bnl.gov) |
29 |
|
30 |
Float_t betaModTrk_p = (trkTrack->GetRigidity() * abs(_charge)) / pow(pow(trkTrack->GetRigidity() * _charge, 2) + pow( |
31 |
_mass_p, 2), 0.5); |
32 |
|
33 |
Float_t betaModTrk_d = (trkTrack->GetRigidity() * abs(_charge)) / pow(pow(trkTrack->GetRigidity() * _charge, 2) + pow( |
34 |
_mass_d, 2), 0.5); |
35 |
|
36 |
if ( (fabs(betaModTof - betaModTrk_p) > _threshold * betaModTof) && (fabs(betaModTof - betaModTrk_d) > _threshold * betaModTof) ) { |
37 |
return 0; |
38 |
} |
39 |
|
40 |
return CUTOK; |
41 |
} |