Dictionary generation failed!

why I got this error during .L twosidebands_dumper.C+:

Error: Symbol eta_bins is not defined in current scope  twosidebands_dumper.C:36:
Error: Failed to evaluate eta_bins.size()
Error: Symbol pt_bins is not defined in current scope  twosidebands_dumper.C:36:
Error: Failed to evaluate pt_bins.size()
Warning: Error occurred during reading source files
Warning: Error occurred during dictionary source generation
!!!Removing /gpfs/storage_4/users/home/turra/diphotons/twosidebands_dumper/twosidebands_dumper_C_ACLiC_dict.cxx /gpfs/storage_4/users/home/turra/diphotons/twosidebands_dumper/twosidebands_dumper_C_ACLiC_dict.h !!!
Error: /gpfs/storage_4/users/home/proof/root/bin/rootcint: error loading headers...
Error in <ACLiC>: Dictionary generation failed!
Info in <ACLiC>: Invoking compiler to check macro's validity
Info in <ACLiC>: The compiler has not found any problem with your macro.
	Probably your macro uses something rootcint can't parse.
	Check http://root.cern.ch/root/Cint.phtml?limitations for Cint's limitations.

what does it mean “Probably your macro uses something rootcint can’t parse.”? I’m not using CINT I’m compiling the macro. If I try compile it manually it works. Piece of code:

namespace bin_definition
{
    
    const double eta_bins_array[] = {0., 0.60, 1.37, 1.52, 1.81, 2.37};
    const double pt_bins_array[] = {15, 20, 25, 30, 35, 40, 50, 60, 100};

    const int n_eta_bins = sizeof(eta_bins_array) / sizeof(double);
    const int n_pt_bins = sizeof(pt_bins_array) / sizeof(double);

    const std::vector<double> eta_bins(eta_bins_array, 
                                       eta_bins_array + n_eta_bins);

    const std::vector<double> pt_bins(pt_bins_array,
                                      pt_bins_array + n_pt_bins);


    const int ALL = std::max(eta_bins.size(), pt_bins.size());   // <-- line 36

Hi,

CINT cannot handle that. You can either convert the vectors and the assignment of ALL to a function call, or if you don’t need dictionaries for them, protect them with #ifndef CINT#endif

Cheers, Axel.

[quote=“Axel”]Hi,

CINT cannot handle that. You can either convert the vectors and the assignment of ALL to a function call, or if you don’t need dictionaries for them, protect them with #ifndef CINT#endif

Cheers, Axel.[/quote]

Yes, I understand that, but the point is: when I do .L foo.C+ what does it mean? Before this I thought it means that I’m asking to compile it, no CINT, no dictionaries.

Hi,

ACLiC creates dictionaries such that you can do I/O with your types etc.

Cheers, Axel.

[quote=“Axel”]Hi,

ACLiC creates dictionaries such that you can do I/O with your types etc.

Cheers, Axel.[/quote]

What about if I don’t need to do I/O and Aclic creates problem during compilation? How to disable it? Or how do ignore piece of code?

Hi,

You can hide the CINT adverse code behind #ifndef CINT[code]
namespace bin_definition
{
#ifndef CINT
const double eta_bins_array[] = {0., 0.60, 1.37, 1.52, 1.81, 2.37};
const double pt_bins_array[] = {15, 20, 25, 30, 35, 40, 50, 60, 100};

const int n_eta_bins = sizeof(eta_bins_array) / sizeof(double);
const int n_pt_bins = sizeof(pt_bins_array) / sizeof(double);

const std::vector<double> eta_bins(eta_bins_array, 
                                   eta_bins_array + n_eta_bins);

const std::vector<double> pt_bins(pt_bins_array,
                                  pt_bins_array + n_pt_bins);

#endif[/code]

Cheers,
Philippe.