RDataFrame runtime_error


Please read tips for efficient and successful posting and posting code

_ROOT Version:JupyROOT 6.24/06
Platform: Not Provided
Compiler: Not Provided


I am a newbie following the RDataFrame HiggstoFourLeptons tutorial and encountered the following errors that I could not understand what it means:

The code:

ROOT.gInterpreter.Declare("""
using cRVecF = const ROOT::RVec<float> &;
bool GoodElectronsAndMuons(const ROOT::RVec<int> & type, cRVecF pt, cRVecF eta, cRVecF phi, cRVecF e, cRVecF trackd0pv, cRVecF tracksigd0pv, cRVecF z0)
{
    for (size_t i = 0; i < type.size(); i++) {
        ROOT::Math::PtEtaPhiEVector p(pt[i] / 1000.0, eta[i], phi[i], e[i] / 1000.0);
        if (type[i] == 11) {
            if (pt[i] < 7000 || abs(eta[i]) > 2.47 || abs(trackd0pv[i] / tracksigd0pv[i]) > 5 || abs(z0[i] * sin(p.Theta())) > 0.5) return false;
        } else {
            if (abs(trackd0pv[i] / tracksigd0pv[i]) > 5 || abs(z0[i] * sin(p.Theta())) > 0.5) return false;
        }
    }
    return true;
}
""")

for s in samples:
    # Select electron or muon trigger
    df[s] = df[s].Filter("trigE || trigM")

    # Select events with exactly four good leptons conserving charge and lepton numbers
    # Note that all collections are RVecs and good_lep is the mask for the good leptons.
    # The lepton types are PDG numbers and set to 11 or 13 for an electron or muon
    # irrespective of the charge.
    df[s] = df[s].Define("good_lep", "abs(lep_eta) < 2.5 && lep_pt > 5000 && lep_ptcone30 / lep_pt < 0.3 && lep_etcone20 / lep_pt < 0.3")\
                 .Filter("Sum(good_lep) == 4")\
                 .Filter("Sum(lep_charge[good_lep]) == 0")\
                 .Define("goodlep_sumtypes", "Sum(lep_type[good_lep])")\
                 .Filter("goodlep_sumtypes == 44 || goodlep_sumtypes == 52 || goodlep_sumtypes == 48")

    # Apply additional cuts depending on lepton flavour
    df[s] = df[s].Filter("GoodElectronsAndMuons(lep_type[good_lep], lep_pt[good_lep], lep_eta[good_lep], lep_phi[good_lep], lep_E[good_lep], lep_trackd0pvunbiased[good_lep], lep_tracksigd0pvunbiased[good_lep], lep_z0[good_lep])")

    # Create new columns with the kinematics of good leptons
    df[s] = df[s].Define("goodlep_pt", "lep_pt[good_lep]")\
                 .Define("goodlep_eta", "lep_eta[good_lep]")\
                 .Define("goodlep_phi", "lep_phi[good_lep]")\
                 .Define("goodlep_E", "lep_E[good_lep]")

    # Select leptons with high transverse momentum
    df[s] = df[s].Filter("goodlep_pt[0] > 25000 && goodlep_pt[1] > 15000 && goodlep_pt[2] > 10000")
---------------------------------------------------------------------------
runtime_error                             Traceback (most recent call last)
Input In [9], in <cell line: 17>()
      1 ROOT.gInterpreter.Declare("""
      2 using cRVecF = const ROOT::RVec<float> &;
      3 bool GoodElectronsAndMuons(const ROOT::RVec<int> & type, cRVecF pt, cRVecF eta, cRVecF phi, cRVecF e, cRVecF trackd0pv, cRVecF tracksigd0pv, cRVecF z0)
   (...)
     14 }
     15 """)
     17 for s in samples:
     18     # Select electron or muon trigger
---> 19     df[s] = df[s].Filter("trigE || trigM")
     21     # Select events with exactly four good leptons conserving charge and lepton numbers
     22     # Note that all collections are RVecs and good_lep is the mask for the good leptons.
     23     # The lepton types are PDG numbers and set to 11 or 13 for an electron or muon
     24     # irrespective of the charge.
     25     df[s] = df[s].Define("good_lep", "abs(lep_eta) < 2.5 && lep_pt > 5000 && lep_ptcone30 / lep_pt < 0.3 && lep_etcone20 / lep_pt < 0.3")\
     26                  .Filter("Sum(good_lep) == 4")\
     27                  .Filter("Sum(lep_charge[good_lep]) == 0")\
     28                  .Define("goodlep_sumtypes", "Sum(lep_type[good_lep])")\
     29                  .Filter("goodlep_sumtypes == 44 || goodlep_sumtypes == 52 || goodlep_sumtypes == 48")

runtime_error: Template method resolution failed:
  ROOT::RDF::RInterface<ROOT::Detail::RDF::RJittedFilter,void> ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager,void>::Filter(basic_string_view<char,char_traits<char> > expression, basic_string_view<char,char_traits<char> > name = "") =>
    runtime_error: GetBranchNames: error in opening the tree mini
  ROOT::RDF::RInterface<ROOT::Detail::RDF::RJittedFilter,void> ROOT::RDF::RInterface<ROOT::Detail::RDF::RLoopManager,void>::Filter(basic_string_view<char,char_traits<char> > expression, basic_string_view<char,char_traits<char> > name = "") =>
    runtime_error: GetBranchNames: error in opening the tree mini

Error in <TUnixSystem::GetHostByName>: getaddrinfo failed for 'eospublic.cern.ch': Temporary failure in name resolution
Error in <TNetXNGFile::Open>: [FATAL] Invalid address
Error in <TUnixSystem::GetHostByName>: getaddrinfo failed for 'eospublic.cern.ch': Temporary failure in name resolution
Error in <TNetXNGFile::Open>: [FATAL] Invalid address

For your information, ROOT::RVecF raised an error of no type named 'RVecF' in namespace 'ROOT'
so I changed it to ROOT::RVec<float> but this does not solve the problem. Any help is much appreciated!

Hi @CzTee ,

do I understand correctly that you encounter this error just by running the tutorial with no changes? If so, it might be because the tutorial you linked is for ROOT’s master branch while you are on ROOT v6.24/06.

You can get a version of that tutorial compatible with your ROOT version using the “version” dropdown menu at the top of the page:

Does that help?

Cheers,
Enrico