127 Log() << kFATAL <<
"<DTExplore> Null pointer given!" <<
Endl;
130 std::vector<TH1D*> hsig, hbkg, hsig_unw, hbkg_unw;
133 hsig_unw.reserve(fDim);
134 hbkg_unw.reserve(fDim);
135 for (
Int_t idim = 0; idim < fDim; idim++) {
137 TString::Format(
"signal[%i]", idim), fNBin, fXmin[idim], fXmax[idim]));
139 TString::Format(
"background[%i]", idim), fNBin, fXmin[idim], fXmax[idim]));
141 TString::Format(
"signal_unw[%i]", idim), fNBin, fXmin[idim], fXmax[idim]));
143 TString::Format(
"background_unw[%i]", idim), fNBin, fXmin[idim], fXmax[idim]));
147 PDEFoamVect cellSize(GetTotDim()), cellPosi(GetTotDim());
148 cell->
GetHcub(cellPosi, cellSize);
151 std::vector<Double_t> lb(GetTotDim());
152 std::vector<Double_t> ub(GetTotDim());
153 for (
Int_t idim = 0; idim < GetTotDim(); idim++) {
154 lb[idim] = VarTransformInvers(idim, cellPosi[idim] - std::numeric_limits<float>::epsilon());
155 ub[idim] = VarTransformInvers(idim, cellPosi[idim] + cellSize[idim] + std::numeric_limits<float>::epsilon());
161 Log() << kFATAL <<
"<PDEFoamDecisionTree::Explore>: cast failed: "
162 <<
"PDEFoamDensityBase* --> PDEFoamDecisionTreeDensity*" <<
Endl;
174 Double_t nTotS = hsig.at(0)->Integral(0, hsig.at(0)->GetNbinsX() + 1);
175 Double_t nTotB = hbkg.at(0)->Integral(0, hbkg.at(0)->GetNbinsX() + 1);
176 Double_t nTotS_unw = hsig_unw.at(0)->Integral(0, hsig_unw.at(0)->GetNbinsX() + 1);
177 Double_t nTotB_unw = hbkg_unw.at(0)->Integral(0, hbkg_unw.at(0)->GetNbinsX() + 1);
179 for (
Int_t idim = 0; idim < fDim; ++idim) {
180 Double_t nSelS = hsig.at(idim)->GetBinContent(0);
181 Double_t nSelB = hbkg.at(idim)->GetBinContent(0);
182 Double_t nSelS_unw = hsig_unw.at(idim)->GetBinContent(0);
183 Double_t nSelB_unw = hbkg_unw.at(idim)->GetBinContent(0);
184 for (
Int_t jLo = 1; jLo < fNBin; jLo++) {
185 nSelS += hsig.at(idim)->GetBinContent(jLo);
186 nSelB += hbkg.at(idim)->GetBinContent(jLo);
187 nSelS_unw += hsig_unw.at(idim)->GetBinContent(jLo);
188 nSelB_unw += hbkg_unw.at(idim)->GetBinContent(jLo);
192 if (!((nSelS_unw + nSelB_unw) >= GetNmin() &&
193 (nTotS_unw - nSelS_unw + nTotB_unw - nSelB_unw) >= GetNmin()))
199 Double_t gain = fSepType->GetSeparationGain(nSelS, nSelB, nTotS, nTotB);
201 if (gain >= maxGain) {
209 if (kBest >= fDim || kBest < 0) {
220 if (nTotB + nTotS > 0)
221 cell->
SetIntg(nTotS / (nTotB + nTotS));
230 SetCellElement(cell, 0, nTotS + nTotB);
233 for (
UInt_t ih = 0; ih < hsig.size(); ih++)
delete hsig.at(ih);
234 for (
UInt_t ih = 0; ih < hbkg.size(); ih++)
delete hbkg.at(ih);
235 for (
UInt_t ih = 0; ih < hsig_unw.size(); ih++)
delete hsig_unw.at(ih);
236 for (
UInt_t ih = 0; ih < hbkg_unw.size(); ih++)
delete hbkg_unw.at(ih);
virtual void FillHistograms(TMVA::Volume &, std::vector< TH1D * > &, std::vector< TH1D * > &, std::vector< TH1D * > &, std::vector< TH1D * > &)
Fill the given histograms with signal and background events, which are found in the volume.