// Class: ReadPDEFoam // Automatically generated by MethodBase::MakeClass // /* configuration options ===================================================== #GEN -*-*-*-*-*-*-*-*-*-*-*- general info -*-*-*-*-*-*-*-*-*-*-*- Method : PDEFoam::PDEFoam TMVA Release : 4.2.1 [262657] ROOT Release : 6.41/01 [403713] Creator : root Date : Tue May 19 20:08:54 2026 Host : Linux d4f37374721b 4.18.0-553.117.1.el8_10.x86_64 #1 SMP Sun Apr 5 23:14:32 EDT 2026 x86_64 GNU/Linux Dir : /github/home/master/notebooks Training events: 4000 Analysis type : [Classification] #OPT -*-*-*-*-*-*-*-*-*-*-*-*- options -*-*-*-*-*-*-*-*-*-*-*-*- # Set by User: V: "False" [Verbose output (short form of "VerbosityLevel" below - overrides the latter one)] H: "False" [Print method-specific help message] TailCut: "1.000000e-03" [Fraction of outlier events that are excluded from the foam in each dimension] VolFrac: "6.660000e-02" [Size of sampling box, used for density calculation during foam build-up (maximum value: 1.0 is equivalent to volume of entire foam)] nActiveCells: "500" [Maximum number of active cells to be created by the foam] nSampl: "2000" [Number of generated MC events per cell] nBin: "5" [Number of bins in edge histograms] Compress: "True" [Compress foam output file] Nmin: "100" [Number of events in cell required to split cell] Kernel: "None" [Kernel type used] # Default: VerbosityLevel: "Default" [Verbosity level] VarTransform: "None" [List of variable transformations performed before training, e.g., "D_Background,P_Signal,G,N_AllClasses" for: "Decorrelation, PCA-transformation, Gaussianisation, Normalisation, each for the given class of events ('AllClasses' denotes all events of all classes, if no class indication is given, 'All' is assumed)"] CreateMVAPdfs: "False" [Create PDFs for classifier outputs (signal and background)] IgnoreNegWeightsInTraining: "False" [Events with negative weights are ignored in the training (but are included for testing and performance evaluation)] SigBgSeparate: "False" [Separate foams for signal and background] MultiTargetRegression: "False" [Do regression with multiple targets] MaxDepth: "0" [Maximum depth of cell tree (0=unlimited)] FillFoamWithOrigWeights: "False" [Fill foam with original or boost weights] UseYesNoCell: "False" [Return -1 or 1 for bkg or signal like events] DTLogic: "None" [Use decision tree algorithm to split cells] TargetSelection: "Mean" [Target selection method] ## #VAR -*-*-*-*-*-*-*-*-*-*-*-* variables *-*-*-*-*-*-*-*-*-*-*-*- NVar 4 var1 var1 var1 var1 'F' [-4.05916023254,3.26447582245] var2 var2 var2 Variable 2 'F' [-3.68905711174,3.78774046898] var3 var3 var3 Variable 3 units 'F' [-3.6296145916,3.91998791695] var4 var4 var4 Variable 4 units 'F' [-4.84856987,4.3625254631] NSpec 0 ============================================================================ */ #include #include #include #include #include #ifndef IClassifierReader__def #define IClassifierReader__def class IClassifierReader { public: // constructor IClassifierReader() : fStatusIsClean( true ) {} virtual ~IClassifierReader() {} // return classifier response virtual std::vector GetMulticlassValues( const std::vector& inputValues ) const = 0; // returns classifier status bool IsStatusClean() const { return fStatusIsClean; } protected: bool fStatusIsClean; }; #endif class ReadPDEFoam : public IClassifierReader { public: // constructor ReadPDEFoam( std::vector& theInputVars ) : IClassifierReader(), fClassName( "ReadPDEFoam" ), fNvars( 4 ) { // the training input variables const char* inputVars[] = { "var1", "var2", "var3", "var4" }; // sanity checks if (theInputVars.size() <= 0) { std::cout << "Problem in class \"" << fClassName << "\": empty input vector" << std::endl; fStatusIsClean = false; } if (theInputVars.size() != fNvars) { std::cout << "Problem in class \"" << fClassName << "\": mismatch in number of input values: " << theInputVars.size() << " != " << fNvars << std::endl; fStatusIsClean = false; } // validate input variables for (size_t ivar = 0; ivar < theInputVars.size(); ivar++) { if (theInputVars[ivar] != inputVars[ivar]) { std::cout << "Problem in class \"" << fClassName << "\": mismatch in input variable names" << std::endl << " for variable [" << ivar << "]: " << theInputVars[ivar].c_str() << " != " << inputVars[ivar] << std::endl; fStatusIsClean = false; } } // initialize min and max vectors (for normalisation) fVmin[0] = 0; fVmax[0] = 0; fVmin[1] = 0; fVmax[1] = 0; fVmin[2] = 0; fVmax[2] = 0; fVmin[3] = 0; fVmax[3] = 0; // initialize input variable types fType[0] = 'F'; fType[1] = 'F'; fType[2] = 'F'; fType[3] = 'F'; // initialize constants Initialize(); } // destructor virtual ~ReadPDEFoam() { Clear(); // method-specific } // the classifier response // "inputValues" is a vector of input values in the same order as the // variables given to the constructor std::vector GetMulticlassValues( const std::vector& inputValues ) const override; private: // method-specific destructor void Clear(); // common member variables const char* fClassName; const size_t fNvars; size_t GetNvar() const { return fNvars; } char GetType( int ivar ) const { return fType[ivar]; } // normalisation of input variables double fVmin[4]; double fVmax[4]; double NormVariable( double x, double xmin, double xmax ) const { // normalise to output range: [-1, 1] return 2*(x - xmin)/(xmax - xmin) - 1.0; } // type of input variable: 'F' or 'I' char fType[4]; // initialize internal variables void Initialize(); std::vector GetMulticlassValues__( const std::vector& inputValues ) const; // private members (method specific) inline std::vector ReadPDEFoam::GetMulticlassValues( const std::vector& inputValues ) const { // classifier response value std::vector retval; // classifier response, sanity check first if (!IsStatusClean()) { std::cout << "Problem in class \"" << fClassName << "\": cannot return classifier response" << " because status is dirty" << std::endl; } else { retval = GetMulticlassValues__( inputValues ); } return retval; }