1 /**************************************************************************
2 * Copyright(c) 1998-2008, 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 /////////////////////////////////////////////////////////////
18 // AliAnalysisTaskSE for RecoDecay object (K0 short, Lambda,
19 // D mesons ...) filtering
21 // Author: X-M. Zhang, xmzhang@lbl.gov
22 /////////////////////////////////////////////////////////////
29 #include <THnSparse.h>
31 #include <TClonesArray.h>
32 #include <TDatabasePDG.h>
33 #include <TParticle.h>
35 #include "AliAODEvent.h"
36 #include "AliESDEvent.h"
37 #include "AliMCEvent.h"
39 #include "AliVVertex.h"
42 #include "AliAODTrack.h"
43 #include "AliESDtrack.h"
45 #include "AliMCParticle.h"
46 #include "AliAODMCParticle.h"
47 #include "AliHeader.h"
48 #include "AliGenDPMjetEventHeader.h"
49 #include "AliV0vertexer.h"
50 #include "AliAnalysisUtils.h"
51 #include "AliInputEventHandler.h"
52 #include "AliCentrality.h"
53 #include "AliPIDResponse.h"
55 #include "AliPicoHeaderCJ.h"
56 #include "AliPicoV0MC.h"
57 #include "AliAnalysisTaskSEPicoV0MakerMC.h"
59 ClassImp(AliAnalysisTaskSEPicoV0MakerMC)
60 //=============================================================================
62 const Double_t AliAnalysisTaskSEPicoV0MakerMC::fgkMassPion = 0.13957;
63 const Double_t AliAnalysisTaskSEPicoV0MakerMC::fgkMassKshort = 0.497614;
64 const Double_t AliAnalysisTaskSEPicoV0MakerMC::fgkMassProton = 0.938272;
65 const Double_t AliAnalysisTaskSEPicoV0MakerMC::fgkMassLambda = 1.11568;
67 //_____________________________________________________________________________
68 AliAnalysisTaskSEPicoV0MakerMC::AliAnalysisTaskSEPicoV0MakerMC() :
79 fIsRefitV0sESD(kFALSE),
80 fIsSkipFastOnly(kFALSE),
82 fCutMinEventVtxContr(0),
83 fCutMaxEventVzAbs(0.),
95 fCutMinDauDCAtoPV(0.),
96 fCutMinDauXrowsTPC(0.),
97 fCutMinDauXrowsOverFindableClusTPC(0.),
98 fCutMaxKshortSigmaTPC(0.),
99 fCutMinKshortCosPA(0.),
100 fCutMaxKshortCtau(0.),
101 fCutMaxKshortArmFrac(0.),
102 fCutMinKshortDeltaM(0.),
103 fCutMaxLambdaSigmaTPC(0.),
104 fCutMinLambdaCosPA(0.),
105 fCutMaxLambdaCtau(0.),
106 fCutMaxLambdaArmFrac(0.),
107 fCutMinLambdaDeletaM(0.),
112 // Default constructor
115 for (Int_t i=3; i--;) fPrimaryVtx[i] = 0.;
118 //_____________________________________________________________________________
119 AliAnalysisTaskSEPicoV0MakerMC::AliAnalysisTaskSEPicoV0MakerMC(const char *name) :
120 AliAnalysisTaskSE(name),
128 fCollisionType(AliPicoHeaderCJ::kPP),
130 fIsRefitV0sESD(kFALSE),
131 fIsSkipFastOnly(kFALSE),
133 fCutMinEventVtxContr(2),
134 fCutMaxEventVzAbs(10.),
143 fCutMinV0Radius(0.5),
144 fCutMaxV0Radius(200.),
146 fCutMinDauDCAtoPV(0.06),
147 fCutMinDauXrowsTPC(70.),
148 fCutMinDauXrowsOverFindableClusTPC(0.8),
149 fCutMaxKshortSigmaTPC(5.),
150 fCutMinKshortCosPA(0.97),
151 fCutMaxKshortCtau(20.),
152 fCutMaxKshortArmFrac(-1.),
153 fCutMinKshortDeltaM(0.005),
154 fCutMaxLambdaSigmaTPC(5.),
155 fCutMinLambdaCosPA(0.995),
156 fCutMaxLambdaCtau(30.),
157 fCutMaxLambdaArmFrac(-1.),
158 fCutMinLambdaDeletaM(0.01),
166 for (Int_t i=3; i--;) fPrimaryVtx[i] = 0.;
168 DefineOutput(1, TList::Class());
171 //_____________________________________________________________________________
172 AliAnalysisTaskSEPicoV0MakerMC::~AliAnalysisTaskSEPicoV0MakerMC()
175 // Default destructor
178 if (fEventAOD) { delete fEventAOD; fEventAOD = 0; }
179 if (fEventESD) { delete fEventESD; fEventESD = 0; }
180 if (fCentInfo) { delete fCentInfo; fCentInfo = 0; }
181 if (fRespoPID) { delete fRespoPID; fRespoPID = 0; }
182 if (fAnaUtils) { delete fAnaUtils; fAnaUtils = 0; }
184 if (fPicoV0sClArr) { delete fPicoV0sClArr; fPicoV0sClArr = 0; }
185 if (fListUserOutputs) { delete fListUserOutputs; fListUserOutputs = 0; }
188 //_____________________________________________________________________________
189 void AliAnalysisTaskSEPicoV0MakerMC::Init()
192 // AliAnalysisTaskSEPicoV0MakerMC::Init
198 //_____________________________________________________________________________
199 void AliAnalysisTaskSEPicoV0MakerMC::UserCreateOutputObjects()
202 // AliAnalysisTaskSEPicoV0MakerMC::UserCreateOutputObjects
206 //=============================================================================
208 fPicoV0sClArr = new TClonesArray("AliPicoV0MC");
209 fPicoV0sClArr->SetName("PicoV0s");
210 //=============================================================================
212 fListUserOutputs = new TList();
213 fListUserOutputs->SetOwner();
216 PostData(1, fListUserOutputs);
220 //_____________________________________________________________________________
221 void AliAnalysisTaskSEPicoV0MakerMC::UserExec(Option_t */*opt*/)
224 // AliAnalysisTaskSEPicoV0MakerMC::UserExec
227 fPicoV0sClArr->Delete();
228 if (IsEventNotAcpt()) return;
229 if (!(InputEvent()->FindListObject("PicoV0s"))) InputEvent()->AddObject(fPicoV0sClArr);
230 //=============================================================================
232 FillHistograms(); if (IsEventNotMBsa()) return;
233 //=============================================================================
239 //_____________________________________________________________________________
240 void AliAnalysisTaskSEPicoV0MakerMC::Terminate(Option_t */*opt*/)
243 // AliAnalysisTaskSEPicoV0MakerMC::Terminate
249 //_____________________________________________________________________________
250 void AliAnalysisTaskSEPicoV0MakerMC::NotifyRun()
253 // AliAnalysisTaskSEPicoV0MakerMC::NotifyRun
259 //_____________________________________________________________________________
260 void AliAnalysisTaskSEPicoV0MakerMC::FillPicoV0s()
263 // AliAnalysisTaskSEPicoV0MakerMC::FillPicoRecoV0s
267 AliAODv0 *pV0AOD = 0;
268 AliESDv0 *pV0ESD = 0;
269 if (fEventAOD) nV0s = fEventAOD->GetNumberOfV0s();
270 if (fEventESD) nV0s = fEventESD->GetNumberOfV0s();
272 //=============================================================================
274 TH2D *hKshortPtInvM = dynamic_cast<TH2D*>(fListUserOutputs->FindObject("hKshortPtInvM"));
275 TH2D *hLambdaPtInvM = dynamic_cast<TH2D*>(fListUserOutputs->FindObject("hLambdaPtInvM"));
276 TH2D *hAntiLaPtInvM = dynamic_cast<TH2D*>(fListUserOutputs->FindObject("hAntiLaPtInvM"));
277 //=============================================================================
279 AliPicoV0MC *pV0 = 0;
280 Int_t nAt = fPicoV0sClArr->GetEntriesFast();
282 for (Int_t iV0=0; iV0<nV0s; iV0++) {
285 pV0AOD = fEventAOD->GetV0(iV0); if (!pV0AOD) continue;
286 pV0 = SelectV0Candidate(pV0AOD); if (!pV0) { pV0AOD = 0; continue; }
290 pV0ESD = fEventESD->GetV0(iV0); if (!pV0ESD) continue;
291 pV0 = SelectV0Candidate(pV0ESD); if (!pV0) { pV0ESD = 0; continue; }
294 pV0->FillKshortPtInvM(hKshortPtInvM);
295 pV0->FillLambdaPtInvM(hLambdaPtInvM);
296 pV0->FillAntiLaPtInvM(hAntiLaPtInvM);
297 new ((*fPicoV0sClArr)[nAt++]) AliPicoV0MC(*pV0);
300 if (pV0AOD) pV0AOD=0;
301 if (pV0ESD) pV0ESD=0;
307 //_____________________________________________________________________________
308 AliPicoV0MC* AliAnalysisTaskSEPicoV0MakerMC::SelectV0Candidate(AliAODv0 const *pV0RD)
311 // AliAnalysisTaskSEPicoV0MakerMC::SelectV0Candidate
314 if (pV0RD->GetOnFlyStatus()) return 0x0;
315 if ((pV0RD->Chi2V0())>fCutMaxV0Chi2) return 0x0;
317 Double_t dV0Pt = pV0RD->Pt(); if ((dV0Pt<fCutMinV0Pt) || (dV0Pt>fCutMaxV0Pt)) return 0x0;
318 //=============================================================================
320 Double_t dV0Vtx[3]; pV0RD->GetXYZ(dV0Vtx);
321 Double_t dV0Radius = TMath::Sqrt(dV0Vtx[0]*dV0Vtx[0] + dV0Vtx[1]*dV0Vtx[1]);
322 if ((dV0Radius<fCutMinV0Radius) || (dV0Radius>fCutMaxV0Radius)) return 0x0;
324 Double_t dDausDCA = pV0RD->DcaV0Daughters(); if (dDausDCA>fCutMaxDausDCA) return 0x0;
325 Double_t dPosDCAtoPV = pV0RD->DcaPosToPrimVertex(); if (dPosDCAtoPV<fCutMinDauDCAtoPV) return 0x0;
326 Double_t dNegDCAtoPV = pV0RD->DcaNegToPrimVertex(); if (dNegDCAtoPV<fCutMinDauDCAtoPV) return 0x0;
327 //=============================================================================
329 AliAODTrack *pDauPosRD = (AliAODTrack*)pV0RD->GetDaughter(0); if (!pDauPosRD) return 0x0;
330 AliAODTrack *pDauNegRD = (AliAODTrack*)pV0RD->GetDaughter(1); if (!pDauNegRD) return 0x0;
332 if (!(pDauPosRD->GetStatus() & AliESDtrack::kTPCrefit)) return 0x0;
333 if (!(pDauNegRD->GetStatus() & AliESDtrack::kTPCrefit)) return 0x0;
335 if ((pDauPosRD->GetProdVertex()->GetType())==((Char_t)AliAODVertex::kKink)) return 0x0;
336 if ((pDauNegRD->GetProdVertex()->GetType())==((Char_t)AliAODVertex::kKink)) return 0x0;
338 Float_t dPosXrowsTPC = pDauPosRD->GetTPCClusterInfo(2,1);
339 Float_t dNegXrowsTPC = pDauNegRD->GetTPCClusterInfo(2,1);
340 Float_t dDauXrowsTPC = dPosXrowsTPC; if (dDauXrowsTPC>dNegXrowsTPC) dDauXrowsTPC = dNegXrowsTPC;
341 if (dDauXrowsTPC<fCutMinDauXrowsTPC) return 0x0;
343 UShort_t wPosTPCNClsF = pDauPosRD->GetTPCNclsF(); if (wPosTPCNClsF<=0) return 0x0;
344 UShort_t wNegTPCNClsF = pDauNegRD->GetTPCNclsF(); if (wNegTPCNClsF<=0) return 0x0;
345 Double_t dPosXrowsOverFindableClusTPC = ((Double_t)dPosXrowsTPC) / ((Double_t)wPosTPCNClsF);
346 Double_t dNegXrowsOverFindableClusTPC = ((Double_t)dNegXrowsTPC) / ((Double_t)wNegTPCNClsF);
348 Double_t dDauXrowsOverFindableClusTPC = dPosXrowsOverFindableClusTPC;
349 if (dDauXrowsOverFindableClusTPC>dNegXrowsOverFindableClusTPC) dDauXrowsOverFindableClusTPC = dNegXrowsOverFindableClusTPC;
350 if (dDauXrowsOverFindableClusTPC<fCutMinDauXrowsOverFindableClusTPC) return 0x0;
351 //=============================================================================
353 Short_t nPosCharge = pDauPosRD->Charge();
354 Short_t nNegCharge = pDauNegRD->Charge();
355 if ((nPosCharge==0) || (nNegCharge==0) || (nPosCharge==nNegCharge)) return 0x0;
357 Double_t dPosPxPyPz[3] = { 0., 0., 0. };
358 Double_t dNegPxPyPz[3] = { 0., 0., 0. };
359 if ((nPosCharge<0) && (nNegCharge>0)) {
360 pDauPosRD = (AliAODTrack*)pV0RD->GetDaughter(1);
361 pDauNegRD = (AliAODTrack*)pV0RD->GetDaughter(0);
363 dPosPxPyPz[0] = pV0RD->MomNegX(); dPosPxPyPz[1] = pV0RD->MomNegY(); dPosPxPyPz[2] = pV0RD->MomNegZ();
364 dNegPxPyPz[0] = pV0RD->MomPosX(); dNegPxPyPz[1] = pV0RD->MomPosY(); dNegPxPyPz[2] = pV0RD->MomPosZ();
366 dPosPxPyPz[0] = pV0RD->MomPosX(); dPosPxPyPz[1] = pV0RD->MomPosY(); dPosPxPyPz[2] = pV0RD->MomPosZ();
367 dNegPxPyPz[0] = pV0RD->MomNegX(); dNegPxPyPz[1] = pV0RD->MomNegY(); dNegPxPyPz[2] = pV0RD->MomNegZ();
370 TVector3 v3Pos(dPosPxPyPz);
371 TVector3 v3Neg(dNegPxPyPz);
373 if ((v3Pos.Pt()<fCutMinDauPt) || (v3Neg.Pt()<fCutMinDauPt)) return 0x0;
374 Double_t dPosEta = v3Pos.Eta(); if ((dPosEta<fCutMinDauEta) || (dPosEta>fCutMaxDauEta)) return 0x0;
375 Double_t dNegEta = v3Neg.Eta(); if ((dNegEta<fCutMinDauEta) || (dNegEta>fCutMaxDauEta)) return 0x0;
376 //=============================================================================
378 Int_t inp = TMath::Abs(pDauPosRD->GetLabel()); if (inp<0) return 0x0;
379 Int_t inn = TMath::Abs(pDauNegRD->GetLabel()); if (inn<0) return 0x0;
380 AliAODMCParticle *pDauPosMC = (AliAODMCParticle*)MCEvent()->GetTrack(inp); if (!pDauPosMC) return 0x0;
381 AliAODMCParticle *pDauNegMC = (AliAODMCParticle*)MCEvent()->GetTrack(inn); if (!pDauNegMC) return 0x0;
383 Int_t imp = pDauPosMC->GetMother(); if (imp<0) return 0x0;
384 Int_t imn = pDauNegMC->GetMother(); if (imn<0) return 0x0;
385 if (imp != imn) return 0x0;
387 AliAODMCParticle *pV0MC = (AliAODMCParticle*)MCEvent()->GetTrack(imp); if (!pV0MC) return 0x0;
388 if (((pV0MC->Y())<fCutMinV0Rap) || ((pV0MC->Y())>fCutMaxV0Rap)) return 0x0;
390 Int_t idvMC = pV0MC->GetPdgCode();
391 Int_t idp = pDauPosMC->GetPdgCode();
392 Int_t idn = pDauNegMC->GetPdgCode();
393 Bool_t bIsKshort = ((idp==211) && (idn==-211) && (idvMC== 310));
394 Bool_t bIsLambda = ((idp==2212) && (idn==-211) && (idvMC== 3122));
395 Bool_t bIsAntiLa = ((idp==211) && (idn==-2212) && (idvMC==-3122));
396 if (!(bIsKshort || bIsLambda || bIsAntiLa)) return 0x0;
397 //=============================================================================
400 if (pV0MC->IsPrimary()) wsvMC |= AliPicoHeaderCJ::kPrimary;
401 if (pV0MC->IsPhysicalPrimary()) wsvMC |= AliPicoHeaderCJ::kPhysicalPrimary;
402 if (pV0MC->IsSecondaryFromWeakDecay()) wsvMC |= AliPicoHeaderCJ::kSecondaryFromWeakDecay;
403 if (pV0MC->IsSecondaryFromMaterial()) wsvMC |= AliPicoHeaderCJ::kSecondaryFromMaterial;
407 Double_t dMotherPt = 0.;
408 Double_t dMotherEta = 0.;
409 Double_t dMotherRap = 0.;
410 if (bIsLambda || bIsAntiLa) {
411 Int_t imv = pV0MC->GetMother(); if (imv>=0) {
412 AliAODMCParticle *pMother = (AliAODMCParticle*)MCEvent()->GetTrack(imv);
415 idmMC = pMother->GetPdgCode();
416 if ((bIsLambda && ((idmMC== 3312) || (idmMC== 3322))) ||
417 (bIsAntiLa && ((idmMC==-3312) || (idmMC==-3322)))) {
418 dMotherPt = pMother->Pt();
419 dMotherEta = pMother->Eta();
420 dMotherRap = pMother->Y();
422 if (pMother->IsPrimary()) wsmMC |= AliPicoHeaderCJ::kPrimary;
423 if (pMother->IsPhysicalPrimary()) wsmMC |= AliPicoHeaderCJ::kPhysicalPrimary;
424 if (pMother->IsSecondaryFromWeakDecay()) wsmMC |= AliPicoHeaderCJ::kSecondaryFromWeakDecay;
425 if (pMother->IsSecondaryFromMaterial()) wsmMC |= AliPicoHeaderCJ::kSecondaryFromMaterial;
430 //=============================================================================
432 Double_t dV0CosPA = pV0RD->CosPointingAngle(fPrimaryVtx);
434 if (bIsKshort) if (dV0CosPA<fCutMinKshortCosPA) {
438 if (bIsLambda || bIsAntiLa) if (dV0CosPA<fCutMinLambdaCosPA) {
443 if (!(bIsKshort || bIsLambda || bIsAntiLa)) return 0x0;
444 //=============================================================================
446 Double_t dV0DistToPV = 0.;
447 for (Int_t i=0; i<3; i++) dV0DistToPV += ((dV0Vtx[i]-fPrimaryVtx[i]) * (dV0Vtx[i]-fPrimaryVtx[i]));
448 Double_t dV0DistToPVoverP = TMath::Sqrt(dV0DistToPV) / (pV0RD->P()+1e-10);
450 if (bIsKshort) if ((dV0DistToPVoverP*fgkMassKshort)>fCutMaxKshortCtau) {
454 if (bIsLambda || bIsAntiLa) if ((dV0DistToPVoverP*fgkMassLambda)>fCutMaxLambdaCtau) {
459 if (!(bIsKshort || bIsLambda || bIsAntiLa)) return 0x0;
460 //=============================================================================
462 Double_t dV0ArmFrac = pV0RD->PtArmV0() / (TMath::Abs(pV0RD->AlphaV0())+1e-12);
464 if (bIsKshort && (fCutMaxKshortArmFrac>0.)) if (dV0ArmFrac>fCutMaxKshortArmFrac) {
468 if ((bIsLambda || bIsAntiLa) && fCutMaxLambdaArmFrac>0.) if (dV0ArmFrac>fCutMaxLambdaArmFrac) {
473 if (!(bIsKshort || bIsLambda || bIsAntiLa)) return 0x0;
474 //=============================================================================
478 TLorentzVector vPosPion; vPosPion.SetVectM(v3Pos, fgkMassPion);
479 TLorentzVector vNegPion; vNegPion.SetVectM(v3Neg, fgkMassPion);
480 TLorentzVector vKshort = vPosPion + vNegPion;
482 Double_t dKshortInvM = vKshort.M();
483 Double_t dLower = 0.430006 - 0.0110029*dV0Pt;
484 Double_t dUpper = 0.563707 + 0.0114979*dV0Pt;
485 if ((dKshortInvM<dLower) || (dKshortInvM>dUpper)) return 0x0;
487 if (fCutMinKshortDeltaM>0.) {
488 TLorentzVector vPosProton; vPosProton.SetVectM(v3Pos, fgkMassProton);
489 TLorentzVector vNegProton; vNegProton.SetVectM(v3Neg, fgkMassProton);
491 TLorentzVector vLamvda = vPosProton + vNegPion;
492 TLorentzVector vAntiLa = vNegProton + vPosPion;
494 Double_t dLambdaInvM = vLamvda.M();
495 Double_t dAntiLaInvM = vAntiLa.M();
496 if ((TMath::Abs(dLambdaInvM-fgkMassLambda)<fCutMinKshortDeltaM) ||
497 (TMath::Abs(dAntiLaInvM-fgkMassLambda)<fCutMinKshortDeltaM)) return 0x0;
500 wMask = AliPicoHeaderCJ::kKshort;
504 TLorentzVector vPosProton; vPosProton.SetVectM(v3Pos, fgkMassProton);
505 TLorentzVector vNegPion; vNegPion.SetVectM(v3Neg, fgkMassPion);
506 TLorentzVector vLamvda = vPosProton + vNegPion;
508 Double_t dLambdaInvM = vLamvda.M();
509 Double_t dLower = 1.09501 - 0.00523272*dV0Pt - 0.075269*TMath::Exp(-3.46339*dV0Pt);
510 Double_t dUpper = 1.13688 + 0.00527838*dV0Pt + 0.084222*TMath::Exp(-3.80595*dV0Pt);
511 if ((dLambdaInvM<dLower) || (dLambdaInvM>dUpper)) return 0x0;
513 if (fCutMinLambdaDeletaM>0.) {
514 TLorentzVector vPosPion; vPosPion.SetVectM(v3Pos, fgkMassPion);
515 TLorentzVector vKshort = vPosPion + vNegPion;
517 Double_t dKshortInvM = vKshort.M();
518 if ((TMath::Abs(dKshortInvM-fgkMassKshort)<fCutMinLambdaDeletaM)) return 0x0;
521 wMask = AliPicoHeaderCJ::kLambda;
525 TLorentzVector vNegProton; vNegProton.SetVectM(v3Neg, fgkMassProton);
526 TLorentzVector vPosPion; vPosPion.SetVectM(v3Pos, fgkMassPion);
527 TLorentzVector vAntiLa = vNegProton + vPosPion;
529 Double_t dAntiLaInvM = vAntiLa.M();
530 Double_t dLower = 1.09501 - 0.00523272*dV0Pt - 0.075269*TMath::Exp(-3.46339*dV0Pt);
531 Double_t dUpper = 1.13688 + 0.00527838*dV0Pt + 0.084222*TMath::Exp(-3.80595*dV0Pt);
532 if ((dAntiLaInvM<dLower) || (dAntiLaInvM>dUpper)) return 0x0;
534 if (fCutMinLambdaDeletaM>0.) {
535 TLorentzVector vNegPion; vNegPion.SetVectM(v3Neg, fgkMassPion);
536 TLorentzVector vKshort = vPosPion + vNegPion;
538 Double_t dKshortInvM = vKshort.M();
539 if ((TMath::Abs(dKshortInvM-fgkMassKshort)<fCutMinLambdaDeletaM)) return 0x0;
542 wMask = AliPicoHeaderCJ::kAntiLambda;
544 //=============================================================================
546 Bool_t bPosInJC = kFALSE;
547 Bool_t bNegInJC = kFALSE;
548 AliPicoV0MC *pPicoV0 = new AliPicoV0MC(wMask,
556 dDauXrowsOverFindableClusTPC,
557 v3Pos.Px(), v3Pos.Py(), v3Pos.Pz(),
558 v3Neg.Px(), v3Neg.Py(), v3Neg.Pz(),
560 idvMC, wsvMC, pV0MC->Px(), pV0MC->Py(), pV0MC->Pz(), pV0MC->E(),
561 idmMC, wsmMC, dMotherPt, dMotherEta, dMotherRap);
567 //_____________________________________________________________________________
568 AliPicoV0MC* AliAnalysisTaskSEPicoV0MakerMC::SelectV0Candidate(AliESDv0 const *pV0RD)
571 // AliAnalysisTaskSEPicoV0MakerMC::SelectV0Candidate
574 AliStack *pStack = MCEvent()->Stack(); if (!pStack) return 0x0;
575 Int_t nPrimary = pStack->GetNprimary();
576 //=============================================================================
578 if (pV0RD->GetOnFlyStatus()) return 0x0;
579 if (pV0RD->GetChi2V0()>fCutMaxV0Chi2) return 0x0;
581 Double_t dV0Pt = pV0RD->Pt(); if ((dV0Pt<fCutMinV0Pt) || (dV0Pt>fCutMaxV0Pt)) return 0x0;
582 //=============================================================================
584 Double_t dV0Vtx[3]; pV0RD->GetXYZ(dV0Vtx[0], dV0Vtx[1], dV0Vtx[2]);
585 Double_t dV0Radius = TMath::Sqrt(dV0Vtx[0]*dV0Vtx[0] + dV0Vtx[1]*dV0Vtx[1]);
586 if ((dV0Radius<fCutMinV0Radius) || (dV0Radius>fCutMaxV0Radius)) return 0x0;
588 Double_t dDausDCA = pV0RD->GetDcaV0Daughters(); if (dDausDCA>fCutMaxDausDCA) return 0x0;
589 //=============================================================================
591 Int_t nPosIndex = TMath::Abs(pV0RD->GetPindex()); if (nPosIndex<0) return 0x0;
592 Int_t nNegIndex = TMath::Abs(pV0RD->GetNindex()); if (nNegIndex<0) return 0x0;
594 AliESDtrack *pDauPosRD = fEventESD->GetTrack(nPosIndex); if (!pDauPosRD) return 0x0;
595 AliESDtrack *pDauNegRD = fEventESD->GetTrack(nNegIndex); if (!pDauNegRD) return 0x0;
597 Double_t dMegField = fEventESD->GetMagneticField();
598 Double_t dPosDCAtoPV = TMath::Abs(pDauPosRD->GetD(fPrimaryVtx[0],fPrimaryVtx[1],dMegField)); if (dPosDCAtoPV<fCutMinDauDCAtoPV) return 0x0;
599 Double_t dNegDCAtoPV = TMath::Abs(pDauNegRD->GetD(fPrimaryVtx[0],fPrimaryVtx[1],dMegField)); if (dNegDCAtoPV<fCutMinDauDCAtoPV) return 0x0;
600 //=============================================================================
602 if (!(pDauPosRD->GetStatus() & AliESDtrack::kTPCrefit)) return 0x0;
603 if (!(pDauNegRD->GetStatus() & AliESDtrack::kTPCrefit)) return 0x0;
604 if ((pDauPosRD->GetKinkIndex(0)>0) || (pDauNegRD->GetKinkIndex(0)>0)) return 0x0;
606 Float_t dPosXrowsTPC = pDauPosRD->GetTPCClusterInfo(2,1);
607 Float_t dNegXrowsTPC = pDauNegRD->GetTPCClusterInfo(2,1);
608 Float_t dDauXrowsTPC = dPosXrowsTPC; if (dDauXrowsTPC>dNegXrowsTPC) dDauXrowsTPC = dNegXrowsTPC;
609 if (dDauXrowsTPC<fCutMinDauXrowsTPC) return 0x0;
611 UShort_t wPosTPCNClsF = pDauPosRD->GetTPCNclsF(); if (wPosTPCNClsF<=0) return 0x0;
612 UShort_t wNegTPCNClsF = pDauNegRD->GetTPCNclsF(); if (wNegTPCNClsF<=0) return 0x0;
613 Double_t dPosXrowsOverFindableClusTPC = ((Double_t)dPosXrowsTPC) / ((Double_t)wPosTPCNClsF);
614 Double_t dNegXrowsOverFindableClusTPC = ((Double_t)dNegXrowsTPC) / ((Double_t)wNegTPCNClsF);
616 Double_t dDauXrowsOverFindableClusTPC = dPosXrowsOverFindableClusTPC;
617 if (dDauXrowsOverFindableClusTPC>dNegXrowsOverFindableClusTPC) dDauXrowsOverFindableClusTPC = dNegXrowsOverFindableClusTPC;
618 if (dDauXrowsOverFindableClusTPC<fCutMinDauXrowsOverFindableClusTPC) return 0x0;
619 //=============================================================================
621 Short_t nPosCharge = pDauPosRD->Charge();
622 Short_t nNegCharge = pDauNegRD->Charge();
623 if ((nPosCharge==0) || (nNegCharge==0) || (nPosCharge==nNegCharge)) return 0x0;
625 Double_t dPosPxPyPz[3] = { 0., 0., 0. };
626 Double_t dNegPxPyPz[3] = { 0., 0., 0. };
627 if ((nPosCharge<0) && (nNegCharge>0)) {
628 pDauPosRD = fEventESD->GetTrack(nNegIndex);
629 pDauNegRD = fEventESD->GetTrack(nPosIndex);
631 pV0RD->GetNPxPyPz(dPosPxPyPz[0], dPosPxPyPz[1], dPosPxPyPz[2]);
632 pV0RD->GetPPxPyPz(dNegPxPyPz[0], dNegPxPyPz[1], dNegPxPyPz[2]);
634 pV0RD->GetPPxPyPz(dPosPxPyPz[0], dPosPxPyPz[1], dPosPxPyPz[2]);
635 pV0RD->GetNPxPyPz(dNegPxPyPz[0], dNegPxPyPz[1], dNegPxPyPz[2]);
638 TVector3 v3Pos(dPosPxPyPz);
639 TVector3 v3Neg(dNegPxPyPz);
641 if ((v3Pos.Pt()<fCutMinDauPt) || (v3Neg.Pt()<fCutMinDauPt)) return 0x0;
642 Double_t dPosEta = v3Pos.Eta(); if ((dPosEta<fCutMinDauEta) || (dPosEta>fCutMaxDauEta)) return 0x0;
643 Double_t dNegEta = v3Neg.Eta(); if ((dNegEta<fCutMinDauEta) || (dNegEta>fCutMaxDauEta)) return 0x0;
644 //=============================================================================
646 Int_t inp = TMath::Abs(pDauPosRD->GetLabel()); if (inp<0) return 0x0;
647 Int_t inn = TMath::Abs(pDauNegRD->GetLabel()); if (inn<0) return 0x0;
648 TParticle *pDauPosMC = ((AliMCParticle*)MCEvent()->GetTrack(inp))->Particle(); if (!pDauPosMC) return 0x0;
649 TParticle *pDauNegMC = ((AliMCParticle*)MCEvent()->GetTrack(inn))->Particle(); if (!pDauNegMC) return 0x0;
651 Int_t imp = pDauPosMC->GetFirstMother(); if (imp<0) return 0x0;
652 Int_t imn = pDauNegMC->GetFirstMother(); if (imn<0) return 0x0;
653 if (imp != imn) return 0x0;
655 TParticle *pV0MC = ((AliMCParticle*)MCEvent()->GetTrack(imp))->Particle(); if (!pV0MC) return 0x0;
656 if (((pV0MC->Y())<fCutMinV0Rap) || ((pV0MC->Y())>fCutMaxV0Rap)) return 0x0;
658 Int_t idvMC = pV0MC->GetPdgCode();
659 Int_t idp = pDauPosMC->GetPdgCode();
660 Int_t idn = pDauNegMC->GetPdgCode();
661 Bool_t bIsKshort = ((idp==211) && (idn==-211) && (idvMC== 310));
662 Bool_t bIsLambda = ((idp==2212) && (idn==-211) && (idvMC== 3122));
663 Bool_t bIsAntiLa = ((idp==211) && (idn==-2212) && (idvMC==-3122));
664 if (!(bIsKshort || bIsLambda || bIsAntiLa)) return 0x0;
665 //=============================================================================
668 if (imp<nPrimary) wsvMC |= AliPicoHeaderCJ::kPrimary;
669 if (pStack->IsPhysicalPrimary(imp)) wsvMC |= AliPicoHeaderCJ::kPhysicalPrimary;
670 if (pStack->IsSecondaryFromWeakDecay(imp)) wsvMC |= AliPicoHeaderCJ::kSecondaryFromWeakDecay;
671 if (pStack->IsSecondaryFromMaterial(imp)) wsvMC |= AliPicoHeaderCJ::kSecondaryFromMaterial;
675 Double_t dMotherPt = 0.;
676 Double_t dMotherEta = 0.;
677 Double_t dMotherRap = 0.;
678 if (bIsLambda || bIsAntiLa) {
679 Int_t imv = pV0MC->GetFirstMother(); if (imv>=0) {
680 TParticle *pMother = ((AliMCParticle*)MCEvent()->GetTrack(imv))->Particle();
683 idmMC = pMother->GetPdgCode();
684 if ((bIsLambda && ((idmMC== 3312) || (idmMC== 3322))) ||
685 (bIsAntiLa && ((idmMC==-3312) || (idmMC==-3322)))) {
686 dMotherPt = pMother->Pt();
687 dMotherEta = pMother->Eta();
688 dMotherRap = pMother->Y();
690 if (imp<nPrimary) wsmMC |= AliPicoHeaderCJ::kPrimary;
691 if (pStack->IsPhysicalPrimary(imv)) wsmMC |= AliPicoHeaderCJ::kPhysicalPrimary;
692 if (pStack->IsSecondaryFromWeakDecay(imv)) wsmMC |= AliPicoHeaderCJ::kSecondaryFromWeakDecay;
693 if (pStack->IsSecondaryFromMaterial(imv)) wsmMC |= AliPicoHeaderCJ::kSecondaryFromMaterial;
698 //=============================================================================
700 Double_t dV0CosPA = pV0RD->GetV0CosineOfPointingAngle(fPrimaryVtx[0], fPrimaryVtx[1], fPrimaryVtx[2]);
702 if (bIsKshort) if (dV0CosPA<fCutMinKshortCosPA) {
706 if (bIsLambda || bIsAntiLa) if (dV0CosPA<fCutMinLambdaCosPA) {
711 if (!(bIsKshort || bIsLambda || bIsAntiLa)) return 0x0;
712 //=============================================================================
714 Double_t dV0DistToPV = 0.;
715 for (Int_t i=0; i<3; i++) dV0DistToPV += ((dV0Vtx[i]-fPrimaryVtx[i]) * (dV0Vtx[i]-fPrimaryVtx[i]));
716 Double_t dV0DistToPVoverP = TMath::Sqrt(dV0DistToPV) / (pV0RD->P()+1e-10);
718 if (bIsKshort) if ((dV0DistToPVoverP*fgkMassKshort)>fCutMaxKshortCtau) {
722 if (bIsLambda || bIsAntiLa) if ((dV0DistToPVoverP*fgkMassLambda)>fCutMaxLambdaCtau) {
727 if (!(bIsKshort || bIsLambda || bIsAntiLa)) return 0x0;
728 //=============================================================================
730 Double_t dV0ArmFrac = pV0RD->PtArmV0() / (TMath::Abs(pV0RD->AlphaV0())+1e-12);
732 if (bIsKshort && (fCutMaxKshortArmFrac>0.)) if (dV0ArmFrac>fCutMaxKshortArmFrac) {
736 if ((bIsLambda && bIsAntiLa) && (fCutMaxLambdaArmFrac>0.)) if (dV0ArmFrac>fCutMaxLambdaArmFrac) {
741 if (!(bIsKshort || bIsLambda || bIsAntiLa)) return 0x0;
742 //=============================================================================
747 TLorentzVector vPosPion; vPosPion.SetVectM(v3Pos, fgkMassPion);
748 TLorentzVector vNegPion; vNegPion.SetVectM(v3Neg, fgkMassPion);
749 TLorentzVector vKshort = vPosPion + vNegPion;
751 Double_t dKshortInvM = vKshort.M();
752 Double_t dLower = 0.430006 - 0.0110029*dV0Pt;
753 Double_t dUpper = 0.563707 + 0.0114979*dV0Pt;
754 if ((dKshortInvM<dLower) || (dKshortInvM>dUpper)) return 0x0;
756 if (fCutMinKshortDeltaM>0.) {
757 TLorentzVector vPosProton; vPosProton.SetVectM(v3Pos, fgkMassProton);
758 TLorentzVector vNegProton; vNegProton.SetVectM(v3Neg, fgkMassProton);
760 TLorentzVector vLamvda = vPosProton + vNegPion;
761 TLorentzVector vAntiLa = vNegProton + vPosPion;
763 Double_t dLambdaInvM = vLamvda.M();
764 Double_t dAntiLaInvM = vAntiLa.M();
765 if ((TMath::Abs(dLambdaInvM-fgkMassLambda)<fCutMinKshortDeltaM) ||
766 (TMath::Abs(dAntiLaInvM-fgkMassLambda)<fCutMinKshortDeltaM)) return 0x0;
769 wMask = AliPicoHeaderCJ::kKshort;
773 TLorentzVector vPosProton; vPosProton.SetVectM(v3Pos, fgkMassProton);
774 TLorentzVector vNegPion; vNegPion.SetVectM(v3Neg, fgkMassPion);
775 TLorentzVector vLamvda = vPosProton + vNegPion;
777 Double_t dLambdaInvM = vLamvda.M();
778 Double_t dLower = 1.09501 - 0.00523272*dV0Pt - 0.075269*TMath::Exp(-3.46339*dV0Pt);
779 Double_t dUpper = 1.13688 + 0.00527838*dV0Pt + 0.084222*TMath::Exp(-3.80595*dV0Pt);
780 if ((dLambdaInvM<dLower) || (dLambdaInvM>dUpper)) return 0x0;
782 if (fCutMinLambdaDeletaM>0.) {
783 TLorentzVector vPosPion; vPosPion.SetVectM(v3Pos, fgkMassPion);
784 TLorentzVector vKshort = vPosPion + vNegPion;
786 Double_t dKshortInvM = vKshort.M();
787 if ((TMath::Abs(dKshortInvM-fgkMassKshort)<fCutMinLambdaDeletaM)) return 0x0;
790 wMask = AliPicoHeaderCJ::kLambda;
794 TLorentzVector vNegProton; vNegProton.SetVectM(v3Neg, fgkMassProton);
795 TLorentzVector vPosPion; vPosPion.SetVectM(v3Pos, fgkMassPion);
796 TLorentzVector vAntiLa = vNegProton + vPosPion;
798 Double_t dAntiLaInvM = vAntiLa.M();
799 Double_t dLower = 1.09501 - 0.00523272*dV0Pt - 0.075269*TMath::Exp(-3.46339*dV0Pt);
800 Double_t dUpper = 1.13688 + 0.00527838*dV0Pt + 0.084222*TMath::Exp(-3.80595*dV0Pt);
801 if ((dAntiLaInvM<dLower) || (dAntiLaInvM>dUpper)) return 0x0;
803 if (fCutMinLambdaDeletaM>0.) {
804 TLorentzVector vNegPion; vNegPion.SetVectM(v3Neg, fgkMassPion);
805 TLorentzVector vKshort = vPosPion + vNegPion;
807 Double_t dKshortInvM = vKshort.M();
808 if ((TMath::Abs(dKshortInvM-fgkMassKshort)<fCutMinLambdaDeletaM)) return 0x0;
811 wMask = AliPicoHeaderCJ::kAntiLambda;
813 //=============================================================================
815 Bool_t bPosInJC = kFALSE;
816 Bool_t bNegInJC = kFALSE;
817 AliPicoV0MC *pPicoV0 = new AliPicoV0MC(wMask,
825 dDauXrowsOverFindableClusTPC,
826 v3Pos.Px(), v3Pos.Py(), v3Pos.Pz(),
827 v3Neg.Px(), v3Neg.Py(), v3Neg.Pz(),
829 idvMC, wsvMC, pV0MC->Px(), pV0MC->Py(), pV0MC->Pz(), pV0MC->Energy(),
830 idmMC, wsmMC, dMotherPt, dMotherEta, dMotherRap);
836 //_____________________________________________________________________________
837 Bool_t AliAnalysisTaskSEPicoV0MakerMC::IsEventNotAcpt()
840 // AliAnalysisTaskSEPicoV0MakerMC::IsEventNotAcpt
844 if (!InputEvent()) return (fEventAcptMask==0);
845 if (!fInputHandler) return (fEventAcptMask==0);
847 if (fCollisionType!=(AliPicoHeaderCJ::kPP)) {
848 fCentInfo = InputEvent()->GetCentrality();
849 if (!fCentInfo) return (fEventAcptMask==0);
852 fEventAOD = dynamic_cast<AliAODEvent*>(InputEvent());
853 fEventESD = dynamic_cast<AliESDEvent*>(InputEvent());
854 if ((!fEventAOD) && (!fEventESD)) return (fEventAcptMask==0);
856 fRespoPID = fInputHandler->GetPIDResponse();
857 if (!fRespoPID) return kTRUE;
860 if (MCEvent()->GetNumberOfTracks()<=0) return (fEventAcptMask==0);
862 return (fEventAcptMask==0);
865 AliHeader *pHeader = MCEvent()->Header(); if (!pHeader) return (fEventAcptMask==0);
868 AliGenDPMjetEventHeader *pDPMjetH = dynamic_cast<AliGenDPMjetEventHeader*>(pHeader->GenEventHeader());
871 Int_t nd0=0, nd1=0, nd2=0; pDPMjetH->GetNDiffractive(nd1, nd2, nd0);
872 if ((nd1+nd2) != (pDPMjetH->ProjectileParticipants() + pDPMjetH->TargetParticipants())) return (fEventAcptMask==0);
876 fEventAcptMask |= AliPicoHeaderCJ::kEventAccCheck;
877 //=============================================================================
879 if (fCollisionType==(AliPicoHeaderCJ::kPP)) {
880 fEventAcptMask |= AliPicoHeaderCJ::kEventAccMult;
882 if (fCentInfo->GetQuality()==0)
883 fEventAcptMask |= AliPicoHeaderCJ::kEventAccMult;
885 return (fEventAcptMask==0);
887 //=============================================================================
889 UInt_t wMask = fInputHandler->IsEventSelected();
890 if ((wMask & fTriggerMask) != fTriggerMask) return (fEventAcptMask==0);
891 if (fIsSkipFastOnly) if ((wMask & AliVEvent::kFastOnly) == AliVEvent::kFastOnly) return (fEventAcptMask==0);
893 fEventAcptMask |= AliPicoHeaderCJ::kEventAccTrigger;
894 //=============================================================================
896 const AliVVertex *pVertex = InputEvent()->GetPrimaryVertex(); if (!pVertex) return (fEventAcptMask==0);
897 pVertex->GetXYZ(fPrimaryVtx); if (TMath::Abs(fPrimaryVtx[2])>fCutMaxEventVzAbs) return (fEventAcptMask==0);
899 if ((fCollisionType==(AliPicoHeaderCJ::kPA)) || (fCollisionType==(AliPicoHeaderCJ::kAP))) {
900 if ( fAnaUtils->IsFirstEventInChunk(InputEvent())) return (fEventAcptMask==0);
901 if (!fAnaUtils->IsVertexSelected2013pA(InputEvent())) return (fEventAcptMask==0);
904 const AliAODVertex *pVtxSPD = fEventAOD->GetPrimaryVertexSPD();
905 const AliAODVertex *pVtxTrk = fEventAOD->GetPrimaryVertex();
906 if ((!pVtxSPD) && (!pVtxTrk)) return (fEventAcptMask==0);
910 Bool_t fHasVertex = kFALSE;
911 const AliESDVertex *pVtxESD = fEventESD->GetPrimaryVertexTracks();
912 if (pVtxESD->GetNContributors()<1) {
913 pVtxESD = fEventESD->GetPrimaryVertexSPD();
914 if (pVtxESD->GetNContributors()<1) fHasVertex = kFALSE;
915 else fHasVertex = kTRUE;
917 TString vtxTyp = pVtxESD->GetTitle();
918 Double_t cov[6] = { 0., 0., 0., 0., 0., 0. };
919 pVtxESD->GetCovarianceMatrix(cov);
920 Double_t zRes = TMath::Sqrt(cov[5]);
921 if (vtxTyp.Contains("vertexer:Z") && (zRes>0.25)) fHasVertex = kFALSE;
922 } else fHasVertex = kTRUE;
924 if (!fHasVertex) return (fEventAcptMask==0);
929 const AliAODVertex *pVtxSPD = fEventAOD->GetPrimaryVertexSPD(); if (!pVtxSPD) return (fEventAcptMask==0);
930 const AliAODVertex *pVtxTrk = fEventAOD->GetPrimaryVertex(); if (!pVtxTrk) return (fEventAcptMask==0);
934 const AliESDVertex *pVtxPri = fEventESD->GetPrimaryVertex(); if (!pVtxPri) return (fEventAcptMask==0);
935 const AliESDVertex *pVtxSPD = fEventESD->GetPrimaryVertexSPD(); if (!pVtxSPD) return (fEventAcptMask==0);
936 const AliESDVertex *pVtxTrk = fEventESD->GetPrimaryVertexTracks(); if (!pVtxTrk) return (fEventAcptMask==0);
937 if ((!(pVtxPri->GetStatus())) && (!(pVtxSPD->GetStatus())) && (!(pVtxTrk->GetStatus()))) return (fEventAcptMask==0);
941 fEventAcptMask |= AliPicoHeaderCJ::kEventAccVertex;
942 //=============================================================================
944 if ((fCollisionType==AliPicoHeaderCJ::kPP) ||
945 (fCollisionType==AliPicoHeaderCJ::kPA) ||
946 (fCollisionType==AliPicoHeaderCJ::kAP)) {
947 if (fAnaUtils->IsPileUpEvent(InputEvent())) return (fEventAcptMask==0);
950 fEventAcptMask |= AliPicoHeaderCJ::kEventAccPileup;
951 //=============================================================================
953 if (fIsRefitV0sESD && fEventESD) {
954 Double_t dCuts[7] = { fCutMaxV0Chi2,
962 fEventESD->ResetV0s();
963 AliV0vertexer aV0vtxer;
964 aV0vtxer.SetDefaultCuts(dCuts);
965 aV0vtxer.Tracks2V0vertices(fEventESD);
968 return (fEventAcptMask==0);
971 //_____________________________________________________________________________
972 Bool_t AliAnalysisTaskSEPicoV0MakerMC::IsEventNotINEL()
975 // AliAnalysisTaskSEPicoV0MakerMC::IsEventNotINEL
978 if ((fEventAcptMask & AliPicoHeaderCJ::kEventAccCheck) != AliPicoHeaderCJ::kEventAccCheck) return kTRUE;
979 if ((fEventAcptMask & AliPicoHeaderCJ::kEventAccMult) != AliPicoHeaderCJ::kEventAccMult) return kTRUE;
984 //_____________________________________________________________________________
985 Bool_t AliAnalysisTaskSEPicoV0MakerMC::IsEventNotMBsa()
988 // AliAnalysisTaskSEPicoV0MakerMC::IsEventNotMBsa
991 if (IsEventNotINEL()) return kTRUE;
993 if ((fEventAcptMask & AliPicoHeaderCJ::kEventAccTrigger) != AliPicoHeaderCJ::kEventAccTrigger) return kTRUE;
994 if ((fEventAcptMask & AliPicoHeaderCJ::kEventAccVertex) != AliPicoHeaderCJ::kEventAccVertex) return kTRUE;
995 if ((fEventAcptMask & AliPicoHeaderCJ::kEventAccPileup) != AliPicoHeaderCJ::kEventAccPileup) return kTRUE;
1000 //_____________________________________________________________________________
1001 void AliAnalysisTaskSEPicoV0MakerMC::FillHistograms()
1004 // AliAnalysisTaskSEPicoV0MakerMC::FillHistograms
1007 Float_t dV0M = fCentInfo->GetCentralityPercentile("V0M");
1008 Float_t dV0A = fCentInfo->GetCentralityPercentile("V0A");
1009 Float_t dCL1 = fCentInfo->GetCentralityPercentile("CL1");
1010 Float_t dZNA = fCentInfo->GetCentralityPercentile("ZNA");
1012 if ((fEventAcptMask & AliPicoHeaderCJ::kEventAccCheck) == AliPicoHeaderCJ::kEventAccCheck) {
1013 ((TH1D*)fListUserOutputs->FindObject("hEventAccCheck_V0M"))->Fill(dV0M);
1014 ((TH1D*)fListUserOutputs->FindObject("hEventAccCheck_V0A"))->Fill(dV0A);
1015 ((TH1D*)fListUserOutputs->FindObject("hEventAccCheck_CL1"))->Fill(dCL1);
1016 ((TH1D*)fListUserOutputs->FindObject("hEventAccCheck_ZNA"))->Fill(dZNA);
1019 if ((fEventAcptMask & AliPicoHeaderCJ::kEventAccMult) == AliPicoHeaderCJ::kEventAccMult) {
1020 ((TH1D*)fListUserOutputs->FindObject("hEventAccMult_V0M"))->Fill(dV0M);
1021 ((TH1D*)fListUserOutputs->FindObject("hEventAccMult_V0A"))->Fill(dV0A);
1022 ((TH1D*)fListUserOutputs->FindObject("hEventAccMult_CL1"))->Fill(dCL1);
1023 ((TH1D*)fListUserOutputs->FindObject("hEventAccMult_ZNA"))->Fill(dZNA);
1026 if ((fEventAcptMask & AliPicoHeaderCJ::kEventAccTrigger) == AliPicoHeaderCJ::kEventAccTrigger) {
1027 ((TH1D*)fListUserOutputs->FindObject("hEventAccTrigger_V0M"))->Fill(dV0M);
1028 ((TH1D*)fListUserOutputs->FindObject("hEventAccTrigger_V0A"))->Fill(dV0A);
1029 ((TH1D*)fListUserOutputs->FindObject("hEventAccTrigger_CL1"))->Fill(dCL1);
1030 ((TH1D*)fListUserOutputs->FindObject("hEventAccTrigger_ZNA"))->Fill(dZNA);
1033 if ((fEventAcptMask & AliPicoHeaderCJ::kEventAccVertex) == AliPicoHeaderCJ::kEventAccVertex) {
1034 ((TH1D*)fListUserOutputs->FindObject("hEventAccVertex_V0M"))->Fill(dV0M);
1035 ((TH1D*)fListUserOutputs->FindObject("hEventAccVertex_V0A"))->Fill(dV0A);
1036 ((TH1D*)fListUserOutputs->FindObject("hEventAccVertex_CL1"))->Fill(dCL1);
1037 ((TH1D*)fListUserOutputs->FindObject("hEventAccVertex_ZNA"))->Fill(dZNA);
1040 if ((fEventAcptMask & AliPicoHeaderCJ::kEventAccPileup) == AliPicoHeaderCJ::kEventAccPileup) {
1041 ((TH1D*)fListUserOutputs->FindObject("hEventAccPileup_V0M"))->Fill(dV0M);
1042 ((TH1D*)fListUserOutputs->FindObject("hEventAccPileup_V0A"))->Fill(dV0A);
1043 ((TH1D*)fListUserOutputs->FindObject("hEventAccPileup_CL1"))->Fill(dCL1);
1044 ((TH1D*)fListUserOutputs->FindObject("hEventAccPileup_ZNA"))->Fill(dZNA);
1050 //_____________________________________________________________________________
1051 void AliAnalysisTaskSEPicoV0MakerMC::CreateHistograms()
1054 // AliAnalysisTaskSEPicoV0MakerMC::CreateHistograms
1057 Bool_t bStatusTmpH = TH1::AddDirectoryStatus();
1058 TH1::AddDirectory(kFALSE);
1059 //=============================================================================
1062 h1 = new TH1D("hEventAccCheck_V0M", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1063 h1 = new TH1D("hEventAccCheck_V0A", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1064 h1 = new TH1D("hEventAccCheck_CL1", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1065 h1 = new TH1D("hEventAccCheck_ZNA", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1067 h1 = new TH1D("hEventAccMult_V0M", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1068 h1 = new TH1D("hEventAccMult_V0A", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1069 h1 = new TH1D("hEventAccMult_CL1", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1070 h1 = new TH1D("hEventAccMult_ZNA", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1072 h1 = new TH1D("hEventAccTrigger_V0M", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1073 h1 = new TH1D("hEventAccTrigger_V0A", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1074 h1 = new TH1D("hEventAccTrigger_CL1", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1075 h1 = new TH1D("hEventAccTrigger_ZNA", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1077 h1 = new TH1D("hEventAccVertex_V0M", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1078 h1 = new TH1D("hEventAccVertex_V0A", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1079 h1 = new TH1D("hEventAccVertex_CL1", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1080 h1 = new TH1D("hEventAccVertex_ZNA", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1082 h1 = new TH1D("hEventAccPileup_V0M", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1083 h1 = new TH1D("hEventAccPileup_V0A", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1084 h1 = new TH1D("hEventAccPileup_CL1", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1085 h1 = new TH1D("hEventAccPileup_ZNA", "", 210, -10., 200.); h1->Sumw2(); fListUserOutputs->Add(h1);
1089 h2 = new TH2D("hKshortPtInvM", "", 1000, 0., 100., 300, fgkMassKshort-0.15, fgkMassKshort+0.15);
1090 h2->Sumw2(); fListUserOutputs->Add(h2); h2=0;
1092 h2 = new TH2D("hLambdaPtInvM", "", 1000, 0., 100., 200, fgkMassLambda-0.10, fgkMassLambda+0.10);
1093 h2->Sumw2(); fListUserOutputs->Add(h2); h2=0;
1095 h2 = new TH2D("hAntiLaPtInvM", "", 1000, 0., 100., 200, fgkMassLambda-0.10, fgkMassLambda+0.10);
1096 h2->Sumw2(); fListUserOutputs->Add(h2); h2=0;
1098 TH1::AddDirectory(bStatusTmpH);
1102 //_____________________________________________________________________________
1103 void AliAnalysisTaskSEPicoV0MakerMC::InitAnalysis()
1106 // AliAnalysisTaskSEPicoV0MakerMC::InitAnalysis
1109 fAnaUtils = new AliAnalysisUtils();
1110 fAnaUtils->SetMinVtxContr(fCutMinEventVtxContr);
1111 fAnaUtils->SetMaxVtxZ(fCutMaxEventVzAbs);
1116 //_____________________________________________________________________________
1117 void AliAnalysisTaskSEPicoV0MakerMC::SetV0Cuts(Double_t d[14])
1120 // AliAnalysisTaskSEPicoV0MakerMC::SetCuts
1123 fCutMinV0Radius = d[0];
1124 fCutMaxV0Radius = d[1];
1126 fCutMaxDausDCA = d[2];
1127 fCutMinDauDCAtoPV = d[3];
1128 fCutMinDauXrowsTPC = d[4];
1129 fCutMinDauXrowsOverFindableClusTPC = d[5];
1131 fCutMaxKshortSigmaTPC = d[6];
1132 fCutMinKshortCosPA = d[7];
1133 fCutMaxKshortCtau = d[8];
1134 fCutMinKshortDeltaM = d[9];
1136 fCutMaxLambdaSigmaTPC = d[10];
1137 fCutMinLambdaCosPA = d[11];
1138 fCutMaxLambdaCtau = d[12];
1139 fCutMinLambdaDeletaM = d[13];