83 Log() << kFATAL <<
"COPY CONSTRUCTOR NOT IMPLEMENTED" <<
Endl;
94 std::vector<Float_t> values = ev->
GetValues();
114 if (!(
fCells[iCell]->GetStat()))
121 Log() << kWARNING <<
"Negative number of signal events in cell " << iCell
122 <<
": " << n_sig <<
". Set to 0." <<
Endl;
126 Log() << kWARNING <<
"Negative number of background events in cell " << iCell
127 <<
": " << n_bg <<
". Set to 0." <<
Endl;
132 if (n_sig + n_bg > 0) {
137 Sqr(n_bg /
Sqr(n_sig + n_bg))*n_bg));
173 if ((idim1 >=
GetTotDim()) || (idim1 < 0) ||
176 Log() << kFATAL <<
"<Project2>: wrong dimensions given: "
177 << idim1 <<
", " << idim2 <<
Endl;
183 Log() << kWARNING <<
"Warning: number of bins too big: " << nbin
184 <<
" Using 1000 bins for each dimension instead." <<
Endl;
186 }
else if (nbin < 1) {
187 Log() << kWARNING <<
"Wrong bin number: " << nbin
188 <<
"; set nbin=50" <<
Endl;
200 if (!
h1)
Log() << kFATAL <<
"ERROR: Can not create histo" << hname <<
Endl;
201 if (cell_value == kValue)
202 h1->GetZaxis()->SetRangeUser(-std::numeric_limits<float>::epsilon(),
203 1. + std::numeric_limits<float>::epsilon());
207 for (
Int_t xbin = 1; xbin <=
h1->GetNbinsX(); ++xbin) {
208 for (
Int_t ybin = 1; ybin <=
h1->GetNbinsY(); ++ybin) {
211 std::map<Int_t, Float_t> txvec;
212 txvec[idim1] =
VarTransform(idim1,
h1->GetXaxis()->GetBinCenter(xbin));
213 txvec[idim2] =
VarTransform(idim2,
h1->GetYaxis()->GetBinCenter(ybin));
217 std::vector<TMVA::PDEFoamCell*> cells =
FindCells(txvec);
222 for (std::vector<TMVA::PDEFoamCell*>::const_iterator it = cells.begin();
223 it != cells.end(); ++it) {
226 (*it)->GetHcub(cellPosi, cellSize);
229 std::vector<Float_t> tvec;
231 if (i != idim1 && i != idim2)
232 tvec.push_back(cellPosi[i] + 0.5 * cellSize[i]);
234 tvec.push_back(txvec[i]);
238 if (kernel != NULL) {
239 cv = kernel->
Estimate(
this, tvec, cell_value);
243 if (cell_value == kValue) {
248 if ((d1 != idim1) && (d1 != idim2))
249 area_cell *= cellSize[d1];
259 h1->SetBinContent(xbin, ybin, sum_cv +
h1->GetBinContent(xbin, ybin));
int Int_t
Signed integer 4 bytes (int).
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
double Double_t
Double 8 bytes.
float Float_t
Float 4 bytes (float).
2-D histogram with a double per channel (see TH1 documentation)
std::vector< Float_t > & GetValues()
void Finalize() override
Calc discriminator and its error for every cell and save it to the cell.
PDEFoamDiscriminant(const PDEFoamDiscriminant &)
Copy Constructor NOT IMPLEMENTED (NEVER USED).
void FillFoamCells(const Event *ev, Float_t wt) override
This function fills an event into the discriminant PDEFoam.
TH2D * Project2(Int_t, Int_t, ECellValue, PDEFoamKernelBase *, UInt_t) override
Project foam variable idim1 and variable idim2 to histogram.
PDEFoamDiscriminant()
Default constructor for streamer, user should not use it.
virtual Float_t Estimate(PDEFoam *, std::vector< Float_t > &, ECellValue)=0
Double_t GetCellElement(const PDEFoamCell *cell, UInt_t i) const
Returns cell element i of cell 'cell'.
virtual Float_t GetCellValue(const std::vector< Float_t > &xvec, ECellValue cv, PDEFoamKernelBase *)
This function finds the cell, which corresponds to the given untransformed event vector 'xvec' and re...
void SetCellElement(PDEFoamCell *cell, UInt_t i, Double_t value)
Set cell element i of cell to value.
PDEFoam(const PDEFoam &)
Copy Constructor NOT IMPLEMENTED (NEVER USED).
Float_t VarTransform(Int_t idim, Float_t x) const
friend class PDEFoamKernelBase
Double_t * fXmin
[fDim] minimum for variable transform
PDEFoamCell * FindCell(const std::vector< Float_t > &) const
Find cell that contains 'xvec' (in foam coordinates [0,1]).
PDEFoamCell ** fCells
[fNCells] Array of ALL cells
std::vector< TMVA::PDEFoamCell * > FindCells(const std::vector< Float_t > &) const
Find all cells, that contain txvec.
Int_t fLastCe
Index of the last cell.
Double_t * fXmax
[fDim] maximum for variable transform
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.
MsgLogger & Endl(MsgLogger &ml)
Double_t Sqrt(Double_t x)
Returns the square root of x.