#include <cmath>
#ifndef ROOT_TMVA_PDEFoamDiscriminantDensity
#include "TMVA/PDEFoamDiscriminantDensity.h"
#endif
ClassImp(TMVA::PDEFoamDiscriminantDensity)
TMVA::PDEFoamDiscriminantDensity::PDEFoamDiscriminantDensity()
: PDEFoamDensityBase()
, fClass(0)
{}
TMVA::PDEFoamDiscriminantDensity::PDEFoamDiscriminantDensity(std::vector<Double_t> box, UInt_t cls)
: PDEFoamDensityBase(box)
, fClass(cls)
{
}
TMVA::PDEFoamDiscriminantDensity::PDEFoamDiscriminantDensity(const PDEFoamDiscriminantDensity &distr)
: PDEFoamDensityBase(distr)
, fClass(distr.fClass)
{
}
Double_t TMVA::PDEFoamDiscriminantDensity::Density(std::vector<Double_t> &xev, Double_t &event_density)
{
if (!fBst)
Log() << kFATAL << "<PDEFoamDiscriminantDensity::Density()> Binary tree not set!" << Endl;
std::vector<Double_t> lb(GetBox().size());
std::vector<Double_t> ub(GetBox().size());
const Double_t probevolume_inv = 1.0 / GetBoxVolume();
for (UInt_t idim = 0; idim < GetBox().size(); ++idim) {
lb[idim] = xev[idim] - GetBox().at(idim) / 2.0;
ub[idim] = xev[idim] + GetBox().at(idim) / 2.0;
}
TMVA::Volume volume(&lb, &ub);
std::vector<const TMVA::BinarySearchTreeNode*> nodes;
const Double_t sumOfWeights = fBst->SearchVolume(&volume, &nodes);
event_density = nodes.size() * probevolume_inv;
Double_t n_sig = 0;
for (std::vector<const TMVA::BinarySearchTreeNode*>::const_iterator it = nodes.begin();
it != nodes.end(); ++it) {
if ((*it)->GetClass() == fClass)
n_sig += (*it)->GetWeight();
}
return (n_sig / (sumOfWeights + 0.1)) * probevolume_inv;
}
PDEFoamDiscriminantDensity.cxx:1 PDEFoamDiscriminantDensity.cxx:2 PDEFoamDiscriminantDensity.cxx:3 PDEFoamDiscriminantDensity.cxx:4 PDEFoamDiscriminantDensity.cxx:5 PDEFoamDiscriminantDensity.cxx:6 PDEFoamDiscriminantDensity.cxx:7 PDEFoamDiscriminantDensity.cxx:8 PDEFoamDiscriminantDensity.cxx:9 PDEFoamDiscriminantDensity.cxx:10 PDEFoamDiscriminantDensity.cxx:11 PDEFoamDiscriminantDensity.cxx:12 PDEFoamDiscriminantDensity.cxx:13 PDEFoamDiscriminantDensity.cxx:14 PDEFoamDiscriminantDensity.cxx:15 PDEFoamDiscriminantDensity.cxx:16 PDEFoamDiscriminantDensity.cxx:17 PDEFoamDiscriminantDensity.cxx:18 PDEFoamDiscriminantDensity.cxx:19 PDEFoamDiscriminantDensity.cxx:20 PDEFoamDiscriminantDensity.cxx:21 PDEFoamDiscriminantDensity.cxx:22 PDEFoamDiscriminantDensity.cxx:23 PDEFoamDiscriminantDensity.cxx:24 PDEFoamDiscriminantDensity.cxx:25 PDEFoamDiscriminantDensity.cxx:26 PDEFoamDiscriminantDensity.cxx:27 PDEFoamDiscriminantDensity.cxx:28 PDEFoamDiscriminantDensity.cxx:29 PDEFoamDiscriminantDensity.cxx:30 PDEFoamDiscriminantDensity.cxx:31 PDEFoamDiscriminantDensity.cxx:32 PDEFoamDiscriminantDensity.cxx:33 PDEFoamDiscriminantDensity.cxx:34 PDEFoamDiscriminantDensity.cxx:35 PDEFoamDiscriminantDensity.cxx:36 PDEFoamDiscriminantDensity.cxx:37 PDEFoamDiscriminantDensity.cxx:38 PDEFoamDiscriminantDensity.cxx:39 PDEFoamDiscriminantDensity.cxx:40 PDEFoamDiscriminantDensity.cxx:41 PDEFoamDiscriminantDensity.cxx:42 PDEFoamDiscriminantDensity.cxx:43 PDEFoamDiscriminantDensity.cxx:44 PDEFoamDiscriminantDensity.cxx:45 PDEFoamDiscriminantDensity.cxx:46 PDEFoamDiscriminantDensity.cxx:47 PDEFoamDiscriminantDensity.cxx:48 PDEFoamDiscriminantDensity.cxx:49 PDEFoamDiscriminantDensity.cxx:50 PDEFoamDiscriminantDensity.cxx:51 PDEFoamDiscriminantDensity.cxx:52 PDEFoamDiscriminantDensity.cxx:53 PDEFoamDiscriminantDensity.cxx:54 PDEFoamDiscriminantDensity.cxx:55 PDEFoamDiscriminantDensity.cxx:56 PDEFoamDiscriminantDensity.cxx:57 PDEFoamDiscriminantDensity.cxx:58 PDEFoamDiscriminantDensity.cxx:59 PDEFoamDiscriminantDensity.cxx:60 PDEFoamDiscriminantDensity.cxx:61 PDEFoamDiscriminantDensity.cxx:62 PDEFoamDiscriminantDensity.cxx:63 PDEFoamDiscriminantDensity.cxx:64 PDEFoamDiscriminantDensity.cxx:65 PDEFoamDiscriminantDensity.cxx:66 PDEFoamDiscriminantDensity.cxx:67 PDEFoamDiscriminantDensity.cxx:68 PDEFoamDiscriminantDensity.cxx:69 PDEFoamDiscriminantDensity.cxx:70 PDEFoamDiscriminantDensity.cxx:71 PDEFoamDiscriminantDensity.cxx:72 PDEFoamDiscriminantDensity.cxx:73 PDEFoamDiscriminantDensity.cxx:74 PDEFoamDiscriminantDensity.cxx:75 PDEFoamDiscriminantDensity.cxx:76 PDEFoamDiscriminantDensity.cxx:77 PDEFoamDiscriminantDensity.cxx:78 PDEFoamDiscriminantDensity.cxx:79 PDEFoamDiscriminantDensity.cxx:80 PDEFoamDiscriminantDensity.cxx:81 PDEFoamDiscriminantDensity.cxx:82 PDEFoamDiscriminantDensity.cxx:83 PDEFoamDiscriminantDensity.cxx:84 PDEFoamDiscriminantDensity.cxx:85 PDEFoamDiscriminantDensity.cxx:86 PDEFoamDiscriminantDensity.cxx:87 PDEFoamDiscriminantDensity.cxx:88 PDEFoamDiscriminantDensity.cxx:89 PDEFoamDiscriminantDensity.cxx:90 PDEFoamDiscriminantDensity.cxx:91 PDEFoamDiscriminantDensity.cxx:92 PDEFoamDiscriminantDensity.cxx:93 PDEFoamDiscriminantDensity.cxx:94 PDEFoamDiscriminantDensity.cxx:95 PDEFoamDiscriminantDensity.cxx:96 PDEFoamDiscriminantDensity.cxx:97 PDEFoamDiscriminantDensity.cxx:98 PDEFoamDiscriminantDensity.cxx:99 PDEFoamDiscriminantDensity.cxx:100 PDEFoamDiscriminantDensity.cxx:101 PDEFoamDiscriminantDensity.cxx:102 PDEFoamDiscriminantDensity.cxx:103 PDEFoamDiscriminantDensity.cxx:104 PDEFoamDiscriminantDensity.cxx:105 PDEFoamDiscriminantDensity.cxx:106 PDEFoamDiscriminantDensity.cxx:107 PDEFoamDiscriminantDensity.cxx:108 PDEFoamDiscriminantDensity.cxx:109 PDEFoamDiscriminantDensity.cxx:110 PDEFoamDiscriminantDensity.cxx:111 PDEFoamDiscriminantDensity.cxx:112 PDEFoamDiscriminantDensity.cxx:113 PDEFoamDiscriminantDensity.cxx:114 PDEFoamDiscriminantDensity.cxx:115 PDEFoamDiscriminantDensity.cxx:116 PDEFoamDiscriminantDensity.cxx:117 PDEFoamDiscriminantDensity.cxx:118 PDEFoamDiscriminantDensity.cxx:119 PDEFoamDiscriminantDensity.cxx:120 PDEFoamDiscriminantDensity.cxx:121 PDEFoamDiscriminantDensity.cxx:122 PDEFoamDiscriminantDensity.cxx:123 PDEFoamDiscriminantDensity.cxx:124 PDEFoamDiscriminantDensity.cxx:125 PDEFoamDiscriminantDensity.cxx:126 PDEFoamDiscriminantDensity.cxx:127 PDEFoamDiscriminantDensity.cxx:128 PDEFoamDiscriminantDensity.cxx:129 PDEFoamDiscriminantDensity.cxx:130 PDEFoamDiscriminantDensity.cxx:131 PDEFoamDiscriminantDensity.cxx:132 PDEFoamDiscriminantDensity.cxx:133 PDEFoamDiscriminantDensity.cxx:134 PDEFoamDiscriminantDensity.cxx:135 PDEFoamDiscriminantDensity.cxx:136