|
DAS
3.0
Das Analysis System
|
Go to the documentation of this file.
20 Eigen::VectorXd
identity (
const Eigen::VectorXd& x);
42 static Eigen::VectorXd
H2V (
const std::unique_ptr<TH1D>&);
43 static Eigen::MatrixXd
H2M (
const std::unique_ptr<TH2D>&);
47 static int GuessOutDim (
int, std::function<Eigen::VectorXd(
const Eigen::VectorXd&)>);
51 static void SanityCheck (
const Eigen::VectorXd&, Eigen::VectorXd&,
double = 0);
53 const Eigen::VectorXd
vec;
54 const Eigen::MatrixXd
cov;
68 std::function<Eigen::VectorXd(
const Eigen::VectorXd &)>
func;
80 (
const Eigen::VectorXd&,
81 const Eigen::MatrixXd&,
82 std::function<Eigen::VectorXd(
const Eigen::VectorXd &)> =
identity,
90 (
const std::unique_ptr<TH1D>&,
91 const std::unique_ptr<TH2D>&,
92 std::function<Eigen::VectorXd(
const Eigen::VectorXd &)> =
identity,
97 std::pair<Eigen::VectorXd, Eigen::MatrixXd>
buy ()
const;
103 template<
typename... Args>
104 std::pair<std::unique_ptr<TH1D>,std::unique_ptr<TH2D>>
buy
108 using namespace Eigen;
110 TAxis * axis =
new TAxis(
args...);
111 int ndiv = axis->GetNbins();
112 double * edges =
new double[ndiv];
113 axis->GetLowEdge(edges);
114 edges[ndiv-1] = axis->GetBinUpEdge(ndiv);
115 auto h = make_unique<TH1D>(
name ,
name, ndiv-1, edges);
116 auto cov = make_unique<TH2D>(
name +
"_cov",
name, ndiv-1, edges, ndiv-1, edges);
123 double content = x(i),
124 error = sqrt(err(i,i));
126 h->SetBinContent(i+1, content);
127 h->SetBinError (i+1, error );
130 cov->SetBinContent(i+1,j+1, err(i,j));
133 return make_pair<unique_ptr<TH1D>,unique_ptr<TH2D>>(move(h),move(
cov));
name
Definition: DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.py:48
static bool verbose
Definition: Teddy.h:74
const Eigen::MatrixXd cov
covariance matrix
Definition: Teddy.h:54
Definition: applyBTagSF.cc:31
std::function< Eigen::VectorXd(const Eigen::VectorXd &)> func
transformation defining output as a function of the input
Definition: Teddy.h:68
args
Definition: Ntupliser_cfg.py:11
static void SanityCheck(const Eigen::VectorXd &, Eigen::VectorXd &, double=0)
Check the number of negative eigenvalues and fail if any is found.
Definition: Teddy.cc:54
std::pair< std::unique_ptr< TH1D >, std::unique_ptr< TH2D > > buy(TString name, Args... args) const
Definition: Teddy.h:105
TRandom3 random
random generator
Definition: Teddy.h:70
const Eigen::VectorXd vec
distribution
Definition: Teddy.h:53
Eigen::VectorXd sum
sum of events, increased at each call and from which output distribution is estimated
Definition: Teddy.h:65
long long N
number of calls
Definition: Teddy.h:58
const int nNewBins
number of bins of output distributions
Definition: Teddy.h:57
std::pair< Eigen::VectorXd, Eigen::MatrixXd > buy() const
Get output distributions, can be called several times.
Definition: Teddy.cc:153
static int GuessOutDim(int, std::function< Eigen::VectorXd(const Eigen::VectorXd &)>)
Guess size of the output distribution by calling once the function with dummy input.
Definition: Teddy.cc:46
Eigen::MatrixXd sum2
sum of tensor products of each event, increased at each call and from which output covariance is esti...
Definition: Teddy.h:66
Eigen::VectorXd sigma
Gaussian widths in diagonal base.
Definition: Teddy.h:63
double identity(double x)
Definition: Greta.h:23
const int nOldBins
number of bins of input distributions
Definition: Teddy.h:56
static Eigen::MatrixXd H2M(const std::unique_ptr< TH2D > &)
conversion from (2D) histogram to matrix
Definition: Teddy.cc:34
Eigen::VectorXd eigVals
eigenvalues of input covariance matrix
Definition: Teddy.h:60
static Eigen::VectorXd H2V(const std::unique_ptr< TH1D > &)
conversion from (1D) histogram to vector
Definition: Teddy.cc:25
Teddy(const Eigen::VectorXd &, const Eigen::MatrixXd &, std::function< Eigen::VectorXd(const Eigen::VectorXd &)>=identity, int=42)
Teddy(const std::unique_ptr< TH1D > &, const std::unique_ptr< TH2D > &, std::function< Eigen::VectorXd(const Eigen::VectorXd &)>=identity, int=42)
void play()
Needs to be called from a loop, but requires no argument.
Definition: Teddy.cc:130
Eigen::MatrixXd rotation
rotation from diagonal basis to original basis
Definition: Teddy.h:61