45 #ifndef ROOT_TMVA_PDEFoamDecisionTreeDensity
62 TMVA::PDEFoamDecisionTreeDensity::PDEFoamDecisionTreeDensity()
63 : PDEFoamDensityBase()
114 std::vector<TH1D*> &hbkg, std::vector<TH1D*> &hsig_unw,
115 std::vector<TH1D*> &hbkg_unw)
118 if (hsig.size() != volume.
fLower->size()
119 || hbkg.size() != volume.
fLower->size()
120 || hsig_unw.size() != volume.
fLower->size()
121 || hbkg_unw.size() != volume.
fLower->size())
122 Log() <<
kFATAL <<
"<PDEFoamDistr::FillHistograms> Edge histograms have wrong size!" <<
Endl;
125 for (
UInt_t idim = 0; idim < hsig.size(); ++idim) {
126 if (!hsig.at(idim) || !hbkg.at(idim) ||
127 !hsig_unw.at(idim) || !hbkg_unw.at(idim))
128 Log() <<
kFATAL <<
"<PDEFoamDistr::FillHist> Histograms not initialized!" <<
Endl;
132 std::vector<const TMVA::BinarySearchTreeNode*> nodes;
135 fBst->SearchVolume(&volume, &nodes);
140 for (std::vector<const TMVA::BinarySearchTreeNode*>::const_iterator it = nodes.begin();
141 it != nodes.end(); ++it) {
142 std::vector<Float_t> ev = (*it)->GetEventV();
143 for (
UInt_t idim = 0; idim <
xmin.size(); ++idim) {
144 if (ev.at(idim) <
xmin.at(idim))
xmin.at(idim) = ev.at(idim);
145 if (ev.at(idim) >
xmax.at(idim))
xmax.at(idim) = ev.at(idim);
150 for (
UInt_t idim = 0; idim < hsig.size(); ++idim) {
151 hsig.at(idim)->GetXaxis()->SetLimits(
xmin.at(idim),
xmax.at(idim));
152 hbkg.at(idim)->GetXaxis()->SetLimits(
xmin.at(idim),
xmax.at(idim));
153 hsig_unw.at(idim)->GetXaxis()->SetLimits(
xmin.at(idim),
xmax.at(idim));
154 hbkg_unw.at(idim)->GetXaxis()->SetLimits(
xmin.at(idim),
xmax.at(idim));
155 hsig.at(idim)->Reset();
156 hbkg.at(idim)->Reset();
157 hsig_unw.at(idim)->Reset();
158 hbkg_unw.at(idim)->Reset();
162 for (std::vector<const TMVA::BinarySearchTreeNode*>::const_iterator it = nodes.begin();
163 it != nodes.end(); ++it) {
164 std::vector<Float_t> ev = (*it)->GetEventV();
165 Float_t wt = (*it)->GetWeight();
166 for (
UInt_t idim = 0; idim < ev.size(); ++idim) {
167 if ((*it)->GetClass() ==
fClass) {
168 hsig.at(idim)->Fill(ev.at(idim), wt);
169 hsig_unw.at(idim)->Fill(ev.at(idim), 1);
171 hbkg.at(idim)->Fill(ev.at(idim), wt);
172 hbkg_unw.at(idim)->Fill(ev.at(idim), 1);
std::vector< Double_t > * fLower
ClassImp(TMVA::PDEFoamDecisionTreeDensity) TMVA
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...
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)
double distr(double *x, double *p)
TClass * fClass
pointer to the foreign object
PDEFoamDecisionTreeDensity()
virtual Double_t Density(std::vector< Double_t > &Xarg, Double_t &event_density)
This function is not used in the decision tree like PDEFoam, instead FillHist() is used...
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)