From: richterm Date: Mon, 21 Nov 2011 09:53:52 +0000 (+0000) Subject: corrected string operation X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=d12e134a83ee60137de0053e3b420b7ee689b38a;p=u%2Fmrichter%2FAliRoot.git corrected string operation --- diff --git a/HLT/BASE/AliHLTTTreeProcessor.cxx b/HLT/BASE/AliHLTTTreeProcessor.cxx index 6864f58f000..3972bbecd9b 100644 --- a/HLT/BASE/AliHLTTTreeProcessor.cxx +++ b/HLT/BASE/AliHLTTTreeProcessor.cxx @@ -494,15 +494,10 @@ TH1* AliHLTTTreeProcessor::CreateHistogram(const AliHLTHistogramDefinition& d) if(d.GetTitle().Length()){ //removing underscore - size_t found; - string str=d.GetTitle().Data(); - found=str.find_first_of("_"); - if(!(d.GetExpression().CompareTo("Track_pt"))){ - found=str.find_first_of("_",found+1); - } - str[found]=' '; - char axis[100]; - sprintf(axis,"%s",str.c_str()); + TString axis=d.GetTitle().Data(); + axis.ReplaceAll("_{T}", "underscore{T}"); + axis.ReplaceAll("_", " "); + axis.ReplaceAll("underscore{T}", "_{T}"); hist->SetXTitle(axis); hist->GetXaxis()->CenterTitle();