I am currently evaulating alternative procedures for kinematic fitting and while doing some debugging i noticed, that the Covariance-Matrices i get are not positive-semi-definite.

I used the Rho-Macro for the kinematic fits and simply called my own routine after the vertex-fit was done (instead of calling the PndKinFitter).

My program also implements RhoFitterBase and after calling:

fDaughters.clear();

FindAndAddFinalStateDaughters(fHeadOfTree);

i take the P4-vectors and their covariances for each final state particle.

When i calcualte the eigenvectors for the covariances there are always some who are negative, which means the covariance matrices are not positive-semi-definite (i calculated the eigenvectors by hand for one example to make sure it is not a numeric problem and i get the same results).

Does anybody know something about this?

Thanks in andvance

Simon Henssler]]>

Thanks for that finding.

Which macro do you use? I assume it is macro/run/ana_complete.C.

Please check those covariances

Cheers

Ralf

]]>

i used the macro in tutorials/rho/tut_ana_task.C

i will check the covariances as you said, then i'll post the results again.

Cheers

Simon]]>

i checked the P4-Covariances of the RhoCandidates before doing any fitting and there are still some eigenvalues < 0, though it seem to be less than before.

I don't really understand what you mean by checking the RecoCandidates, because the FairRecoCandidate is virtual.

Greetings

Simon]]>

That should be fine:

PndPidCandidate* myPidcand = (PndPidCandidate*) myRhocand->GetRecoCandidate();

Then proceed from there. PndPidCandidate inherits from FairRecoCandidate.

Cheers

Ralf]]>

i'm not really sure if this simply doesn't work, or if i'm doing something wrong...

if i do:

PndPidCandidate *myPidcand = (PndPidCandidate*) (jpsi[j]->GetRecoCandidate());

this works fine, but trying to access any member-functions, for example:

myPidCandidate->P4Cov().Print();

then i get a segmentation violation.

Greetings

Simon]]>

Well, Only final state paticles have a RecoCand (which is basically the track information plus PID related properties from various detectors). A J/Psi is always a combined candidate and thus has no RecoCand. I think firstly you should look at the final state particles anyways.

To avoid segfaults, catch such pointer cunstructions with if(0=myPidcand) ...

Cheers

Ralf]]>

i was just confused, because everything worked fine when i used the RhoCandidates directly... sorry i'm not really familiar with all the Panda physics and the computing framework,

anyway the calculated eigenvectors from the RhoCandidates and the PndPidCandidates are exactly the same and there are still some < 0. I used the TMatrixDEigen to calculate them, though i think with the values in a range of 10^-15 there should not occur any numeric issues.

Cheers

Simon]]>

The next to check would be the tracks themselves:

Get a track array (mind loading the reco file):

TClonesArray* tca = ( TClonesArray* ) fRootManager->GetObject ("SttMvdGemGenTrack");

Then get the track and proceed from there:

PndPidCandidate* pidCand = (PndPidCandidate*)cand->GetRecoCandidate(); PndTrack* track = ( PndTrack* ) tca->At ( pidCand->GetTrackIndex() );

Cheers

Ralf]]>

I don't quite understand how to proceed with the tracks. Do they have covariances?

If they do, then how do I get them?

Thanks

Simon]]>

You could go with the track parameters defined at the "first" hit of the measured trajectory:

PndPidCandidate* pidCand = (PndPidCandidate*)cand->GetRecoCandidate(); PndTrack* track = ( PndTrack* ) tca->At ( pidCand->GetTrackIndex() ); FairTrackParP* firstpar = track->GetParamFirst();

Then access the things via: GetX(), GetDX(), GetPx(), GetDPx() (and the other coordinates similar).

Header of FairTrackPar: here.

For the non-diagonal elements, i.e. the covariance matrix:

Double_t fistparCov[6][6]; firstpar->GetMARSCov(firstparCov); //cov is being filled here

If you want to access the prefit do this:

PndTrackCand* mytcand = track->GetTrackCandPtr();

Cheers

Ralf]]>

const Float_t* GetErrorP7() const{return fErrP7;} const Float_t* GetCov() const{return fCov;} TMatrixD& Cov7() const; TMatrixD& P4Cov() const ;

Those covariances are after the propagation to the IP. With the firstPar you get the actual values from the track fit. That is my point here.

Cheers

Ralf

]]>

]]>

positive semi definite does not mean that there cannot be negative values.

The Definition says, that any vector y multiplied in the way: y^t * C * y,

where C is the Covariance Matrix, must result in a value greater or equal to zero.

In a way that is the proof, that the Chi-Square value ( y^t * C^-1 * y ) is always positive.

Or rather, if C is not positive semi definite, then it cannot ne guaranteed that the Chi Square value is positive.

It is a mathematical property that every Covarince Matrix Must have.

Cheers

Simon ]]>

To verify the negative values i used the TMatrixDEigen Analysis from Root. ]]>

I am on vacation right now and do not have access, so this will have to wait until next week.

Or you could ask Elisabetta, i think she verified the negative values.

Greetings

Simon]]>