+ if((lambda[0]>0.01) && (lambda[1]>0.01) && time > 0.){
+
+ // Looking at the CPV detector. If RCPV greater than CpvEmcDistance, 1st,
+ // 2nd or 3rd bit (depending on the efficiency-purity point )is set to 1 .
+
+ if(GetDistance(emc, cpv, "R") > (*fParameters)(fClusterrcpv,eff_pur) )
+ rp->SetPIDBit(eff_pur) ;
+
+ // Looking the TOF. If TOF smaller than gate, 4th, 5th or 6th
+ // bit (depending on the efficiency-purity point )is set to 1
+ if(time< (*fParameters)(fCluster+3+fMatrixExtraRow,eff_pur))
+ rp->SetPIDBit(eff_pur+3) ;
+
+ // Looking PCA. Define and calculate the data (X), introduce in the function
+ // X2P that gives the components (P).
+ Float_t Spher = 0. ;
+ Float_t Emaxdtotal = 0. ;
+
+ if((lambda[0]+lambda[1])!=0) Spher=fabs(lambda[0]-lambda[1])/(lambda[0]+lambda[1]);
+
+ Emaxdtotal=emc->GetMaximalEnergy()/emc->GetEnergy();
+
+ fX[0] = lambda[0] ;
+ fX[1] = lambda[1] ;
+ fX[2] = emc->GetDispersion() ;
+ fX[3] = Spher ;
+ fX[4] = emc->GetMultiplicity() ;
+ fX[5] = Emaxdtotal ;
+ fX[6] = emc->GetCoreEnergy() ;
+
+ fPrincipal->X2P(fX,fP);
+
+ //If we are inside the ellipse, 7th, 8th or 9th
+ // bit (depending on the efficiency-purity point )is set to 1
+ if(GetPrincipalSign(fP,fCluster+fMatrixExtraRow,eff_pur) == 1)
+ rp->SetPIDBit(eff_pur+6) ;
+
+ }