Dear experts,
I am trying to access a variable from a branch structured similarly to std::vector<std::set<int16_t>>
I am trying to access the variable with the following lines of code in the macro
static constexpr Int_t kMaxPFCandidates = 1167;
std::set<int> PFCandidates_regionsOfInterest_[kMaxPFCandidates];
TBranch *b_PFCandidates_regionsOfInterest_;
fChain->SetBranchAddress("PFCandidates.regionsOfInterest_",PFCandidates_regionsOfInterest_, &b_PFCandidates_regionsOfInterest_);
Now in the event loop
for (Long64_t jentry=0; jentry<nentries;jentry++){
Long64_t ientry = LoadTree(jentry);
for (int iPFcan=0; iPFcan < PFCandidates_; iPFcan++){
if (PFCandidates_>0){
std::set<int> mySet = PFCandidates_regionsOfInterest_[iPFcan];
cout<<"mySet.size()\t " <<mySet.size<<endl;
}
}
}
The set’s size appears to be zero, indicating that I might be unable to retrieve PFCandidates.regionsOfInterest_
. Is there something I’m overlooking, or do objects like std::vector<std::set> require a different access method than SetBranchAddress
?
Best
Prafulla