Recent Changes · Search:

Dispense


Navigation Tips - Dritte


PmWiki

pmwiki.org

edit SideBar

Data

< Mujpy.Methods2 | Index | Mujpy.GlobalFits >


Data handling

Try: mumodel knows it all. -load_ always passes the full suite and reassigns _add_ (overloads it) to act differently for fit and plot, seamlessly. No need to know fit type. Fit knows it and can load onto mumodel the correct behaviour for itself and for plot, by _add_ overload.

  • musuite class
  • an instance provides access to a set of experimental runs and methods to obtain their asymmetry for different groupings. the run set and groupings are specified as _init_ arguments
    • musuite.asymmetry_single(the_run.kgroup) returns 1d arrays asymmetry and standard deviations (a,e in the following), adding runs in the list the_run, each containing a run number string
    • musuite.single_for_back_counts provides the same for calibration fits, where {$\alpha$} are parameters and data are recalculated for each migrad step (could speed up by checking that {$\alpha$} changed indeed)
    • musuite.asymmetry_slice(krun,kgroup) returns
      • 1d asymmetry_single(krun,kgroup) result for a given pair of legal positive integers
      • a 2d vstack spanning the whole set if either the first or the second integer is -1, e.g. krun = -1 includes all runs in the set
      • a 3d vstack if both integers are -1
  • probably the mufitplot handling of list / array dimensions is still wrong and it is sorted out by tools.rshp squeezing. It should be corrected eventually, but it works for the time being;
  • remember that self.lastfit must not be appended directly to self.lastfits because they are all the same Minuit instance and any migrad changes also all previous results
    • lastfits now appends list(self.lastfit.values) instead.

  • mufit class
    • an instance must specify a suite instance, and it provies a model method as an instance of the following
    • the fit uses suite.asymmetry_slice or suite.slice_for_back_counts to select the data slice for the fit. Namely
      • A1, A20, B1, B20 1d slices
      • A21, B21 2d slices (multigroup)
      • C1 2d slices (multirun)
      • C2 3d slice
  • mumodel class (in mucomponents)
    • an instance provides the model functions
    • it must be loaded by either the _load_ or the _load_calib_ methods to redirect the _add_(t,*par) method, overloaded to produce the correct it function f.
    • @@_
    • both load unbinned data and rely on _reload_/_reload_calib_ methods to produce rebinned _x_,_y_,_e_ methods
  • mufitplot class
    • an instance specifies a fit, hence its model, its suite and its fit slices;
    • fits A1, A21, C1, C2, the suite coincides with the fit slice
      • self.model._add_(t,*self.lastfit.values) can be used to produce the fit function for plotting: 1d for A1, 2d vstack for A21, C1, 3d vstack for C2
    • sequential fits, A20, B1, B20, B21, the suite is larger than the fit slice, the function used for plotting must extend the self.model._add_ method
      • self.model._add_plot_(t,*val) uses fstack with val in self.lastfits

Specific fit and plot type data handling

There are eight different types of fit. Sequential or global fits load different slice of the suite in the model. Plot need to rebin in several ways (data, plot function and chi2 histograms). Furthermore sequential plot needs to load again the slice at suite level. Specifically

  • A1
    • suite is single run, single groups
    • fit loads 1d arrays into model and produces a lastfit method (lastfit.values are the best fit parameters)
    • plot accesses the same _add_ as fit and rebins via reload, overloaded to mumodel _reload_
  • A20
    • suite is single run, multi groups
    • sequential fit loads 1d rebinned slices into model and produces a lastfits list of lastfit instances
    • plot accesses mumodel._re_/_re_load_calib_ to change 1d slice from suite, without changing other model methods, and before rebinning by mudel._reload_/_reload_calib_

< Mujpy.Methods2 | Index | Mujpy.GlobalFits >

Edit - History - Print - PDF - Recent Changes - Search
Page last modified on July 21, 2026, at 10:11 AM