50 #ifndef ROOT_TMVA_PDEFoamDecisionTree
53 #ifndef ROOT_TMVA_PDEFoamDecisionTreeDensity
75 TMVA::PDEFoamDecisionTree::PDEFoamDecisionTree()
76 : PDEFoamDiscriminant()
102 , fSepType(from.fSepType)
104 Log() <<
kFATAL <<
"COPY CONSTRUCTOR NOT IMPLEMENTED" <<
Endl;
134 Log() <<
kFATAL <<
"<DTExplore> Null pointer given!" <<
Endl;
137 std::vector<TH1D*> hsig, hbkg, hsig_unw, hbkg_unw;
140 hsig_unw.reserve(fDim);
141 hbkg_unw.reserve(fDim);
142 for (
Int_t idim = 0; idim < fDim; idim++) {
143 hsig.push_back(
new TH1D(
Form(
"hsig_%i", idim),
144 Form(
"signal[%i]", idim), fNBin, fXmin[idim], fXmax[idim]));
145 hbkg.push_back(
new TH1D(
Form(
"hbkg_%i", idim),
146 Form(
"background[%i]", idim), fNBin, fXmin[idim], fXmax[idim]));
147 hsig_unw.push_back(
new TH1D(
Form(
"hsig_unw_%i", idim),
148 Form(
"signal_unw[%i]", idim), fNBin, fXmin[idim], fXmax[idim]));
149 hbkg_unw.push_back(
new TH1D(
Form(
"hbkg_unw_%i", idim),
150 Form(
"background_unw[%i]", idim), fNBin, fXmin[idim], fXmax[idim]));
154 PDEFoamVect cellSize(GetTotDim()), cellPosi(GetTotDim());
155 cell->
GetHcub(cellPosi, cellSize);
158 std::vector<Double_t> lb(GetTotDim());
159 std::vector<Double_t> ub(GetTotDim());
160 for (
Int_t idim = 0; idim < GetTotDim(); idim++) {
168 Log() <<
kFATAL <<
"<PDEFoamDecisionTree::Explore>: cast failed: "
169 <<
"PDEFoamDensityBase* --> PDEFoamDecisionTreeDensity*" <<
Endl;
181 Double_t nTotS = hsig.at(0)->Integral(0, hsig.at(0)->GetNbinsX() + 1);
182 Double_t nTotB = hbkg.at(0)->Integral(0, hbkg.at(0)->GetNbinsX() + 1);
183 Double_t nTotS_unw = hsig_unw.at(0)->Integral(0, hsig_unw.at(0)->GetNbinsX() + 1);
184 Double_t nTotB_unw = hbkg_unw.at(0)->Integral(0, hbkg_unw.at(0)->GetNbinsX() + 1);
186 for (
Int_t idim = 0; idim < fDim; ++idim) {
187 Double_t nSelS = hsig.at(idim)->GetBinContent(0);
188 Double_t nSelB = hbkg.at(idim)->GetBinContent(0);
189 Double_t nSelS_unw = hsig_unw.at(idim)->GetBinContent(0);
190 Double_t nSelB_unw = hbkg_unw.at(idim)->GetBinContent(0);
191 for (
Int_t jLo = 1; jLo < fNBin; jLo++) {
192 nSelS += hsig.at(idim)->GetBinContent(jLo);
193 nSelB += hbkg.at(idim)->GetBinContent(jLo);
194 nSelS_unw += hsig_unw.at(idim)->GetBinContent(jLo);
195 nSelB_unw += hbkg_unw.at(idim)->GetBinContent(jLo);
199 if (!((nSelS_unw + nSelB_unw) >= GetNmin() &&
200 (nTotS_unw - nSelS_unw + nTotB_unw - nSelB_unw) >= GetNmin()))
206 Double_t gain = fSepType->GetSeparationGain(nSelS, nSelB, nTotS, nTotB);
208 if (gain >= maxGain) {
216 if (kBest >= fDim || kBest < 0) {
227 if (nTotB + nTotS > 0)
228 cell->
SetIntg(nTotS / (nTotB + nTotS));
237 SetCellElement(cell, 0, nTotS + nTotB);
240 for (
UInt_t ih = 0; ih < hsig.size(); ih++)
delete hsig.at(ih);
241 for (
UInt_t ih = 0; ih < hbkg.size(); ih++)
delete hbkg.at(ih);
242 for (
UInt_t ih = 0; ih < hsig_unw.size(); ih++)
delete hsig_unw.at(ih);
243 for (
UInt_t ih = 0; ih < hbkg_unw.size(); ih++)
delete hbkg_unw.at(ih);
ClassImp(TMVA::PDEFoamDecisionTree) TMVA
Default constructor for streamer, user should not use it.
MsgLogger & Endl(MsgLogger &ml)
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...
double distr(double *x, double *p)
void SetXdiv(Double_t Xdiv)
virtual void Explore(PDEFoamCell *Cell)
Internal subprogram used by Create.
void CalcVolume()
Calculates volume of the cell using size params which are calculated.
char * Form(const char *fmt,...)
void SetDriv(Double_t Driv)
1-D histogram with a double per channel (see TH1 documentation)}
void SetIntg(Double_t Intg)
void GetHcub(PDEFoamVect &, PDEFoamVect &) const
Provides size and position of the cell These parameter are calculated by analyzing information in all...
virtual ~PDEFoamDecisionTree()
Destructor deletes fSepType.