--- PamCut/CollectionActions/Histo2DActions/TofDedxVsBetaHistoAction/TofDedxVsBetaHistoAction.cpp 2010/08/12 15:14:31 1.3 +++ PamCut/CollectionActions/Histo2DActions/TofDedxVsBetaHistoAction/TofDedxVsBetaHistoAction.cpp 2011/12/20 17:41:49 1.4 @@ -11,8 +11,8 @@ TofDedxVsBetaHistoAction::TofDedxVsBetaHistoAction(const char *actionName, unsigned int layers, bool standAlone, TString outFileBase, TString mode, bool outRoot, bool outText, TString title) : - Histo2DAction (actionName, title, outFileBase, mode, outRoot, outText), _layers(layers), _nLayers(0), - _badEvents(0), _standAlone(standAlone) { + Histo2DAction(actionName, title, outFileBase, mode, outRoot, outText), _layers(layers), _nLayers(0), _badEvents( + 0), _standAlone(standAlone) { bool buildTitle = false; if (title == "") { @@ -90,6 +90,25 @@ badLayers = 0; if ((_layers & S11) == S11) { dEdxLayer = event->GetToFLevel2()->GetdEdx(trkSeqNo, 0, 100); + // Patch to exclude S115b + ToFTrkVar *tofTrk = event->GetToFLevel2()->GetToFTrkVar(trkSeqNo); + 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