13 |
|
|
14 |
int TofDedxS1Cut::Check(PamLevel2 *event) { |
int TofDedxS1Cut::Check(PamLevel2 *event) { |
15 |
|
|
16 |
int trkSeqNo = 0; |
int idx = 0; |
17 |
for (int i = 0; i < event->GetToFLevel2()->ntrk(); i++) { |
for (int i = 0; i < event->GetToFLevel2()->ntrk(); i++) { |
18 |
if (event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == event->GetTrack(0)->GetTrkTrack()->GetSeqNo()) |
if (event->GetToFLevel2()->GetToFTrkVar(i)->trkseqno == event->GetTrack(0)->GetTrkTrack()->GetSeqNo()) |
19 |
trkSeqNo = i; |
idx = i; |
20 |
} |
} |
21 |
|
|
22 |
float dEdx = 0; |
float dEdx = 0; |
23 |
int nLayers = 0; |
int nLayers = 0; |
24 |
float dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 0, 100); |
float dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 0, 100); |
25 |
|
|
26 |
// Patch to exclude S115b |
// Patch to exclude S115b |
27 |
ToFTrkVar *tofTrk = event->GetToFLevel2()->GetToFTrkVar(trkSeqNo); |
ToFTrkVar *tofTrk = event->GetToFLevel2()->GetToFTrkVar(idx); |
28 |
bool has8 = false, has9 = false; |
bool has8 = false, has9 = false; |
29 |
float dedx9 = 0.; |
float dedx9 = 0.; |
30 |
for (Int_t ib = 0; ib < tofTrk->npmtadc; ib++) { |
for (Int_t ib = 0; ib < tofTrk->npmtadc; ib++) { |
47 |
dEdx += dEdxLayer; |
dEdx += dEdxLayer; |
48 |
nLayers++; |
nLayers++; |
49 |
} |
} |
50 |
dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 1, 100); |
dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 1, 100); |
51 |
if (dEdxLayer > 0. && dEdxLayer < 4090) { |
if (dEdxLayer > 0. && dEdxLayer < 4090) { |
52 |
dEdx += dEdxLayer; |
dEdx += dEdxLayer; |
53 |
nLayers++; |
nLayers++; |