--- PamCut/CollectionActions/Histo2DActions/TofDedxVsBetaHistoAction/TofDedxVsBetaHistoAction.cpp 2009/09/25 15:36:35 1.1 +++ PamCut/CollectionActions/Histo2DActions/TofDedxVsBetaHistoAction/TofDedxVsBetaHistoAction.cpp 2010/08/12 15:14:31 1.3 @@ -14,46 +14,60 @@ Histo2DAction (actionName, title, outFileBase, mode, outRoot, outText), _layers(layers), _nLayers(0), _badEvents(0), _standAlone(standAlone) { + bool buildTitle = false; if (title == "") { + buildTitle = true; title = "TOF dE/dx ("; - if ((_layers & S11) == S11) { + } + if ((_layers & S11) == S11) { + if (buildTitle) title += "S11"; - _nLayers++; - } - if ((_layers & S12) == S12) { + _nLayers++; + } + if ((_layers & S12) == S12) { + if (buildTitle) { if (_nLayers > 0) title += ","; title += "S12"; - _nLayers++; } - if ((_layers & S21) == S21) { + _nLayers++; + } + if ((_layers & S21) == S21) { + if (buildTitle) { if (_nLayers > 0) title += ","; title += "S21"; - _nLayers++; } - if ((_layers & S22) == S22) { + _nLayers++; + } + if ((_layers & S22) == S22) { + if (buildTitle) { if (_nLayers > 0) title += ","; title += "S22"; - _nLayers++; } - if ((_layers & S31) == S31) { + _nLayers++; + } + if ((_layers & S31) == S31) { + if (buildTitle) { if (_nLayers > 0) title += ","; title += "S31"; - _nLayers++; } - if ((_layers & S32) == S32) { + _nLayers++; + } + if ((_layers & S32) == S32) { + if (buildTitle) { if (_nLayers > 0) title += ","; title += "S32"; - _nLayers++; } + _nLayers++; + } + if (buildTitle) title += ") Vs Beta"; - SetTitle(title); - } + SetTitle(title); } @@ -117,7 +131,7 @@ badLayers++; } if (badLayers == 0) { - dEdx /= _nLayers - badLayers; + dEdx /= _nLayers; Fill(event->GetToFLevel2()->GetToFTrkVar(trkSeqNo)->beta[12], dEdx); } else