]>
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 | //============================================================================= | |
b226c9db | 29 | AliUnicorEventAliceESD::AliUnicorEventAliceESD(AliESDEvent *esd) : AliUnicorEvent(), fESD(esd), fPhysicsSelection(0) |
621688e4 | 30 | { |
31 | // constructor | |
32 | ||
33 | // printf("%s object created\n",ClassName()); | |
34 | if (!fESD) fESD = new AliESDEvent(); | |
b226c9db | 35 | fPhysicsSelection = new AliPhysicsSelection(); |
621688e4 | 36 | } |
37 | //============================================================================= | |
38 | AliUnicorEventAliceESD::~AliUnicorEventAliceESD() | |
39 | { | |
40 | // destructor | |
41 | ||
42 | } | |
43 | //============================================================================= | |
44 | Bool_t AliUnicorEventAliceESD::Good() const | |
45 | { | |
46 | // event cuts | |
47 | ||
b226c9db | 48 | // if (!fPhysicsSelection->IsCollisionCandidate(fESD)) return kFALSE; |
49 | const AliESDVertex *vtx = fESD->GetPrimaryVertex(); | |
76d78859 | 50 | if (!vtx->GetStatus()) return kFALSE; |
621688e4 | 51 | if (fabs(Zver())>1) return kFALSE; |
621688e4 | 52 | return kTRUE; |
53 | } | |
54 | //============================================================================= | |
55 | Bool_t AliUnicorEventAliceESD::ParticleGood(Int_t i, Int_t pidi) const | |
56 | { | |
57 | // track cuts and particle id cuts; pidi=0 means take all species | |
58 | // consider using the standard ESDcut | |
59 | ||
60 | // track quality cuts | |
61 | ||
62 | AliESDtrack *track = fESD->GetTrack(i); | |
63 | if (!track->IsOn(AliESDtrack::kTPCrefit)) return 0; // TPC refit | |
76d78859 | 64 | if (!track->IsOn(AliESDtrack::kITSrefit)) return 0; // ITS refit |
b226c9db | 65 | if (track->GetTPCNcls() < 90) return 0; // number of TPC clusters |
76d78859 | 66 | if (track->GetKinkIndex(0) > 0) return 0; // no kink daughters |
67 | const AliExternalTrackParam *tp = GetTrackParam(i); | |
68 | if (!tp) return 0; // track param | |
69 | if (fabs(tp->Eta())>0.8) return 0; // fiducial pseudorapidity | |
70 | ||
71 | // double pi9 = TMath::Pi()/9.0; | |
72 | // double eta = tp->Eta(); | |
73 | // double phi = ParticlePhi(i); | |
74 | // if (eta>0 && phi>-8*pi9 && phi<-7*pi9) return 0; // A10 | |
75 | // if (eta>0 && phi> 1*pi9 && phi< 2*pi9) return 0; // A01 | |
621688e4 | 76 | |
77 | Float_t r,z; | |
040da09c | 78 | track->GetImpactParametersTPC(r,z); |
76d78859 | 79 | if (fabs(z)>3.2) return 0; // impact parameter in z |
80 | if (fabs(r)>2.4) return 0; // impact parameter in xy | |
040da09c | 81 | |
82 | //TBits shared = track->GetTPCSharedMap(); | |
76d78859 | 83 | //if (shared.CountBits()) return 0; // no shared clusters; pragmatic but dangerous |
621688e4 | 84 | |
76d78859 | 85 | if (pidi==0) return 1; |
621688e4 | 86 | |
76d78859 | 87 | // pid |
040da09c | 88 | |
621688e4 | 89 | if (!track->IsOn(AliESDtrack::kTPCpid)) return 0; |
90 | Double_t p[AliPID::kSPECIES]; | |
91 | track->GetTPCpid(p); | |
92 | Int_t q = tp->Charge(); | |
040da09c | 93 | |
621688e4 | 94 | if (pidi == -211) return p[AliPID::kPion]+p[AliPID::kMuon]>0.5 && q==-1; |
95 | else if (pidi == 211) return p[AliPID::kPion]+p[AliPID::kMuon]>0.5 && q==1; | |
b226c9db | 96 | |
040da09c | 97 | else if (pidi == -321) return p[AliPID::kKaon]>0.5 && q==-1; |
98 | else if (pidi == 321) return p[AliPID::kKaon]>0.5 && q==1; | |
99 | else if (pidi == -2212) return p[AliPID::kProton]>0.5 && q==-1; | |
100 | else if (pidi == 2212) return p[AliPID::kProton]>0.5 && q==1; | |
621688e4 | 101 | else return 0; |
102 | } | |
103 | //============================================================================= | |
104 | Bool_t AliUnicorEventAliceESD::PairGood(Double_t /*p0*/, Double_t the0, Double_t phi0, | |
105 | Double_t /*p1*/, Double_t the1, Double_t phi1) const { | |
106 | ||
107 | // two-track separation cut | |
108 | ||
76d78859 | 109 | return 1; |
c6fc7f72 | 110 | double dthe = the1-the0; |
111 | double dphi = TVector2::Phi_mpi_pi(phi1-phi0); | |
040da09c | 112 | // double dpt = p1*sin(the1) - p0*sin(the0); |
040da09c | 113 | return (fabs(dthe)>0.010 || fabs(dphi)>0.060); |
114 | //return (dpt*dphi<0); | |
621688e4 | 115 | } |
116 | //============================================================================= |