Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:32:53

0001 /*****************************************************************************
0002  * Project: RooFit                                                           *
0003  * Package: RooFitCore                                                       *
0004  *    File: $Id$
0005  * Authors:                                                                  *
0006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
0007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
0008  *                                                                           *
0009  * Copyright (c) 2000-2005, Regents of the University of California          *
0010  *                          and Stanford University. All rights reserved.    *
0011  *                                                                           *
0012  * Redistribution and use in source and binary forms,                        *
0013  * with or without modification, are permitted according to the terms        *
0014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
0015  *****************************************************************************/
0016 
0017 #ifndef ROO_CHI2_MCS_MODULE
0018 #define ROO_CHI2_MCS_MODULE
0019 
0020 #include "RooAbsMCStudyModule.h"
0021 
0022 #include <memory>
0023 
0024 class RooChi2MCSModule : public RooAbsMCStudyModule {
0025 public:
0026 
0027   RooChi2MCSModule() ;
0028   RooChi2MCSModule(const RooChi2MCSModule& other) ;
0029   ~RooChi2MCSModule() override ;
0030 
0031   bool initializeInstance() override ;
0032   bool initializeRun(Int_t /*numSamples*/) override ;
0033   RooDataSet* finalizeRun() override ;
0034   bool processAfterFit(Int_t /*sampleNum*/) override  ;
0035 
0036 private:
0037    std::unique_ptr<RooDataSet> _data;    // Summary dataset to store results
0038    std::unique_ptr<RooRealVar> _chi2;    // Chi^2 of function w.r.t. data
0039    std::unique_ptr<RooRealVar> _ndof;    // Number of degrees of freedom
0040    std::unique_ptr<RooRealVar> _chi2red; // Reduced Chi^2 w.r.t data
0041    std::unique_ptr<RooRealVar> _prob;    // Probability of chi^2,nDOF combination
0042 
0043    ClassDefOverride(RooChi2MCSModule, 0) // MCStudy module to calculate chi2 between binned data and fit
0044 };
0045 
0046 #endif