Lambda_C reconstruction

Single Lambda_C reconstruction 

Problems:

I) a large number of candidates with zero mass, zero decay length error, etc. when refitting the tracks

SOLUTION: rewrite the refit procedure (first add the mother, then subtract daughters)

old code:

//subtract daughters
particle[1].SubtractFromVertex(particle[0]);
particle[2].SubtractFromVertex(particle[0]);
particle[3].SubtractFromVertex(particle[0]);
//add mother to PV
particle[0].AddDaughter(DP);

//set productionVertex of mother
DP.SetProductionVertex(pVertex);

//set productionVertex of daughters
particle[1].SetProductionVertex(DP);
particle[2].SetProductionVertex(DP);
particle[3].SetProductionVertex(DP);

new code:

//add mother to PV
pVertex.AddDaughter(DP);

//subtract daughters
particle[1].SubtractFromVertex(pVertex);
particle[2].SubtractFromVertex(pVertex);
particle[3].SubtractFromVertex(pVertex);

//set productionVertex of mother
DP.SetProductionVertex(pVertex);

//set productionVertex of daughters
particle[1].SetProductionVertex(DP);
particle[2].SetProductionVertex(DP);
particle[3].SetProductionVertex(DP);

With no PID, an additional problem arises:

Let's have a candidate 123 (first track assigned as  a kaon, 2nd proton, 3rd pion). All tracks (and also the PV) are then refitted. Then we move to the candidate 132. In such a case the 1st track (and the PV) is still refited while the 2nd and 3rd are not. Therefore it is necessary to rewrite the code in order to ensure that all the tracks are not refited at the begining:

if(refit==1 && current_k==k)particle[1]=particle_old[0];
if(refit==1 && current_i==i)particle[2]=particle_old[1];

particle[ndaug+1] = KFParticle(particle[1],particle[2],particle[3]);
...

if(refit==1)
{
//save non-refited daugther particles for the next loop(s)
particle_old[0]=particle[1];
particle_old[1]=particle[2];
current_k=k;
current_i=i;

//add mother to PV

...

II) shift in the reconstructed mass spectra

Fig. 1 - reconstructed mass spectra for single lambda_c 20k events - with the PID

 This is clearly a reconstruction issue:

Fig. 2 - Mass pull. PID, refit, vertex in XYZ. 

 SOLUTION: I have no idea...

III) angular distribtion

This is what we have:

Fig. 3 - Angular distribution for single lambda_c 20k events - with the PID

 However, when we reconstruct the Lambda candidates in the following way (2+1):

...
int NDaughters = ndaug-1;
const KFParticle *vDaughters[ndaug-1] = {&particle[1],&particle[2]};
KFParticle DP;
DP.Construct(vDaughters,NDaughters,&pVertex,-1,0);
DP.AddDaughter(particle[3]);
...

we will get this distribution:

Fig. 4 - Angular distribution for single lambda_c 20k events - with the PID. "2+1" reconstruction.

This is what one would not expect. On the other hand e.g. the mass spectra are not different.