Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 10:22:57

0001 // @(#)root/tmva $Id$
0002 // Author: Andreas Hoecker, Peter Speckmayer, Joerg Stelzer, Helge Voss
0003 
0004 /**********************************************************************************
0005  * Project: TMVA - a Root-integrated toolkit for multivariate data analysis       *
0006  * Package: TMVA                                                                  *
0007  * Class  : ResultsRegression                                                     *
0008  *                                                                                *
0009  *                                                                                *
0010  * Description:                                                                   *
0011  *      Derived-class for result-vectors                                          *
0012  *                                                                                *
0013  * Authors (alphabetical):                                                        *
0014  *      Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland              *
0015  *      Peter Speckmayer <Peter.Speckmayer@cern.ch>  - CERN, Switzerland          *
0016  *      Joerg Stelzer   <Joerg.Stelzer@cern.ch>  - CERN, Switzerland              *
0017  *      Helge Voss      <Helge.Voss@cern.ch>     - MPI-K Heidelberg, Germany      *
0018  *                                                                                *
0019  * Copyright (c) 2006:                                                            *
0020  *      CERN, Switzerland                                                         *
0021  *      U. of Victoria, Canada                                                    *
0022  *      MPI-K Heidelberg, Germany                                                 *
0023  *                                                                                *
0024  * Redistribution and use in source and binary forms, with or without             *
0025  * modification, are permitted according to the terms listed in LICENSE           *
0026  * (see tmva/doc/LICENSE)                                                         *
0027  **********************************************************************************/
0028 
0029 #ifndef ROOT_TMVA_ResultsRegression
0030 #define ROOT_TMVA_ResultsRegression
0031 
0032 //////////////////////////////////////////////////////////////////////////
0033 //                                                                      //
0034 // ResultsRegression                                                    //
0035 //                                                                      //
0036 // Class that is the derived-class for a vector of results              //
0037 //                                                                      //
0038 //////////////////////////////////////////////////////////////////////////
0039 
0040 #include <vector>
0041 
0042 #include "TH1F.h"
0043 #include "TH2F.h"
0044 
0045 #include "TMVA/Results.h"
0046 #include "TMVA/Event.h"
0047 
0048 namespace TMVA {
0049 
0050 class MsgLogger;
0051 
0052 class ResultsRegression : public Results {
0053 
0054 public:
0055    ResultsRegression(const DataSetInfo *dsi, TString resultsName);
0056    ~ResultsRegression();
0057 
0058    // setters
0059    void SetValue(std::vector<Float_t> &value, Int_t ievt);
0060    void Resize(Int_t entries) { fRegValues.resize(entries); }
0061 
0062    using TObject::Clear;
0063    void Clear(Option_t *) override { fRegValues.clear(); }
0064 
0065    // getters
0066    Long64_t GetSize() const { return fRegValues.size(); }
0067    const std::vector<Float_t> &operator[](Int_t ievt) const override { return fRegValues.at(ievt); }
0068    std::vector<std::vector<Float_t>> *GetValueVector() { return &fRegValues; }
0069 
0070    TH2F *DeviationAsAFunctionOf(UInt_t varNum, UInt_t tgtNum);
0071    TH1F *QuadraticDeviation(UInt_t tgtNum, Bool_t truncate = false, Double_t truncvalue = 0.);
0072    void CreateDeviationHistograms(TString prefix);
0073 
0074    Types::EAnalysisType GetAnalysisType() override { return Types::kRegression; }
0075 
0076 private:
0077    mutable std::vector<std::vector<Float_t>> fRegValues; ///< mva values (Results)
0078    mutable MsgLogger *fLogger;                           ///<! message logger
0079    MsgLogger &Log() const { return *fLogger; }
0080 
0081 protected:
0082    ClassDefOverride(ResultsRegression, 3);
0083 };
0084 } // namespace TMVA
0085 
0086 #endif