TChain Merge Output Has Too Few Events

I am currently running a fairly simple C++ program to merge various Root files using TChain. I am merging around 1,000 files at a time, but each has only 2 or 3 events. The only error I get is

“Error in <TBranch::In the branch %s, no basket contains the entry %d >: CC05E391ModuleModID”

but I do get an output file with events in it. However, I am expecting the file to have 1,000-2,000 events but the file has only around 100 events. This is the code I am using:

#include <iostream>
#include <sstream>

#include "TChain.h"

using namespace std;

int main(int argc, char** argv)
{
        TChain join(argv[3]);
        int i;

        for(i = 9000; i < 11000; i++)
        {

                stringstream FileName;
                FileName << argv[1]  << i << ".root";

                string FileNameS = FileName.str();

                join.Add(FileNameS.c_str());

                cout << FileNameS << "\n";

        }

        join.Merge(argv[2]);

        cout << "\n\n Join Done\n";

        return 0;
}

These files contain events generated through a Monte Carlo simulation. I doubt that there are any “repeat events” with the exact same values in all branches, but I am wondering if the merging discards repeat events so then the problem I am seeing is due to my Monte Carlo rather than with Root itself. Thank you in advance for your suggestions.

ROOT Version: 5.34/38
Platform: Not Provided
Compiler: Not Provided


v5.34 is quite ancient. Can you try with v6.22?

I can ask about upgrading the version, but I am working through the KEK computing cluster so I don’t know how feasible it will be to work with a newer version of Root. If you believe this issue is highly dependant on what version of Root I am using I can ask about upgrading my version of Root and get back to you once I know if that will be possible.

You can install ROOT in your own user area and easily use it. See for example https://root.cern.ch/install/#download-a-pre-compiled-binary-distribution.

We would then be able to tell if the problem is with the files or with the code in ROOT.

Alternatively you can provide us with a set of failing files and we can try it out.

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