Dear All,
This will be a very complicated issue, but please bear with me. I’m desperate for some expert help…
In ATLAS we have a pretty complicated “vector type” called DataVector
. Amongst other things, it allows us to set up containers where let’s say if Muon
inherits from Particle
, then DataVector<Muon>
ends up inheriting from DataVector<Particle>
. One of the public places where you can have a look at the class, is here:
Now… We’re in the process of writing some new “algorithms” for ATLAS analyses. These algorithms we instantiate in our lightweight framework through their dictionaries. Which in general works fine. But we’re having endless problems with the classes defined in one of our libraries, that I can just not figure out. It’s this package/library for reference:
The problem is that when our framework tries to instantiate any of the algorithms defined in this package/library, we get these sort of errors:
In file included from libJetAnalysisAlgorithmsDict dictionary payload:50:
In file included from /home/krasznaa/projects/AnaAlg/build/x86_64-slc6-gcc62-opt/include/JetAnalysisAlgorithms/JetCalibrationAlg.h:12:
In file included from /home/krasznaa/projects/AnaAlg/build/x86_64-slc6-gcc62-opt/include/JetCalibTools/IJetCalibrationTool.h:19:
In file included from /home/krasznaa/projects/AnaAlg/build/x86_64-slc6-gcc62-opt/include/JetInterface/IJetModifier.h:17:
In file included from /home/krasznaa/projects/AnaAlg/build/x86_64-slc6-gcc62-opt/include/xAODJet/JetContainer.h:12:
In file included from /home/krasznaa/projects/AnaAlg/build/x86_64-slc6-gcc62-opt/include/xAODJet/Jet.h:12:
/home/krasznaa/projects/AnaAlg/build/x86_64-slc6-gcc62-opt/include/xAODJet/versions/Jet_v1.h:376:1: error: explicit specialization of 'DataVectorBase<xAOD::Jet_v1>' after instantiation
DATAVECTOR_BASE( xAOD::Jet_v1, xAOD::IParticle );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/krasznaa/projects/AnaAlg/build/x86_64-slc6-gcc62-opt/include/AthContainers/DataVector.h:615:43: note: expanded from macro 'DATAVECTOR_BASE'
#define DATAVECTOR_BASE(T, BASE) \
^
/home/krasznaa/projects/AnaAlg/build/x86_64-slc6-gcc62-opt/include/AthContainers/DataVector.h:625:20: note: expanded from macro '\
DATAVECTOR_BASE_FWD'
template <> struct DataVectorBase<T> \
^~~~~~~~~~~~~~~~~
/home/krasznaa/projects/AnaAlg/build/x86_64-slc6-gcc62-opt/include/AthContainers/DataVector.h:721:42: note: implicit instantiation first required here
template <class T, class BASE = typename DataVectorBase<T>::Base>
^
TInterpreter::AutoParse ERROR Error parsing payload code for class CP::JetUncertaintiesAlg with content:
#line 1 "libJetAnalysisAlgorithmsDict dictionary payload"
#ifndef G__VECTOR_HAS_CLASS_ITERATOR
#define G__VECTOR_HAS_CLASS_ITERATOR 1
#endif
#ifndef HAVE_PRETTY_FUNCTION
#define HAVE_PRETTY_FUNCTION 1
#endif
#ifndef HAVE_64_BITS
#define HAVE_64_BITS 1
#endif
#ifndef __IDENTIFIER_64BIT__
#define __IDENTIFIER_64BIT__ 1
#endif
#ifndef ATLAS
#define ATLAS 1
#endif
#ifndef ROOTCORE
#define ROOTCORE 1
#endif
#ifndef XAOD_STANDALONE
#define XAOD_STANDALONE 1
#endif
#ifndef XAOD_ANALYSIS
#define XAOD_ANALYSIS 1
#endif
#ifndef ROOTCORE_RELEASE_SERIES
#define ROOTCORE_RELEASE_SERIES 25
#endif
#ifndef PACKAGE_VERSION
#define PACKAGE_VERSION "JetAnalysisAlgorithms-00-00-00"
#endif
#ifndef PACKAGE_VERSION_UQ
#define PACKAGE_VERSION_UQ JetAnalysisAlgorithms-00-00-00
#endif
#ifndef EIGEN_DONT_VECTORIZE
#define EIGEN_DONT_VECTORIZE 1
#endif
#define _BACKWARD_BACKWARD_WARNING_H
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
/// @author Nils Krumnack
#ifndef JET_ANALYSIS_ALGORITHMS__JET_ANALYSIS_ALGORITHMS_DICT_H
#define JET_ANALYSIS_ALGORITHMS__JET_ANALYSIS_ALGORITHMS_DICT_H
#include <JetAnalysisAlgorithms/JetCalibrationAlg.h>
#include <JetAnalysisAlgorithms/JetSelectionAlg.h>
#include <JetAnalysisAlgorithms/JetSmearingAlg.h>
#include <JetAnalysisAlgorithms/JetUncertaintiesAlg.h>
#include <JetAnalysisAlgorithms/JvtEfficiencyAlg.h>
#include <JetAnalysisAlgorithms/JvtUpdateAlg.h>
#endif
#undef _BACKWARD_BACKWARD_WARNING_H
input_line_255:2:38: error: allocation of incomplete type 'CP::JetUncertaintiesAlg'
dynamic_cast<EL::AnaAlgorithm*>(new CP::JetUncertaintiesAlg ("JetUncertaintiesAlg", nullptr))
^~~~~~~~~~~~~~~~~~~~~~~
libJetAnalysisAlgorithmsDict dictionary forward declarations' payload:8:109: note: forward declaration of 'CP::JetUncertaintiesAlg'
namespace CP{class __attribute__((annotate("$clingAutoload$JetAnalysisAlgorithms/JetUncertaintiesAlg.h"))) JetU...
^
EventLoopComp_Algorith...ERROR /home/krasznaa/projects/AnaAlg/athena/PhysicsAnalysis/D3PDTools/AnaAlgorithm/Root/AnaAlgorithmConfig.cxx:231 (StatusCode EL::AnaAlgorithmConfig::makeAlgorithm(std::unique_ptr<EL::AnaAlgorithm>&) const): failed to create algorithm of type CP::JetUncertaintiesAlg
EventLoopComp_Algorith...ERROR /home/krasznaa/projects/AnaAlg/athena/PhysicsAnalysis/D3PDTools/AnaAlgorithm/Root/AnaAlgorithmConfig.cxx:232 (StatusCode EL::AnaAlgorithmConfig::makeAlgorithm(std::unique_ptr<EL::AnaAlgorithm>&) const): make sure you created a dictionary for your algorithm
Now, as far as I understand, this sort of error should happen when:
- We declare a class, in this case xAOD::Jet_v1;
- We instantiate a
DataVector<xAOD::Jet_v1>
object; - After all of this, we use the DATAVECTOR_BASE macro to specify that
DataVector<xAOD::Jet_v1>
should inherit fromDataVector<xAOD::IParticle>
.
I.e. we call the DATAVECTOR_BASE
macro “too late”. But I can just not figure out how this is meant to happen.
The situation is made much weirder by the fact that I can happily instantiate the algorithm from PyROOT for instance. It’s only when our framework tries to instantiate this algorithm that things break like this.
Also note that our other algorithms, which use containers very similar to xAOD::JetContainer
, work just fine.
Does anyone have any ideas how I can try to debug this? I’ve been looking at this issue for a long time already, and I’m really out of ideas by now. How could I ask cling how it encountered the “un-specialised” form of that DataVectorBase
struct? Unfortunately the error message telling me on which line it encountered it, without giving be a full backtrace of how it reached that line, is not enough help…
Any help is very much welcomed on this one.
Cheers,
Attila