Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Physics python tutorials #15567

Closed
wants to merge 2,137 commits into from
Closed

Conversation

PPaye
Copy link

@PPaye PPaye commented May 19, 2024

This Pull request:

Adds a Physics Tutorials translation into Python.

Checklist:

  • [yes] tested changes locally
  • [yes] updated the docs (if necessary)

guitargeek and others added 30 commits October 24, 2023 22:47
The `R__HAS_ROOFIT_MULTIPROCESS` is not used in any public header files,
so it's not needed. In the RooFit implementation, it is replaced with a
`ROOFIT_MULTIPROCESS` define that is part of the RooFitCore target.

The `R__HAS_ROOFIT_MULTIPROCESS` was only introduced in ROOT 6.26 and it
was never advocated to users, so it should be safe to remove it.
The `roofitmore` is only compiled anyway if mathmore is available.
In RooFit, there are checks if ROOT is build with CUDA only in the
`.cxx` implementation files, not in the public headers. We therefore
don't need a `R__HAS_CUDA` in the ROOT configuration.

The `R__HAS_CUDA` flag was only introduced in ROOT 6.26 and it was never
advocated to users, so it should be safe to remove it.
This commit enables serialization of the Python proxy defined within cppyy to
the C++ std::runtime_error class. By doing so, we avoid errors that happen in
certain configurations of Dask tasks where a std::runtime_error may be thrown
within the event loop itself. Recent CI failures report the following:

```
  RDataFrame::Run: event loop was interrupted
  Warning in <TBufferFile::WriteObjectAny>: since runtime_error has no public constructor
	which can be called without argument, objects of this class
	can not be read with the current library. You will need to
	add a default constructor before attempting to read it.
  Warning in <TStreamerInfo::Build>: runtime_error: base class exception has no streamer or dictionary it will not be saved
  Warning in <TStreamerInfo::Build>: runtime_error: __cow_string has no streamer or dictionary, data member "_M_msg" will not be saved
  Error in <TClass::New>: cannot create object of class runtime_error
  Error in <TBufferFile::ReadObject>: could not create object of class runtime_error
   *** Break *** segmentation violation
```

This is due to the fact that for some reason the std::runtime_error object is
serialized at the end of the function scope within the Dask task. The
culprit is the [tblib](https://github.com/ionelmc/python-tblib) Python
package, a dependency of Dask. Its most recent version (3.0.0)
released on October 22th changes the pickling behaviour of exception
objects, which is now evidently more enforced than before. Downgrading
to previous versions of tblib make the errors above disappear in the
distributed RDataFrame tests.
TGraph2DPainter keep pointers on TGraph2D data,
but was not checking if these values were changed.

Fixes problem reported https://root-forum.cern.ch/t/56816/
When searching for a new point between p1 and p2, if MnCross fails, retry using  a position closer to p1 instead of the middle. Thsi is what is done in old TMinuit.
Minuit2 was trying to switch direction of the search and this was causing
finding points in the opposite side  of contour and messing up the order.

Improve also debugging of MnContour
    The computed value of the Minos error was WRONG when parameter+error is over the limit, but the minos point is before the limit.
    Thsi can happen for example when computing a limit on a fraction parameter that is bound to be less than 1.
…en g2 is zero

When g2 is zero better using an arbitrary value of 1 in the covariance then a very large one, which can be problematic.
This commit restores what is so far used in the legacy TMinuit
…s are not present

In this case the limit value is zero, so a special treatment is needed to check if a limit is present or not

Add also suggestion by Jonas review
After previous commits finding the contour works now in Minuit2
…ed covariance

Use precision.Eps() instead of precision.Eps2() for threshold for the lower values for the initial seed covariance matrix
ReadObj returns an owning pointer.
Using dynamic_cast and ignoring the "not castable" case can
leak memory.

See: https://root-forum.cern.ch/t/possible-leak-with-dynamic-cast-and-tkey-readobj/56799
* Correct code highlighting in doxygen

* Fix some references to other functions and classes in the reference
  guide

* Add a section that summarizes the relevent implementation details for
  RooFit AD
In particular, make sure that the brief class description is not too
verbose and does not repeat the class name.
For his work on the RooFit Developer Documentation.
While histogram not stored with TGraph2D, it should be
append to the pad list of primitives and drawn independently
Otherwise TF1::Save store wrong values, which difficult to use
In some old examples "same" and "sames" draw options for TF1 was used.
Currently if "sames" used for TF1 - plain histogram painting is
performed which is wrong for the function.

Also improve PMC/PLC/PFC handling
1. Fix - proper fit pars display in stats, proper #chi^{2}
2. Fix - several bugs in TFormula parsing
3. Fix - correctly use saved buffer in TF1/TF2
In "classical" TBrowser one want to use normal TCanvas -
even if rootrc configured differently. Therefore change gEnv values
for the time when canvas is created
* Fix Cocoa GUI for MacOS14 and clang5

* Fix the text editor (Thanks Timur !)

(cherry picked from commit 6593d77)
This fixes using the fit2dHist.C when using the global fit (user defined FCN)

This PR fixes root-project#13906
Co-authored-by: Bertrand Bellenot <bellenot@users.noreply.github.com>
@guitargeek guitargeek removed their request for review May 20, 2024 14:34
@pcanal
Copy link
Member

pcanal commented May 20, 2024

Something went very wrong in the creation of this merge request. It shows 2137 commits to be merged. Either the target branch is not the one intended or the local branch is not up to date. Please check this and create a new request.

@pcanal pcanal closed this May 20, 2024
@PPaye PPaye deleted the physics-python-tutorials branch May 21, 2024 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet