diff --git a/src/classes/PRunDataHandler.cpp b/src/classes/PRunDataHandler.cpp index 5e5cb616..386f3a5a 100644 --- a/src/classes/PRunDataHandler.cpp +++ b/src/classes/PRunDataHandler.cpp @@ -2055,11 +2055,15 @@ Bool_t PRunDataHandler::ReadRootFile() } dataSet.Clear(); - dataSet.SetName(histo->GetTitle()); + dataSet.SetTitle(histo->GetTitle()); dataSet.SetHistoNo(redGreenOffsets[i]+j+1); // get detector info path.Form("DetectorInfo/Detector%03d/", redGreenOffsets[i]+j+1); + pathName = path + "Name"; + header->Get(pathName, str, ok); + if (ok) + dataSet.SetName(str); pathName = path + "Time Zero Bin"; header->Get(pathName, dval, ok); if (ok) @@ -5582,6 +5586,29 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln) Int_t ival = 0; PRawRunDataSet *dataSet; UInt_t size = fData[0].GetNoOfHistos(); + // collect histo names in order to see if they are still unique after cropping to 4 char. + PStringVector hName, hNCrop; + TString sCrop; + for (UInt_t i=0; iGetName(); + hName.push_back(str); + sCrop = str; + sCrop.Remove(4); + hNCrop.push_back(sCrop); + } + // check cropped for uniqueness + ival = 1; + for (UInt_t i=0; iGetName(); - if (!str.CompareTo("n/a")) - str.Form("Detector%3d", i+1); - psibin.PutNameHisto(str.Data(), i); + psibin.PutNameHisto(hNCrop[i].Data(), i); // time zero bin ival = static_cast(dataSet->GetTimeZeroBin()/fAny2ManyInfo->rebin); psibin.PutT0Int(i, ival);