Dear Expert:
There is an error when I process the following macro. Could you please take a look? Thanks.
using namespace ROOT;
void test() {
auto file = TFile::Open("ot/test.root", "READ");
auto dtr = file->Get<TTree>("Detector/Det");
auto vtr = file->Get<TTree>("Ntp/vDet");
dtr->BuildIndex("EventID", "TrackID");
vtr->AddFriend(dtr, "dtr");
RDataFrame df(*vtr);
std::cout << df.Filter("(PDGid==-11) && (dtr.PDGid==-11)").Count().GetValue() << std::endl;
}
error: use of undeclared identifier 'dtr'
auto func0(const Float_t var0, const Float_t var1){return (var0==-11) && (dtr.var0==-11)
^
terminate called after throwing an instance of 'std::runtime_error'
what():
RDataFrame: An error occurred during just-in-time compilation. The lines above might indicate the cause of the crash
All RDF objects that have not run an event loop yet should be considered in an invalid state.
Please read tips for efficient and successful posting and posting code
ROOT Version: 6.27/01
Platform: CentOS7.9
Compiler: gcc9.3.0