166 TUnfoldDensity::~TUnfoldDensity(
void)
169 if(fOwnedOutputBins)
delete fOwnedOutputBins;
170 if(fOwnedInputBins)
delete fOwnedInputBins;
171 if(fRegularisationConditions)
delete fRegularisationConditions;
183 fRegularisationConditions=0;
220 const TUnfoldBinning *inputBins,
const char *regularisationDistribution,
221 const char *regularisationAxisSteering) :
222 TUnfoldSys(hist_A,histmap,kRegModeNone,constraint)
224 fRegularisationConditions=0;
226 fConstOutputBins = outputBins;
227 fOwnedOutputBins = 0;
228 TAxis const *genAxis,*detAxis;
229 if(histmap==kHistMapOutputHoriz) {
236 if(!fConstOutputBins) {
241 fConstOutputBins = fOwnedOutputBins;
244 if(fConstOutputBins->GetParentNode()) {
245 Error(
"TUnfoldDensity",
246 "Invalid output binning scheme (node is not the root node)");
248 fConstInputBins = inputBins;
250 if(!fConstInputBins) {
255 fConstInputBins = fOwnedInputBins;
257 if(fConstInputBins->GetParentNode()) {
258 Error(
"TUnfoldDensity",
259 "Invalid input binning scheme (node is not the root node)");
267 if((nOutMappedT!= nOut)&&(nOutMappedF!=nOut)) {
268 Error(
"TUnfoldDensity",
269 "Output binning incompatible number of bins: axis %d binning scheme %d (%d)",
270 nOut,nOutMappedT,nOutMappedF);
277 if((nInputMappedT!= nInput)&&(nInputMappedF!= nInput)) {
278 Error(
"TUnfoldDensity",
279 "Input binning incompatible number of bins:axis %d binning scheme %d (%d) ",
280 nInput,nInputMappedT,nInputMappedF);
284 for (
Int_t ix = 0; ix <= nOut+1; ix++) {
286 Info(
"TUnfold",
"*NOT* unfolding bin %s",(
char const *)GetOutputBinName(ix));
291 if(regmode !=kRegModeNone) {
292 RegularizeDistribution
293 (regmode,densityMode,regularisationDistribution,
294 regularisationAxisSteering);
309 else return fConstOutputBins->GetBinName(iBinX);
336 if((densityMode == kDensityModeBinWidth)||
337 (densityMode == kDensityModeBinWidthAndUser)) {
338 Double_t binSize=fConstOutputBins->GetBinSize(iBin);
339 if(binSize>0.0) factor /= binSize;
342 if((densityMode == kDensityModeUser)||
343 (densityMode == kDensityModeBinWidthAndUser)) {
344 factor *= fConstOutputBins->GetBinFactor(iBin);
385 const char *axisSteering)
388 RegularizeDistributionRecursive(GetOutputBinning(),regmode,densityMode,
389 distribution,axisSteering);
403 EDensityMode densityMode,
const char *distribution,
const char *axisSteering) {
404 if((!distribution)|| !TString(distribution).CompareTo(binning->
GetName())) {
405 RegularizeOneDistribution(binning,regmode,densityMode,axisSteering);
409 RegularizeDistributionRecursive(child,regmode,densityMode,distribution,
427 cout<<
"TUnfoldDensity::RegularizeOneDistribution node=" 428 <<binning->
GetName()<<
" "<<regmode<<
" "<<densityMode
429 <<
" "<<(axisSteering ? axisSteering :
"")<<
"\n";
431 if(!fRegularisationConditions)
438 Int_t isOptionGiven[8];
441 isOptionGiven[0] |= isOptionGiven[1];
443 isOptionGiven[2] |= isOptionGiven[3];
445 isOptionGiven[4] |= isOptionGiven[5];
447 for(
Int_t i=0;i<7;i++) {
448 isOptionGiven[7] &= ~isOptionGiven[i];
451 if(isOptionGiven[6] & (isOptionGiven[0]|isOptionGiven[2]) ) {
452 Error(
"RegularizeOneDistribution",
453 "axis steering %s is not valid",axisSteering);
456 cout<<
" "<<isOptionGiven[0]
457 <<
" "<<isOptionGiven[1]
458 <<
" "<<isOptionGiven[2]
459 <<
" "<<isOptionGiven[3]
460 <<
" "<<isOptionGiven[4]
461 <<
" "<<isOptionGiven[5]
462 <<
" "<<isOptionGiven[6]
463 <<
" "<<isOptionGiven[7]
466 Info(
"RegularizeOneDistribution",
"regularizing %s regMode=%d" 467 " densityMode=%d axisSteering=%s",
469 axisSteering ? axisSteering :
"");
472 std::vector<Double_t> factor(endBin-startBin);
474 for(
Int_t bin=startBin;bin<endBin;bin++) {
475 factor[bin-startBin]=GetDensityFactor(densityMode,bin);
476 if(factor[bin-startBin] !=0.0) nbin++;
479 cout<<
"initial number of bins "<<nbin<<
"\n";
485 for(
Int_t bin=startBin;bin<endBin;bin++) {
486 Int_t uStatus,oStatus;
488 if(uStatus & isOptionGiven[1]) factor[bin-startBin]=0.;
489 if(oStatus & isOptionGiven[3]) factor[bin-startBin]=0.;
490 if(factor[bin-startBin] !=0.0) nbin++;
493 cout<<
"after underflow/overflow bin removal "<<nbin<<
"\n";
495 if(regmode==kRegModeSize) {
499 for(
Int_t bin=startBin;bin<endBin;bin++) {
500 if(factor[bin-startBin]==0.0)
continue;
501 if(AddRegularisationCondition(bin,factor[bin-startBin])) {
506 thisRegularisationBinning->
AddBinning(
"size",nRegBins);
508 }
else if((regmode==kRegModeDerivative)||(regmode==kRegModeCurvature)) {
509 for(
Int_t direction=0;direction<dimension;direction++) {
512 Int_t directionMask=(1<<direction);
513 if(isOptionGiven[7] & directionMask) {
515 cout<<
"skip direction "<<direction<<
"\n";
520 (isOptionGiven[5] & directionMask) ?
522 (direction,isOptionGiven[0] & directionMask,
523 isOptionGiven[2] & directionMask) : 1.0;
524 for(
Int_t bin=startBin;bin<endBin;bin++) {
526 if(factor[bin-startBin]==0.0)
continue;
531 (bin,direction,&iPrev,&distPrev,&iNext,&distNext,
532 isOptionGiven[6] & directionMask);
534 Error(
"RegularizeOneDistribution",
535 "invalid option %s (isPeriodic) for axis %s" 536 " (has underflow or overflow)",axisSteering,
539 if((regmode==kRegModeDerivative)&&(iNext>=0)) {
540 Double_t f0 = -factor[bin-startBin];
542 if(isOptionGiven[4] & directionMask) {
544 f0 *= binDistanceNormalisation/distNext;
545 f1 *= binDistanceNormalisation/distNext;
551 if((f0==0.0)||(f1==0.0))
continue;
552 if(AddRegularisationCondition(bin,f0,iNext,f1)) {
555 std::cout<<
"Added Reg: bin "<<bin<<
" "<<f0
556 <<
" next: "<<iNext<<
" "<<f1<<
"\n";
559 }
else if((regmode==kRegModeCurvature)&&(iPrev>=0)&&(iNext>=0)) {
560 Double_t f0 = factor[iPrev-startBin];
562 Double_t f2 = factor[iNext-startBin];
563 if(isOptionGiven[4] & directionMask) {
564 if((distPrev<0.)&&(distNext>0.)) {
569 f1 *= f*(1./distPrev+1./distNext);
577 if((f0==0.0)||(f1==0.0)||(f2==0.0))
continue;
578 if(AddRegularisationCondition(iPrev,f0,bin,f1,iNext,f2)) {
581 std::cout<<
"Added Reg: prev "<<iPrev<<
" "<<f0
582 <<
" bin: "<<bin<<
" "<<f1
583 <<
" next: "<<iNext<<
" "<<f2<<
"\n";
590 if(regmode==kRegModeDerivative) {
592 }
else if(regmode==kRegModeCurvature) {
596 thisRegularisationBinning->
AddBinning(name,nRegBins);
651 (
const char *histogramName,
const char *histogramTitle,
652 const char *distributionName,
const char *axisSteering,
653 Bool_t useAxisBinning)
const 658 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
683 (
const char *histogramName,
const char *histogramTitle,
684 const char *distributionName,
const char *axisSteering,
685 Bool_t useAxisBinning)
const 690 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
694 if(binMap)
delete [] binMap;
715 (
const char *histogramName,
const char *histogramTitle,
716 const char *distributionName,
const char *axisSteering,
722 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
729 if(binMap)
delete [] binMap;
751 (
const char *histogramName,
const char *bgrSource,
const char *histogramTitle,
752 const char *distributionName,
const char *axisSteering,
Bool_t useAxisBinning,
753 Int_t includeError)
const 758 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
762 if(binMap)
delete [] binMap;
781 (
const char *histogramName,
const char *histogramTitle,
782 const char *distributionName,
const char *axisSteering,
783 Bool_t useAxisBinning)
const 788 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
792 if(binMap)
delete [] binMap;
814 (
const char *histogramName,
const char *histogramTitle,
815 const char *distributionName,
const char *axisSteering,
820 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
825 TString ematName(histogramName);
826 ematName +=
"_inverseEMAT";
829 (ematName,useAxisBinning,&binMap2D,histogramTitle,
831 if(binMap2D)
delete [] binMap2D;
833 Error(
"GetRhoItotal",
834 "can not return inverse of error matrix for this binning");
842 if(binMap)
delete [] binMap;
865 (
const char *histogramName,
const char *histogramTitle,
866 const char *distributionName,
const char *axisSteering,
871 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
876 TString ematName(histogramName);
877 ematName +=
"_inverseEMAT";
880 (ematName,useAxisBinning,&binMap2D,histogramTitle,
882 if(binMap2D)
delete [] binMap2D;
884 Error(
"GetRhoItotal",
885 "can not return inverse of error matrix for this binning");
893 if(binMap)
delete [] binMap;
913 (
const char *source,
const char *histogramName,
914 const char *histogramTitle,
const char *distributionName,
915 const char *axisSteering,
Bool_t useAxisBinning) {
919 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
926 if(binMap)
delete [] binMap;
947 (
const char *bgrSource,
const char *histogramName,
948 const char *histogramTitle,
const char *distributionName,
949 const char *axisSteering,
Bool_t useAxisBinning) {
953 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
960 if(binMap)
delete [] binMap;
980 (
const char *histogramName,
const char *histogramTitle,
981 const char *distributionName,
const char *axisSteering,
Bool_t useAxisBinning)
986 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
993 if(binMap)
delete [] binMap;
1012 (
const char *histogramName,
const char *histogramTitle,
1013 const char *distributionName,
const char *axisSteering,
1016 TH2 *
r=GetEmatrixTotal
1017 (histogramName,histogramTitle,distributionName,
1018 axisSteering,useAxisBinning);
1030 if((e_i>0.0)&&(e_j>0.0)) {
1064 (
const char *histogramName,
const char *histogramTitle,
1065 const char *distributionName,
const char *axisSteering,
1071 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
1075 if(binMap)
delete [] binMap;
1095 (
const char *bgrSource,
const char *histogramName,
1096 const char *histogramTitle,
const char *distributionName,
1097 const char *axisSteering,
Bool_t useAxisBinning)
1102 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
1106 if(binMap)
delete [] binMap;
1126 (
const char *histogramName,
const char *histogramTitle,
1127 const char *distributionName,
const char *axisSteering,
1133 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
1137 if(binMap)
delete [] binMap;
1153 (
const char *histogramName,
const char *histogramTitle,
1154 Bool_t useAxisBinning)
const 1157 (fConstOutputBins,fConstInputBins,histogramName,
1158 useAxisBinning,useAxisBinning,histogramTitle);
1178 (
const char *histogramName,
const char *histogramTitle,
1179 const char *distributionName,
const char *axisSteering,
1185 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
1189 if(binMap)
delete [] binMap;
1205 (
const char *histogramName,
const char *histogramTitle,
Bool_t useAxisBinning)
1207 if(fRegularisationConditions &&
1208 (fRegularisationConditions->GetEndBin()-
1209 fRegularisationConditions->GetStartBin()!= fL->GetNrows())) {
1211 "remove invalid scheme of regularisation conditions %d %d",
1212 fRegularisationConditions->GetEndBin(),fL->GetNrows());
1213 delete fRegularisationConditions;
1214 fRegularisationConditions=0;
1216 if(!fRegularisationConditions) {
1217 fRegularisationConditions=
new TUnfoldBinning(
"regularisation",fL->GetNrows());
1218 Warning(
"GetL",
"create flat regularisation conditions scheme");
1221 (fConstOutputBins,fRegularisationConditions,histogramName,
1222 useAxisBinning,useAxisBinning,histogramTitle);
1243 (
const char *histogramName,
const char *histogramTitle)
1247 if(fRegularisationConditions &&
1248 (fRegularisationConditions->GetEndBin()-
1249 fRegularisationConditions->GetStartBin()!= fL->GetNrows())) {
1251 "remove invalid scheme of regularisation conditions %d %d",
1252 fRegularisationConditions->GetEndBin(),fL->GetNrows());
1253 delete fRegularisationConditions;
1254 fRegularisationConditions=0;
1256 if(!fRegularisationConditions) {
1257 fRegularisationConditions=
new TUnfoldBinning(
"regularisation",fL->GetNrows());
1258 Warning(
"GetLxMinusBias",
"create flat regularisation conditions scheme");
1260 TH1 *
r=fRegularisationConditions->CreateHistogram
1261 (histogramName,
kFALSE,0,histogramTitle);
1265 if(Ldx_rows[row]<Ldx_rows[row+1]) {
1282 (
const char *distributionName)
const 1286 return fConstInputBins->
FindNode(distributionName);
1298 (
const char *distributionName)
const 1302 return fConstOutputBins->
FindNode(distributionName);
1345 Int_t mode,
const char *distribution,
const char *axisSteering,
1348 typedef std::map<Double_t,Double_t> TauScan_t;
1349 typedef std::map<Double_t,std::pair<Double_t,Double_t> > LCurve_t;
1374 if((tauMin<=0)||(tauMax<=0.0)||(tauMin>=tauMax)) {
1384 Error(
"ScanTau",
"too few input bins, NDF<=0 %d",GetNdf());
1388 Double_t y0=GetScanVariable(mode,distribution,axisSteering);
1389 Info(
"ScanTau",
"logtau=-Infinity y=%lf X=%lf Y=%lf",y0,X0,Y0);
1397 Fatal(
"ScanTau",
"problem (missing regularisation?) X=%f Y=%f",
1398 GetLcurveX(),GetLcurveY());
1400 Double_t y=GetScanVariable(mode,distribution,axisSteering);
1402 lcurve[logTau]=std::make_pair(GetLcurveX(),GetLcurveY());
1403 Info(
"ScanTau",
"logtau=%lf y=%lf X=%lf Y=%lf",logTau,y,
1404 GetLcurveX(),GetLcurveY());
1409 while(((
int)curve.size()<nPoint-1)&&
1414 Double_t y=GetScanVariable(mode,distribution,axisSteering);
1416 lcurve[logTau]=std::make_pair(GetLcurveX(),GetLcurveY());
1417 Info(
"ScanTay",
"logtau=%lf y=%lf X=%lf Y=%lf",logTau,y,
1418 GetLcurveX(),GetLcurveY());
1426 Double_t y=GetScanVariable(mode,distribution,axisSteering);
1428 lcurve[logTauMax]=std::make_pair(GetLcurveX(),GetLcurveY());
1429 Info(
"ScanTau",
"logtau=%lf y=%lf X=%lf Y=%lf",logTauMax,y,
1430 GetLcurveX(),GetLcurveY());
1434 Double_t y=GetScanVariable(mode,distribution,axisSteering);
1436 lcurve[logTauMin]=std::make_pair(GetLcurveX(),GetLcurveY());
1437 Info(
"ScanTau",
"logtau=%lf y=%lf X=%lf Y=%lf",logTauMin,y,
1438 GetLcurveX(),GetLcurveY());
1444 while((
int)curve.size()<nPoint-1) {
1450 TauScan_t::const_iterator i0,i1;
1455 for (; i0 != curve.end(); ++i0) {
1456 if((*i0).second<yMin) {
1458 logTauYMin=(*i0).first;
1467 for (++i1; i1 != curve.end(); ++i1) {
1472 +0.25*
TMath::Power(0.5*((*i0).first+(*i1).first)-logTauYMin,2.)/
1473 ((*curve.rbegin()).
first-(*curve.begin()).
first)/nPoint;
1474 if((dist<=0.0)||(dist>distMax)) {
1476 logTau=0.5*((*i0).first+(*i1).first);
1481 Double_t y=GetScanVariable(mode,distribution,axisSteering);
1483 lcurve[logTau]=std::make_pair(GetLcurveX(),GetLcurveY());
1484 Info(
"ScanTau",
"logtau=%lf y=%lf X=%lf Y=%lf",logTau,y,
1485 GetLcurveX(),GetLcurveY());
1499 for (TauScan_t::const_iterator i = curve.begin(); i != curve.end(); ++i) {
1516 for(
Int_t i=iskip;i<n-1-iskip;i++) {
1539 xx = m_p_half + discr;
1541 xx = m_p_half - discr;
1545 if((xx>0.0)&&(xx<dx)) {
1546 y=splineC->
Eval(x+xx);
1559 if((xx>0.0)&&(xx<dx)) {
1560 y=splineC->
Eval(x+xx);
1580 Double_t y=GetScanVariable(mode,distribution,axisSteering);
1582 lcurve[logTauFin]=std::make_pair(GetLcurveX(),GetLcurveY());
1583 Info(
"ScanTau",
"Result logtau=%lf y=%lf X=%lf Y=%lf",logTauFin,y,
1584 GetLcurveX(),GetLcurveY());
1590 Int_t bestChoice=-1;
1591 if(curve.size()>0) {
1595 for (TauScan_t::const_iterator i = curve.begin(); i != curve.end(); ++i) {
1596 if(logTauFin==(*i).first) {
1606 if(distribution) name+= distribution;
1608 if(axisSteering) name += axisSteering;
1610 (*scanResult)=
new TSpline3(name+
"%log(tau)",logT,y,n);
1620 for (LCurve_t::const_iterator i = lcurve.begin(); i != lcurve.end(); ++i) {
1622 x[
n]=(*i).second.first;
1623 y[
n]=(*i).second.second;
1628 *lCurvePlot=
new TGraph(n,x,y);
1629 (*lCurvePlot)->SetTitle(
"L curve");
1632 *logTauXPlot=
new TSpline3(
"log(chi**2)%log(tau)",logT,x,n);
1634 *logTauYPlot=
new TSpline3(
"log(reg.cond)%log(tau)",logT,y,n);
1668 (
Int_t mode,
const char *distribution,
const char *axisSteering)
1671 TString
name(
"GetScanVariable(");
1673 if(distribution) name += distribution;
1675 if(axisSteering) name += axisSteering;
1678 if((mode==kEScanTauRhoAvg)||(mode==kEScanTauRhoMax)||
1679 (mode==kEScanTauRhoSquareAvg)) {
1680 rhoi=GetRhoIstatbgr(name,0,distribution,axisSteering,
kFALSE);
1681 }
else if((mode==kEScanTauRhoAvgSys)||(mode==kEScanTauRhoMaxSys)||
1682 (mode==kEScanTauRhoSquareAvgSys)) {
1683 rhoi=GetRhoItotal(name,0,distribution,axisSteering,
kFALSE);
1693 if(c>rhoMax) rhoMax=
c;
1699 if((mode==kEScanTauRhoAvg)||(mode==kEScanTauRhoAvgSys)) {
1701 }
else if((mode==kEScanTauRhoSquareAvg)||
1702 (mode==kEScanTauRhoSquareAvgSys)) {
1710 Fatal(
"GetScanVariable",
"mode %d not implemented",mode);
virtual const char * GetName() const
Returns name of object.
virtual const Element * GetMatrixArray() const
TUnfoldBinning const * GetChildNode(void) const
first daughter node
double dist(Rotation3D const &r1, Rotation3D const &r2)
static long int sum(long int i)
TH1 * CreateHistogram(const char *histogramName, Bool_t originalAxisBinning=kFALSE, Int_t **binMap=0, const char *histogramTitle=0, const char *axisSteering=0) const
Create a THxx histogram capable to hold the bins of this binning node and its children.
An algorithm to unfold distributions from detector to truth level.
TH2D * CreateErrorMatrixHistogram(const char *histogramName, Bool_t originalAxisBinning, Int_t **binMap=0, const char *histogramTitle=0, const char *axisSteering=0) const
Create a TH2D histogram capable to hold a covariance matrix.
virtual const Int_t * GetRowIndexArray() const
void Fatal(const char *location, const char *msgfmt,...)
void GetEmatrixInput(TH2 *ematrix, const Int_t *binMap=0, Bool_t clearEmat=kTRUE)
Covariance matrix contribution from input measurement uncertainties.
virtual Double_t GetDistributionAverageBinSize(Int_t axis, Bool_t includeUnderflow, Bool_t includeOverflow) const
Get average bin size on the specified axis.
virtual Int_t ScanTau(Int_t nPoint, Double_t tauMin, Double_t tauMax, TSpline **scanResult, Int_t mode=kEScanTauRhoAvg, const char *distribution=0, const char *projectionMode=0, TGraph **lCurvePlot=0, TSpline **logTauXPlot=0, TSpline **logTauYPlot=0)
Scan a function wrt tau and determine the minimum.
Bool_t GetDeltaSysSource(TH1 *hist_delta, const char *source, const Int_t *binMap=0)
Correlated one-sigma shifts correspinding to a given systematic uncertainty.
TH1 * GetBias(const char *histogramName, const char *histogramTitle=0, const char *distributionName=0, const char *projectionMode=0, Bool_t useAxisBinning=kTRUE) const
Retrieve bias vector as a new histogram.
Base class for spline implementation containing the Draw/Paint methods.
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
An algorithm to unfold distributions from detector to truth level, with background subtraction and pr...
void GetBinUnderflowOverflowStatus(Int_t iBin, Int_t *uStatus, Int_t *oStatus) const
Return bit maps indicating underflow and overflow status.
TH2 * GetEmatrixSysUncorr(const char *histogramName, const char *histogramTitle=0, const char *distributionName=0, const char *projectionMode=0, Bool_t useAxisBinning=kTRUE)
Retrieve covariance contribution from uncorrelated (statistical) uncertainties of the response matrix...
TH1 * GetFoldedOutput(const char *histogramName, const char *histogramTitle=0, const char *distributionName=0, const char *projectionMode=0, Bool_t useAxisBinning=kTRUE, Bool_t addBgr=kFALSE) const
Retrieve unfolding result folded back as a new histogram.
void GetEmatrixSysBackgroundUncorr(TH2 *ematrix, const char *source, const Int_t *binMap=0, Bool_t clearEmat=kTRUE)
Covariance contribution from background uncorrelated uncertainty.
TUnfoldDensity(void)
Only for use by root streamer or derived classes.
EDensityMode
choice of regularisation scale factors to cinstruct the matrix L
TH2 * GetL(const char *histogramName, const char *histogramTitle=0, Bool_t useAxisBinning=kTRUE)
Access matrix of regularisation conditions in a new histogram.
void RegularizeDistribution(ERegMode regmode, EDensityMode densityMode, const char *distribution, const char *axisSteering)
Set up regularisation conditions.
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
TUnfoldBinning const * GetNextNode(void) const
next sister node
Class to create third splines to interpolate knots Arbitrary conditions can be introduced for first a...
Double_t GetRhoI(TH1 *rhoi, const Int_t *binMap=0, TH2 *invEmat=0) const
Get global correlation coefficients, possibly cumulated over several bins.
TH2 * GetEmatrixSysBackgroundUncorr(const char *bgrSource, const char *histogramName, const char *histogramTitle=0, const char *distributionName=0, const char *projectionMode=0, Bool_t useAxisBinning=kTRUE)
Retrieve covariance contribution from uncorrelated background uncertainties.
virtual Int_t GetDimension() const
TH1 * GetLxMinusBias(const char *histogramName, const char *histogramTitle=0)
Get regularisation conditions multiplied by result vector minus bias L(x-biasScale*biasVector).
TH2 * GetEmatrixTotal(const char *histogramName, const char *histogramTitle=0, const char *distributionName=0, const char *projectionMode=0, Bool_t useAxisBinning=kTRUE)
Get covariance matrix including all contributions.
const TUnfoldBinning * GetOutputBinning(const char *distributionName=0) const
Locate a binning node for the unfolded (truth level) quantities.
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString...
void GetEmatrixSysUncorr(TH2 *ematrix, const Int_t *binMap=0, Bool_t clearEmat=kTRUE)
Covariance contribution from uncorrelated uncertainties of the response matrix.
TH1 * GetBackground(const char *histogramName, const char *bgrSource=0, const char *histogramTitle=0, const char *distributionName=0, const char *projectionMode=0, Bool_t useAxisBinning=kTRUE, Int_t includeError=3) const
Retrieve a background source in a new histogram.
EHistMap
arrangement of axes for the response matrix (TH2 histogram)
EConstraint
type of extra constraint
Double_t Log10(Double_t x)
void RegularizeOneDistribution(const TUnfoldBinning *binning, ERegMode regmode, EDensityMode densityMode, const char *axisSteering)
Regularize the distribution of the given node.
void Info(const char *location, const char *msgfmt,...)
Int_t GetBinNeighbours(Int_t globalBin, Int_t axis, Int_t *prev, Double_t *distPrev, Int_t *next, Double_t *distNext, Bool_t isPeriodic=kFALSE) const
Get neighbour bins along the specified axis.
Int_t Finite(Double_t x)
Check if it is finite with a mask in order to be consistent in presence of fast math.
Int_t GetStartBin(void) const
first bin of this node
void Error(const char *location, const char *msgfmt,...)
ERegMode
choice of regularisation scheme
Int_t GetDistributionDimension(void) const
query dimension of this node's distribution
void GetBias(TH1 *bias, const Int_t *binMap=0) const
Get bias vector including bias scale.
void DecodeAxisSteering(const char *axisSteering, const char *options, Int_t *isOptionGiven) const
Decode axis steering.
virtual TString GetOutputBinName(Int_t iBinX) const
Get bin name of an output bin.
Service class for 2-Dim histogram classes.
Class to manage histogram axis.
TH2 * GetRhoIJtotal(const char *histogramName, const char *histogramTitle=0, const char *distributionName=0, const char *projectionMode=0, Bool_t useAxisBinning=kTRUE)
Retrieve correlation coefficients, including all uncertainties.
void GetEmatrixTotal(TH2 *ematrix, const Int_t *binMap=0)
Get total error matrix, summing up all contributions.
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
TH1 * GetInput(const char *histogramName, const char *histogramTitle=0, const char *distributionName=0, const char *projectionMode=0, Bool_t useAxisBinning=kTRUE) const
Retrieve input distribution in a new histogram.
const TUnfoldBinning * GetInputBinning(const char *distributionName=0) const
Locate a binning node for the input (measured) quantities.
Bool_t GetDeltaSysTau(TH1 *delta, const Int_t *binMap=0)
Correlated one-sigma shifts from shifting tau.
TH1 * GetDeltaSysTau(const char *histogramName, const char *histogramTitle=0, const char *distributionName=0, const char *projectionMode=0, Bool_t useAxisBinning=kTRUE)
Retrieve 1-sigma shift corresponding to the previously specified uncertainty on tau.
void Warning(const char *location, const char *msgfmt,...)
void GetBackground(TH1 *bgr, const char *bgrSource=0, const Int_t *binMap=0, Int_t includeError=3, Bool_t clearHist=kTRUE) const
Get background into a histogram.
static TH2D * CreateHistogramOfMigrations(TUnfoldBinning const *xAxis, TUnfoldBinning const *yAxis, char const *histogramName, Bool_t originalXAxisBinning=kFALSE, Bool_t originalYAxisBinning=kFALSE, char const *histogramTitle=0)
Create a TH2D histogram capable to hold the bins of the two input binning schemes on the x and y axes...
TH1 * GetRhoIstatbgr(const char *histogramName, const char *histogramTitle=0, const char *distributionName=0, const char *projectionMode=0, Bool_t useAxisBinning=kTRUE, TH2 **ematInv=0)
Retrieve global correlation coefficients including input (statistical) and background uncertainties...
Binning schemes for use with the unfolding algorithm TUnfoldDensity.
TH1 * GetDeltaSysSource(const char *source, const char *histogramName, const char *histogramTitle=0, const char *distributionName=0, const char *projectionMode=0, Bool_t useAxisBinning=kTRUE)
Retrieve a correlated systematic 1-sigma shift.
TString GetDistributionAxisLabel(Int_t axis) const
get name of an axis
virtual TString GetOutputBinName(Int_t iBinX) const
Get bin name of an output bin.
TH1 * GetOutput(const char *histogramName, const char *histogramTitle=0, const char *distributionName=0, const char *projectionMode=0, Bool_t useAxisBinning=kTRUE) const
retrieve unfolding result as a new histogram
void GetProbabilityMatrix(TH2 *A, EHistMap histmap) const
Get matrix of probabilities.
void GetFoldedOutput(TH1 *folded, const Int_t *binMap=0) const
Get unfolding result on detector level.
void GetInput(TH1 *inputData, const Int_t *binMap=0) const
Input vector of measurements.
Int_t GetDistributionNumberOfBins(void) const
number of bins in the distribution possibly including under/overflow
void GetCoeff(Int_t i, Double_t &x, Double_t &y, Double_t &b, Double_t &c, Double_t &d)
TH1 * GetDeltaSysBackgroundScale(const char *bgrSource, const char *histogramName, const char *histogramTitle=0, const char *distributionName=0, const char *projectionMode=0, Bool_t useAxisBinning=kTRUE)
Retrieve systematic 1-sigma shift corresponding to a background scale uncertainty.
void GetOutput(TH1 *output, const Int_t *binMap=0) const
Get output distribution, possibly cumulated over several bins.
A Graph is a graphics object made of two arrays X and Y with npoints each.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual Double_t GetScanVariable(Int_t mode, const char *distribution, const char *projectionMode)
Calculate the function for ScanTau().
Double_t GetDensityFactor(EDensityMode densityMode, Int_t iBin) const
Density correction factor for a given bin.
TH2 * GetEmatrixInput(const char *histogramName, const char *histogramTitle=0, const char *distributionName=0, const char *projectionMode=0, Bool_t useAxisBinning=kTRUE)
Get covariance contribution from the input uncertainties (data statistical uncertainties).
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
TH1 * GetRhoItotal(const char *histogramName, const char *histogramTitle=0, const char *distributionName=0, const char *projectionMode=0, Bool_t useAxisBinning=kTRUE, TH2 **ematInv=0)
Retrieve global correlation coefficients including all uncertainty sources.
void GetL(TH2 *l) const
Get matrix of regularisation conditions.
virtual Int_t GetNbinsX() const
Double_t Sqrt(Double_t x)
void GetRhoItotal(TH1 *rhoi, const Int_t *binMap=0, TH2 *invEmat=0)
Get global correlatiocn coefficients, summing up all contributions.
Double_t Eval(Double_t x) const
Eval this spline at x.
TUnfoldBinning * AddBinning(TUnfoldBinning *binning)
Add a TUnfoldBinning as the last child of this node.
TUnfoldBinning const * FindNode(char const *name) const
Traverse the tree and return the first node which matches the given name.
TH2 * GetProbabilityMatrix(const char *histogramName, const char *histogramTitle=0, Bool_t useAxisBinning=kTRUE) const
Get matrix of probabilities in a new histogram.
Bool_t GetDeltaSysBackgroundScale(TH1 *delta, const char *source, const Int_t *binMap=0)
Correlated one-sigma shifts from background normalisation uncertainty.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
virtual Int_t GetNbinsY() const
void RegularizeDistributionRecursive(const TUnfoldBinning *binning, ERegMode regmode, EDensityMode densityMode, const char *distribution, const char *axisSteering)
Recursively add regularisation conditions for this node and its children.