Hi, I have 3 root files with TTrees that contain some observables and the event weight
In my fit program I want to merge the three samples in a unique RooDataSet and fit it with RooSimultaneous.
for(int i=0; i<3; i++){
h[i] = (TTree*)f[i]->Get( “merged” );
data[i] = new RooDataSet(“data”, “data”, *obs, Import(h[i]));
reducedData[i] = (RooDataSet) data[i]->reduce(cut.c_str());
reducedData[i]->SetName(“reducedData”);
// create weightfed data set
datawS[i] = new RooDataSet(reducedData[i]->GetName(), reducedData[i]->GetTitle(), reducedData[i], *reducedData[i]->get(), 0, “N_LsigR_sw”); //-----------> The weight is correctly assigned
datawS[i]->Print(“V”);
}
RooCategory selection(“selection”,“selection”);
selection.defineType(“prompt”);
selection.defineType(“fromB”);
selection.defineType(“MCB”);
RooDataSet *combData = new RooDataSet(“combData”, “combined data”, RooArgSet(D0IP), Index(selection), Import(“prompt”,*datawS[0]), Import(“fromB”,*datawS[1]),Import(“MCB”,*datawS[2]));
RooFormulaVar D0logIP(“D0logIP”, “log(D0 IP)”, “log(@0)”, RooArgList(D0IP)); // check units
RooRealVar D0logIPvar = (RooRealVar) combData->addColumn(D0logIP);
combData doesn’t seem to propagate the weight since I get this message:
DataStore reducedData (merged)
Observables:
1) D0_IP_OWNPV = 0.0277355 L(0 - 100000) // [mm] "D0 IP"
Dataset variable “N_LsigR_sw” is interpreted as the event weight
DataStore reducedData (merged)
Contains 116 entries
Observables:
1) D0_IP_OWNPV = 0.164524 L(0 - 100000) // [mm] "D0 IP"
Dataset variable “N_LsigR_sw” is interpreted as the event weight
DataStore reducedData (merged)
Contains 21162 entries
Observables:
1) D0_IP_OWNPV = 0.513287 L(0 - 100000) // [mm] "D0 IP"
Dataset variable “N_LsigR_sw” is interpreted as the event weight
29844
DataStore combData (merged)
Contains 29844 entries
Observables:
1) selection = prompt "selection"
2) D0_IP_OWNPV = 0.0277355 L(0 - 100000) // [mm] "D0 IP"
3) D0logIP = -3.58504 C L(-7 - 3) “log(D0 IP)”
How can I assign the weight also to combData?
Many thanks
Stefania