1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * ALICE Experiment at CERN, All rights reserved. *
5 * Primary Author: Svein Lindal <slindal@fys.uio.no> *
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 /// @file AliConversionTrackCuts.cxx
17 /// @author Svein Lindal
18 /// @brief Base class for analysation of conversion particle - track correlations
21 #include "AliConversionTrackCuts.h"
22 //#include "AliAODTrack.h"
23 #include "AliAODEvent.h"
30 ClassImp(AliConversionTrackCuts)
32 //________________________________________________________________________
33 AliConversionTrackCuts::AliConversionTrackCuts() :
37 fRejectKinkDaughters(kTRUE),
49 fAODTestFilterBit(-1),
55 //________________________________________________________________________
56 AliConversionTrackCuts::AliConversionTrackCuts(TString name, TString title = "title") :
57 AliAnalysisCuts(name, title),
60 fRejectKinkDaughters(kTRUE),
72 fAODTestFilterBit(-1),
80 //________________________________________________________________________________
81 AliConversionTrackCuts::~AliConversionTrackCuts() {
84 // delete fHistograms;
85 // fHistograms = NULL;
89 TList * AliConversionTrackCuts::CreateHistograms() {
91 if(!fHistograms) fHistograms = new TList();
93 fHistograms->SetOwner(kTRUE);
94 fHistograms->SetName("trackCuts");
96 fhPhi = new TH2F("phi", "phi", 20, -0.5, 19.5, 128, 0, TMath::TwoPi());
97 fHistograms->Add(fhPhi);
99 fhPhiPt = new TH2F("phipt", "phipt", 80, 0, 100, 128, 0, TMath::TwoPi());
100 fHistograms->Add(fhPhiPt);
107 void AliConversionTrackCuts::FillHistograms(Int_t cutIndex, AliVTrack * track) {
109 fhPhi->Fill(cutIndex, track->Phi());
110 fhPhiPt->Fill(track->Pt(), track->Phi());
113 Bool_t AliConversionTrackCuts::AcceptTrack(AliAODTrack * track, AliAODEvent * aodEvent) {
114 // Check an AOD track.
115 // This is done doing directly all checks, since there is not
116 // an equivalend checker for AOD tracks
119 // try to retrieve the reference AOD event
120 // AliAODEvent *aodEvent = 0x0;
121 // if (fEvent) aodEvent = fEvent->GetRefAOD();
123 // AliError("AOD reference event is not initialized!");
129 FillHistograms(cutIndex, track);
131 // step #0: check SPD and ITS clusters
133 nSPD = TESTBIT(track->GetITSClusterMap(), 0);
134 nSPD += TESTBIT(track->GetITSClusterMap(), 1);
135 if (nSPD < fSPDminNClusters) {
136 FillHistograms(cutIndex, track);
137 AliDebug(AliLog::kDebug + 2, "Not enough SPD clusters in this track. Rejected");
142 // step #1: check number of clusters in TPC
143 if (track->GetTPCNcls() < fTPCminNClusters) {
144 FillHistograms(cutIndex, track);
145 AliDebug(AliLog::kDebug + 2, "Too few TPC clusters. Rejected");
150 if (track->GetITSNcls() < fITSminNClusters) {
151 FillHistograms(cutIndex, track);
152 AliDebug(AliLog::kDebug + 2, "Too few ITS clusters. Rejected");
157 // step #2: check chi square
158 if (track->Chi2perNDF() > fTPCmaxChi2) {
159 FillHistograms(cutIndex, track);
160 AliDebug(AliLog::kDebug + 2, "Bad chi2. Rejected");
165 if (track->Chi2perNDF() > fITSmaxChi2) {
166 FillHistograms(cutIndex, track);
167 AliDebug(AliLog::kDebug + 2, "Bad chi2. Rejected");
173 // step #3: reject kink daughters
174 AliAODVertex *vertex = track->GetProdVertex();
175 if (vertex && fRejectKinkDaughters) {
176 if (vertex->GetType() == AliAODVertex::kKink) {
177 FillHistograms(cutIndex, track);
178 AliDebug(AliLog::kDebug + 2, "Kink daughter. Rejected");
185 // step #4: DCA cut (transverse)
186 Double_t b[2], cov[3];
187 vertex = aodEvent->GetPrimaryVertex();
189 FillHistograms(cutIndex, track);
190 AliDebug(AliLog::kDebug + 2, "NULL vertex");
195 if (!track->PropagateToDCA(vertex, aodEvent->GetMagneticField(), kVeryBig, b, cov)) {
196 AliDebug(AliLog::kDebug + 2, "Failed propagation to vertex");
197 FillHistograms(cutIndex, track);
202 // if the DCA cut is not fixed, compute current value
204 FillHistograms(cutIndex, track);
205 static TString str(fDCARptFormula);
206 str.ReplaceAll("pt", "x");
207 static const TFormula dcaXY(Form("%s_dcaXY", GetName()), str.Data());
208 fDCARmax = dcaXY.Eval(track->Pt());
213 if (TMath::Abs(b[0]) > fDCARmax) {
214 FillHistograms(cutIndex, track);
215 AliDebug(AliLog::kDebug + 2, "Too large transverse DCA");
221 // step #5: DCA cut (longitudinal)
222 // the DCA has already been computed above
223 // if the DCA cut is not fixed, compute current value
225 FillHistograms(cutIndex, track);
226 static TString str(fDCAZptFormula);
227 str.ReplaceAll("pt", "x");
228 static const TFormula dcaZ(Form("%s_dcaXY", GetName()), str.Data());
229 fDCAZmax = dcaZ.Eval(track->Pt());
234 if (TMath::Abs(b[1]) > fDCAZmax) {
235 FillHistograms(cutIndex, track);
236 AliDebug(AliLog::kDebug + 2, "Too large longitudinal DCA");
242 // step #6: check eta/pt range
243 if (track->Eta() < fEta[0] || track->Eta() > fEta[1]) {
244 FillHistograms(cutIndex, track);
245 AliDebug(AliLog::kDebug + 2, "Outside ETA acceptance");
250 // if (track->Pt() < fPt[0] || track->Pt() > fPt[1]) {
251 // AliDebug(AliLog::kDebug + 2, "Outside PT acceptance");
255 // if we are here, all cuts were passed and no exit point was got
259 //_________________________________________________________________________________________________
260 void AliConversionTrackCuts::Print(const Option_t *) const
263 // Print information on this cut
266 AliInfo(Form("Cut name : %s", GetName()));
267 AliInfo(Form("Required flags (off, on): %lx %lx", fFlagsOn, fFlagsOff));
268 AliInfo(Form("Ranges in eta, pt : %.2f - %.2f, %.2f - %.2f", fEta[0], fEta[1], fPt[0], fPt[1]));
269 AliInfo(Form("Kink daughters are : %s", (fRejectKinkDaughters ? "rejected" : "accepted")));
270 AliInfo(Form("TPC requirements : min. cluster = %d, max chi2 = %f", fTPCminNClusters, fTPCmaxChi2));
271 AliInfo(Form("ITS requirements : min. cluster = %d (all), %d (SPD), max chi2 = %f", fITSminNClusters, fSPDminNClusters, fITSmaxChi2));
274 AliInfo(Form("DCA r cut : fixed to %f cm", fDCARmax));
276 AliInfo(Form("DCA r cut formula : %s", fDCARptFormula.Data()));
280 AliInfo(Form("DCA z cut : fixed to %f cm", fDCAZmax));
282 AliInfo(Form("DCA z cut formula : %s", fDCAZptFormula.Data()));