Error in <ACLiC>: Dictionary generation failed!

Hi ,
I am running a macro to read some branches of a input .root file and trying to write it in a another .root file. But the problem I am facing is while reading a vector of TLorentzVector.(something mentioned below.)
Can anyone please help me.

././convertt.C:24:19: error: allocation of incomplete type 'TFile'
   TFile *f = new TFile("/home/tribeni/Run2017F-31Mar2018-v1.SinglePhoton_391_RA2AnalysisTree.root");                                                                //Input root file 
                  ^~~~~
/home/tribeni/root/obj/include/TUUID.h:37:7: note: forward declaration of 'TFile'
class TFile;
      ^
In file included from input_line_12:9:
././convertt.C:25:24: error: member access into incomplete type 'TFile'
   TTree *t1 =(TTree*)f->Get("/TreeMaker2/PreSelection");
                       ^
/home/tribeni/root/obj/include/TUUID.h:37:7: note: forward declaration of 'TFile'
class TFile;
      ^
In file included from input_line_12:9:
././convertt.C:66:20: error: incomplete type 'TFile' named in nested name specifier
   TFile *output = TFile::Open("skim_output.root","RECREATE");            //output root file 
                   ^~~~~~~
/home/tribeni/root/obj/include/TUUID.h:37:7: note: forward declaration of 'TFile'
class TFile;
      ^
In file included from input_line_12:9:
././convertt.C:125:9: error: member access into incomplete type 'TFile'
  output->Write();
        ^
/home/tribeni/root/obj/include/TUUID.h:37:7: note: forward declaration of 'TFile'
class TFile;
      ^
In file included from input_line_12:9:
././convertt.C:126:3: warning: deleting pointer to incomplete type 'TFile' may cause undefined behavior [-Wdelete-incomplete]
  delete f;
  ^      ~
/home/tribeni/root/obj/include/TUUID.h:37:7: note: forward declaration of 'TFile'
class TFile;
      ^
In file included from input_line_12:9:
././convertt.C:127:3: warning: deleting pointer to incomplete type 'TFile' may cause undefined behavior [-Wdelete-incomplete]
  delete output;
  ^      ~~~~~~
/home/tribeni/root/obj/include/TUUID.h:37:7: note: forward declaration of 'TFile'
class TFile;
      ^
Error in <ACLiC>: Dictionary generation failed!

In your “convertt.C”, add: #include "TFile.h"

Thanks Wile. It is solved now.
But I am facing a new kind of error now. I am trying to access Pt of a vector of TLorentzVector.
I am getting error like :

Processing convertt.C+…
Info in TUnixSystem::ACLiC: creating shared library /home/tribeni/Downloads/./convertt_C.so

Total Entries in input file : 50029
Warning in TTree::Bronch: Using split mode on a class: TLorentzVector with a custom Streamer
terminate called after throwing an instance of ‘std::out_of_range’
what(): vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)

Can you please suggest what to do. How can I access Pt of a vector of TLorentzVector(Photons).

Thanks in advance. Please suggest me what to do.

The warning and the actual may or may not be related. I recommend compiled in debug mode (.x convertt.C+g) and running root.exe in a debugger (and/or valgrind) to find out more about the error.

Cheers,
Philippe.

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