ROOT logo
// @(#)root/foam:$Name: not supported by cvs2svn $:$Id: PDEFoam.h 29246 2009-06-26 16:50:00Z brun $
// Author: S. Jadach <mailto:Stanislaw.jadach@ifj.edu.pl>, P.Sawicki <mailto:Pawel.Sawicki@ifj.edu.pl>

/**********************************************************************************
 * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
 * Package: TMVA                                                                  *
 * Classes: PDEFoam, PDEFoamCell, PDEFoamIntegrand, PDEFoamMaxwt, PDEFoamVect,    *
 *          TFDISTR                                                               *
 * Web    : http://tmva.sourceforge.net                                           *
 *                                                                                *
 * Description:                                                                   *
 *      Collection of helper classes to be used with MethodPDEFoam                *
 *                                                                                *
 * Authors (alphabetical):                                                        *
 *      S. Jadach        - Institute of Nuclear Physics, Cracow, Poland           *
 *      Tancredi Carli   - CERN, Switzerland                                      *
 *      Dominik Dannheim - CERN, Switzerland                                      *
 *      Alexander Voigt  - CERN, Switzerland                                      *
 *                                                                                * 
 * Copyright (c) 2008:                                                            *
 *      CERN, Switzerland                                                         * 
 *      MPI-K Heidelberg, Germany                                                 * 
 *                                                                                *
 * Redistribution and use in source and binary forms, with or without             *
 * modification, are permitted according to the terms listed in LICENSE           *
 * (http://tmva.sourceforge.net/LICENSE)                                          *
 **********************************************************************************/

#ifndef ROOT_TMVA_PDEFoam
#define ROOT_TMVA_PDEFoam

#include <iosfwd>

#ifndef ROOT_TMath
#include "TMath.h"
#endif
#ifndef ROOT_TH2D
#include "TH2D.h"
#endif
#ifndef ROOT_TObjArray
#include "TObjArray.h"
#endif
#ifndef ROOT_TObjString
#include "TObjString.h"
#endif
#ifndef ROOT_TVectorT
#include "TVectorT.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
#ifndef ROOT_TRefArray
#include "TRefArray.h"
#endif
#ifndef ROOT_TMethodCall
#include "TMethodCall.h"
#endif
#ifndef ROOT_TMVA_BinarySearchTree
#include "TMVA/BinarySearchTree.h"
#endif
#ifndef ROOT_TMVA_VariableInfo
#include "TMVA/VariableInfo.h"
#endif
#ifndef ROOT_TMVA_Timer
#include "TMVA/Timer.h"
#endif
#ifndef ROOT_TRef
#include "TRef.h"
#endif
#ifndef ROOT_TObject
#include "TObject.h"
#endif

class TRandom3;

namespace TMVA {
   class PDEFoam;
   class PDEFoamCell;
   class PDEFoamIntegrand;
   class PDEFoamVect;
   class PDEFoamMaxwt;
   class MsgLogger;

   enum EKernel { kNone, kGaus, kLinN };
   enum ETargetSelection { kMean, kMpv };
   enum ECellType { kAll, kActive, kInActive };
   enum EFoamType { kSeparate, kDiscr, kMonoTarget, kMultiTarget };
   // possible values, saved in foam cells
   // kNev           : number of events (saved in cell element 0)
   // kDiscriminator : discriminator (saved in cell element 0)
   // kTarget0       : target 0 (saved in cell element 0)
   // kMeanValue     : mean sampling value (saved in fIntegral)
   // kRms           : rms of sampling distribution (saved in fDriver)
   // kRmsOvMean     : rms/mean of sampling distribution (saved in fDriver and fIntegral)
   // kDensity       : number of events/cell volume
   enum ECellValue { kNev, kDiscriminator, kTarget0, kMeanValue, kRms, kRmsOvMean, kDensity };
   // options for filling density (used in Density() to build up foam)
   // kEVENT_DENSITY : use event density for foam buildup
   // kDISCRIMINATOR : use N_sig/(N_sig + N_bg) for foam buildup
   // kTARGET        : use GetTarget(0) for foam build up
   enum TDensityCalc { kEVENT_DENSITY, kDISCRIMINATOR, kTARGET };
}

//////////////////////////////////////////////////////////////
//                                                          //
// Class PDEFoamIntegrand is an Abstract class representing //
// n-dimensional real positive integrand function           //
//                                                          //
//////////////////////////////////////////////////////////////

namespace TMVA {

   class PDEFoamIntegrand : public ::TObject  {

   public:
      PDEFoamIntegrand();
      virtual ~PDEFoamIntegrand() { }
      virtual Double_t Density(Int_t ndim, Double_t *) = 0;
      virtual Double_t Density(Int_t ndim, Double_t *, Double_t &) = 0;

      ClassDef(PDEFoamIntegrand,1); //n-dimensional real positive integrand of FOAM
   }; // end of PDEFoamIntegrand
} // namespace TMVA


//////////////////////////////////////////////////////////////////////////////
//                                                                          //
// TFDISTR is a child class of PDEFoamIntegrand and contains Methods to     //
// create a probability density by filling in events.                       //
// The main function is Density() which provides the event density at a     //
// given point during the foam build-up (sampling).                         //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////

namespace TMVA {

   // class definition of underlying density
   class TFDISTR : public PDEFoamIntegrand
   {
   private:
      Int_t fDim;               // number of dimensions 
      Float_t *fXmin;           //[fDim] minimal value of phase space in all dimension 
      Float_t *fXmax;           //[fDim] maximal value of phase space in all dimension 
      Float_t fVolFrac;         // volume fraction (with respect to total phase space
      BinarySearchTree *fBst;   // Binary tree to find events within a volume
      TDensityCalc fDensityCalc;// method of density calculation
     
   protected:
      Int_t fSignalClass;      // TODO: intermediate solution to keep IsSignal() of Event working. TODO: remove IsSignal() from Event
      Int_t fBackgroundClass;  // TODO: intermediate solution to keep IsSignal() of Event working. TODO: remove IsSignal() from Event

      mutable MsgLogger* fLogger;                     //! message logger
      MsgLogger& Log() const { return *fLogger; }                       

   public:
      TFDISTR();
      virtual ~TFDISTR();
     
      // Getter and setter for VolFrac option
      void SetVolumeFraction(Float_t vfr){fVolFrac=vfr; return;}
      Float_t GetVolumeFraction(){return fVolFrac;}
     
      // set foam dimension (mandatory before foam build-up!)
      void SetDim(Int_t idim){ 
         fDim = idim; 
	 if (fXmin) delete [] fXmin;
	 if (fXmax) delete [] fXmax;
         fXmin = new Float_t[fDim];
         fXmax = new Float_t[fDim];
         return;
      }
     
      // set foam boundaries
      void SetXmin(Int_t idim,Float_t wmin){fXmin[idim]=wmin; return;}
      void SetXmax(Int_t idim,Float_t wmax){fXmax[idim]=wmax; return;}
     
      // transformation functions for event variable into foam boundaries
      // reason: foam allways has boundaries [0, 1]
      Float_t VarTransform(Int_t idim, Float_t x){        // transform [xmin, xmax] --> [0, 1]
         Float_t b=fXmax[idim]-fXmin[idim]; 
         return (x-fXmin[idim])/b;
      }
      Float_t VarTransformInvers(Int_t idim, Float_t x){  // transform [0, 1] --> [xmin, xmax]
         Float_t b=fXmax[idim]-fXmin[idim]; 
         return x*b + fXmin[idim];
      }
     
      // debug function
      void PrintDensity();
     
      // density build-up functions
      void Initialize(Int_t ndim = 2);
      void FillBinarySearchTree( const Event* ev, EFoamType ft, Bool_t NoNegWeights=kFALSE );
     
      // Dominik Dannheim 10.Jan.2008
      // new method to fill edge histograms directly, without MC sampling
      void FillEdgeHist(Int_t nDim, TObjArray *myfHistEdg , Double_t *cellPosi, Double_t *cellSize, Double_t *ceSum, Double_t ceVol);
     
      // main function used by PDEFoam
      // returns density at a given point by range searching in BST
      Double_t Density(int nDim, Double_t *Xarg, Double_t &event_density);
      Double_t Density(int nDim, Double_t *Xarg){ 
         Double_t event_density = 0; 
         return Density(nDim, Xarg, event_density);
      };

      // helper functions on BST
      UInt_t GetNEvents(PDEFoamCell* cell); // gets number of events in cell (from fBst)
      Bool_t CellRMSCut(PDEFoamCell* cell, Float_t rms_cut, Int_t nbin); // calc cell rms and compare with rms_cut

      // Getters and setters for foam filling method
      void SetDensityCalc( TDensityCalc dc ){ fDensityCalc = dc; };
      Bool_t FillDiscriminator(){ return fDensityCalc == kDISCRIMINATOR; }
      Bool_t FillTarget0()      { return fDensityCalc == kTARGET;        }
      Bool_t FillEventDensity() { return fDensityCalc == kEVENT_DENSITY; }
     
      void SetSignalClass( Int_t cls )     { fSignalClass = cls;  } // TODO: intermediate solution to keep IsSignal() of Event working. TODO: remove IsSignal() from Event
      void SetBackgroundClass( Int_t cls ) { fBackgroundClass = cls;  } // TODO: intermediate solution to keep IsSignal() of Event working. TODO: remove IsSignal() from Event
      TH2D* MakeHistogram(Int_t nbinsx, Int_t nbinsy);
     
      ClassDef(TFDISTR,3) //Class for Event density
         };  //end of TFDISTR
     
}  // namespace TMVA

//////////////////////////////////////////////////////////////////////////////
//                                                                          //
// PDEFoam is the child class of the multi-dimensional general purpose      //
// Monte Carlo event generator (integrator) PDEFoam.                          //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////

namespace TMVA {
   
   class PDEFoamCell;
   class PDEFoam;

   std::ostream& operator<< ( std::ostream& os, const PDEFoam& pdefoam );
   std::istream& operator>> ( std::istream& istr,     PDEFoam& pdefoam );
   
   class PDEFoam : public TObject {
   protected:
      // COMPONENTS //
      //-------------- Input parameters
      TString fName;             // Name of a given instance of the FOAM class
      TString fVersion;          // Actual version of the FOAM like (1.01m)
      TString fDate;             // Release date of FOAM
      Int_t   fDim;              // Dimension of the integration/simulation space
      Int_t   fNCells;           // Maximum number of cells
      Int_t   fRNmax;            // Maximum No. of the rand. numb. requested at once
      //-------------------
      Int_t   fOptDrive;         // Optimization switch =1,2 for variance or maximum weight optimization
      Int_t   fChat;             // Chat=0,1,2 chat level in output, Chat=1 normal level
      Int_t   fOptRej;           // Switch =0 for weighted events; =1 for unweighted events in MC
      //-------------------
      Int_t   fNBin;             // No. of bins in the edge histogram for cell MC exploration
      Int_t   fNSampl;           // No. of MC events, when dividing (exploring) cell
      Int_t   fEvPerBin;         // Maximum number of effective (wt=1) events per bin
      //-------------------  MULTI-BRANCHING ---------------------
      Int_t  *fMaskDiv;          //! [fDim] Dynamic Mask for  cell division
      Int_t  *fInhiDiv;          //! [fDim] Flags for inhibiting cell division
      Int_t   fOptPRD;           //  Option switch for predefined division, for quick check
      PDEFoamVect **fXdivPRD;    //! Lists of division values encoded in one vector per direction
      //-------------------  GEOMETRY ----------------------------
      Int_t   fNoAct;            // Number of active cells
      Int_t   fLastCe;           // Index of the last cell
      PDEFoamCell **fCells;      // [fNCells] Array of ALL cells
      //------------------ M.C. generation----------------------------
      PDEFoamMaxwt   *fMCMonit;  // Monitor of the MC weight for measuring MC efficiency
      Double_t   fMaxWtRej;      // Maximum weight in rejection for getting wt=1 events
      TRefArray *fCellsAct;      // Array of pointers to active cells, constructed at the end of foam build-up
      Double_t  *fPrimAcu;       // [fNoAct] Array of cumulative probability of all active cells
      TObjArray *fHistEdg;       // Histograms of wt, one for each cell edge
      TObjArray *fHistDbg;       // Histograms of wt, for debug
      TH1D      *fHistWt;        // Histogram of the MC wt

      Double_t *fMCvect;         // [fDim] Generated MC vector for the outside user
      Double_t  fMCwt;           // MC weight
      Double_t *fRvec;           // [fRNmax] random number vector from r.n. generator fDim+1 maximum elements
      //----------- Procedures
      PDEFoamIntegrand *fRho;    //! Pointer to the user-defined integrand function/distribution
      TMethodCall *fMethodCall;  //! ROOT's pointer to user-defined global distribution function
      TRandom3        *fPseRan;  // Pointer to user-defined generator of pseudorandom numbers
      //----------- Statistics and MC results
      Long_t   fNCalls;          // Total number of the function calls
      Long_t   fNEffev;          // Total number of effective events (wt=1) in the foam buildup
      Double_t fSumWt, fSumWt2;  // Total sum of wt and wt^2
      Double_t fSumOve;          // Total Sum of overveighted events
      Double_t fNevGen;          // Total number of the generated MC events
      Double_t fWtMax, fWtMin;   // Maximum/Minimum MC weight
      Double_t fPrime;           // Primary integral R' (R=R'<wt>)
      Double_t fMCresult;        // True Integral R from MC series
      Double_t fMCerror;         // and its error
      //----------  working space for CELL exploration -------------
      Double_t *fAlpha;          // [fDim] Internal parameters of the hyperrectangle
      // ---------  PDE-Foam specific variables
      Double_t *fXmin;         // [fDim] minimum for variable transform
      Double_t *fXmax;         // [fDim] maximum for variable transform
      UInt_t fNElements;       // number of variables in every cell
      Bool_t fCutNmin;         // true: activate cut on minimal number of events in cell
      UInt_t fNmin;            // minimal number of events in cell to split cell
      Bool_t fCutRMSmin;       // true:  peek cell with max. RMS for next split
      Double_t fRMSmin;        // activate cut: minimal RMS in cell to split cell
      Float_t fVolFrac;        // volume fraction (with respect to total phase space
      TFDISTR *fDistr;         //! density from extern
      Timer *fTimer;           // timer for graphical output
      TObjArray *fVariableNames;// collection of all variable names
      Int_t fSignalClass;      // TODO: intermediate solution to keep IsSignal() of Event working. TODO: remove IsSignal() from Event
      Int_t fBackgroundClass;  // TODO: intermediate solution to keep IsSignal() of Event working. TODO: remove IsSignal() from Event
      mutable MsgLogger* fLogger;                     //! message logger
      MsgLogger& Log() const { return *fLogger; }                       

      //////////////////////////////////////////////////////////////////////////////////////////////
      //                                     METHODS                                              //
      //////////////////////////////////////////////////////////////////////////////////////////////
   private:
      Double_t Sqr(Double_t x) const { return x*x;}      // Square function

   protected:
      // override  PDEFoam::OutputGrow(Bool_t) for nicer TMVA output
      virtual void OutputGrow(Bool_t finished = false ); 

      // weight result from function with kernel
      Double_t WeightGaus(PDEFoamCell*, std::vector<Float_t>, UInt_t dim=0); 
      Double_t WeightLinNeighbors( std::vector<Float_t> txvec, ECellValue cv );

   public:
      PDEFoam();                  // Default constructor (used only by ROOT streamer)
      PDEFoam(const TString&);    // Principal user-defined constructor
      virtual ~PDEFoam();         // Default destructor
      PDEFoam(const PDEFoam&);    // Copy Constructor  NOT USED

      // Initialization
      virtual void Initialize(Bool_t CreateCellElements);     // Initialisation of foam
      virtual void Initialize(TRandom3*, PDEFoamIntegrand *); // Alternative initialization method, backward compatibility
      virtual void InitCells(Bool_t CreateCellElements);      // Initialisation of all foam cells
      virtual Int_t CellFill(Int_t, PDEFoamCell*);// Allocates new empty cell and return its index
      virtual void Explore(PDEFoamCell *Cell);    // Exploration of the new cell, determine <wt>, wtMax etc.
      virtual void Carver(Int_t&,Double_t&,Double_t&);// Determines the best edge, wt_max reduction
      virtual void Varedu(Double_t [], Int_t&, Double_t&,Double_t&); // Determines the best edge, variace reduction
      virtual void MakeAlpha();                 // Provides random point inside hyperrectangle
      virtual void Grow();                      // build up foam
      virtual Long_t PeekMax();                 // peek cell with max. driver integral
      virtual Int_t  Divide(PDEFoamCell *);     // Divide iCell into two daughters; iCell retained, taged as inactive
      virtual void MakeActiveList();            // Creates table of active cells
      virtual void GenerCel2(PDEFoamCell *&);   // Chose an active cell the with probability ~ Primary integral
      // Generation
      virtual Double_t Eval(Double_t *xRand, Double_t &event_density); // evaluate distribution on point 'xRand'
      virtual Double_t Eval(Double_t *xRand){   // evaluate distribution on point 'xRand'
	 Double_t event_density = 0;
	 return Eval(xRand, event_density);
      };
      virtual void     MakeEvent();             // Makes (generates) single MC event
      virtual void     GetMCvect(Double_t *);   // Provides generated randomly MC vector
      virtual void     GetMCwt(Double_t &);     // Provides generated MC weight
      virtual Double_t GetMCwt();               // Provides generates MC weight
      virtual Double_t MCgenerate(Double_t *MCvect);// All three above function in one
      // Finalization
      virtual void GetIntegMC(Double_t&, Double_t&);  // Provides Integrand and abs. error from MC run
      virtual void GetIntNorm(Double_t&, Double_t&);  // Provides normalization Inegrand
      virtual void GetWtParams(Double_t, Double_t&, Double_t&, Double_t&);// Provides MC weight parameters
      virtual void Finalize(  Double_t&, Double_t&);    // Prints summary of MC integration
      virtual PDEFoamIntegrand  *GetRho(){return fRho;} // Gets pointer of the distribut. (after restoring from disk)
      virtual TRandom3*GetPseRan() const {return fPseRan;}   // Gets pointer of r.n. generator (after restoring from disk)
      virtual void SetRhoInt(void *Rho);              // Set new integrand distr. in interactive mode
      virtual void SetRho(PDEFoamIntegrand *Rho);     // Set new integrand distr. in compiled mode
      virtual void ResetRho(PDEFoamIntegrand *Rho);              // Set new distribution, delete old
      virtual void SetPseRan(TRandom3*PseRan){fPseRan=PseRan;}   // Set new r.n. generator
      virtual void ResetPseRan(TRandom3*PseRan);                 // Set new r.n.g, delete old
      // Getters and Setters
      virtual void SetkDim(Int_t kDim){ // Sets dimension of cubical space
	 fDim  = kDim;
	 if (fXmin) delete [] fXmin;
	 if (fXmax) delete [] fXmax;
         fXmin = new Double_t[GetTotDim()];
         fXmax = new Double_t[GetTotDim()];
      }
      virtual void SetnCells(Long_t nCells){fNCells =nCells;}  // Sets maximum number of cells
      virtual void SetnSampl(Long_t nSampl){fNSampl =nSampl;}  // Sets no of MC events in cell exploration
      virtual void SetnBin(Int_t nBin){fNBin = nBin;}          // Sets no of bins in histogs in cell exploration
      virtual void SetChat(Int_t Chat){fChat = Chat;}          // Sets option Chat, chat level
      virtual void SetOptRej(Int_t OptRej){fOptRej =OptRej;}   // Sets option for MC rejection
      virtual void SetOptDrive(Int_t OptDrive){fOptDrive =OptDrive;}   // Sets optimization switch
      virtual void SetEvPerBin(Int_t EvPerBin){fEvPerBin =EvPerBin;}   // Sets max. no. of effective events per bin
      virtual void SetMaxWtRej(Double_t MaxWtRej){fMaxWtRej=MaxWtRej;} // Sets max. weight for rejection
      virtual void SetInhiDiv(Int_t, Int_t );            // Set inhibition of cell division along certain edge
      virtual void SetXdivPRD(Int_t, Int_t, Double_t[]); // Set predefined division points
      // Getters and Setters
      virtual const char *GetVersion() const {return fVersion.Data();}// Get version of the FOAM
      virtual Int_t    GetTotDim() const { return fDim;}              // Get total dimension
      virtual Double_t GetPrimary() const {return fPrime;}            // Get value of primary integral R'
      virtual void GetPrimary(Double_t &prime) {prime = fPrime;}      // Get value of primary integral R'
      virtual Long_t GetnCalls() const {return fNCalls;}              // Get total no. of the function calls
      virtual Long_t GetnEffev() const {return fNEffev;}              // Get total no. of effective wt=1 events
      virtual TString GetFoamName() const {return fName;}             // Get name of foam
      // Debug
      virtual void CheckAll(Int_t);     // Checks correctness of the entire data structure in the FOAM object
      virtual void PrintCells();        // Prints content of all cells
      virtual void LinkCells(void);     // Void function for backward compatibility

      // getter and setter to activate cut options
      void   CutNmin(Bool_t cut )   { fCutNmin = cut;    }
      Bool_t CutNmin()              { return fCutNmin;   }
      void   CutRMSmin(Bool_t cut ) { fCutRMSmin = cut;  }
      Bool_t CutRMSmin()            { return fCutRMSmin; }

      // getter and setter for cut values
      void     SetNmin(UInt_t val)     { fNmin=val;      }
      UInt_t   GetNmin()               { return fNmin;   }
      void     SetRMSmin(Double_t val) { fRMSmin=val;    }
      Double_t GetRMSmin()             { return fRMSmin; }

      // foam output operators
      friend std::ostream& operator<< ( std::ostream& os, const PDEFoam& pdefoam );
      friend std::istream& operator>> ( std::istream& istr,     PDEFoam& pdefoam );

      void ReadStream(istream &);         // read foam from stream
      void PrintStream(ostream  &) const; // write foam from stream
      void ReadXML( void* parent );       // read foam variables from xml
      void AddXMLTo( void* parent );      // write foam variables to xml
      
      // getters/ setters for foam boundaries
      void SetXmin(Int_t idim, Double_t wmin){ 
         fXmin[idim]=wmin;
         fDistr->SetXmin(idim, wmin);
         return; 
      }
      void SetXmax(Int_t idim, Double_t wmax){ 
         fXmax[idim]=wmax;
         fDistr->SetXmax(idim, wmax);
         return; 
      }
      Double_t GetXmin(Int_t idim){return fXmin[idim];}
      Double_t GetXmax(Int_t idim){return fXmax[idim];}

      // getter/ setter for variable name
      void AddVariableName(const char *s){
	 TObjString *os = new TObjString(s);
	 AddVariableName(os);
      };
      void AddVariableName(TObjString *s){
	 fVariableNames->Add(s);
      };
      TObjString* GetVariableName(Int_t idx){
	 return dynamic_cast<TObjString*>(fVariableNames->At(idx));
      };

      // transformation functions for event variable into foam boundaries
      // reason: foam allways has boundaries [0, 1]
      Float_t VarTransform(Int_t idim, Float_t x){        // transform [xmin, xmax] --> [0, 1]
         Float_t b=fXmax[idim]-fXmin[idim]; 
         return (x-fXmin[idim])/b;
      }
      std::vector<Float_t> VarTransform(std::vector<Float_t> invec){
         std::vector<Float_t> outvec;
         for(UInt_t i=0; i<invec.size(); i++)
            outvec.push_back(VarTransform(i, invec.at(i)));
         return outvec;
      }
      Float_t VarTransformInvers(Int_t idim, Float_t x){  // transform [0, 1] --> [xmin, xmax]
         Float_t b=fXmax[idim]-fXmin[idim]; 
         return x*b + fXmin[idim];
      }
      std::vector<Float_t> VarTransformInvers(std::vector<Float_t> invec){
         std::vector<Float_t> outvec;
         for(UInt_t i=0; i<invec.size(); i++)
            outvec.push_back(VarTransformInvers(i, invec.at(i)));
         return outvec;
      }
      
      // projection method
      virtual TH2D* Project2(Int_t idim1, Int_t idim2, const char *opt="nev", const char *ker="kNone", UInt_t maxbins=0);

      // Project foam by creating MC events
      virtual TH2D* ProjectMC(Int_t idim1, Int_t idim2, Int_t nevents, Int_t nbin);  

      // Draw a 1-dim histogram
      virtual TH1D* Draw1Dim(const char *opt, Int_t nbin);

      // Generates C++ code (root macro) for drawing foam with boxes (only 2-dim!)
      virtual void RootPlot2dim( const TString& filename, std::string what, 
                                 Bool_t CreateCanvas = kTRUE, Bool_t colors = kTRUE, Bool_t log_colors = kFALSE  );

      // init TObject pointer on cells
      void ResetCellElements(Bool_t allcells = false);

      // low level functions to access a certain cell value
      TVectorD* GetCellElements(std::vector<Float_t>);       // return cell elements of cell with given coordinates
      Double_t GetCellElement(PDEFoamCell *cell, UInt_t i);  // get Element 'i' in cell 'cell'
      void SetCellElement(PDEFoamCell *cell, UInt_t i, Double_t value); // set Element 'i' in cell 'cell' to value 'value'
      void SetNElements(UInt_t numb){ fNElements = numb; }   // init every cell element (TVectorD*)
      UInt_t GetNElements(){ return fNElements; }            // returns number of elements, saved on every cell
      
      void DisplayCellContent(void); // debug function

      // functions to fill created cells with certain values
      void FillFoamCells(const Event* ev, EFoamType ft, Bool_t NoNegWeights=kFALSE);
      
      // functions to calc discriminators/ mean targets for every cell
      // using filled cell values
      void CalcCellDiscr();
      void CalcCellTarget();

      // helper functions to access cell data
      Double_t GetCellMean(std::vector<Float_t> xvec);
      Double_t GetCellRMS(std::vector<Float_t> xvec);
      Double_t GetCellEntries(std::vector<Float_t> xvec);
      Double_t GetCellDiscr(std::vector<Float_t> xvec, EKernel kernel=kNone);
      Double_t GetCellDiscrError(std::vector<Float_t> xvec);
      Double_t GetCellDensity(std::vector<Float_t> xvec, EKernel kernel=kNone);

      Double_t GetCellMean(PDEFoamCell* cell);
      Double_t GetCellRMS(PDEFoamCell* cell);
      Double_t GetCellRMSovMean(PDEFoamCell* cell);
      Double_t GetCellEntries(PDEFoamCell* cell);
      Double_t GetCellEvents(PDEFoamCell* cell);
      Double_t GetCellDiscr(PDEFoamCell* cell);
      Double_t GetCellDiscrError(PDEFoamCell* cell);
      Double_t GetCellRegValue0(PDEFoamCell* cell); // returns regression value (regression method 1)
      Double_t GetCellDensity(PDEFoamCell*);

      // returns regression value (mono target regression)
      Double_t GetCellRegValue0(std::vector<Float_t>, EKernel kernel=kNone);
      // returns regression value i, given all variables (multi target regression)
      Double_t GetProjectedRegValue(UInt_t i, std::vector<Float_t> vals, EKernel kernel=kNone, ETargetSelection ts=kMean);
      Double_t GetCellTarget(UInt_t target_number, std::vector<Float_t> tvals, ETargetSelection ts);

      // helper/ debug functions
      Double_t GetSumCellIntg();           // test function. calculates sum over all cell->GetIntg()
      Double_t GetSumCellElements(UInt_t); // test function. calculates sum over all cell->GetCellElement()
      UInt_t   GetNActiveCells();          // returns number of active cells
      UInt_t   GetNInActiveCells();        // returns number of not active cells
      UInt_t   GetNCells();                // returns number of cells
      PDEFoamCell* GetRootCell();          // get pointer to root cell
      Int_t    GetSumCellMemory(ECellType ct = kAll); // return memory consumtion of all cells
      void     CheckCells(Bool_t remove_empty_cells=false); // check all cells with respect to critical values
      void     RemoveEmptyCell(Int_t iCell); // removes iCell if its volume is zero
      void     PrintCellElements();          // print all cells with its elements

      // find cell according to given event variables
      PDEFoamCell* FindCell(std::vector<Float_t>); //!

      // helper functions to include TFDISTR into the PDEFoam class
      // set VolFrac to PDEFoam
      void SetPDEFoamVolumeFraction( Double_t vfr) { fVolFrac = vfr; }
      // get VolFrac from PDEFoam
      Double_t GetPDEFoamVolumeFraction() const { return fVolFrac; }
      void SetVolumeFraction(Double_t);    // set VolFrac to TFDISTR
      void FillBinarySearchTree( const Event* ev, EFoamType ft, Bool_t NoNegWeights=kFALSE );
      void Create(Bool_t CreateCellElements=false); // create PDEFoam
      void Init();                    // initialize TFDISTR
      void PrintDensity();            // debug output
      void SetFoamType(EFoamType ft);

      void SetSignalClass( Int_t cls )     { fSignalClass = cls; fDistr->SetSignalClass( cls ); } // TODO: intermediate solution to keep IsSignal() of Event working. TODO: remove IsSignal() from Event
      void SetBackgroundClass( Int_t cls ) { fBackgroundClass = cls; fDistr->SetBackgroundClass( cls ); } // TODO: intermediate solution to keep IsSignal() of Event working. TODO: remove IsSignal() from Event

      //////////////////////////////////////////////////////////////////////////////////////////////
      ClassDef(PDEFoam,3)   // General purpose self-adapting binning
   }; // end of PDEFoam 

}  // namespace TMVA


////////////////////////////////////////////////////////////////////////////////////
//                                                                                //
// Class PDEFoamCell used in PDEFoam                                              //
//                                                                                //
// Objects of this class are hyperrectangular cells organized in the binary tree. //
// Special algoritm for encoding relalive positioning of the cells                //
// saves total memory allocation needed for the system of cells.                  //
//                                                                                //
////////////////////////////////////////////////////////////////////////////////////

namespace TMVA {

   class PDEFoamVect;

   class PDEFoamCell : public TObject {

      //   static, the same for all cells!
   private:
      Short_t  fDim;                   // Dimension of the vector space
      //   MEMBERS

   private:
      //--- linked tree organization ---
      Int_t    fSerial;                // Serial number
      Int_t    fStatus;                // Status (active, inactive)
      TRef     fParent;                // Pointer to parent cell
      TRef     fDaught0;               // Pointer to daughter 1
      TRef     fDaught1;               // Pointer to daughter 2
      //--- M.C. sampling and choice of the best edge ---

   private:
      Double_t fXdiv;                  // Factor for division
      Int_t    fBest;                  // Best Edge for division
      //--- Integrals of all kinds ---
      Double_t fVolume;                // Cartesian Volume of cell
      Double_t fIntegral;              // Integral over cell (estimate from exploration)
      Double_t fDrive;                 // Driver  integral, only for cell build-up
      Double_t fPrimary;               // Primary integral, only for MC generation
      //----------  working space for the user --------------
      TObject *fElement;               // may set by the user to save some data in this cell

      //////////////////////////////////////////////////////////////////////////////////////
      //                           METHODS                                                //
      //////////////////////////////////////////////////////////////////////////////////////
   public:
      PDEFoamCell();                          // Default Constructor for ROOT streamers
      PDEFoamCell(Int_t);                     // User Constructor
      PDEFoamCell(PDEFoamCell &);             // Copy Constructor
      virtual ~PDEFoamCell();                 // Destructor
      void  Fill(Int_t, PDEFoamCell*, PDEFoamCell*, PDEFoamCell*);    // Assigns values of attributes
      PDEFoamCell&  operator=(const PDEFoamCell&);       // Substitution operator (never used)
      //--------------- Geometry ----------------------------------
      Double_t  GetXdiv() const { return fXdiv;}          // Pointer to Xdiv
      Int_t     GetBest() const { return fBest;}          // Pointer to Best
      void      SetBest(Int_t    Best){ fBest =Best;}     // Set Best edge candidate
      void      SetXdiv(Double_t Xdiv){ fXdiv =Xdiv;}     // Set x-division for best edge cand.
      void      GetHcub(  PDEFoamVect&, PDEFoamVect&) const;  // Get position and size vectors (h-cubical subspace)
      void      GetHSize( PDEFoamVect& ) const;             // Get size only of cell vector  (h-cubical subspace)
      //--------------- Integrals/Volumes -------------------------
      void      CalcVolume();                             // Calculates volume of cell
      Double_t  GetVolume() const { return fVolume;}      // Volume of cell
      Double_t  GetIntg() const { return fIntegral;}      // Get Integral
      Double_t  GetDriv() const { return fDrive;}         // Get Drive
      Double_t  GetPrim() const { return fPrimary;}       // Get Primary
      void      SetIntg(Double_t Intg){ fIntegral=Intg;}  // Set true integral
      void      SetDriv(Double_t Driv){ fDrive   =Driv;}  // Set driver integral
      void      SetPrim(Double_t Prim){ fPrimary =Prim;}  // Set primary integral
      //--------------- linked tree organization ------------------
      Int_t     GetStat() const { return fStatus;}        // Get Status
      void      SetStat(Int_t Stat){ fStatus=Stat;}       // Set Status
      PDEFoamCell* GetPare() const { return (PDEFoamCell*) fParent.GetObject(); }  // Get Pointer to parent cell
      PDEFoamCell* GetDau0() const { return (PDEFoamCell*) fDaught0.GetObject(); } // Get Pointer to 1-st daughter vertex
      PDEFoamCell* GetDau1() const { return (PDEFoamCell*) fDaught1.GetObject(); } // Get Pointer to 2-nd daughter vertex
      void      SetDau0(PDEFoamCell* Daug){ fDaught0 = Daug;}  // Set pointer to 1-st daughter
      void      SetDau1(PDEFoamCell* Daug){ fDaught1 = Daug;}  // Set pointer to 2-nd daughter
      void      SetPare(PDEFoamCell* Pare){ fParent  = Pare;}  // Set pointer to parent
      void      SetSerial(Int_t Serial){ fSerial=Serial;}    // Set serial number
      Int_t     GetSerial() const { return fSerial;}         // Get serial number
      //--- other ---
      void Print(Option_t *option) const ;                   // Prints cell content
      //--- getter and setter for user variable ---
      void SetElement(TObject* fobj){ fElement = fobj; }     // Set user variable
      TObject* GetElement(){ return fElement; }              // Get pointer to user varibale
      ////////////////////////////////////////////////////////////////////////////
      ClassDef(PDEFoamCell,1)  //Single cell of FOAM
   }; // end of PDEFoamCell
} // namespace TMVA



//////////////////////////////////////////////////////////////////
//                                                              //
// Small auxiliary class for controlling MC weight.             //
//                                                              //
//////////////////////////////////////////////////////////////////

namespace TMVA {

   class PDEFoamMaxwt : public TObject {

   private:
      Double_t  fNent;      // No. of MC events
      Int_t     fnBin;      // No. of bins on the weight distribution
      Double_t  fwmax;      // Maximum analyzed weight

   protected:
      mutable MsgLogger* fLogger;                     //! message logger
      MsgLogger& Log() const { return *fLogger; }                          
   
   public:

      TH1D   *fWtHst1;      // Histogram of the weight wt
      TH1D   *fWtHst2;      // Histogram of wt filled with wt

   public:
      // constructor
      PDEFoamMaxwt();                          // NOT IMPLEMENTED (NEVER USED)
      PDEFoamMaxwt(Double_t, Int_t);           // Principal Constructor
      PDEFoamMaxwt(PDEFoamMaxwt &From);        // Copy constructor
      virtual ~PDEFoamMaxwt();                 // Destructor
      void Reset();                            // Reset
      PDEFoamMaxwt& operator=(const PDEFoamMaxwt &);    // operator =
      void Fill(Double_t);
      void Make(Double_t, Double_t&);
      void GetMCeff(Double_t, Double_t&, Double_t&);  // get MC efficiency= <w>/wmax

      ClassDef(PDEFoamMaxwt,1); //Controlling of the MC weight (maximum weight)
   }; // end of PDEFoamMaxwt
} // namespace TMVA



////////////////////////////////////////////////////////////////////////////////
//                                                                            //
// Auxiliary class PDEFoamVect of n-dimensional vector, with dynamic allocation //
// used for the cartesian geometry of the PDEFoam cells                       //
//                                                                            //
////////////////////////////////////////////////////////////////////////////////

namespace TMVA {
   ///////////////////////////////////////////////////////////////////////////////
   class PDEFoamVect : public TObject {

   private:
      Int_t       fDim;                     // Dimension
      Double_t   *fCoords;                  // [fDim] Coordinates
      PDEFoamVect  *fNext;                  // pointer for tree construction
      PDEFoamVect  *fPrev;                  // pointer for tree construction

   protected:
      mutable MsgLogger* fLogger;                     //! message logger
      MsgLogger& Log() const { return *fLogger; }                       

   public:
      // constructor
      PDEFoamVect();                                 // Constructor
      PDEFoamVect(Int_t);                            // USER Constructor
      PDEFoamVect(const PDEFoamVect &);              // Copy constructor
      virtual ~PDEFoamVect();                        // Destructor

      //////////////////////////////////////////////////////////////////////////////
      //                     Overloading operators                                //
      //////////////////////////////////////////////////////////////////////////////
      PDEFoamVect& operator =( const PDEFoamVect& ); // = operator; Substitution
      Double_t & operator[]( Int_t );                // [] provides POINTER to coordinate
      PDEFoamVect& operator =( Double_t [] );        // LOAD IN entire double vector
      PDEFoamVect& operator =( Double_t );           // LOAD IN double number
      //////////////////////////   OTHER METHODS    //////////////////////////////////
      PDEFoamVect& operator+=( const  PDEFoamVect& );  // +=; add vector u+=v  (FAST)
      PDEFoamVect& operator-=( const  PDEFoamVect& );  // +=; add vector u+=v  (FAST)
      PDEFoamVect& operator*=( const  Double_t&  );    // *=; mult. by scalar v*=x (FAST)
      PDEFoamVect  operator+ ( const  PDEFoamVect& );  // +;  u=v+s, NEVER USE IT, SLOW!!!
      PDEFoamVect  operator- ( const  PDEFoamVect& );  // -;  u=v-s, NEVER USE IT, SLOW!!!
      void       Print(Option_t *option) const;    // Prints vector
      void       PrintList();                      // Prints vector and the following linked list
      Int_t      GetDim() const { return fDim; }   // Returns dimension
      Double_t   GetCoord(Int_t i) const { return fCoords[i]; }   // Returns coordinate

      ClassDef(PDEFoamVect,1) //n-dimensional vector with dynamical allocation
   }; // end of PDEFoamVect
}  // namespace TMVA

#endif
 PDEFoam.h:1
 PDEFoam.h:2
 PDEFoam.h:3
 PDEFoam.h:4
 PDEFoam.h:5
 PDEFoam.h:6
 PDEFoam.h:7
 PDEFoam.h:8
 PDEFoam.h:9
 PDEFoam.h:10
 PDEFoam.h:11
 PDEFoam.h:12
 PDEFoam.h:13
 PDEFoam.h:14
 PDEFoam.h:15
 PDEFoam.h:16
 PDEFoam.h:17
 PDEFoam.h:18
 PDEFoam.h:19
 PDEFoam.h:20
 PDEFoam.h:21
 PDEFoam.h:22
 PDEFoam.h:23
 PDEFoam.h:24
 PDEFoam.h:25
 PDEFoam.h:26
 PDEFoam.h:27
 PDEFoam.h:28
 PDEFoam.h:29
 PDEFoam.h:30
 PDEFoam.h:31
 PDEFoam.h:32
 PDEFoam.h:33
 PDEFoam.h:34
 PDEFoam.h:35
 PDEFoam.h:36
 PDEFoam.h:37
 PDEFoam.h:38
 PDEFoam.h:39
 PDEFoam.h:40
 PDEFoam.h:41
 PDEFoam.h:42
 PDEFoam.h:43
 PDEFoam.h:44
 PDEFoam.h:45
 PDEFoam.h:46
 PDEFoam.h:47
 PDEFoam.h:48
 PDEFoam.h:49
 PDEFoam.h:50
 PDEFoam.h:51
 PDEFoam.h:52
 PDEFoam.h:53
 PDEFoam.h:54
 PDEFoam.h:55
 PDEFoam.h:56
 PDEFoam.h:57
 PDEFoam.h:58
 PDEFoam.h:59
 PDEFoam.h:60
 PDEFoam.h:61
 PDEFoam.h:62
 PDEFoam.h:63
 PDEFoam.h:64
 PDEFoam.h:65
 PDEFoam.h:66
 PDEFoam.h:67
 PDEFoam.h:68
 PDEFoam.h:69
 PDEFoam.h:70
 PDEFoam.h:71
 PDEFoam.h:72
 PDEFoam.h:73
 PDEFoam.h:74
 PDEFoam.h:75
 PDEFoam.h:76
 PDEFoam.h:77
 PDEFoam.h:78
 PDEFoam.h:79
 PDEFoam.h:80
 PDEFoam.h:81
 PDEFoam.h:82
 PDEFoam.h:83
 PDEFoam.h:84
 PDEFoam.h:85
 PDEFoam.h:86
 PDEFoam.h:87
 PDEFoam.h:88
 PDEFoam.h:89
 PDEFoam.h:90
 PDEFoam.h:91
 PDEFoam.h:92
 PDEFoam.h:93
 PDEFoam.h:94
 PDEFoam.h:95
 PDEFoam.h:96
 PDEFoam.h:97
 PDEFoam.h:98
 PDEFoam.h:99
 PDEFoam.h:100
 PDEFoam.h:101
 PDEFoam.h:102
 PDEFoam.h:103
 PDEFoam.h:104
 PDEFoam.h:105
 PDEFoam.h:106
 PDEFoam.h:107
 PDEFoam.h:108
 PDEFoam.h:109
 PDEFoam.h:110
 PDEFoam.h:111
 PDEFoam.h:112
 PDEFoam.h:113
 PDEFoam.h:114
 PDEFoam.h:115
 PDEFoam.h:116
 PDEFoam.h:117
 PDEFoam.h:118
 PDEFoam.h:119
 PDEFoam.h:120
 PDEFoam.h:121
 PDEFoam.h:122
 PDEFoam.h:123
 PDEFoam.h:124
 PDEFoam.h:125
 PDEFoam.h:126
 PDEFoam.h:127
 PDEFoam.h:128
 PDEFoam.h:129
 PDEFoam.h:130
 PDEFoam.h:131
 PDEFoam.h:132
 PDEFoam.h:133
 PDEFoam.h:134
 PDEFoam.h:135
 PDEFoam.h:136
 PDEFoam.h:137
 PDEFoam.h:138
 PDEFoam.h:139
 PDEFoam.h:140
 PDEFoam.h:141
 PDEFoam.h:142
 PDEFoam.h:143
 PDEFoam.h:144
 PDEFoam.h:145
 PDEFoam.h:146
 PDEFoam.h:147
 PDEFoam.h:148
 PDEFoam.h:149
 PDEFoam.h:150
 PDEFoam.h:151
 PDEFoam.h:152
 PDEFoam.h:153
 PDEFoam.h:154
 PDEFoam.h:155
 PDEFoam.h:156
 PDEFoam.h:157
 PDEFoam.h:158
 PDEFoam.h:159
 PDEFoam.h:160
 PDEFoam.h:161
 PDEFoam.h:162
 PDEFoam.h:163
 PDEFoam.h:164
 PDEFoam.h:165
 PDEFoam.h:166
 PDEFoam.h:167
 PDEFoam.h:168
 PDEFoam.h:169
 PDEFoam.h:170
 PDEFoam.h:171
 PDEFoam.h:172
 PDEFoam.h:173
 PDEFoam.h:174
 PDEFoam.h:175
 PDEFoam.h:176
 PDEFoam.h:177
 PDEFoam.h:178
 PDEFoam.h:179
 PDEFoam.h:180
 PDEFoam.h:181
 PDEFoam.h:182
 PDEFoam.h:183
 PDEFoam.h:184
 PDEFoam.h:185
 PDEFoam.h:186
 PDEFoam.h:187
 PDEFoam.h:188
 PDEFoam.h:189
 PDEFoam.h:190
 PDEFoam.h:191
 PDEFoam.h:192
 PDEFoam.h:193
 PDEFoam.h:194
 PDEFoam.h:195
 PDEFoam.h:196
 PDEFoam.h:197
 PDEFoam.h:198
 PDEFoam.h:199
 PDEFoam.h:200
 PDEFoam.h:201
 PDEFoam.h:202
 PDEFoam.h:203
 PDEFoam.h:204
 PDEFoam.h:205
 PDEFoam.h:206
 PDEFoam.h:207
 PDEFoam.h:208
 PDEFoam.h:209
 PDEFoam.h:210
 PDEFoam.h:211
 PDEFoam.h:212
 PDEFoam.h:213
 PDEFoam.h:214
 PDEFoam.h:215
 PDEFoam.h:216
 PDEFoam.h:217
 PDEFoam.h:218
 PDEFoam.h:219
 PDEFoam.h:220
 PDEFoam.h:221
 PDEFoam.h:222
 PDEFoam.h:223
 PDEFoam.h:224
 PDEFoam.h:225
 PDEFoam.h:226
 PDEFoam.h:227
 PDEFoam.h:228
 PDEFoam.h:229
 PDEFoam.h:230
 PDEFoam.h:231
 PDEFoam.h:232
 PDEFoam.h:233
 PDEFoam.h:234
 PDEFoam.h:235
 PDEFoam.h:236
 PDEFoam.h:237
 PDEFoam.h:238
 PDEFoam.h:239
 PDEFoam.h:240
 PDEFoam.h:241
 PDEFoam.h:242
 PDEFoam.h:243
 PDEFoam.h:244
 PDEFoam.h:245
 PDEFoam.h:246
 PDEFoam.h:247
 PDEFoam.h:248
 PDEFoam.h:249
 PDEFoam.h:250
 PDEFoam.h:251
 PDEFoam.h:252
 PDEFoam.h:253
 PDEFoam.h:254
 PDEFoam.h:255
 PDEFoam.h:256
 PDEFoam.h:257
 PDEFoam.h:258
 PDEFoam.h:259
 PDEFoam.h:260
 PDEFoam.h:261
 PDEFoam.h:262
 PDEFoam.h:263
 PDEFoam.h:264
 PDEFoam.h:265
 PDEFoam.h:266
 PDEFoam.h:267
 PDEFoam.h:268
 PDEFoam.h:269
 PDEFoam.h:270
 PDEFoam.h:271
 PDEFoam.h:272
 PDEFoam.h:273
 PDEFoam.h:274
 PDEFoam.h:275
 PDEFoam.h:276
 PDEFoam.h:277
 PDEFoam.h:278
 PDEFoam.h:279
 PDEFoam.h:280
 PDEFoam.h:281
 PDEFoam.h:282
 PDEFoam.h:283
 PDEFoam.h:284
 PDEFoam.h:285
 PDEFoam.h:286
 PDEFoam.h:287
 PDEFoam.h:288
 PDEFoam.h:289
 PDEFoam.h:290
 PDEFoam.h:291
 PDEFoam.h:292
 PDEFoam.h:293
 PDEFoam.h:294
 PDEFoam.h:295
 PDEFoam.h:296
 PDEFoam.h:297
 PDEFoam.h:298
 PDEFoam.h:299
 PDEFoam.h:300
 PDEFoam.h:301
 PDEFoam.h:302
 PDEFoam.h:303
 PDEFoam.h:304
 PDEFoam.h:305
 PDEFoam.h:306
 PDEFoam.h:307
 PDEFoam.h:308
 PDEFoam.h:309
 PDEFoam.h:310
 PDEFoam.h:311
 PDEFoam.h:312
 PDEFoam.h:313
 PDEFoam.h:314
 PDEFoam.h:315
 PDEFoam.h:316
 PDEFoam.h:317
 PDEFoam.h:318
 PDEFoam.h:319
 PDEFoam.h:320
 PDEFoam.h:321
 PDEFoam.h:322
 PDEFoam.h:323
 PDEFoam.h:324
 PDEFoam.h:325
 PDEFoam.h:326
 PDEFoam.h:327
 PDEFoam.h:328
 PDEFoam.h:329
 PDEFoam.h:330
 PDEFoam.h:331
 PDEFoam.h:332
 PDEFoam.h:333
 PDEFoam.h:334
 PDEFoam.h:335
 PDEFoam.h:336
 PDEFoam.h:337
 PDEFoam.h:338
 PDEFoam.h:339
 PDEFoam.h:340
 PDEFoam.h:341
 PDEFoam.h:342
 PDEFoam.h:343
 PDEFoam.h:344
 PDEFoam.h:345
 PDEFoam.h:346
 PDEFoam.h:347
 PDEFoam.h:348
 PDEFoam.h:349
 PDEFoam.h:350
 PDEFoam.h:351
 PDEFoam.h:352
 PDEFoam.h:353
 PDEFoam.h:354
 PDEFoam.h:355
 PDEFoam.h:356
 PDEFoam.h:357
 PDEFoam.h:358
 PDEFoam.h:359
 PDEFoam.h:360
 PDEFoam.h:361
 PDEFoam.h:362
 PDEFoam.h:363
 PDEFoam.h:364
 PDEFoam.h:365
 PDEFoam.h:366
 PDEFoam.h:367
 PDEFoam.h:368
 PDEFoam.h:369
 PDEFoam.h:370
 PDEFoam.h:371
 PDEFoam.h:372
 PDEFoam.h:373
 PDEFoam.h:374
 PDEFoam.h:375
 PDEFoam.h:376
 PDEFoam.h:377
 PDEFoam.h:378
 PDEFoam.h:379
 PDEFoam.h:380
 PDEFoam.h:381
 PDEFoam.h:382
 PDEFoam.h:383
 PDEFoam.h:384
 PDEFoam.h:385
 PDEFoam.h:386
 PDEFoam.h:387
 PDEFoam.h:388
 PDEFoam.h:389
 PDEFoam.h:390
 PDEFoam.h:391
 PDEFoam.h:392
 PDEFoam.h:393
 PDEFoam.h:394
 PDEFoam.h:395
 PDEFoam.h:396
 PDEFoam.h:397
 PDEFoam.h:398
 PDEFoam.h:399
 PDEFoam.h:400
 PDEFoam.h:401
 PDEFoam.h:402
 PDEFoam.h:403
 PDEFoam.h:404
 PDEFoam.h:405
 PDEFoam.h:406
 PDEFoam.h:407
 PDEFoam.h:408
 PDEFoam.h:409
 PDEFoam.h:410
 PDEFoam.h:411
 PDEFoam.h:412
 PDEFoam.h:413
 PDEFoam.h:414
 PDEFoam.h:415
 PDEFoam.h:416
 PDEFoam.h:417
 PDEFoam.h:418
 PDEFoam.h:419
 PDEFoam.h:420
 PDEFoam.h:421
 PDEFoam.h:422
 PDEFoam.h:423
 PDEFoam.h:424
 PDEFoam.h:425
 PDEFoam.h:426
 PDEFoam.h:427
 PDEFoam.h:428
 PDEFoam.h:429
 PDEFoam.h:430
 PDEFoam.h:431
 PDEFoam.h:432
 PDEFoam.h:433
 PDEFoam.h:434
 PDEFoam.h:435
 PDEFoam.h:436
 PDEFoam.h:437
 PDEFoam.h:438
 PDEFoam.h:439
 PDEFoam.h:440
 PDEFoam.h:441
 PDEFoam.h:442
 PDEFoam.h:443
 PDEFoam.h:444
 PDEFoam.h:445
 PDEFoam.h:446
 PDEFoam.h:447
 PDEFoam.h:448
 PDEFoam.h:449
 PDEFoam.h:450
 PDEFoam.h:451
 PDEFoam.h:452
 PDEFoam.h:453
 PDEFoam.h:454
 PDEFoam.h:455
 PDEFoam.h:456
 PDEFoam.h:457
 PDEFoam.h:458
 PDEFoam.h:459
 PDEFoam.h:460
 PDEFoam.h:461
 PDEFoam.h:462
 PDEFoam.h:463
 PDEFoam.h:464
 PDEFoam.h:465
 PDEFoam.h:466
 PDEFoam.h:467
 PDEFoam.h:468
 PDEFoam.h:469
 PDEFoam.h:470
 PDEFoam.h:471
 PDEFoam.h:472
 PDEFoam.h:473
 PDEFoam.h:474
 PDEFoam.h:475
 PDEFoam.h:476
 PDEFoam.h:477
 PDEFoam.h:478
 PDEFoam.h:479
 PDEFoam.h:480
 PDEFoam.h:481
 PDEFoam.h:482
 PDEFoam.h:483
 PDEFoam.h:484
 PDEFoam.h:485
 PDEFoam.h:486
 PDEFoam.h:487
 PDEFoam.h:488
 PDEFoam.h:489
 PDEFoam.h:490
 PDEFoam.h:491
 PDEFoam.h:492
 PDEFoam.h:493
 PDEFoam.h:494
 PDEFoam.h:495
 PDEFoam.h:496
 PDEFoam.h:497
 PDEFoam.h:498
 PDEFoam.h:499
 PDEFoam.h:500
 PDEFoam.h:501
 PDEFoam.h:502
 PDEFoam.h:503
 PDEFoam.h:504
 PDEFoam.h:505
 PDEFoam.h:506
 PDEFoam.h:507
 PDEFoam.h:508
 PDEFoam.h:509
 PDEFoam.h:510
 PDEFoam.h:511
 PDEFoam.h:512
 PDEFoam.h:513
 PDEFoam.h:514
 PDEFoam.h:515
 PDEFoam.h:516
 PDEFoam.h:517
 PDEFoam.h:518
 PDEFoam.h:519
 PDEFoam.h:520
 PDEFoam.h:521
 PDEFoam.h:522
 PDEFoam.h:523
 PDEFoam.h:524
 PDEFoam.h:525
 PDEFoam.h:526
 PDEFoam.h:527
 PDEFoam.h:528
 PDEFoam.h:529
 PDEFoam.h:530
 PDEFoam.h:531
 PDEFoam.h:532
 PDEFoam.h:533
 PDEFoam.h:534
 PDEFoam.h:535
 PDEFoam.h:536
 PDEFoam.h:537
 PDEFoam.h:538
 PDEFoam.h:539
 PDEFoam.h:540
 PDEFoam.h:541
 PDEFoam.h:542
 PDEFoam.h:543
 PDEFoam.h:544
 PDEFoam.h:545
 PDEFoam.h:546
 PDEFoam.h:547
 PDEFoam.h:548
 PDEFoam.h:549
 PDEFoam.h:550
 PDEFoam.h:551
 PDEFoam.h:552
 PDEFoam.h:553
 PDEFoam.h:554
 PDEFoam.h:555
 PDEFoam.h:556
 PDEFoam.h:557
 PDEFoam.h:558
 PDEFoam.h:559
 PDEFoam.h:560
 PDEFoam.h:561
 PDEFoam.h:562
 PDEFoam.h:563
 PDEFoam.h:564
 PDEFoam.h:565
 PDEFoam.h:566
 PDEFoam.h:567
 PDEFoam.h:568
 PDEFoam.h:569
 PDEFoam.h:570
 PDEFoam.h:571
 PDEFoam.h:572
 PDEFoam.h:573
 PDEFoam.h:574
 PDEFoam.h:575
 PDEFoam.h:576
 PDEFoam.h:577
 PDEFoam.h:578
 PDEFoam.h:579
 PDEFoam.h:580
 PDEFoam.h:581
 PDEFoam.h:582
 PDEFoam.h:583
 PDEFoam.h:584
 PDEFoam.h:585
 PDEFoam.h:586
 PDEFoam.h:587
 PDEFoam.h:588
 PDEFoam.h:589
 PDEFoam.h:590
 PDEFoam.h:591
 PDEFoam.h:592
 PDEFoam.h:593
 PDEFoam.h:594
 PDEFoam.h:595
 PDEFoam.h:596
 PDEFoam.h:597
 PDEFoam.h:598
 PDEFoam.h:599
 PDEFoam.h:600
 PDEFoam.h:601
 PDEFoam.h:602
 PDEFoam.h:603
 PDEFoam.h:604
 PDEFoam.h:605
 PDEFoam.h:606
 PDEFoam.h:607
 PDEFoam.h:608
 PDEFoam.h:609
 PDEFoam.h:610
 PDEFoam.h:611
 PDEFoam.h:612
 PDEFoam.h:613
 PDEFoam.h:614
 PDEFoam.h:615
 PDEFoam.h:616
 PDEFoam.h:617
 PDEFoam.h:618
 PDEFoam.h:619
 PDEFoam.h:620
 PDEFoam.h:621
 PDEFoam.h:622
 PDEFoam.h:623
 PDEFoam.h:624
 PDEFoam.h:625
 PDEFoam.h:626
 PDEFoam.h:627
 PDEFoam.h:628
 PDEFoam.h:629
 PDEFoam.h:630
 PDEFoam.h:631
 PDEFoam.h:632
 PDEFoam.h:633
 PDEFoam.h:634
 PDEFoam.h:635
 PDEFoam.h:636
 PDEFoam.h:637
 PDEFoam.h:638
 PDEFoam.h:639
 PDEFoam.h:640
 PDEFoam.h:641
 PDEFoam.h:642
 PDEFoam.h:643
 PDEFoam.h:644
 PDEFoam.h:645
 PDEFoam.h:646
 PDEFoam.h:647
 PDEFoam.h:648
 PDEFoam.h:649
 PDEFoam.h:650
 PDEFoam.h:651
 PDEFoam.h:652
 PDEFoam.h:653
 PDEFoam.h:654
 PDEFoam.h:655
 PDEFoam.h:656
 PDEFoam.h:657
 PDEFoam.h:658
 PDEFoam.h:659
 PDEFoam.h:660
 PDEFoam.h:661
 PDEFoam.h:662
 PDEFoam.h:663
 PDEFoam.h:664
 PDEFoam.h:665
 PDEFoam.h:666
 PDEFoam.h:667
 PDEFoam.h:668
 PDEFoam.h:669
 PDEFoam.h:670
 PDEFoam.h:671
 PDEFoam.h:672
 PDEFoam.h:673
 PDEFoam.h:674
 PDEFoam.h:675
 PDEFoam.h:676
 PDEFoam.h:677
 PDEFoam.h:678
 PDEFoam.h:679
 PDEFoam.h:680
 PDEFoam.h:681
 PDEFoam.h:682
 PDEFoam.h:683
 PDEFoam.h:684
 PDEFoam.h:685
 PDEFoam.h:686
 PDEFoam.h:687
 PDEFoam.h:688
 PDEFoam.h:689
 PDEFoam.h:690
 PDEFoam.h:691
 PDEFoam.h:692
 PDEFoam.h:693
 PDEFoam.h:694
 PDEFoam.h:695
 PDEFoam.h:696
 PDEFoam.h:697
 PDEFoam.h:698
 PDEFoam.h:699
 PDEFoam.h:700
 PDEFoam.h:701
 PDEFoam.h:702
 PDEFoam.h:703
 PDEFoam.h:704
 PDEFoam.h:705
 PDEFoam.h:706
 PDEFoam.h:707
 PDEFoam.h:708
 PDEFoam.h:709
 PDEFoam.h:710
 PDEFoam.h:711
 PDEFoam.h:712
 PDEFoam.h:713
 PDEFoam.h:714
 PDEFoam.h:715
 PDEFoam.h:716
 PDEFoam.h:717
 PDEFoam.h:718
 PDEFoam.h:719
 PDEFoam.h:720
 PDEFoam.h:721
 PDEFoam.h:722
 PDEFoam.h:723
 PDEFoam.h:724
 PDEFoam.h:725
 PDEFoam.h:726
 PDEFoam.h:727
 PDEFoam.h:728
 PDEFoam.h:729
 PDEFoam.h:730
 PDEFoam.h:731
 PDEFoam.h:732
 PDEFoam.h:733
 PDEFoam.h:734
 PDEFoam.h:735
 PDEFoam.h:736
 PDEFoam.h:737
 PDEFoam.h:738
 PDEFoam.h:739
 PDEFoam.h:740
 PDEFoam.h:741
 PDEFoam.h:742
 PDEFoam.h:743
 PDEFoam.h:744
 PDEFoam.h:745
 PDEFoam.h:746
 PDEFoam.h:747