1 /*************************************************************************
2 * Copyright(c) 1998-2048, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
16 // Author: Dariusz Miskowiec <mailto:d.miskowiec@gsi.de> 2008
18 //=============================================================================
19 // AliUnicorEvent-AliESD interface //
20 //=============================================================================
23 #include "AliESDEvent.h"
24 #include "AliUnicorEventAliceESD.h"
26 ClassImp(AliUnicorEventAliceESD)
28 //=============================================================================
29 AliUnicorEventAliceESD::AliUnicorEventAliceESD(AliESDEvent *esd) : AliUnicorEvent(), fESD(esd)
33 // printf("%s object created\n",ClassName());
34 if (!fESD) fESD = new AliESDEvent();
36 //=============================================================================
37 AliUnicorEventAliceESD::~AliUnicorEventAliceESD()
42 //=============================================================================
43 Bool_t AliUnicorEventAliceESD::Good() const
47 if (fabs(Zver())>1) return kFALSE;
48 if (fESD->GetPrimaryVertexTPC()->GetZRes()>1.5) return kFALSE;
51 //=============================================================================
52 Bool_t AliUnicorEventAliceESD::ParticleGood(Int_t i, Int_t pidi) const
54 // track cuts and particle id cuts; pidi=0 means take all species
55 // consider using the standard ESDcut
59 AliESDtrack *track = fESD->GetTrack(i);
60 if (!track->IsOn(AliESDtrack::kTPCrefit)) return 0; // TPC refit
61 if (track->GetTPCNcls() < 100) return 0; // number of TPC clusters
62 const AliExternalTrackParam *tp = track->GetTPCInnerParam();
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
70 //TBits shared = track->GetTPCSharedMap();
71 //if (shared.CountBits()) return 0; // no shared clusters; pragmatic but dangerous
75 if (pidi==0) return 1;
77 if (!track->IsOn(AliESDtrack::kTPCpid)) return 0;
78 Double_t p[AliPID::kSPECIES];
80 Int_t q = tp->Charge();
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;
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;
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 {
96 // two-track separation cut
98 double dthe = the1-the0;
99 double dphi = TVector2::Phi_mpi_pi(phi1-phi0);
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);
105 //=============================================================================