adopted to the SECTOR command in combination with DKS.
This commit is contained in:
parent
01ba9f3add
commit
1ea877621f
@ -83,30 +83,38 @@
|
||||
PSectorChisq::PSectorChisq(UInt_t noOfRuns) : fNoOfRuns(noOfRuns)
|
||||
{
|
||||
// init
|
||||
fFirst = 0.0;
|
||||
fLast = 0.0;
|
||||
fChisq = 0.0;
|
||||
fNDF = 0;
|
||||
fFirst.resize(fNoOfRuns);
|
||||
fChisqRun.resize(fNoOfRuns);
|
||||
fNDFRun.resize(fNoOfRuns);
|
||||
for (UInt_t i=0; i<fNoOfRuns; i++) {
|
||||
fFirst[i] = 0.0;
|
||||
fChisqRun[i] = 0.0;
|
||||
fNDFRun[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// SetTimeRange
|
||||
// SetRunFirstTime
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Set the time range for one sector
|
||||
* <p>Set the time of the fgb of a given RUN
|
||||
*
|
||||
* @param first time stamp of the fgb
|
||||
* @param last time stamp of the requested sector end
|
||||
* @param idx index of the RUN
|
||||
*/
|
||||
void PSectorChisq::SetTimeRange(Double_t first, Double_t last)
|
||||
void PSectorChisq::SetRunFirstTime(Double_t first, UInt_t idx)
|
||||
{
|
||||
// NOT YET IMPLEMENTED //as35
|
||||
if (idx > fNoOfRuns) {
|
||||
std::cerr << "**WARNING** from PSectorChisq::SetRunFirstTime. It tries to set" << std::endl;
|
||||
std::cerr << " a fgb time stamp with idx=" << idx << " which is larger than #RUNS=" << fNoOfRuns << "." << std::endl;
|
||||
std::cerr << " Will ignore it, but you better check what is going on!" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
fFirst[idx] = first;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -120,7 +128,14 @@ void PSectorChisq::SetTimeRange(Double_t first, Double_t last)
|
||||
*/
|
||||
void PSectorChisq::SetChisq(Double_t chisq, UInt_t idx)
|
||||
{
|
||||
// NOT YET IMPLEMENTED //as35
|
||||
if (idx > fNoOfRuns) {
|
||||
std::cerr << "**WARNING** from PSectorChisq::SetChisq. It tries to set" << std::endl;
|
||||
std::cerr << " a chisq with idx=" << idx << " which is larger than #RUNS=" << fNoOfRuns << "." << std::endl;
|
||||
std::cerr << " Will ignore it, but you better check what is going on!" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
fChisqRun[idx] = chisq;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -134,7 +149,33 @@ void PSectorChisq::SetChisq(Double_t chisq, UInt_t idx)
|
||||
*/
|
||||
void PSectorChisq::SetNDF(Double_t ndf, UInt_t idx)
|
||||
{
|
||||
// NOT YET IMPLEMENTED //as35
|
||||
if (idx > fNoOfRuns) {
|
||||
std::cerr << "**WARNING** from PSectorChisq::SetNDF. It tries to set" << std::endl;
|
||||
std::cerr << " a NDF with idx=" << idx << " which is larger than #RUNS=" << fNoOfRuns << "." << std::endl;
|
||||
std::cerr << " Will ignore it, but you better check what is going on!" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
fNDFRun[idx] = ndf;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// GetTimeRangeFirst
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Get the fgb time of RUN with index idx. If idx is out-of-range
|
||||
* PMUSR_UNDEFINED is returned.
|
||||
*
|
||||
* @param idx index of the RUN
|
||||
*
|
||||
* <b>return:</b> return the fgb time of RUN with index idx.
|
||||
*/
|
||||
Double_t PSectorChisq::GetTimeRangeFirst(UInt_t idx)
|
||||
{
|
||||
if (idx > fNoOfRuns)
|
||||
return PMUSR_UNDEFINED;
|
||||
|
||||
return fFirst[idx];
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
@ -196,6 +237,8 @@ PFitter::PFitter(PMsrHandler *runInfo, PRunListCollection *runListCollection, Bo
|
||||
|
||||
fStrategy = 1; // 0=low, 1=default, 2=high
|
||||
|
||||
fSectorFlag = false;
|
||||
|
||||
fParams = *(runInfo->GetMsrParamList());
|
||||
fCmdLines = *runInfo->GetMsrCommands();
|
||||
|
||||
@ -311,6 +354,11 @@ Bool_t PFitter::DoFit()
|
||||
|
||||
// check if only chisq/maxLH shall be calculated once
|
||||
if (fChisqOnly) {
|
||||
|
||||
// check for sector command
|
||||
if (fSectorFlag)
|
||||
PrepareSector();
|
||||
|
||||
std::vector<Double_t> param = fMnUserParams.Params();
|
||||
std::vector<Double_t> error = fMnUserParams.Errors();
|
||||
Int_t usedParams = 0;
|
||||
@ -331,15 +379,15 @@ Bool_t PFitter::DoFit()
|
||||
if (fUseChi2) {
|
||||
// calculate expected chisq
|
||||
Double_t totalExpectedChisq = 0.0;
|
||||
std::vector<Double_t> expectedChisqPerHisto;
|
||||
std::vector<Double_t> expectedChisqPerRun;
|
||||
if (fDKSReady)
|
||||
fFitterFcnDKS->CalcExpectedChiSquare(param, totalExpectedChisq, expectedChisqPerHisto);
|
||||
fFitterFcnDKS->CalcExpectedChiSquare(param, totalExpectedChisq, expectedChisqPerRun);
|
||||
else
|
||||
fFitterFcn->CalcExpectedChiSquare(param, totalExpectedChisq, expectedChisqPerHisto);
|
||||
fFitterFcn->CalcExpectedChiSquare(param, totalExpectedChisq, expectedChisqPerRun);
|
||||
// calculate chisq per run
|
||||
std::vector<Double_t> chisqPerHisto;
|
||||
std::vector<Double_t> chisqPerRun;
|
||||
for (UInt_t i=0; i<fRunInfo->GetMsrRunList()->size(); i++) {
|
||||
chisqPerHisto.push_back(fRunListCollection->GetSingleRunChisq(param, i));
|
||||
chisqPerRun.push_back(fRunListCollection->GetSingleRunChisq(param, i));
|
||||
}
|
||||
|
||||
std::cout << std::endl << std::endl << ">> chisq = " << val << ", NDF = " << ndf << ", chisq/NDF = " << val/ndf;
|
||||
@ -347,32 +395,173 @@ Bool_t PFitter::DoFit()
|
||||
if (totalExpectedChisq != 0.0) {
|
||||
std::cout << std::endl << ">> expected chisq = " << totalExpectedChisq << ", NDF = " << ndf << ", expected chisq/NDF = " << totalExpectedChisq/ndf;
|
||||
UInt_t ndf_histo = 0;
|
||||
for (UInt_t i=0; i<expectedChisqPerHisto.size(); i++) {
|
||||
for (UInt_t i=0; i<expectedChisqPerRun.size(); i++) {
|
||||
if (fDKSReady)
|
||||
ndf_histo = fFitterFcnDKS->GetNoOfFittedBins(i) - fRunInfo->GetNoOfFitParameters(i);
|
||||
else
|
||||
ndf_histo = fFitterFcn->GetNoOfFittedBins(i) - fRunInfo->GetNoOfFitParameters(i);
|
||||
if (ndf_histo > 0)
|
||||
std::cout << std::endl << ">> run block " << i+1 << ": (NDF/red.chisq/red.chisq_e) = (" << ndf_histo << "/" << chisqPerHisto[i]/ndf_histo << "/" << expectedChisqPerHisto[i]/ndf_histo << ")";
|
||||
std::cout << std::endl << ">> run block " << i+1 << ": (NDF/red.chisq/red.chisq_e) = (" << ndf_histo << "/" << chisqPerRun[i]/ndf_histo << "/" << expectedChisqPerRun[i]/ndf_histo << ")";
|
||||
}
|
||||
} else if (chisqPerHisto.size() > 0) { // in case expected chisq is not applicable like for asymmetry fits
|
||||
} else if (chisqPerRun.size() > 0) { // in case expected chisq is not applicable like for asymmetry fits
|
||||
UInt_t ndf_histo = 0;
|
||||
for (UInt_t i=0; i<chisqPerHisto.size(); i++) {
|
||||
for (UInt_t i=0; i<chisqPerRun.size(); i++) {
|
||||
if (fDKSReady)
|
||||
ndf_histo = fFitterFcnDKS->GetNoOfFittedBins(i) - fRunInfo->GetNoOfFitParameters(i);
|
||||
else
|
||||
ndf_histo = fFitterFcn->GetNoOfFittedBins(i) - fRunInfo->GetNoOfFitParameters(i);
|
||||
|
||||
if (ndf_histo > 0)
|
||||
std::cout << std::endl << ">> run block " << i+1 << ": (NDF/red.chisq) = (" << ndf_histo << "/" << chisqPerHisto[i]/ndf_histo << ")";
|
||||
std::cout << std::endl << ">> run block " << i+1 << ": (NDF/red.chisq) = (" << ndf_histo << "/" << chisqPerRun[i]/ndf_histo << ")";
|
||||
}
|
||||
}
|
||||
|
||||
// clean up
|
||||
chisqPerHisto.clear();
|
||||
expectedChisqPerHisto.clear();
|
||||
chisqPerRun.clear();
|
||||
expectedChisqPerRun.clear();
|
||||
|
||||
if (fSectorFlag) {
|
||||
PDoublePairVector secFitRange;
|
||||
secFitRange.resize(1);
|
||||
for (UInt_t k=0; k<fSector.size(); k++) {
|
||||
// set sector fit range
|
||||
secFitRange[0].first = fSector[k].GetTimeRangeFirst(0);
|
||||
secFitRange[0].second = fSector[k].GetTimeRangeLast();
|
||||
fRunListCollection->SetFitRange(secFitRange);
|
||||
// calculate chisq and NDF
|
||||
if (fDKSReady) {
|
||||
ndf = static_cast<Int_t>(fFitterFcnDKS->GetTotalNoOfFittedBins()) - usedParams;
|
||||
val = (*fFitterFcnDKS)(param);
|
||||
} else {
|
||||
ndf = static_cast<Int_t>(fFitterFcn->GetTotalNoOfFittedBins()) - usedParams;
|
||||
val = (*fFitterFcn)(param);
|
||||
}
|
||||
// calculate expected chisq
|
||||
totalExpectedChisq = 0.0;
|
||||
if (fDKSReady)
|
||||
fFitterFcnDKS->CalcExpectedChiSquare(param, totalExpectedChisq, expectedChisqPerRun);
|
||||
else
|
||||
fFitterFcn->CalcExpectedChiSquare(param, totalExpectedChisq, expectedChisqPerRun);
|
||||
// calculate chisq per run
|
||||
for (UInt_t i=0; i<fRunInfo->GetMsrRunList()->size(); i++) {
|
||||
chisqPerRun.push_back(fRunListCollection->GetSingleRunChisq(param, i));
|
||||
}
|
||||
|
||||
std::cout << std::endl;
|
||||
std::cout << "++++" << std::endl;
|
||||
std::cout << ">> Sector " << k << ": FitRange: " << secFitRange[0].first << ", " << secFitRange[0].second << std::endl;
|
||||
std::cout << ">> chisq = " << val << ", NDF = " << ndf << ", chisq/NDF = " << val/ndf;
|
||||
|
||||
if (totalExpectedChisq != 0.0) {
|
||||
std::cout << std::endl << ">> expected chisq = " << totalExpectedChisq << ", NDF = " << ndf << ", expected chisq/NDF = " << totalExpectedChisq/ndf;
|
||||
UInt_t ndf_histo = 0;
|
||||
for (UInt_t i=0; i<expectedChisqPerRun.size(); i++) {
|
||||
if (fDKSReady)
|
||||
ndf_histo = fFitterFcnDKS->GetNoOfFittedBins(i) - fRunInfo->GetNoOfFitParameters(i);
|
||||
else
|
||||
ndf_histo = fFitterFcn->GetNoOfFittedBins(i) - fRunInfo->GetNoOfFitParameters(i);
|
||||
if (ndf_histo > 0)
|
||||
std::cout << std::endl << ">> run block " << i+1 << ": (NDF/red.chisq/red.chisq_e) = (" << ndf_histo << "/" << chisqPerRun[i]/ndf_histo << "/" << expectedChisqPerRun[i]/ndf_histo << ")";
|
||||
}
|
||||
} else if (chisqPerRun.size() > 0) { // in case expected chisq is not applicable like for asymmetry fits
|
||||
UInt_t ndf_histo = 0;
|
||||
for (UInt_t i=0; i<chisqPerRun.size(); i++) {
|
||||
if (fDKSReady)
|
||||
ndf_histo = fFitterFcnDKS->GetNoOfFittedBins(i) - fRunInfo->GetNoOfFitParameters(i);
|
||||
else
|
||||
ndf_histo = fFitterFcn->GetNoOfFittedBins(i) - fRunInfo->GetNoOfFitParameters(i);
|
||||
if (ndf_histo > 0)
|
||||
std::cout << std::endl << ">> run block " << i+1 << ": (NDF/red.chisq) = (" << ndf_histo << "/" << chisqPerRun[i]/ndf_histo << ")";
|
||||
}
|
||||
}
|
||||
// clean up
|
||||
chisqPerRun.clear();
|
||||
expectedChisqPerRun.clear();
|
||||
}
|
||||
}
|
||||
} else { // max. log likelihood
|
||||
// calculate expected maxLH
|
||||
Double_t totalExpectedMaxLH = 0.0;
|
||||
std::vector<Double_t> expectedMaxLHPerRun;
|
||||
if (fDKSReady)
|
||||
fFitterFcnDKS->CalcExpectedChiSquare(param, totalExpectedMaxLH, expectedMaxLHPerRun);
|
||||
else
|
||||
fFitterFcn->CalcExpectedChiSquare(param, totalExpectedMaxLH, expectedMaxLHPerRun);
|
||||
// calculate maxLH per run
|
||||
std::vector<Double_t> maxLHPerRun;
|
||||
for (UInt_t i=0; i<fRunInfo->GetMsrRunList()->size(); i++) {
|
||||
maxLHPerRun.push_back(fRunListCollection->GetSingleRunMaximumLikelihood(param, i));
|
||||
}
|
||||
|
||||
std::cout << std::endl << std::endl << ">> maxLH = " << val << ", NDF = " << ndf << ", maxLH/NDF = " << val/ndf;
|
||||
|
||||
if (totalExpectedMaxLH != 0.0) {
|
||||
std::cout << std::endl << ">> expected maxLH = " << totalExpectedMaxLH << ", NDF = " << ndf << ", expected maxLH/NDF = " << totalExpectedMaxLH/ndf;
|
||||
UInt_t ndf_histo = 0;
|
||||
for (UInt_t i=0; i<expectedMaxLHPerRun.size(); i++) {
|
||||
if (fDKSReady)
|
||||
ndf_histo = fFitterFcnDKS->GetNoOfFittedBins(i) - fRunInfo->GetNoOfFitParameters(i);
|
||||
else
|
||||
ndf_histo = fFitterFcn->GetNoOfFittedBins(i) - fRunInfo->GetNoOfFitParameters(i);
|
||||
if (ndf_histo > 0)
|
||||
std::cout << std::endl << ">> run block " << i+1 << ": (NDF/maxLH.chisq/maxLH.chisq_e) = (" << ndf_histo << "/" << maxLHPerRun[i]/ndf_histo << "/" << expectedMaxLHPerRun[i]/ndf_histo << ")";
|
||||
}
|
||||
}
|
||||
|
||||
// clean up
|
||||
maxLHPerRun.clear();
|
||||
expectedMaxLHPerRun.clear();
|
||||
|
||||
if (fSectorFlag) {
|
||||
PDoublePairVector secFitRange;
|
||||
secFitRange.resize(1);
|
||||
for (UInt_t k=0; k<fSector.size(); k++) {
|
||||
// set sector fit range
|
||||
secFitRange[0].first = fSector[k].GetTimeRangeFirst(0);
|
||||
secFitRange[0].second = fSector[k].GetTimeRangeLast();
|
||||
fRunListCollection->SetFitRange(secFitRange);
|
||||
// calculate chisq and NDF
|
||||
if (fDKSReady) {
|
||||
ndf = static_cast<Int_t>(fFitterFcnDKS->GetTotalNoOfFittedBins()) - usedParams;
|
||||
val = (*fFitterFcnDKS)(param);
|
||||
} else {
|
||||
ndf = static_cast<Int_t>(fFitterFcn->GetTotalNoOfFittedBins()) - usedParams;
|
||||
val = (*fFitterFcn)(param);
|
||||
}
|
||||
// calculate expected maxLH
|
||||
totalExpectedMaxLH = 0.0;
|
||||
if (fDKSReady)
|
||||
fFitterFcnDKS->CalcExpectedChiSquare(param, totalExpectedMaxLH, expectedMaxLHPerRun);
|
||||
else
|
||||
fFitterFcn->CalcExpectedChiSquare(param, totalExpectedMaxLH, expectedMaxLHPerRun);
|
||||
// calculate maxLH per run
|
||||
for (UInt_t i=0; i<fRunInfo->GetMsrRunList()->size(); i++) {
|
||||
maxLHPerRun.push_back(fRunListCollection->GetSingleRunMaximumLikelihood(param, i));
|
||||
}
|
||||
|
||||
std::cout << std::endl;
|
||||
std::cout << "++++" << std::endl;
|
||||
std::cout << ">> Sector " << k << ": FitRange: " << secFitRange[0].first << ", " << secFitRange[0].second << std::endl;
|
||||
std::cout << ">> maxLH = " << val << ", NDF = " << ndf << ", maxLH/NDF = " << val/ndf;
|
||||
|
||||
if (totalExpectedMaxLH != 0.0) {
|
||||
std::cout << std::endl << ">> expected maxLH = " << totalExpectedMaxLH << ", NDF = " << ndf << ", expected maxLH/NDF = " << totalExpectedMaxLH/ndf;
|
||||
UInt_t ndf_histo = 0;
|
||||
for (UInt_t i=0; i<expectedMaxLHPerRun.size(); i++) {
|
||||
if (fDKSReady)
|
||||
ndf_histo = fFitterFcnDKS->GetNoOfFittedBins(i) - fRunInfo->GetNoOfFitParameters(i);
|
||||
else
|
||||
ndf_histo = fFitterFcn->GetNoOfFittedBins(i) - fRunInfo->GetNoOfFitParameters(i);
|
||||
if (ndf_histo > 0)
|
||||
std::cout << std::endl << ">> run block " << i+1 << ": (NDF/maxLH.chisq/maxLH.chisq_e) = (" << ndf_histo << "/" << maxLHPerRun[i]/ndf_histo << "/" << expectedMaxLHPerRun[i]/ndf_histo << ")";
|
||||
}
|
||||
}
|
||||
|
||||
// clean up
|
||||
maxLHPerRun.clear();
|
||||
expectedMaxLHPerRun.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
std::cout << std::endl << std::endl;
|
||||
return true;
|
||||
@ -449,6 +638,9 @@ Bool_t PFitter::DoFit()
|
||||
case PMN_SCAN:
|
||||
status = ExecuteScan();
|
||||
break;
|
||||
case PMN_SECTOR:
|
||||
// nothing to be done here
|
||||
break;
|
||||
case PMN_SIMPLEX:
|
||||
status = ExecuteSimplex();
|
||||
break;
|
||||
@ -1057,6 +1249,7 @@ Bool_t PFitter::CheckCommands()
|
||||
cmd.second = cmdLineNo;
|
||||
fCmdList.push_back(cmd);
|
||||
} else if (line.Contains("SECTOR", TString::kIgnoreCase)) {
|
||||
fSectorFlag = true;
|
||||
cmd.first = PMN_SECTOR;
|
||||
cmd.second = cmdLineNo;
|
||||
fCmdList.push_back(cmd);
|
||||
@ -1080,11 +1273,15 @@ Bool_t PFitter::CheckCommands()
|
||||
tokens = nullptr;
|
||||
}
|
||||
fIsValid = false;
|
||||
fSectorFlag = false;
|
||||
break;
|
||||
}
|
||||
|
||||
Double_t dval;
|
||||
for (Int_t i=1; i<tokens->GetEntries(); i++) {
|
||||
// keep time range of sector
|
||||
PSectorChisq sec(fRunInfo->GetNoOfRuns());
|
||||
// get parse tokens
|
||||
ostr = dynamic_cast<TObjString*>(tokens->At(i));
|
||||
str = ostr->GetString();
|
||||
if (str.IsFloat()) {
|
||||
@ -1103,9 +1300,13 @@ Bool_t PFitter::CheckCommands()
|
||||
tokens = nullptr;
|
||||
}
|
||||
fIsValid = false;
|
||||
fSectorFlag = false;
|
||||
return fIsValid;
|
||||
}
|
||||
sec.SetRunFirstTime(fOriginalFitRange[j].first, j); // keep fgb time stamp for sector
|
||||
}
|
||||
sec.SetSectorTime(dval);
|
||||
fSector.push_back(sec);
|
||||
} else { // sector element is NOT a float
|
||||
std::cerr << std::endl << ">> PFitter::CheckCommands(): **FATAL ERROR** in line " << it->fLineNo;
|
||||
std::cerr << std::endl << ">> " << line.Data();
|
||||
@ -1118,6 +1319,7 @@ Bool_t PFitter::CheckCommands()
|
||||
tokens = nullptr;
|
||||
}
|
||||
fIsValid = false;
|
||||
fSectorFlag = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2308,11 +2510,36 @@ Bool_t PFitter::ExecuteSimplex()
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// PrepareSector
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Collect all the necessary chisq/maxLH sector information.
|
||||
*/
|
||||
void PFitter::PrepareSector()
|
||||
{
|
||||
// NOT YET IMPLEMENTED //as35
|
||||
|
||||
/*
|
||||
for (UInt_t i=0; i<fSector.size(); i++) {
|
||||
std::cout << "debug> +++++" << std::endl;
|
||||
std::cout << "debug> sector " << i << std::endl;
|
||||
std::cout << "debug> noOfRuns: " << fSector[i].GetNoRuns() << std::endl;
|
||||
for (UInt_t j=0; j<fSector[i].GetNoRuns(); j++) {
|
||||
std::cout << "debug> ----" << std::endl;
|
||||
std::cout << "debug> RUN BLOCK " << j << std::endl;
|
||||
std::cout << "debug> Sector Time Range: " << fSector[i].GetTimeRangeFirst(j) << ", " << fSector[i].GetTimeRangeLast() << std::endl;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// ExecuteSector
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Collects all the necessary chisq/maxLH for the given sectors.
|
||||
* <p>Write all chisq/maxLH sector information to MINUIT.OUTPUT and dump it
|
||||
* to stdout.
|
||||
*
|
||||
* <b>return:</b> if the sector command was successful, otherwise return flase.
|
||||
*/
|
||||
|
@ -378,7 +378,7 @@ void PRunAsymmetry::SetFitRangeBin(const TString fitRange)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// CalcNoOfFitBins (protected)
|
||||
// CalcNoOfFitBins (public)
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the number of fitted bins for the current fit range.
|
||||
|
@ -400,7 +400,7 @@ void PRunAsymmetryBNMR::SetFitRangeBin(const TString fitRange)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// CalcNoOfFitBins (protected)
|
||||
// CalcNoOfFitBins (public)
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the number of fitted bins for the current fit range.
|
||||
|
@ -370,7 +370,7 @@ void PRunAsymmetryRRF::SetFitRangeBin(const TString fitRange)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// CalcNoOfFitBins (protected)
|
||||
// CalcNoOfFitBins (public)
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the number of fitted bins for the current fit range.
|
||||
|
@ -206,18 +206,30 @@ void PRunListCollection::SetFitRange(const TString fitRange)
|
||||
*/
|
||||
void PRunListCollection::SetFitRange(const PDoublePairVector fitRange)
|
||||
{
|
||||
for (UInt_t i=0; i<fRunSingleHistoList.size(); i++)
|
||||
for (UInt_t i=0; i<fRunSingleHistoList.size(); i++) {
|
||||
fRunSingleHistoList[i]->SetFitRange(fitRange);
|
||||
for (UInt_t i=0; i<fRunSingleHistoRRFList.size(); i++)
|
||||
fRunSingleHistoList[i]->CalcNoOfFitBins(); // needed to update fStartTimeBin, fEndTimeBin
|
||||
}
|
||||
for (UInt_t i=0; i<fRunSingleHistoRRFList.size(); i++) {
|
||||
fRunSingleHistoRRFList[i]->SetFitRange(fitRange);
|
||||
for (UInt_t i=0; i<fRunAsymmetryList.size(); i++)
|
||||
fRunSingleHistoRRFList[i]->CalcNoOfFitBins(); // needed to update fStartTimeBin, fEndTimeBin
|
||||
}
|
||||
for (UInt_t i=0; i<fRunAsymmetryList.size(); i++) {
|
||||
fRunAsymmetryList[i]->SetFitRange(fitRange);
|
||||
for (UInt_t i=0; i<fRunAsymmetryRRFList.size(); i++)
|
||||
fRunAsymmetryList[i]->CalcNoOfFitBins(); // needed to update fStartTimeBin, fEndTimeBin
|
||||
}
|
||||
for (UInt_t i=0; i<fRunAsymmetryRRFList.size(); i++) {
|
||||
fRunAsymmetryRRFList[i]->SetFitRange(fitRange);
|
||||
for (UInt_t i=0; i<fRunAsymmetryBNMRList.size(); i++)
|
||||
fRunAsymmetryRRFList[i]->CalcNoOfFitBins(); // needed to update fStartTimeBin, fEndTimeBin
|
||||
}
|
||||
for (UInt_t i=0; i<fRunAsymmetryBNMRList.size(); i++) {
|
||||
fRunAsymmetryBNMRList[i]->SetFitRange(fitRange);
|
||||
for (UInt_t i=0; i<fRunMuMinusList.size(); i++)
|
||||
fRunAsymmetryBNMRList[i]->CalcNoOfFitBins(); // needed to update fStartTimeBin, fEndTimeBin
|
||||
}
|
||||
for (UInt_t i=0; i<fRunMuMinusList.size(); i++) {
|
||||
fRunMuMinusList[i]->SetFitRange(fitRange);
|
||||
fRunMuMinusList[i]->CalcNoOfFitBins(); // needed to update fStartTimeBin, fEndTimeBin
|
||||
}
|
||||
for (UInt_t i=0; i<fRunNonMusrList.size(); i++)
|
||||
fRunNonMusrList[i]->SetFitRange(fitRange);
|
||||
}
|
||||
|
@ -382,7 +382,7 @@ void PRunMuMinus::SetFitRangeBin(const TString fitRange)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// CalcNoOfFitBins (private)
|
||||
// CalcNoOfFitBins (public)
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the number of fitted bins for the current fit range.
|
||||
|
@ -659,7 +659,7 @@ void PRunSingleHisto::SetFitRangeBin(const TString fitRange)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// CalcNoOfFitBins (protected)
|
||||
// CalcNoOfFitBins (public)
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the number of fitted bins for the current fit range.
|
||||
|
@ -388,7 +388,7 @@ void PRunSingleHistoRRF::SetFitRangeBin(const TString fitRange)
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// CalcNoOfFitBins (protected)
|
||||
// CalcNoOfFitBins (public)
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Calculate the number of fitted bins for the current fit range.
|
||||
|
@ -74,13 +74,14 @@ class PSectorChisq
|
||||
public:
|
||||
PSectorChisq(UInt_t noOfRuns);
|
||||
|
||||
void SetTimeRange(Double_t first, Double_t last);
|
||||
void SetRunFirstTime(Double_t first, UInt_t idx);
|
||||
void SetSectorTime(Double_t last) { fLast = last; }
|
||||
void SetChisq(Double_t chisq) { fChisq = chisq; }
|
||||
void SetChisq(Double_t chisq, UInt_t idx);
|
||||
void SetNDF(Double_t ndf) { fNDF = ndf; }
|
||||
void SetNDF(Double_t ndf, UInt_t idx);
|
||||
|
||||
Double_t GetTimeRangeFirst() { return fFirst; }
|
||||
Double_t GetTimeRangeFirst(UInt_t idx);
|
||||
Double_t GetTimeRangeLast() { return fLast; }
|
||||
Double_t GetChisq() { return fChisq; }
|
||||
UInt_t GetNDF() { return fNDF; }
|
||||
@ -90,10 +91,10 @@ class PSectorChisq
|
||||
|
||||
private:
|
||||
UInt_t fNoOfRuns; ///< number of runs presesent
|
||||
Double_t fFirst; ///< time stamp for fgb
|
||||
Double_t fLast; ///< requested time stamp
|
||||
Double_t fChisq; ///< chisq or maxLH for the sector
|
||||
UInt_t fNDF; ///< NDF for the sector
|
||||
std::vector<Double_t> fFirst; ///< time stamp for fgb for a given run
|
||||
std::vector<Double_t> fChisqRun; ///< chisq or maxLH for the sector and run
|
||||
std::vector<UInt_t> fNDFRun; ///< NDF for the sector and run
|
||||
};
|
||||
@ -151,6 +152,7 @@ class PFitter
|
||||
|
||||
PStringVector fElapsedTime;
|
||||
|
||||
Bool_t fSectorFlag; ///< sector command present flag
|
||||
std::vector<PSectorChisq> fSector; ///< stores all chisq/maxLH sector information
|
||||
|
||||
// commands
|
||||
@ -171,6 +173,7 @@ class PFitter
|
||||
Bool_t ExecuteScan();
|
||||
Bool_t ExecuteSave(Bool_t first);
|
||||
Bool_t ExecuteSimplex();
|
||||
void PrepareSector();
|
||||
Bool_t ExecuteSector();
|
||||
|
||||
Double_t MilliTime();
|
||||
|
@ -68,6 +68,8 @@ class PMsrHandler
|
||||
|
||||
virtual TString* GetMsrFileDirectoryPath() { return &fMsrFileDirectoryPath; }
|
||||
|
||||
virtual UInt_t GetNoOfRuns() { return fRuns.size(); }
|
||||
|
||||
virtual UInt_t GetNoOfParams() { return fParam.size(); }
|
||||
virtual const TString& GetFileName() const { return fFileName; }
|
||||
|
||||
|
@ -56,8 +56,9 @@ class PRunAsymmetry : public PRunBase
|
||||
virtual Int_t GetEndTimeBin() { return fEndTimeBin; }
|
||||
virtual Int_t GetPacking() { return fPacking; }
|
||||
|
||||
protected:
|
||||
virtual void CalcNoOfFitBins();
|
||||
|
||||
protected:
|
||||
virtual Bool_t PrepareData();
|
||||
virtual Bool_t PrepareFitData();
|
||||
virtual Bool_t PrepareViewData(PRawRunData* runData, UInt_t histoNo[2]);
|
||||
|
@ -57,8 +57,9 @@ class PRunAsymmetryBNMR : public PRunBase
|
||||
virtual Int_t GetEndTimeBin() { return fEndTimeBin; }
|
||||
virtual Int_t GetPacking() { return fPacking; }
|
||||
|
||||
protected:
|
||||
virtual void CalcNoOfFitBins();
|
||||
|
||||
protected:
|
||||
virtual Bool_t PrepareData();
|
||||
virtual Bool_t PrepareFitData();
|
||||
virtual Bool_t PrepareViewData(PRawRunData* runData, UInt_t histoNo[2]);
|
||||
|
@ -55,8 +55,9 @@ class PRunAsymmetryRRF : public PRunBase
|
||||
virtual Int_t GetStartTimeBin() { return fStartTimeBin; }
|
||||
virtual Int_t GetEndTimeBin() { return fEndTimeBin; }
|
||||
|
||||
protected:
|
||||
virtual void CalcNoOfFitBins();
|
||||
|
||||
protected:
|
||||
virtual Bool_t PrepareData();
|
||||
virtual Bool_t PrepareFitData();
|
||||
virtual Bool_t PrepareViewData(PRawRunData* runData, UInt_t histoNo[2]);
|
||||
|
@ -55,8 +55,9 @@ class PRunMuMinus : public PRunBase
|
||||
virtual Int_t GetEndTimeBin() { return fEndTimeBin; }
|
||||
virtual Int_t GetPacking() { return fPacking; }
|
||||
|
||||
protected:
|
||||
virtual void CalcNoOfFitBins();
|
||||
|
||||
protected:
|
||||
virtual Bool_t PrepareData();
|
||||
virtual Bool_t PrepareFitData(PRawRunData* runData, const UInt_t histoNo);
|
||||
virtual Bool_t PrepareRawViewData(PRawRunData* runData, const UInt_t histoNo);
|
||||
|
@ -59,8 +59,9 @@ class PRunSingleHisto : public PRunBase
|
||||
virtual Int_t GetPacking() { return fPacking; }
|
||||
virtual Bool_t GetScaleN0AndBkg() { return fScaleN0AndBkg; }
|
||||
|
||||
protected:
|
||||
virtual void CalcNoOfFitBins();
|
||||
|
||||
protected:
|
||||
virtual Bool_t PrepareData();
|
||||
virtual Bool_t PrepareFitData(PRawRunData* runData, const UInt_t histoNo);
|
||||
virtual Bool_t PrepareRawViewData(PRawRunData* runData, const UInt_t histoNo);
|
||||
|
@ -54,8 +54,9 @@ class PRunSingleHistoRRF : public PRunBase
|
||||
virtual Int_t GetStartTimeBin() { return fStartTimeBin; }
|
||||
virtual Int_t GetEndTimeBin() { return fEndTimeBin; }
|
||||
|
||||
protected:
|
||||
virtual void CalcNoOfFitBins();
|
||||
|
||||
protected:
|
||||
virtual Bool_t PrepareData();
|
||||
virtual Bool_t PrepareFitData(PRawRunData* runData, const UInt_t histoNo);
|
||||
virtual Bool_t PrepareViewData(PRawRunData* runData, const UInt_t histoNo);
|
||||
|
Loading…
x
Reference in New Issue
Block a user