ROOT  6.06/09
Reference Guide
PDEFoamEvent.cxx
Go to the documentation of this file.
1 // @(#)root/tmva $Id$
2 // Author: Tancredi Carli, Dominik Dannheim, Alexander Voigt
3 
4 /**********************************************************************************
5  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis *
6  * Package: TMVA *
7  * Classes: PDEFoamEvent *
8  * Web : http://tmva.sourceforge.net *
9  * *
10  * Description: *
11  * Implementation. *
12  * *
13  * Authors (alphabetical): *
14  * Tancredi Carli - CERN, Switzerland *
15  * Dominik Dannheim - CERN, Switzerland *
16  * S. Jadach - Institute of Nuclear Physics, Cracow, Poland *
17  * Alexander Voigt - TU Dresden, Germany *
18  * Peter Speckmayer - CERN, Switzerland *
19  * *
20  * Copyright (c) 2008, 2010: *
21  * CERN, Switzerland *
22  * MPI-K Heidelberg, Germany *
23  * *
24  * Redistribution and use in source and binary forms, with or without *
25  * modification, are permitted according to the terms listed in LICENSE *
26  * (http://tmva.sourceforge.net/LICENSE) *
27  **********************************************************************************/
28 
29 //_____________________________________________________________________
30 //
31 // PDEFoamEvent
32 //
33 // This PDEFoam variant stores in every cell the sum of event weights
34 // and the sum of the squared event weights. It therefore acts as
35 // event density estimator. It should be booked together with the
36 // PDEFoamEventDensity density estimator, which returns the event
37 // weight density at a given phase space point during the foam
38 // build-up.
39 //
40 //_____________________________________________________________________
41 
42 #ifndef ROOT_TMVA_PDEFoamEvent
43 #include "TMVA/PDEFoamEvent.h"
44 #endif
45 
47 
48 ////////////////////////////////////////////////////////////////////////////////
49 /// Default constructor for streamer, user should not use it.
50 
51 TMVA::PDEFoamEvent::PDEFoamEvent()
52  : PDEFoam()
53 {
54 }
55 
56 ////////////////////////////////////////////////////////////////////////////////
57 
59  : PDEFoam(name)
60 {}
61 
62 ////////////////////////////////////////////////////////////////////////////////
63 /// Copy Constructor NOT IMPLEMENTED (NEVER USED)
64 
66  : PDEFoam(from)
67 {
68  Log() << kFATAL << "COPY CONSTRUCTOR NOT IMPLEMENTED" << Endl;
69 }
70 
71 ////////////////////////////////////////////////////////////////////////////////
72 /// This function fills an event weight 'wt' into the PDEFoam. Cell
73 /// element 0 is filled with the weight 'wt', and element 1 is
74 /// filled with the squared weight.
75 
77 {
78  // find corresponding foam cell
79  std::vector<Float_t> values = ev->GetValues();
80  std::vector<Float_t> tvalues = VarTransform(values);
81  PDEFoamCell *cell = FindCell(tvalues);
82 
83  // 0. Element: Sum of event weights 'wt'
84  // 1. Element: Sum of squared event weights 'wt'
85  SetCellElement(cell, 0, GetCellElement(cell, 0) + wt);
86  SetCellElement(cell, 1, GetCellElement(cell, 1) + wt * wt);
87 }
MsgLogger & Endl(MsgLogger &ml)
Definition: MsgLogger.h:162
float Float_t
Definition: RtypesCore.h:53
ClassImp(TMVA::PDEFoamEvent) TMVA
Default constructor for streamer, user should not use it.
virtual void FillFoamCells(const Event *ev, Float_t wt)
This function fills an event weight 'wt' into the PDEFoam.
MsgLogger & Log() const
Definition: PDEFoam.h:265
Basic string class.
Definition: TString.h:137
#define name(a, b)
Definition: linkTestLib0.cpp:5
Abstract ClassifierFactory template that handles arbitrary types.
std::vector< Float_t > & GetValues()
Definition: Event.h:93