Hi there! This may be a very simple answer, I am not sure. But, I was wondering for a variable number of branches in root that are named incrementally ( Detector_P0, Detector_P2, etc.) how one would use the SetBranchAddress all in one step to read them into correctly named variables (typed double). This is what I have so far: (I have it working for the branchName, but not the &variableName in SetBranchAddress())
for (int i = 0; i < nb_det; i++) {
std::string branchVarName = "Detector_P" + std::string(to_string(i));
const char * branchVarNameC;
branchVarNameC = branchVarName.c_str();
All->SetBranchAddress(branchVarNameC,&("detectorP" + i, ???);
}
Please read tips for efficient and successful posting and posting code
ROOT Version: 6.20/04
Platform: Not Provided
Compiler: Not Provided