Skip to content

Commit

Permalink
Merge branch 'master' into install-test
Browse files Browse the repository at this point in the history
  • Loading branch information
ellert committed Jan 29, 2016
2 parents ad6e69c + bc8c692 commit fdbcd5e
Show file tree
Hide file tree
Showing 114 changed files with 4,186 additions and 2,468 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ else()
add_custom_command(OUTPUT tutorials/hsimple.root
COMMAND ROOTIGNOREPREFIX=1 $<TARGET_FILE:root> -l -q -b -n -x hsimple.C -e return
WORKING_DIRECTORY tutorials
DEPENDS root Cling Hist Tree Gpad Graf HistPainter move_artifacts)
DEPENDS root root.exe Cling Hist Tree Gpad Graf HistPainter move_artifacts)
endif()
install(FILES ${CMAKE_BINARY_DIR}/tutorials/hsimple.root DESTINATION ${CMAKE_INSTALL_TUTDIR} COMPONENT tests)

Expand Down
19 changes: 19 additions & 0 deletions README/ReleaseNotes/v608/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ Other improvements, which may cause compilation errors in third party code:
* If you get std::type_info from Rtypeinfo.h, type_info should be spelled
std::type_info.

Also:
* TPluginManager was made thread-safe [ROOT-7927].

### Containers
A pseudo-container (generator) was created, ROOT::TSeq<T>. This template is
inspired by the xrange built-in function of Python. See the example
Expand All @@ -84,8 +87,10 @@ Custom streamers need to #include TBuffer.h explicitly (see

## TTree Libraries

* Update TChain::LoadTree so that the user call back routine is actually called for each input file even those containing TTree objects with no entries.
* Repair setting the branch address of a leaflist style branch taking directly the address of the struct. (Note that leaflist is nonetheless still deprecated and declaring the struct to the interpreter and passing the object directly to create the branch is much better).
* Provide an implicitly parallel implementation of TTree::GetEntry. The approach is based on creating a task per top-level branch in order to do the reading, unzipping and deserialisation in parallel. In addition, a getter and a setter methods are provided to check the status and enable/disable implicit multi-threading for that tree (see Parallelisation section for more information about implicit multi-threading).
* Properly support std::cin (and other stream that can not be rewound) in TTree::ReadStream. This fixes [ROOT-7588].

## Histogram Libraries

Expand All @@ -107,9 +112,23 @@ Custom streamers need to #include TBuffer.h explicitly (see
`CreateGradientColorTable`.
* In `CreateGradientColorTable` we do not need anymore to compute the highest
color index.
* In `TGraphPainter`, when graphs are painted with lines, they are split into
chunks of length `fgMaxPointsPerLine`. This allows to paint line with an "infinite"
number of points. In some case this "chunks painting" technic may create artefacts
at the chunk's boundaries. For instance when zooming deeply in a PDF file. To avoid
this effect it might be necessary to increase the chunks' size using the new function:
`TGraphPainter::SetMaxPointsPerLine(20000)`.
* When using line styles different from 1 (continuous line), the behavior of TArrow
was suboptimal. The problem was that the line style is also applied to the arrow
head, which is usually not what one wants.
The arrow tip is now drawn using a continuous line.
* It is now possible to select an histogram on a canvas by clicking on the vertical
lines of the bins boundaries. This problem was reported [here](https://sft.its.cern.ch/jira/browse/ROOT-6649?).

## 3D Graphics Libraries

* When painting a `TH3` as 3D boxes, `TMarker3DBox` ignored the max and min values
specified by `SetMaximum()` and `SetMinimum()`.

## Geometry Libraries

Expand Down
1 change: 1 addition & 0 deletions bindings/pyroot/src/Executors.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -842,6 +842,7 @@ namespace {
NFp_t( "unsigned short*", &CreateUShortArrayExecutor ),
NFp_t( "int*", &CreateIntArrayExecutor ),
NFp_t( "unsigned int*", &CreateUIntArrayExecutor ),
NFp_t( "UInt_t*", /* enum */ &CreateUIntArrayExecutor ),
NFp_t( "long*", &CreateLongArrayExecutor ),
NFp_t( "unsigned long*", &CreateULongArrayExecutor ),
NFp_t( "float*", &CreateFloatArrayExecutor ),
Expand Down
2 changes: 1 addition & 1 deletion cmake/modules/RootNewMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ function(ROOT_GENERATE_DICTIONARY dictionary)
endif()
else()
set(library_name ${libprefix}${deduced_arg_module}${libsuffix})
set(pcm_name ${dictionary}_rdict.pcm)
set(pcm_name ${library_output_dir}/${libprefix}${deduced_arg_module}_rdict.pcm)
set(rootmap_name ${library_output_dir}/${libprefix}${deduced_arg_module}.rootmap)
endif()

Expand Down
10 changes: 9 additions & 1 deletion core/base/inc/TPluginManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,15 @@ class TFunction;
class TMethodCall;
class TPluginManager;

#include <atomic>

class TPluginHandler : public TObject {

friend class TPluginManager;

private:
using AtomicInt_t = std::atomic<Int_t>;

TString fBase; // base class which will be extended by plugin
TString fRegexp; // regular expression which must be matched in URI
TString fClass; // class to be loaded from plugin library
Expand All @@ -122,7 +125,7 @@ friend class TPluginManager;
TString fOrigin; // origin of plugin handler definition
TMethodCall *fCallEnv; //!ctor method call environment
TFunction *fMethod; //!ctor method or global function
Int_t fCanCall; //!if 1 fCallEnv is ok, -1 fCallEnv is not ok
AtomicInt_t fCanCall; //!if 1 fCallEnv is ok, -1 fCallEnv is not ok, 0 fCallEnv not setup yet.
Bool_t fIsMacro; // plugin is a macro and not a library
Bool_t fIsGlobal; // plugin ctor is a global function

Expand Down Expand Up @@ -158,6 +161,11 @@ friend class TPluginManager;
auto nargs = sizeof...(params);
if (!CheckForExecPlugin(nargs)) return 0;

// The fCallEnv object is shared, since the PluginHandler is a global
// resource ... and both SetParams and Execute ends up taking the lock
// individually anyway ...

R__LOCKGUARD2(gInterpreterMutex);
fCallEnv->SetParams(params...);

Long_t ret;
Expand Down
6 changes: 3 additions & 3 deletions core/base/src/TColor.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,9 @@ Begin_Macro(source)
End_Macro
## <a name="C06"></a> High quality predefined palettes
\since **6.04:**
62 high quality palettes are predefined with 255 colors each.
These palettes can be accessed "by name" with gStyle->SetPalette(num).
These palettes can be accessed "by name" with `gStyle->SetPalette(num)`.
`num` can be taken within the following enum:
~~~ {.cpp}
Expand Down Expand Up @@ -905,7 +905,7 @@ itself remains fully opaque.
histo->SetFillColorAlpha(kBlue, 0.35);
~~~
The transparency is available on all platforms when the `flagOpenGL.CanvasPreferGL` is set to `1`
The transparency is available on all platforms when the flag `OpenGL.CanvasPreferGL` is set to `1`
in `$ROOTSYS/etc/system.rootrc`, or on Mac with the Cocoa backend. On the file output
it is visible with PDF, PNG, Gif, JPEG, SVG ... but not PostScript.
*/
Expand Down
25 changes: 21 additions & 4 deletions core/base/src/TPluginManager.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ TFile, TSQLServer, TGrid, etc. functionality.
#include "TObjString.h"
#include "ThreadLocalStorage.h"

#include <memory>

TPluginManager *gPluginMgr; // main plugin manager created in TROOT

Expand Down Expand Up @@ -183,7 +184,17 @@ Bool_t TPluginHandler::CanHandle(const char *base, const char *uri)

void TPluginHandler::SetupCallEnv()
{
fCanCall = -1;
int setCanCall = -1;

// Use a exit_scope guard, to insure that fCanCall is set (to the value of
// result) as the last action of this function before returning.

// When the standard supports it, we should use std::exit_code
// See N4189 for example.
// auto guard = make_exit_scope( [...]() { ... } );
using exit_scope = std::shared_ptr<void*>;
exit_scope guard(nullptr,
[this,&setCanCall](void *) { this->fCanCall = setCanCall; } );

// check if class exists
TClass *cl = TClass::GetClass(fClass);
Expand Down Expand Up @@ -221,7 +232,7 @@ void TPluginHandler::SetupCallEnv()
fCallEnv = new TMethodCall;
fCallEnv->Init(fMethod);

fCanCall = 1;
setCanCall = 1;

return;
}
Expand Down Expand Up @@ -265,8 +276,14 @@ Bool_t TPluginHandler::CheckForExecPlugin(Int_t nargs)
return kFALSE;
}

if (!fCallEnv && !fCanCall)
SetupCallEnv();
if (fCanCall == 0) {
// Not initialized yet.
R__LOCKGUARD2(gPluginManagerMutex);

// Now check if another thread did not already do the work.
if (fCanCall == 0)
SetupCallEnv();
}

if (fCanCall == -1)
return kFALSE;
Expand Down
146 changes: 146 additions & 0 deletions core/base/v7/inc/ROOT/TIndexIter.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
/// \file ROOT/TIndexIter.h
/// \ingroup Base ROOT7
/// \author Axel Naumann <axel@cern.ch>
/// \date 2016-01-19
/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!

/*************************************************************************
* Copyright (C) 1995-2016, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/

#ifndef ROOT7_TIndexIter
#define ROOT7_TIndexIter

#include <iterator>

namespace ROOT {
namespace Experimental {
namespace Internal {

/**
\class TIndexIter
Iterates over an index; the REFERENCE is defined by the REFERENCE template parameter.
Derived classes are expected to implement `const REFERENCE& operator*()` and
`const POINTER operator->()`.
*/

template <class REFERENCE,
class POINTER = typename std::add_pointer<typename std::remove_reference<REFERENCE>::type>::type>
class TIndexIter:
public std::iterator<std::random_access_iterator_tag, REFERENCE, POINTER> {
size_t fIndex;
protected:
static constexpr size_t fgEndIndex = (size_t) -1;

public:
TIndexIter(size_t idx): fIndex(idx) {}

/// Get the current index value.
size_t GetIndex() const noexcept { return fIndex; }

///\{
///\name Index modifiers
/// ++i
TIndexIter &operator++() noexcept {
++fIndex;
return *this;
}

/// --i
TIndexIter &operator--() noexcept {
if (fIndex != fgEndIndex)
--fIndex;
return *this;
}

/// i++
TIndexIter operator++(int) noexcept {
TIndexIter old(*this);
++(*this);
return old;
}

// i--
TIndexIter operator--(int) noexcept {
TIndexIter old(*this);
--(*this);
return old;
}

TIndexIter &operator+=(int d) noexcept {
fIndex += d;
return *this;
}

TIndexIter &operator-=(int d) noexcept {
if (d > fIndex) {
fIndex = fgEndIndex;
} else {
fIndex -= d;
}
return *this;
}

TIndexIter operator+(int d) noexcept {
TIndexIter ret(*this);
ret += d;
return ret;
}

TIndexIter operator-(int d) noexcept {
TIndexIter ret(*this);
ret -= d;
return ret;
}
///\}
};

///\{
///\name Relational operators.
template <class REFERENCE, class POINTER>
bool operator<(TIndexIter<REFERENCE, POINTER> lhs,
TIndexIter<REFERENCE, POINTER> rhs) noexcept {
return lhs.GetIndex() < rhs.GetIndex();
}

template <class REFERENCE, class POINTER>
bool operator>(TIndexIter<REFERENCE, POINTER> lhs,
TIndexIter<REFERENCE, POINTER> rhs) noexcept {
return lhs.GetIndex() > rhs.GetIndex();
}

template <class REFERENCE, class POINTER>
bool operator<=(TIndexIter<REFERENCE, POINTER> lhs,
TIndexIter<REFERENCE, POINTER> rhs) noexcept {
return lhs.GetIndex() <= rhs.GetIndex();
}

template <class REFERENCE, class POINTER>
inline bool operator>=(TIndexIter<REFERENCE, POINTER> lhs,
TIndexIter<REFERENCE, POINTER> rhs) noexcept {
return lhs.GetIndex() >= rhs.GetIndex();
}

template <class REFERENCE, class POINTER>
inline bool operator==(TIndexIter<REFERENCE, POINTER> lhs,
TIndexIter<REFERENCE, POINTER> rhs) noexcept {
return lhs.GetIndex() == rhs.GetIndex();
}

template <class REFERENCE, class POINTER>
inline bool operator!=(TIndexIter<REFERENCE, POINTER> lhs,
TIndexIter<REFERENCE, POINTER> rhs) noexcept {
return lhs.GetIndex() != rhs.GetIndex();
}
///\}

}
}
}

#endif // ROOT7_TIndexIter
10 changes: 5 additions & 5 deletions core/base/v7/inc/ROOT/rhysd_array_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,12 @@ class array_view {
*/
// slice with indices {{{
// check bound {{{
constexpr array_view<T> slice(check_bound_t, size_type const pos, size_type const length) const
constexpr array_view<T> slice(check_bound_t, size_type const pos, size_type const slicelen) const
{
if (pos >= length_ || pos + length >= length_) {
if (pos >= length_ || pos + slicelen >= length_) {
throw std::out_of_range("array_view::slice()");
}
return array_view<T>{begin() + pos, begin() + pos + length};
return array_view<T>{begin() + pos, begin() + pos + slicelen};
}
constexpr array_view<T> slice_before(check_bound_t, size_type const pos) const
{
Expand All @@ -319,9 +319,9 @@ class array_view {
}
// }}}
// not check bound {{{
constexpr array_view<T> slice(size_type const pos, size_type const length) const
constexpr array_view<T> slice(size_type const pos, size_type const slicelen) const
{
return array_view<T>{begin() + pos, begin() + pos + length};
return array_view<T>{begin() + pos, begin() + pos + slicelen};
}
constexpr array_view<T> slice_before(size_type const pos) const
{
Expand Down
2 changes: 1 addition & 1 deletion core/rint/src/TRint.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ void TRint::PrintLogo(Bool_t lite)
// Here, %%s results in %s after TString::Format():
lines.emplace_back(TString::Format("Welcome to ROOT %s%%shttp://root.cern.ch",
gROOT->GetVersion()));
lines.emplace_back(TString::Format("%%s(c) 1995-2014, The ROOT Team"));
lines.emplace_back(TString::Format("%%s(c) 1995-2016, The ROOT Team"));
lines.emplace_back(TString::Format("Built for %s%%s", gSystem->GetBuildArch()));
if (!strcmp(gROOT->GetGitBranch(), gROOT->GetGitCommit())) {
static const char *months[] = {"January","February","March","April","May",
Expand Down
2 changes: 1 addition & 1 deletion documentation/doxygen/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ EXCLUDE_SYMLINKS = NO
EXCLUDE_PATTERNS = */G__* \
*/src/unuran-* \
*/libAfterImage/* \
*/doc/v6* */doc/v5* v7 \
*/doc/v6* */doc/v5* \
*/win32gdk/gdk/* \
makeimage.C filter.cxx

Expand Down
Loading

0 comments on commit fdbcd5e

Please sign in to comment.