Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:11:04

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  : ResultsClassification                                                 *
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_ResultsClassification
0030 #define ROOT_TMVA_ResultsClassification
0031 
0032 //////////////////////////////////////////////////////////////////////////
0033 //                                                                      //
0034 // ResultsClassification                                                //
0035 //                                                                      //
0036 // Class that is the derived-class for a vector of results              //
0037 //                                                                      //
0038 //////////////////////////////////////////////////////////////////////////
0039 
0040 #include <vector>
0041 
0042 #include "TMVA/Results.h"
0043 
0044 namespace TMVA {
0045 
0046 class MsgLogger;
0047 
0048 class ResultsClassification : public Results {
0049 
0050 public:
0051    ResultsClassification(const DataSetInfo *dsi, TString resultsName);
0052    ~ResultsClassification();
0053 
0054    // setters : set  score value and type for each single event.
0055    // note type=TRUE for signal and FLASE for background
0056    void SetValue(Float_t value, Int_t ievt, Bool_t type);
0057 
0058    void Resize(Int_t entries)
0059    {
0060       fMvaValues.resize(entries);
0061       fMvaValuesTypes.resize(entries);
0062    }
0063    using TObject::Clear;
0064    void Clear(Option_t *) override
0065    {
0066       fMvaValues.clear();
0067       fMvaValuesTypes.clear();
0068    }
0069 
0070    // getters
0071    Long64_t GetSize() const { return fMvaValues.size(); }
0072    const std::vector<Float_t> &operator[](Int_t ievt) const override
0073    {
0074       fRet[0] = fMvaValues[ievt];
0075       return fRet;
0076    }
0077    std::vector<Float_t> *GetValueVector() { return &fMvaValues; }
0078    std::vector<Bool_t> *GetValueVectorTypes() { return &fMvaValuesTypes; }
0079 
0080    Types::EAnalysisType GetAnalysisType() override { return Types::kClassification; }
0081 
0082 private:
0083    std::vector<Float_t> fMvaValues;     ///< mva values (Results)
0084    std::vector<Bool_t> fMvaValuesTypes; ///< mva values type(sig/bkg) (Results)
0085    mutable std::vector<Float_t> fRet;   ///< return val
0086    mutable MsgLogger *fLogger;          ///<! message logger
0087    MsgLogger &Log() const { return *fLogger; }
0088 
0089 protected:
0090    ClassDefOverride(ResultsClassification, 3);
0091 };
0092 } // namespace TMVA
0093 
0094 #endif