Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
fe43e9c
[roottest] Replace a test dependency with a fixture.
hageboeck Jul 22, 2026
6dbb028
[math/tmva] Clean up files that unnecessarily include TEventList.
hageboeck Jul 14, 2026
a10110b
[NFC] Remove dead mentions of TEventList.
hageboeck Jul 14, 2026
1e10a18
[tree] Small cleanups in TEventList.
hageboeck Jul 14, 2026
64012d0
[treeplayer] Replace a char array with a string.
hageboeck Jul 22, 2026
3d300d2
[mlp] Prepare mlp for TEventLists that don't auto-register to gDirect…
hageboeck Jul 14, 2026
142b30c
Prepare ROOT's tests for TEventList without auto-registration.
hageboeck Jul 22, 2026
c7657b4
[treeplayer] Explicitly add TEventList/TEntryList to gDirectory.
hageboeck Jul 14, 2026
4a3e250
[treeplayer] Add test for correct registration of TEventList/TEntryList.
hageboeck Jul 22, 2026
2d2899a
[treeplayer] Add warnings if histograms/event lists cannot be found.
hageboeck Jul 23, 2026
ef7eb8d
[tree] Honour ObjectAutoRegistrationEnabled() in TEventList.
hageboeck Jul 14, 2026
b7d5b74
[NFC] Remove unused includes.
hageboeck Jul 22, 2026
90561ca
Prepare ROOT for disabling the auto-registration of TEntryList.
hageboeck Jul 22, 2026
bb6b981
[NFC] Apply clang-tidy member initializer fixes to TEntryList.
hageboeck Jul 22, 2026
2e5bbd3
[tree] Honour ObjectAutoRegistrationEnabled() in TEntryList.
hageboeck Jul 22, 2026
17a4e04
[core] Explain how to select ROOT auto-registration defaults.
hageboeck Jul 8, 2026
0e160e8
[tree][docs] Explain how histograms or event lists can be registered …
hageboeck Jul 23, 2026
2a86453
!!!REMOVE THIS COMMIT: Remove Globally disable auto registration in CI.
hageboeck Jul 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/root-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
GLOBAL_OVERRIDES: 'asserts=ON LLVM_ENABLE_ASSERTIONS=ON'
ROOT_TEST_S3_ACCESS_KEY: ${{ secrets.ROOT_TEST_S3_ACCESS_KEY }}
ROOT_TEST_S3_SECRET_KEY: ${{ secrets.ROOT_TEST_S3_SECRET_KEY }}
ROOT_OBJECT_AUTO_REGISTRATION: 0

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.run_id }}
Expand Down Expand Up @@ -157,7 +158,7 @@
INCREMENTAL: ${{ !contains(github.event.pull_request.labels.*.name, 'clean build') && !matrix.platform == 'mac15' && !matrix.platform == 'mac26'}}
GITHUB_PR_ORIGIN: ${{ github.event.pull_request.head.repo.clone_url }}
OVERRIDES: ${{ join( matrix.overrides, ' ') }}
run: |

Check failure on line 161 in .github/workflows/root-ci.yml

View workflow job for this annotation

GitHub Actions / lint-action-files

"github.event.pull_request.head.ref" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details
[ -d "${VIRTUAL_ENV_DIR}" ] && source ${VIRTUAL_ENV_DIR}/bin/activate
echo "Python is now $(which python3) $(python3 --version)"
src/.github/workflows/root-ci-config/build_root.py \
Expand Down Expand Up @@ -287,7 +288,7 @@
INCREMENTAL: ${{ !contains(github.event.pull_request.labels.*.name, 'clean build') }}
GITHUB_PR_ORIGIN: ${{ github.event.pull_request.head.repo.clone_url }}
shell: cmd
run: "C:\\setenv.bat ${{ matrix.target_arch }} &&

Check failure on line 291 in .github/workflows/root-ci.yml

View workflow job for this annotation

GitHub Actions / lint-action-files

"github.event.pull_request.head.ref" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details
python .github/workflows/root-ci-config/build_root.py
--buildtype ${{ matrix.config }}
--platform windows10
Expand Down Expand Up @@ -454,7 +455,7 @@
- self-hosted
- linux
- ${{ matrix.architecture == null && 'x64' || matrix.architecture }}
- ${{ matrix.extra-runs-on == null && 'cpu' || matrix.extra-runs-on }}

Check failure on line 458 in .github/workflows/root-ci.yml

View workflow job for this annotation

GitHub Actions / lint-action-files

property "extra-runs-on" is not defined in object type {architecture: string; image: string; is_special: bool; overrides: array<string>; platform_config: string; property: string; python_venv: string}

Check failure on line 458 in .github/workflows/root-ci.yml

View workflow job for this annotation

GitHub Actions / lint-action-files

property "extra-runs-on" is not defined in object type {architecture: string; image: string; is_special: bool; overrides: array<string>; platform_config: string; property: string; python_venv: string}

name: |
${{ matrix.image }} ${{ matrix.property }}
Expand Down
53 changes: 34 additions & 19 deletions core/base/src/TROOT.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -295,24 +295,20 @@ namespace {
return moduleHeaderInfoBuffer;
}

/// State helper for object auto registration.
enum class AutoReg : unsigned char {
kNotInitialised = 0,
kOn,
kOff,
};

////////////////////////////////////////////////////////////////////////////////
/// \brief Test if various objects (such as TH1-derived classes) should automatically register
/// themselves (ROOT 6 mode) or not (ROOT 7 mode).
/// A default can be set in a .rootrc using e.g. "Root.ObjectAutoRegistration: 1" or setting
/// the environment variable "ROOT_OBJECT_AUTO_REGISTRATION=0".
AutoReg &ObjectAutoRegistrationEnabledImpl()
/// Set up the default state for object auto registration by inspecting the environment.
/// This state is used to initialise the auto-registration state for each thread that starts.
AutoReg ObjectAutoRegistrationDefault()
{
static constexpr auto rcName = "Root.ObjectAutoRegistration"; // Update the docs if this is changed
static constexpr auto envName = "ROOT_OBJECT_AUTO_REGISTRATION"; // Update the docs if this is changed
thread_local static AutoReg tlsState = AutoReg::kNotInitialised;

static const AutoReg defaultState = []() {
static const AutoReg defaultFromEnvironment = []() {
AutoReg autoReg = AutoReg::kOn; // ROOT 6 default
std::stringstream infoMessage;

Expand Down Expand Up @@ -356,10 +352,18 @@ namespace {
return autoReg;
}();

if (tlsState == AutoReg::kNotInitialised) {
assert(defaultState != AutoReg::kNotInitialised);
tlsState = defaultState;
}
return defaultFromEnvironment;
}

////////////////////////////////////////////////////////////////////////////////
/// \brief Test if various objects (such as TH1-derived classes) should automatically register
/// themselves (ROOT 6 mode) or not (ROOT 7 mode).
/// A default can be set in a .rootrc using e.g. "Root.ObjectAutoRegistration: 1" or setting
/// the environment variable "ROOT_OBJECT_AUTO_REGISTRATION=0".
AutoReg &ObjectAutoRegistrationEnabledImpl()
{
thread_local static AutoReg tlsState = ObjectAutoRegistrationDefault();
assert(tlsState != AutoReg::kNotInitialised);

return tlsState;
}
Expand Down Expand Up @@ -727,16 +731,26 @@ namespace Internal {
/// | RooPlot | Yes | RooPlot::addDirectoryStatus() |
/// | TEfficiency | Yes | No |
/// | TProfile2D | Yes | TH1::AddDirectoryStatus() |
/// | TEntryList | No, but planned for 6.42 | No |
/// | TEventList | No, but planned for 6.42 | No |
/// | TEntryList (+ derived)| Yes | No |
/// | TEventList | Yes | No |
/// | TFunction | No, but work in progress | No |
///
/// ## Setting defaults
///
/// A default can be set in a .rootrc using e.g. `Root.ObjectAutoRegistration: 1` or setting
/// the environment variable `ROOT_OBJECT_AUTO_REGISTRATION=0`. Note that this default affects
/// all the threads that get started.
/// When a default is set using one of these methods, ROOT will notify with an Info message.
/// A default can be set (in order of precedence):
/// 1. Setting the environment variable `ROOT_OBJECT_AUTO_REGISTRATION=[01]`
/// 2. Setting `Root.ObjectAutoRegistration: [01]` in a .rootrc file.
///
/// To do this programmatically, one can use
/// \code{.cpp}
/// setenv("ROOT_OBJECT_AUTO_REGISTRATION", 1);
/// // or using ROOT's TEnv:
/// gEnv->SetValue("Root.ObjectAutoRegistration", 1);
/// \endcode
/// This has to be done *before* the first object with auto-registration is created. Once this is done,
/// every thread starts with the same default. A running thread's behaviour can only be changed using
/// Enable/DisableObjectAutoRegistration().
/// When the default state is changed using the environment or .rootrc, ROOT issues a reminder.
///
/// ## Difference to TH1::AddDirectoryStatus()
///
Expand Down Expand Up @@ -765,6 +779,7 @@ namespace Internal {
assert(state != AutoReg::kNotInitialised);
return state == AutoReg::kOn;
}

} // namespace Experimental
} // end of ROOT namespace

Expand Down
2 changes: 1 addition & 1 deletion math/mlp/inc/TMultiLayerPerceptron.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "TObject.h"
#include "TString.h"
#include "TObjArray.h"
#include "TMatrixD.h"
#include "TNeuron.h"
#include "TMatrixDfwd.h"

class TTree;
class TEventList;
Expand Down
2 changes: 2 additions & 0 deletions math/mlp/src/TMLPAnalyzer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,8 @@ void TMLPAnalyzer::DrawNetwork(Int_t neuron, const char* signal, const char* bg)
// build event lists for signal and background
TEventList* signal_list = new TEventList("__tmpSig_MLPA");
TEventList* bg_list = new TEventList("__tmpBkg_MLPA");
signal_list->SetDirectory(gDirectory);
bg_list->SetDirectory(gDirectory);
data->Draw(">>__tmpSig_MLPA",signal,"goff");
data->Draw(">>__tmpBkg_MLPA",bg,"goff");

Expand Down
23 changes: 18 additions & 5 deletions math/mlp/src/TMultiLayerPerceptron.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ neurons, hidden layers and inputs/outputs that does not apply to TMultiLayerPerc
#include "TH2.h"
#include "TGraph.h"
#include "TLegend.h"
#include "TMatrixD.h"
#include "TMultiGraph.h"
#include "TDirectory.h"
#include "TSystem.h"
Expand Down Expand Up @@ -458,12 +459,12 @@ TMultiLayerPerceptron::TMultiLayerPerceptron(const char * layout, TTree * data,
fCurrentTree = -1;
fCurrentTreeWeight = 1;
{
TDirectory::TContext ctxt;
TDirectory::TContext ctxt{nullptr};
fTraining = new TEventList(Form("fTrainingList_%zu",(size_t)this));
}
fTrainingOwner = true;
{
TDirectory::TContext ctxt;
TDirectory::TContext ctxt{nullptr};
fTest = new TEventList(Form("fTestList_%zu",(size_t)this));
}
fTestOwner = true;
Expand All @@ -478,8 +479,12 @@ TMultiLayerPerceptron::TMultiLayerPerceptron(const char * layout, TTree * data,
fManager = nullptr;
if (data) {
BuildNetwork();
fTraining->SetDirectory(gDirectory);
fTest->SetDirectory(gDirectory);
data->Draw(Form(">>fTrainingList_%zu",(size_t)this),training,"goff");
data->Draw(Form(">>fTestList_%zu",(size_t)this),(const char *)testcut,"goff");
fTraining->SetDirectory(nullptr);
fTest->SetDirectory(nullptr);
AttachData();
}
else {
Expand Down Expand Up @@ -537,12 +542,12 @@ TMultiLayerPerceptron::TMultiLayerPerceptron(const char * layout,
fCurrentTree = -1;
fCurrentTreeWeight = 1;
{
TDirectory::TContext ctxt;
TDirectory::TContext ctxt{nullptr};
fTraining = new TEventList(Form("fTrainingList_%zu",(size_t)this));
}
fTrainingOwner = true;
{
TDirectory::TContext ctxt;
TDirectory::TContext ctxt{nullptr};
fTest = new TEventList(Form("fTestList_%zu",(size_t)this));
}
fTestOwner = true;
Expand All @@ -557,8 +562,12 @@ TMultiLayerPerceptron::TMultiLayerPerceptron(const char * layout,
fManager = nullptr;
if (data) {
BuildNetwork();
fTraining->SetDirectory(gDirectory);
fTest->SetDirectory(gDirectory);
data->Draw(Form(">>fTrainingList_%zu",(size_t)this),training,"goff");
data->Draw(Form(">>fTestList_%zu",(size_t)this),(const char *)testcut,"goff");
fTraining->SetDirectory(nullptr);
fTest->SetDirectory(nullptr);
AttachData();
}
else {
Expand Down Expand Up @@ -645,12 +654,14 @@ void TMultiLayerPerceptron::SetTrainingDataSet(const char * train)
{
if(fTraining && fTrainingOwner) delete fTraining;
{
TDirectory::TContext ctxt;
TDirectory::TContext ctxt{nullptr};
fTraining = new TEventList(Form("fTrainingList_%zu",(size_t)this));
}
fTrainingOwner = true;
if (fData) {
fTraining->SetDirectory(gDirectory);
fData->Draw(Form(">>fTrainingList_%zu",(size_t)this),train,"goff");
fTraining->SetDirectory(nullptr);
}
else {
Warning("TMultiLayerPerceptron::TMultiLayerPerceptron","Data not set. Cannot define datasets");
Expand All @@ -672,7 +683,9 @@ void TMultiLayerPerceptron::SetTestDataSet(const char * test)
}
fTestOwner = true;
if (fData) {
fTraining->SetDirectory(gDirectory);
fData->Draw(Form(">>fTestList_%zu",(size_t)this),test,"goff");
fTraining->SetDirectory(nullptr);
}
else {
Warning("TMultiLayerPerceptron::TMultiLayerPerceptron","Data not set. Cannot define datasets");
Expand Down
3 changes: 2 additions & 1 deletion roottest/cling/specialobj/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ROOTTEST_ADD_TEST(assertGPad

ROOTTEST_ADD_TEST(stlwrite
MACRO write.C
FIXTURES_SETUP cling-specialobj-stlwrite
LABELS roottest regression cling)

ROOTTEST_ADD_TEST(argtwice
Expand All @@ -14,7 +15,7 @@ ROOTTEST_ADD_TEST(argtwice
ROOTTEST_ADD_TEST(stlProxies
MACRO runstlProxies.C
OUTREF stlProxies.ref
DEPENDS stlwrite
FIXTURES_REQUIRED cling-specialobj-stlwrite
LABELS roottest regression cling)

if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "x86_64.*|x86.*|amd64.*|AMD64.*|i686.*|i386.*")
Expand Down
19 changes: 3 additions & 16 deletions roottest/root/tree/cache/variableCluster.C
Original file line number Diff line number Diff line change
Expand Up @@ -220,26 +220,13 @@ Long64_t checkBoundary(TTree *tree, Long64_t entry)
TTree::TClusterIterator clusterIter = tree->GetClusterIterator(entry);
fEntryCurrent = clusterIter();
fEntryNext = clusterIter.GetNextEntry();

// fprintf(stdout,"finds = %lld %lld\n",fEntryCurrent,fEntryNext);

if (fEntryCurrent < fEntryMin) fEntryCurrent = fEntryMin;
if (fEntryMax <= 0) fEntryMax = tree->GetEntries();
if (fEntryNext > fEntryMax) fEntryNext = fEntryMax;

// Check if owner has a TEventList set. If yes we optimize for this
// Special case reading only the baskets containing entries in the
// list.
// TEventList *elist = fOwner->GetEventList();
// Long64_t chainOffset = 0;
// if (elist) {
// if (fOwner->IsA() ==TChain::Class()) {
// TChain *chain = (TChain*)fOwner;
// Int_t t = chain->GetTreeNumber();
// chainOffset = chain->GetTreeOffset()[t];
// }
// }


Int_t flushIntervals = 0;
Long64_t minEntry = fEntryCurrent;
Long64_t prevNtot;
Expand Down
1 change: 1 addition & 0 deletions test/stress.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@ void stress7()
char cutname[20];
TEventList *el[10];
TEventList *elistall = new TEventList("elistall","Sum of all cuts");
elistall->SetDirectory(gDirectory);
for (i=0;i<10;i++) {
snprintf(elistname,20,">>elist%d",i);
snprintf(cutname,20,"i 10 == %d",i); cutname[1] ='%';
Expand Down
9 changes: 6 additions & 3 deletions test/stressEntryList.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
// *******************Deleting the data files****************************
// **********************************************************************

#include <map>
#include <list>
#include <array>
#include <functional>
Expand All @@ -52,7 +51,6 @@
#include "TFile.h"
#include "TSystem.h"
#include "TError.h"
#include "snprintf.h"

Int_t stressEntryList(Int_t nentries = 10000, Int_t nfiles = 10);
void MakeTrees(Int_t nentries, Int_t nfiles);
Expand Down Expand Up @@ -219,8 +217,10 @@ Bool_t Test2()
TCut cut1("cut1", "x>0");
TCut cut2("cut2", "y<0.1 && y>-0.1");
TEntryList *elist1 = new TEntryList("elist1", "elist1");
chain->Draw(">>elist1", cut1, "entrylist");
TEntryList *elist2 = new TEntryList("elist2", "elist2");
elist1->SetDirectory(gDirectory);
elist2->SetDirectory(gDirectory);
chain->Draw(">>elist1", cut1, "entrylist");
chain->Draw(">>elist2", cut2, "entrylist");

//add those 2 lists (1+2)
Expand All @@ -229,6 +229,7 @@ Bool_t Test2()
elistsum->Add(elist2);

TEntryList *elistcheck = new TEntryList("elistcheck", "elistcheck");
elistcheck->SetDirectory(gDirectory);
chain->Draw(">>elistcheck", cut1 || cut2, "entrylist");

Int_t n=elistcheck->GetN();
Expand Down Expand Up @@ -264,6 +265,7 @@ Bool_t Test2()

//add by using "+" in TTree::Draw
TEntryList *elistsum3 = new TEntryList("elistsum3", "elistsum3");
elistsum3->SetDirectory(gDirectory);
chain->Draw(">>elistsum3", cut1, "entrylist");
chain->Draw(">>+elistsum3", cut2, "entrylist");
wrongentries3 = 0;
Expand All @@ -282,6 +284,7 @@ Bool_t Test2()
elistsum->Subtract(elist2);
n = elistsum->GetN();
TEntryList *elistcheck2 = new TEntryList("elistcheck2","elistcheck2");
elistcheck2->SetDirectory(gDirectory);
chain->Draw(">>elistcheck2", cut1 && !cut2, "entrylist");

wrongentries4 = 0;
Expand Down
1 change: 0 additions & 1 deletion tmva/tmva/src/Classification.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
#include <TKey.h>
#include <TLeaf.h>
#include <TBranch.h>
#include <TEventList.h>
#include <TGraph.h>
#include <TMatrixF.h>
#include <TMatrixDSym.h>
Expand Down
3 changes: 0 additions & 3 deletions tmva/tmva/src/DataInputHandler.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,9 @@ Class that contains all the data information.
#include "TMVA/DataLoader.h"
#include "TMVA/MsgLogger.h"
#include "TMVA/Types.h"
#include "TEventList.h"
#include "TCut.h"
#include "TTree.h"

#include "TMVA/Configurable.h"

#include <vector>
#include <fstream>

Expand Down
9 changes: 0 additions & 9 deletions tmva/tmva/src/DataSetFactory.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,17 @@ Class that contains all the data information
#include <iostream>

#include <algorithm>
#include <functional>
#include <numeric>
#include <random>

#include "TMVA/DataSetFactory.h"

#include "TEventList.h"
#include "TFile.h"
#include "TRandom3.h"
#include "TMatrixF.h"
#include "TVectorF.h"
#include "TMath.h"
#include "TTree.h"
#include "TBranch.h"

#include "TMVA/MsgLogger.h"
#include "TMVA/Configurable.h"
#include "TMVA/VariableIdentityTransform.h"
#include "TMVA/VariableDecorrTransform.h"
#include "TMVA/VariablePCATransform.h"
#include "TMVA/DataSet.h"
#include "TMVA/DataSetInfo.h"
#include "TMVA/DataInputHandler.h"
Expand Down
8 changes: 2 additions & 6 deletions tmva/tmva/src/DataSetInfo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,8 @@ Class that contains all the data information.

*/

#include <vector>

#include "TEventList.h"
#include "TH2.h"
#include "TRandom3.h"
#include "TMatrixF.h"
#include "TVectorF.h"
#include "TROOT.h"

#include "TMVA/MsgLogger.h"
#include "TMVA/Tools.h"
Expand All @@ -50,6 +44,8 @@ Class that contains all the data information.
#include "TMVA/Types.h"
#include "TMVA/VariableInfo.h"

#include <vector>

////////////////////////////////////////////////////////////////////////////////
/// constructor

Expand Down
Loading
Loading