which I want is to tell Root interpreter where to find the Delphes classes. However some errors occur,
/Users/lihuang/work/6t2/analysis/test.C:19:27: error: cannot initialize a parameter of type 'const char ’ with an rvalue of type
‘int’
…‘#include “/Users/lihuang/tools/packages/madgraph/Delphes/classes/DelphesClasses.h”’);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/lihuang/tools/root6/include/TInterpreter.h:119:41: note: passing argument to parameter ‘code’ here
virtual Bool_t Declare(const char code) = 0;
^
In file included from input_line_10:1:
/Users/lihuang/work/6t2/analysis/test.C:20:27: warning: multi-character character constant [-Wmultichar]
When using Python, the similar code always give the right path and .h files, what shall I do in C++?
I’m fairly sure that that error has nothing to do with your ntuple having been produced by Delphes.
I’m afraid that RooDataSet is not willing to read an array/vector variable like this. I’m afraid you’ll have to do something more elaborate to feed a vector variable such as this one into your fit.
It does beg the question though: How do you want to use this variable exactly? “HT” in my understanding is an “event-wide” variable. So the only reason for it to be an array in your ntuple should be because different elements of the array describe HT calculated in different ways. (That’s what we do in ATLAS with MET variables, that’s why I’m guessing this…) If that is the case, you’ll definitely have to write your own interface between that variable and RooFit.
Or, depending on the size of your ntuple, you could just create another ntuple from this one which contains all your variables of interest as simple primitives. (One value per event/entry.) Then you’d just need to write the code for creating that derived ntuple, and you could read the variables with RooDataSet with this formalism.
Hi,
Thank you very much.
I am not really know how Delphes calculate it ( though I think the definition is uniform for every entries but I don’t check the source code ). I guess what you suggest is to write a new tree with a single branch with this “HT”? I don’t understand if I can feed a ntuple to Roofit since it said “tree” explicitly. However, I afraid copy a branch to a new tree will be slow and occupy too much memory.