diff --git a/ChangeLog b/ChangeLog index 96cbdde5..92fd9cd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,8 @@ NEW 2012-05-12 added dump_header. This is a little program which dumps the NEW 2012-04-24 added a first version for negative muon fitting. At the same time substaintial bug fixing has been carried out (mainly the logx/logy handling). +FIXED 2012-12-18 fixed a shortcoming of the outdated TLemRunHeader class + (see MUSR-246). FIXED 2012-11-19 fixes issue with too many t0's in the msr-file (see MUSR-238). FIXED 2012-11-19 the Fourier transform had 1 Bin too much, this is fixed now diff --git a/src/classes/PRunDataHandler.cpp b/src/classes/PRunDataHandler.cpp index 0b26992b..fd3213c3 100644 --- a/src/classes/PRunDataHandler.cpp +++ b/src/classes/PRunDataHandler.cpp @@ -4463,9 +4463,17 @@ Bool_t PRunDataHandler::WriteRootFile(TString fln) header->SetNHist(fData[0].GetNoOfHistos()); header->SetCuts("none"); header->SetModerator("none"); - // feed t0's - Double_t *tt0 = new Double_t[fData[0].GetNoOfHistos()]; - for (UInt_t i=0; i NHIST) { + cerr << endl << ">> PRunDataHandler::WriteRootFile: **WARNING** found more T0's (" << NoT0s << ") than can be handled (" << NHIST << ")."; + cerr << endl << ">> Will only write the first " << NHIST << " T0s!!" << endl; + NoT0s = NHIST; + } + Double_t *tt0 = new Double_t[NoT0s]; + + for (UInt_t i=0; iGetTimeZeroBin()/fAny2ManyInfo->rebin; } @@ -4481,7 +4489,7 @@ Bool_t PRunDataHandler::WriteRootFile(TString fln) for (UInt_t i=0; i> PRunDataHandler::WriteNexusFile: **ERROR** Couldn't get data set (idx=0" << i << ")"; + cerr << endl << ">> PRunDataHandler::WriteRootFile: **ERROR** Couldn't get data set (idx=0" << i << ")"; cerr << endl << ">> something is really wrong!" << endl; return false; } @@ -4703,7 +4711,7 @@ Bool_t PRunDataHandler::WriteNexusFile(TString fln) } size = dataSet->GetData()->size(); for (UInt_t j=0; jGetData()->at(j)); + data.push_back((UInt_t)dataSet->GetData()->at(j)); } nxs->GetEntryIdf1()->GetData()->SetHisto(data, i); data.clear(); diff --git a/src/external/TLemRunHeader/TLemRunHeader.cxx b/src/external/TLemRunHeader/TLemRunHeader.cxx index 4c3d9dbf..3928cc45 100644 --- a/src/external/TLemRunHeader/TLemRunHeader.cxx +++ b/src/external/TLemRunHeader/TLemRunHeader.cxx @@ -5,6 +5,9 @@ // // $Id: TLemRunHeader.cxx 3897 2009-05-01 22:06:11Z l_wojek $ // +#include +using namespace std; + #include "TLemRunHeader.h" ClassImp(TLemRunHeader) @@ -190,10 +193,13 @@ void TLemRunHeader::SetModerator(const Char_t *moderator){ } //---------------------------------------------------------- void TLemRunHeader::SetTimeZero(const Double_t *value){ + Int_t noT0s = fNHist; + if (noT0s > NHIST) + noT0s = NHIST; TString str; str = "16 t0: "; - for (Int_t i = 0; i < fNHist; i++){ - //fTimeZero.push_back(value[i]); + for (Int_t i = 0; i < noT0s; i++){ + //fTimeZero.push_back(value[i]); fTimeZero[i] = value[i]; str += value[i]; str += " ";