Efficiencies with pyROOT

I’m trying to calculate muon efficiencies with pyroot.

f_SF_ID_BC = ROOT.TFile.Open( “EfficienciesStudies_2016_legacy_rereco_rootfiles_RunBCDEF_SF_ID.root”)
h_SF_ID_BC = ROOT.TH2D()

Get_Object_f_SF_ID_BC = f_SF_ID_BC.GetObject( “NUM_TightID_DEN_genTracks_eta_pt”, h_SF_ID_BC )

The first few times it worked, now this error is showing up:

TypeError: Template method resolution failed:
Failed to instantiate “GetObject(std::string,TH2D&)”
Failed to instantiate “GetObject(std::string,TH2D*)”
Failed to instantiate “GetObject(std::string,TH2D)”


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Hi Matheus,

try this instead:

f_SF_ID_BC = ROOT.TFile.Open("EfficienciesStudies_2016_legacy_rereco_rootfiles_RunBCDEF_SF_ID.root")
h_SF_ID_BC = f_SF_ID_BC.Get("NUM_TightID_DEN_genTracks_eta_pt")

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.