25 #include <TParticle.h> 27 #include <THnSparse.h> 30 #include <TDatabasePDG.h> 31 #include <TParameter.h> 32 #include <AliAnalysisDataSlot.h> 33 #include <AliAnalysisDataContainer.h> 35 #include "AliMCEvent.h" 36 #include "AliAnalysisManager.h" 37 #include "AliAODMCHeader.h" 38 #include "AliAODHandler.h" 40 #include "AliAODVertex.h" 41 #include "AliAODRecoDecay.h" 46 #include "AliESDtrack.h" 47 #include "AliAODMCParticle.h" 49 #include "AliAODEvent.h" 50 #include "AliVertexerTracks.h" 51 #include "AliNeutralTrackParam.h" 62 fSingleSideband(kFALSE),
76 fIsSignalPrompt(kFALSE),
77 fIsSignalFromB(kFALSE),
78 fIsBackground(kFALSE),
85 fTrueImpParForTree(0),
97 fSingleSideband(kFALSE),
105 fListSignalPrompt(0),
111 fIsSignalPrompt(kFALSE),
112 fIsSignalFromB(kFALSE),
113 fIsBackground(kFALSE),
120 fTrueImpParForTree(0),
122 fSignalTypeForTree(0)
133 DefineOutput(1, TH1D::Class());
134 DefineOutput(2, TList::Class());
135 DefineOutput(3, TList::Class());
136 DefineOutput(4, TList::Class());
137 DefineOutput(5, TList::Class());
138 DefineOutput(6, TList::Class());
139 DefineOutput(7, AliRDHFCutsDStartoKpipi::Class());
140 DefineOutput(8, AliNormalizationCounter::Class());
141 DefineOutput(9, TTree::Class());
143 for (
Int_t i=0;i<30;i++) {
172 const char* name = GetOutputSlot(7)->GetContainer()->GetName();
173 copyCuts->SetName(name);
175 PostData(7, copyCuts);
177 fPDGMDStarD0 = TDatabasePDG::Instance()->GetParticle(413)->Mass() - TDatabasePDG::Instance()->GetParticle(421)->Mass();
182 fNEvents =
new TH1D(GetOutputSlot(1)->GetContainer()->GetName(),
"Counter", 21, -0.5, 20.5);
183 fNEvents->GetXaxis()->SetBinLabel(1,
"Events");
184 fNEvents->GetXaxis()->SetBinLabel(2,
"Magnetic field");
185 fNEvents->GetXaxis()->SetBinLabel(3,
"Selected");
186 fNEvents->GetXaxis()->SetBinLabel(4,
"Primary vertex");
187 fNEvents->GetXaxis()->SetBinLabel(5,
"Candidates");
188 fNEvents->GetXaxis()->SetBinLabel(6,
"Passed track cuts");
189 fNEvents->GetXaxis()->SetBinLabel(7,
"Passed fiducial acc cuts");
190 fNEvents->GetXaxis()->SetBinLabel(8,
"Calc D* vtx");
191 fNEvents->GetXaxis()->SetBinLabel(9,
"Pass daught imppar cut");
192 fNEvents->GetXaxis()->SetBinLabel(10,
"Real D* (MC)");
193 fNEvents->GetXaxis()->SetBinLabel(11,
"Skip from Hijing (MC)");
230 fTreeCandidate =
new TTree(GetOutputSlot(9)->GetContainer()->GetName(), GetOutputSlot(9)->GetContainer()->GetName());
251 TString listName = list->GetName();
252 listName.ReplaceAll(
"list",
"");
254 if (listName.EqualTo(
"signalfromb")) {
255 listName =
"signal from B";
257 if (listName.EqualTo(
"signalprompt")) {
258 listName =
"signal prompt";
261 TString regions[3] = {
"",
"Peak",
"Sideband"};
264 TH1D* hDeltaInvMass =
new TH1D(
"DeltaInvMass", Form(
"D*-D^{0} invariant mass, %s; #DeltaM [GeV/c^{2}]; Entries", listName.Data()), 700, 0.13, 0.2);
265 hDeltaInvMass->Sumw2();
266 hDeltaInvMass->SetLineColor(4);
267 hDeltaInvMass->SetMarkerColor(4);
268 hDeltaInvMass->SetMarkerStyle(20);
269 hDeltaInvMass->SetMarkerSize(0.6);
270 list->Add(hDeltaInvMass);
275 TH1D* hInvMassD0 =
new TH1D(
"InvMassD0", Form(
"D^{0} invariant mass, %s; M [GeV/c^{2}]; Entries", listName.Data()), 600, 1.6, 2.2);
277 hInvMassD0->SetLineColor(4);
278 hInvMassD0->SetMarkerColor(4);
279 hInvMassD0->SetMarkerStyle(20);
280 hInvMassD0->SetMarkerSize(0.6);
281 list->Add(hInvMassD0);
283 for (
Int_t r=0;r<3;r++) {
284 TString regionTitle(regions[r]);
285 if (!regionTitle.EqualTo(
"")) {
286 regionTitle.ToLower();
287 regionTitle.Prepend(
", ");
288 regionTitle.Append(
" region");
292 TH1D* hImpPar =
new TH1D(Form(
"ImpPar%s", regions[r].
Data()), Form(
"D* impact parameter%s, %s; Impact parameter [#mum]; Entries", regionTitle.Data(), listName.Data()), 1000, -1000., 1000.);
294 hImpPar->SetLineColor(4);
295 hImpPar->SetMarkerColor(4);
296 hImpPar->SetMarkerStyle(20);
297 hImpPar->SetMarkerSize(0.6);
301 TH1D* hImpParSoftPi =
new TH1D(Form(
"ImpParSoftPi%s", regions[r].
Data()), Form(
"#pi_{s} impact parameter%s, %s; Impact parameter [#mum]; Entries", regionTitle.Data(), listName.Data()), 1000, -1000., 1000.);
302 hImpParSoftPi->Sumw2();
303 hImpParSoftPi->SetLineColor(4);
304 hImpParSoftPi->SetMarkerColor(4);
305 hImpParSoftPi->SetMarkerStyle(20);
306 hImpParSoftPi->SetMarkerSize(0.6);
307 list->Add(hImpParSoftPi);
310 TH1D* hImpParD0 =
new TH1D(Form(
"ImpParD0%s", regions[r].
Data()), Form(
"D^{0} impact parameter%s, %s; Impact parameter [#mum]; Entries", regionTitle.Data(), listName.Data()), 1000, -1000., 1000.);
312 hImpParD0->SetLineColor(4);
313 hImpParD0->SetMarkerColor(4);
314 hImpParD0->SetMarkerStyle(20);
315 hImpParD0->SetMarkerSize(0.6);
316 list->Add(hImpParD0);
319 TH1D* hImpParD0K =
new TH1D(Form(
"ImpParD0K%s", regions[r].
Data()), Form(
"K (from D^{0}) impact parameter%s, %s; Impact parameter [#mum]; Entries", regionTitle.Data(), listName.Data()), 1000, -1000., 1000.);
321 hImpParD0K->SetLineColor(4);
322 hImpParD0K->SetMarkerColor(4);
323 hImpParD0K->SetMarkerStyle(20);
324 hImpParD0K->SetMarkerSize(0.6);
325 list->Add(hImpParD0K);
328 TH1D* hImpParD0K2 =
new TH1D(Form(
"ImpParD0K2%s", regions[r].
Data()), Form(
"K (from D^{0}) impact parameter (no recalc prim vtx)%s, %s; Impact parameter [#mum]; Entries", regionTitle.Data(), listName.Data()), 1000, -1000., 1000.);
329 hImpParD0K2->Sumw2();
330 hImpParD0K2->SetLineColor(4);
331 hImpParD0K2->SetMarkerColor(4);
332 hImpParD0K2->SetMarkerStyle(20);
333 hImpParD0K2->SetMarkerSize(0.6);
334 list->Add(hImpParD0K2);
337 TH1D* hImpParD0Pi =
new TH1D(Form(
"ImpParD0Pi%s", regions[r].
Data()), Form(
"#pi (from D^{0}) impact parameter%s, %s; Impact parameter [#mum]; Entries", regionTitle.Data(), listName.Data()), 1000, -1000., 1000.);
338 hImpParD0Pi->Sumw2();
339 hImpParD0Pi->SetLineColor(4);
340 hImpParD0Pi->SetMarkerColor(4);
341 hImpParD0Pi->SetMarkerStyle(20);
342 hImpParD0Pi->SetMarkerSize(0.6);
343 list->Add(hImpParD0Pi);
346 TH1D* hImpParD0Pi2 =
new TH1D(Form(
"ImpParD0Pi2%s", regions[r].
Data()), Form(
"#pi (from D^{0}) impact parameter (no recalc prim vtx)%s, %s; Impact parameter [#mum]; Entries", regionTitle.Data(), listName.Data()), 1000, -1000., 1000.);
347 hImpParD0Pi2->Sumw2();
348 hImpParD0Pi2->SetLineColor(4);
349 hImpParD0Pi2->SetMarkerColor(4);
350 hImpParD0Pi2->SetMarkerStyle(20);
351 hImpParD0Pi2->SetMarkerSize(0.6);
352 list->Add(hImpParD0Pi2);
359 Float_t ptHigh = ptLimits[(i+1)];
361 TH1D* hDeltaInvMassLoop =
new TH1D(Form(
"DeltaInvMass_%d", i), Form(
"D*-D^{0} invariant mass, %s, %.1f < p_{T} < %.1f GeV/c; #DeltaM [GeV/c^{2}]; Entries", listName.Data(), ptLow, ptHigh), 700, 0.13, 0.2);
362 hDeltaInvMassLoop->Sumw2();
363 hDeltaInvMassLoop->SetLineColor(4);
364 hDeltaInvMassLoop->SetMarkerColor(4);
365 hDeltaInvMassLoop->SetMarkerStyle(20);
366 hDeltaInvMassLoop->SetMarkerSize(0.6);
367 list->Add(hDeltaInvMassLoop);
371 TH1D* hInvMassD0Loop =
new TH1D(Form(
"InvMassD0_%d", i), Form(
"D^{0} invariant mass, %s, %.1f < p_{T} < %.1f GeV/c; M [GeV/c^{2}]; Entries", listName.Data(), ptLow, ptHigh), 600, 1.6, 2.2);
372 hInvMassD0Loop->Sumw2();
373 hInvMassD0Loop->SetLineColor(4);
374 hInvMassD0Loop->SetMarkerColor(4);
375 hInvMassD0Loop->SetMarkerStyle(20);
376 hInvMassD0Loop->SetMarkerSize(0.6);
377 list->Add(hInvMassD0Loop);
379 for (
Int_t r=0;r<3;r++) {
380 TString regionTitle(regions[r]);
381 if (!regionTitle.EqualTo(
"")) {
382 regionTitle.ToLower();
383 regionTitle.Prepend(
", ");
384 regionTitle.Append(
" region");
388 TH1D* hImpPar =
new TH1D(Form(
"ImpPar%s_%d", regions[r].
Data(), i), Form(
"D* impact parameter%s, %s, %.1f < p_{T} < %.1f GeV/c; Impact parameter [#mum]; Entries", regionTitle.Data(), listName.Data(), ptLow, ptHigh), 1000, -1000., 1000.);
390 hImpPar->SetLineColor(4);
391 hImpPar->SetMarkerColor(4);
392 hImpPar->SetMarkerStyle(20);
393 hImpPar->SetMarkerSize(0.6);
397 TH1D* hImpParSoftPi =
new TH1D(Form(
"ImpParSoftPi%s_%d", regions[r].
Data(), i), Form(
"#pi_{s} impact parameter%s, %s, %.1f < p_{T} < %.1f GeV/c; Impact parameter [#mum]; Entries", regionTitle.Data(), listName.Data(), ptLow, ptHigh), 1000, -1000., 1000.);
398 hImpParSoftPi->Sumw2();
399 hImpParSoftPi->SetLineColor(4);
400 hImpParSoftPi->SetMarkerColor(4);
401 hImpParSoftPi->SetMarkerStyle(20);
402 hImpParSoftPi->SetMarkerSize(0.6);
403 list->Add(hImpParSoftPi);
406 TH1D* hImpParD0 =
new TH1D(Form(
"ImpParD0%s_%d", regions[r].
Data(), i), Form(
"D^{0} impact parameter%s, %s, %.1f < p_{T} < %.1f GeV/c; Impact parameter [#mum]; Entries", regionTitle.Data(), listName.Data(), ptLow, ptHigh), 1000, -1000., 1000.);
408 hImpParD0->SetLineColor(4);
409 hImpParD0->SetMarkerColor(4);
410 hImpParD0->SetMarkerStyle(20);
411 hImpParD0->SetMarkerSize(0.6);
412 list->Add(hImpParD0);
415 TH1D* hImpParD0K =
new TH1D(Form(
"ImpParD0K%s_%d", regions[r].
Data(), i), Form(
"K (from D^{0}) impact parameter%s, %s, %.1f < p_{T} < %.1f GeV/c; Impact parameter [#mum]; Entries", regionTitle.Data(), listName.Data(), ptLow, ptHigh), 1000, -1000., 1000.);
417 hImpParD0K->SetLineColor(4);
418 hImpParD0K->SetMarkerColor(4);
419 hImpParD0K->SetMarkerStyle(20);
420 hImpParD0K->SetMarkerSize(0.6);
421 list->Add(hImpParD0K);
424 TH1D* hImpParD0K2 =
new TH1D(Form(
"ImpParD0K2%s_%d", regions[r].
Data(), i), Form(
"K (from D^{0}) impact parameter (no recalc prim vtx)%s, %s, %.1f < p_{T} < %.1f GeV/c; Impact parameter [#mum]; Entries", regionTitle.Data(), listName.Data(), ptLow, ptHigh), 1000, -1000., 1000.);
425 hImpParD0K2->Sumw2();
426 hImpParD0K2->SetLineColor(4);
427 hImpParD0K2->SetMarkerColor(4);
428 hImpParD0K2->SetMarkerStyle(20);
429 hImpParD0K2->SetMarkerSize(0.6);
430 list->Add(hImpParD0K2);
433 TH1D* hImpParD0Pi =
new TH1D(Form(
"ImpParD0Pi%s_%d", regions[r].
Data(), i), Form(
"#pi (from D^{0}) impact parameter%s, %s, %.1f < p_{T} < %.1f GeV/c; Impact parameter [#mum]; Entries", regionTitle.Data(), listName.Data(), ptLow, ptHigh), 1000, -1000., 1000.);
434 hImpParD0Pi->Sumw2();
435 hImpParD0Pi->SetLineColor(4);
436 hImpParD0Pi->SetMarkerColor(4);
437 hImpParD0Pi->SetMarkerStyle(20);
438 hImpParD0Pi->SetMarkerSize(0.6);
439 list->Add(hImpParD0Pi);
442 TH1D* hImpParD0Pi2 =
new TH1D(Form(
"ImpParD0Pi2%s_%d", regions[r].
Data(), i), Form(
"#pi (from D^{0}) impact parameter (no recalc prim vtx)%s, %s, %.1f < p_{T} < %.1f GeV/c; Impact parameter [#mum]; Entries", regionTitle.Data(), listName.Data(), ptLow, ptHigh), 1000, -1000., 1000.);
443 hImpParD0Pi2->Sumw2();
444 hImpParD0Pi2->SetLineColor(4);
445 hImpParD0Pi2->SetMarkerColor(4);
446 hImpParD0Pi2->SetMarkerStyle(20);
447 hImpParD0Pi2->SetMarkerSize(0.6);
448 list->Add(hImpParD0Pi2);
454 TH1D* hProdd0d0All =
new TH1D(Form(
"Prodd0d0All_%d", i), Form(
"d0d0, no cut, %s; d0d0 [cm^{2}]; Entries", listName.Data()), 2000, -0.0002, 0.0002);
455 hProdd0d0All->Sumw2();
456 hProdd0d0All->SetLineColor(4);
457 hProdd0d0All->SetMarkerColor(4);
458 hProdd0d0All->SetMarkerStyle(20);
459 hProdd0d0All->SetMarkerSize(0.6);
460 list->Add(hProdd0d0All);
462 TH1D* hCosPntAngleAll =
new TH1D(Form(
"CosPntAngleAll_%d", i), Form(
"cos #theta_{point}, no cut, %s; cos #theta_{point}; Entries", listName.Data()), 2000, -1, 1);
463 hCosPntAngleAll->Sumw2();
464 hCosPntAngleAll->SetLineColor(4);
465 hCosPntAngleAll->SetMarkerColor(4);
466 hCosPntAngleAll->SetMarkerStyle(20);
467 hCosPntAngleAll->SetMarkerSize(0.6);
468 list->Add(hCosPntAngleAll);
470 TH1D* hNormDecLenAll =
new TH1D(Form(
"NormDecLenAll_%d", i), Form(
"Normalized decay length, no cut, %s; Normalized decay length; Entries", listName.Data()), 2000, 0, 20);
471 hNormDecLenAll->Sumw2();
472 hNormDecLenAll->SetLineColor(4);
473 hNormDecLenAll->SetMarkerColor(4);
474 hNormDecLenAll->SetMarkerStyle(20);
475 hNormDecLenAll->SetMarkerSize(0.6);
476 list->Add(hNormDecLenAll);
482 Int_t sparseBins[3] = {1000, 1000, 1000};
Double_t sparseLow[3] = {-0.5, -0.5, -0.5};
Double_t sparseHigh[3] = {999.5, 999.5, 999.5};
483 THnSparseF* hPDG =
new THnSparseF(
"PDGMotherPeak",
"PDG mother, peak region, background", 3, sparseBins, sparseLow, sparseHigh);
491 Float_t ptHigh = ptLimits[(i+1)];
493 TH1D* hImpParTrue =
new TH1D(Form(
"ImpParTrue_%d", i), Form(
"True D* impact parameter, %s, %.1f < p_{T} < %.1f GeV/c; Impact parameter [#mum]; Entries", listName.Data(), ptLow, ptHigh), 1000, -1000., 1000.);
494 hImpParTrue->Sumw2();
495 hImpParTrue->SetLineColor(4);
496 hImpParTrue->SetMarkerColor(4);
497 hImpParTrue->SetMarkerStyle(20);
498 hImpParTrue->SetMarkerSize(0.6);
499 list->Add(hImpParTrue);
506 list->Add(pSingleSideband);
513 list->Add(pSidebandCut);
516 list->Add(pSidebandWindow);
523 Error(
"UserExec",
"NO EVENT FOUND!");
528 TClonesArray *arrayCand = 0;
532 if (!aodEvent && AODEvent() && IsStandardAOD()) {
533 aodEvent =
dynamic_cast<AliAODEvent*
> (AODEvent());
534 AliAODHandler* aodHandler = (AliAODHandler*) ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
535 if(aodHandler->GetExtensions()) {
536 AliAODExtension *ext = (AliAODExtension*) aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
538 arrayCand = (TClonesArray*) aodFromExt->GetList()->FindObject(
"Dstar");
542 arrayCand = (TClonesArray*) aodEvent->GetList()->FindObject(
"Dstar");
545 Int_t pdgDgDStartoD0pi[2] = {421, 211};
546 Int_t pdgDgD0toKpi[2] = {321, 211};
548 TClonesArray *mcArray = 0;
549 AliAODMCHeader *mcHeader = 0;
551 mcArray =
dynamic_cast<TClonesArray*
>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
553 AliError(
"Could not find Monte-Carlo in AOD");
557 mcHeader = (AliAODMCHeader*) aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
559 printf(
"AliAnalysisTaskSEDplus::UserExec: MC header branch not found!\n");
564 if (!aodEvent->GetPrimaryVertex() || TMath::Abs(aodEvent->GetMagneticField()) < 0.001) {
578 AliAODVertex *vtx1 = (AliAODVertex*) aodEvent->GetPrimaryVertex();
579 if (!vtx1 || vtx1->GetNContributors() < 1) {
585 AliInfo(
"Could not find array of HF vertices, skipping the event");
589 AliDebug(2, Form(
"Found %d vertices", arrayCand->GetEntriesFast()));
595 Int_t nSelectedProd = 0;
596 Int_t nSelectedAna = 0;
598 Int_t nCand = arrayCand->GetEntriesFast();
599 for (
Int_t iCand = 0; iCand<nCand; iCand++) {
615 if (ptBin < 0 || ptBin >=
fNPtBins) {
640 AliAODMCParticle *partDSt = 0;
642 Int_t mcLabel = cand->
MatchToMC(413, 421, pdgDgDStartoD0pi, pdgDgD0toKpi, mcArray);
648 partDSt = (AliAODMCParticle*) mcArray->At(mcLabel);
655 if (
IsFromB(mcArray, partDSt)) {
687 ((
TH1D*)
fListBackground->FindObject(Form(
"CosPntAngleAll_%d", ptBin)))->Fill(cosPntAngle);
698 if(!aodEvent->GetPrimaryVertex()){
702 fNewPrimVtx =
new AliAODVertex(*aodEvent->GetPrimaryVertex());
715 d0 = TMath::Abs(d0*1.e4);
723 d0 = TMath::Abs(d0*1.e4);
731 d0 = TMath::Abs(d0*1.e4);
747 AliAODTrack *daughters[3];
748 daughters[0] = candSoftPi;
750 if (((AliAODTrack*) candD0->GetDaughter(0))->Charge()*cand->Charge() > 0) {
752 daughters[1] = (AliAODTrack*) candD0->GetDaughter(0);
753 daughters[2] = (AliAODTrack*) candD0->GetDaughter(1);
756 daughters[1] = (AliAODTrack*) candD0->GetDaughter(1);
757 daughters[2] = (AliAODTrack*) candD0->GetDaughter(0);
760 Double_t PDGCodes[3] = {0., 0., 0.};
762 for (
Int_t iD=0; iD<3; iD++) {
763 AliAODTrack *daughter = daughters[iD];
765 Int_t daughterLabel = daughter->GetLabel();
766 if (daughterLabel >= 0) {
767 AliAODMCParticle *daughterMC = (AliAODMCParticle*) mcArray->At(daughterLabel);
768 Int_t motherLabel = daughterMC->GetMother();
769 if (motherLabel >= 0) {
770 AliAODMCParticle *motherMC = (AliAODMCParticle*) mcArray->At(motherLabel);
771 Int_t motherPDG = TMath::Abs(motherMC->GetPdgCode());
775 PDGCodes[iD] = motherPDG;
780 Int_t grandmotherLabel = motherMC->GetMother();
781 if (grandmotherLabel >= 0) {
782 AliAODMCParticle *grandmotherMC = (AliAODMCParticle*) mcArray->At(grandmotherLabel);
783 Int_t grandmotherPDG = TMath::Abs(grandmotherMC->GetPdgCode());
784 PDGCodes[iD] = grandmotherPDG;
791 ((THnSparseF*)
fListBackground->FindObject(
"PDGMotherPeak"))->Fill(PDGCodes);
824 AliAODVertex *vtxAOD = aod->GetPrimaryVertex();
830 if (!title.Contains(
"VertexerTracks")) {
834 AliVertexerTracks *vertexer =
new AliVertexerTracks(aod->GetMagneticField());
836 vertexer->SetITSMode();
837 vertexer->SetMinClusters(3);
838 vertexer->SetConstraintOff();
840 if (title.Contains(
"WithConstraint")) {
842 aod->GetDiamondCovXY(diamondcovxy);
843 Double_t pos[3] = {aod->GetDiamondX(), aod->GetDiamondY(), 0.};
844 Double_t cov[6] = {diamondcovxy[0], diamondcovxy[1], diamondcovxy[2], 0., 0., 10.*10.};
845 AliESDVertex *diamond =
new AliESDVertex(pos, cov, 1., 1);
846 vertexer->SetVtxStart(diamond);
847 delete diamond; diamond=NULL;
850 Int_t skipped[10];
for(
Int_t i=0; i<10; i++) { skipped[i] = -1; }
851 Int_t nTrksToSkip = 0, id;
854 for (
Int_t i=0; i<3; i++) {
860 t = (AliAODTrack*) twoProng->GetDaughter(i-1);
863 id = (
Int_t) t->GetID();
867 skipped[nTrksToSkip++] = id;
870 vertexer->SetSkipTracks(nTrksToSkip, skipped);
871 AliESDVertex *vtxESDNew = vertexer->FindPrimaryVertex(aod);
873 delete vertexer; vertexer = NULL;
879 if (vtxESDNew->GetNContributors() <= 0) {
880 delete vtxESDNew; vtxESDNew = NULL;
885 Double_t pos[3], cov[6], chi2perNDF;
886 vtxESDNew->GetXYZ(pos);
887 vtxESDNew->GetCovMatrix(cov);
888 chi2perNDF = vtxESDNew->GetChi2toNDF();
889 delete vtxESDNew; vtxESDNew = NULL;
891 AliAODVertex *vtxAODNew =
new AliAODVertex(pos, cov, chi2perNDF);
902 AliNeutralTrackParam *ntpD0 =
new AliNeutralTrackParam(candD0);
905 AliESDtrack *candSoftPiESD =
new AliESDtrack(candSoftPi);
909 tracks->AddAt(candSoftPiESD, 0);
910 tracks->AddAt(ntpD0, 1);
916 AliESDVertex *newPrimVtxESD =
new AliESDVertex(pos, cov, 100., 100,
fNewPrimVtx->GetName());
918 AliVertexerTracks *vertexerTracks =
new AliVertexerTracks(
fMagneticField);
919 vertexerTracks->SetVtxStart(newPrimVtxESD);
920 AliESDVertex *vertexESD = (AliESDVertex*) vertexerTracks->VertexForSelectedESDTracks(tracks);
925 if (vertexESD->GetNContributors() != 2) {
926 delete vertexESD; vertexESD = 0;
930 Double_t vertRadius2 = vertexESD->GetX()*vertexESD->GetX() + vertexESD->GetY()*vertexESD->GetY();
931 if (vertRadius2 > 8.) {
933 delete vertexESD; vertexESD = 0;
937 Double_t pos2[3], cov2[6], chi2perNDF;
938 vertexESD->GetXYZ(pos2);
939 vertexESD->GetCovMatrix(cov2);
940 chi2perNDF = vertexESD->GetChi2toNDF();
942 delete vertexESD; vertexESD = 0;
944 AliAODVertex *vertexAOD =
new AliAODVertex(pos2, cov2, chi2perNDF, 0x0, -1, AliAODVertex::kUndef, 2);
952 Double_t invMassDiffAbs = TMath::Abs(invMassDiff);
966 if (invMassDiffAbs < peakCut) {
972 invMassDiff = invMassDiffAbs;
975 if (invMassDiff > sidebandCut && invMassDiff <= sidebandCut+sidebandWindow) {
982 Int_t mother = mcPartCandidate->GetMother();
984 AliAODMCParticle *mcGranma =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(mother));
986 Int_t pdgGranma = mcGranma->GetPdgCode();
987 Int_t abspdgGranma = TMath::Abs(pdgGranma);
988 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)) {
991 mother = mcGranma->GetMother();
994 AliError(
"Failed casting the mother particle!");
1004 Int_t mother = mcPartCandidate->GetMother();
1005 while (mother > 0) {
1006 AliAODMCParticle *mcGranma =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(mother));
1008 Int_t pdgGranma = mcGranma->GetPdgCode();
1009 Int_t abspdgGranma = TMath::Abs(pdgGranma);
1010 if (abspdgGranma == 4 || abspdgGranma == 5) {
1013 mother = mcGranma->GetMother();
1016 AliError(
"Failed casting the mother particle!");
1026 AliExternalTrackParam etp;
1027 etp.CopyFromVTrack(track);
1032 d0Err = TMath::Sqrt(covdz[0]);
1043 Double_t p[3] = {cand->Px(), cand->Py(), cand->Pz()};
1044 Double_t ptsq = p[0]*p[0] + p[1]*p[1];
1049 Double_t k = - (sec[0]-prim[0])*p[0] - (sec[1]-prim[1])*p[1];
1051 Double_t dx = sec[0] - prim[0] + k*p[0];
1052 Double_t dy = sec[1] - prim[1] + k*p[1];
1053 Double_t absImpPar = TMath::Sqrt(dx*dx+dy*dy);
1055 TVector3 mom(p[0], p[1], p[2]);
1056 TVector3 fline(sec[0]-prim[0], sec[1]-prim[1], sec[2]-prim[2]);
1057 TVector3 cross = mom.Cross(fline);
1059 return (cross.Z() > 0. ? absImpPar : -absImpPar);
1065 AliAODTrack *tr1 = (AliAODTrack*) candD0->GetDaughter(0);
1066 AliAODTrack *tr2 = (AliAODTrack*) candD0->GetDaughter(1);
1067 AliAODTrack *tr3 = (AliAODTrack*) cand->
GetBachelor();
1069 Int_t label1 = tr1->GetLabel();
1070 Int_t label2 = tr2->GetLabel();
1071 Int_t label3 = tr3->GetLabel();
1073 if (label1 < 0 || label2 < 0 || label3 < 0) {
1077 AliAODMCParticle *part1 = (AliAODMCParticle*) arrayMC->At(label1);
1078 AliAODMCParticle *part2 = (AliAODMCParticle*) arrayMC->At(label2);
1079 AliAODMCParticle *part3 = (AliAODMCParticle*) arrayMC->At(label3);
1081 if (part1 == 0 || part2 == 0 || part3 == 0) {
1085 Double_t PxTotal = part1->Px()+part2->Px()+part3->Px();
1086 Double_t PyTotal = part1->Py()+part2->Py()+part3->Py();
1087 Double_t PzTotal = part1->Pz()+part2->Pz()+part3->Pz();
1091 Double_t prim[3] = {headerMC->GetVtxX(), headerMC->GetVtxY(), headerMC->GetVtxZ()};
1092 Double_t sec[3] = {part3->Xv(), part3->Yv(), part3->Zv()};
1093 Double_t p[3] = {PxTotal, PyTotal, PzTotal};
1096 Double_t ptsq = p[0]*p[0] + p[1]*p[1];
1097 Double_t k = - (sec[0]-prim[0])*p[0] - (sec[1]-prim[1])*p[1];
1099 Double_t dx = sec[0] - prim[0] + k*p[0];
1100 Double_t dy = sec[1] - prim[1] + k*p[1];
1101 Double_t absImpPar = TMath::Sqrt(dx*dx+dy*dy)*1.e4;
1103 TVector3 mom(p[0], p[1], p[2]);
1104 TVector3 fline(sec[0]-prim[0], sec[1]-prim[1], sec[2]-prim[2]);
1105 TVector3 cross = mom.Cross(fline);
1107 return cross.Z() > 0. ? absImpPar : -absImpPar;
1120 FillHistogram(Form(
"DeltaInvMass_%d", ptBin), deltaInvMass);
1152 AliAODTrack *
pi; AliAODTrack *K;
Int_t piId, KId;
1153 if (((AliAODTrack*) candD0->GetDaughter(0))->Charge()*cand->Charge() > 0) {
1161 pi = (AliAODTrack*) candD0->GetDaughter(piId);
1162 K = (AliAODTrack*) candD0->GetDaughter(KId);
1173 d0 = candD0->Getd0Prong(piId);
1188 d0 = candD0->Getd0Prong(KId);
1194 AliAODVertex *origVtx = 0;
Double_t NormalizedDecayLengthXY() const
Double_t fSidebandCut[30]
Bool_t IsFromHijing(TClonesArray *arrayMC, const AliAODMCParticle *mcPartCandidate)
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
Double_t fSidebandWindow[30]
Double_t DeltaInvMass() const
void FillRegionHistogram(const char *name, Double_t value)
Bool_t CalculateImpactParameter(AliAODTrack *track, Double_t &d0, Double_t &d0Err)
Int_t MatchToMC(Int_t pdgabs, Int_t pdgabs2prong, Int_t *pdgDg, Int_t *pdgDg2prong, TClonesArray *mcArray, Bool_t isV0=kFALSE) const
virtual void UserExec(Option_t *option)
void UnsetOwnPrimaryVtx()
Double_t ImpParXY() const
void FillHistograms(AliAODRecoCascadeHF *cand)
void FillHistogram(const char *name, Double_t value)
Double_t Prodd0d0() const
virtual ~AliAnalysisTaskSEDStarCharmFraction()
void SetUpList(TList *list)
TList * fListSignalPrompt
Double_t CalculateImpactParameterDStar(AliAODRecoCascadeHF *cand)
AliAODTrack * GetBachelor() const
AliAODVertex * GetOwnPrimaryVtx() const
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel, AliAODEvent *aod)
void CheckInvMassDStar(AliAODRecoCascadeHF *cand)
AliNormalizationCounter * fCounter
AliAODVertex * RemoveDaughtersFromPrimaryVtx(AliAODEvent *aod, AliAODRecoCascadeHF *cand)
AliAODVertex * fNewPrimVtx
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
Short_t fSignalTypeForTree
virtual void Terminate(Option_t *option)
Bool_t IsEventSelected(AliVEvent *event)
AliAnalysisTaskSEDStarCharmFraction()
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999, Double_t spherocity=-99.)
AliAODVertex * ReconstructDStarVtx(AliAODRecoCascadeHF *cand)
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
AliRDHFCutsDStartoKpipi * fCuts
Float_t * GetPtBinLimits() const
Double_t CalculateTrueImpactParameterDStar(AliAODMCHeader *headerMC, TClonesArray *arrayMC, AliAODRecoCascadeHF *cand)
Double_t fTrueImpParForTree
Double_t InvMassD0() const
void FillTrueImpactParameter(AliAODRecoCascadeHF *cand)
Bool_t IsFromB(TClonesArray *arrayMC, const AliAODMCParticle *mcPartCandidate)
Double_t CosPointingAngle() const
AliAODRecoDecayHF2Prong * Get2Prong() const
virtual void UserCreateOutputObjects()
Int_t PtBin(Double_t pt) const