added addt0 to the GLOBAL block

This commit is contained in:
suter_a 2014-12-17 15:40:43 +01:00
parent f13fa554bf
commit 56cb9749d2
2 changed files with 80 additions and 1 deletions

View File

@ -799,6 +799,80 @@ void PMsrGlobalBlock::SetT0Bin(Double_t dval, Int_t idx)
fT0[idx] = dval;
}
//--------------------------------------------------------------------------
// GetAddT0BinSize (public)
//--------------------------------------------------------------------------
/**
* <p> get add T0 size of the addrun at index addRunIdx
*
* <b>return:</b>
* - addt0 value, if idx is within proper boundaries
* - -1, otherwise
*
* \param addRunIdx index of the addrun
*/
Int_t PMsrGlobalBlock::GetAddT0BinSize(UInt_t addRunIdx)
{
if (fAddT0.empty())
return -1;
if (addRunIdx >= fAddT0.size())
return -1;
return fAddT0[addRunIdx].size();
}
//--------------------------------------------------------------------------
// GetAddT0Bin (public)
//--------------------------------------------------------------------------
/**
* <p> get add T0 of the addrun (index addRunIdx) at index histoIdx
*
* <b>return:</b>
* - addt0 value, if indices are within proper boundaries
* - -1, otherwise
*
* \param addRunIdx index of the addrun
* \param histoIdx index of the add backward histo number value
*/
Double_t PMsrGlobalBlock::GetAddT0Bin(UInt_t addRunIdx, UInt_t histoIdx)
{
if (fAddT0.empty())
return -1.0;
if (addRunIdx >= fAddT0.size())
return -1.0;
if (fAddT0[addRunIdx].empty())
return -1.0;
if (histoIdx >= fAddT0[addRunIdx].size())
return -1.0;
return fAddT0[addRunIdx][histoIdx];
}
//--------------------------------------------------------------------------
// SetAddT0Bin (public)
//--------------------------------------------------------------------------
/**
* <p> set add T0 bin of the addrun at index histoNoIdx
*
* \param ival T0 bin
* \param addRunIdx addrun index
* \param histoNoIdx index whithin the fAddT0 vector where to set the value.
*/
void PMsrGlobalBlock::SetAddT0Bin(Double_t dval, UInt_t addRunIdx, UInt_t histoNoIdx)
{
if (addRunIdx >= fAddT0.size())
fAddT0.resize(addRunIdx+1);
if (histoNoIdx >= fAddT0[addRunIdx].size())
fAddT0[addRunIdx].resize(histoNoIdx+1);
fAddT0[addRunIdx][histoNoIdx] = dval;
}
//--------------------------------------------------------------------------
// GetFitRange (public)
//--------------------------------------------------------------------------

View File

@ -537,6 +537,9 @@ class PMsrGlobalBlock {
virtual Int_t GetDataRange(UInt_t idx);
virtual UInt_t GetT0BinSize() { return fT0.size(); }
virtual Double_t GetT0Bin(UInt_t idx=0);
virtual UInt_t GetAddT0BinEntries() { return fAddT0.size(); }
virtual Int_t GetAddT0BinSize(UInt_t addRunIdx);
virtual Double_t GetAddT0Bin(UInt_t addRunIdx, UInt_t histoIdx);
virtual Bool_t IsFitRangeInBin() { return fFitRangeInBins; }
virtual Double_t GetFitRange(UInt_t idx);
virtual Int_t GetFitRangeOffset(UInt_t idx);
@ -545,6 +548,7 @@ class PMsrGlobalBlock {
virtual void SetFitType(Int_t ival) { fFitType = ival; }
virtual void SetDataRange(Int_t ival, Int_t idx);
virtual void SetT0Bin(Double_t dval, Int_t idx=-1);
virtual void SetAddT0Bin(Double_t dval, UInt_t addRunIdx, UInt_t histoNoIdx);
virtual void SetFitRangeInBins(Bool_t bval) { fFitRangeInBins = bval; }
virtual void SetFitRange(Double_t dval, UInt_t idx);
virtual void SetFitRangeOffset(Int_t ival, UInt_t idx);
@ -553,7 +557,8 @@ class PMsrGlobalBlock {
private:
Int_t fFitType; ///< fit type: 0=single histo fit, 2=asymmetry fit, 4=mu^- single histo fit, 8=non muSR fit
Int_t fDataRange[4]; ///< data bin range (fit type 0, 2, 4)
PDoubleVector fT0; ///< t0 bins (fit type 0, 2, 4). if fit type 0 -> f0, f1, f2, ...; if fit type
PDoubleVector fT0; ///< t0 bins (fit type 0, 2, 4). if fit type 0 -> f0, f1, f2, ...; if fit type 2, 4 -> f0, b0, f1, b1, ...
vector<PDoubleVector> fAddT0; ///< addt0 bins (fit type 0, 2, 4). if fit type 0 -> f0, f1, f2, ...; if fit type 2, 4 -> f0, b0, f1, b1, ...
Bool_t fFitRangeInBins; ///< flag telling if fit range is given in time or in bins
Double_t fFitRange[2]; ///< fit range in (us)
Int_t fFitRangeOffset[2]; ///< if fit range is given in bins it can have the form fit fgb+n0 lgb-n1. This variable holds the n0 and n1.