219 const TUnfoldBinning *inputBins,
const char *regularisationDistribution,
220 const char *regularisationAxisSteering) :
221 TUnfoldSys(hist_A,histmap,kRegModeNone,constraint)
227 TAxis const *genAxis,*detAxis;
244 Error(
"TUnfoldDensity",
245 "Invalid output binning scheme (node is not the root node)");
257 Error(
"TUnfoldDensity",
258 "Invalid input binning scheme (node is not the root node)");
266 if((nOutMappedT!= nOut)&&(nOutMappedF!=nOut)) {
267 Error(
"TUnfoldDensity",
268 "Output binning incompatible number of bins: axis %d binning scheme %d (%d)",
269 nOut,nOutMappedT,nOutMappedF);
276 if((nInputMappedT!= nInput)&&(nInputMappedF!= nInput)) {
277 Error(
"TUnfoldDensity",
278 "Input binning incompatible number of bins:axis %d binning scheme %d (%d) ",
279 nInput,nInputMappedT,nInputMappedF);
283 for (
Int_t ix = 0; ix <= nOut+1; ix++) {
292 (regmode,densityMode,regularisationDistribution,
293 regularisationAxisSteering);
338 if(binSize>0.0) factor /= binSize;
384 const char *axisSteering)
388 distribution,axisSteering);
402 EDensityMode densityMode,
const char *distribution,
const char *axisSteering) {
403 if((!distribution)|| !
TString(distribution).CompareTo(binning->
GetName())) {
426 cout<<
"TUnfoldDensity::RegularizeOneDistribution node="
427 <<binning->
GetName()<<
" "<<regmode<<
" "<<densityMode
428 <<
" "<<(axisSteering ? axisSteering :
"")<<
"\n";
437 Int_t isOptionGiven[8];
440 isOptionGiven[0] |= isOptionGiven[1];
442 isOptionGiven[2] |= isOptionGiven[3];
444 isOptionGiven[4] |= isOptionGiven[5];
446 for(
Int_t i=0;i<7;i++) {
447 isOptionGiven[7] &= ~isOptionGiven[i];
450 if(isOptionGiven[6] & (isOptionGiven[0]|isOptionGiven[2]) ) {
451 Error(
"RegularizeOneDistribution",
452 "axis steering %s is not valid",axisSteering);
455 cout<<
" "<<isOptionGiven[0]
456 <<
" "<<isOptionGiven[1]
457 <<
" "<<isOptionGiven[2]
458 <<
" "<<isOptionGiven[3]
459 <<
" "<<isOptionGiven[4]
460 <<
" "<<isOptionGiven[5]
461 <<
" "<<isOptionGiven[6]
462 <<
" "<<isOptionGiven[7]
465 Info(
"RegularizeOneDistribution",
"regularizing %s regMode=%d"
466 " densityMode=%d axisSteering=%s",
468 axisSteering ? axisSteering :
"");
471 std::vector<Double_t> factor(endBin-startBin);
473 for(
Int_t bin=startBin;bin<endBin;bin++) {
475 if(factor[bin-startBin] !=0.0) nbin++;
478 cout<<
"initial number of bins "<<nbin<<
"\n";
484 for(
Int_t bin=startBin;bin<endBin;bin++) {
485 Int_t uStatus,oStatus;
487 if(uStatus & isOptionGiven[1]) factor[bin-startBin]=0.;
488 if(oStatus & isOptionGiven[3]) factor[bin-startBin]=0.;
489 if(factor[bin-startBin] !=0.0) nbin++;
492 cout<<
"after underflow/overflow bin removal "<<nbin<<
"\n";
498 for(
Int_t bin=startBin;bin<endBin;bin++) {
499 if(factor[bin-startBin]==0.0)
continue;
505 thisRegularisationBinning->
AddBinning(
"size",nRegBins);
508 for(
Int_t direction=0;direction<dimension;direction++) {
511 Int_t directionMask=(1<<direction);
512 if(isOptionGiven[7] & directionMask) {
514 cout<<
"skip direction "<<direction<<
"\n";
519 (isOptionGiven[5] & directionMask) ?
521 (direction,isOptionGiven[0] & directionMask,
522 isOptionGiven[2] & directionMask) : 1.0;
523 for(
Int_t bin=startBin;bin<endBin;bin++) {
525 if(factor[bin-startBin]==0.0)
continue;
530 (bin,direction,&iPrev,&distPrev,&iNext,&distNext,
531 isOptionGiven[6] & directionMask);
533 Error(
"RegularizeOneDistribution",
534 "invalid option %s (isPeriodic) for axis %s"
535 " (has underflow or overflow)",axisSteering,
539 Double_t f0 = -factor[bin-startBin];
541 if(isOptionGiven[4] & directionMask) {
543 f0 *= binDistanceNormalisation/distNext;
544 f1 *= binDistanceNormalisation/distNext;
550 if((f0==0.0)||(
f1==0.0))
continue;
554 std::cout<<
"Added Reg: bin "<<bin<<
" "<<f0
555 <<
" next: "<<iNext<<
" "<<
f1<<
"\n";
559 Double_t f0 = factor[iPrev-startBin];
561 Double_t f2 = factor[iNext-startBin];
562 if(isOptionGiven[4] & directionMask) {
563 if((distPrev<0.)&&(distNext>0.)) {
568 f1 *=
f*(1./distPrev+1./distNext);
576 if((f0==0.0)||(
f1==0.0)||(f2==0.0))
continue;
580 std::cout<<
"Added Reg: prev "<<iPrev<<
" "<<f0
581 <<
" bin: "<<bin<<
" "<<
f1
582 <<
" next: "<<iNext<<
" "<<f2<<
"\n";
650(
const char *histogramName,
const char *histogramTitle,
651 const char *distributionName,
const char *axisSteering,
652 Bool_t useAxisBinning)
const
657 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
682(
const char *histogramName,
const char *histogramTitle,
683 const char *distributionName,
const char *axisSteering,
684 Bool_t useAxisBinning)
const
689 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
693 if(binMap)
delete [] binMap;
714(
const char *histogramName,
const char *histogramTitle,
715 const char *distributionName,
const char *axisSteering,
721 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
728 if(binMap)
delete [] binMap;
750(
const char *histogramName,
const char *bgrSource,
const char *histogramTitle,
751 const char *distributionName,
const char *axisSteering,
Bool_t useAxisBinning,
752 Int_t includeError)
const
757 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
761 if(binMap)
delete [] binMap;
780(
const char *histogramName,
const char *histogramTitle,
781 const char *distributionName,
const char *axisSteering,
782 Bool_t useAxisBinning)
const
787 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
791 if(binMap)
delete [] binMap;
813(
const char *histogramName,
const char *histogramTitle,
814 const char *distributionName,
const char *axisSteering,
819 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
823 if(
r->GetDimension()==1) {
824 TString ematName(histogramName);
825 ematName +=
"_inverseEMAT";
828 (ematName,useAxisBinning,&binMap2D,histogramTitle,
830 if(binMap2D)
delete [] binMap2D;
832 Error(
"GetRhoItotal",
833 "can not return inverse of error matrix for this binning");
841 if(binMap)
delete [] binMap;
864(
const char *histogramName,
const char *histogramTitle,
865 const char *distributionName,
const char *axisSteering,
870 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
874 if(
r->GetDimension()==1) {
875 TString ematName(histogramName);
876 ematName +=
"_inverseEMAT";
879 (ematName,useAxisBinning,&binMap2D,histogramTitle,
881 if(binMap2D)
delete [] binMap2D;
883 Error(
"GetRhoItotal",
884 "can not return inverse of error matrix for this binning");
892 if(binMap)
delete [] binMap;
912(
const char *source,
const char *histogramName,
913 const char *histogramTitle,
const char *distributionName,
914 const char *axisSteering,
Bool_t useAxisBinning) {
918 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
925 if(binMap)
delete [] binMap;
946(
const char *bgrSource,
const char *histogramName,
947 const char *histogramTitle,
const char *distributionName,
948 const char *axisSteering,
Bool_t useAxisBinning) {
952 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
959 if(binMap)
delete [] binMap;
979(
const char *histogramName,
const char *histogramTitle,
980 const char *distributionName,
const char *axisSteering,
Bool_t useAxisBinning)
985 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
992 if(binMap)
delete [] binMap;
1011(
const char *histogramName,
const char *histogramTitle,
1012 const char *distributionName,
const char *axisSteering,
1016 (histogramName,histogramTitle,distributionName,
1017 axisSteering,useAxisBinning);
1019 for(
Int_t i=0;i<=
r->GetNbinsX()+1;i++) {
1023 for(
Int_t j=0;j<=
r->GetNbinsY()+1;j++) {
1029 if((e_i>0.0)&&(e_j>0.0)) {
1030 r->SetBinContent(i,j,e_ij/e_i/e_j);
1032 r->SetBinContent(i,j,0.0);
1036 for(
Int_t i=0;i<=
r->GetNbinsX()+1;i++) {
1037 if(
r->GetBinContent(i,i)>0.0) {
1038 r->SetBinContent(i,i,1.0);
1040 r->SetBinContent(i,i,0.0);
1063(
const char *histogramName,
const char *histogramTitle,
1064 const char *distributionName,
const char *axisSteering,
1070 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
1074 if(binMap)
delete [] binMap;
1094(
const char *bgrSource,
const char *histogramName,
1095 const char *histogramTitle,
const char *distributionName,
1096 const char *axisSteering,
Bool_t useAxisBinning)
1101 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
1105 if(binMap)
delete [] binMap;
1125(
const char *histogramName,
const char *histogramTitle,
1126 const char *distributionName,
const char *axisSteering,
1132 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
1136 if(binMap)
delete [] binMap;
1152(
const char *histogramName,
const char *histogramTitle,
1153 Bool_t useAxisBinning)
const
1157 useAxisBinning,useAxisBinning,histogramTitle);
1177(
const char *histogramName,
const char *histogramTitle,
1178 const char *distributionName,
const char *axisSteering,
1184 (histogramName,useAxisBinning,&binMap,histogramTitle,axisSteering);
1188 if(binMap)
delete [] binMap;
1204(
const char *histogramName,
const char *histogramTitle,
Bool_t useAxisBinning)
1210 "remove invalid scheme of regularisation conditions %d %d",
1217 Warning(
"GetL",
"create flat regularisation conditions scheme");
1221 useAxisBinning,useAxisBinning,histogramTitle);
1242(
const char *histogramName,
const char *histogramTitle)
1250 "remove invalid scheme of regularisation conditions %d %d",
1257 Warning(
"GetLxMinusBias",
"create flat regularisation conditions scheme");
1260 (histogramName,
kFALSE,0,histogramTitle);
1264 if(Ldx_rows[row]<Ldx_rows[row+1]) {
1265 r->SetBinContent(row+1,Ldx_data[Ldx_rows[row]]);
1281(
const char *distributionName)
const
1297(
const char *distributionName)
const
1344 Int_t mode,
const char *distribution,
const char *axisSteering,
1347 typedef std::map<Double_t,Double_t> TauScan_t;
1348 typedef std::map<Double_t,std::pair<Double_t,Double_t> > LCurve_t;
1373 if((tauMin<=0)||(tauMax<=0.0)||(tauMin>=tauMax)) {
1383 Error(
"ScanTau",
"too few input bins, NDF<=0 %d",
GetNdf());
1388 Info(
"ScanTau",
"logtau=-Infinity y=%lf X=%lf Y=%lf",y0,X0,Y0);
1396 Fatal(
"ScanTau",
"problem (missing regularisation?) X=%f Y=%f",
1402 Info(
"ScanTau",
"logtau=%lf y=%lf X=%lf Y=%lf",logTau,
y,
1408 while(((
int)curve.size()<nPoint-1)&&
1416 Info(
"ScanTay",
"logtau=%lf y=%lf X=%lf Y=%lf",logTau,
y,
1428 Info(
"ScanTau",
"logtau=%lf y=%lf X=%lf Y=%lf",logTauMax,
y,
1436 Info(
"ScanTau",
"logtau=%lf y=%lf X=%lf Y=%lf",logTauMin,
y,
1443 while((
int)curve.size()<nPoint-1) {
1449 TauScan_t::const_iterator i0,i1;
1454 for (; i0 != curve.end(); ++i0) {
1455 if((*i0).second<yMin) {
1457 logTauYMin=(*i0).first;
1466 for (++i1; i1 != curve.end(); ++i1) {
1471 +0.25*
TMath::Power(0.5*((*i0).first+(*i1).first)-logTauYMin,2.)/
1472 ((*curve.rbegin()).
first-(*curve.begin()).
first)/nPoint;
1475 logTau=0.5*((*i0).first+(*i1).first);
1483 Info(
"ScanTau",
"logtau=%lf y=%lf X=%lf Y=%lf",logTau,
y,
1498 for (TauScan_t::const_iterator i = curve.begin(); i != curve.end(); ++i) {
1515 for(
Int_t i=iskip;i<
n-1-iskip;i++) {
1538 xx = m_p_half + discr;
1540 xx = m_p_half - discr;
1544 if((xx>0.0)&&(xx<dx)) {
1558 if((xx>0.0)&&(xx<dx)) {
1582 Info(
"ScanTau",
"Result logtau=%lf y=%lf X=%lf Y=%lf",logTauFin,
y,
1589 Int_t bestChoice=-1;
1590 if(curve.size()>0) {
1594 for (TauScan_t::const_iterator i = curve.begin(); i != curve.end(); ++i) {
1595 if(logTauFin==(*i).first) {
1605 if(distribution)
name+= distribution;
1607 if(axisSteering)
name += axisSteering;
1619 for (LCurve_t::const_iterator i = lcurve.begin(); i != lcurve.end(); ++i) {
1621 x[
n]=(*i).second.first;
1622 y[
n]=(*i).second.second;
1628 (*lCurvePlot)->SetTitle(
"L curve");
1631 *logTauXPlot=
new TSpline3(
"log(chi**2)%log(tau)",logT,
x,
n);
1633 *logTauYPlot=
new TSpline3(
"log(reg.cond)%log(tau)",logT,
y,
n);
1667(
Int_t mode,
const char *distribution,
const char *axisSteering)
1672 if(distribution)
name += distribution;
1674 if(axisSteering)
name += axisSteering;
1692 if(
c>rhoMax) rhoMax=
c;
1709 Fatal(
"GetScanVariable",
"mode %d not implemented",mode);
Class to manage histogram axis.
A TGraph is an object made of two arrays X and Y with npoints each.
TAxis * GetXaxis()
Get the behaviour adopted by the object about the statoverflows. See EStatOverflows for more informat...
virtual Int_t GetNbinsX() const
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
Service class for 2-Dim histogram classes.
virtual const Int_t * GetRowIndexArray() const
virtual const Element * GetMatrixArray() const
virtual const char * GetName() const
Returns name of object.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
Class to create third splines to interpolate knots Arbitrary conditions can be introduced for first a...
Double_t Eval(Double_t x) const
Eval this spline at x.
void GetCoeff(Int_t i, Double_t &x, Double_t &y, Double_t &b, Double_t &c, Double_t &d)
Base class for spline implementation containing the Draw/Paint methods.
const char * Data() const
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Binning schemes for use with the unfolding algorithm TUnfoldDensity.
Int_t GetTH1xNumberOfBins(Bool_t originalAxisBinning=kTRUE, const char *axisSteering=0) const
Return the number of histogram bins required when storing this binning in a one-dimensional histogram...
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.
Int_t GetDistributionDimension(void) const
query dimension of this node's distribution
TString GetBinName(Int_t iBin) const
Get the name of a bin.
Double_t GetBinSize(Int_t iBin) const
Get N-dimensional bin size.
Int_t GetDistributionNumberOfBins(void) const
number of bins in the distribution possibly including under/overflow
virtual Double_t GetBinFactor(Int_t iBin) const
Return scaling factor for the given global bin number.
Int_t GetEndBin(void) const
last+1 bin of this node (includes children)
TUnfoldBinning const * GetNextNode(void) const
next sister node
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...
TUnfoldBinning const * GetParentNode(void) const
mother node
void GetBinUnderflowOverflowStatus(Int_t iBin, Int_t *uStatus, Int_t *oStatus) const
Return bit maps indicating underflow and overflow status.
virtual Double_t GetDistributionAverageBinSize(Int_t axis, Bool_t includeUnderflow, Bool_t includeOverflow) const
Get average bin size on the specified axis.
void DecodeAxisSteering(const char *axisSteering, const char *options, Int_t *isOptionGiven) const
Decode axis steering.
TString GetDistributionAxisLabel(Int_t axis) const
get name of an axis
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.
TUnfoldBinning * AddBinning(TUnfoldBinning *binning)
Add a TUnfoldBinning as the last child of this node.
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 GetStartBin(void) const
first bin of this node
TUnfoldBinning const * FindNode(char const *name) const
Traverse the tree and return the first node which matches the given name.
TUnfoldBinning const * GetChildNode(void) const
first daughter node
An algorithm to unfold distributions from detector to truth level.
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 RegularizeOneDistribution(const TUnfoldBinning *binning, ERegMode regmode, EDensityMode densityMode, const char *axisSteering)
Regularize the distribution of the given node.
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.
@ kEScanTauRhoAvg
average global correlation coefficient (from TUnfold::GetRhoI())
@ kEScanTauRhoMax
maximum global correlation coefficient (from TUnfold::GetRhoI())
@ kEScanTauRhoSquareAvgSys
average global correlation coefficient squared (from TUnfoldSys::GetRhoItotal())
@ kEScanTauRhoMaxSys
maximum global correlation coefficient (from TUnfoldSys::GetRhoItotal())
@ kEScanTauRhoSquareAvg
average global correlation coefficient squared (from TUnfold::GetRhoI())
@ kEScanTauRhoAvgSys
average global correlation coefficient (from TUnfoldSys::GetRhoItotal())
TH2 * GetL(const char *histogramName, const char *histogramTitle=0, Bool_t useAxisBinning=kTRUE)
Access matrix of regularisation conditions in a new histogram.
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).
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.
virtual ~TUnfoldDensity(void)
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...
const TUnfoldBinning * fConstOutputBins
binning scheme for the output (truth level)
virtual TString GetOutputBinName(Int_t iBinX) const
Get bin name of an output bin.
TUnfoldBinning * fRegularisationConditions
binning scheme for the regularisation conditions
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.
TH2 * GetProbabilityMatrix(const char *histogramName, const char *histogramTitle=0, Bool_t useAxisBinning=kTRUE) const
Get matrix of probabilities in a new histogram.
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.
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.
TUnfoldBinning * fOwnedOutputBins
pointer to output binning scheme if owned by this class
TUnfoldBinning * fOwnedInputBins
pointer to input binning scheme if owned by this class
void RegularizeDistribution(ERegMode regmode, EDensityMode densityMode, const char *distribution, const char *axisSteering)
Set up regularisation conditions.
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.
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.
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.
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.
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
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 * fConstInputBins
binning scheme for the input (detector level)
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.
TUnfoldDensity(void)
Only for use by root streamer or derived classes.
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.
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.
const TUnfoldBinning * GetInputBinning(const char *distributionName=0) const
Locate a binning node for the input (measured) quantities.
virtual Double_t GetScanVariable(Int_t mode, const char *distribution, const char *projectionMode)
Calculate the function for ScanTau().
EDensityMode
choice of regularisation scale factors to cinstruct the matrix L
@ kDensityModeUser
scale factors from user function in TUnfoldBinning
@ kDensityModeBinWidthAndUser
scale factors from multidimensional bin width and user function
@ kDensityModeBinWidth
scale factors from multidimensional bin width
An algorithm to unfold distributions from detector to truth level, with background subtraction and pr...
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.
Bool_t GetDeltaSysSource(TH1 *hist_delta, const char *source, const Int_t *binMap=0)
Correlated one-sigma shifts correspinding to a given systematic uncertainty.
void GetEmatrixInput(TH2 *ematrix, const Int_t *binMap=0, Bool_t clearEmat=kTRUE)
Covariance matrix contribution from input measurement uncertainties.
Bool_t GetDeltaSysBackgroundScale(TH1 *delta, const char *source, const Int_t *binMap=0)
Correlated one-sigma shifts from background normalisation uncertainty.
Bool_t GetDeltaSysTau(TH1 *delta, const Int_t *binMap=0)
Correlated one-sigma shifts from shifting tau.
void GetRhoItotal(TH1 *rhoi, const Int_t *binMap=0, TH2 *invEmat=0)
Get global correlatiocn coefficients, summing up all contributions.
void GetEmatrixSysUncorr(TH2 *ematrix, const Int_t *binMap=0, Bool_t clearEmat=kTRUE)
Covariance contribution from uncorrelated uncertainties of the response matrix.
void GetEmatrixTotal(TH2 *ematrix, const Int_t *binMap=0)
Get total error matrix, summing up all contributions.
void GetEmatrixSysBackgroundUncorr(TH2 *ematrix, const char *source, const Int_t *binMap=0, Bool_t clearEmat=kTRUE)
Covariance contribution from background uncorrelated uncertainty.
TArrayI fHistToX
mapping of histogram bins to matrix indices
void GetBias(TH1 *bias, const Int_t *binMap=0) const
Get bias vector including bias scale.
virtual Double_t GetLcurveY(void) const
Get value on y-axis of L-curve determined in recent unfolding.
TMatrixDSparse * MultiplyMSparseM(const TMatrixDSparse *a, const TMatrixD *b) const
Multiply sparse matrix and a non-sparse matrix.
virtual Double_t DoUnfold(void)
Core unfolding algorithm.
TMatrixD * fX0
bias vector x0
void GetProbabilityMatrix(TH2 *A, EHistMap histmap) const
Get matrix of probabilities.
virtual TString GetOutputBinName(Int_t iBinX) const
Get bin name of an output bin.
Double_t fBiasScale
scale factor for the bias
Bool_t AddRegularisationCondition(Int_t i0, Double_t f0, Int_t i1=-1, Double_t f1=0., Int_t i2=-1, Double_t f2=0.)
Add a row of regularisation conditions to the matrix L.
void GetL(TH2 *l) const
Get matrix of regularisation conditions.
const TMatrixD * GetX(void) const
vector of the unfolding result
EConstraint
type of extra constraint
virtual Double_t GetLcurveX(void) const
Get value on x-axis of L-curve determined in recent unfolding.
ERegMode
choice of regularisation scheme
@ kRegModeNone
no regularisation, or defined later by RegularizeXXX() methods
@ kRegModeDerivative
regularize the 1st derivative of the output distribution
@ kRegModeSize
regularise the amplitude of the output distribution
@ kRegModeCurvature
regularize the 2nd derivative of the output distribution
void GetInput(TH1 *inputData, const Int_t *binMap=0) const
Input vector of measurements.
Double_t GetRhoI(TH1 *rhoi, const Int_t *binMap=0, TH2 *invEmat=0) const
Get global correlation coefficients, possibly cumulated over several bins.
void GetOutput(TH1 *output, const Int_t *binMap=0) const
Get output distribution, possibly cumulated over several bins.
EHistMap
arrangement of axes for the response matrix (TH2 histogram)
@ kHistMapOutputHoriz
truth level on x-axis of the response matrix
Double_t GetChi2A(void) const
get χ2A contribution determined in recent unfolding
void GetFoldedOutput(TH1 *folded, const Int_t *binMap=0) const
Get unfolding result on detector level.
TMatrixDSparse * fL
regularisation conditions L
Int_t GetNdf(void) const
get number of degrees of freedom determined in recent unfolding
double dist(Rotation3D const &r1, Rotation3D const &r2)
Int_t Finite(Double_t x)
Check if it is finite with a mask in order to be consistent in presence of fast math.
Double_t Sqrt(Double_t x)
LongDouble_t Power(LongDouble_t x, LongDouble_t y)
Double_t Log10(Double_t x)
static long int sum(long int i)