I am using roofit and reading a tree. In that tree there is a float variable named var1. I am able to define it as
RooRealVar var1(“var1”, “first variable”, 0., 10.);
But in case, if my variable var1 is defined as vector, then how can I use this variable?
I tried to use it as:
RooRealVar var1(“var1->at(0)”, “first variable”, 0., 10.);
But it is not working this way. Can you please suggest me any better way?
what you are asking might not be possible. A variable is a double, and I doubt you can bind it to anything using just a name. There needs to be a dataset involved that reads a tree.
But let me ask this:
Are you trying to give the variable an initial value?
If yes, do it like this: