TChain Seg violation

Having chained together ‘outTree’ from different .root files and successfully used the template produced by MakeClass as follows:

TChain chain(“outTree”);

I find that if I try to open a tfile within the macro template HistogramChain.C, I get a segmentation violation. Print statements show it is just from opening this file, I do nothing else before this. The file is not part of the TChain.

If I add this:

if (f->IsZombie()) {
      cout << "Error opening file" << endl;

directly after the declaration TFile *f = new TFile(“ROC.root”); which is causing the problem, it doesn’t enter the zombie loop.

Why would this be causing a problem and is there a way to solve it?

Thanks for any help :slight_smile:

Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

Could you share the actual source file and the actual, complete error message / stack trace etc you get? Which ROOT version, which platform?

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