Can't understand warning


When running my code, I get a warning, which I can’t tell whether or not it is a issue which I should pay attention.

root [0]

Processing run_HLTEffAna.C...

Info in <TUnixSystem::ACLiC>: creating shared library /afs/

N. Entries: 55266

Warning in <TTreeReader::SetEntryBase()>: The current tree in the TChain ggNtuplizer/EventTree has changed (e.g. by TTree::Process) even though TTreeReader::SetEntry() was called, which switched the tree again. Did you mean to call TTreeReader::SetLocalEntry()?

Here is a, not so small, snippet of the code which generate this:


  gSystem->SetBuildDir("tmpdir", kTRUE);

  gROOT->ProcessLine(".L HLTEffAna_ZtoUpsilonPhoton.C++");


  vector<string> ggNtuplesFiles = {




#include <iostream>
#include "TFile.h"
#include "TLorentzVector.h"
#include "TTree.h"
#include "TTreeReader.h"
#include "TTreeReaderValue.h"
#include "TTreeReaderArray.h"

#include "../plugins/ggNtuplesFilesReader.h"

using namespace std;

void HLTEffAna_ZtoUpsilonPhoton(vector<string> ggNtuplesFiles)  

	TTreeReader * dataReader = ggNtuplesFilesReader( ggNtuplesFiles, nFiles );
	TTree * dataTree = dataReader->GetTree();

	// define readers
	TTreeReaderArray< float > phoE(*dataReader, "phoE");

	cout << "N. Entries: " << dataTree->GetEntries() << endl;
	// data->Print();

	while (dataReader->Next()) { // loop over events
		for (unsigned int i = 0; i < phoE.GetSize(); i++){
			cout << "phoE: " << phoE[i] << endl;
    } // end loop over events
} //end ana_ZtoUpsilonPhoton


#include "TChain.h"
#include "TTreeReader.h"

using namespace std;

TTreeReader * ggNtuplesFilesReader(vector<string> ggNtuplesFiles, int nFiles)  
	TChain * chain = new TChain("ggNtuplizer/EventTree");

	for(unsigned int i = 0; i < ggNtuplesFiles.size(); i++) {
		chain->AddFile( ggNtuplesFiles[i].c_str() );
	// chain->Print();
	TTreeReader * reader = new TTreeReader(chain);
	return reader;

Any tip would be very helpfull.

Thanks in advance.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.