86 Log() <<
kFATAL <<
"COPY CONSTRUCTOR NOT IMPLEMENTED" <<
Endl;
97 std::vector<Float_t> values = ev->
GetValues();
117 if (!(
fCells[iCell]->GetStat()))
124 Log() <<
kWARNING <<
"Negative number of signal events in cell " << iCell
125 <<
": " << n_sig <<
". Set to 0." <<
Endl;
129 Log() <<
kWARNING <<
"Negative number of background events in cell " << iCell
130 <<
": " << n_bg <<
". Set to 0." <<
Endl;
135 if (n_sig + n_bg > 0) {
140 Sqr(n_bg /
Sqr(n_sig + n_bg))*n_bg));
176 if ((idim1 >=
GetTotDim()) || (idim1 < 0) ||
179 Log() <<
kFATAL <<
"<Project2>: wrong dimensions given: " 180 << idim1 <<
", " << idim2 <<
Endl;
186 Log() <<
kWARNING <<
"Warning: number of bins too big: " << nbin
187 <<
" Using 1000 bins for each dimension instead." <<
Endl;
189 }
else if (nbin < 1) {
191 <<
"; set nbin=50" <<
Endl;
201 h1 =
new TH2D(hname.
Data(),
Form(
"var%d vs var%d", idim1, idim2), nbin,
fXmin[idim1],
fXmax[idim1], nbin, fXmin[idim2], fXmax[idim2]);
203 if (!h1)
Log() <<
kFATAL <<
"ERROR: Can not create histo" << hname <<
Endl;
214 std::map<Int_t, Float_t> txvec;
220 std::vector<TMVA::PDEFoamCell*> cells =
FindCells(txvec);
225 for (std::vector<TMVA::PDEFoamCell*>::const_iterator it = cells.begin();
226 it != cells.end(); ++it) {
229 (*it)->GetHcub(cellPosi, cellSize);
232 std::vector<Float_t> tvec;
234 if (i != idim1 && i != idim2)
235 tvec.push_back(cellPosi[i] + 0.5 * cellSize[i]);
237 tvec.push_back(txvec[i]);
241 if (kernel !=
NULL) {
242 cv = kernel->
Estimate(
this, tvec, cell_value);
246 if (cell_value ==
kValue) {
251 if ((d1 != idim1) && (d1 != idim2))
252 area_cell *= cellSize[d1];
MsgLogger & Endl(MsgLogger &ml)
PDEFoamDiscriminant()
Default constructor for streamer, user should not use it.
Float_t VarTransform(Int_t idim, Float_t x) const
std::vector< TMVA::PDEFoamCell * > FindCells(const std::vector< Float_t > &) const
Find all cells, that contain txvec.
virtual TH2D * Project2(Int_t, Int_t, ECellValue, PDEFoamKernelBase *, UInt_t)
Project foam variable idim1 and variable idim2 to histogram.
Double_t GetCellElement(const PDEFoamCell *cell, UInt_t i) const
Returns cell element i of cell 'cell'.
void SetCellElement(PDEFoamCell *cell, UInt_t i, Double_t value)
Set cell element i of cell to value.
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
Set the viewing range for the axis from ufirst to ulast (in user coordinates).
virtual Float_t Estimate(PDEFoam *, std::vector< Float_t > &, ECellValue)=0
PDEFoamCell * FindCell(const std::vector< Float_t > &) const
Find cell that contains 'xvec' (in foam coordinates [0,1]).
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
char * Form(const char *fmt,...)
THist< 2, double, THistStatContent, THistStatUncertainty > TH2D
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...
virtual void Finalize()
Calc discriminator and its error for every cell and save it to the cell.
virtual void FillFoamCells(const Event *ev, Float_t wt)
This function fills an event into the discriminant PDEFoam.
Abstract ClassifierFactory template that handles arbitrary types.
std::vector< Float_t > & GetValues()
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content.
virtual Int_t GetNbinsX() const
Double_t Sqrt(Double_t x)
virtual Int_t GetNbinsY() const
tomato 2-D histogram with a double per channel (see TH1 documentation)}
const char * Data() const