16 |
const float TofDedxHCut::_S31_SA_params[] = { 1.6, 1.2, -0.15, -2., 0.8, 1.6, 1.2, -0.2, 0., 0.8 }; |
const float TofDedxHCut::_S31_SA_params[] = { 1.6, 1.2, -0.15, -2., 0.8, 1.6, 1.2, -0.2, 0., 0.8 }; |
17 |
const float TofDedxHCut::_S32_SA_params[] = { 1.6, 1.2, -0.15, -2., 0.8, 1.6, 1.2, -0.2, 0., 0.8 }; |
const float TofDedxHCut::_S32_SA_params[] = { 1.6, 1.2, -0.15, -2., 0.8, 1.6, 1.2, -0.2, 0., 0.8 }; |
18 |
|
|
19 |
TofDedxHCut::TofDedxHCut(const char *cutName, unsigned int layer, bool standAlone) : |
const float TofDedxHCut::_S11_SA_params_strict[] = { 1.5, 1.2, -0.15, -1.7, 0.8, 1.6, 1.2, -0.2, -0.8, 0.8 }; |
20 |
|
const float TofDedxHCut::_S12_SA_params_strict[] = { 1.5, 1.2, -0.15, -1.7, 0.8, 1.6, 1.2, -0.2, -0.8, 0.8 }; |
21 |
|
const float TofDedxHCut::_S21_SA_params_strict[] = { 1.6, 1.2, -0.15, -1.7, 0.8, 1.6, 1.2, -0.2, -0.8, 0.8 }; |
22 |
|
const float TofDedxHCut::_S22_SA_params_strict[] = { 1.6, 1.2, -0.15, -1.7, 0.8, 1.6, 1.2, -0.2, -0.8, 0.8 }; |
23 |
|
const float TofDedxHCut::_S31_SA_params_strict[] = { 1.6, 1.2, -0.15, -1.7, 0.8, 1.6, 1.2, -0.2, -0.8, 0.8 }; |
24 |
|
const float TofDedxHCut::_S32_SA_params_strict[] = { 1.6, 1.2, -0.15, -1.7, 0.8, 1.6, 1.2, -0.2, -0.8, 0.8 }; |
25 |
|
|
26 |
|
TofDedxHCut::TofDedxHCut(const char *cutName, unsigned int layer, bool standAlone, bool strict) : |
27 |
PamCut(cutName), _layer(layer), _standAlone(standAlone), _p(NULL) { |
PamCut(cutName), _layer(layer), _standAlone(standAlone), _p(NULL) { |
28 |
|
|
29 |
switch (_layer) { |
if (strict) { |
30 |
case S11: |
switch (_layer) { |
31 |
_p = _S11_SA_params; |
case S11: |
32 |
break; |
_p = _S11_SA_params_strict; |
33 |
case S12: |
break; |
34 |
_p = _S12_SA_params; |
case S12: |
35 |
break; |
_p = _S12_SA_params_strict; |
36 |
case S21: |
break; |
37 |
_p = _S21_SA_params; |
case S21: |
38 |
break; |
_p = _S21_SA_params_strict; |
39 |
case S22: |
break; |
40 |
_p = _S22_SA_params; |
case S22: |
41 |
break; |
_p = _S22_SA_params_strict; |
42 |
case S31: |
break; |
43 |
_p = _S31_SA_params; |
case S31: |
44 |
break; |
_p = _S31_SA_params_strict; |
45 |
case S32: |
break; |
46 |
_p = _S32_SA_params; |
case S32: |
47 |
break; |
_p = _S32_SA_params_strict; |
48 |
default: |
break; |
49 |
_p = _S21_SA_params; |
default: |
50 |
|
_p = _S21_SA_params_strict; |
51 |
|
} |
52 |
|
} |
53 |
|
else { |
54 |
|
switch (_layer) { |
55 |
|
case S11: |
56 |
|
_p = _S11_SA_params; |
57 |
|
break; |
58 |
|
case S12: |
59 |
|
_p = _S12_SA_params; |
60 |
|
break; |
61 |
|
case S21: |
62 |
|
_p = _S21_SA_params; |
63 |
|
break; |
64 |
|
case S22: |
65 |
|
_p = _S22_SA_params; |
66 |
|
break; |
67 |
|
case S31: |
68 |
|
_p = _S31_SA_params; |
69 |
|
break; |
70 |
|
case S32: |
71 |
|
_p = _S32_SA_params; |
72 |
|
break; |
73 |
|
default: |
74 |
|
_p = _S21_SA_params; |
75 |
|
} |
76 |
} |
} |
|
|
|
77 |
} |
} |
78 |
|
|
79 |
int TofDedxHCut::Check(PamLevel2 *event) { |
int TofDedxHCut::Check(PamLevel2 *event) { |
80 |
|
|
81 |
static int trkSeqNo; |
static int trkSeqNo; |
82 |
|
static int idx; |
83 |
if (_standAlone) |
if (_standAlone) |
84 |
trkSeqNo = 0; |
trkSeqNo = -1; |
85 |
else { |
else |
86 |
for (int i = 0; i < event->GetToFLevel2()->ntrk(); i++) { |
trkSeqNo = event->GetTrack(0)->GetTrkTrack()->GetSeqNo(); |
87 |
if (event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == event->GetTrack(0)->GetTrkTrack()->GetSeqNo()) |
|
88 |
trkSeqNo = i; |
for (int i = 0; i < event->GetToFLevel2()->ntrk(); i++) { |
89 |
} |
if (event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == trkSeqNo) |
90 |
|
idx = i; |
91 |
} |
} |
92 |
|
|
93 |
float beta = event->GetToFLevel2()->GetToFTrkVar(trkSeqNo)->beta[12]; |
float beta = event->GetToFLevel2()->GetToFTrkVar(idx)->beta[12]; |
94 |
|
|
95 |
static unsigned int auxLayer; |
static unsigned int auxLayer; |
96 |
static float dEdx; |
static float dEdx; |
103 |
nLayers = 0; |
nLayers = 0; |
104 |
while (auxLayer > 0) { |
while (auxLayer > 0) { |
105 |
if ((auxLayer & 0x1) == 1) { |
if ((auxLayer & 0x1) == 1) { |
106 |
dEdx += event->GetToFLevel2()->GetdEdx(trkSeqNo, currLayer, 100); |
dEdx += event->GetToFLevel2()->GetdEdx(idx, currLayer, 100); |
107 |
nLayers++; |
nLayers++; |
108 |
// Patch to exclude S115b |
// Patch to exclude S115b |
109 |
if (currLayer == 0) { |
if (currLayer == 0) { |
110 |
ToFTrkVar *tofTrk = event->GetToFLevel2()->GetToFTrkVar(trkSeqNo); |
ToFTrkVar *tofTrk = event->GetToFLevel2()->GetToFTrkVar(idx); |
111 |
bool has8 = false, has9 = false; |
bool has8 = false, has9 = false; |
112 |
float dedx9 = 0.; |
float dedx9 = 0.; |
113 |
for (Int_t ib = 0; ib < tofTrk->npmtadc; ib++) { |
for (Int_t ib = 0; ib < tofTrk->npmtadc; ib++) { |