Is there something wrong with the code below??Because I get a segmentation break with these lines and without everything works perfectly..

The problem seems to be in the red line...

Any ideas??

// store the 4-vector of the truth matched candidate (or a dummy, if not matched to keep ntuple consistent)

RhoCandidate *truth = d0[j]->GetMcTruth();

TLorentzVector lv;

if (truth) lv = truth->P4();

qa.qaP4("trd0", lv, nd0);

PndKinVtxFitter *vtxfitter=new PndKinVtxFitter(truth); // instantiate a vertex fitter

vtxfitter->Fit();

RhoCandidate *d0fitvtx = truth->GetFit(); // access the fitted cand

Float_t chi2_vtx = vtxfitter->GetChi2(); // access chi2 of fit

Float_t prob_vtx = vtxfitter->GetProb(); // access probability of fit

TVector3 d0Vtx = d0fitvtx->Pos(); // and the decay vertex position

nd0->Column("vtxprob", (Float_t) prob_vtx);

nd0->Column("vtxchi2", (Float_t) chi2_vtx);

nd0->Column("vtxposx", (Float_t) d0Vtx.));

nd0->Column("vtxposy", (Float_t) d0Vtx.Y());

nd0->Column("vtxposz", (Float_t) d0Vtx.Z());]]>

You try to fit a MC-Truth candidate. I have two objections against that: Firstly it does not have a PidCandidate object and not all featureas, esp. Vertexing, are available. Secondly it is the truth and should not be processed by a fitter, because vertex and fourmomenta are true and the truest truth.

Try some reconstructed candidate.

Cheers

Ralf]]>

I am trying to calculate ctau for D0 meson in my analysis(123micrometers)

From the mc the calculation is correct(125micrometers).

From the vertex information I get 185micrometers..

I have looked several times my code and I could not find a single mistake..

Is there a chance, since we are talking about micrometers that the resolution is not good or there is something else wrong??

I attach my code and my results to get an idea..

Thanks!!]]>