From b7418623e57d2a1a33e12490f168d330bc78eb3b Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Tue, 13 Sep 2011 06:48:25 +0000 Subject: [PATCH] implemented compact detector grouping in musrview --- src/classes/PMsrHandler.cpp | 59 +++++++++++++++++++++++++++++-------- src/classes/PMusrCanvas.cpp | 24 ++++++--------- src/include/PMsrHandler.h | 4 ++- 3 files changed, 59 insertions(+), 28 deletions(-) diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index 1c514245..3cb3fa63 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -4502,7 +4502,7 @@ void PMsrHandler::FillParameterInUse(PMsrLines &theory, PMsrLines &funcs, PMsrLi //-------------------------------------------------------------------------- -// CheckRunBlockIntegrity (private) +// CheckRunBlockIntegrity (public) //-------------------------------------------------------------------------- /** *

Checks the consistency of each RUN block, i.e. are the necessary parameters @@ -4646,7 +4646,7 @@ Bool_t PMsrHandler::CheckRunBlockIntegrity() } //-------------------------------------------------------------------------- -// CheckUniquenessOfParamNames (private) +// CheckUniquenessOfParamNames (public) //-------------------------------------------------------------------------- /** *

Checks if all the fit parameters are unique. If not parX, parY will show @@ -4678,7 +4678,7 @@ Bool_t PMsrHandler::CheckUniquenessOfParamNames(UInt_t &parX, UInt_t &parY) } //-------------------------------------------------------------------------- -// CheckMaps (private) +// CheckMaps (public) //-------------------------------------------------------------------------- /** *

Checks if map entries found in the theory- or function-block are also @@ -4788,7 +4788,7 @@ Bool_t PMsrHandler::CheckMaps() } //-------------------------------------------------------------------------- -// CheckFuncs (private) +// CheckFuncs (public) //-------------------------------------------------------------------------- /** *

Checks if fun entries found in the theory- and run-block are also @@ -4880,7 +4880,7 @@ Bool_t PMsrHandler::CheckFuncs() } //-------------------------------------------------------------------------- -// CheckHistoGrouping (private) +// CheckHistoGrouping (public) //-------------------------------------------------------------------------- /** *

Checks if histogram grouping makes any sense. @@ -4935,7 +4935,7 @@ Bool_t PMsrHandler::CheckHistoGrouping() } //-------------------------------------------------------------------------- -// CheckAddRunParameters (private) +// CheckAddRunParameters (public) //-------------------------------------------------------------------------- /** *

In case addrun is present check that if addt0's are given there are as many addt0's than addrun's. @@ -4967,7 +4967,7 @@ Bool_t PMsrHandler::CheckAddRunParameters() } //-------------------------------------------------------------------------- -// CheckMaxLikelihood (private) +// CheckMaxLikelihood (public) //-------------------------------------------------------------------------- /** *

If log max likelihood is requested, make sure that all run blocks are of single histogram type. @@ -4989,6 +4989,36 @@ void PMsrHandler::CheckMaxLikelihood() } } +//-------------------------------------------------------------------------- +// GetGroupingString (public) +//-------------------------------------------------------------------------- +/** + *

returns the forward/backward grouping string. + * + * \param runNo msr-file run block number + * \param detector tag telling which set to be used. Possible are: 'forward' and 'backward' + * \param groupingStr compressed grouping information. + */ +void PMsrHandler::GetGroupingString(Int_t runNo, TString detector, TString &groupingStr) +{ + PIntVector grouping; + + if (!detector.CompareTo("forward", TString::kIgnoreCase)) { + for (UInt_t i=0; iGetGroupingString(runNo, "forward", grouping); + tstr += grouping; tstr += TString(","); } else if (runs[runNo].GetFitType() == MSR_FITTYPE_ASYM) { tstr += TString("h:"); - tstr += runs[runNo].GetForwardHistoNo(); - for (UInt_t j=1; jGetGroupingString(runNo, "forward", grouping); + tstr += grouping; tstr += TString("/"); - tstr += runs[runNo].GetBackwardHistoNo(); - for (UInt_t j=1; jGetGroupingString(runNo, "backward", grouping); + tstr += grouping; tstr += TString(","); } // temperature if present diff --git a/src/include/PMsrHandler.h b/src/include/PMsrHandler.h index db3f4607..16dffcd3 100644 --- a/src/include/PMsrHandler.h +++ b/src/include/PMsrHandler.h @@ -105,6 +105,8 @@ class PMsrHandler virtual Bool_t CheckAddRunParameters(); virtual void CheckMaxLikelihood(); + virtual void GetGroupingString(Int_t runNo, TString detector, TString &groupingStr); + private: Bool_t fWriteExpectedChisq; ///< flag shows if expected chisq shall be written to the msr-file @@ -147,7 +149,7 @@ class PMsrHandler virtual UInt_t LastSignificant(Double_t dval, UInt_t precLimit=6); virtual Bool_t ParseDetectorGrouping(TString str, PIntVector &group); - virtual void MakeDetectorGroupingString(TString str, PIntVector &group, TString &result); + virtual void MakeDetectorGroupingString(TString str, PIntVector &group, TString &result, Bool_t includeDetector = true); }; #endif // _PMSRHANDLER_H_