]>
Commit | Line | Data |
---|---|---|
621688e4 | 1 | /************************************************************************* |
2 | * Copyright(c) 1998-2048, ALICE Experiment at CERN, All rights reserved. * | |
3 | * * | |
4 | * Author: The ALICE Off-line Project. * | |
5 | * Contributors are mentioned in the code where appropriate. * | |
6 | * * | |
7 | * Permission to use, copy, modify and distribute this software and its * | |
8 | * documentation strictly for non-commercial purposes is hereby granted * | |
9 | * without fee, provided that the above copyright notice appears in all * | |
10 | * copies and that both the copyright notice and this permission notice * | |
11 | * appear in the supporting documentation. The authors make no claims * | |
12 | * about the suitability of this software for any purpose. It is * | |
13 | * provided "as is" without express or implied warranty. * | |
14 | **************************************************************************/ | |
15 | ||
16 | // Author: Dariusz Miskowiec <mailto:d.miskowiec@gsi.de> 2008 | |
17 | ||
18 | //============================================================================= | |
19 | // AliUnicorEvent-AliESD interface // | |
20 | //============================================================================= | |
21 | ||
22 | #include <cmath> | |
23 | #include "AliESDEvent.h" | |
24 | #include "AliUnicorEventAliceESD.h" | |
25 | ||
26 | ClassImp(AliUnicorEventAliceESD) | |
27 | ||
28 | //============================================================================= | |
29 | AliUnicorEventAliceESD::AliUnicorEventAliceESD(AliESDEvent *esd) : AliUnicorEvent(), fESD(esd) | |
30 | { | |
31 | // constructor | |
32 | ||
33 | // printf("%s object created\n",ClassName()); | |
34 | if (!fESD) fESD = new AliESDEvent(); | |
35 | } | |
36 | //============================================================================= | |
37 | AliUnicorEventAliceESD::~AliUnicorEventAliceESD() | |
38 | { | |
39 | // destructor | |
40 | ||
41 | } | |
42 | //============================================================================= | |
43 | Bool_t AliUnicorEventAliceESD::Good() const | |
44 | { | |
45 | // event cuts | |
46 | ||
47 | if (fabs(Zver())>1) return kFALSE; | |
040da09c | 48 | if (fESD->GetPrimaryVertexTPC()->GetZRes()>1.5) return kFALSE; |
621688e4 | 49 | return kTRUE; |
50 | } | |
51 | //============================================================================= | |
52 | Bool_t AliUnicorEventAliceESD::ParticleGood(Int_t i, Int_t pidi) const | |
53 | { | |
54 | // track cuts and particle id cuts; pidi=0 means take all species | |
55 | // consider using the standard ESDcut | |
56 | ||
57 | // track quality cuts | |
58 | ||
59 | AliESDtrack *track = fESD->GetTrack(i); | |
60 | if (!track->IsOn(AliESDtrack::kTPCrefit)) return 0; // TPC refit | |
c6fc7f72 | 61 | if (track->GetTPCNcls() < 100) return 0; // number of TPC clusters |
621688e4 | 62 | const AliExternalTrackParam *tp = track->GetTPCInnerParam(); |
63 | if (!tp) return 0; | |
64 | ||
65 | Float_t r,z; | |
040da09c | 66 | track->GetImpactParametersTPC(r,z); |
67 | if (fabs(z)>1) return 0; // impact parameter in z | |
68 | if (fabs(r)>1) return 0; // impact parameter in xy | |
69 | ||
70 | //TBits shared = track->GetTPCSharedMap(); | |
71 | //if (shared.CountBits()) return 0; // no shared clusters; pragmatic but dangerous | |
621688e4 | 72 | |
73 | // pid | |
74 | ||
75 | if (pidi==0) return 1; | |
040da09c | 76 | |
621688e4 | 77 | if (!track->IsOn(AliESDtrack::kTPCpid)) return 0; |
78 | Double_t p[AliPID::kSPECIES]; | |
79 | track->GetTPCpid(p); | |
80 | Int_t q = tp->Charge(); | |
040da09c | 81 | |
621688e4 | 82 | if (pidi == -211) return p[AliPID::kPion]+p[AliPID::kMuon]>0.5 && q==-1; |
83 | else if (pidi == 211) return p[AliPID::kPion]+p[AliPID::kMuon]>0.5 && q==1; | |
040da09c | 84 | //if (pidi == -211) return ParticleDedx(i)<1.2 && ParticleP(i)<0.75 && q==-1; |
85 | //else if (pidi == 211) return ParticleDedx(i)<1.2 && ParticleP(i)<0.75 && q==1; | |
86 | else if (pidi == -321) return p[AliPID::kKaon]>0.5 && q==-1; | |
87 | else if (pidi == 321) return p[AliPID::kKaon]>0.5 && q==1; | |
88 | else if (pidi == -2212) return p[AliPID::kProton]>0.5 && q==-1; | |
89 | else if (pidi == 2212) return p[AliPID::kProton]>0.5 && q==1; | |
621688e4 | 90 | else return 0; |
91 | } | |
92 | //============================================================================= | |
93 | Bool_t AliUnicorEventAliceESD::PairGood(Double_t /*p0*/, Double_t the0, Double_t phi0, | |
94 | Double_t /*p1*/, Double_t the1, Double_t phi1) const { | |
95 | ||
96 | // two-track separation cut | |
97 | ||
c6fc7f72 | 98 | double dthe = the1-the0; |
99 | double dphi = TVector2::Phi_mpi_pi(phi1-phi0); | |
040da09c | 100 | // double dpt = p1*sin(the1) - p0*sin(the0); |
101 | // return (fabs(dthe)>0.005 || fabs(dphi)>0.030); | |
102 | return (fabs(dthe)>0.010 || fabs(dphi)>0.060); | |
103 | //return (dpt*dphi<0); | |
621688e4 | 104 | } |
105 | //============================================================================= |