70 , fTargetSelection(kMean)
97 , fTargetSelection(ts)
106 , fTargetSelection(from.fTargetSelection)
108 Log() << kFATAL <<
"COPY CONSTRUCTOR NOT IMPLEMENTED" <<
Endl;
131 std::map<Int_t, Float_t> txvec;
132 for (std::map<Int_t, Float_t>::const_iterator it = xvec.begin();
133 it != xvec.end(); ++it) {
134 Float_t coordinate = it->second;
135 Int_t dim = it->first;
138 if (coordinate <= fXmin[dim])
140 else if (coordinate >= fXmax[dim])
143 txvec.insert(std::pair<Int_t, Float_t>(dim, VarTransform(dim, coordinate)));
147 std::map<Int_t, Float_t> target;
150 std::vector<PDEFoamCell*> cells = FindCells(txvec);
154 return std::vector<Float_t>(GetTotDim() - xvec.size(), 0);
158 for (
Int_t idim = 0; idim < GetTotDim(); ++idim) {
160 if (txvec.find(idim) == txvec.end())
161 target.insert(std::pair<Int_t, Float_t>(idim, 0));
164 switch (fTargetSelection) {
166 CalculateMean(target, cells);
169 CalculateMpv(target, cells);
172 Log() <<
"<PDEFoamMultiTarget::GetCellValue>: "
173 <<
"unknown target selection type!" <<
Endl;
178 std::vector<Float_t> result;
179 result.reserve(target.size());
180 for (std::map<Int_t, Float_t>::const_iterator it = target.begin();
181 it != target.end(); ++it)
182 result.push_back(it->second);
207 for (std::vector<PDEFoamCell*>::const_iterator cell_it = cells.begin();
208 cell_it != cells.end(); ++cell_it) {
211 const Double_t cell_density = GetCellValue(*cell_it, kValueDensity);
214 if (cell_density > max_dens) {
216 PDEFoamVect cellPosi(GetTotDim()), cellSize(GetTotDim());
217 (*cell_it)->GetHcub(cellPosi, cellSize);
220 max_dens = cell_density;
223 for (std::map<Int_t, Float_t>::iterator target_it = target.begin();
224 target_it != target.end(); ++target_it) {
225 const Int_t dim = target_it->first;
227 VarTransformInvers(dim, cellPosi[dim] + 0.5 * cellSize[dim]);
251 std::map<Int_t, Float_t> norm;
254 for (std::vector<PDEFoamCell*>::const_iterator cell_it = cells.begin();
255 cell_it != cells.end(); ++cell_it) {
258 const Double_t cell_density = GetCellValue(*cell_it, kValueDensity);
261 PDEFoamVect cellPosi(GetTotDim()), cellSize(GetTotDim());
262 (*cell_it)->GetHcub(cellPosi, cellSize);
265 for (std::map<Int_t, Float_t>::iterator target_it = target.begin();
266 target_it != target.end(); ++target_it) {
267 const Int_t dim = target_it->first;
268 target_it->second += cell_density *
269 VarTransformInvers(dim, cellPosi[dim] + 0.5 * cellSize[dim]);
270 norm[dim] += cell_density;
275 for (std::map<Int_t, Float_t>::iterator target_it = target.begin();
276 target_it != target.end(); ++target_it) {
279 const Int_t dim = target_it->first;
283 target[dim] /= norm[dim];
287 target[dim] = (fXmax[dim] - fXmin[dim]) / 2.;
This PDEFoam variant stores in every cell the sum of event weights and the sum of the squared event w...
This PDEFoam variant is used to estimate multiple targets by creating an event density foam (PDEFoamE...
virtual void CalculateMean(std::map< Int_t, Float_t > &, const std::vector< PDEFoamCell * > &)
This function calculates the mean target value from a given number of cells.
virtual void CalculateMpv(std::map< Int_t, Float_t > &, const std::vector< PDEFoamCell * > &)
This function calculates the most probable target value from a given number of cells.
virtual std::vector< Float_t > GetCellValue(const std::map< Int_t, Float_t > &, ECellValue)
This function is overridden from PDFEFoam.
PDEFoamMultiTarget()
Default constructor for streamer, user should not use it.
MsgLogger & Endl(MsgLogger &ml)