#include "AliESDEvent.h"
#include "AliESDcascade.h"
#include "AliLightCascadeVertexer.h"
ClassImp(AliLightCascadeVertexer)
Double_t
AliLightCascadeVertexer::fgChi2max=33.;
Double_t
AliLightCascadeVertexer::fgDV0min=0.01;
Double_t
AliLightCascadeVertexer::fgMassWin=0.008;
Double_t
AliLightCascadeVertexer::fgDBachMin=0.01;
Double_t
AliLightCascadeVertexer::fgDCAmax=2.0;
Double_t
AliLightCascadeVertexer::fgCPAmin=0.98;
Double_t
AliLightCascadeVertexer::fgRmin=0.2;
Double_t
AliLightCascadeVertexer::fgRmax=100.;
Double_t AliLightCascadeVertexer::fgMaxEta=0.8;
Double_t AliLightCascadeVertexer::fgMinClusters=70;
Int_t AliLightCascadeVertexer::V0sTracks2CascadeVertices(AliESDEvent *event) {
const AliESDVertex *vtxT3D=event->GetPrimaryVertex();
Double_t xPrimaryVertex=vtxT3D->GetX();
Double_t yPrimaryVertex=vtxT3D->GetY();
Double_t zPrimaryVertex=vtxT3D->GetZ();
Double_t b=event->GetMagneticField();
Int_t nV0=(Int_t)event->GetNumberOfV0s();
TObjArray vtcs(nV0);
Int_t i;
for (i=0; i<nV0; i++) {
AliESDv0 *v=event->GetV0(i);
if (v->GetOnFlyStatus()) continue;
if (v->GetD(xPrimaryVertex,yPrimaryVertex,zPrimaryVertex)<fDV0min) continue;
vtcs.AddLast(v);
}
nV0=vtcs.GetEntriesFast();
Int_t nentr=(Int_t)event->GetNumberOfTracks();
TArrayI trk(nentr); Int_t ntr=0;
for (i=0; i<nentr; i++) {
AliESDtrack *esdtr=event->GetTrack(i);
ULong_t status=esdtr->GetStatus();
if ((status&AliESDtrack::kITSrefit)==0)
if ((status&AliESDtrack::kTPCrefit)==0) continue;
if (esdtr->GetTPCNcls() < fMinClusters ) continue;
if (TMath::Abs(esdtr->GetD(xPrimaryVertex,yPrimaryVertex,b))<fDBachMin) continue;
trk[ntr++]=i;
}
Double_t massLambda=1.11568;
Int_t ncasc=0;
for (i=0; i<nV0; i++) {
AliESDv0 *v=(AliESDv0*)vtcs.UncheckedAt(i);
AliESDv0 v0(*v);
v0.ChangeMassHypothesis(kLambda0);
if (TMath::Abs(v0.GetEffMass()-massLambda)>fMassWin) continue;
for (Int_t j=0; j<ntr; j++) {
Int_t bidx=trk[j];
if (bidx==v0.GetIndex(0)) continue;
AliESDtrack *btrk=event->GetTrack(bidx);
if (btrk->GetSign()>0) continue;
AliESDv0 *pv0=&v0;
AliExternalTrackParam bt(*btrk), *pbt=&bt;
Double_t dca=PropagateToDCA(pv0,pbt,b);
if (dca > fDCAmax) continue;
if (TMath::Abs(pbt->Eta())>fMaxEta) continue;
AliESDcascade cascade(*pv0,*pbt,bidx);
Double_t x,y,z; cascade.GetXYZcascade(x,y,z);
Double_t r2=x*x + y*y;
if (r2 > fRmax*fRmax) continue;
if (r2 < fRmin*fRmin) continue;
Double_t pxV0,pyV0,pzV0;
pv0->GetPxPyPz(pxV0,pyV0,pzV0);
if (x*pxV0+y*pyV0+z*pzV0 < 0) continue;
Double_t x1,y1,z1; pv0->GetXYZ(x1,y1,z1);
if (r2 > (x1*x1+y1*y1)) continue;
if (cascade.GetCascadeCosineOfPointingAngle(xPrimaryVertex,yPrimaryVertex,zPrimaryVertex) <fCPAmin) continue;
cascade.SetDcaXiDaughters(dca);
event->AddCascade(&cascade);
ncasc++;
}
}
for (i=0; i<nV0; i++) {
AliESDv0 *v=(AliESDv0*)vtcs.UncheckedAt(i);
AliESDv0 v0(*v);
v0.ChangeMassHypothesis(kLambda0Bar);
if (TMath::Abs(v0.GetEffMass()-massLambda)>fMassWin) continue;
for (Int_t j=0; j<ntr; j++) {
Int_t bidx=trk[j];
if (bidx==v0.GetIndex(1)) continue;
AliESDtrack *btrk=event->GetTrack(bidx);
if (btrk->GetSign()<0) continue;
AliESDv0 *pv0=&v0;
AliExternalTrackParam bt(*btrk), *pbt=&bt;
Double_t dca=PropagateToDCA(pv0,pbt,b);
if (dca > fDCAmax) continue;
AliESDcascade cascade(*pv0,*pbt,bidx);
Double_t x,y,z; cascade.GetXYZcascade(x,y,z);
Double_t r2=x*x + y*y;
if (r2 > fRmax*fRmax) continue;
if (r2 < fRmin*fRmin) continue;
Double_t pxV0,pyV0,pzV0;
pv0->GetPxPyPz(pxV0,pyV0,pzV0);
if (x*pxV0+y*pyV0+z*pzV0 < 0) continue;
Double_t x1,y1,z1; pv0->GetXYZ(x1,y1,z1);
if (r2 > (x1*x1+y1*y1)) continue;
if (cascade.GetCascadeCosineOfPointingAngle(xPrimaryVertex,yPrimaryVertex,zPrimaryVertex) < fCPAmin) continue;
cascade.SetDcaXiDaughters(dca);
event->AddCascade(&cascade);
ncasc++;
}
}
Info("V0sTracks2CascadeVertices","Number of reconstructed cascades: %d",ncasc);
return 0;
}
Double_t AliLightCascadeVertexer::Det(Double_t a00, Double_t a01, Double_t a10, Double_t a11) const {
return a00*a11 - a01*a10;
}
Double_t AliLightCascadeVertexer::Det(Double_t a00,Double_t a01,Double_t a02,
Double_t a10,Double_t a11,Double_t a12,
Double_t a20,Double_t a21,Double_t a22) const {
return a00*Det(a11,a12,a21,a22)-a01*Det(a10,a12,a20,a22)+a02*Det(a10,a11,a20,a21);
}
Double_t AliLightCascadeVertexer::PropagateToDCA(AliESDv0 *v, AliExternalTrackParam *t, Double_t b) {
Double_t alpha=t->GetAlpha(), cs1=TMath::Cos(alpha), sn1=TMath::Sin(alpha);
Double_t r[3]; t->GetXYZ(r);
Double_t x1=r[0], y1=r[1], z1=r[2];
Double_t p[3]; t->GetPxPyPz(p);
Double_t px1=p[0], py1=p[1], pz1=p[2];
Double_t x2,y2,z2;
Double_t px2,py2,pz2;
v->GetXYZ(x2,y2,z2);
v->GetPxPyPz(px2,py2,pz2);
Double_t dd= Det(x2-x1,y2-y1,z2-z1,px1,py1,pz1,px2,py2,pz2);
Double_t ax= Det(py1,pz1,py2,pz2);
Double_t ay=-Det(px1,pz1,px2,pz2);
Double_t az= Det(px1,py1,px2,py2);
Double_t dca=TMath::Abs(dd)/TMath::Sqrt(ax*ax + ay*ay + az*az);
Double_t t1 = Det(x2-x1,y2-y1,z2-z1,px2,py2,pz2,ax,ay,az)/
Det(px1,py1,pz1,px2,py2,pz2,ax,ay,az);
x1 += px1*t1; y1 += py1*t1;
x1=x1*cs1 + y1*sn1;
if (!t->PropagateTo(x1,b)) {
Error("PropagateToDCA","Propagation failed !");
return 1.e+33;
}
return dca;
}
AliLightCascadeVertexer.cxx:1 AliLightCascadeVertexer.cxx:2 AliLightCascadeVertexer.cxx:3 AliLightCascadeVertexer.cxx:4 AliLightCascadeVertexer.cxx:5 AliLightCascadeVertexer.cxx:6 AliLightCascadeVertexer.cxx:7 AliLightCascadeVertexer.cxx:8 AliLightCascadeVertexer.cxx:9 AliLightCascadeVertexer.cxx:10 AliLightCascadeVertexer.cxx:11 AliLightCascadeVertexer.cxx:12 AliLightCascadeVertexer.cxx:13 AliLightCascadeVertexer.cxx:14 AliLightCascadeVertexer.cxx:15 AliLightCascadeVertexer.cxx:16 AliLightCascadeVertexer.cxx:17 AliLightCascadeVertexer.cxx:18 AliLightCascadeVertexer.cxx:19 AliLightCascadeVertexer.cxx:20 AliLightCascadeVertexer.cxx:21 AliLightCascadeVertexer.cxx:22 AliLightCascadeVertexer.cxx:23 AliLightCascadeVertexer.cxx:24 AliLightCascadeVertexer.cxx:25 AliLightCascadeVertexer.cxx:26 AliLightCascadeVertexer.cxx:27 AliLightCascadeVertexer.cxx:28 AliLightCascadeVertexer.cxx:29 AliLightCascadeVertexer.cxx:30 AliLightCascadeVertexer.cxx:31 AliLightCascadeVertexer.cxx:32 AliLightCascadeVertexer.cxx:33 AliLightCascadeVertexer.cxx:34 AliLightCascadeVertexer.cxx:35 AliLightCascadeVertexer.cxx:36 AliLightCascadeVertexer.cxx:37 AliLightCascadeVertexer.cxx:38 AliLightCascadeVertexer.cxx:39 AliLightCascadeVertexer.cxx:40 AliLightCascadeVertexer.cxx:41 AliLightCascadeVertexer.cxx:42 AliLightCascadeVertexer.cxx:43 AliLightCascadeVertexer.cxx:44 AliLightCascadeVertexer.cxx:45 AliLightCascadeVertexer.cxx:46 AliLightCascadeVertexer.cxx:47 AliLightCascadeVertexer.cxx:48 AliLightCascadeVertexer.cxx:49 AliLightCascadeVertexer.cxx:50 AliLightCascadeVertexer.cxx:51 AliLightCascadeVertexer.cxx:52 AliLightCascadeVertexer.cxx:53 AliLightCascadeVertexer.cxx:54 AliLightCascadeVertexer.cxx:55 AliLightCascadeVertexer.cxx:56 AliLightCascadeVertexer.cxx:57 AliLightCascadeVertexer.cxx:58 AliLightCascadeVertexer.cxx:59 AliLightCascadeVertexer.cxx:60 AliLightCascadeVertexer.cxx:61 AliLightCascadeVertexer.cxx:62 AliLightCascadeVertexer.cxx:63 AliLightCascadeVertexer.cxx:64 AliLightCascadeVertexer.cxx:65 AliLightCascadeVertexer.cxx:66 AliLightCascadeVertexer.cxx:67 AliLightCascadeVertexer.cxx:68 AliLightCascadeVertexer.cxx:69 AliLightCascadeVertexer.cxx:70 AliLightCascadeVertexer.cxx:71 AliLightCascadeVertexer.cxx:72 AliLightCascadeVertexer.cxx:73 AliLightCascadeVertexer.cxx:74 AliLightCascadeVertexer.cxx:75 AliLightCascadeVertexer.cxx:76 AliLightCascadeVertexer.cxx:77 AliLightCascadeVertexer.cxx:78 AliLightCascadeVertexer.cxx:79 AliLightCascadeVertexer.cxx:80 AliLightCascadeVertexer.cxx:81 AliLightCascadeVertexer.cxx:82 AliLightCascadeVertexer.cxx:83 AliLightCascadeVertexer.cxx:84 AliLightCascadeVertexer.cxx:85 AliLightCascadeVertexer.cxx:86 AliLightCascadeVertexer.cxx:87 AliLightCascadeVertexer.cxx:88 AliLightCascadeVertexer.cxx:89 AliLightCascadeVertexer.cxx:90 AliLightCascadeVertexer.cxx:91 AliLightCascadeVertexer.cxx:92 AliLightCascadeVertexer.cxx:93 AliLightCascadeVertexer.cxx:94 AliLightCascadeVertexer.cxx:95 AliLightCascadeVertexer.cxx:96 AliLightCascadeVertexer.cxx:97 AliLightCascadeVertexer.cxx:98 AliLightCascadeVertexer.cxx:99 AliLightCascadeVertexer.cxx:100 AliLightCascadeVertexer.cxx:101 AliLightCascadeVertexer.cxx:102 AliLightCascadeVertexer.cxx:103 AliLightCascadeVertexer.cxx:104 AliLightCascadeVertexer.cxx:105 AliLightCascadeVertexer.cxx:106 AliLightCascadeVertexer.cxx:107 AliLightCascadeVertexer.cxx:108 AliLightCascadeVertexer.cxx:109 AliLightCascadeVertexer.cxx:110 AliLightCascadeVertexer.cxx:111 AliLightCascadeVertexer.cxx:112 AliLightCascadeVertexer.cxx:113 AliLightCascadeVertexer.cxx:114 AliLightCascadeVertexer.cxx:115 AliLightCascadeVertexer.cxx:116 AliLightCascadeVertexer.cxx:117 AliLightCascadeVertexer.cxx:118 AliLightCascadeVertexer.cxx:119 AliLightCascadeVertexer.cxx:120 AliLightCascadeVertexer.cxx:121 AliLightCascadeVertexer.cxx:122 AliLightCascadeVertexer.cxx:123 AliLightCascadeVertexer.cxx:124 AliLightCascadeVertexer.cxx:125 AliLightCascadeVertexer.cxx:126 AliLightCascadeVertexer.cxx:127 AliLightCascadeVertexer.cxx:128 AliLightCascadeVertexer.cxx:129 AliLightCascadeVertexer.cxx:130 AliLightCascadeVertexer.cxx:131 AliLightCascadeVertexer.cxx:132 AliLightCascadeVertexer.cxx:133 AliLightCascadeVertexer.cxx:134 AliLightCascadeVertexer.cxx:135 AliLightCascadeVertexer.cxx:136 AliLightCascadeVertexer.cxx:137 AliLightCascadeVertexer.cxx:138 AliLightCascadeVertexer.cxx:139 AliLightCascadeVertexer.cxx:140 AliLightCascadeVertexer.cxx:141 AliLightCascadeVertexer.cxx:142 AliLightCascadeVertexer.cxx:143 AliLightCascadeVertexer.cxx:144 AliLightCascadeVertexer.cxx:145 AliLightCascadeVertexer.cxx:146 AliLightCascadeVertexer.cxx:147 AliLightCascadeVertexer.cxx:148 AliLightCascadeVertexer.cxx:149 AliLightCascadeVertexer.cxx:150 AliLightCascadeVertexer.cxx:151 AliLightCascadeVertexer.cxx:152 AliLightCascadeVertexer.cxx:153 AliLightCascadeVertexer.cxx:154 AliLightCascadeVertexer.cxx:155 AliLightCascadeVertexer.cxx:156 AliLightCascadeVertexer.cxx:157 AliLightCascadeVertexer.cxx:158 AliLightCascadeVertexer.cxx:159 AliLightCascadeVertexer.cxx:160 AliLightCascadeVertexer.cxx:161 AliLightCascadeVertexer.cxx:162 AliLightCascadeVertexer.cxx:163 AliLightCascadeVertexer.cxx:164 AliLightCascadeVertexer.cxx:165 AliLightCascadeVertexer.cxx:166 AliLightCascadeVertexer.cxx:167 AliLightCascadeVertexer.cxx:168 AliLightCascadeVertexer.cxx:169 AliLightCascadeVertexer.cxx:170 AliLightCascadeVertexer.cxx:171 AliLightCascadeVertexer.cxx:172 AliLightCascadeVertexer.cxx:173 AliLightCascadeVertexer.cxx:174 AliLightCascadeVertexer.cxx:175 AliLightCascadeVertexer.cxx:176 AliLightCascadeVertexer.cxx:177 AliLightCascadeVertexer.cxx:178 AliLightCascadeVertexer.cxx:179 AliLightCascadeVertexer.cxx:180 AliLightCascadeVertexer.cxx:181 AliLightCascadeVertexer.cxx:182 AliLightCascadeVertexer.cxx:183 AliLightCascadeVertexer.cxx:184 AliLightCascadeVertexer.cxx:185 AliLightCascadeVertexer.cxx:186 AliLightCascadeVertexer.cxx:187 AliLightCascadeVertexer.cxx:188 AliLightCascadeVertexer.cxx:189 AliLightCascadeVertexer.cxx:190 AliLightCascadeVertexer.cxx:191 AliLightCascadeVertexer.cxx:192 AliLightCascadeVertexer.cxx:193 AliLightCascadeVertexer.cxx:194 AliLightCascadeVertexer.cxx:195 AliLightCascadeVertexer.cxx:196 AliLightCascadeVertexer.cxx:197 AliLightCascadeVertexer.cxx:198 AliLightCascadeVertexer.cxx:199 AliLightCascadeVertexer.cxx:200 AliLightCascadeVertexer.cxx:201 AliLightCascadeVertexer.cxx:202 AliLightCascadeVertexer.cxx:203 AliLightCascadeVertexer.cxx:204 AliLightCascadeVertexer.cxx:205 AliLightCascadeVertexer.cxx:206 AliLightCascadeVertexer.cxx:207 AliLightCascadeVertexer.cxx:208 AliLightCascadeVertexer.cxx:209 AliLightCascadeVertexer.cxx:210 AliLightCascadeVertexer.cxx:211 AliLightCascadeVertexer.cxx:212 AliLightCascadeVertexer.cxx:213 AliLightCascadeVertexer.cxx:214 AliLightCascadeVertexer.cxx:215 AliLightCascadeVertexer.cxx:216 AliLightCascadeVertexer.cxx:217 AliLightCascadeVertexer.cxx:218 AliLightCascadeVertexer.cxx:219 AliLightCascadeVertexer.cxx:220 AliLightCascadeVertexer.cxx:221 AliLightCascadeVertexer.cxx:222 AliLightCascadeVertexer.cxx:223 AliLightCascadeVertexer.cxx:224 AliLightCascadeVertexer.cxx:225 AliLightCascadeVertexer.cxx:226 AliLightCascadeVertexer.cxx:227 AliLightCascadeVertexer.cxx:228 AliLightCascadeVertexer.cxx:229 AliLightCascadeVertexer.cxx:230 AliLightCascadeVertexer.cxx:231 AliLightCascadeVertexer.cxx:232 AliLightCascadeVertexer.cxx:233 AliLightCascadeVertexer.cxx:234 AliLightCascadeVertexer.cxx:235 AliLightCascadeVertexer.cxx:236 AliLightCascadeVertexer.cxx:237 AliLightCascadeVertexer.cxx:238 AliLightCascadeVertexer.cxx:239 AliLightCascadeVertexer.cxx:240 AliLightCascadeVertexer.cxx:241 AliLightCascadeVertexer.cxx:242 AliLightCascadeVertexer.cxx:243 AliLightCascadeVertexer.cxx:244 AliLightCascadeVertexer.cxx:245 AliLightCascadeVertexer.cxx:246 AliLightCascadeVertexer.cxx:247 AliLightCascadeVertexer.cxx:248 AliLightCascadeVertexer.cxx:249 AliLightCascadeVertexer.cxx:250 AliLightCascadeVertexer.cxx:251 AliLightCascadeVertexer.cxx:252 AliLightCascadeVertexer.cxx:253 AliLightCascadeVertexer.cxx:254 AliLightCascadeVertexer.cxx:255 AliLightCascadeVertexer.cxx:256 AliLightCascadeVertexer.cxx:257 AliLightCascadeVertexer.cxx:258 AliLightCascadeVertexer.cxx:259 AliLightCascadeVertexer.cxx:260 AliLightCascadeVertexer.cxx:261 AliLightCascadeVertexer.cxx:262 AliLightCascadeVertexer.cxx:263 AliLightCascadeVertexer.cxx:264 AliLightCascadeVertexer.cxx:265 AliLightCascadeVertexer.cxx:266 AliLightCascadeVertexer.cxx:267 AliLightCascadeVertexer.cxx:268 AliLightCascadeVertexer.cxx:269 AliLightCascadeVertexer.cxx:270 AliLightCascadeVertexer.cxx:271