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++) { |