1 /**************************************************************************
2 * Copyright(c) 1998-1999, 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 **************************************************************************/
18 // AliFlowTrackSimpleCuts:
19 // A simple track cut class to the the AliFlowTrackSimple
20 // for basic kinematic cuts
22 // author: N. van der Kolk (kolk@nikhef.nl)
23 // mods: Mikolaj Krzewicki (mikolaj.krzewicki@cern.ch)
28 #include "TParticle.h"
29 #include "TParticlePDG.h"
30 #include "AliFlowTrackSimpleCuts.h"
31 #include "AliFlowTrackSimple.h"
33 ClassImp(AliFlowTrackSimpleCuts)
35 //-----------------------------------------------------------------------
36 AliFlowTrackSimpleCuts::AliFlowTrackSimpleCuts():
55 ////-----------------------------------------------------------------------
56 //AliFlowTrackSimpleCuts::AliFlowTrackSimpleCuts(const AliFlowTrackSimpleCuts& someCuts):
58 // fCutPt(someCuts.fCutPt),
59 // fPtMax(someCuts.fPtMax),
60 // fPtMin(someCuts.fPtMin),
61 // fCutEta(someCuts.fCutEta),
62 // fEtaMax(someCuts.fEtaMax),
63 // fEtaMin(someCuts.fEtaMin),
64 // fCutPhi(someCuts.fCutPhi),
65 // fPhiMax(someCuts.fPhiMax),
66 // fPhiMin(someCuts.fPhiMin),
67 // fCutPID(someCuts.fCutPID),
68 // fPID(someCuts.fPID),
69 // fCutCharge(someCuts.fCutCharge),
70 // fCharge(someCuts.fCharge)
75 ////-----------------------------------------------------------------------
76 //AliFlowTrackSimpleCuts& AliFlowTrackSimpleCuts::operator=(const AliFlowTrackSimpleCuts& someCuts)
78 // TNamed::operator=(someCuts);
79 // fCutPt = someCuts.fCutPt;
80 // fPtMax = someCuts.fPtMax;
81 // fPtMin = someCuts.fPtMin;
82 // fCutEta = someCuts.fCutEta;
83 // fEtaMax = someCuts.fEtaMax;
84 // fEtaMin = someCuts.fEtaMin;
85 // fCutPhi = someCuts.fCutPhi;
86 // fPhiMax = someCuts.fPhiMax;
87 // fPhiMin = someCuts.fPhiMin;
88 // fCutPID = someCuts.fCutPID;
89 // fPID = someCuts.fPID;
90 // fCutCharge = someCuts.fCutCharge;
91 // fCharge = someCuts.fCharge;
96 //-----------------------------------------------------------------------
97 Bool_t AliFlowTrackSimpleCuts::PassesCuts(const AliFlowTrackSimple *track) const
99 //simple method to check if the simple track passes the simple cuts
100 if(fCutPt) {if (track->Pt() < fPtMin || track->Pt() >= fPtMax ) return kFALSE;}
101 if(fCutEta) {if (track->Eta() < fEtaMin || track->Eta() >= fEtaMax ) return kFALSE;}
102 if(fCutPhi) {if (track->Phi() < fPhiMin || track->Phi() >= fPhiMax ) return kFALSE;}
103 //if(fCutPID) {if (track->PID() != fPID) return kFALSE;}
104 if(fCutCharge) {if (track->Charge() != fCharge) return kFALSE;}
108 //-----------------------------------------------------------------------
109 Bool_t AliFlowTrackSimpleCuts::PassesCuts(TParticle* track) const
111 //simple method to check if the simple track passes the simple cuts
112 if(fCutPt) {if (track->Pt() < fPtMin || track->Pt() >= fPtMax ) return kFALSE;}
113 if(fCutEta) {if (track->Eta() < fEtaMin || track->Eta() >= fEtaMax ) return kFALSE;}
114 if(fCutPhi) {if (track->Phi() < fPhiMin || track->Phi() >= fPhiMax ) return kFALSE;}
115 //if(fCutPID) {if (track->GetPdgCode() != fPID) return kFALSE;}
117 //getting the charge from a tparticle is expensive
118 //only do it if neccesary
121 TParticlePDG* ppdg = track->GetPDG();
122 Int_t charge = TMath::Nint(ppdg->Charge()/3.0);
123 return (charge==fCharge);