Skip to content

"Second registration of" error with a template argument "missing" #22359

@makortel

Description

@makortel

Check duplicate issues.

  • Checked for duplicates

Description

I was working to add dictionaries for types that were causing header parsing in cms-sw/cmssw#50292 (comment). Adding this fragment to SimDataFormats/Associations/src/classes_def.xml

  <class name="edm::OneToManyWithQualityGeneric<
  std::vector<SimCluster>, std::vector<reco::PFCluster>, std::pair<float,float>, unsigned int,
  edm ::RefProd<std::vector<SimCluster>>, edm::RefProd<std::vector<reco::PFCluster>>,
  edm::Ref<std::vector<SimCluster>>, edm::Ref<std::vector<reco::PFCluster>>>"/>

  <class name="edm::OneToManyWithQualityGeneric<
               std::vector<CaloParticle>, std::vector<reco::PFCluster>, std::pair<float,float>, unsigned int,
               edm::RefProd<std::vector<CaloParticle>>, edm::RefProd<std::vector<reco::PFCluster>>,
               edm::Ref<std::vector<CaloParticle>>, edm::Ref<std::vector<reco::PFCluster>>>"/>

leads to loading the library (e.g. by utilities being run in CMSSW build) to report(linebreaks are mine)

Error in TClassTable::AddAlternate: Second registration of edm::OneToManyWithQualityGeneric<,std::vector<reco::PFCluster>,std::pair<float,float>,unsigned int,,edm::RefProd<std::vector<reco::PFCluster> >,,edm::Ref<std::vector<reco::PFCluster> > >
with a different normalized name (
 old: 'edm::OneToManyWithQualityGeneric<vector<CaloParticle>,vector<reco::PFCluster>,pair<float,float>,unsigned int,edm::RefProd<vector<CaloParticle> >,edm::RefProd<vector<reco::PFCluster> >,edm::Ref<vector<CaloParticle>,CaloParticle,edm::refhelper::FindUsingAdvance<vector<CaloParticle>,CaloParticle> >,edm::Ref<vector<reco::PFCluster>,reco::PFCluster,edm::refhelper::FindUsingAdvance<vector<reco::PFCluster>,reco::PFCluster> > >',
 new: 'edm::OneToManyWithQualityGeneric<vector<SimCluster>,vector<reco::PFCluster>,pair<float,float>,unsigned int,edm::RefProd<vector<SimCluster> >,edm::RefProd<vector<reco::PFCluster> >,edm::Ref<vector<SimCluster>,SimCluster,edm::refhelper::FindUsingAdvance<vector<SimCluster>,SimCluster> >,edm::Ref<vector<reco::PFCluster>,reco::PFCluster,edm::refhelper::FindUsingAdvance<vector<reco::PFCluster>,reco::PFCluster> > >'
)

(note that rootcling itself appears to not report errors)

The error message containing edm::OneToManyWithQualityGeneric<,std::vector (specifically <,) smells.

I inspected the SimDataFormatsAssociations_xr.rootmap file and it contains

class edm::AssociationMap<edm::OneToManyWithQualityGeneric<,std::vector<CaloParticle>,float,unsigned int,,edm::RefProd<std::vector<CaloParticle> >,,edm::Ref<std::vector<CaloParticle> > > >
class edm::OneToManyWithQualityGeneric<,std::vector<reco::PFCluster>,std::pair<float,float>,unsigned int,,edm::RefProd<std::vector<reco::PFCluster> >,,edm::Ref<std::vector<reco::PFCluster> > >
class edm::OneToManyWithQualityGeneric<,std::vector<reco::PFCluster>,std::pair<float,float>,unsigned int,,edm::RefProd<std::vector<reco::PFCluster> >,,edm::Ref<std::vector<reco::PFCluster> > >

Reproducer

In CMSSW environment (apologies)

cmsrel CMSSW_17_0_X_2026-05-18-1100 # reproduces on many other builds as well
cd CMSSW_17_0_X_2026-05-18-1100/src
cmsenv
git cms-addpkg SimDataFormats/Associations
# edit SimDataFormats/Associations/src/classes_def.xml and add the fragment above
scram b

ROOT version

6.36.11 (specifically on 1db6564)

Installation method

As part of CMSSW

Operating system

Linux, Alma 8

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions