Creating a TH1 type branch error

I apologise, the full bit of that code is:

 for (unsigned int imodel = 0; imodel < N; imodel++) {
                   GenericSingleSampleFitModel *this_model = (GenericSingleSampleFitModel *)(cm->GetSubModel(imodel));
                   conv::Detector_t d = this_model->GetDetector();
                   conv::BeamConf_t b = this_model->GetBeam();
                   conv::Sample_t s = this_model->GetSample();
                   conv::KineSpace_t ks = this_model->GetKineSpace();
                   std::string model_name = util::nm::MdlName(d, b, s, ks);
                   _tree_pars->Branch(model_name.c_str(), &(pdfs[imodel]), 32000, 0); //This is the line creating the error.
               }

model_name does change with imodel and I’ve checked that the branches do indeed have different names.