25 #include <TClonesArray.h>
31 #include <THnSparse.h>
32 #include <TDatabasePDG.h>
33 #include <Riostream.h>
35 #include "AliAnalysisManager.h"
36 #include "AliAODHandler.h"
37 #include "AliAODEvent.h"
38 #include "AliAODVertex.h"
39 #include "AliAODTrack.h"
40 #include "AliAODMCHeader.h"
41 #include "AliAODMCParticle.h"
42 #include "AliAODRecoDecay.h"
46 #include "AliAnalysisTaskSE.h"
68 fWriteOnlySignal(kFALSE),
69 fDoCutVarHistos(kTRUE),
70 fUseSelectionBit(kFALSE),
83 for(Int_t i=0;i<3;i++){
87 for(Int_t i=0;i<4;i++) {
112 for(Int_t i=0;i<kMaxPtBins+1;i++){
115 for (Int_t i=0; i<4; i++) {
122 AliAnalysisTaskSE(name),
131 fFillNtuple(fillNtuple),
133 fWriteOnlySignal(kFALSE),
134 fDoCutVarHistos(kTRUE),
135 fUseSelectionBit(kFALSE),
142 fAnalysisCuts(analysiscuts),
149 for(Int_t i=0;i<3;i++){
153 for(Int_t i=0;i<4;i++) {
178 for(Int_t i=0;i<kMaxPtBins+1;i++){
182 for (Int_t i=0; i<4; i++) {
190 DefineOutput(1,TList::Class());
192 DefineOutput(2,TList::Class());
194 DefineOutput(3,AliNormalizationCounter::Class());
198 DefineOutput(4,TNtuple::Class());
207 printf(
"Max. number of Pt bins = %d\n",
kMaxPtBins);
221 printf(
"Number of Pt bins = %d\n",
fNPtBins);
231 for(Int_t i=0;i<4;i++){
261 for(Int_t i=0;i<3;i++){
268 for (Int_t i=0; i<4; i++) {
285 if(fDebug > 1) printf(
"AnalysisTaskSEDs::Init() \n");
292 analysis->SetName(
"AnalysisCuts");
304 if(fDebug > 1) printf(
"AnalysisTaskSEDs::UserCreateOutputObjects() \n");
309 fOutput->SetName(
"OutputHistos");
311 fHistNEvents =
new TH1F(
"hNEvents",
"number of events ",13,-0.5,12.5);
313 fHistNEvents->GetXaxis()->SetBinLabel(2,
"n. passing IsEvSelected");
314 fHistNEvents->GetXaxis()->SetBinLabel(3,
"n. rejected due to trigger");
315 fHistNEvents->GetXaxis()->SetBinLabel(4,
"n. rejected due to not reco vertex");
316 fHistNEvents->GetXaxis()->SetBinLabel(5,
"n. rejected for contr vertex");
317 fHistNEvents->GetXaxis()->SetBinLabel(6,
"n. rejected for vertex out of accept");
318 fHistNEvents->GetXaxis()->SetBinLabel(7,
"n. rejected for pileup events");
319 fHistNEvents->GetXaxis()->SetBinLabel(8,
"no. of out centrality events");
320 fHistNEvents->GetXaxis()->SetBinLabel(9,
"no. of 3 prong candidates");
321 fHistNEvents->GetXaxis()->SetBinLabel(10,
"no. of Ds after filtering cuts");
322 fHistNEvents->GetXaxis()->SetBinLabel(11,
"no. of Ds after selection cuts");
323 fHistNEvents->GetXaxis()->SetBinLabel(12,
"no. of not on-the-fly rec Ds");
332 fHistCentrality[1]=
new TH1F(
"hCentr(selectedCent)",
"centrality(selectedCent)",10000,0.,100.);
333 fHistCentrality[2]=
new TH1F(
"hCentr(OutofCent)",
"centrality(OutofCent)",10000,0.,100.);
334 fHistCentralityMult[0]=
new TH2F(
"hCentrMult",
"centrality vs mult",100,0.5,30000.5,40,0.,100.);
335 fHistCentralityMult[1]=
new TH2F(
"hCentrMult(selectedCent)",
"centrality vs mult(selectedCent)",100,0.5,30000.5,40,0.,100.);
336 fHistCentralityMult[2]=
new TH2F(
"hCentrMult(OutofCent)",
"centrality vs mult(OutofCent)",100,0.5,30000.5,40,0.,100.);
337 for(Int_t i=0;i<3;i++){
344 Double_t massDs=TDatabasePDG::Instance()->GetParticle(431)->Mass();
347 if(nInvMassBins%2==1) nInvMassBins++;
356 for(Int_t iType=0; iType<4; iType++){
371 hisname.Form(
"hMass%sPt%d",htype.Data(),i);
374 hisname.Form(
"hMass%sPt%dphi",htype.Data(),i);
377 hisname.Form(
"hMass%sPt%dk0st",htype.Data(),i);
380 hisname.Form(
"hCosP%sPt%d",htype.Data(),i);
381 fCosPHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
383 hisname.Form(
"hDLen%sPt%d",htype.Data(),i);
384 fDLenHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
386 hisname.Form(
"hSumd02%sPt%d",htype.Data(),i);
387 fSumd02Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
389 hisname.Form(
"hSigVert%sPt%d",htype.Data(),i);
390 fSigVertHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
392 hisname.Form(
"hPtMax%sPt%d",htype.Data(),i);
393 fPtMaxHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,20.);
395 hisname.Form(
"hPtCand%sPt%d",htype.Data(),i);
396 fPtCandHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,20.);
398 hisname.Form(
"hDCA%sPt%d",htype.Data(),i);
399 fDCAHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
401 hisname.Form(
"hPtProng0%sPt%d",htype.Data(),i);
402 fPtProng0Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.0,20.);
404 hisname.Form(
"hPtProng1%sPt%d",htype.Data(),i);
405 fPtProng1Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.0,20.);
407 hisname.Form(
"hPtProng2%sPt%d",htype.Data(),i);
408 fPtProng2Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.0,20.);
410 hisname.Form(
"hDalitz%sPt%d",htype.Data(),i);
411 fDalitz[index]=
new TH2F(hisname.Data(),hisname.Data(),100,0.,2.,100,0.,2.);
413 hisname.Form(
"hDalitz%sPt%dphi",htype.Data(),i);
414 fDalitzPhi[index]=
new TH2F(hisname.Data(),hisname.Data(),100,0.,2.,100,0.,2.);
416 hisname.Form(
"hDalitz%sPt%dk0st",htype.Data(),i);
417 fDalitzK0st[index]=
new TH2F(hisname.Data(),hisname.Data(),100,0.,2.,100,0.,2.);
443 fChanHist[0] =
new TH1F(
"hChanAll",
"KKpi and piKK candidates",64,-0.5,63.5);
444 fChanHist[1] =
new TH1F(
"hChanSig",
"KKpi and piKK candidates",64,-0.5,63.5);
445 fChanHist[2] =
new TH1F(
"hChanBkg",
"KKpi and piKK candidates",64,-0.5,63.5);
446 fChanHist[3] =
new TH1F(
"hChanReflSig",
"KKpi and piKK candidates",64,-0.5,63.5);
447 for(Int_t i=0;i<4;i++){
454 fPtVsMass=
new TH2F(
"hPtVsMass",
"PtVsMass (prod. cuts)",nInvMassBins,minMass,maxMass,40,0.,20.);
455 fPtVsMassPhi=
new TH2F(
"hPtVsMassPhi",
"PtVsMass (phi selection)",nInvMassBins,minMass,maxMass,200,0.,20.);
456 fPtVsMassK0st=
new TH2F(
"hPtVsMassK0st",
"PtVsMass (K0* selection)",nInvMassBins,minMass,maxMass,200,0.,20.);
457 fYVsPt=
new TH2F(
"hYVsPt",
"YvsPt (prod. cuts)",40,0.,20.,80,-2.,2.);
458 fYVsPtSig=
new TH2F(
"hYVsPtSig",
"YvsPt (MC, only sig., prod. cuts)",40,0.,20.,80,-2.,2.);
461 hisname.Form(
"hMassKKPt%d",i);
462 fMassHistKK[i]=
new TH1F(hisname.Data(),hisname.Data(),200,0.95,1.35);
465 hisname.Form(
"hMassKpiPt%d",i);
466 fMassHistKpi[i]=
new TH1F(hisname.Data(),hisname.Data(),200,0.7,1.1);
477 const Int_t nvarsReco = 16;
478 const Int_t nvarsAcc = 2;
479 Int_t nBinsReco[nvarsReco] = {500,20,60,1000,1000,500,500,50,50,100,100,100,400,400,400,400};
480 Int_t nBinsAcc[nvarsAcc] = {100,20};
481 Double_t xminAcc[nvarsAcc] = {0.,-1.};
482 Double_t xmaxAcc[nvarsAcc] = {100.,1.};
483 Double_t xminReco[nvarsReco] = {1.5,0.,0.,0.,0.,0.,0.,0.5,0.5,0.,0.,0.,-10.,-10.,-10.,-10.};
484 Double_t xmaxReco[nvarsReco] = {2.5,20.,0.03,5.,5.,500.,500.,1.,1.,0.1,1.,1.,10.,10.,10.,10.};
485 TString axis[nvarsReco] = {
"invMassAllPhi",
"p_{T}",
"#Delta Mass(KK)",
"dlen",
"dlen_{xy}",
"normdl",
"normdl_{xy}",
"cosP",
"cosP_{xy}",
486 "sigVert",
"cosPiDs",
"|cosPiKPhi^{3}|",
"normIP",
"normIP_kaon1",
"normIP_kaon2",
"normIP_pion"};
488 const Int_t nvarsIP = 6;
489 Int_t nBinsIP[nvarsIP] = {20,400,400,400,400,3};
490 Double_t xminIP[nvarsIP] = {0.,-10.,-10.,-10.,-10.,0.};
491 Double_t xmaxIP[nvarsIP] = {20.,10.,10.,10.,10.,3.};
492 TString axisIP[nvarsIP] = {
"motherPt",
"maxNormImp",
"IP0",
"IP1",
"IP2",
"candType"};
497 TString label[nvarsAcc] = {
"fromC",
"fromB"};
498 for (Int_t i=0; i<2; i++) {
499 fnSparseMC[i] =
new THnSparseF(Form(
"fnSparseAcc_%s",label[i].
Data()),Form(
"MC nSparse (Acc.Step)- %s",label[i].
Data()),
500 nvarsAcc, nBinsAcc, xminAcc, xmaxAcc);
501 fnSparseMC[i]->GetAxis(0)->SetTitle(
"p_{T} (GeV/c)");
505 for (Int_t i=2; i<4; i++) {
506 fnSparseMC[i] =
new THnSparseF(Form(
"fnSparseReco_%s",label[i-2].
Data()),Form(
"MC nSparse (Reco Step)- %s",label[i-2].
Data()),
507 nvarsReco, nBinsReco, xminReco, xmaxReco);
508 for (Int_t j=0; j<nvarsReco; j++) {
514 fnSparseIP =
new THnSparseF(
"fnSparseIP",
"nSparseIP", nvarsIP, nBinsIP, xminIP, xmaxIP);
515 for (Int_t j=0; j<nvarsIP; j++) {
518 fnSparseIP->GetAxis(5)->SetTitle(
"candType (0.5=bkg; 1.5=prompt; 2.5=FD)");
522 fnSparse =
new THnSparseF(
"fnSparse",
"nSparse", nvarsReco, nBinsReco, xminReco, xmaxReco);
523 for (Int_t j=0; j<nvarsReco; j++) {
524 fnSparse->GetAxis(j)->SetTitle(Form(
"%s",axis[j].
Data()));
540 fNtupleDs =
new TNtuple(
"fNtupleDs",
"Ds",
"labDs:retcode:pdgcode0:Pt0:Pt1:Pt2:PtRec:P0:P1:P2:PidTrackBit0:PidTrackBit1:PidTrackBit2:PointingAngle:PointingAngleXY:DecLeng:DecLengXY:NorDecLeng:NorDecLengXY:InvMassKKpi:InvMasspiKK:sigvert:d00:d01:d02:dca:d0square:InvMassPhiKKpi:InvMassPhipiKK:InvMassK0starKKpi:InvMassK0starpiKK:cosinePiDsFrameKKpi:cosinePiDsFramepiKK:cosineKPhiFrameKKpi:cosineKPhiFramepiKK:centrality:runNumber");
554 AliAODEvent *aod =
dynamic_cast<AliAODEvent*
> (InputEvent());
556 TClonesArray *array3Prong = 0;
557 if(!aod && AODEvent() && IsStandardAOD()) {
560 aod =
dynamic_cast<AliAODEvent*
> (AODEvent());
563 AliAODHandler* aodHandler = (AliAODHandler*)
564 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
565 if(aodHandler->GetExtensions()) {
566 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
567 AliAODEvent *aodFromExt = ext->GetAOD();
568 array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject(
"Charm3Prong");
571 array3Prong=(TClonesArray*)aod->GetList()->FindObject(
"Charm3Prong");
574 if(!aod || !array3Prong) {
575 printf(
"AliAnalysisTaskSEDs::UserExec: Charm3Prong branch not found!\n");
582 if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001)
return;
593 Float_t ntracks=aod->GetNumberOfTracks();
610 Int_t runNumber=aod->GetRunNumber();
614 TClonesArray *arrayMC=0;
615 AliAODMCHeader *mcHeader=0;
618 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
624 arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
626 printf(
"AliAnalysisTaskSEDs::UserExec: MC particles branch not found!\n");
631 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
633 printf(
"AliAnalysisTaskSEDs::UserExec: MC header branch not found!\n");
640 if(aod->GetTriggerMask()==0 && (runNumber>=195344 && runNumber<=195677))
646 Double_t zMCVertex = mcHeader->GetVtxZ();
657 Int_t n3Prong = array3Prong->GetEntriesFast();
658 if(fDebug>1) printf(
"Number of Ds->KKpi: %d\n",n3Prong);
661 Int_t pdgDstoKKpi[3]={321,321,211};
664 Double_t massPhi=TDatabasePDG::Instance()->GetParticle(333)->Mass();
671 for (Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
687 Bool_t unsetvtx=kFALSE;
693 Bool_t recVtx=kFALSE;
694 AliAODVertex *origownvtx=0x0;
696 Double_t ptCand = d->Pt();
698 Double_t rapid=d->
YDs();
699 fYVsPt->Fill(ptCand,rapid);
702 if(!isFidAcc)
continue;
705 Int_t retCodeNoRes=retCodeAnalysisCuts;
712 Double_t massKK = 0.;
715 massKK=d->InvMass2Prongs(0,1,321,321);
716 Double_t massKp=d->InvMass2Prongs(1,2,321,211);
721 massKK=d->InvMass2Prongs(1,2,321,321);
722 Double_t massKp=d->InvMass2Prongs(0,1,211,321);
727 Int_t isKKpi=retCodeAnalysisCuts&1;
728 Int_t ispiKK=retCodeAnalysisCuts&2;
729 Int_t isPhiKKpi=retCodeAnalysisCuts&4;
730 Int_t isPhipiKK=retCodeAnalysisCuts&8;
731 Int_t isK0starKKpi=retCodeAnalysisCuts&16;
732 Int_t isK0starpiKK=retCodeAnalysisCuts&32;
734 if(retCodeAnalysisCuts<=0)
continue;
749 Double_t weightKKpi=1.;
750 Double_t weightpiKK=1.;
754 if(weightKKpi>1. || weightKKpi<0.) weightKKpi=0.;
755 if(weightpiKK>1. || weightpiKK<0.) weightpiKK=0.;
761 Double_t invMass = 0.;
762 Int_t indexMCKKpi=-1;
763 Int_t indexMCpiKK=-1;
771 labDs = d->MatchToMC(431,arrayMC,3,pdgDstoKKpi);
773 Int_t labDau0=((AliAODTrack*)d->GetDaughter(0))->GetLabel();
774 AliAODMCParticle* p=(AliAODMCParticle*)arrayMC->UncheckedAt(TMath::Abs(labDau0));
775 pdgCode0=TMath::Abs(p->GetPdgCode());
808 Double_t candType = 0.5;
812 fMassHist[index]->Fill(invMass,weightKKpi);
813 fPtVsMass->Fill(invMass,ptCand,weightKKpi);
822 if(
fReadMC && indexMCKKpi!=-1){
823 fMassHist[indexMCKKpi]->Fill(invMass,weightKKpi);
828 AliAODMCParticle *partDs = (AliAODMCParticle*)arrayMC->At(labDs);
839 if(isK0starKKpi)
fMassHistK0st[indexMCKKpi]->Fill(invMass,weightKKpi);
844 fMassHist[index]->Fill(invMass,weightpiKK);
845 fPtVsMass->Fill(invMass,ptCand,weightpiKK);
854 if(
fReadMC && indexMCpiKK!=-1){
855 fMassHist[indexMCpiKK]->Fill(invMass,weightpiKK);
860 AliAODMCParticle *partDs = (AliAODMCParticle*)arrayMC->At(labDs);
871 if(isK0starpiKK)
fMassHistK0st[indexMCpiKK]->Fill(invMass,weightpiKK);
880 const Int_t nProng = 3;
881 Double_t deltaMassKK=999.;
888 Double_t pt0=d->PtProng(0);
889 Double_t pt1=d->PtProng(1);
890 Double_t pt2=d->PtProng(2);
892 Double_t cosPiDs=-99.;
893 Double_t cosPiKPhi=-99.;
895 Double_t normIPprong[nProng];
897 Double_t tmpNormIP[nProng];
900 massKK = d->InvMass2Prongs(0,1,321,321);
901 deltaMassKK = TMath::Abs(massKK-massPhi);
904 cosPiKPhi = TMath::Abs(cosPiKPhi*cosPiKPhi*cosPiKPhi);
906 for(Int_t ip=0; ip<nProng; ip++) {
907 Double_t diffIP, errdiffIP;
909 tmpNormIP[ip] = diffIP/errdiffIP;
910 if(ip==0) normIP = tmpNormIP[ip];
911 else if(TMath::Abs(tmpNormIP[ip])>TMath::Abs(normIP)) normIP = tmpNormIP[ip];
913 normIPprong[0] = tmpNormIP[0];
914 normIPprong[1] = tmpNormIP[1];
915 normIPprong[2] = tmpNormIP[2];
917 Double_t var4nSparse[16] = {invMass,ptCand,deltaMassKK,dlen,dlenxy,normdl,normdlxy,cosp,cospxy,
918 sigvert,cosPiDs,cosPiKPhi,normIP,normIPprong[0],normIPprong[1],normIPprong[2]};
925 if(candType==1.5)
fnSparseMC[2]->Fill(var4nSparse);
926 if(candType==2.5)
fnSparseMC[3]->Fill(var4nSparse);
931 Double_t tmpNormIP[nProng];
934 massKK = d->InvMass2Prongs(1,2,321,321);
935 deltaMassKK = TMath::Abs(massKK-massPhi);
938 cosPiKPhi = TMath::Abs(cosPiKPhi*cosPiKPhi*cosPiKPhi);
940 for(Int_t ip=0; ip<nProng; ip++) {
941 Double_t diffIP, errdiffIP;
943 tmpNormIP[ip] = diffIP/errdiffIP;
944 if(ip==0) normIP = tmpNormIP[ip];
945 else if(TMath::Abs(tmpNormIP[ip])>TMath::Abs(normIP)) normIP = tmpNormIP[ip];
948 normIPprong[0] = tmpNormIP[2];
949 normIPprong[1] = tmpNormIP[1];
950 normIPprong[2] = tmpNormIP[0];
952 Double_t var4nSparse[16] = {invMass,ptCand,deltaMassKK,dlen,dlenxy,normdl,normdlxy,cosp,cospxy,
953 sigvert,cosPiDs,cosPiKPhi,normIP,normIPprong[0],normIPprong[1],normIPprong[2]};
960 if(candType==1.5)
fnSparseMC[2]->Fill(var4nSparse);
961 if(candType==2.5)
fnSparseMC[3]->Fill(var4nSparse);
966 if(
fReadMC && (isPhiKKpi || isPhiKKpi)) {
967 Double_t var[6] = {ptCand,normIP,normIPprong[0],normIPprong[1],normIPprong[2],candType};
976 Double_t pt0=d->PtProng(0);
977 Double_t pt1=d->PtProng(1);
978 Double_t pt2=d->PtProng(2);
980 Double_t sumD02=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
981 Double_t dca=d->GetDCA();
983 for(Int_t i=0;i<3;i++){
984 if(d->PtProng(i)>
ptmax)ptmax=d->PtProng(i);
996 Double_t massKK=d->InvMass2Prongs(0,1,321,321);
997 Double_t massKp=d->InvMass2Prongs(1,2,321,211);
998 fDalitz[index]->Fill(massKK,massKp);
999 if(isPhiKKpi)
fDalitzPhi[index]->Fill(massKK,massKp);
1000 if(isK0starKKpi)
fDalitzK0st[index]->Fill(massKK,massKp);
1001 if(
fReadMC && indexMCKKpi!=-1){
1002 fDalitz[indexMCKKpi]->Fill(massKK,massKp);
1003 if(isPhiKKpi)
fDalitzPhi[indexMCKKpi]->Fill(massKK,massKp);
1004 if(isK0starKKpi)
fDalitzK0st[indexMCKKpi]->Fill(massKK,massKp);
1018 Double_t massKK=d->InvMass2Prongs(1,2,321,321);
1019 Double_t massKp=d->InvMass2Prongs(0,1,211,321);
1020 fDalitz[index]->Fill(massKK,massKp);
1021 if(isPhipiKK)
fDalitzPhi[index]->Fill(massKK,massKp);
1022 if(isK0starpiKK)
fDalitzK0st[index]->Fill(massKK,massKp);
1025 if(
fReadMC && indexMCpiKK!=-1){
1026 fDalitz[indexMCpiKK]->Fill(massKK,massKp);
1027 if(isPhipiKK)
fDalitzPhi[indexMCpiKK]->Fill(massKK,massKp);
1028 if(isK0starpiKK)
fDalitzK0st[indexMCpiKK]->Fill(massKK,massKp);
1050 AliAODTrack *track0=(AliAODTrack*)d->GetDaughter(0);
1051 AliAODTrack *track1=(AliAODTrack*)d->GetDaughter(1);
1052 AliAODTrack *track2=(AliAODTrack*)d->GetDaughter(2);
1058 tmp[0]=Float_t(labDs);
1060 tmp[1]=Float_t(retCodeAnalysisCuts);
1061 tmp[2]=Float_t(pdgCode0);
1062 tmp[3]=d->PtProng(0);
1063 tmp[4]=d->PtProng(1);
1064 tmp[5]=d->PtProng(2);
1066 tmp[7]=d->PProng(0);
1067 tmp[8]=d->PProng(1);
1068 tmp[9]=d->PProng(2);
1069 tmp[10]=Int_t(bitMapPIDTrack0);
1070 tmp[11]=Int_t(bitMapPIDTrack1);
1071 tmp[12]=Int_t(bitMapPIDTrack2);
1081 tmp[22]=d->Getd0Prong(0);
1082 tmp[23]=d->Getd0Prong(1);
1083 tmp[24]=d->Getd0Prong(2);
1084 tmp[25]=d->GetDCA();
1085 tmp[26]=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
1086 tmp[27]=d->InvMass2Prongs(0,1,321,321);
1087 tmp[28]=d->InvMass2Prongs(1,2,321,321);
1088 tmp[29]=d->InvMass2Prongs(1,2,321,211);
1089 tmp[30]=d->InvMass2Prongs(0,1,211,321);
1094 tmp[35]=(Float_t)(centrality);
1095 tmp[36]=(Float_t)(runNumber);
1127 if(fDebug > 1) printf(
"AnalysisTaskSEDs: Terminate() \n");
1128 fOutput =
dynamic_cast<TList*
> (GetOutputData(1));
1130 printf(
"ERROR: fOutput not available\n");
1135 printf(
"Number of analyzed events = %d\n",(Int_t)
fHistNEvents->GetBinContent(2));
1137 printf(
"ERROR: fHistNEvents not available\n");
1148 Double_t zMCVertex = mcHeader->GetVtxZ();
1150 for(Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++){
1152 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(iPart));
1154 if(TMath::Abs(mcPart->GetPdgCode()) == 431) {
1158 Bool_t isGoodDecay = kFALSE;
1159 Int_t labDau[3] = {-1,-1,-1};
1160 Bool_t isFidAcc = kFALSE;
1161 Bool_t isDaugInAcc = kFALSE;
1164 if(deca == 1) isGoodDecay=kTRUE;
1166 if(labDau[0]==-1)
continue;
1169 Double_t pt = mcPart->Pt();
1170 Double_t rapid = mcPart->Y();
1175 Double_t var4nSparseAcc[2] = {pt,rapid};
1177 if(orig==4)
fnSparseMC[0]->Fill(var4nSparseAcc);
1178 if(orig==5)
fnSparseMC[1]->Fill(var4nSparseAcc);
1190 for (Int_t iProng = 0; iProng<nProng; iProng++){
1191 AliAODMCParticle* mcPartDaughter=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(labDau[iProng]));
1192 if(!mcPartDaughter) {
1195 Double_t eta = mcPartDaughter->Eta();
1196 Double_t pt = mcPartDaughter->Pt();
1197 if (TMath::Abs(eta) > 0.9 || pt < 0.1) {
Double_t NormalizedDecayLengthXY() const
Bool_t IsEventRejectedDueToCentrality() const
TH1F * fPtMaxHist[4 *kMaxPtBins]
! hist. for Pt Max (Prod Cuts)
Bool_t IsEventRejectedDueToZVertexOutsideFiducialRegion() const
Double_t NormalizedDecayLength() const
THnSparseF * fnSparseMC[4]
!<!THnSparse for topomatic variable
Bool_t IsEventRejectedDueToNotRecoVertex() const
Double_t InvMassDsKKpi() const
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
void Getd0MeasMinusExpProng(Int_t ip, Double_t magf, Double_t &d0diff, Double_t &errd0diff) const
TH1F * fPtProng1Hist[4 *kMaxPtBins]
! hist. for DCA (Prod Cuts)
Double_t InvMassDspiKK() const
void SetPtBins(Int_t n, Float_t *lim)
Int_t IsEventSelectedInCentrality(AliVEvent *event)
Bool_t HasSelectionBit(Int_t i) const
TH2F * fDalitzK0st[4 *kMaxPtBins]
! dalitz plot via K0* (sig,bkg,tot)
void UnsetOwnPrimaryVtx()
Double_t CosPiDsLabFrameKKpi() const
Int_t GetHistoIndex(Int_t iPtBin) const
Double_t fMassRange
limits for pt bins
Bool_t IsEventRejectedDueToVertexContributors() const
TH2F * fPtVsMass
! hist. of pt vs. mass (prod. cuts)
static Int_t CheckDsDecay(AliStack *stack, Int_t label, Int_t *arrayDauLab)
Double_t CosPointingAngleXY() const
TH1F * fPtProng0Hist[4 *kMaxPtBins]
! hist. for Pt Max (Prod Cuts)
Bool_t FillRecoCand(AliVEvent *event, AliAODRecoDecayHF3Prong *rd3)
TH2F * fYVsPtSig
! hist. of Y vs. Pt (MC, only sig, prod. cuts)
Int_t GetPidOption() const
virtual void UserCreateOutputObjects()
Implementation of interface methods.
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
static Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPart, Bool_t searchUpToQuark=kTRUE)
Bool_t fFillSparse
flag for usage of HasSelectionBit
Double_t GetMaxVtxZ() const
TH1F * fSumd02Hist[4 *kMaxPtBins]
! hist. for sum d02 (Prod Cuts)
UInt_t GetPIDTrackTPCTOFBitMap(AliAODTrack *track) const
TH1F * fMassHistPhi[4 *kMaxPtBins]
! hist. of mass spectra via phi (sig,bkg,tot)
THnSparseF * fnSparse
Cuts for Analysis.
TNtuple * fNtupleDs
! output ntuple
virtual ~AliAnalysisTaskSEDs()
TH1F * fHistCentrality[3]
!hist. for cent distr (all,sel ev, )
AliNormalizationCounter * fCounter
bin size for inv. mass histo
TH2F * fHistCentralityMult[3]
!hist. for cent distr vs mult (all,sel ev, )
TH1F * fHistNEvents
! hist. for No. of events
AliRDHFCutsDstoKKpi * fAnalysisCuts
TList * fOutput
! list send on output slot 0
Double_t CosPiKPhiRFrameKKpi() const
AliAODVertex * GetOwnPrimaryVtx() const
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
Double_t GetSigmaVert(const AliAODEvent *aod=0x0)
THnSparseF * fnSparseIP
!<!THnSparse for candidates on data
Bool_t CheckDaugAcc(TClonesArray *arrayMC, Int_t nProng, Int_t *labDau)
TH2F * fDalitzPhi[4 *kMaxPtBins]
! dalitz plot via phi (sig,bkg,tot)
Float_t GetCentrality(AliAODEvent *aodEvent)
Bool_t IsEventRejectedDueToPileup() const
TH1F * fMassHistKpi[kMaxPtBins]
! hist. of mass spectra of Kpi
Bool_t IsCutOnResonancesApplied() const
TH1F * fPtCandHist[4 *kMaxPtBins]
! hist. for Pt Max (Prod Cuts)
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 FillMCGenAccHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader)
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
Double_t CosPiDsLabFramepiKK() const
Double_t DecayLengthXY() const
Bool_t GetIsPrimaryWithoutDaughters() const
Int_t GetSignalHistoIndex(Int_t iPtBin) const
Bool_t IsEventSelected(AliVEvent *event)
virtual void UserExec(Option_t *option)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999, Double_t spherocity=-99.)
Int_t GetReflSignalHistoIndex(Int_t iPtBin) const
virtual void Terminate(Option_t *option)
TH1F * fCosPHist[4 *kMaxPtBins]
! hist. of cos pointing angle (sig,bkg,tot)
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
void CleanOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod, AliAODVertex *origownvtx) const
Float_t * GetPtBinLimits() const
TH1F * fDLenHist[4 *kMaxPtBins]
! hist. of decay length (sig,bkg,tot)
Bool_t fUseSelectionBit
flag to create and fill histos with distributions of cut variables
Double_t GetWeightForpiKK() const
Double_t GetWeightForKKpi() const
TH1F * fChanHist[4]
! hist. with KKpi and piKK candidates (sig,bkg,tot)
TH1F * fMassHist[4 *kMaxPtBins]
! hist. of mass spectra (sig,bkg,tot)
TH1F * fDCAHist[4 *kMaxPtBins]
! hist. for DCA (Prod Cuts)
Bool_t IsEventRejectedDueToTrigger() const
Bool_t fDoCutVarHistos
flag to control ntuple writing in MC
TH1F * fPtProng2Hist[4 *kMaxPtBins]
! hist. for DCA (Prod Cuts)
Double_t CosPointingAngle() const
TH2F * fDalitz[4 *kMaxPtBins]
! dalitz plot (sig,bkg,tot)
Int_t GetUseCentrality() const
TH1F * fSigVertHist[4 *kMaxPtBins]
! hist. for sigVert (Prod Cuts)
Bool_t RecalcOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
Double_t DecayLength() const
TH2F * fPtVsMassPhi
! hist. of pt vs. mass (phi selection)
TH1F * fMassHistKK[kMaxPtBins]
! hist. of mass spectra of KK
Double_t CosPiKPhiRFramepiKK() const
TH1F * fMassHistK0st[4 *kMaxPtBins]
! hist. of mass spectra via K0* (sig,bkg,tot)
TH2F * fYVsPt
! hist. of Y vs. Pt (prod. cuts)
TH2F * fPtVsMassK0st
! hist. of pt vs. mass (K0* selection)
TList * fListCuts
number of Pt bins
void ApplyCutOnResonances(Bool_t opt=kTRUE)
UChar_t fNPtBins
flag for usage of THnSparse
Bool_t fWriteOnlySignal
flag for access to MC
Double_t fMassBinSize
range for mass histogram
Int_t GetBackgroundHistoIndex(Int_t iPtBin) const
Float_t fPtLimits[kMaxPtBins+1]