Question about TMatrixD->operator()

Dear all,

This question applies to both TMatrixD->operator() and TVectorD->operator()

I’m using a macro .C in a given class Tools which contains the followinc code


Float_t Tools::ACP_secondary( PHMuoTracksOut* &muo, Int_t idx, TMatrixD* &ACP, TVectorD* &ACP_Eigen, TVectorD* &ACP_Means) {

Float_t dg0 = Tools::DG0(muo,idx)-(Float_t)ACP_Means->operator()(0);
Float_t ddg0 = Tools::DDG0(muo,idx)-(Float_t)ACP_Means->operator()(1);
Float_t ds3 = Tools::DS3(muo,idx)-(Float_t)ACP_Means->operator()(2);
Float_t ds3ctp = Tools::DS3ctp(muo,idx)-(Float_t)ACP_Means->operator()(3);
Float_t A2 = (Float_t)ACP->operator()(1,0)*dg0+(Float_t)ACP->operator()(1,1)*ds3+(Float_t)ACP->operator()(1,2)*ddg0+(Float_t)ACP->operator()(1,3)*ds3ctp;
Float_t A3 = (Float_t)ACP->operator()(2,0)*dg0+(Float_t)ACP->operator()(2,1)*ds3+(Float_t)ACP->operator()(2,2)*ddg0+(Float_t)ACP->operator()(2,3)*ds3ctp;
Float_t A4 = (Float_t)ACP->operator()(3,0)*dg0+(Float_t)ACP->operator()(3,1)*ds3+(Float_t)ACP->operator()(3,2)*ddg0+(Float_t)ACP->operator()(3,3)*ds3ctp;


I encounter no problems during compilation, but when I launch the compiled program, the program exits as soon as I’m using the ->operator() function and i return immediately to prompt (ROOT exits) without any error message

Do anyone has any idea about how this is happening, and any solution ???

Thanks by advance

Ecole Polytechnique

Hi Vincent,

Unfortunately, I can not run your script because of missing code .
Running the following little script is fine with the current 4.00/07

#include “TMatrixD.h”

TVectorD *x = new TVectorD(3);
x->operator()(0) = 1;

TMatrixD *y = new TMatrixD(3,3);
(*y)(1,2) = 3;