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

Contents of /PamCut/TofCuts/TofDedxHeCut/TofDedxHeCut.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Tue Jan 3 08:57:21 2012 UTC (12 years, 11 months ago) by pam-fi
Branch: MAIN
CVS Tags: V9, HEAD
Changes since 1.3: +11 -9 lines
Fix in Tof track handling.

1 /*
2 * TofDedxHeCut.cpp
3 *
4 * Created on: 03/ago/2009
5 * Author: Nicola Mori
6 */
7
8 /*! @file TofDedxHeCut.cpp The TofDedxHeCut class implementation file. */
9
10 #include "TofDedxHeCut.h"
11
12 const float TofDedxHeCut::_S11_SA_params[] = { 0.27, 0.045, -4.9, 4.7, 2.6, 0.38, 0.045, 1.7, 2., 2.5 };
13 const float TofDedxHeCut::_S12_SA_params[] = { 0.27, 0.043, -4.9, 4.7, 2.6, 0.38, 0.042, 1.7, 2., 2.5 };
14 const float TofDedxHeCut::_S21_SA_params[] = { 0.29, 0.037, -4.52, 4.4, 2.4, 0.28, 0.031, 1., 2.2, 2. };
15 const float TofDedxHeCut::_S22_SA_params[] = { 0.31, 0.033, -4.52, 4.4, 2.4, 0.29, 0.02, 1., 2.4, 1.9 };
16 const float TofDedxHeCut::_S31_SA_params[] = { 0.44, 0.029, -2.4, 3.2, 2.5, 0.56, 0.008, 3.2, 1.2, 2.3 };
17 const float TofDedxHeCut::_S32_SA_params[] = { 0.48, 0.024, -2.4, 3.4, 2.5, 0.64, -0.0071, 3.2, 1.3, 2.3 };
18
19 TofDedxHeCut::TofDedxHeCut(const char *cutName, unsigned int layer, bool standAlone) :
20 PamCut(cutName), _layer(layer), _standAlone(standAlone), _p(NULL) {
21
22 switch (_layer) {
23 case S11:
24 _p = _S11_SA_params;
25 break;
26 case S12:
27 _p = _S12_SA_params;
28 break;
29 case S21:
30 _p = _S21_SA_params;
31 break;
32 case S22:
33 _p = _S22_SA_params;
34 break;
35 case S31:
36 _p = _S31_SA_params;
37 break;
38 case S32:
39 _p = _S32_SA_params;
40 break;
41 default:
42 _p = _S21_SA_params;
43 }
44
45 }
46
47 int TofDedxHeCut::Check(PamLevel2 *event) {
48
49 static int trkSeqNo;
50 static int idx;
51 if (_standAlone)
52 trkSeqNo = -1;
53 else
54 trkSeqNo = event->GetTrack(0)->GetTrkTrack()->GetSeqNo();
55
56 for (int i = 0; i < event->GetToFLevel2()->ntrk(); i++) {
57 if (event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == trkSeqNo)
58 idx = i;
59 }
60
61 float beta = event->GetToFLevel2()->GetToFTrkVar(idx)->beta[12];
62
63 static unsigned int auxLayer;
64 static float dEdx;
65 static unsigned int currLayer;
66 static unsigned int nLayers;
67
68 auxLayer = _layer;
69 dEdx = 0;
70 currLayer = 0;
71 nLayers = 0;
72 while (auxLayer > 0) {
73 if ((auxLayer & 0x1) == 1) {
74 //cout << auxLayer << " " << currLayer << endl;
75 dEdx += event->GetToFLevel2()->GetdEdx(idx, currLayer, 100);
76 nLayers++;
77 }
78 currLayer++;
79 auxLayer >>= 1;
80 }
81
82 dEdx /= nLayers;
83
84 if (dEdx < 1. / (_p[0] * pow(beta, _p[4]) + _p[1]) + _p[2] + _p[3] * beta)
85 return 0;
86
87 if (dEdx > 1. / (_p[5] * pow(beta, _p[9]) + _p[6]) + _p[7] + _p[8] * beta)
88 return 0;
89
90 return CUTOK;
91 }

  ViewVC Help
Powered by ViewVC 1.1.23