DAS  3.0
Das Analysis System
DAS::Prefiring::Prefiring Namespace Reference

Functions

double ansatz (double *x, double *p)
 
unique_ptr< TH1 > Copy (const unique_ptr< TH1 > &h, double maxPt)
 

Function Documentation

◆ ansatz()

double DAS::Prefiring::Prefiring::ansatz ( double *  x,
double *  p 
)

NOTE: this analytical is partly arbitrary.

35 {
36  return 0.5*p[0]*(1+erf((log(*x)-log(p[1]))/(p[2])));
37 }

◆ Copy()

unique_ptr<TH1> DAS::Prefiring::Prefiring::Copy ( const unique_ptr< TH1 > &  h,
double  maxPt 
)
40 {
41  vector<double> edges;
42  for (int i = 1; i <= h->GetNbinsX()+1; ++i) {
43  auto edge = h->GetBinLowEdge(i);
44  auto content = h->GetBinContent(i);
45  cout << i << ' ' << edge << ' ' << content << '\n';
46  edges.push_back(edge);
47  }
48  cout << flush;
49  edges.back() = maxPt;
50  cout << edges.back() << endl;
51  auto g = make_unique<TH1D>("g", "", edges.size()-1, edges.data());
52  for (int i = 1; i <= g->GetNbinsX(); ++i) {
53  double content = h->GetBinContent(i),
54  error = h->GetBinError (i);
55  g->SetBinContent(i, content);
56  //error = max(error, 0.2*content);
57  g->SetBinError (i, error );
58  }
59  return g;
60 }
Ntupliser_cfg.p
p
Definition: Ntupliser_cfg.py:358