1 /**************************************************************************
\r
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
\r
4 * Author: The ALICE Off-line Project. *
\r
5 * Contributors are mentioned in the code where appropriate. *
\r
7 * Permission to use, copy, modify and distribute this software and its *
\r
8 * documentation strictly for non-commercial purposes is hereby granted *
\r
9 * without fee, provided that the above copyright notice appears in all *
\r
10 * copies and that both the copyright notice and this permission notice *
\r
11 * appear in the supporting documentation. The authors make no claims *
\r
12 * about the suitability of this software for any purpose. It is *
\r
13 * provided "as is" without express or implied warranty. *
\r
14 **************************************************************************/
\r
17 * author: M.Kalisky@gsi.de
\r
20 * Description: This class allows with purely kinematical cuts
\r
21 * to select clean samples of electrons, pions and protons from the
\r
22 * V0 online finder ESD V0 candidates for PID and dectector resonse
\r
26 #include <TVector3.h>
\r
27 #include <TDatabasePDG.h>
\r
29 #include "AliESDv0.h"
\r
30 #include "AliESDtrack.h"
\r
31 #include "AliESDEvent.h"
\r
32 #include "AliVEvent.h"
\r
34 #include "AliKFParticle.h"
\r
35 #include "AliVTrack.h"
\r
36 #include "AliKFVertex.h"
\r
38 #include "AliESDv0KineCuts.h"
\r
40 ClassImp(AliESDv0KineCuts)
\r
42 //____________________________________________________________________
\r
43 AliESDv0KineCuts::AliESDv0KineCuts() :
\r
45 , fPrimaryVertex(0x0)
\r
50 , fTPCchi2perCls(4.0)
\r
54 , fGcutInvMass(0.05)
\r
59 // Default constructor
\r
62 // default single track cuts
\r
63 fTPCNcls = 1; // minimal number of the TPC clusters
\r
64 fTPCrefit = kTRUE; // TPC refit
\r
65 fTPCchi2perCls = 4.0; // chi2 per TPC cluster
\r
66 fTPCclsRatio = 0.6; // minimal foun/findable TPC cluster ratio
\r
67 fNoKinks = kTRUE; // kinks - no [kTRUE] or do not care [kFalse]
\r
70 // default gamma cuts values
\r
71 fGcutChi2NDF = 10; // Chi2NF cut value for the AliKFparticle gamma
\r
72 fGcutCosPoint[0] = 0; // cos of the pointing angle [min, max]
\r
73 fGcutCosPoint[1] = 0.02; // cos of the pointing angle [min, max]
\r
74 fGcutDCA[0] = 0.; // DCA between the daughter tracks [min, max]
\r
75 fGcutDCA[1] = 0.25; // DCA between the daughter tracks [min, max]
\r
76 fGcutVertexR[0] = 3.; // radius of the conversion point [min, max]
\r
77 fGcutVertexR[1] = 90.; // radius of the conversion point [min, max]
\r
78 fGcutPsiPair[0] = 0.; // value of the psi pair cut [min, max]
\r
79 fGcutPsiPair[1] = 0.05; // value of the psi pair cut [min, max]
\r
80 fGcutInvMass = 0.05; // upper value on the gamma invariant mass
\r
82 fK0cutChi2NDF = 10; // Chi2NF cut value for the AliKFparticle K0
\r
83 fK0cutCosPoint[0] = 0.; // cos of the pointing angle [min, max]
\r
84 fK0cutCosPoint[1] = 0.02; // cos of the pointing angle [min, max]
\r
85 fK0cutDCA[0] = 0.; // DCA between the daughter tracks [min, max]
\r
86 fK0cutDCA[1] = 0.2; // DCA between the daughter tracks [min, max]
\r
87 fK0cutVertexR[0] = 2.0; // radius of the decay point [min, max]
\r
88 fK0cutVertexR[1] = 30.0; // radius of the decay point [min, max]
\r
89 fK0cutInvMass[0] = 0.486; // invariant mass window
\r
90 fK0cutInvMass[1] = 0.508; // invariant mass window
\r
91 // Lambda & anti-Lambda cut values
\r
92 fLcutChi2NDF = 10; // Chi2NF cut value for the AliKFparticle K0
\r
93 fLcutCosPoint[0] = 0.; // cos of the pointing angle [min, max]
\r
94 fLcutCosPoint[1] = 0.02; // cos of the pointing angle [min, max]
\r
95 fLcutDCA[0] = 0.; // DCA between the daughter tracks [min, max]
\r
96 fLcutDCA[1] = 0.2; // DCA between the daughter tracks [min, max]
\r
97 fLcutVertexR[0] = 2.0; // radius of the decay point [min, max]
\r
98 fLcutVertexR[1] = 40.0; // radius of the decay point [min, max]
\r
99 fLcutInvMass[0] = 1.11; // invariant mass window
\r
100 fLcutInvMass[1] = 1.12; // invariant mass window
\r
103 //____________________________________________________________________
\r
104 AliESDv0KineCuts::~AliESDv0KineCuts(){
\r
111 //____________________________________________________________________
\r
112 AliESDv0KineCuts::AliESDv0KineCuts(const AliESDv0KineCuts &ref):
\r
115 , fPrimaryVertex(0x0)
\r
120 , fTPCchi2perCls(4.0)
\r
121 , fTPCclsRatio(0.6)
\r
124 , fGcutInvMass(0.05)
\r
125 , fK0cutChi2NDF(10)
\r
134 //____________________________________________________________________
\r
135 AliESDv0KineCuts &AliESDv0KineCuts::operator=(const AliESDv0KineCuts &ref){
\r
137 // assignment operator
\r
143 //____________________________________________________________________
\r
144 void AliESDv0KineCuts::Copy(TObject &ref) const {
\r
146 // Performs the copying of the object
\r
149 TObject::Copy(ref);
\r
151 AliESDv0KineCuts &target = dynamic_cast<AliESDv0KineCuts &>(ref);
\r
153 // default single track cuts
\r
154 target.fTPCNcls = fTPCNcls;
\r
155 target.fTPCrefit = fTPCrefit;
\r
156 target.fTPCchi2perCls = fTPCchi2perCls;
\r
157 target.fTPCclsRatio = fTPCclsRatio;
\r
158 target.fNoKinks = fNoKinks;
\r
161 // default gamma cuts values
\r
162 target.fGcutChi2NDF = fGcutChi2NDF;
\r
163 memcpy(target.fGcutCosPoint, fGcutCosPoint, sizeof(Float_t) * 2);
\r
164 memcpy(target.fGcutDCA, fGcutDCA, sizeof(Float_t) * 2);
\r
165 memcpy(target.fGcutVertexR, fGcutVertexR, sizeof(Float_t) * 2);
\r
166 memcpy(target.fGcutPsiPair, fGcutPsiPair, sizeof(Float_t) * 2);
\r
167 target.fGcutInvMass = fGcutInvMass;
\r
169 target.fK0cutChi2NDF = fK0cutChi2NDF;
\r
170 memcpy(target.fK0cutCosPoint, fK0cutCosPoint, sizeof(Float_t) * 2);
\r
171 memcpy(target.fK0cutDCA, fK0cutDCA, sizeof(Float_t) * 2);
\r
172 memcpy(target.fK0cutVertexR, fK0cutVertexR, sizeof(Float_t) * 2);
\r
173 memcpy(target.fK0cutInvMass, fK0cutInvMass, sizeof(Float_t) * 2);
\r
174 // Lambda & anti-Lambda cut values
\r
175 target.fLcutChi2NDF = fLcutChi2NDF;
\r
176 memcpy(target.fLcutCosPoint, fLcutCosPoint, sizeof(Float_t) * 2);
\r
177 memcpy(target.fLcutDCA, fLcutDCA, sizeof(Float_t) * 2);
\r
178 memcpy(target.fLcutVertexR, fLcutVertexR, sizeof(Float_t) * 2);
\r
179 memcpy(target.fLcutInvMass, fLcutInvMass, sizeof(Float_t) * 2);
\r
182 //____________________________________________________________________
\r
183 Bool_t AliESDv0KineCuts::ProcessV0(AliESDv0* const v0, Int_t &pdgV0, Int_t &pdgP, Int_t &pdgN){
\r
185 // main user function
\r
188 if(!v0) return kFALSE;
\r
190 AliErrorClass("No valid Event pointer available, provide it first");
\r
194 if(!V0CutsCommon(v0)) return kFALSE;
\r
196 const Int_t id = PreselectV0(v0);
\r
198 if(!SingleTrackCuts(v0)) return kFALSE;
\r
204 return CaseGamma(v0, pdgV0, pdgP, pdgN);
\r
206 return CaseK0(v0, pdgV0, pdgP, pdgN);
\r
208 return CaseLambda(v0, pdgV0, pdgP, pdgN, 0);
\r
210 return CaseLambda(v0, pdgV0, pdgP, pdgN, 1);
\r
217 //____________________________________________________________________
\r
218 Bool_t AliESDv0KineCuts::ProcessV0(AliESDv0* const v0, Int_t &pdgP, Int_t &pdgN){
\r
220 // main user function, simplified if the V0 identity is not necessary
\r
223 if(!v0) return kFALSE;
\r
225 AliErrorClass("No valid Event pointer available, provide it first");
\r
230 return ProcessV0(v0, idV0, pdgP, pdgN);
\r
233 //____________________________________________________________________
\r
234 Int_t AliESDv0KineCuts::PreselectV0(AliESDv0* const v0){
\r
236 // Make a preselection (exclusive) of the V0 cadidates based on
\r
238 // the armenteros cut values are currently fixed and user is not able to set them via
\r
239 // set funcions. The reason is that these cuts are optimized and furneter changes should
\r
240 // not be necessary. To prove otherwise please study in detail before changing the values
\r
243 Float_t ap[2] = {-1., -1.};
\r
244 Armenteros(v0, ap);
\r
246 const Float_t alpha = ap[0];
\r
247 const Float_t qt = ap[1];
\r
250 // - the reagions for different candidates must not overlap
\r
253 const Double_t cutAlphaG = 0.35;
\r
254 const Double_t cutQTG = 0.05;
\r
255 const Double_t cutAlphaG2[2] = {0.6, 0.8};
\r
256 const Double_t cutQTG2 = 0.04;
\r
259 const Float_t cutQTK0[2] = {0.1075, 0.215};
\r
260 const Float_t cutAPK0[2] = {0.199, 0.8}; // parameters for curved QT cut
\r
262 // Lambda & A-Lambda cuts
\r
263 const Float_t cutQTL = 0.03;
\r
264 const Float_t cutAlphaL[2] = {0.35, 0.7};
\r
265 const Float_t cutAlphaAL[2] = {-0.7, -0.35};
\r
266 const Float_t cutAPL[3] = {0.107, -0.69, 0.5}; // parameters fir curved QT cut
\r
269 if(kPurity == fMode){
\r
270 // Check for Gamma candidates
\r
272 if( (TMath::Abs(alpha) < cutAlphaG) ) return kGamma;
\r
274 // additional region - should help high pT gammas
\r
276 if( (TMath::Abs(alpha) > cutAlphaG2[0]) && (TMath::Abs(alpha) < cutAlphaG2[1]) ) return kGamma;
\r
279 if(kEffGamma == fMode){
\r
280 if(qt < cutQTG) return kGamma;
\r
284 // Check for K0 candidates
\r
285 Float_t q = cutAPK0[0] * TMath::Sqrt(TMath::Abs(1 - alpha*alpha/(cutAPK0[1]*cutAPK0[1])));
\r
286 if( (qt > cutQTK0[0]) && (qt < cutQTK0[1]) && (qt > q) ){
\r
290 // Check for Lambda candidates
\r
291 q = cutAPL[0] * TMath::Sqrt(TMath::Abs(1 - ( (alpha + cutAPL[1]) * (alpha + cutAPL[1]) ) / (cutAPL[2]*cutAPL[2]) ));
\r
292 if( (alpha > cutAlphaL[0]) && (alpha < cutAlphaL[1]) && (qt > cutQTL) && (qt < q) ){
\r
296 // Check for A-Lambda candidates
\r
297 q = cutAPL[0] * TMath::Sqrt(TMath::Abs(1 - ( (alpha - cutAPL[1]) * (alpha - cutAPL[1]) ) / (cutAPL[2]*cutAPL[2]) ));
\r
298 if( (alpha > cutAlphaAL[0]) && (alpha < cutAlphaAL[1]) && (qt > cutQTL) && (qt < q) ){
\r
304 //____________________________________________________________________
\r
305 Bool_t AliESDv0KineCuts::SingleTrackCuts(AliESDv0 * const v0){
\r
307 // apply single track cuts
\r
308 // correct sign not relevat here
\r
311 if(!v0) return kFALSE;
\r
313 Int_t pIndex = 0, nIndex = 0;
\r
314 pIndex = v0->GetPindex();
\r
315 nIndex = v0->GetNindex();
\r
317 d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));
\r
318 d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));
\r
320 for(Int_t i=0; i<2; ++i){
\r
321 if(!d[i]) return kFALSE;
\r
324 ULong_t status = d[i]->GetStatus();
\r
326 // No. of TPC clusters leave to the users
\r
327 if(d[i]->GetTPCNcls() < 1) return kFALSE;
\r
330 if(!(status & AliESDtrack::kTPCrefit)) return kFALSE;
\r
332 // Chi2 per TPC cluster
\r
333 Int_t nTPCclusters = d[i]->GetTPCNcls();
\r
334 Float_t chi2perTPCcluster = d[i]->GetTPCchi2()/Float_t(nTPCclusters);
\r
335 if(chi2perTPCcluster > 4) return kFALSE;
\r
337 // TPC cluster ratio
\r
338 Float_t cRatioTPC = d[i]->GetTPCNclsF() > 0. ? static_cast<Float_t>(d[i]->GetTPCNcls())/static_cast<Float_t> (d[i]->GetTPCNclsF()) : 1.;
\r
339 if(cRatioTPC < 0.6) return kFALSE;
\r
342 if(d[i]->GetKinkIndex(0) != 0) return kFALSE;
\r
348 //____________________________________________________________________
\r
349 Bool_t AliESDv0KineCuts::CaseGamma(AliESDv0* const v0, Int_t &pdgV0, Int_t &pdgP, Int_t &pdgN){
\r
351 // process the gamma conversion candidate
\r
354 if(!v0) return kFALSE;
\r
356 AliVTrack* daughter[2];
\r
357 Int_t pIndex = 0, nIndex = 0;
\r
359 Bool_t sign = CheckSigns(v0);
\r
361 pIndex = v0->GetPindex();
\r
362 nIndex = v0->GetNindex();
\r
365 pIndex = v0->GetNindex();
\r
366 nIndex = v0->GetPindex();
\r
368 daughter[0] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(pIndex));
\r
369 daughter[1] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(nIndex));
\r
370 if(!daughter[0] || !daughter[1]) return kFALSE;
\r
372 AliKFParticle *kfMother = CreateMotherParticle(daughter[0], daughter[1], TMath::Abs(kElectron), TMath::Abs(kElectron));
\r
373 if(!kfMother) return kFALSE;
\r
376 d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));
\r
377 d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));
\r
379 Float_t iMass = v0->GetEffMass(0, 0);
\r
381 // cos pointing angle
\r
382 Double_t cosPoint = v0->GetV0CosineOfPointingAngle();
\r
383 cosPoint = TMath::ACos(cosPoint);
\r
385 // DCA between daughters
\r
386 Double_t dca = v0->GetDcaV0Daughters();
\r
388 // Production vertex
\r
391 Double_t r = TMath::Sqrt(x*x + y*y);
\r
395 if ( GetConvPosXY(d[0], d[1], xy) ){
\r
396 r2 = TMath::Sqrt(xy[0]*xy[0] + xy[1]*xy[1]);
\r
400 Double_t psiPair = PsiPair(v0);
\r
403 Double_t chi2ndf = kfMother->GetChi2()/kfMother->GetNDF();
\r
405 if(kfMother) delete kfMother;
\r
409 if(iMass > fGcutInvMass) return kFALSE;
\r
411 if(chi2ndf > fGcutChi2NDF) return kFALSE;
\r
413 if(cosPoint < fGcutCosPoint[0] || cosPoint > fGcutCosPoint[1]) return kFALSE;
\r
415 if(dca < fGcutDCA[0] || dca > fGcutDCA[1]) return kFALSE;
\r
417 if(r < fGcutVertexR[0] || r > fGcutVertexR[1]) return kFALSE;
\r
419 if(psiPair < fGcutPsiPair[0] || psiPair > fGcutPsiPair[1]) return kFALSE;
\r
435 //____________________________________________________________________
\r
436 Bool_t AliESDv0KineCuts::CaseK0(AliESDv0* const v0, Int_t &pdgV0, Int_t &pdgP, Int_t &pdgN){
\r
438 // process the K0 candidate
\r
441 if(!v0) return kFALSE;
\r
443 AliVTrack* daughter[2];
\r
444 Int_t pIndex = 0, nIndex = 0;
\r
445 Bool_t sign = CheckSigns(v0);
\r
447 pIndex = v0->GetPindex();
\r
448 nIndex = v0->GetNindex();
\r
451 pIndex = v0->GetNindex();
\r
452 nIndex = v0->GetPindex();
\r
455 daughter[0] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(pIndex));
\r
456 daughter[1] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(nIndex));
\r
457 if(!daughter[0] || !daughter[1]) return kFALSE;
\r
459 AliKFParticle *kfMother = CreateMotherParticle(daughter[0], daughter[1], TMath::Abs(kPiPlus), TMath::Abs(kPiPlus));
\r
460 if(!kfMother) return kFALSE;
\r
463 d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));
\r
464 d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));
\r
466 Float_t iMass = v0->GetEffMass(2, 2);
\r
468 // cos pointing angle
\r
469 Double_t cosPoint = v0->GetV0CosineOfPointingAngle();
\r
470 cosPoint = TMath::ACos(cosPoint);
\r
472 // DCA between daughters
\r
473 Double_t dca = v0->GetDcaV0Daughters();
\r
475 // Production vertex
\r
479 Double_t r = TMath::Sqrt(x*x + y*y);
\r
482 Double_t chi2ndf = kfMother->GetChi2()/kfMother->GetNDF();
\r
484 if(kfMother) delete kfMother;
\r
489 if(iMass < fK0cutInvMass[0] || iMass > fK0cutInvMass[1]) return kFALSE;
\r
491 if(chi2ndf > fK0cutChi2NDF) return kFALSE;
\r
493 if(cosPoint < fK0cutCosPoint[0] || cosPoint > fK0cutCosPoint[1]) return kFALSE;
\r
495 if(dca < fK0cutDCA[0] || dca > fK0cutDCA[1]) return kFALSE;
\r
497 if(r < fK0cutVertexR[0] || r > fK0cutVertexR[1]) return kFALSE;
\r
512 //____________________________________________________________________
\r
513 Bool_t AliESDv0KineCuts::CaseLambda(AliESDv0* const v0, Int_t &pdgV0, Int_t &pdgP, Int_t &pdgN, Int_t id){
\r
515 // process teh Lambda and Anti-Lambda candidate
\r
518 if(!v0) return kFALSE;
\r
520 const Double_t cL0mass=TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass(); // PDG lambda mass
\r
522 AliVTrack* daughter[2];
\r
523 Int_t pIndex = 0, nIndex = 0;
\r
524 Float_t mMass[2] = {-1., -1.};
\r
525 Bool_t sign = CheckSigns(v0);
\r
527 pIndex = v0->GetPindex();
\r
528 nIndex = v0->GetNindex();
\r
529 mMass[0] = v0->GetEffMass(4, 2);
\r
530 mMass[1] = v0->GetEffMass(2, 4);
\r
533 pIndex = v0->GetNindex();
\r
534 nIndex = v0->GetPindex();
\r
535 mMass[0] = v0->GetEffMass(2, 4);
\r
536 mMass[1] = v0->GetEffMass(4, 2);
\r
539 daughter[0] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(pIndex));
\r
540 daughter[1] = dynamic_cast<AliVTrack *>(fEvent->GetTrack(nIndex));
\r
541 if(!daughter[0] || !daughter[1]) return kFALSE;
\r
543 AliKFParticle *kfMother[2] = {0x0, 0x0};
\r
545 kfMother[0] = CreateMotherParticle(daughter[0], daughter[1], TMath::Abs(kProton), TMath::Abs(kPiPlus));
\r
546 if(!kfMother[0]) return kFALSE;
\r
549 kfMother[1] = CreateMotherParticle(daughter[0], daughter[1], TMath::Abs(kPiPlus), TMath::Abs(kProton));
\r
550 if(!kfMother[1]) return kFALSE;
\r
552 Float_t dMass[2] = {TMath::Abs(mMass[0] - cL0mass), TMath::Abs(mMass[1] - cL0mass)};
\r
555 d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));
\r
556 d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));
\r
557 if(!d[0] || !d[1]) return kFALSE;
\r
559 Float_t p[2] = {d[0]->GetP(), d[1]->GetP()};
\r
561 // check the 3 lambda - antilambda variables
\r
562 Int_t check[2] = {-1, -1}; // 0 : lambda, 1 : antilambda
\r
563 // 1) momentum of the daughter particles - proton is expected to have higher momentum than pion
\r
564 check[0] = (p[0] > p[1]) ? 0 : 1;
\r
565 // 2) mass of the mother particle
\r
566 check[1] = (dMass[0] < dMass[1]) ? 0 : 1;
\r
568 // require positive correlation of (1) and (2)
\r
569 if(check[0] != check[1]){
\r
570 if(kfMother[0]) delete kfMother[0];
\r
571 if(kfMother[1]) delete kfMother[1];
\r
575 // now that the check[0] == check[1]
\r
576 const Int_t type = check[0];
\r
578 // require that the input armenteros preselection agree:
\r
579 if(type != id) return kFALSE;
\r
583 iMass = (type == 0) ? v0->GetEffMass(4, 2) : v0->GetEffMass(2, 4);
\r
586 iMass = (type == 0) ? v0->GetEffMass(2, 4) : v0->GetEffMass(4, 2);
\r
589 // cos pointing angle
\r
590 Double_t cosPoint = v0->GetV0CosineOfPointingAngle();
\r
591 cosPoint = TMath::ACos(cosPoint);
\r
593 // DCA between daughters
\r
594 Double_t dca = v0->GetDcaV0Daughters();
\r
596 // Production vertex
\r
599 Double_t r = TMath::Sqrt(x*x + y*y);
\r
601 // proton - pion indices
\r
602 Int_t ix[2] = {0, 1};
\r
609 Double_t chi2ndf = kfMother[type]->GetChi2()/kfMother[type]->GetNDF();
\r
611 if(kfMother[0]) delete kfMother[0];
\r
612 if(kfMother[1]) delete kfMother[1];
\r
618 if(iMass < fLcutInvMass[0] || iMass > fLcutInvMass[1]) return kFALSE;
\r
620 if(chi2ndf > fLcutChi2NDF) return kFALSE;
\r
622 if(cosPoint < fLcutCosPoint[0] || cosPoint > fLcutCosPoint[1]) return kFALSE;
\r
624 if(dca < fLcutDCA[0] || dca > fLcutDCA[1]) return kFALSE;
\r
626 if(r < fLcutVertexR[0] || r > fLcutVertexR[1]) return kFALSE;
\r
655 //____________________________________________________________________
\r
656 Bool_t AliESDv0KineCuts::V0CutsCommon(AliESDv0 * const v0){
\r
658 // V0 cuts common to all V0s
\r
661 AliESDtrack* dN, *dP;
\r
663 dP = dynamic_cast<AliESDtrack *>(fEvent->GetTrack(v0->GetPindex()));
\r
664 dN = dynamic_cast<AliESDtrack *>(fEvent->GetTrack(v0->GetNindex()));
\r
666 if(!dN || !dP) return kFALSE;
\r
668 Int_t qP = dP->Charge();
\r
669 Int_t qN = dN->Charge();
\r
671 if((qP*qN) != -1) return kFALSE;
\r
675 //____________________________________________________________________
\r
676 void AliESDv0KineCuts::Armenteros(AliESDv0* const v0, Float_t val[2]){
\r
678 // computes the Armenteros variables for given V0
\r
679 // fills the histogram
\r
680 // returns the values via "val"
\r
683 Double_t mn[3] = {0,0,0};
\r
684 Double_t mp[3] = {0,0,0};
\r
685 Double_t mm[3] = {0,0,0};
\r
687 if(CheckSigns(v0)){
\r
688 v0->GetNPxPyPz(mn[0],mn[1],mn[2]); //reconstructed cartesian momentum components of negative daughter
\r
689 v0->GetPPxPyPz(mp[0],mp[1],mp[2]); //reconstructed cartesian momentum components of positive daughter
\r
692 v0->GetPPxPyPz(mn[0],mn[1],mn[2]); //reconstructed cartesian momentum components of negative daughter
\r
693 v0->GetNPxPyPz(mp[0],mp[1],mp[2]); //reconstructed cartesian momentum components of positive daughter
\r
695 v0->GetPxPyPz(mm[0],mm[1],mm[2]); //reconstructed cartesian momentum components of mother
\r
697 TVector3 vecN(mn[0],mn[1],mn[2]);
\r
698 TVector3 vecP(mp[0],mp[1],mp[2]);
\r
699 TVector3 vecM(mm[0],mm[1],mm[2]);
\r
701 Double_t thetaP = acos((vecP * vecM)/(vecP.Mag() * vecM.Mag()));
\r
702 Double_t thetaN = acos((vecN * vecM)/(vecN.Mag() * vecM.Mag()));
\r
704 Double_t alfa = ((vecP.Mag())*cos(thetaP)-(vecN.Mag())*cos(thetaN))/
\r
705 ((vecP.Mag())*cos(thetaP)+(vecN.Mag())*cos(thetaN)) ;
\r
706 Double_t qt = vecP.Mag()*sin(thetaP);
\r
711 //____________________________________________________________________
\r
712 Bool_t AliESDv0KineCuts::CheckSigns(AliESDv0* const v0){
\r
714 // check wheter the sign was correctly applied to
\r
715 // V0 daughter tracks
\r
718 Bool_t correct = kFALSE;
\r
720 Int_t pIndex = 0, nIndex = 0;
\r
721 pIndex = v0->GetPindex();
\r
722 nIndex = v0->GetNindex();
\r
725 d[0] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(pIndex));
\r
726 d[1] = dynamic_cast<AliESDtrack*>(fEvent->GetTrack(nIndex));
\r
729 sign[0] = (int)d[0]->GetSign();
\r
730 sign[1] = (int)d[1]->GetSign();
\r
732 if(-1 == sign[0] && 1 == sign[1]){
\r
741 //________________________________________________________________
\r
742 Double_t AliESDv0KineCuts::PsiPair(AliESDv0* const v0) {
\r
744 // Angle between daughter momentum plane and plane
\r
747 if(!fEvent) return -1.;
\r
749 Float_t magField = fEvent->GetMagneticField();
\r
753 if(CheckSigns(v0)){
\r
754 pIndex = v0->GetPindex();
\r
755 nIndex = v0->GetNindex();
\r
758 pIndex = v0->GetNindex();
\r
759 nIndex = v0->GetPindex();
\r
763 AliESDtrack* daughter[2];
\r
765 daughter[0] = dynamic_cast<AliESDtrack *>(fEvent->GetTrack(pIndex));
\r
766 daughter[1] = dynamic_cast<AliESDtrack *>(fEvent->GetTrack(nIndex));
\r
769 v0->GetXYZ(x,y,z);//Reconstructed coordinates of V0; to be replaced by Markus Rammler's method in case of conversions!
\r
771 Double_t mn[3] = {0,0,0};
\r
772 Double_t mp[3] = {0,0,0};
\r
775 v0->GetNPxPyPz(mn[0],mn[1],mn[2]);//reconstructed cartesian momentum components of negative daughter;
\r
776 v0->GetPPxPyPz(mp[0],mp[1],mp[2]);//reconstructed cartesian momentum components of positive daughter;
\r
779 Double_t deltat = 1.;
\r
780 deltat = TMath::ATan(mp[2]/(TMath::Sqrt(mp[0]*mp[0] + mp[1]*mp[1])+1.e-13)) - TMath::ATan(mn[2]/(TMath::Sqrt(mn[0]*mn[0] + mn[1]*mn[1])+1.e-13));//difference of angles of the two daughter tracks with z-axis
\r
782 Double_t radiussum = TMath::Sqrt(x*x + y*y) + 50;//radius to which tracks shall be propagated
\r
784 Double_t momPosProp[3];
\r
785 Double_t momNegProp[3];
\r
787 AliExternalTrackParam pt(*daughter[0]), nt(*daughter[1]);
\r
789 Double_t psiPair = 4.;
\r
791 if(nt.PropagateTo(radiussum,magField) == 0)//propagate tracks to the outside
\r
793 if(pt.PropagateTo(radiussum,magField) == 0)
\r
795 pt.GetPxPyPz(momPosProp);//Get momentum vectors of tracks after propagation
\r
796 nt.GetPxPyPz(momNegProp);
\r
799 TMath::Sqrt(momNegProp[0]*momNegProp[0]+momNegProp[1]*momNegProp[1]+momNegProp[2]*momNegProp[2]);//absolute momentum value of negative daughter
\r
801 TMath::Sqrt(momPosProp[0]*momPosProp[0]+momPosProp[1]*momPosProp[1]+momPosProp[2]*momPosProp[2]);//absolute momentum value of positive daughter
\r
803 Double_t scalarproduct =
\r
804 momPosProp[0]*momNegProp[0]+momPosProp[1]*momNegProp[1]+momPosProp[2]*momNegProp[2];//scalar product of propagated positive and negative daughters' momenta
\r
806 Double_t chipair = TMath::ACos(scalarproduct/(pEle*pPos));//Angle between propagated daughter tracks
\r
808 psiPair = TMath::Abs(TMath::ASin(deltat/chipair));
\r
812 //___________________________________________________________________
\r
813 Bool_t AliESDv0KineCuts::GetConvPosXY(AliESDtrack * const ptrack, AliESDtrack * const ntrack, Double_t convpos[2]){
\r
815 // recalculate the gamma conversion XY postition
\r
818 const Double_t b = fEvent->GetMagneticField();
\r
820 Double_t helixcenterpos[2];
\r
821 GetHelixCenter(ptrack,b,ptrack->Charge(),helixcenterpos);
\r
823 Double_t helixcenterneg[2];
\r
824 GetHelixCenter(ntrack,b,ntrack->Charge(),helixcenterneg);
\r
826 Double_t poshelix[6];
\r
827 ptrack->GetHelixParameters(poshelix,b);
\r
828 Double_t posradius = TMath::Abs(1./poshelix[4]);
\r
830 Double_t neghelix[6];
\r
831 ntrack->GetHelixParameters(neghelix,b);
\r
832 Double_t negradius = TMath::Abs(1./neghelix[4]);
\r
834 Double_t xpos = helixcenterpos[0];
\r
835 Double_t ypos = helixcenterpos[1];
\r
836 Double_t xneg = helixcenterneg[0];
\r
837 Double_t yneg = helixcenterneg[1];
\r
839 convpos[0] = (xpos*negradius + xneg*posradius)/(negradius+posradius);
\r
840 convpos[1] = (ypos*negradius+ yneg*posradius)/(negradius+posradius);
\r
844 //___________________________________________________________________
\r
845 Bool_t AliESDv0KineCuts::GetHelixCenter(AliESDtrack * const track, Double_t b,Int_t charge, Double_t center[2]){
\r
847 // computes the center of the track helix
\r
850 Double_t pi = TMath::Pi();
\r
853 track->GetHelixParameters(helix,b);
\r
855 Double_t xpos = helix[5];
\r
856 Double_t ypos = helix[0];
\r
857 Double_t radius = TMath::Abs(1./helix[4]);
\r
858 Double_t phi = helix[2];
\r
865 Double_t xpoint = radius * TMath::Cos(phi);
\r
866 Double_t ypoint = radius * TMath::Sin(phi);
\r
890 center[0] = xpos + xpoint;
\r
891 center[1] = ypos + ypoint;
\r
895 //___________________________________________________________________
\r
896 AliKFParticle *AliESDv0KineCuts::CreateMotherParticle(const AliVTrack* const pdaughter, const AliVTrack* const ndaughter, Int_t pspec, Int_t nspec){
\r
898 // Creates a mother particle
\r
900 AliKFParticle pkfdaughter(*pdaughter, pspec);
\r
901 AliKFParticle nkfdaughter(*ndaughter, nspec);
\r
904 // Create the mother particle
\r
905 AliKFParticle *m = new AliKFParticle(pkfdaughter, nkfdaughter);
\r
907 if(TMath::Abs(kElectron) == pspec && TMath::Abs(kElectron) == nspec) m->SetMassConstraint(0, 0.001);
\r
908 else if(TMath::Abs(kPiPlus) == pspec && TMath::Abs(kPiPlus) == nspec) m->SetMassConstraint(TDatabasePDG::Instance()->GetParticle(kK0Short)->Mass(), 0.);
\r
909 else if(TMath::Abs(kProton) == pspec && TMath::Abs(kPiPlus) == nspec) m->SetMassConstraint(TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass(), 0.);
\r
910 else if(TMath::Abs(kPiPlus) == pspec && TMath::Abs(kProton) == nspec) m->SetMassConstraint(TDatabasePDG::Instance()->GetParticle(kLambda0)->Mass(), 0.);
\r
912 AliErrorClass("Wrong daughter ID - mass constraint can not be set");
\r
915 AliKFVertex improvedVertex = *fPrimaryVertex;
\r
916 improvedVertex += *m;
\r
917 m->SetProductionVertex(improvedVertex);
\r
919 // update 15/06/2010
\r
920 // mother particle will not be added to primary vertex but only to its copy
\r
921 // as this confilcts with calling
\r
922 // m->SetPrimaryVertex() function and
\r
923 // subsequently removing the mother particle afterwards
\r
924 // Source: Sergey Gorbunov
\r
928 //____________________________________________________________________
\r
929 void AliESDv0KineCuts::SetEvent(AliESDEvent* const event){
\r
931 // direct setter of ESD event
\r
935 AliErrorClass("Invalid input event pointer");
\r
940 //____________________________________________________________________
\r
941 void AliESDv0KineCuts::SetEvent(AliVEvent* const event){
\r
943 // direct setter of ESD event
\r
946 fEvent = static_cast<AliESDEvent*>(event);
\r
948 AliErrorClass("Invalid input event pointer");
\r
953 //________________________________________________________________
\r
954 void AliESDv0KineCuts::SetPrimaryVertex(AliKFVertex* const v){
\r
956 // set the primary vertex of the event
\r
958 fPrimaryVertex = v;
\r
959 if(!fPrimaryVertex){
\r
960 AliErrorClass("Failed to initialize the primary vertex");
\r
964 //___________________________________________________________________
\r
965 void AliESDv0KineCuts::SetMode(Int_t mode, Int_t type){
\r
967 // this function allows the user to select (prior running the 'ProcessV0' function)
\r
968 // to select different approaches to V0 selection - the 'mode'
\r
970 // different systems (pp, PbPb) - 'type'
\r
972 // To see the cut values for different modes please refer to the
\r
973 // function SetCuts()
\r
975 // Important notice: based on the parameters particular sets of cuts will
\r
976 // be activated for teh V0 selection. If some additional changes to single
\r
977 // cuts are needed please us the SetXXXcut function (see the header file)
\r
982 fMode = kPurity; // used to obtain highest purity possible - the efficiency may be low
\r
984 fMode = kEffGamma; // used to obtain highes efficiency possible - the purity may be worse
\r
986 AliError("V0 selection mode not recognozed, setting 'kPurity'");
\r
992 fType = kPP; // cuts optimized for low multiplicity
\r
994 fType = kPbPb; // cuts optimized for high multiplicity
\r
997 // setup the cut values for selected mode & type
\r
1001 //___________________________________________________________________
\r
1002 void AliESDv0KineCuts::SetMode(Int_t mode, const char* type){
\r
1004 // overloaded function - please see above
\r
1009 if(!strcmp("pp", type)) t = kPP;
\r
1010 else if(!(strcmp("PbPb", type))) t = kPbPb;
\r
1012 AliError("data type not recognized, setting 'pp'");
\r
1019 //___________________________________________________________________
\r
1020 void AliESDv0KineCuts::SetCuts(){
\r
1022 // this funciton sets the default cut values based on the selected
\r
1023 // fMode and fType.
\r
1024 // please note that only the cuts that have different values than the default
\r
1025 // cuts are updated here
\r
1028 // last update: 14/02/2011
\r
1029 // as a very preliminary - the only change to default cuts is to apply
\r
1030 // less restricting gamma conversion selection in PreselectV0() function
\r