Hi Dilia,
Philippe is currently travelling, he might reply when he’s back (in ~3 weeks).
In the meanwhile, can you post the output of tree->Print() for your TTree? As far as I know it’s not possible to create branches of type unsigned long in a TTree, i.e. you might want to actually read the branch as some other type, e.g. unsigned long long.
I am also seeing the exact same behavior, and trying to use
TTreeReaderValue<unsigned long long> evt_event(myReader,"evt.event");
does not correct the issue for me.
I seem to be doing the same thing as DongLiang and Dilia_Maria_Portillo.
I make a branch using a struct in my analysis, and that struct contains items of type ULong64_t. When I run MakeSelector on the branch that is made, I get
When I try to run the selector in ROOT (v6.18), I am presented with an error:
root [0] TChain* ch = new TChain("pduneMuonLifetime/OpHitBkgTree")
(TChain *) 0x55aa6129d3f0
root [1] ch->Add("~/PDune_ReproV28/pdune_reco_repro_opPatch_SMu_np04_raw_run005*.root")
(int) 14
root [2] ch->Process("BKGSelection.C+g")
slave begin
Hists made
Getting Entry from reader
Error in <TTreeReaderValueBase::CreateProxy()>: Leaf of type ULong64_t cannot be read by TTreeReaderValue<unsigned long long>.
I hate to resurrect a zombie, but it appears that this is the exact same issue, and a solution does not appear to have been found.
I have created my own topic to follow up with this, as I feel it does merit it’s own discussion in a modern thread, but for anyone who ends up here by virtue of google and is in need of an answer, I want to link that topic here.