--- PamCut/CollectionActions/Histo2DActions/TofDedxVsBetaHistoAction/TofDedxVsBetaHistoAction.cpp 2012/01/03 08:45:27 1.1.2.2 +++ PamCut/CollectionActions/Histo2DActions/TofDedxVsBetaHistoAction/TofDedxVsBetaHistoAction.cpp 2012/01/03 08:57:21 1.5 @@ -93,6 +93,25 @@ badLayers = 0; if ((_layers & S11) == S11) { dEdxLayer = event->GetToFLevel2()->GetdEdx(idx, 0, 100); + // Patch to exclude S115b + ToFTrkVar *tofTrk = event->GetToFLevel2()->GetToFTrkVar(idx); + bool has8 = false, has9 = false; + float dedx9 = 0.; + for (Int_t ib = 0; ib < tofTrk->npmtadc; ib++) { + if (tofTrk->pmtadc[ib] == 8) { + has8 = true; + } + if (tofTrk->pmtadc[ib] == 9) { + has9 = true; + dedx9 = tofTrk->dedx[ib]; + } + } + + if (has9) { + dEdxLayer -= (dedx9 / ((int) has8 + 1)); + dEdxLayer *= 2.; + } + //End of patch if (dEdxLayer > 0. && dEdxLayer < 4090) dEdx += dEdxLayer; else @@ -134,7 +153,7 @@ badLayers++; } if (badLayers == 0) { - dEdx /= _nLayers - badLayers; + dEdx /= _nLayers; Fill(event->GetToFLevel2()->GetToFTrkVar(idx)->beta[12], dEdx); } else