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->GetPrimaryVertex()->GetZRes()>0.1) 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() < 120) return 0; // number of TPC clusters
62 const AliExternalTrackParam *tp = track->GetTPCInnerParam();
66 track->GetImpactParameters(r,z);
67 // if (fabs(z)>0.2) return 0; // impact parameter in z
68 // if (fabs(r)>0.1) return 0; // impact parameter in xy
72 if (pidi==0) return 1;
73 if (!track->IsOn(AliESDtrack::kTPCpid)) return 0;
74 Double_t p[AliPID::kSPECIES];
76 Int_t q = tp->Charge();
77 if (pidi == -211) return p[AliPID::kPion]+p[AliPID::kMuon]>0.5 && q==-1;
78 else if (pidi == 211) return p[AliPID::kPion]+p[AliPID::kMuon]>0.5 && q==1;
81 //=============================================================================
82 Bool_t AliUnicorEventAliceESD::PairGood(Double_t /*p0*/, Double_t the0, Double_t phi0,
83 Double_t /*p1*/, Double_t the1, Double_t phi1) const {
85 // two-track separation cut
87 double r = 85; // TPC entrance radius in cm
88 double x0 = r*sin(the0)*cos(phi0);
89 double x1 = r*sin(the1)*cos(phi0);
90 double y0 = r*sin(the0)*sin(phi0);
91 double y1 = r*sin(the1)*sin(phi1);
92 double z0 = r*cos(the0);
93 double z1 = r*cos(the1);
97 double dist2 = dx*dx+dy*dy+dz*dz;
100 //=============================================================================