DAS  3.0
Das Analysis System
Transformer

Description

Transform a yield onto another observable such as a ratio or a fraction.

Gaussian uncertainties are assumed. Correlations are taken into account and propagated to the new observable using Teddy.

Goal: factorise the filling of the input histogram to the transformation in an observable-agnostic way, hence avoiding multiple executables.

#include <Observable.h>

+ Inheritance diagram for Transformer:

Public Member Functions

virtual ~Transformer ()=default
 
virtual void Transform (const Eigen::VectorXd &) const
 
virtual void RemoveBadInputBins (TH1 *, TH2 *)
 
 Transformer (TUnfoldBinning *, bool=true)
 

Public Attributes

TUnfoldBinning * preBinning
 
TUnfoldBinning * postBinning
 

Static Public Attributes

static Eigen::VectorXd y
 

Static Protected Member Functions

static void AddAxis (TUnfoldBinning *, TUnfoldBinning *, int)
 

Constructor & Destructor Documentation

◆ ~Transformer()

virtual ~Transformer ( )
virtualdefault

Destructor.

◆ Transformer()

Transformer ( TUnfoldBinning *  bng,
bool  clone_binning = true 
)

Constructor.

Note
subnodes are currently not supported
Parameters
bngsource binning
clone_binningflag to clone the original binning in target binning
96  :
97  preBinning(bng), postBinning(new TUnfoldBinning(bng->GetName()))
98 {
99  postBinning->SetTitle(bng->GetTitle());
100 
101  if (!clone_binning) return;
102 
103  int d = bng->GetDistributionDimension();
104  for (int i = 0; i < d; ++i)
106 }

Member Function Documentation

◆ AddAxis()

void AddAxis ( TUnfoldBinning *  preBinning,
TUnfoldBinning *  postBinning,
int  iaxis 
)
staticprotected

Copy the axis of the source binning object into the target binning object.

Parameters
preBinningsource binning
postBinningtarget binning
iaxisaxis index (follow `TUnfoldBinning`'s convention)
88 {
89  TString axisname = preBinning->GetDistributionAxisLabel(iaxis);
90  const TVectorD * binning = preBinning->GetDistributionBinning(iaxis);
91  int nbins = binning->GetNrows()-1;
92  const double * edges = binning->GetMatrixArray();
93  postBinning->AddAxis(axisname, nbins, edges, false, false);
94 }

◆ RemoveBadInputBins()

void RemoveBadInputBins ( TH1 *  h,
TH2 *  cov 
)
virtual

Remove bins with too low coverage for Gaussian hypothesis.

Parameters
hdistribution
covits covariance matrix
123 {
124  for (int i = preBinning->GetStartBin();
125  i < preBinning->GetEndBin(); ++i) {
126  double element = h->GetBinContent(i);
127 
128  // skip empty bins
129  if (element == 0) continue;
130 
131  // avoid two consecutive bins with identical content
132  if (h->GetBinContent(i-1) == h->GetBinContent(i)) {
133  EmptyBin(h,cov,i);
134  continue;
135  }
136 
137  // avoid isolated bins
138  if (h->GetBinContent(i-1) == 0 &&
139  h->GetBinContent(i+1) == 0)
140  EmptyBin(h,cov,i);
141  }
142 }

◆ Transform()

void Transform ( const Eigen::VectorXd &  ) const
virtual

Copies the input distribution by default.

Reimplemented in TestTransformer, and HTnTransformer.

145 {
146  int preOffset = preBinning->GetStartBin()-1,
147  postOffset = postBinning->GetStartBin()-1,
148  nBins = preBinning->GetDistributionNumberOfBins();
149  y.segment(postOffset, nBins) = x.segment(preOffset, nBins);
150 }

Member Data Documentation

◆ postBinning

TUnfoldBinning * postBinning

target binning

◆ preBinning

TUnfoldBinning* preBinning

source binning (either rec or gen level)

◆ y

VectorXd y
static

output vector


The documentation for this class was generated from the following files:
DAS::Unfolding::Transformer::AddAxis
static void AddAxis(TUnfoldBinning *, TUnfoldBinning *, int)
Copy the axis of the source binning object into the target binning object.
Definition: Observable.cc:87
DAS::Unfolding::Transformer::postBinning
TUnfoldBinning * postBinning
target binning
Definition: Observable.h:103
DAS::Unfolding::Transformer::preBinning
TUnfoldBinning * preBinning
source binning (either rec or gen level)
Definition: Observable.h:102
DAS::Unfolding::Transformer::y
static Eigen::VectorXd y
output vector
Definition: Observable.h:100