Error when compiling new RooFit class - RooBinomial

Dear all,
I am trying to create a RooBinomial class - please see attached files. I am using root 6.26/06 and
I have recycled as mush as I could the RooPoisson class.

When I try to compile it I get the following error:

$ root -l
root [0] gROOT->ProcessLineSync(".x RooBinomial.cxx+")
Info in <TMacOSXSystem::ACLiC>: creating shared library /Users/mbomben/work/root_macros/./
In file included from input_line_9:6:
In file included from ././RooBinomial.cxx:17:
/Users/mbomben/work/root_macros/RooBinomial.h:56:85: error: no type named 'DataMap' in namespace 'RooBatchCompute'
  void computeBatch(cudaStream_t*, double* output, size_t nEvents, RooBatchCompute::DataMap&) const override;
In file included from input_line_9:6:
././RooBinomial.cxx:126:103: error: no type named 'DataMap' in namespace 'RooBatchCompute'
void RooBinomial::computeBatch(cudaStream_t* stream, double* output, size_t nEvents, RooBatchCompute::DataMap& dataMap) const
././RooBinomial.cxx:129:46: error: no member named 'Binomial' in namespace 'RooBatchCompute'
  dispatch->compute(stream, RooBatchCompute::Binomial, output, nEvents, dataMap, {&*k,&*p,&*_norm},
Error in <ACLiC>: Executing '/Users/mbomben/miniconda3/envs/root_62606/bin/rootcling -v0 "--lib-list-prefix=/Users/mbomben/work/root_macros/RooBinomial_cxx_ACLiC_map" -f "/Users/mbomben/work/root_macros/RooBinomial_cxx_ACLiC_dict.cxx" -I$ROOTSYS/include -I"/Users/mbomben/miniconda3/envs/root_62606/etc/" -I"/Users/mbomben/miniconda3/envs/root_62606/etc//cling" -I"/Users/mbomben/miniconda3/envs/root_62606/etc//cling/plugins/include" -I"/Users/mbomben/miniconda3/envs/root_62606/include/" -I"/Users/mbomben/miniconda3/envs/root_62606/include" -D__ACLIC__ -I/Users/mbomben/work/root_macros "/Users/mbomben/work/root_macros/./RooBinomial.cxx" "/Users/mbomben/work/root_macros/RooBinomial_cxx_ACLiC_linkdef.h"' failed!
(long) 0

I have looked into RooBatchCompute but I could not find DataMap; plus I don’t understand how
to add Binomial in namespace 'RooBatchCompute'

Any help will be greatly appreciated :smiley:

Best regards,
Marco Bomben

RooBinomial.cxx (8.6 KB)
RooBinomial.h (2.5 KB)

Any ideas, please?

Thanks and regards,
Marco Bomben

Hi @bomben ,

sorry for the high latency, we need @jonas 's help here, let’s ping him.


Can you try to do this in the master ? I think we have several fixes in the BatchCompute library in the master compared to 6.26.
Then as a side note, why do you need a RooBinomial class ? There is in RooFit the RooEfficiency class to be used to model binomial processes, see the relevant tutorials, like rf701_efficiencyfit.C.

Best regards,


I will try with master.

The reason why I would like to have an implementation of a binomial pdf is that I would like
to generate binomial events in first place and then also do profile likelihood studies.
Do you think I can avoid using a dedicated pdf, please?

Many thanks in advance and best regards,
Marco Bomben


For generate data you can just use gRandom->Binomial(int ntot, double p).
For modelling and building a likelihood function you can use the RooEfficiency class.


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