]>
Commit | Line | Data |
---|---|---|
7148817a | 1 | // Author: Dariusz Miskowiec <mailto:d.miskowiec@gsi.de> 2008 |
2 | ||
3 | //============================================================================= | |
4 | // AliDEvent-AliESD interface // | |
5 | //============================================================================= | |
6 | ||
5a6d201c | 7 | #include <cmath> |
7148817a | 8 | #include "AliESDEvent.h" |
9 | #include "AliDEventAliceESD.h" | |
10 | ||
11 | ClassImp(AliDEventAliceESD) | |
12 | ||
13 | //============================================================================= | |
14 | AliDEventAliceESD::AliDEventAliceESD() : AliDEvent(), AliESDEvent() | |
15 | { | |
16 | // constructor | |
17 | ||
18 | printf("%s object created\n",AliDEvent::ClassName()); | |
19 | } | |
20 | //============================================================================= | |
21 | AliDEventAliceESD::~AliDEventAliceESD() | |
22 | { | |
23 | // destructor | |
24 | ||
25 | } | |
26 | //============================================================================= | |
27 | Bool_t AliDEventAliceESD::Good() const | |
28 | { | |
29 | // event cuts | |
30 | ||
5a6d201c | 31 | if (fabs(Zver())>1) return kFALSE; |
7148817a | 32 | if (AliESDEvent::GetPrimaryVertex()->GetZRes()>0.1) return kFALSE; |
33 | return kTRUE; | |
34 | } | |
35 | //============================================================================= | |
36 | Bool_t AliDEventAliceESD::ParticleGood(Int_t i, Int_t pidi) const | |
37 | { | |
38 | // track cuts and particle id cuts; pidi=0 means take all tracks | |
39 | // consider using the standard ESDcut | |
40 | ||
41 | // track quality cuts | |
42 | ||
43 | AliESDtrack *track = AliESDEvent::GetTrack(i); | |
44 | if (!track->IsOn(AliESDtrack::kTPCrefit)) return 0; // TPC refit | |
45 | if (track->GetTPCNcls() < 120) return 0; // number of TPC clusters | |
46 | const AliExternalTrackParam *tp = track->GetTPCInnerParam(); | |
47 | if (!tp) return 0; | |
48 | ||
49 | Float_t r,z; | |
50 | track->GetImpactParameters(r,z); | |
5a6d201c | 51 | // if (fabs(z)>0.2) return 0; // impact parameter in z |
52 | // if (fabs(r)>0.1) return 0; // impact parameter in xy | |
7148817a | 53 | |
54 | // pid | |
55 | ||
56 | if (pidi==0) return 1; | |
57 | if (!track->IsOn(AliESDtrack::kTPCpid)) return 0; | |
58 | Double_t p[AliPID::kSPECIES]; | |
59 | track->GetESDpid(p); | |
60 | Int_t q = tp->Charge(); | |
61 | if (pidi == -211) return p[AliPID::kPion]>0.5 && q==-1; | |
62 | else if (pidi == 211) return p[AliPID::kPion]>0.5 && q==1; | |
63 | else return 0; | |
64 | } | |
65 | //============================================================================= | |
66 | Bool_t AliDEventAliceESD::PairGood(Double_t p0, Double_t the0, Double_t phi0, | |
67 | Double_t p1, Double_t the1, Double_t phi1) const { | |
68 | ||
69 | // two-track separation cut | |
70 | ||
71 | double r = 85; // TPC entrance radius in cm | |
72 | double x0 = r*sin(the0)*cos(phi0); | |
73 | double x1 = r*sin(the1)*cos(phi0); | |
74 | double y0 = r*sin(the0)*sin(phi0); | |
75 | double y1 = r*sin(the1)*sin(phi1); | |
76 | double z0 = r*cos(the0); | |
77 | double z1 = r*cos(the1); | |
78 | double dx = x1-x0; | |
79 | double dy = y1-y0; | |
80 | double dz = z1-z0; | |
81 | double dist2 = dx*dx+dy*dy+dz*dz; | |
82 | return dist2>2*2; | |
83 | } | |
84 | //============================================================================= |