I am trying to make a roodataset with cuts on a variable as follows:
[code] TFile* dataFile = new TFile( fileNameData.Data() );
dataTree = (TTree*) dataFile->FindObjectAny(“Events”);
RooDataSet* dataDS = new RooDataSet(“dataDS”,"",RooArgSet(eta1),Import(*dataTree),Cut(“eta1>1”));
cout << "dataDS->numEntries() = " << dataDS->numEntries() << endl;
TH1D* hData = new TH1D(“hData”,"",100,-10.,10.);
cout << "hData->GetEntries() = " << hData->GetEntries() << endl;
The output of the program is this:
dataDS->numEntries() = 0
Info in TCanvas::MakeDefCanvas: created default TCanvas with name c1
hData->GetEntries() = 408[/quote]
Does anyone have any idea why the cut eta1 > 1 is not effective with the roodataset?
By playing around with the cut in the roodataset constructor, I have found that it thinks that eta1 = 0 for every entry in the tree. This is definitely not true, as I have verified by looking at tree and as you can see from the “hData->GetEntries() = 408”.