Constructors of my class are missing in the dictionary

Hi,

Constructors of one of my classes are missing in the dictionary generated by rootcint in ROOT v.4. How can determine what is wrong?

A more detailed description follows:

I write a ROOT class library which I use in interactive sessions and in compiled programs. Both gcc and icc do not report any errors and compiled programs run OK. The dictionary contained the constructors when I used ROOT 3.10/02 but they are missing when I use 4.00/04 or 4.00/06a. I haven’t tested other versions of ROOT.

The dictionary is generated by

rootcint -v -f ctmodDict.cc -c -DUSE_ROOT $(HDRS) ctmodLinkDef.h

where $(HDRS) refers to approximately 50 header files.

A section of the class code is:

  TVpPointDetectorArrayPlanar();
  TVpPointDetectorArrayPlanar(TVpVector3 const center,
			      TVpVector3 const stepX, TVpVector3 const stepY,
			      Int_t nx, Int_t ny, Int_t numOfChannels,
			      Double_t minEnergy, Double_t maxEnergy,
			      TVpDetectorResponse *detectorResponse = 0);
  TVpPointDetectorArrayPlanar(Char_t *fileName);
  virtual ~TVpPointDetectorArrayPlanar() {};
  void     SetPosition(TVpVector3 const& center, TVpVector3 const& stepX, TVpVector3 const& stepY);

The relevant section of the dictionary (4.00/06a) is:

/* TVpPointDetectorArrayPlanar */
static int G__ctmodDict_255_4_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
      G__setnull(result7);
      ((TVpPointDetectorArrayPlanar*)(G__getstructoffset()))->SetPosition(*(TVpVector3*)libp->para[0].ref,*(TVpVector3*)libp->para[1].ref
,*(TVpVector3*)libp->para[2].ref);
   return(1 || funcname || hash || result7 || libp) ;
}

Note the index starts from _4_0 and refers to the SetPosition() member function.

The 3.10/02 version of the dictionary is:

/* TVpPointDetectorArrayPlanar */
static int G__ctmodDict_248_0_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
   TVpPointDetectorArrayPlanar *p=NULL;
   if(G__getaryconstruct()) p=new TVpPointDetectorArrayPlanar[G__getaryconstruct()];
   else p=::new((G__ctmodDictdOcc_tag*)G__getgvp()) TVpPointDetectorArrayPlanar;
      result7->obj.i = (long)p;
      result7->ref = (long)p;
      result7->type = 'u';
      result7->tagnum = G__get_linked_tagnum(&G__ctmodDictLN_TVpPointDetectorArrayPlanar);
   return(1 || funcname || hash || result7 || libp) ;
}
...
static int G__ctmodDict_248_4_0(G__value *result7,G__CONST char *funcname,struct G__param *libp,int hash) {
      G__setnull(result7);
      ((TVpPointDetectorArrayPlanar*)(G__getstructoffset()))->SetPosition(*(TVpVector3*)libp->para[0].ref,*(TVpVector3*)libp->para[1].ref
,*(TVpVector3*)libp->para[2].ref);
   return(1 || funcname || hash || result7 || libp) ;
}

The index starts from _0_0 and all constructors are there. The SetPosition() function has the index _4_0.

The problem may be somewhere in my code, any suggestions would be appreciated.

Hi,

In general rootcint does not generate the dictionary entry for the constructor only if they are either private or protected or if the class is abstract (i.e. one of the abstract virtual method is not overloaded).

In order to check this problem, I would need a tar file containing enought of your header to run your rootcint command.

Cheers,
Philippe

Hi,

I’ve found a workaround. The original class was

class TVpPointDetectorArrayPlanar : public TVpPointDetectorArray
{
 public:
  TVpVector3        fOrigin;        // Origin of the detector array
  TVpVector3        fStepX;         // Step between detectors in local X-direction
  TVpVector3        fStepY;         // Step between detectors in local Y-direction
  
  Double_t          fArraySizeX;    // Size of the array in X-direction
  Double_t          fArraySizeY;    // Size of the array in Y-direction
  Double_t          fStepSizeX;     // Step size X
  Double_t          fStepSizeY;     // Step size Y
  
  TVpPointDetectorArrayPlanar();
  TVpPointDetectorArrayPlanar(TVpVector3 const center,
			      TVpVector3 const stepX, TVpVector3 const stepY,
			      Int_t nx, Int_t ny, Int_t numOfChannels,
			      Double_t minEnergy, Double_t maxEnergy,
			      TVpDetectorResponse *detectorResponse = 0);
  TVpPointDetectorArrayPlanar(Char_t *fileName);
  virtual ~TVpPointDetectorArrayPlanar() {};
  void     SetPosition(TVpVector3 const& center, TVpVector3 const& stepX,
		       TVpVector3 const& stepY);
  void     PrintStatus(std::ostream &out = std::cout) const;
  void     SetDefaultPosition();
  void     Move(TVpMatrix3x3 const & rotMat, TVpVector3 const & traVec);
  TVpPointDetectorArray* Clone(Int_t numDivX = 1, Int_t numDivY = 1) const;
  TVpVector3 GetCenter() const;

#ifdef USE_ROOT
  ClassDef(TVpPointDetectorArrayPlanar,1) // Point detector array, planar shape
#endif 

};

I’ve changed the declaration of the Move() member function from

void Move(TVpMatrix3x3 const & rotMat, TVpVector3 const & traVec);

to

void Move(const TVpMatrix3x3& rotMat, const TVpVector3& traVec);

and rootcint (4.00/06a) now generates all constructors of this class.

It looks like a rootcint bug but I haven’t succeeded to write a short code which demonstrates the problem.

My other classes use the “const T&” syntax so there is no problem with this change.