83 Log() << kFATAL <<
"COPY CONSTRUCTOR NOT IMPLEMENTED" <<
Endl;
94 std::vector<Float_t> values = ev->
GetValues();
95 std::vector<Float_t> tvalues = VarTransform(values);
101 SetCellElement(cell, 0, GetCellElement(cell, 0) + wt);
103 SetCellElement(cell, 1, GetCellElement(cell, 1) + wt);
113 for (
Long_t iCell = 0; iCell <= fLastCe; iCell++) {
114 if (!(fCells[iCell]->GetStat()))
117 Double_t n_sig = GetCellElement(fCells[iCell], 0);
118 Double_t n_bg = GetCellElement(fCells[iCell], 1);
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) {
134 SetCellElement(fCells[iCell], 0, n_sig / (n_sig + n_bg));
136 SetCellElement(fCells[iCell], 1,
TMath::Sqrt(Sqr(n_sig / Sqr(n_sig + n_bg))*n_sig +
137 Sqr(n_bg / Sqr(n_sig + n_bg))*n_bg));
140 SetCellElement(fCells[iCell], 0, 0.5);
141 SetCellElement(fCells[iCell], 1, 1.);
173 if ((idim1 >= GetTotDim()) || (idim1 < 0) ||
174 (idim2 >= GetTotDim()) || (idim2 < 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;
198 h1 =
new TH2D(hname.
Data(),
TString::Format(
"var%d vs var%d", idim1, idim2).
Data(), nbin, fXmin[idim1], fXmax[idim1], nbin, fXmin[idim2], fXmax[idim2]);
200 if (!
h1) Log() << kFATAL <<
"ERROR: Can not create histo" << hname <<
Endl;
201 if (cell_value == kValue)
203 1. + std::numeric_limits<float>::epsilon());
211 std::map<Int_t, Float_t> txvec;
217 std::vector<TMVA::PDEFoamCell*> cells = FindCells(txvec);
222 for (std::vector<TMVA::PDEFoamCell*>::const_iterator it = cells.begin();
223 it != cells.end(); ++it) {
225 PDEFoamVect cellPosi(GetTotDim()), cellSize(GetTotDim());
226 (*it)->GetHcub(cellPosi, cellSize);
229 std::vector<Float_t> tvec;
230 for (
Int_t i = 0; i < GetTotDim(); ++i) {
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);
241 cv = GetCellValue(FindCell(tvec), cell_value);
243 if (cell_value == kValue) {
247 for (
Int_t d1 = 0; d1 < GetTotDim(); ++d1) {
248 if ((d1 != idim1) && (d1 != idim2))
249 area_cell *= cellSize[d1];
interop::TCppScope_t fClass
long Long_t
Signed long integer 4 bytes (long). Size depends on architecture.
float Float_t
Float 4 bytes (float)
virtual Double_t GetBinCenter(Int_t bin) const
Return center of bin.
virtual void SetRangeUser(Double_t ufirst, Double_t ulast)
Set the viewing range for the axis from ufirst to ulast (in user coordinates, that is,...
virtual Int_t GetNbinsY() const
virtual Int_t GetNbinsX() const
virtual void SetBinContent(Int_t bin, Double_t content)
Set bin content see convention for numbering bins in TH1::GetBin In case the bin number is greater th...
virtual Double_t GetBinContent(Int_t bin) const
Return content of bin number bin.
2-D histogram with a double per channel (see TH1 documentation)
std::vector< Float_t > & GetValues()
This PDEFoam variant stores in every cell the discriminant.
void Finalize() override
Calc discriminator and its error for every cell and save it to the cell.
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.
This class is the abstract kernel interface for PDEFoam.
virtual Float_t Estimate(PDEFoam *, std::vector< Float_t > &, ECellValue)=0
Implementation of PDEFoam.
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.