]>
Commit | Line | Data |
---|---|---|
6a213b59 | 1 | /************************************************************************** |
2 | * Copyright(c) 1998-2007, 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 | //---------------------------------------------------------------------------- | |
17 | // Implementation of the heavy-flavour vertexing analysis class | |
dcb444c9 | 18 | // Candidates are stored in the AOD as objects deriving from AliAODRecoDecay. |
19 | // To be used as a task of AliAnalysisManager by means of the interface | |
20 | // class AliAnalysisTaskSEVertexingHF. | |
21 | // An example of usage in the macro AliAnalysisTaskSEVertexingHFTest.C. | |
6a213b59 | 22 | // |
2ff20727 | 23 | // Origin: E.Bruna, G.E.Bruno, A.Dainese, F.Prino, R.Romita, X.M.Zhang |
b056c5e3 | 24 | // Contact: andrea.dainese@lnl.infn.it |
6a213b59 | 25 | //---------------------------------------------------------------------------- |
b82f6d67 | 26 | #include <TFile.h> |
6a213b59 | 27 | #include <TDatabasePDG.h> |
28 | #include <TString.h> | |
dcb444c9 | 29 | #include "AliLog.h" |
30 | #include "AliVEvent.h" | |
31 | #include "AliVVertex.h" | |
32 | #include "AliVTrack.h" | |
6a213b59 | 33 | #include "AliVertexerTracks.h" |
a353d2e4 | 34 | #include "AliKFVertex.h" |
dcb444c9 | 35 | #include "AliESDEvent.h" |
6a213b59 | 36 | #include "AliESDVertex.h" |
dcb444c9 | 37 | #include "AliESDtrack.h" |
f8fa4595 | 38 | #include "AliESDtrackCuts.h" |
b056c5e3 | 39 | #include "AliAODEvent.h" |
6a213b59 | 40 | #include "AliAODRecoDecay.h" |
41 | #include "AliAODRecoDecayHF.h" | |
42 | #include "AliAODRecoDecayHF2Prong.h" | |
43 | #include "AliAODRecoDecayHF3Prong.h" | |
44 | #include "AliAODRecoDecayHF4Prong.h" | |
2ff20727 | 45 | #include "AliAODRecoCascadeHF.h" |
f8fa4595 | 46 | #include "AliAnalysisFilter.h" |
6a213b59 | 47 | #include "AliAnalysisVertexingHF.h" |
48 | ||
49 | ClassImp(AliAnalysisVertexingHF) | |
50 | ||
51 | //---------------------------------------------------------------------------- | |
52 | AliAnalysisVertexingHF::AliAnalysisVertexingHF(): | |
dcb444c9 | 53 | fInputAOD(kFALSE), |
54 | fAODMap(0), | |
b82f6d67 | 55 | fBzkG(0.), |
56 | fSecVtxWithKF(kFALSE), | |
6a213b59 | 57 | fRecoPrimVtxSkippingTrks(kFALSE), |
58 | fRmTrksFromPrimVtx(kFALSE), | |
59 | fV1(0x0), | |
b82f6d67 | 60 | fD0toKpi(kTRUE), |
61 | fJPSItoEle(kTRUE), | |
62 | f3Prong(kTRUE), | |
63 | f4Prong(kTRUE), | |
2ff20727 | 64 | fDstar(kTRUE), |
65 | fTrackFilter(0x0), | |
66 | fTrackFilterSoftPi(0x0) | |
6a213b59 | 67 | { |
68 | // Default constructor | |
69 | ||
70 | SetD0toKpiCuts(); | |
71 | SetBtoJPSICuts(); | |
72 | SetDplusCuts(); | |
b82f6d67 | 73 | SetDsCuts(); |
74 | SetLcCuts(); | |
2ff20727 | 75 | SetDstarCuts(); |
f8fa4595 | 76 | |
6a213b59 | 77 | } |
13977a79 | 78 | //-------------------------------------------------------------------------- |
79 | AliAnalysisVertexingHF::AliAnalysisVertexingHF(const AliAnalysisVertexingHF &source) : | |
80 | TNamed(source), | |
dcb444c9 | 81 | fInputAOD(source.fInputAOD), |
82 | fAODMap(source.fAODMap), | |
b82f6d67 | 83 | fBzkG(source.fBzkG), |
84 | fSecVtxWithKF(source.fSecVtxWithKF), | |
13977a79 | 85 | fRecoPrimVtxSkippingTrks(source.fRecoPrimVtxSkippingTrks), |
86 | fRmTrksFromPrimVtx(source.fRmTrksFromPrimVtx), | |
87 | fV1(source.fV1), | |
13977a79 | 88 | fD0toKpi(source.fD0toKpi), |
89 | fJPSItoEle(source.fJPSItoEle), | |
90 | f3Prong(source.f3Prong), | |
91 | f4Prong(source.f4Prong), | |
2ff20727 | 92 | fDstar(source.fDstar), |
93 | fTrackFilter(source.fTrackFilter), | |
94 | fTrackFilterSoftPi(source.fTrackFilterSoftPi) | |
13977a79 | 95 | { |
96 | // | |
97 | // Copy constructor | |
98 | // | |
99 | for(Int_t i=0; i<9; i++) fD0toKpiCuts[i]=source.fD0toKpiCuts[i]; | |
100 | for(Int_t i=0; i<9; i++) fBtoJPSICuts[i]=source.fBtoJPSICuts[i]; | |
101 | for(Int_t i=0; i<12; i++) fDplusCuts[i]=source.fDplusCuts[i]; | |
2ff20727 | 102 | for(Int_t i=0; i<13; i++) fDsCuts[i]=source.fDsCuts[i]; |
103 | for(Int_t i=0; i<12; i++) fLcCuts[i]=source.fLcCuts[i]; | |
104 | for(Int_t i=0; i<5; i++) fDstarCuts[i]=source.fDstarCuts[i]; | |
13977a79 | 105 | } |
106 | //-------------------------------------------------------------------------- | |
107 | AliAnalysisVertexingHF &AliAnalysisVertexingHF::operator=(const AliAnalysisVertexingHF &source) | |
108 | { | |
109 | // | |
110 | // assignment operator | |
111 | // | |
112 | if(&source == this) return *this; | |
dcb444c9 | 113 | fInputAOD = source.fInputAOD; |
b82f6d67 | 114 | fBzkG = source.fBzkG; |
115 | fSecVtxWithKF = source.fSecVtxWithKF; | |
13977a79 | 116 | fRecoPrimVtxSkippingTrks = source.fRecoPrimVtxSkippingTrks; |
117 | fRmTrksFromPrimVtx = source.fRmTrksFromPrimVtx; | |
118 | fV1 = source.fV1; | |
13977a79 | 119 | fD0toKpi = source.fD0toKpi; |
120 | fJPSItoEle = source.fJPSItoEle; | |
121 | f3Prong = source.f3Prong; | |
122 | f4Prong = source.f4Prong; | |
2ff20727 | 123 | fDstar = source.fDstar; |
f8fa4595 | 124 | fTrackFilter = source.fTrackFilter; |
2ff20727 | 125 | fTrackFilterSoftPi = source.fTrackFilterSoftPi; |
13977a79 | 126 | |
127 | for(Int_t i=0; i<9; i++) fD0toKpiCuts[i]=source.fD0toKpiCuts[i]; | |
128 | for(Int_t i=0; i<9; i++) fBtoJPSICuts[i]=source.fBtoJPSICuts[i]; | |
129 | for(Int_t i=0; i<12; i++) fDplusCuts[i]=source.fDplusCuts[i]; | |
2ff20727 | 130 | for(Int_t i=0; i<13; i++) fDsCuts[i]=source.fDsCuts[i]; |
131 | for(Int_t i=0; i<12; i++) fLcCuts[i]=source.fLcCuts[i]; | |
132 | for(Int_t i=0; i<5; i++) fDstarCuts[i]=source.fDstarCuts[i]; | |
13977a79 | 133 | |
134 | return *this; | |
135 | } | |
6a213b59 | 136 | //---------------------------------------------------------------------------- |
137 | AliAnalysisVertexingHF::~AliAnalysisVertexingHF() { | |
138 | // Destructor | |
13977a79 | 139 | if(fV1) { delete fV1; fV1=0; } |
f8fa4595 | 140 | if(fTrackFilter) { delete fTrackFilter; fTrackFilter=0; } |
2ff20727 | 141 | if(fTrackFilterSoftPi) { delete fTrackFilterSoftPi; fTrackFilterSoftPi=0; } |
6a213b59 | 142 | } |
143 | //---------------------------------------------------------------------------- | |
dcb444c9 | 144 | void AliAnalysisVertexingHF::FindCandidates(AliVEvent *event, |
145 | TClonesArray *aodVerticesHFTClArr, | |
146 | TClonesArray *aodD0toKpiTClArr, | |
147 | TClonesArray *aodJPSItoEleTClArr, | |
148 | TClonesArray *aodCharm3ProngTClArr, | |
2ff20727 | 149 | TClonesArray *aodCharm4ProngTClArr, |
150 | TClonesArray *aodDstarTClArr) | |
b056c5e3 | 151 | { |
152 | // Find heavy-flavour vertex candidates | |
dcb444c9 | 153 | // Input: ESD or AOD |
b056c5e3 | 154 | // Output: AOD (additional branches added) |
155 | ||
dcb444c9 | 156 | |
157 | TString evtype = event->IsA()->GetName(); | |
158 | fInputAOD = ((evtype=="AliAODEvent") ? kTRUE : kFALSE); | |
159 | ||
b056c5e3 | 160 | if(!aodVerticesHFTClArr) { |
161 | printf("ERROR: no aodVerticesHFTClArr"); | |
162 | return; | |
163 | } | |
164 | if(fD0toKpi && !aodD0toKpiTClArr) { | |
165 | printf("ERROR: no aodD0toKpiTClArr"); | |
166 | return; | |
167 | } | |
168 | if(fJPSItoEle && !aodJPSItoEleTClArr) { | |
169 | printf("ERROR: no aodJPSItoEleTClArr"); | |
170 | return; | |
171 | } | |
172 | if(f3Prong && !aodCharm3ProngTClArr) { | |
173 | printf("ERROR: no aodCharm3ProngTClArr"); | |
174 | return; | |
175 | } | |
176 | if(f4Prong && !aodCharm4ProngTClArr) { | |
177 | printf("ERROR: no aodCharm4ProngTClArr"); | |
178 | return; | |
179 | } | |
2ff20727 | 180 | if(fDstar && !aodDstarTClArr) { |
181 | printf("ERROR: no aodDstarTClArr"); | |
182 | return; | |
183 | } | |
b056c5e3 | 184 | |
185 | // delete candidates from previous event and create references | |
2ff20727 | 186 | Int_t iVerticesHF=0,iD0toKpi=0,iJPSItoEle=0,i3Prong=0,i4Prong=0,iDstar=0; |
b056c5e3 | 187 | aodVerticesHFTClArr->Delete(); |
188 | iVerticesHF = aodVerticesHFTClArr->GetEntriesFast(); | |
189 | TClonesArray &verticesHFRef = *aodVerticesHFTClArr; | |
190 | if(fD0toKpi) { | |
191 | aodD0toKpiTClArr->Delete(); | |
192 | iD0toKpi = aodD0toKpiTClArr->GetEntriesFast(); | |
193 | } | |
194 | if(fJPSItoEle) { | |
195 | aodJPSItoEleTClArr->Delete(); | |
196 | iJPSItoEle = aodJPSItoEleTClArr->GetEntriesFast(); | |
197 | } | |
198 | if(f3Prong) { | |
199 | aodCharm3ProngTClArr->Delete(); | |
200 | i3Prong = aodCharm3ProngTClArr->GetEntriesFast(); | |
201 | } | |
202 | if(f4Prong) { | |
203 | aodCharm4ProngTClArr->Delete(); | |
204 | i4Prong = aodCharm4ProngTClArr->GetEntriesFast(); | |
205 | } | |
2ff20727 | 206 | if(fDstar) { |
207 | aodDstarTClArr->Delete(); | |
208 | iDstar = aodDstarTClArr->GetEntriesFast(); | |
209 | } | |
210 | TClonesArray &aodD0toKpiRef = *aodD0toKpiTClArr; | |
211 | TClonesArray &aodJPSItoEleRef = *aodJPSItoEleTClArr; | |
212 | TClonesArray &aodCharm3ProngRef = *aodCharm3ProngTClArr; | |
213 | TClonesArray &aodCharm4ProngRef = *aodCharm4ProngTClArr; | |
214 | TClonesArray &aodDstarRef = *aodDstarTClArr; | |
b056c5e3 | 215 | |
216 | ||
2ff20727 | 217 | AliAODRecoDecayHF2Prong *io2Prong = 0; |
218 | AliAODRecoDecayHF3Prong *io3Prong = 0; | |
219 | AliAODRecoDecayHF4Prong *io4Prong = 0; | |
220 | AliAODRecoCascadeHF *ioCascade = 0; | |
b056c5e3 | 221 | |
2ff20727 | 222 | Int_t iTrkP1,iTrkP2,iTrkN1,iTrkN2,iTrkSoftPi,trkEntries; |
223 | Double_t xdummy,ydummy,dcap1n1,dcap1n2,dcap2n1,dcap1p2,dcan1n2,dcaCasc; | |
b056c5e3 | 224 | Bool_t okD0=kFALSE,okJPSI=kFALSE,ok3Prong=kFALSE,ok4Prong=kFALSE; |
2ff20727 | 225 | Bool_t okDstar=kFALSE,okD0fromDstar=kFALSE; |
b056c5e3 | 226 | AliESDtrack *postrack1 = 0; |
227 | AliESDtrack *postrack2 = 0; | |
228 | AliESDtrack *negtrack1 = 0; | |
229 | AliESDtrack *negtrack2 = 0; | |
2ff20727 | 230 | AliESDtrack *trackPi = 0; |
b056c5e3 | 231 | Double_t dcaMax = fD0toKpiCuts[1]; |
232 | if(dcaMax < fBtoJPSICuts[1]) dcaMax=fBtoJPSICuts[1]; | |
233 | if(dcaMax < fDplusCuts[11]) dcaMax=fDplusCuts[11]; | |
dcb444c9 | 234 | AliDebug(2,Form(" dca cut set to %f cm",dcaMax)); |
b056c5e3 | 235 | |
b056c5e3 | 236 | |
dcb444c9 | 237 | // get Bz |
238 | fBzkG = (Double_t)event->GetMagneticField(); | |
b056c5e3 | 239 | |
dcb444c9 | 240 | trkEntries = (Int_t)event->GetNumberOfTracks(); |
241 | AliDebug(1,Form(" Number of tracks: %d",trkEntries)); | |
357cd934 | 242 | |
243 | if(trkEntries<2) { | |
244 | AliDebug(1,Form(" Not enough tracks: %d",trkEntries)); | |
245 | return; | |
246 | } | |
b056c5e3 | 247 | |
357cd934 | 248 | const AliVVertex *primary = event->GetPrimaryVertex(); |
249 | if(!primary) { | |
250 | AliDebug(1," No primary vertex from tracks"); | |
251 | return; | |
252 | } | |
253 | TString primTitle = primary->GetTitle(); | |
254 | if(!primTitle.Contains("VertexerTracks")) { | |
255 | AliDebug(1," No primary vertex from tracks"); | |
b056c5e3 | 256 | return; |
257 | } | |
258 | ||
dcb444c9 | 259 | // call function that applies sigle-track selection, |
2ff20727 | 260 | // for displaced tracks and soft pions (both charges) for D*, |
dcb444c9 | 261 | // and retrieves primary vertex |
2ff20727 | 262 | TObjArray seleTrksArray(trkEntries); |
263 | UChar_t *seleFlags = new UChar_t[trkEntries]; // bit 0: displaced, bit 1: softpi | |
264 | Int_t nSeleTrks=0; | |
265 | SelectTracksAndCopyVertex(event,seleTrksArray,nSeleTrks,seleFlags); | |
b056c5e3 | 266 | |
2ff20727 | 267 | AliDebug(1,Form(" Selected tracks: %d",nSeleTrks)); |
b056c5e3 | 268 | |
2ff20727 | 269 | TObjArray *twoTrackArray1 = new TObjArray(2); |
270 | TObjArray *twoTrackArray2 = new TObjArray(2); | |
271 | TObjArray *twoTrackArrayCasc = new TObjArray(2); | |
272 | TObjArray *threeTrackArray = new TObjArray(3); | |
273 | TObjArray *fourTrackArray = new TObjArray(4); | |
b056c5e3 | 274 | |
dcb444c9 | 275 | Double_t dispersion; |
276 | ||
2ff20727 | 277 | AliAODRecoDecayHF *rd = 0; |
278 | AliAODRecoCascadeHF *rc = 0; | |
279 | ||
b056c5e3 | 280 | // LOOP ON POSITIVE TRACKS |
2ff20727 | 281 | for(iTrkP1=0; iTrkP1<nSeleTrks; iTrkP1++) { |
282 | if(iTrkP1%1==0) AliDebug(1,Form(" 1st loop on pos: track number %d of %d",iTrkP1,nSeleTrks)); | |
b056c5e3 | 283 | // get track from tracks array |
2ff20727 | 284 | postrack1 = (AliESDtrack*)seleTrksArray.UncheckedAt(iTrkP1); |
285 | if(postrack1->Charge()<0 || !TESTBIT(seleFlags[iTrkP1],kBitDispl)) continue; | |
b056c5e3 | 286 | // LOOP ON NEGATIVE TRACKS |
2ff20727 | 287 | for(iTrkN1=0; iTrkN1<nSeleTrks; iTrkN1++) { |
288 | if(iTrkN1==iTrkP1) continue; | |
289 | if(iTrkN1%1==0) AliDebug(1,Form(" 1st loop on neg: track number %d of %d",iTrkN1,nSeleTrks)); | |
b056c5e3 | 290 | // get track from tracks array |
2ff20727 | 291 | negtrack1 = (AliESDtrack*)seleTrksArray.UncheckedAt(iTrkN1); |
292 | if(negtrack1->Charge()>0 || !TESTBIT(seleFlags[iTrkN1],kBitDispl)) continue; | |
dcb444c9 | 293 | // back to primary vertex |
294 | postrack1->PropagateToDCA(fV1,fBzkG,kVeryBig); | |
295 | negtrack1->PropagateToDCA(fV1,fBzkG,kVeryBig); | |
b056c5e3 | 296 | // DCA between the two tracks |
297 | dcap1n1 = postrack1->GetDCA(negtrack1,fBzkG,xdummy,ydummy); | |
298 | if(dcap1n1>dcaMax) { negtrack1=0; continue; } | |
299 | // Vertexing | |
300 | twoTrackArray1->AddAt(postrack1,0); | |
301 | twoTrackArray1->AddAt(negtrack1,1); | |
dcb444c9 | 302 | AliAODVertex *vertexp1n1 = ReconstructSecondaryVertex(twoTrackArray1,dispersion); |
b056c5e3 | 303 | if(!vertexp1n1) { |
304 | twoTrackArray1->Clear(); | |
305 | negtrack1=0; | |
306 | continue; | |
307 | } | |
2ff20727 | 308 | if(fD0toKpi || fJPSItoEle || fDstar) { |
309 | io2Prong = Make2Prong(twoTrackArray1,event,vertexp1n1,dcap1n1,okD0,okJPSI,okD0fromDstar); | |
310 | if((fD0toKpi && okD0) || (fJPSItoEle && okJPSI)) { | |
311 | // add the vertex and the decay to the AOD | |
312 | AliAODVertex *v2Prong = new(verticesHFRef[iVerticesHF++])AliAODVertex(*vertexp1n1); | |
313 | if(fInputAOD) AddDaughterRefs(v2Prong,event,twoTrackArray1); | |
dcb444c9 | 314 | if(okD0) { |
2ff20727 | 315 | rd = new(aodD0toKpiRef[iD0toKpi++])AliAODRecoDecayHF2Prong(*io2Prong); |
316 | rd->SetSecondaryVtx(v2Prong); | |
317 | v2Prong->SetParent(rd); | |
dcb444c9 | 318 | } |
319 | if(okJPSI) { | |
2ff20727 | 320 | rd = new(aodJPSItoEleRef[iJPSItoEle++])AliAODRecoDecayHF2Prong(*io2Prong); |
321 | rd->SetSecondaryVtx(v2Prong); | |
322 | if(!okD0) v2Prong->SetParent(rd); // it cannot have two mothers ... | |
b056c5e3 | 323 | } |
324 | } | |
2ff20727 | 325 | if(fDstar && okD0fromDstar) { |
326 | if(fInputAOD) { // write references in io2Prong | |
327 | AddDaughterRefs(vertexp1n1,event,twoTrackArray1); | |
328 | io2Prong->SetSecondaryVtx(vertexp1n1); | |
329 | } | |
330 | // create a track from the D0 | |
d5ea6432 | 331 | AliESDtrack *trackD0 = new AliESDtrack(io2Prong); |
2ff20727 | 332 | // LOOP ON TRACKS THAT PASSED THE SOFT PION CUTS |
333 | for(iTrkSoftPi=0; iTrkSoftPi<nSeleTrks; iTrkSoftPi++) { | |
334 | if(iTrkSoftPi==iTrkP1 || iTrkSoftPi==iTrkN1) continue; | |
335 | if(!TESTBIT(seleFlags[iTrkSoftPi],kBitSoftPi)) continue; | |
336 | if(iTrkSoftPi%1==0) AliDebug(1,Form(" 1st loop on pi_s: track number %d of %d",iTrkSoftPi,nSeleTrks)); | |
337 | // get track from tracks array | |
338 | trackPi = (AliESDtrack*)seleTrksArray.UncheckedAt(iTrkSoftPi); | |
339 | ||
340 | trackPi->PropagateToDCA(fV1,fBzkG,kVeryBig); | |
341 | trackD0->PropagateToDCA(fV1,fBzkG,kVeryBig); | |
342 | // DCA between the two tracks | |
343 | dcaCasc = trackPi->GetDCA(trackD0,fBzkG,xdummy,ydummy); | |
344 | // Vertexing | |
345 | twoTrackArrayCasc->AddAt(trackPi,0); | |
346 | twoTrackArrayCasc->AddAt(trackD0,1); | |
347 | AliAODVertex *vertexCasc = ReconstructSecondaryVertex(twoTrackArrayCasc,dispersion); | |
348 | if(!vertexCasc) { | |
349 | twoTrackArrayCasc->Clear(); | |
350 | trackPi=0; | |
351 | continue; | |
352 | } | |
353 | ioCascade = MakeCascade(twoTrackArrayCasc,event,vertexCasc,io2Prong,dcaCasc,okDstar); | |
354 | if(okDstar) { | |
355 | if(!okD0) { | |
356 | // add the D0 to the AOD (if not already done) | |
357 | AliAODVertex *v2Prong = new(verticesHFRef[iVerticesHF++])AliAODVertex(*vertexp1n1); | |
358 | if(fInputAOD) AddDaughterRefs(v2Prong,event,twoTrackArray1); | |
359 | rd = new(aodD0toKpiRef[iD0toKpi++])AliAODRecoDecayHF2Prong(*io2Prong); | |
360 | rd->SetSecondaryVtx(v2Prong); | |
361 | v2Prong->SetParent(rd); | |
362 | okD0=kTRUE; // this is done to add it only once | |
363 | } | |
364 | // add the vertex and the cascade to the AOD | |
365 | AliAODVertex *vCasc = new(verticesHFRef[iVerticesHF++])AliAODVertex(*vertexCasc); | |
366 | if(fInputAOD) AddDaughterRefs(vCasc,event,twoTrackArrayCasc); // add the pion | |
367 | //vCasc->AddDaughter(rd); // doesn't work, because the D0 and the bachelor have different ROOT process ID | |
368 | rc = new(aodDstarRef[iDstar++])AliAODRecoCascadeHF(*ioCascade); | |
369 | rc->Set2Prong(rd); // add the D0 | |
370 | rc->SetSecondaryVtx(vCasc); | |
371 | vCasc->SetParent(rc); | |
372 | } | |
373 | twoTrackArrayCasc->Clear(); | |
374 | trackPi=0; | |
375 | ioCascade=NULL; | |
376 | delete vertexCasc; | |
377 | } // end loop on soft pi tracks | |
378 | if(trackD0) {delete trackD0; trackD0=NULL;} | |
379 | } | |
b056c5e3 | 380 | io2Prong=NULL; |
2ff20727 | 381 | } |
b056c5e3 | 382 | twoTrackArray1->Clear(); |
383 | if(!f3Prong && !f4Prong) { | |
384 | negtrack1=0; | |
385 | delete vertexp1n1; | |
386 | continue; | |
387 | } | |
388 | ||
389 | ||
390 | // 2nd LOOP ON POSITIVE TRACKS | |
2ff20727 | 391 | for(iTrkP2=iTrkP1+1; iTrkP2<nSeleTrks; iTrkP2++) { |
392 | if(iTrkP2==iTrkP1 || iTrkP2==iTrkN1) continue; | |
393 | if(iTrkP2%1==0) AliDebug(1,Form(" 2nd loop on pos: track number %d of %d",iTrkP2,nSeleTrks)); | |
b056c5e3 | 394 | // get track from tracks array |
2ff20727 | 395 | postrack2 = (AliESDtrack*)seleTrksArray.UncheckedAt(iTrkP2); |
396 | if(postrack2->Charge()<0 || !TESTBIT(seleFlags[iTrkP2],kBitDispl)) continue; | |
dcb444c9 | 397 | // back to primary vertex |
398 | postrack1->PropagateToDCA(fV1,fBzkG,kVeryBig); | |
399 | postrack2->PropagateToDCA(fV1,fBzkG,kVeryBig); | |
400 | negtrack1->PropagateToDCA(fV1,fBzkG,kVeryBig); | |
2ff20727 | 401 | //printf("********** %d %d %d\n",postrack1->GetID(),postrack2->GetID(),negtrack1->GetID()); |
b056c5e3 | 402 | dcap2n1 = postrack2->GetDCA(negtrack1,fBzkG,xdummy,ydummy); |
403 | if(dcap2n1>dcaMax) { postrack2=0; continue; } | |
404 | dcap1p2 = postrack2->GetDCA(postrack1,fBzkG,xdummy,ydummy); | |
405 | if(dcap1p2>dcaMax) { postrack2=0; continue; } | |
406 | ||
407 | // Vertexing | |
408 | twoTrackArray2->AddAt(postrack2,0); | |
409 | twoTrackArray2->AddAt(negtrack1,1); | |
dcb444c9 | 410 | AliAODVertex *vertexp2n1 = ReconstructSecondaryVertex(twoTrackArray2,dispersion); |
b056c5e3 | 411 | if(!vertexp2n1) { |
412 | twoTrackArray2->Clear(); | |
413 | postrack2=0; | |
414 | continue; | |
415 | } | |
416 | if(f3Prong) { | |
417 | threeTrackArray->AddAt(postrack1,0); | |
418 | threeTrackArray->AddAt(negtrack1,1); | |
419 | threeTrackArray->AddAt(postrack2,2); | |
dcb444c9 | 420 | AliAODVertex* secVert3PrAOD = ReconstructSecondaryVertex(threeTrackArray,dispersion); |
421 | io3Prong = Make3Prong(threeTrackArray,event,secVert3PrAOD,dispersion,vertexp1n1,vertexp2n1,dcap1n1,dcap2n1,dcap1p2,ok3Prong); | |
b056c5e3 | 422 | if(ok3Prong) { |
2ff20727 | 423 | AliAODVertex *v3Prong = new(verticesHFRef[iVerticesHF++])AliAODVertex(*secVert3PrAOD); |
424 | if(fInputAOD) AddDaughterRefs(v3Prong,event,threeTrackArray); | |
425 | rd = new(aodCharm3ProngRef[i3Prong++])AliAODRecoDecayHF3Prong(*io3Prong); | |
426 | rd->SetSecondaryVtx(v3Prong); | |
427 | v3Prong->SetParent(rd); | |
b056c5e3 | 428 | } |
dcb444c9 | 429 | if(io3Prong) io3Prong=NULL; |
b056c5e3 | 430 | } |
431 | if(f4Prong) { | |
432 | // 3rd LOOP ON NEGATIVE TRACKS (for 4 prong) | |
2ff20727 | 433 | for(iTrkN2=iTrkN1+1; iTrkN2<nSeleTrks; iTrkN2++) { |
434 | if(iTrkN2==iTrkP1 || iTrkN2==iTrkP2 || iTrkN2==iTrkN1) continue; | |
435 | if(iTrkN2%1==0) AliDebug(1,Form(" 3rd loop on neg: track number %d of %d",iTrkN2,nSeleTrks)); | |
b056c5e3 | 436 | // get track from tracks array |
2ff20727 | 437 | negtrack2 = (AliESDtrack*)seleTrksArray.UncheckedAt(iTrkN2); |
438 | if(negtrack2->Charge()>0 || !TESTBIT(seleFlags[iTrkN2],kBitDispl)) continue; | |
dcb444c9 | 439 | // back to primary vertex |
440 | postrack1->PropagateToDCA(fV1,fBzkG,kVeryBig); | |
441 | postrack2->PropagateToDCA(fV1,fBzkG,kVeryBig); | |
442 | negtrack1->PropagateToDCA(fV1,fBzkG,kVeryBig); | |
443 | negtrack2->PropagateToDCA(fV1,fBzkG,kVeryBig); | |
b056c5e3 | 444 | dcap1n2 = postrack1->GetDCA(negtrack2,fBzkG,xdummy,ydummy); |
445 | if(dcap1n2>dcaMax) { negtrack2=0; continue; } | |
446 | // Vertexing | |
447 | fourTrackArray->AddAt(postrack1,0); | |
448 | fourTrackArray->AddAt(negtrack1,1); | |
449 | fourTrackArray->AddAt(postrack2,2); | |
450 | fourTrackArray->AddAt(negtrack2,3); | |
dcb444c9 | 451 | AliAODVertex* secVert4PrAOD = ReconstructSecondaryVertex(fourTrackArray,dispersion); |
452 | io4Prong = Make4Prong(fourTrackArray,event,secVert4PrAOD,vertexp1n1,vertexp2n1,dcap1n1,dcap1n2,dcap2n1,ok4Prong); | |
b056c5e3 | 453 | if(ok4Prong) { |
2ff20727 | 454 | AliAODVertex *v4Prong = new(verticesHFRef[iVerticesHF++])AliAODVertex(*secVert4PrAOD); |
455 | if(fInputAOD) AddDaughterRefs(v4Prong,event,fourTrackArray); | |
456 | rd = new(aodCharm4ProngRef[i4Prong++])AliAODRecoDecayHF4Prong(*io4Prong); | |
457 | rd->SetSecondaryVtx(v4Prong); | |
458 | v4Prong->SetParent(rd); | |
b056c5e3 | 459 | } |
dcb444c9 | 460 | if(io4Prong) io4Prong=NULL; |
b056c5e3 | 461 | fourTrackArray->Clear(); |
462 | negtrack2 = 0; | |
463 | } // end loop on negative tracks | |
464 | } | |
465 | postrack2 = 0; | |
466 | delete vertexp2n1; | |
467 | } // end 2nd loop on positive tracks | |
468 | twoTrackArray2->Clear(); | |
469 | ||
470 | // 2nd LOOP ON NEGATIVE TRACKS | |
2ff20727 | 471 | for(iTrkN2=iTrkN1+1; iTrkN2<nSeleTrks; iTrkN2++) { |
472 | if(iTrkN2==iTrkP1 || iTrkN2==iTrkP2 || iTrkN2==iTrkN1) continue; | |
473 | if(iTrkN2%1==0) AliDebug(1,Form(" 2nd loop on neg: track number %d of %d",iTrkN2,nSeleTrks)); | |
b056c5e3 | 474 | // get track from tracks array |
2ff20727 | 475 | negtrack2 = (AliESDtrack*)seleTrksArray.UncheckedAt(iTrkN2); |
476 | if(negtrack2->Charge()>0 || !TESTBIT(seleFlags[iTrkN2],kBitDispl)) continue; | |
dcb444c9 | 477 | // back to primary vertex |
478 | postrack1->PropagateToDCA(fV1,fBzkG,kVeryBig); | |
479 | negtrack1->PropagateToDCA(fV1,fBzkG,kVeryBig); | |
480 | negtrack2->PropagateToDCA(fV1,fBzkG,kVeryBig); | |
2ff20727 | 481 | //printf("********** %d %d %d\n",postrack1->GetID(),negtrack1->GetID(),negtrack2->GetID()); |
b056c5e3 | 482 | dcap1n2 = postrack1->GetDCA(negtrack2,fBzkG,xdummy,ydummy); |
483 | if(dcap1n2>dcaMax) { negtrack2=0; continue; } | |
484 | dcan1n2 = negtrack1->GetDCA(negtrack2,fBzkG,xdummy,ydummy); | |
485 | if(dcan1n2>dcaMax) { negtrack2=0; continue; } | |
486 | ||
487 | // Vertexing | |
488 | twoTrackArray2->AddAt(postrack1,0); | |
489 | twoTrackArray2->AddAt(negtrack2,1); | |
dcb444c9 | 490 | |
491 | AliAODVertex *vertexp1n2 = ReconstructSecondaryVertex(twoTrackArray2,dispersion); | |
b056c5e3 | 492 | if(!vertexp1n2) { |
493 | twoTrackArray2->Clear(); | |
494 | negtrack2=0; | |
495 | continue; | |
496 | } | |
497 | if(f3Prong) { | |
498 | threeTrackArray->AddAt(negtrack1,0); | |
499 | threeTrackArray->AddAt(postrack1,1); | |
500 | threeTrackArray->AddAt(negtrack2,2); | |
dcb444c9 | 501 | AliAODVertex* secVert3PrAOD = ReconstructSecondaryVertex(threeTrackArray,dispersion); |
502 | io3Prong = Make3Prong(threeTrackArray,event,secVert3PrAOD,dispersion,vertexp1n1,vertexp1n2,dcap1n1,dcap1n2,dcan1n2,ok3Prong); | |
b056c5e3 | 503 | if(ok3Prong) { |
2ff20727 | 504 | AliAODVertex *v3Prong = new(verticesHFRef[iVerticesHF++])AliAODVertex(*secVert3PrAOD); |
505 | if(fInputAOD) AddDaughterRefs(v3Prong,event,threeTrackArray); | |
506 | rd = new(aodCharm3ProngRef[i3Prong++])AliAODRecoDecayHF3Prong(*io3Prong); | |
507 | rd->SetSecondaryVtx(v3Prong); | |
508 | v3Prong->SetParent(rd); | |
b056c5e3 | 509 | } |
dcb444c9 | 510 | if(io3Prong) io3Prong=NULL; |
b056c5e3 | 511 | } |
512 | negtrack2 = 0; | |
513 | delete vertexp1n2; | |
514 | } // end 2nd loop on negative tracks | |
515 | twoTrackArray2->Clear(); | |
516 | ||
517 | negtrack1 = 0; | |
518 | delete vertexp1n1; | |
519 | } // end 1st loop on negative tracks | |
520 | ||
521 | postrack1 = 0; | |
522 | } // end 1st loop on positive tracks | |
523 | ||
524 | ||
2ff20727 | 525 | AliDebug(1,Form(" Total HF vertices in event = %d;", |
526 | (Int_t)aodVerticesHFTClArr->GetEntriesFast())); | |
b056c5e3 | 527 | if(fD0toKpi) { |
dcb444c9 | 528 | AliDebug(1,Form(" D0->Kpi in event = %d;", |
529 | (Int_t)aodD0toKpiTClArr->GetEntriesFast())); | |
b056c5e3 | 530 | } |
531 | if(fJPSItoEle) { | |
dcb444c9 | 532 | AliDebug(1,Form(" JPSI->ee in event = %d;", |
533 | (Int_t)aodJPSItoEleTClArr->GetEntriesFast())); | |
b056c5e3 | 534 | } |
535 | if(f3Prong) { | |
dcb444c9 | 536 | AliDebug(1,Form(" Charm->3Prong in event = %d;", |
537 | (Int_t)aodCharm3ProngTClArr->GetEntriesFast())); | |
b056c5e3 | 538 | } |
539 | if(f4Prong) { | |
dcb444c9 | 540 | AliDebug(1,Form(" Charm->4Prong in event = %d;\n", |
541 | (Int_t)aodCharm4ProngTClArr->GetEntriesFast())); | |
b056c5e3 | 542 | } |
2ff20727 | 543 | if(fDstar) { |
544 | AliDebug(1,Form(" D*->D0pi in event = %d;\n", | |
545 | (Int_t)aodDstarTClArr->GetEntriesFast())); | |
546 | } | |
b056c5e3 | 547 | |
548 | ||
dcb444c9 | 549 | twoTrackArray1->Delete(); delete twoTrackArray1; |
550 | twoTrackArray2->Delete(); delete twoTrackArray2; | |
2ff20727 | 551 | twoTrackArrayCasc->Delete(); delete twoTrackArrayCasc; |
b056c5e3 | 552 | threeTrackArray->Clear(); |
553 | threeTrackArray->Delete(); delete threeTrackArray; | |
dcb444c9 | 554 | fourTrackArray->Delete(); delete fourTrackArray; |
2ff20727 | 555 | delete [] seleFlags; seleFlags=NULL; |
b056c5e3 | 556 | |
dcb444c9 | 557 | if(fInputAOD) { |
2ff20727 | 558 | seleTrksArray.Delete(); |
dcb444c9 | 559 | } |
b056c5e3 | 560 | |
561 | return; | |
562 | } | |
563 | //---------------------------------------------------------------------------- | |
dcb444c9 | 564 | void AliAnalysisVertexingHF::AddDaughterRefs(AliAODVertex *v,AliVEvent *event, |
565 | TObjArray *trkArray) const | |
6a213b59 | 566 | { |
dcb444c9 | 567 | // Add the AOD tracks as daughters of the vertex (TRef) |
6a213b59 | 568 | |
dcb444c9 | 569 | Int_t nTrks = trkArray->GetEntriesFast(); |
6a213b59 | 570 | |
dcb444c9 | 571 | AliESDtrack *esdTrack = 0; |
572 | AliAODTrack *aodTrack = 0; | |
573 | Int_t id; | |
6a213b59 | 574 | |
dcb444c9 | 575 | for(Int_t i=0; i<nTrks; i++) { |
576 | esdTrack = (AliESDtrack*)trkArray->UncheckedAt(i); | |
577 | id = (Int_t)esdTrack->GetID(); | |
2ff20727 | 578 | //printf("---> %d\n",id); |
579 | if(id<0) continue; // this track is a D0 | |
dcb444c9 | 580 | aodTrack = (AliAODTrack*)event->GetTrack(fAODMap[id]); |
581 | v->AddDaughter(aodTrack); | |
6a213b59 | 582 | } |
6a213b59 | 583 | |
584 | return; | |
dcb444c9 | 585 | } |
6a213b59 | 586 | //---------------------------------------------------------------------------- |
2ff20727 | 587 | AliAODRecoCascadeHF* AliAnalysisVertexingHF::MakeCascade( |
588 | TObjArray *twoTrackArray,AliVEvent *event, | |
589 | AliAODVertex *secVert, | |
590 | AliAODRecoDecayHF2Prong *rd2Prong, | |
591 | Double_t dca, | |
592 | Bool_t &okDstar) const | |
593 | { | |
594 | // Make the cascade as a 2Prong decay and check if it passes Dstar | |
595 | // reconstruction cuts | |
596 | ||
597 | okDstar = kFALSE; | |
598 | ||
599 | Bool_t dummy1,dummy2,dummy3; | |
600 | ||
601 | // We use Make2Prong to construct the AliAODRecoCascadeHF | |
602 | // (which inherits from AliAODRecoDecayHF2Prong) | |
603 | AliAODRecoCascadeHF *theCascade = | |
604 | (AliAODRecoCascadeHF*)Make2Prong(twoTrackArray,event,secVert,dca, | |
605 | dummy1,dummy2,dummy3); | |
606 | if(!theCascade) return 0x0; | |
607 | ||
608 | // charge | |
609 | AliESDtrack *trackPi = (AliESDtrack*)twoTrackArray->UncheckedAt(0); | |
610 | theCascade->SetCharge(trackPi->Charge()); | |
611 | ||
612 | //--- selection cuts | |
613 | // | |
614 | AliAODRecoCascadeHF *tmpCascade = new AliAODRecoCascadeHF(*theCascade); | |
615 | tmpCascade->Set2Prong(rd2Prong); // this is needed for the selection | |
616 | AliAODVertex *primVertexAOD=0; | |
617 | if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) { | |
618 | // take event primary vertex | |
619 | primVertexAOD = PrimaryVertex(); | |
620 | tmpCascade->SetOwnPrimaryVtx(primVertexAOD); | |
621 | rd2Prong->SetOwnPrimaryVtx(primVertexAOD); | |
622 | } | |
623 | // select D*->D0pi | |
624 | if(fDstar) { | |
625 | Bool_t testD0=kTRUE; | |
626 | okDstar = tmpCascade->SelectDstar(fDstarCuts,fD0fromDstarCuts,testD0); | |
627 | } | |
628 | tmpCascade->UnsetOwnPrimaryVtx(); | |
629 | tmpCascade->Unset2Prong(); | |
630 | delete tmpCascade; tmpCascade=NULL; | |
631 | if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) { | |
632 | rd2Prong->UnsetOwnPrimaryVtx(); | |
633 | delete primVertexAOD; primVertexAOD=NULL; | |
634 | } | |
635 | //--- | |
636 | ||
637 | return theCascade; | |
638 | } | |
639 | //----------------------------------------------------------------------------- | |
6a213b59 | 640 | AliAODRecoDecayHF2Prong *AliAnalysisVertexingHF::Make2Prong( |
2ff20727 | 641 | TObjArray *twoTrackArray,AliVEvent *event, |
dcb444c9 | 642 | AliAODVertex *secVert,Double_t dca, |
2ff20727 | 643 | Bool_t &okD0,Bool_t &okJPSI, |
644 | Bool_t &okD0fromDstar) const | |
6a213b59 | 645 | { |
646 | // Make 2Prong candidates and check if they pass D0toKpi or BtoJPSI | |
647 | // reconstruction cuts | |
648 | // G.E.Bruno (J/psi), A.Dainese (D0->Kpi) | |
649 | ||
2ff20727 | 650 | okD0=kFALSE; okJPSI=kFALSE; okD0fromDstar=kFALSE; |
6a213b59 | 651 | |
652 | Double_t px[2],py[2],pz[2],d0[2],d0err[2]; | |
6a213b59 | 653 | |
2ff20727 | 654 | AliESDtrack *postrack = (AliESDtrack*)twoTrackArray->UncheckedAt(0); |
655 | AliESDtrack *negtrack = (AliESDtrack*)twoTrackArray->UncheckedAt(1); | |
6a213b59 | 656 | |
657 | // propagate tracks to secondary vertex, to compute inv. mass | |
dcb444c9 | 658 | postrack->PropagateToDCA(secVert,fBzkG,kVeryBig); |
659 | negtrack->PropagateToDCA(secVert,fBzkG,kVeryBig); | |
6a213b59 | 660 | |
661 | Double_t momentum[3]; | |
662 | postrack->GetPxPyPz(momentum); | |
663 | px[0] = momentum[0]; py[0] = momentum[1]; pz[0] = momentum[2]; | |
664 | negtrack->GetPxPyPz(momentum); | |
665 | px[1] = momentum[0]; py[1] = momentum[1]; pz[1] = momentum[2]; | |
666 | ||
667 | ||
668 | // invariant mass cut (try to improve coding here..) | |
669 | Bool_t okMassCut=kFALSE; | |
dcb444c9 | 670 | if(!okMassCut && fD0toKpi) if(SelectInvMass(0,2,px,py,pz)) okMassCut=kTRUE; |
6a213b59 | 671 | if(!okMassCut && fJPSItoEle) if(SelectInvMass(1,2,px,py,pz)) okMassCut=kTRUE; |
2ff20727 | 672 | if(!okMassCut && fDstar) if(SelectInvMass(3,2,px,py,pz)) okMassCut=kTRUE; |
6a213b59 | 673 | if(!okMassCut) { |
dcb444c9 | 674 | AliDebug(2," candidate didn't pass mass cut"); |
6a213b59 | 675 | return 0x0; |
676 | } | |
677 | ||
dcb444c9 | 678 | // primary vertex to be used by this candidate |
2ff20727 | 679 | AliAODVertex *primVertexAOD = PrimaryVertex(twoTrackArray,event); |
dcb444c9 | 680 | if(!primVertexAOD) return 0x0; |
6a213b59 | 681 | |
dcb444c9 | 682 | Double_t d0z0[2],covd0z0[3]; |
683 | postrack->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0,covd0z0); | |
6a213b59 | 684 | d0[0] = d0z0[0]; |
685 | d0err[0] = TMath::Sqrt(covd0z0[0]); | |
dcb444c9 | 686 | negtrack->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0,covd0z0); |
6a213b59 | 687 | d0[1] = d0z0[0]; |
688 | d0err[1] = TMath::Sqrt(covd0z0[0]); | |
689 | ||
690 | // create the object AliAODRecoDecayHF2Prong | |
dcb444c9 | 691 | AliAODRecoDecayHF2Prong *the2Prong = new AliAODRecoDecayHF2Prong(secVert,px,py,pz,d0,d0err,dca); |
6a213b59 | 692 | the2Prong->SetOwnPrimaryVtx(primVertexAOD); |
dcb444c9 | 693 | UShort_t id[2]={(UShort_t)postrack->GetID(),(UShort_t)negtrack->GetID()}; |
694 | the2Prong->SetProngIDs(2,id); | |
6a213b59 | 695 | |
b056c5e3 | 696 | |
6a213b59 | 697 | // select D0->Kpi |
698 | Int_t checkD0,checkD0bar; | |
2ff20727 | 699 | if(fD0toKpi) okD0 = the2Prong->SelectD0(fD0toKpiCuts,checkD0,checkD0bar); |
6a213b59 | 700 | //if(fDebug && fD0toKpi) printf(" %d\n",(Int_t)okD0); |
701 | // select J/psi from B | |
702 | Int_t checkJPSI; | |
2ff20727 | 703 | if(fJPSItoEle) okJPSI = the2Prong->SelectBtoJPSI(fBtoJPSICuts,checkJPSI); |
6a213b59 | 704 | //if(fDebug && fJPSItoEle) printf(" %d\n",(Int_t)okJPSI); |
2ff20727 | 705 | // select D0->Kpi from Dstar |
706 | if(fDstar) okD0fromDstar = the2Prong->SelectD0(fD0fromDstarCuts,checkD0,checkD0bar); | |
707 | //if(fDebug && fDstar) printf(" %d\n",(Int_t)okD0fromDstar); | |
6a213b59 | 708 | |
2ff20727 | 709 | // remove the primary vertex (was used only for selection) |
dcb444c9 | 710 | if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) the2Prong->UnsetOwnPrimaryVtx(); |
6a213b59 | 711 | |
2ff20727 | 712 | // get PID info from ESD |
713 | Double_t esdpid0[5]; | |
714 | postrack->GetESDpid(esdpid0); | |
715 | Double_t esdpid1[5]; | |
716 | negtrack->GetESDpid(esdpid1); | |
717 | Double_t esdpid[10]; | |
718 | for(Int_t i=0;i<5;i++) { | |
719 | esdpid[i] = esdpid0[i]; | |
720 | esdpid[5+i] = esdpid1[i]; | |
6a213b59 | 721 | } |
2ff20727 | 722 | the2Prong->SetPID(2,esdpid); |
6a213b59 | 723 | |
6a213b59 | 724 | return the2Prong; |
725 | } | |
726 | //---------------------------------------------------------------------------- | |
727 | AliAODRecoDecayHF3Prong* AliAnalysisVertexingHF::Make3Prong( | |
dcb444c9 | 728 | TObjArray *threeTrackArray,AliVEvent *event, |
729 | AliAODVertex *secVert,Double_t dispersion, | |
730 | AliAODVertex *vertexp1n1,AliAODVertex *vertexp2n1, | |
6a213b59 | 731 | Double_t dcap1n1,Double_t dcap2n1,Double_t dcap1p2, |
732 | Bool_t &ok3Prong) const | |
733 | { | |
734 | // Make 3Prong candidates and check if they pass Dplus or Ds or Lambdac | |
735 | // reconstruction cuts | |
736 | // E.Bruna, F.Prino | |
737 | ||
dcb444c9 | 738 | |
6a213b59 | 739 | ok3Prong=kFALSE; |
dcb444c9 | 740 | if(!secVert) return 0x0; |
741 | ||
742 | Double_t px[3],py[3],pz[3],d0[3],d0err[3]; | |
743 | Double_t momentum[3]; | |
6a213b59 | 744 | |
6a213b59 | 745 | |
746 | AliESDtrack *postrack1 = (AliESDtrack*)threeTrackArray->UncheckedAt(0); | |
dcb444c9 | 747 | AliESDtrack *negtrack = (AliESDtrack*)threeTrackArray->UncheckedAt(1); |
6a213b59 | 748 | AliESDtrack *postrack2 = (AliESDtrack*)threeTrackArray->UncheckedAt(2); |
749 | ||
dcb444c9 | 750 | postrack1->PropagateToDCA(secVert,fBzkG,kVeryBig); |
751 | negtrack->PropagateToDCA(secVert,fBzkG,kVeryBig); | |
752 | postrack2->PropagateToDCA(secVert,fBzkG,kVeryBig); | |
6a213b59 | 753 | postrack1->GetPxPyPz(momentum); |
754 | px[0] = momentum[0]; py[0] = momentum[1]; pz[0] = momentum[2]; | |
755 | negtrack->GetPxPyPz(momentum); | |
756 | px[1] = momentum[0]; py[1] = momentum[1]; pz[1] = momentum[2]; | |
757 | postrack2->GetPxPyPz(momentum); | |
758 | px[2] = momentum[0]; py[2] = momentum[1]; pz[2] = momentum[2]; | |
759 | ||
b82f6d67 | 760 | // invariant mass cut for D+, Ds, Lc |
6a213b59 | 761 | Bool_t okMassCut=kFALSE; |
762 | if(!okMassCut && f3Prong) if(SelectInvMass(2,3,px,py,pz)) okMassCut=kTRUE; | |
763 | if(!okMassCut) { | |
dcb444c9 | 764 | AliDebug(2," candidate didn't pass mass cut"); |
6a213b59 | 765 | return 0x0; |
766 | } | |
767 | ||
dcb444c9 | 768 | // primary vertex to be used by this candidate |
2ff20727 | 769 | AliAODVertex *primVertexAOD = PrimaryVertex(threeTrackArray,event); |
dcb444c9 | 770 | if(!primVertexAOD) return 0x0; |
771 | ||
772 | Double_t d0z0[2],covd0z0[3]; | |
773 | postrack1->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0,covd0z0); | |
774 | d0[0]=d0z0[0]; | |
775 | d0err[0] = TMath::Sqrt(covd0z0[0]); | |
776 | negtrack->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0,covd0z0); | |
777 | d0[1]=d0z0[0]; | |
778 | d0err[1] = TMath::Sqrt(covd0z0[0]); | |
779 | postrack2->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0,covd0z0); | |
780 | d0[2]=d0z0[0]; | |
781 | d0err[2] = TMath::Sqrt(covd0z0[0]); | |
6a213b59 | 782 | |
6a213b59 | 783 | |
784 | // create the object AliAODRecoDecayHF3Prong | |
dcb444c9 | 785 | Double_t pos[3]; primVertexAOD->GetXYZ(pos); |
6a213b59 | 786 | Double_t dca[3]={dcap1n1,dcap2n1,dcap1p2}; |
dcb444c9 | 787 | Double_t dist12=TMath::Sqrt((vertexp1n1->GetX()-pos[0])*(vertexp1n1->GetX()-pos[0])+(vertexp1n1->GetY()-pos[1])*(vertexp1n1->GetY()-pos[1])+(vertexp1n1->GetZ()-pos[2])*(vertexp1n1->GetZ()-pos[2])); |
788 | Double_t dist23=TMath::Sqrt((vertexp2n1->GetX()-pos[0])*(vertexp2n1->GetX()-pos[0])+(vertexp2n1->GetY()-pos[1])*(vertexp2n1->GetY()-pos[1])+(vertexp2n1->GetZ()-pos[2])*(vertexp2n1->GetZ()-pos[2])); | |
789 | Short_t charge=(Short_t)(postrack1->Charge()*postrack2->Charge()*negtrack->Charge()); | |
790 | AliAODRecoDecayHF3Prong *the3Prong = new AliAODRecoDecayHF3Prong(secVert,px,py,pz,d0,d0err,dca,dispersion,dist12,dist23,charge); | |
6a213b59 | 791 | the3Prong->SetOwnPrimaryVtx(primVertexAOD); |
dcb444c9 | 792 | UShort_t id[3]={(UShort_t)postrack1->GetID(),(UShort_t)negtrack->GetID(),(UShort_t)postrack2->GetID()}; |
793 | the3Prong->SetProngIDs(3,id); | |
6a213b59 | 794 | |
795 | ||
b82f6d67 | 796 | // select D+->Kpipi, Ds->KKpi, Lc->pKpi |
797 | if(f3Prong) { | |
798 | ok3Prong = kFALSE; | |
799 | Int_t ok1,ok2; | |
800 | if(the3Prong->SelectDplus(fDplusCuts)) ok3Prong = kTRUE; | |
801 | if(the3Prong->SelectDs(fDsCuts,ok1,ok2)) ok3Prong = kTRUE; | |
802 | if(the3Prong->SelectLc(fLcCuts,ok1,ok2)) ok3Prong = kTRUE; | |
803 | } | |
6a213b59 | 804 | //if(fDebug) printf("ok3Prong: %d\n",(Int_t)ok3Prong); |
dcb444c9 | 805 | |
806 | if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) the3Prong->UnsetOwnPrimaryVtx(); | |
807 | ||
2ff20727 | 808 | // get PID info from ESD |
809 | Double_t esdpid0[5]; | |
810 | postrack1->GetESDpid(esdpid0); | |
811 | Double_t esdpid1[5]; | |
812 | negtrack->GetESDpid(esdpid1); | |
813 | Double_t esdpid2[5]; | |
814 | postrack2->GetESDpid(esdpid2); | |
815 | ||
816 | Double_t esdpid[15]; | |
817 | for(Int_t i=0;i<5;i++) { | |
818 | esdpid[i] = esdpid0[i]; | |
819 | esdpid[5+i] = esdpid1[i]; | |
820 | esdpid[10+i] = esdpid2[i]; | |
6a213b59 | 821 | } |
2ff20727 | 822 | the3Prong->SetPID(3,esdpid); |
6a213b59 | 823 | |
6a213b59 | 824 | return the3Prong; |
825 | } | |
826 | //---------------------------------------------------------------------------- | |
827 | AliAODRecoDecayHF4Prong* AliAnalysisVertexingHF::Make4Prong( | |
dcb444c9 | 828 | TObjArray *fourTrackArray,AliVEvent *event, |
829 | AliAODVertex *secVert, | |
830 | AliAODVertex *vertexp1n1,AliAODVertex *vertexp2n1, | |
6a213b59 | 831 | Double_t dcap1n1,Double_t dcap1n2,Double_t dcap2n1, |
832 | Bool_t &ok4Prong) const | |
833 | { | |
834 | // Make 4Prong candidates and check if they pass D0toKpipipi | |
835 | // reconstruction cuts | |
836 | // G.E.Bruno, R.Romita | |
837 | ||
838 | ok4Prong=kFALSE; | |
dcb444c9 | 839 | if(!secVert) return 0x0; |
6a213b59 | 840 | |
841 | Double_t px[4],py[4],pz[4],d0[4],d0err[4];//d0z[3]; | |
6a213b59 | 842 | |
b82f6d67 | 843 | px[0]=dcap1n1*dcap1n2*dcap2n1; // TO BE CHANGED (done just to removed compilation warning about dca... not used) |
6a213b59 | 844 | |
6a213b59 | 845 | AliESDtrack *postrack1 = (AliESDtrack*)fourTrackArray->UncheckedAt(0); |
846 | AliESDtrack *negtrack1 = (AliESDtrack*)fourTrackArray->UncheckedAt(1); | |
847 | AliESDtrack *postrack2 = (AliESDtrack*)fourTrackArray->UncheckedAt(2); | |
848 | AliESDtrack *negtrack2 = (AliESDtrack*)fourTrackArray->UncheckedAt(3); | |
849 | ||
dcb444c9 | 850 | postrack1->PropagateToDCA(secVert,fBzkG,kVeryBig); |
851 | negtrack1->PropagateToDCA(secVert,fBzkG,kVeryBig); | |
852 | postrack2->PropagateToDCA(secVert,fBzkG,kVeryBig); | |
853 | negtrack2->PropagateToDCA(secVert,fBzkG,kVeryBig); | |
6a213b59 | 854 | |
855 | Double_t momentum[3]; | |
856 | postrack1->GetPxPyPz(momentum); | |
857 | px[0] = momentum[0]; py[0] = momentum[1]; pz[0] = momentum[2]; | |
858 | negtrack1->GetPxPyPz(momentum); | |
859 | px[1] = momentum[0]; py[1] = momentum[1]; pz[1] = momentum[2]; | |
860 | postrack2->GetPxPyPz(momentum); | |
861 | px[2] = momentum[0]; py[2] = momentum[1]; pz[2] = momentum[2]; | |
862 | negtrack2->GetPxPyPz(momentum); | |
863 | px[3] = momentum[0]; py[3] = momentum[1]; pz[3] = momentum[2]; | |
864 | ||
865 | // invariant mass cut for rho or D0 (try to improve coding here..) | |
866 | //Bool_t okMassCut=kFALSE; | |
867 | //if(!okMassCut) if(SelectInvMass(2,3,px,py,pz)) okMassCut=kTRUE; | |
868 | //if(!okMassCut) { | |
869 | // if(fDebug) printf(" candidate didn't pass mass cut\n"); | |
870 | // return 0x0; | |
871 | //} | |
872 | ||
dcb444c9 | 873 | // primary vertex to be used by this candidate |
2ff20727 | 874 | AliAODVertex *primVertexAOD = PrimaryVertex(fourTrackArray,event); |
dcb444c9 | 875 | if(!primVertexAOD) return 0x0; |
876 | ||
877 | /* | |
878 | Double_t d0z0[2],covd0z0[3]; | |
879 | postrack1->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0,covd0z0); | |
880 | negtrack1->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0,covd0z0); | |
881 | postrack2->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0,covd0z0); | |
882 | negtrack2->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0,covd0z0); | |
883 | */ | |
6a213b59 | 884 | |
885 | // create the object AliAODRecoDecayHF4Prong | |
dcb444c9 | 886 | Double_t pos[3]; primVertexAOD->GetXYZ(pos); |
6a213b59 | 887 | Double_t dca[6]={0.,0.,0.,0.,0.,0.}; // modify it |
dcb444c9 | 888 | Double_t dist12=TMath::Sqrt((vertexp1n1->GetX()-pos[0])*(vertexp1n1->GetX()-pos[0])+(vertexp1n1->GetY()-pos[1])*(vertexp1n1->GetY()-pos[1])+(vertexp1n1->GetZ()-pos[2])*(vertexp1n1->GetZ()-pos[2])); |
889 | Double_t dist23=TMath::Sqrt((vertexp2n1->GetX()-pos[0])*(vertexp2n1->GetX()-pos[0])+(vertexp2n1->GetY()-pos[1])*(vertexp2n1->GetY()-pos[1])+(vertexp2n1->GetZ()-pos[2])*(vertexp2n1->GetZ()-pos[2])); | |
6a213b59 | 890 | Double_t dist14=0.; // to be implemented |
891 | Double_t dist34=0.; // to be implemented | |
dcb444c9 | 892 | Short_t charge=0; |
893 | AliAODRecoDecayHF4Prong *the4Prong = new AliAODRecoDecayHF4Prong(secVert,px,py,pz,d0,d0err,dca,dist12,dist23,dist14,dist34,charge); | |
6a213b59 | 894 | the4Prong->SetOwnPrimaryVtx(primVertexAOD); |
dcb444c9 | 895 | UShort_t id[4]={(UShort_t)postrack1->GetID(),(UShort_t)negtrack1->GetID(),(UShort_t)postrack2->GetID(),(UShort_t)negtrack2->GetID()}; |
896 | the4Prong->SetProngIDs(4,id); | |
6a213b59 | 897 | |
898 | ||
899 | // use the following two lines once AliAODRecoDecayHF4Prong::SelectD0 is available | |
900 | // select D0->Kpipipi | |
901 | //Int_t checkD0,checkD0bar; | |
902 | // ok4Prong=the4Prong->SelectD0(fD04pCuts,checkD0,checkD0bar); | |
903 | ok4Prong=kFALSE; //for the time being ... | |
904 | ||
dcb444c9 | 905 | if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) the4Prong->UnsetOwnPrimaryVtx(); |
6a213b59 | 906 | |
907 | // get PID info from ESD | |
908 | Double_t esdpid0[5]; | |
909 | postrack1->GetESDpid(esdpid0); | |
910 | Double_t esdpid1[5]; | |
911 | negtrack1->GetESDpid(esdpid1); | |
912 | Double_t esdpid2[5]; | |
913 | postrack2->GetESDpid(esdpid2); | |
914 | Double_t esdpid3[5]; | |
915 | negtrack2->GetESDpid(esdpid3); | |
916 | ||
917 | Double_t esdpid[20]; | |
918 | for(Int_t i=0;i<5;i++) { | |
2ff20727 | 919 | esdpid[i] = esdpid0[i]; |
920 | esdpid[5+i] = esdpid1[i]; | |
6a213b59 | 921 | esdpid[10+i] = esdpid2[i]; |
922 | esdpid[15+i] = esdpid3[i]; | |
923 | } | |
924 | the4Prong->SetPID(4,esdpid); | |
925 | ||
6a213b59 | 926 | return the4Prong; |
927 | } | |
928 | //----------------------------------------------------------------------------- | |
2ff20727 | 929 | AliAODVertex* AliAnalysisVertexingHF::PrimaryVertex(TObjArray *trkArray, |
930 | AliVEvent *event) const | |
6a213b59 | 931 | { |
2ff20727 | 932 | // Returns primary vertex to be used for this candidate |
6a213b59 | 933 | |
dcb444c9 | 934 | AliESDVertex *vertexESD = 0; |
935 | AliAODVertex *vertexAOD = 0; | |
936 | ||
dcb444c9 | 937 | |
938 | if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) { | |
939 | // primary vertex from the input event | |
940 | ||
941 | vertexESD = new AliESDVertex(*fV1); | |
942 | ||
943 | } else { | |
944 | // primary vertex specific to this candidate | |
945 | ||
2ff20727 | 946 | Int_t nTrks = trkArray->GetEntriesFast(); |
dcb444c9 | 947 | AliVertexerTracks *vertexer = new AliVertexerTracks(event->GetMagneticField()); |
948 | ||
949 | if(fRecoPrimVtxSkippingTrks) { | |
950 | // recalculating the vertex | |
951 | ||
952 | if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraint")) { | |
953 | Float_t diamondcovxy[3]; | |
954 | event->GetDiamondCovXY(diamondcovxy); | |
955 | Double_t pos[3]={event->GetDiamondX(),event->GetDiamondY(),0.}; | |
956 | Double_t cov[6]={diamondcovxy[0],diamondcovxy[1],diamondcovxy[2],0.,0.,10.}; | |
957 | AliESDVertex *diamond = new AliESDVertex(pos,cov,1.,1); | |
958 | vertexer->SetVtxStart(diamond); | |
959 | delete diamond; diamond=NULL; | |
960 | if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraintOnlyFitter")) | |
961 | vertexer->SetOnlyFitter(); | |
962 | } | |
963 | Int_t skipped[10]; | |
964 | AliESDtrack *t = 0; | |
965 | for(Int_t i=0; i<nTrks; i++) { | |
966 | t = (AliESDtrack*)trkArray->UncheckedAt(i); | |
967 | skipped[i] = (Int_t)t->GetID(); | |
968 | } | |
969 | vertexer->SetSkipTracks(nTrks,skipped); | |
970 | vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(event); | |
971 | ||
972 | } else if(fRmTrksFromPrimVtx) { | |
973 | // removing the prongs tracks | |
974 | ||
975 | TObjArray rmArray(nTrks); | |
976 | UShort_t *rmId = new UShort_t[nTrks]; | |
977 | AliESDtrack *esdTrack = 0; | |
978 | AliESDtrack *t = 0; | |
979 | for(Int_t i=0; i<nTrks; i++) { | |
980 | t = (AliESDtrack*)trkArray->UncheckedAt(i); | |
981 | esdTrack = new AliESDtrack(*t); | |
982 | rmArray.AddLast(esdTrack); | |
2ff20727 | 983 | if(esdTrack->GetID()>=0) { |
984 | rmId[i]=(UShort_t)esdTrack->GetID(); | |
985 | } else { | |
986 | rmId[i]=9999; | |
987 | } | |
dcb444c9 | 988 | } |
989 | Float_t diamondxy[2]={event->GetDiamondX(),event->GetDiamondY()}; | |
990 | vertexESD = vertexer->RemoveTracksFromVertex(fV1,&rmArray,rmId,diamondxy); | |
991 | delete [] rmId; rmId=NULL; | |
992 | rmArray.Delete(); | |
993 | ||
6a213b59 | 994 | } |
6a213b59 | 995 | |
dcb444c9 | 996 | if(!vertexESD) return vertexAOD; |
997 | if(vertexESD->GetNContributors()<=0) { | |
998 | AliDebug(2,"vertexing failed"); | |
999 | delete vertexESD; vertexESD=NULL; | |
1000 | return vertexAOD; | |
6a213b59 | 1001 | } |
dcb444c9 | 1002 | |
1003 | delete vertexer; vertexer=NULL; | |
1004 | ||
6a213b59 | 1005 | } |
1006 | ||
dcb444c9 | 1007 | // convert to AliAODVertex |
1008 | Double_t pos[3],cov[6],chi2perNDF; | |
1009 | vertexESD->GetXYZ(pos); // position | |
1010 | vertexESD->GetCovMatrix(cov); //covariance matrix | |
1011 | chi2perNDF = vertexESD->GetChi2toNDF(); | |
1012 | delete vertexESD; vertexESD=NULL; | |
1013 | ||
1014 | vertexAOD = new AliAODVertex(pos,cov,chi2perNDF); | |
6a213b59 | 1015 | |
dcb444c9 | 1016 | return vertexAOD; |
6a213b59 | 1017 | } |
1018 | //----------------------------------------------------------------------------- | |
1019 | void AliAnalysisVertexingHF::PrintStatus() const { | |
1020 | // Print parameters being used | |
1021 | ||
f8fa4595 | 1022 | //printf("Preselections:\n"); |
1023 | // fTrackFilter->Dump(); | |
4d5c9633 | 1024 | if(fSecVtxWithKF) { |
1025 | printf("Secondary vertex with Kalman filter package (AliKFParticle)\n"); | |
1026 | } else { | |
1027 | printf("Secondary vertex with AliVertexerTracks\n"); | |
1028 | } | |
6a213b59 | 1029 | if(fRecoPrimVtxSkippingTrks) printf("RecoPrimVtxSkippingTrks\n"); |
1030 | if(fRmTrksFromPrimVtx) printf("RmTrksFromPrimVtx\n"); | |
1031 | if(fD0toKpi) { | |
1032 | printf("Reconstruct D0->Kpi candidates with cuts:\n"); | |
1033 | printf(" |M-MD0| [GeV] < %f\n",fD0toKpiCuts[0]); | |
1034 | printf(" dca [cm] < %f\n",fD0toKpiCuts[1]); | |
1035 | printf(" cosThetaStar < %f\n",fD0toKpiCuts[2]); | |
1036 | printf(" pTK [GeV/c] > %f\n",fD0toKpiCuts[3]); | |
1037 | printf(" pTpi [GeV/c] > %f\n",fD0toKpiCuts[4]); | |
1038 | printf(" |d0K| [cm] < %f\n",fD0toKpiCuts[5]); | |
1039 | printf(" |d0pi| [cm] < %f\n",fD0toKpiCuts[6]); | |
1040 | printf(" d0d0 [cm^2] < %f\n",fD0toKpiCuts[7]); | |
1041 | printf(" cosThetaPoint > %f\n",fD0toKpiCuts[8]); | |
1042 | } | |
2ff20727 | 1043 | if(fDstar) { |
1044 | printf(" |M-MD*| [GeV] < %f\n",fDstarCuts[0]); | |
1045 | printf(" |M_Kpipi-M_Kpi-(MD*-MD0)| [GeV] < %f\n",fDstarCuts[1]); | |
1046 | printf(" pTpisoft [GeV/c] > %f\n",fDstarCuts[2]); | |
1047 | printf(" pTpisoft [GeV/c] < %f\n",fDstarCuts[3]); | |
1048 | printf(" Theta(pisoft,D0plane) < %f\n",fDstarCuts[4]); | |
1049 | printf("Reconstruct D*->D0pi candidates with cuts:\n"); | |
1050 | printf(" D0 from D* cuts:\n"); | |
1051 | printf(" |M-MD0| [GeV] < %f\n",fD0fromDstarCuts[0]); | |
1052 | printf(" dca [cm] < %f\n",fD0fromDstarCuts[1]); | |
1053 | printf(" cosThetaStar < %f\n",fD0fromDstarCuts[2]); | |
1054 | printf(" pTK [GeV/c] > %f\n",fD0fromDstarCuts[3]); | |
1055 | printf(" pTpi [GeV/c] > %f\n",fD0fromDstarCuts[4]); | |
1056 | printf(" |d0K| [cm] < %f\n",fD0fromDstarCuts[5]); | |
1057 | printf(" |d0pi| [cm] < %f\n",fD0fromDstarCuts[6]); | |
1058 | printf(" d0d0 [cm^2] < %f\n",fD0fromDstarCuts[7]); | |
1059 | printf(" cosThetaPoint > %f\n",fD0fromDstarCuts[8]); | |
1060 | } | |
6a213b59 | 1061 | if(fJPSItoEle) { |
1062 | printf("Reconstruct J/psi from B candidates with cuts:\n"); | |
1063 | printf(" |M-MJPSI| [GeV] < %f\n",fBtoJPSICuts[0]); | |
1064 | printf(" dca [cm] < %f\n",fBtoJPSICuts[1]); | |
1065 | printf(" cosThetaStar < %f\n",fBtoJPSICuts[2]); | |
1066 | printf(" pTP [GeV/c] > %f\n",fBtoJPSICuts[3]); | |
1067 | printf(" pTN [GeV/c] > %f\n",fBtoJPSICuts[4]); | |
1068 | printf(" |d0P| [cm] < %f\n",fBtoJPSICuts[5]); | |
1069 | printf(" |d0N| [cm] < %f\n",fBtoJPSICuts[6]); | |
1070 | printf(" d0d0 [cm^2] < %f\n",fBtoJPSICuts[7]); | |
1071 | printf(" cosThetaPoint > %f\n",fBtoJPSICuts[8]); | |
1072 | } | |
1073 | if(f3Prong) { | |
1074 | printf("Reconstruct 3 prong candidates.\n"); | |
4d5c9633 | 1075 | printf(" D+->Kpipi cuts:\n"); |
6a213b59 | 1076 | printf(" |M-MD+| [GeV] < %f\n",fDplusCuts[0]); |
1077 | printf(" pTK [GeV/c] > %f\n",fDplusCuts[1]); | |
1078 | printf(" pTPi [GeV/c] > %f\n",fDplusCuts[2]); | |
1079 | printf(" |d0K| [cm] > %f\n",fDplusCuts[3]); | |
1080 | printf(" |d0Pi| [cm] > %f\n",fDplusCuts[4]); | |
1081 | printf(" dist12 [cm] < %f\n",fDplusCuts[5]); | |
1082 | printf(" sigmavert [cm] < %f\n",fDplusCuts[6]); | |
1083 | printf(" dist prim-sec [cm] > %f\n",fDplusCuts[7]); | |
1084 | printf(" pM=Max{pT1,pT2,pT3} [GeV/c] > %f\n",fDplusCuts[8]); | |
1085 | printf(" cosThetaPoint > %f\n",fDplusCuts[9]); | |
1086 | printf(" Sum d0^2 [cm^2] > %f\n",fDplusCuts[10]); | |
1087 | printf(" dca cut [cm] < %f\n",fDplusCuts[11]); | |
4d5c9633 | 1088 | printf(" Ds->KKpi cuts:\n"); |
1089 | printf(" |M-MDs| [GeV] < %f\n",fDsCuts[0]); | |
81679460 | 1090 | printf(" pTK [GeV/c] > %f\n",fDsCuts[1]); |
1091 | printf(" pTPi [GeV/c] > %f\n",fDsCuts[2]); | |
1092 | printf(" |d0K| [cm] > %f\n",fDsCuts[3]); | |
1093 | printf(" |d0Pi| [cm] > %f\n",fDsCuts[4]); | |
1094 | printf(" dist12 [cm] < %f\n",fDsCuts[5]); | |
1095 | printf(" sigmavert [cm] < %f\n",fDsCuts[6]); | |
1096 | printf(" dist prim-sec [cm] > %f\n",fDsCuts[7]); | |
1097 | printf(" pM=Max{pT1,pT2,pT3} [GeV/c] > %f\n",fDsCuts[8]); | |
1098 | printf(" cosThetaPoint > %f\n",fDsCuts[9]); | |
1099 | printf(" Sum d0^2 [cm^2] > %f\n",fDsCuts[10]); | |
1100 | printf(" dca cut [cm] < %f\n",fDsCuts[11]); | |
1101 | printf(" Inv. Mass phi/K0* [GeV] < %f\n",fDsCuts[12]); | |
6ea608bf | 1102 | printf(" Lc->pKpi cuts:\n"); |
1103 | printf(" |M-MLc| [GeV] < %f\n",fLcCuts[0]); | |
81679460 | 1104 | printf(" pTP [GeV/c] > %f\n",fLcCuts[1]); |
1105 | printf(" pTPi and pTK [GeV/c] > %f\n",fLcCuts[2]); | |
1106 | printf(" |d0P| [cm] > %f\n",fLcCuts[3]); | |
1107 | printf(" |d0Pi| and |d0K| [cm] > %f\n",fLcCuts[4]); | |
1108 | printf(" dist12 [cm] < %f\n",fLcCuts[5]); | |
1109 | printf(" sigmavert [cm] < %f\n",fLcCuts[6]); | |
1110 | printf(" dist prim-sec [cm] > %f\n",fLcCuts[7]); | |
1111 | printf(" pM=Max{pT1,pT2,pT3} [GeV/c] > %f\n",fLcCuts[8]); | |
1112 | printf(" cosThetaPoint > %f\n",fLcCuts[9]); | |
1113 | printf(" Sum d0^2 [cm^2] > %f\n",fLcCuts[10]); | |
1114 | printf(" dca cut [cm] < %f\n",fLcCuts[11]); | |
6ea608bf | 1115 | printf(" Ds->KKpi cuts:\n"); |
6a213b59 | 1116 | } |
1117 | ||
1118 | return; | |
1119 | } | |
1120 | //----------------------------------------------------------------------------- | |
dcb444c9 | 1121 | AliAODVertex* AliAnalysisVertexingHF::ReconstructSecondaryVertex(TObjArray *trkArray, |
1122 | Double_t &dispersion) const | |
1123 | { | |
1124 | // Secondary vertex reconstruction with AliVertexerTracks or AliKFParticle | |
1125 | ||
1126 | AliESDVertex *vertexESD = 0; | |
1127 | AliAODVertex *vertexAOD = 0; | |
1128 | ||
1129 | if(!fSecVtxWithKF) { // AliVertexerTracks | |
1130 | ||
1131 | AliVertexerTracks *vertexer = new AliVertexerTracks(fBzkG); | |
1132 | vertexer->SetVtxStart(fV1); | |
1133 | vertexESD = (AliESDVertex*)vertexer->VertexForSelectedESDTracks(trkArray); | |
1134 | delete vertexer; vertexer=NULL; | |
1135 | ||
1136 | if(!vertexESD) return vertexAOD; | |
1137 | ||
1138 | if(vertexESD->GetNContributors()!=trkArray->GetEntriesFast()) { | |
1139 | AliDebug(2,"vertexing failed"); | |
1140 | delete vertexESD; vertexESD=NULL; | |
1141 | return vertexAOD; | |
1142 | } | |
1143 | ||
1144 | } else { // Kalman Filter vertexer (AliKFParticle) | |
1145 | ||
1146 | AliKFParticle::SetField(fBzkG); | |
1147 | ||
a353d2e4 | 1148 | AliKFVertex vertexKF; |
dcb444c9 | 1149 | |
1150 | Int_t nTrks = trkArray->GetEntriesFast(); | |
1151 | for(Int_t i=0; i<nTrks; i++) { | |
1152 | AliESDtrack *esdTrack = (AliESDtrack*)trkArray->At(i); | |
1153 | AliKFParticle daughterKF(*esdTrack,211); | |
1154 | vertexKF.AddDaughter(daughterKF); | |
1155 | } | |
a353d2e4 | 1156 | vertexESD = new AliESDVertex(vertexKF.Parameters(), |
1157 | vertexKF.CovarianceMatrix(), | |
1158 | vertexKF.GetChi2(), | |
1159 | vertexKF.GetNContributors()); | |
dcb444c9 | 1160 | |
1161 | } | |
1162 | ||
1163 | // convert to AliAODVertex | |
1164 | Double_t pos[3],cov[6],chi2perNDF; | |
1165 | vertexESD->GetXYZ(pos); // position | |
1166 | vertexESD->GetCovMatrix(cov); //covariance matrix | |
1167 | chi2perNDF = vertexESD->GetChi2toNDF(); | |
1168 | dispersion = vertexESD->GetDispersion(); | |
1169 | delete vertexESD; vertexESD=NULL; | |
1170 | ||
1171 | vertexAOD = new AliAODVertex(pos,cov,chi2perNDF); | |
1172 | vertexAOD->SetType(AliAODVertex::kUndef); // to be changed | |
1173 | ||
1174 | return vertexAOD; | |
1175 | } | |
1176 | //----------------------------------------------------------------------------- | |
6a213b59 | 1177 | Bool_t AliAnalysisVertexingHF::SelectInvMass(Int_t decay, |
1178 | Int_t nprongs, | |
1179 | Double_t *px, | |
1180 | Double_t *py, | |
1181 | Double_t *pz) const { | |
1182 | // Check invariant mass cut | |
1183 | ||
1184 | Short_t dummycharge=0; | |
1185 | Double_t *dummyd0 = new Double_t[nprongs]; | |
b056c5e3 | 1186 | for(Int_t ip=0;ip<nprongs;ip++) dummyd0[ip]=0.; |
6a213b59 | 1187 | AliAODRecoDecay *rd = new AliAODRecoDecay(0x0,nprongs,dummycharge,px,py,pz,dummyd0); |
1188 | delete [] dummyd0; | |
1189 | ||
1190 | UInt_t pdg2[2],pdg3[3]; | |
1191 | Double_t mPDG,minv; | |
1192 | ||
1193 | Bool_t retval=kFALSE; | |
1194 | switch (decay) | |
1195 | { | |
1196 | case 0: // D0->Kpi | |
1197 | pdg2[0]=211; pdg2[1]=321; | |
1198 | mPDG=TDatabasePDG::Instance()->GetParticle(421)->Mass(); | |
1199 | minv = rd->InvMass(nprongs,pdg2); | |
1200 | if(TMath::Abs(minv-mPDG)<fD0toKpiCuts[0]) retval=kTRUE; | |
1201 | pdg2[0]=321; pdg2[1]=211; | |
1202 | minv = rd->InvMass(nprongs,pdg2); | |
1203 | if(TMath::Abs(minv-mPDG)<fD0toKpiCuts[0]) retval=kTRUE; | |
1204 | break; | |
1205 | case 1: // JPSI->ee | |
1206 | pdg2[0]=11; pdg2[1]=11; | |
1207 | mPDG=TDatabasePDG::Instance()->GetParticle(443)->Mass(); | |
1208 | minv = rd->InvMass(nprongs,pdg2); | |
1209 | if(TMath::Abs(minv-mPDG)<fBtoJPSICuts[0]) retval=kTRUE; | |
1210 | break; | |
1211 | case 2: // D+->Kpipi | |
1212 | pdg3[0]=211; pdg3[1]=321; pdg3[2]=211; | |
1213 | mPDG=TDatabasePDG::Instance()->GetParticle(411)->Mass(); | |
1214 | minv = rd->InvMass(nprongs,pdg3); | |
1215 | if(TMath::Abs(minv-mPDG)<fDplusCuts[0]) retval=kTRUE; | |
b82f6d67 | 1216 | // Ds+->KKpi |
1217 | pdg3[0]=321; pdg3[1]=321; pdg3[2]=211; | |
1218 | mPDG=TDatabasePDG::Instance()->GetParticle(431)->Mass(); | |
1219 | minv = rd->InvMass(nprongs,pdg3); | |
1220 | if(TMath::Abs(minv-mPDG)<fDsCuts[0]) retval=kTRUE; | |
1221 | pdg3[0]=211; pdg3[1]=321; pdg3[2]=321; | |
1222 | minv = rd->InvMass(nprongs,pdg3); | |
1223 | if(TMath::Abs(minv-mPDG)<fDsCuts[0]) retval=kTRUE; | |
1224 | // Lc->pKpi | |
1225 | pdg3[0]=2212; pdg3[1]=321; pdg3[2]=211; | |
1226 | mPDG=TDatabasePDG::Instance()->GetParticle(4122)->Mass(); | |
1227 | minv = rd->InvMass(nprongs,pdg3); | |
1228 | if(TMath::Abs(minv-mPDG)<fLcCuts[0]) retval=kTRUE; | |
1229 | pdg3[0]=211; pdg3[1]=321; pdg3[2]=2212; | |
1230 | minv = rd->InvMass(nprongs,pdg3); | |
1231 | if(TMath::Abs(minv-mPDG)<fLcCuts[0]) retval=kTRUE; | |
6a213b59 | 1232 | break; |
2ff20727 | 1233 | case 3: // D*->D0pi |
1234 | pdg2[0]=421; pdg2[1]=211; | |
1235 | mPDG=TDatabasePDG::Instance()->GetParticle(413)->Mass(); | |
1236 | minv = rd->InvMass(nprongs,pdg2); | |
1237 | if(TMath::Abs(minv-mPDG)<fDstarCuts[0]) retval=kTRUE; | |
1238 | break; | |
6a213b59 | 1239 | default: |
2ff20727 | 1240 | printf("SelectInvMass(): wrong decay selection\n"); |
6a213b59 | 1241 | break; |
1242 | } | |
1243 | ||
1244 | delete rd; | |
1245 | ||
1246 | return retval; | |
1247 | } | |
1248 | //----------------------------------------------------------------------------- | |
dcb444c9 | 1249 | void AliAnalysisVertexingHF::SelectTracksAndCopyVertex(AliVEvent *event, |
2ff20727 | 1250 | TObjArray &seleTrksArray,Int_t &nSeleTrks, |
1251 | UChar_t *seleFlags) | |
6a213b59 | 1252 | { |
2ff20727 | 1253 | // Apply single-track preselection. |
1254 | // Fill a TObjArray with selected tracks (for displaced vertices or | |
1255 | // soft pion from D*). Selection flag stored in seleFlags. | |
dcb444c9 | 1256 | // Create the AliESDVertex object (convert from AliAODVertex if necessary) |
1257 | // In case of AOD input, also fill fAODMap for track index<->ID | |
1258 | ||
1259 | const AliVVertex *vprimary = event->GetPrimaryVertex(); | |
1260 | ||
1261 | if(fV1) { delete fV1; fV1=NULL; } | |
1262 | if(fAODMap) { delete [] fAODMap; fAODMap=NULL; } | |
1263 | ||
1264 | Int_t nindices=0; | |
1265 | UShort_t *indices = 0; | |
1266 | Double_t pos[3],cov[6]; | |
1267 | ||
1268 | if(!fInputAOD) { // ESD | |
1269 | fV1 = new AliESDVertex(*((AliESDVertex*)vprimary)); | |
1270 | } else { // AOD | |
1271 | vprimary->GetXYZ(pos); | |
1272 | vprimary->GetCovarianceMatrix(cov); | |
1273 | fV1 = new AliESDVertex(pos,cov,100.,100,vprimary->GetName()); | |
1274 | indices = new UShort_t[event->GetNumberOfTracks()]; | |
1275 | fAODMap = new Int_t[100000]; | |
1276 | } | |
1277 | ||
1278 | ||
dcb444c9 | 1279 | Int_t entries = (Int_t)event->GetNumberOfTracks(); |
2ff20727 | 1280 | Bool_t okDisplaced=kFALSE,okSoftPi=kFALSE; |
1281 | nSeleTrks=0; | |
6a213b59 | 1282 | |
dcb444c9 | 1283 | // transfer ITS tracks from event to arrays |
6a213b59 | 1284 | for(Int_t i=0; i<entries; i++) { |
dcb444c9 | 1285 | AliVTrack *track = (AliVTrack*)event->GetTrack(i); |
1286 | ||
1287 | if(fInputAOD) { | |
1288 | AliAODTrack *aodt = (AliAODTrack*)track; | |
1289 | if(aodt->GetUsedForPrimVtxFit()) { | |
1290 | indices[nindices]=aodt->GetID(); nindices++; | |
1291 | } | |
1292 | fAODMap[(Int_t)aodt->GetID()] = i; | |
1293 | } | |
6a213b59 | 1294 | |
dcb444c9 | 1295 | AliESDtrack *esdt = 0; |
1296 | if(!fInputAOD) { | |
1297 | esdt = (AliESDtrack*)track; | |
1298 | } else { | |
1299 | esdt = new AliESDtrack(track); | |
1300 | } | |
6a213b59 | 1301 | |
1302 | // single track selection | |
2ff20727 | 1303 | okDisplaced=kFALSE; okSoftPi=kFALSE; |
1304 | if(SingleTrkCuts(esdt,okDisplaced,okSoftPi)) { | |
1305 | seleTrksArray.AddLast(esdt); | |
1306 | seleFlags[nSeleTrks]=0; | |
1307 | if(okDisplaced) SETBIT(seleFlags[nSeleTrks],kBitDispl); | |
1308 | if(okSoftPi) SETBIT(seleFlags[nSeleTrks],kBitSoftPi); | |
1309 | nSeleTrks++; | |
1310 | } else { | |
dcb444c9 | 1311 | if(fInputAOD) delete esdt; |
1312 | esdt = NULL; | |
1313 | continue; | |
2ff20727 | 1314 | } |
6a213b59 | 1315 | |
dcb444c9 | 1316 | } // end loop on tracks |
1317 | ||
1318 | // primary vertex from AOD | |
1319 | if(fInputAOD) { | |
1320 | delete fV1; fV1=NULL; | |
1321 | vprimary->GetXYZ(pos); | |
1322 | vprimary->GetCovarianceMatrix(cov); | |
1323 | Double_t chi2toNDF = vprimary->GetChi2perNDF(); | |
1324 | Int_t ncontr=nindices; | |
a6e0ebfe | 1325 | if(!strcmp(vprimary->GetTitle(),"VertexerTracksWithContraint")) ncontr += 1; |
dcb444c9 | 1326 | Double_t chi2=chi2toNDF*(2.*(Double_t)ncontr-3.); |
1327 | fV1 = new AliESDVertex(pos,cov,chi2,ncontr,vprimary->GetName()); | |
1328 | fV1->SetTitle(vprimary->GetTitle()); | |
1329 | fV1->SetIndices(nindices,indices); | |
1330 | } | |
1331 | if(indices) { delete [] indices; indices=NULL; } | |
1332 | ||
6a213b59 | 1333 | |
1334 | return; | |
1335 | } | |
1336 | //----------------------------------------------------------------------------- | |
1337 | void AliAnalysisVertexingHF::SetD0toKpiCuts(Double_t cut0,Double_t cut1, | |
1338 | Double_t cut2,Double_t cut3,Double_t cut4, | |
1339 | Double_t cut5,Double_t cut6, | |
1340 | Double_t cut7,Double_t cut8) | |
1341 | { | |
1342 | // Set the cuts for D0 selection | |
1343 | fD0toKpiCuts[0] = cut0; | |
1344 | fD0toKpiCuts[1] = cut1; | |
1345 | fD0toKpiCuts[2] = cut2; | |
1346 | fD0toKpiCuts[3] = cut3; | |
1347 | fD0toKpiCuts[4] = cut4; | |
1348 | fD0toKpiCuts[5] = cut5; | |
1349 | fD0toKpiCuts[6] = cut6; | |
1350 | fD0toKpiCuts[7] = cut7; | |
1351 | fD0toKpiCuts[8] = cut8; | |
1352 | ||
1353 | return; | |
1354 | } | |
1355 | //----------------------------------------------------------------------------- | |
1356 | void AliAnalysisVertexingHF::SetD0toKpiCuts(const Double_t cuts[9]) | |
1357 | { | |
1358 | // Set the cuts for D0 selection | |
1359 | ||
1360 | for(Int_t i=0; i<9; i++) fD0toKpiCuts[i] = cuts[i]; | |
1361 | ||
1362 | return; | |
1363 | } | |
1364 | //----------------------------------------------------------------------------- | |
2ff20727 | 1365 | void AliAnalysisVertexingHF::SetD0fromDstarCuts(Double_t cut0,Double_t cut1, |
1366 | Double_t cut2,Double_t cut3,Double_t cut4, | |
1367 | Double_t cut5,Double_t cut6, | |
1368 | Double_t cut7,Double_t cut8) | |
1369 | { | |
1370 | // Set the cuts for D0 from D* selection | |
1371 | fD0fromDstarCuts[0] = cut0; | |
1372 | fD0fromDstarCuts[1] = cut1; | |
1373 | fD0fromDstarCuts[2] = cut2; | |
1374 | fD0fromDstarCuts[3] = cut3; | |
1375 | fD0fromDstarCuts[4] = cut4; | |
1376 | fD0fromDstarCuts[5] = cut5; | |
1377 | fD0fromDstarCuts[6] = cut6; | |
1378 | fD0fromDstarCuts[7] = cut7; | |
1379 | fD0fromDstarCuts[8] = cut8; | |
1380 | ||
1381 | return; | |
1382 | } | |
1383 | //----------------------------------------------------------------------------- | |
1384 | void AliAnalysisVertexingHF::SetD0fromDstarCuts(const Double_t cuts[9]) | |
1385 | { | |
1386 | // Set the cuts for D0 from D* selection | |
1387 | ||
1388 | for(Int_t i=0; i<9; i++) fD0fromDstarCuts[i] = cuts[i]; | |
1389 | ||
1390 | return; | |
1391 | } | |
1392 | //----------------------------------------------------------------------------- | |
1393 | void AliAnalysisVertexingHF::SetDstarCuts(Double_t cut0,Double_t cut1, | |
1394 | Double_t cut2,Double_t cut3, | |
1395 | Double_t cut4) | |
1396 | { | |
1397 | // Set the cuts for D* selection | |
1398 | fDstarCuts[0] = cut0; | |
1399 | fDstarCuts[1] = cut1; | |
1400 | fDstarCuts[2] = cut2; | |
1401 | fDstarCuts[3] = cut3; | |
1402 | fDstarCuts[4] = cut4; | |
1403 | ||
1404 | return; | |
1405 | } | |
1406 | //----------------------------------------------------------------------------- | |
1407 | void AliAnalysisVertexingHF::SetDstarCuts(const Double_t cuts[5]) | |
1408 | { | |
1409 | // Set the cuts for D* selection | |
1410 | ||
1411 | for(Int_t i=0; i<5; i++) fDstarCuts[i] = cuts[i]; | |
1412 | ||
1413 | return; | |
1414 | } | |
1415 | //----------------------------------------------------------------------------- | |
6a213b59 | 1416 | void AliAnalysisVertexingHF::SetBtoJPSICuts(Double_t cut0,Double_t cut1, |
1417 | Double_t cut2,Double_t cut3,Double_t cut4, | |
1418 | Double_t cut5,Double_t cut6, | |
1419 | Double_t cut7,Double_t cut8) | |
1420 | { | |
1421 | // Set the cuts for J/psi from B selection | |
1422 | fBtoJPSICuts[0] = cut0; | |
1423 | fBtoJPSICuts[1] = cut1; | |
1424 | fBtoJPSICuts[2] = cut2; | |
1425 | fBtoJPSICuts[3] = cut3; | |
1426 | fBtoJPSICuts[4] = cut4; | |
1427 | fBtoJPSICuts[5] = cut5; | |
1428 | fBtoJPSICuts[6] = cut6; | |
1429 | fBtoJPSICuts[7] = cut7; | |
1430 | fBtoJPSICuts[8] = cut8; | |
1431 | ||
1432 | return; | |
1433 | } | |
1434 | //----------------------------------------------------------------------------- | |
1435 | void AliAnalysisVertexingHF::SetBtoJPSICuts(const Double_t cuts[9]) | |
1436 | { | |
1437 | // Set the cuts for J/psi from B selection | |
1438 | ||
1439 | for(Int_t i=0; i<9; i++) fBtoJPSICuts[i] = cuts[i]; | |
1440 | ||
1441 | return; | |
1442 | } | |
1443 | //----------------------------------------------------------------------------- | |
1444 | void AliAnalysisVertexingHF::SetDplusCuts(Double_t cut0,Double_t cut1, | |
1445 | Double_t cut2,Double_t cut3,Double_t cut4, | |
1446 | Double_t cut5,Double_t cut6, | |
1447 | Double_t cut7,Double_t cut8, | |
1448 | Double_t cut9,Double_t cut10,Double_t cut11) | |
1449 | { | |
1450 | // Set the cuts for Dplus->Kpipi selection | |
1451 | fDplusCuts[0] = cut0; | |
1452 | fDplusCuts[1] = cut1; | |
1453 | fDplusCuts[2] = cut2; | |
1454 | fDplusCuts[3] = cut3; | |
1455 | fDplusCuts[4] = cut4; | |
1456 | fDplusCuts[5] = cut5; | |
1457 | fDplusCuts[6] = cut6; | |
1458 | fDplusCuts[7] = cut7; | |
1459 | fDplusCuts[8] = cut8; | |
1460 | fDplusCuts[9] = cut9; | |
1461 | fDplusCuts[10] = cut10; | |
1462 | fDplusCuts[11] = cut11; | |
1463 | ||
1464 | return; | |
1465 | } | |
1466 | //----------------------------------------------------------------------------- | |
1467 | void AliAnalysisVertexingHF::SetDplusCuts(const Double_t cuts[12]) | |
1468 | { | |
b82f6d67 | 1469 | // Set the cuts for Dplus->Kpipi selection |
6a213b59 | 1470 | |
1471 | for(Int_t i=0; i<12; i++) fDplusCuts[i] = cuts[i]; | |
1472 | ||
1473 | return; | |
1474 | } | |
1475 | //----------------------------------------------------------------------------- | |
6ea608bf | 1476 | void AliAnalysisVertexingHF::SetDsCuts(Double_t cut0,Double_t cut1, |
1477 | Double_t cut2,Double_t cut3,Double_t cut4, | |
1478 | Double_t cut5,Double_t cut6, | |
1479 | Double_t cut7,Double_t cut8, | |
81679460 | 1480 | Double_t cut9,Double_t cut10, |
1481 | Double_t cut11,Double_t cut12) | |
b82f6d67 | 1482 | { |
1483 | // Set the cuts for Ds->KKpi selection | |
1484 | fDsCuts[0] = cut0; | |
6ea608bf | 1485 | fDsCuts[1] = cut1; |
1486 | fDsCuts[2] = cut2; | |
1487 | fDsCuts[3] = cut3; | |
1488 | fDsCuts[4] = cut4; | |
1489 | fDsCuts[5] = cut5; | |
1490 | fDsCuts[6] = cut6; | |
1491 | fDsCuts[7] = cut7; | |
1492 | fDsCuts[8] = cut8; | |
1493 | fDsCuts[9] = cut9; | |
1494 | fDsCuts[10] = cut10; | |
1495 | fDsCuts[11] = cut11; | |
81679460 | 1496 | fDsCuts[12] = cut12; |
b82f6d67 | 1497 | |
1498 | return; | |
1499 | } | |
1500 | //----------------------------------------------------------------------------- | |
81679460 | 1501 | void AliAnalysisVertexingHF::SetDsCuts(const Double_t cuts[13]) |
b82f6d67 | 1502 | { |
1503 | // Set the cuts for Ds->KKpi selection | |
1504 | ||
81679460 | 1505 | for(Int_t i=0; i<13; i++) fDsCuts[i] = cuts[i]; |
b82f6d67 | 1506 | |
1507 | return; | |
1508 | } | |
1509 | //----------------------------------------------------------------------------- | |
6ea608bf | 1510 | void AliAnalysisVertexingHF::SetLcCuts(Double_t cut0,Double_t cut1, |
1511 | Double_t cut2,Double_t cut3,Double_t cut4, | |
1512 | Double_t cut5,Double_t cut6, | |
1513 | Double_t cut7,Double_t cut8, | |
1514 | Double_t cut9,Double_t cut10,Double_t cut11) | |
b82f6d67 | 1515 | { |
1516 | // Set the cuts for Lc->pKpi selection | |
1517 | fLcCuts[0] = cut0; | |
6ea608bf | 1518 | fLcCuts[1] = cut1; |
1519 | fLcCuts[2] = cut2; | |
1520 | fLcCuts[3] = cut3; | |
1521 | fLcCuts[4] = cut4; | |
1522 | fLcCuts[5] = cut5; | |
1523 | fLcCuts[6] = cut6; | |
1524 | fLcCuts[7] = cut7; | |
1525 | fLcCuts[8] = cut8; | |
1526 | fLcCuts[9] = cut9; | |
1527 | fLcCuts[10] = cut10; | |
1528 | fLcCuts[11] = cut11; | |
b82f6d67 | 1529 | |
1530 | return; | |
1531 | } | |
1532 | //----------------------------------------------------------------------------- | |
6ea608bf | 1533 | void AliAnalysisVertexingHF::SetLcCuts(const Double_t cuts[12]) |
b82f6d67 | 1534 | { |
1535 | // Set the cuts for Lc->pKpi selection | |
1536 | ||
6ea608bf | 1537 | for(Int_t i=0; i<12; i++) fLcCuts[i] = cuts[i]; |
b82f6d67 | 1538 | |
1539 | return; | |
1540 | } | |
1541 | //----------------------------------------------------------------------------- | |
2ff20727 | 1542 | Bool_t AliAnalysisVertexingHF::SingleTrkCuts(AliESDtrack *trk, |
1543 | Bool_t &okDisplaced,Bool_t &okSoftPi) const | |
6a213b59 | 1544 | { |
1545 | // Check if track passes some kinematical cuts | |
6a213b59 | 1546 | |
f8fa4595 | 1547 | // this is needed to store the impact parameters |
1548 | trk->RelateToVertex(fV1,fBzkG,kVeryBig); | |
1549 | ||
2ff20727 | 1550 | UInt_t selectInfo; |
f8fa4595 | 1551 | // |
2ff20727 | 1552 | // Track selection, displaced tracks |
1553 | selectInfo = 0; | |
f8fa4595 | 1554 | if(fTrackFilter) { |
1555 | selectInfo = fTrackFilter->IsSelected(trk); | |
6a213b59 | 1556 | } |
2ff20727 | 1557 | if(selectInfo) okDisplaced=kTRUE; |
1558 | // Track selection, soft pions | |
1559 | selectInfo = 0; | |
1560 | if(fDstar && fTrackFilterSoftPi) { | |
1561 | selectInfo = fTrackFilterSoftPi->IsSelected(trk); | |
1562 | } | |
1563 | if(selectInfo) okSoftPi=kTRUE; | |
6a213b59 | 1564 | |
2ff20727 | 1565 | if(okDisplaced || okSoftPi) return kTRUE; |
f8fa4595 | 1566 | |
2ff20727 | 1567 | return kFALSE; |
6a213b59 | 1568 | } |
1569 | //----------------------------------------------------------------------------- |