28 #include <TClonesArray.h>
33 #include <TDatabasePDG.h>
35 #include "AliAnalysisManager.h"
37 #include "AliAODHandler.h"
38 #include "AliAODEvent.h"
39 #include "AliAODVertex.h"
40 #include "AliAODTrack.h"
43 #include "AliAnalysisTaskSE.h"
79 fUseStrangeness(kFALSE),
83 fDoTrackVarHist(kFALSE),
85 fUseQuarkTagInKine(kTRUE),
95 for(Int_t i=0;i<3;i++){
130 for(Int_t i=0;i<kMaxPtBins+1;i++){
138 AliAnalysisTaskSE(name),
151 fPhiEtaCandSigReg(0),
155 fLowmasslimit(1.765),
159 fRDCutsAnalysis(dpluscutsana),
161 fFillNtuple(fillNtuple),
163 fUseStrangeness(kFALSE),
167 fDoTrackVarHist(kFALSE),
169 fUseQuarkTagInKine(kTRUE),
171 fLowerImpPar(-1000.),
172 fHigherImpPar(1000.),
182 for(Int_t i=0;i<3;i++){
216 for(Int_t i=0;i<kMaxPtBins+1;i++){
223 DefineOutput(1,TList::Class());
226 DefineOutput(2,TList::Class());
228 DefineOutput(3,AliNormalizationCounter::Class());
232 DefineOutput(4,TNtuple::Class());
270 for(Int_t i=0;i<3;i++){
274 for(Int_t i=0;i<5;i++){
321 Int_t missingbins=4-nbins%4;
322 nbins=nbins+missingbins;
325 printf(
"AliAnalysisTaskSEDplus::SetBinWidth: W-bin width of %f will produce histograms not rebinnable by 4. New width set to %f\n",w,width);
328 if(fDebug>1) printf(
"AliAnalysisTaskSEDplus::SetBinWidth: width set to %f\n",width);
342 if(fDebug>1)printf(
"started LS\n");
349 Int_t nPosTrks=0,nNegTrks=0;
350 Int_t nOStriplets = arrayOppositeSign->GetEntriesFast();
353 Int_t nLikeSign = arrayLikeSign->GetEntriesFast();
357 for(Int_t iLikeSign = 0; iLikeSign < nLikeSign; iLikeSign++) {
360 Bool_t unsetvtx=kFALSE;
365 Double_t ptCand = d->Pt();
367 if(iPtBin<0)
continue;
368 Int_t sign= d->GetCharge();
381 histLSPlus->Fill(invMass);
384 histLSMinus->Fill(invMass);
390 Double_t sumD02=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
391 Double_t dca=d->GetDCA();
394 for(Int_t i=0;i<3;i++){
395 if(d->PtProng(i)>
ptmax)ptmax=d->PtProng(i);
412 if(nLikeSign!=0)wei2 = (Float_t)nOStriplets/(Float_t)nLikeSign;
414 if(nDplusLS!=0)wei3 = (Float_t)nDplusOS/(Float_t)(nDplusLS+nDminusLS);
415 Float_t weiplus=1.,weiminus=1.;
416 Float_t wei4plus=1.,wei4minus=1.;
418 if(nPosTrks>2)weiplus=3.*(Float_t)nNegTrks/((Float_t)nPosTrks-2.);
419 if(nDplusLS>2)wei4plus=3.*(Float_t)nDminusLS/((Float_t)nDplusLS-2.);
420 if(nNegTrks>2)weiminus=3.*(Float_t)nPosTrks/((Float_t)nNegTrks-2.);
421 if(nDminusLS>2)wei4minus=3.*(Float_t)nDplusLS/((Float_t)nDminusLS-2.);
432 delete histLSPlus;histLSPlus=0;
433 delete histLSMinus;histLSMinus=0;
435 if(fDebug>1) printf(
"LS analysis terminated\n");
443 if(fDebug > 1) printf(
"AnalysisTaskSEDplus::Init() \n");
449 analysis->SetName(
"AnalysisCuts");
462 if(fDebug > 1) printf(
"AnalysisTaskSEDplus::UserCreateOutputObjects() \n");
467 fOutput->SetName(
"OutputHistos");
469 fHistNEvents =
new TH1F(
"fHistNEvents",
"number of events ",13,-0.5,12.5);
471 fHistNEvents->GetXaxis()->SetBinLabel(2,
"nEvents accepted");
472 fHistNEvents->GetXaxis()->SetBinLabel(3,
"Rejected due to trigger");
473 fHistNEvents->GetXaxis()->SetBinLabel(4,
"Rejected pileup events");
474 fHistNEvents->GetXaxis()->SetBinLabel(5,
"Rejected due to centrality");
475 fHistNEvents->GetXaxis()->SetBinLabel(6,
"Rejected due to vtxz");
476 fHistNEvents->GetXaxis()->SetBinLabel(7,
"Rejected due to Physics Sel");
477 fHistNEvents->GetXaxis()->SetBinLabel(8,
"Total no. of candidate");
478 fHistNEvents->GetXaxis()->SetBinLabel(9,
"no. of cand wo bitmask");
479 fHistNEvents->GetXaxis()->SetBinLabel(10,
"D+ after topological cuts");
480 fHistNEvents->GetXaxis()->SetBinLabel(11,
"D+ after Topological+SingleTrack cuts");
481 fHistNEvents->GetXaxis()->SetBinLabel(12,
"D+ after Topological+SingleTrack+PID cuts");
482 fHistNEvents->GetXaxis()->SetBinLabel(13,
"D+ not on-the-fly reco");
492 fHistCentrality[0]=
new TH2F(
"hCentrMult",
"centrality",100,0.5,30000.5,40,0.,100.);
493 fHistCentrality[1]=
new TH2F(
"hCentrMult(selectedCent)",
"centrality(selectedCent)",100,0.5,30000.5,40,0.,100.);
494 fHistCentrality[2]=
new TH2F(
"hCentrMult(OutofCent)",
"centrality(OutofCent)",100,0.5,30000.5,40,0.,100.);
495 for(Int_t i=0;i<3;i++){
503 hisname.Form(
"hMassNoPidPt%d",i);
506 hisname.Form(
"hCosPAllPt%d",i);
507 fCosPHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
509 hisname.Form(
"hDLenAllPt%d",i);
510 fDLenHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
512 hisname.Form(
"hSumd02AllPt%d",i);
513 fSumd02Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
515 hisname.Form(
"hSigVertAllPt%d",i);
516 fSigVertHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
518 hisname.Form(
"hPtMaxAllPt%d",i);
519 fPtMaxHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
521 hisname.Form(
"hPtKPt%d",i);
522 fPtKHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
524 hisname.Form(
"hPtpi1Pt%d",i);
525 fPtpi1Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
527 hisname.Form(
"hPtpi2Pt%d",i);
528 fPtpi2Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
530 hisname.Form(
"hDCAAllPt%d",i);
531 fDCAHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
534 hisname.Form(
"hDLxyPt%d",i);
535 fDLxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
536 fDLxy[index]->Sumw2();
537 hisname.Form(
"hCosxyPt%d",i);
538 fCosxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
541 hisname.Form(
"hMassPt%dTC",i);
544 hisname.Form(
"hMassPt%dTCPlus",i);
547 hisname.Form(
"hMassPt%dTCMinus",i);
554 hisname.Form(
"hSigNoPidPt%d",i);
557 hisname.Form(
"hCosPSigPt%d",i);
558 fCosPHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
560 hisname.Form(
"hDLenSigPt%d",i);
561 fDLenHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
563 hisname.Form(
"hSumd02SigPt%d",i);
564 fSumd02Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
566 hisname.Form(
"hSigVertSigPt%d",i);
567 fSigVertHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
569 hisname.Form(
"hPtMaxSigPt%d",i);
570 fPtMaxHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
572 hisname.Form(
"hPtKSigPt%d",i);
573 fPtKHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
575 hisname.Form(
"hPtpi1SigPt%d",i);
576 fPtpi1Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
578 hisname.Form(
"hPtpi2SigPt%d",i);
579 fPtpi2Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
582 hisname.Form(
"hDCASigPt%d",i);
583 fDCAHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
586 hisname.Form(
"hDLxySigPt%d",i);
587 fDLxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
588 fDLxy[index]->Sumw2();
589 hisname.Form(
"hCosxySigPt%d",i);
590 fCosxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
592 hisname.Form(
"hSigPt%dTC",i);
595 hisname.Form(
"hSigPt%dTCPlus",i);
598 hisname.Form(
"hSigPt%dTCMinus",i);
604 hisname.Form(
"hBkgNoPidPt%d",i);
607 hisname.Form(
"hCosPBkgPt%d",i);
608 fCosPHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
610 hisname.Form(
"hDLenBkgPt%d",i);
611 fDLenHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
613 hisname.Form(
"hSumd02BkgPt%d",i);
614 fSumd02Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
616 hisname.Form(
"hSigVertBkgPt%d",i);
617 fSigVertHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
619 hisname.Form(
"hPtMaxBkgPt%d",i);
620 fPtMaxHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
622 hisname.Form(
"hPtKBkgPt%d",i);
623 fPtKHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
625 hisname.Form(
"hPtpi1BkgPt%d",i);
626 fPtpi1Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
628 hisname.Form(
"hPtpi2BkgPt%d",i);
629 fPtpi2Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
631 hisname.Form(
"hDCABkgPt%d",i);
632 fDCAHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
635 hisname.Form(
"hDLxyBkgPt%d",i);
636 fDLxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
637 fDLxy[index]->Sumw2();
638 hisname.Form(
"hCosxyBkgPt%d",i);
639 fCosxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
643 hisname.Form(
"hBkgPt%dTC",i);
646 hisname.Form(
"hBkgPt%dTCPlus",i);
649 hisname.Form(
"hBkgPt%dTCMinus",i);
676 fCorreld0Kd0pi[0]=
new TH2F(
"hCorreld0Kd0piAll",
"",100,-0.02,0.02,100,-0.02,0.02);
677 fCorreld0Kd0pi[1]=
new TH2F(
"hCorreld0Kd0piSig",
"",100,-0.02,0.02,100,-0.02,0.02);
678 fCorreld0Kd0pi[2]=
new TH2F(
"hCorreld0Kd0piBkg",
"",100,-0.02,0.02,100,-0.02,0.02);
680 for(Int_t i=0; i<3; i++){
689 fYVsPtNoPid=
new TH3F(
"hYVsPtNoPid",
"YvsPt (no PID)",40,0.,20.,80,-2.,2.,nbins,
fLowmasslimit,
fUpmasslimit);
690 fYVsPt=
new TH3F(
"hYVsPt",
"YvsPt",40,0.,20.,80,-2.,2.,nbins,
fLowmasslimit,
fUpmasslimit);
691 fYVsPtSigNoPid=
new TH2F(
"hYVsPtSigNoPid",
"YvsPt (MC, only sig., no PID)",40,0.,20.,80,-2.,2.);
692 fYVsPtSig=
new TH2F(
"hYVsPtSig",
"YvsPt (MC, only Sig)",40,0.,20.,80,-2.,2.);
693 fPhiEtaCand=
new TH2F(
"hPhiEtaCand",
"phi vs. eta candidates",20,-1.,1.,50,0.,2*TMath::Pi());
694 fPhiEtaCandSigReg=
new TH2F(
"hPhiEtaCandSigReg",
"phi vs. eta candidates",20,-1.,1.,50,0.,2*TMath::Pi());
699 fSPDMult =
new TH1F(
"hSPDMult",
"Tracklets multiplicity; Tracklets ; Entries",200,0.,maxmult);
712 TString normName=
"NormalizationCounter";
713 AliAnalysisDataContainer *cont = GetOutputSlot(3)->GetContainer();
714 if(cont)normName=(TString)cont->GetName();
729 fNtupleDplus =
new TNtuple(
"fNtupleDplus",
"D +",
"pdg:Px:Py:Pz:Pt:charge:piddau0:piddau1:piddau2:Ptpi:PtK:Ptpi2:mompi:momK:mompi2:cosp:cospxy:DecLen:NormDecLen:DecLenXY:NormDecLenXY:InvMass:sigvert:d0Pi:d0K:d0Pi2:maxdca:ntracks:centr:RunNumber:BadDau");
737 fNtupleDplus =
new TNtuple(
"fNtupleDplus",
"D +",
"pdg:Pt:InvMass:d0:origin");
750 AliAODEvent *aod =
dynamic_cast<AliAODEvent*
> (InputEvent());
752 TClonesArray *array3Prong = 0;
753 TClonesArray *arrayLikeSign =0;
754 if(!aod && AODEvent() && IsStandardAOD()) {
757 aod =
dynamic_cast<AliAODEvent*
> (AODEvent());
760 AliAODHandler* aodHandler = (AliAODHandler*)
761 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
762 if(aodHandler->GetExtensions()) {
763 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
764 AliAODEvent *aodFromExt = ext->GetAOD();
765 array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject(
"Charm3Prong");
766 arrayLikeSign=(TClonesArray*)aodFromExt->GetList()->FindObject(
"LikeSign3Prong");
769 array3Prong=(TClonesArray*)aod->GetList()->FindObject(
"Charm3Prong");
770 arrayLikeSign=(TClonesArray*)aod->GetList()->FindObject(
"LikeSign3Prong");
773 if(!aod || !array3Prong) {
774 printf(
"AliAnalysisTaskSEDplus::UserExec: Charm3Prong branch not found!\n");
777 if(!arrayLikeSign &&
fDoLS) {
778 printf(
"AliAnalysisTaskSEDplus::UserExec: LikeSign3Prong branch not found!\n");
784 if(!aod->GetPrimaryVertex()||TMath::Abs(aod->GetMagneticField())<0.001)
return;
790 Int_t runNumber=aod->GetRunNumber();
794 Float_t ntracks=aod->GetNumberOfTracks();
804 TClonesArray *arrayMC=0;
805 AliAODMCHeader *mcHeader=0;
808 arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
810 printf(
"AliAnalysisTaskSEDplus::UserExec: MC particles branch not found!\n");
815 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
817 printf(
"AliAnalysisTaskSEDplus::UserExec: MC header branch not found!\n");
822 if(aod->GetTriggerMask()==0 &&
823 (runNumber>=195344 && runNumber<=195677)){
845 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
851 Int_t n3Prong = array3Prong->GetEntriesFast();
856 Int_t pdgDgDplustoKpipi[3]={321,211,211};
863 for (Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
872 Int_t nSelectednopid=0,nSelected=0;
873 for (Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
887 Bool_t passSingleTrackCuts=kTRUE;
892 if(!passSingleTrackCuts)
continue;
896 Double_t etaD=d->Eta();
897 Double_t phiD=d->Phi();
903 Bool_t unsetvtx=kFALSE;
909 Double_t ptCand = d->Pt();
912 Bool_t recVtx=kFALSE;
913 AliAODVertex *origownvtx=0x0;
921 Bool_t isPrimary=kFALSE;
922 Bool_t isFeeddown=kFALSE;
924 Float_t trueImpParXY=0.;
927 labDp = d->MatchToMC(411,arrayMC,3,pdgDgDplustoKpipi);
929 AliAODMCParticle *partDp = (AliAODMCParticle*)arrayMC->At(labDp);
931 pdgCode=TMath::Abs(partDp->GetPdgCode());
949 Double_t rapid=d->
YDplus();
951 if(passTopolAndPIDCuts) {
952 fYVsPt->Fill(ptCand,rapid,invMass);
957 if(passTopolAndPIDCuts)
fYVsPtSig->Fill(ptCand,rapid, invMass);
963 Double_t minPtDau=999.,
ptmax=0,maxdca=0,sigvert=0,sumD02=0;
964 Double_t dlen=0,cosp=0,dlenxy=0,cospxy=0, ndlenxy=0, dd0max=0;
968 sumD02=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
970 for(Int_t idau=0;idau<3;idau++)
if(d->GetDCA(idau)>maxdca) maxdca=d->GetDCA(idau);
976 for(Int_t i=0; i<3; i++) {
978 if(d->PtProng(i)<minPtDau) minPtDau=d->PtProng(i);
979 Double_t diffIP, errdiffIP;
981 Double_t normdd0= diffIP/errdiffIP;
982 if(i==0) dd0max=normdd0;
983 else if(TMath::Abs(normdd0)>TMath::Abs(dd0max)) dd0max=normdd0;
986 Double_t impparXY=d->
ImpParXY()*10000.;
989 if(passTopolAndPIDCuts) resSel=2;
992 Double_t arrayForSparse[
kVarForSparse]={invMass,ptCand,impparXY,resSel,minPtDau,sigvert,cosp,cospxy,dlen,dlenxy,ndlenxy,dd0max};
994 Double_t arrayForSparseFD[
kVarForSparseFD]={invMass,ptCand,impparXY,resSel,minPtDau,sigvert,cosp,cospxy,dlen,dlenxy,ndlenxy,dd0max,ptB};
995 Double_t arrayForSparseTrue[
kVarForSparseFD]={invMass,ptCand,trueImpParXY,resSel,minPtDau,sigvert,cosp,cospxy,dlen,dlenxy,ndlenxy,dd0max,ptB};
996 Double_t flagOrigin = 0;
1000 for(
int i = 0; i < 3; i++) {
1001 Double_t ptTrack = 0, nCrossedRowsTPC = 0, nClustersTPC = 0, ratioCRowsFClu = 0, isSig = 0;
1002 track = (AliAODTrack*)d->GetDaughter(i);
1003 AliESDtrack esdTrack(track);
1004 esdTrack.SetTPCClusterMap(track->GetTPCClusterMap());
1005 esdTrack.SetTPCSharedMap(track->GetTPCSharedMap());
1006 esdTrack.SetTPCPointsF(track->GetTPCNclsF());
1007 ptTrack = track->Pt();
1008 nCrossedRowsTPC = esdTrack.GetTPCCrossedRows();
1009 nClustersTPC = esdTrack.GetTPCNcls();
1010 if(esdTrack.GetTPCNclsF()>0) {
1011 ratioCRowsFClu = nCrossedRowsTPC / esdTrack.GetTPCNclsF();
1013 if(isPrimary) isSig = 1.;
1014 else if(isFeeddown) isSig = 2.;
1017 Double_t arrayForTrackSparse[
kVarForTrackSparse]={ptCand,invMass,ptTrack,nClustersTPC,nCrossedRowsTPC,ratioCRowsFClu,isSig};
1018 if(passTopolAndPIDCuts){
1032 if(passTopolAndPIDCuts){
1046 fPtKHist[index]->Fill(d->PtProng(1));
1050 fDLxy[index]->Fill(ndlenxy);
1051 fCosxy[index]->Fill(cospxy);
1052 fCorreld0Kd0pi[0]->Fill(d->Getd0Prong(0)*d->Getd0Prong(1),d->Getd0Prong(2)*d->Getd0Prong(1));
1062 if(isFeeddown) tmp[0]+=5000.;
1067 tmp[5]=d->GetCharge();
1072 tmp[9]=d->PtProng(0);
1073 tmp[10]=d->PtProng(1);
1074 tmp[11]=d->PtProng(2);
1075 tmp[12]=d->PProng(0);
1076 tmp[13]=d->PProng(1);
1077 tmp[14]=d->PProng(2);
1086 tmp[23]=d->Getd0Prong(0);
1087 tmp[24]=d->Getd0Prong(1);
1088 tmp[25]=d->Getd0Prong(2);
1101 if(isFeeddown) tmp[0]+=5000.;
1107 if(isPrimary&&labDp>=0)flagOrigin=1;
1108 if(isFeeddown&&labDp>=0)flagOrigin=2;
1109 if(!(labDp>=0))flagOrigin=3;
1124 else if(isFeeddown){
1134 if(passTopolAndPIDCuts){
1137 Float_t factor[3]={1.,1.,1.};
1141 fDLxy[index]->Fill(ndlenxy);
1142 fCosxy[index]->Fill(cospxy);
1143 Float_t sumd02s=d->Getd0Prong(0)*d->Getd0Prong(0)*factor[0]*factor[0]+d->Getd0Prong(1)*d->Getd0Prong(1)*factor[1]*factor[1]+d->Getd0Prong(2)*d->Getd0Prong(2)*factor[2]*factor[2];
1147 fPtKHist[index]->Fill(d->PtProng(1),fact);
1150 fDCAHist[index]->Fill(maxdca,fact);
1151 fCorreld0Kd0pi[1]->Fill(d->Getd0Prong(0)*d->Getd0Prong(1),d->Getd0Prong(2)*d->Getd0Prong(1));
1169 if(
fDoLS && arrayLikeSign)
LSAnalysis(array3Prong,arrayLikeSign,aod,vtx1,nOS);
1190 hisname.Form(
"hLSPt%d",i);
1194 hisname.Form(
"hCosPAllPt%dLS",i);
1197 hisname.Form(
"hDLenAllPt%dLS",i);
1200 hisname.Form(
"hSumd02AllPt%dLS",i);
1203 hisname.Form(
"hSigVertAllPt%dLS",i);
1206 hisname.Form(
"hPtMaxAllPt%dLS",i);
1209 hisname.Form(
"hDCAAllPt%dLS",i);
1210 fDCAHistLS[index]=
new TH1F(hisname.Data(),hisname.Data(),
nbins,0.,0.1);
1216 hisname.Form(
"hLSPt%dnw",i);
1220 hisname.Form(
"hCosPSigPt%dLS",i);
1223 hisname.Form(
"hDLenSigPt%dLS",i);
1226 hisname.Form(
"hSumd02SigPt%dLS",i);
1229 hisname.Form(
"hSigVertSigPt%dLS",i);
1232 hisname.Form(
"hPtMaxSigPt%dLS",i);
1235 hisname.Form(
"hDCASigPt%dLS",i);
1236 fDCAHistLS[index]=
new TH1F(hisname.Data(),hisname.Data(),
nbins,0.,0.1);
1242 hisname.Form(
"hLSPt%dLCntrip",i);
1246 hisname.Form(
"hCosPBkgPt%dLS",i);
1249 hisname.Form(
"hDLenBkgPt%dLS",i);
1252 hisname.Form(
"hSumd02BkgPt%dLS",i);
1255 hisname.Form(
"hSigVertBkgPt%dLS",i);
1258 hisname.Form(
"hPtMaxBkgPt%dLS",i);
1261 hisname.Form(
"hDCABkgPt%dLS",i);
1262 fDCAHistLS[index]=
new TH1F(hisname.Data(),hisname.Data(),
nbins,0.,0.1);
1266 hisname.Form(
"hLSPt%dLCntripsinglecut",i);
1271 hisname.Form(
"hLSPt%dspc",i);
1302 Int_t nptmindaubins=10;
1303 Double_t minptmindau=0.2;
1304 Double_t maxptmindau=1.2;
1306 Int_t nsigvertbins=25;
1307 Double_t minsigvert=0.010;
1308 Double_t maxsigvert=0.035;
1311 Double_t minsel=0.5;
1312 Double_t maxsel=2.5;
1314 Int_t ncospbins=100;
1315 Double_t mincosp=0.90;
1316 Double_t maxcosp=1.;
1318 Int_t ncospxybins=30;
1319 Double_t mincospxy=0.97;
1320 Double_t maxcospxy=1.;
1323 Double_t mindecl=0.;
1324 Double_t maxdecl=0.7;
1326 Int_t ndeclxybins=70;
1327 Double_t mindeclxy=0.;
1328 Double_t maxdeclxy=0.7;
1330 Int_t nnormdlbins=30;
1331 Double_t minnormdl=0.;
1332 Double_t maxnormdl=30.;
1334 Int_t nd0d0expbins=40;
1335 Double_t mind0d0=-10.;
1336 Double_t maxd0d0=10.;
1340 TString axTit[
kVarForSparse]={
"M_{K#pi#pi} (GeV/c^{2})",
"p_{T} (GeV/c)",
"Imp Par (#mum)",
"passTopolPID",
"min. daughter p_{T} (GeV/c)",
1341 "sigmaVertex",
"cos(#theta_{P})",
"cos(#theta_{P}^{xy})",
"decL (cm)",
"decL XY (cm)",
"Norm decL XY",
"Norm max d0-d0exp"};
1343 Int_t
nbins[
kVarForSparse]={nmassbins,
nptbins,
fNImpParBins,nselbins,nptmindaubins,nsigvertbins,ncospbins,ncospxybins,ndeclbins,ndeclxybins,nnormdlbins,nd0d0expbins};
1344 Double_t xmin[
kVarForSparse]={
fLowmasslimit,
ptmin,
fLowerImpPar,minsel,minptmindau,minsigvert,mincosp,mincospxy,mindecl,mindeclxy,minnormdl,mind0d0};
1345 Double_t xmax[
kVarForSparse]={
fUpmasslimit,
ptmax,
fHigherImpPar,maxsel,maxptmindau,maxsigvert,maxcosp,maxcospxy,maxdecl,maxdeclxy,maxnormdl,maxd0d0};
1348 Int_t nbinsFD[
kVarForSparseFD]={nmassbins,
nptbins,
fNImpParBins,nselbins,nptmindaubins,nsigvertbins,ncospbins,ncospxybins,ndeclbins,ndeclbins,nnormdlbins,nd0d0expbins,84};
1349 Double_t xminFD[
kVarForSparseFD]={
fLowmasslimit,
ptmin,
fLowerImpPar,minsel,minptmindau,minsigvert,mincosp,mincospxy,mindecl,mindeclxy,minnormdl,mind0d0,-2};
1350 Double_t xmaxFD[
kVarForSparseFD]={
fUpmasslimit,
ptmax,
fHigherImpPar,maxsel,maxptmindau,maxsigvert,maxcosp,maxcospxy,maxdecl,maxdeclxy,maxnormdl,maxd0d0,40};
1355 "Mass vs. pt vs.imppar - All",
1358 "Mass vs. pt vs.imppar - promptD",
1361 "Mass vs. pt vs.imppar - DfromB",
1364 "Mass vs. pt vs.true imppar -DfromB",
1367 "Mass vs. pt vs.imppar - backgr.",
1371 for(Int_t i=0; i<5; i++){
1390 fHistTrackVar->GetAxis(1)->SetTitle(
"k#pi#pi inv. mass (GeV/c^{2})");
1394 fHistTrackVar->GetAxis(5)->SetTitle(
"TPC clust./cross.rows");
1405 const Int_t nVarPrompt = 2;
1406 const Int_t nVarFD = 3;
1408 Int_t nbinsPrompt[nVarPrompt]={200,100};
1409 Int_t nbinsFD[nVarFD]={200,100,200};
1411 Double_t xminPrompt[nVarPrompt] = {0.,-1.};
1412 Double_t xmaxPrompt[nVarPrompt] = {40.,1.};
1414 Double_t xminFD[nVarFD] = {0.,-1.,0.};
1415 Double_t xmaxFD[nVarFD] = {40.,1.,40.};
1418 fMCAccPrompt =
new THnSparseF(
"hMCAccPrompt",
"kStepMCAcceptance pt vs. y - promptD",nVarPrompt,nbinsPrompt,xminPrompt,xmaxPrompt);
1423 fMCAccBFeed =
new THnSparseF(
"hMCAccBFeed",
"kStepMCAcceptance pt vs. y vs. ptB - DfromB",nVarFD,nbinsFD,xminFD,xmaxFD);
1424 fMCAccBFeed->GetAxis(0)->SetTitle(
"p_{T} (GeV/c)");
1426 fMCAccBFeed->GetAxis(2)->SetTitle(
"p_{T}^{B} (GeV/c)");
1436 const Int_t nProng = 3;
1438 Double_t zMCVertex = mcHeader->GetVtxZ();
1440 for(Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++){
1441 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(iPart));
1442 if (TMath::Abs(mcPart->GetPdgCode()) == 411){
1447 Bool_t isGoodDecay=kFALSE;
1448 Int_t labDau[4]={-1,-1,-1,-1};
1449 Bool_t isInAcc = kFALSE;
1450 Bool_t isFidAcc = kFALSE;
1453 if(deca > 0) isGoodDecay=kTRUE;
1460 isInAcc=
CheckAcc(arrayMC,nProng,labDau);
1466 Double_t arrayMCprompt[2] = {mcPart->Pt(),mcPart->Y()};
1473 Double_t arrayMCFD[3] = {mcPart->Pt(),mcPart->Y(),ptB};
1488 if(fDebug > 1) printf(
"AnalysisTaskSEDplus: Terminate() \n");
1490 fOutput =
dynamic_cast<TList*
> (GetOutputData(1));
1492 printf(
"ERROR: fOutput not available\n");
1498 printf(
"Number of analyzed events = %d\n",(Int_t)
fHistNEvents->GetBinContent(2));
1500 printf(
"ERROR: fHistNEvents not available\n");
1510 Double_t vtxTrue[3];
1511 mcHeader->GetVertex(vtxTrue);
1513 partDp->XvYvZv(origD);
1514 Short_t
charge=partDp->Charge();
1515 Double_t pXdauTrue[3],pYdauTrue[3],pZdauTrue[3];
1516 for(Int_t iDau=0; iDau<3; iDau++){
1522 Int_t nDau=partDp->GetNDaughters();
1523 Int_t labelFirstDau = partDp->GetDaughter(0);
1525 for(Int_t iDau=0; iDau<3; iDau++){
1526 Int_t ind = labelFirstDau+iDau;
1527 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
1529 AliError(
"Daughter particle not found in MC array");
1532 pXdauTrue[iDau]=part->Px();
1533 pYdauTrue[iDau]=part->Py();
1534 pZdauTrue[iDau]=part->Pz();
1538 for(Int_t iDau=0; iDau<2; iDau++){
1539 Int_t ind = labelFirstDau+iDau;
1540 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
1542 AliError(
"Daughter particle not found in MC array");
1545 Int_t pdgCode=TMath::Abs(part->GetPdgCode());
1546 if(pdgCode==211 || pdgCode==321){
1547 pXdauTrue[theDau]=part->Px();
1548 pYdauTrue[theDau]=part->Py();
1549 pZdauTrue[theDau]=part->Pz();
1552 Int_t nDauRes=part->GetNDaughters();
1554 Int_t labelFirstDauRes = part->GetDaughter(0);
1555 for(Int_t iDauRes=0; iDauRes<2; iDauRes++){
1556 Int_t indDR = labelFirstDauRes+iDauRes;
1557 AliAODMCParticle* partDR =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indDR));
1559 AliError(
"Daughter particle not found in MC array");
1563 Int_t pdgCodeDR=TMath::Abs(partDR->GetPdgCode());
1564 if(pdgCodeDR==211 || pdgCodeDR==321){
1565 pXdauTrue[theDau]=partDR->Px();
1566 pYdauTrue[theDau]=partDR->Py();
1567 pZdauTrue[theDau]=partDR->Pz();
1575 AliError(
"Wrong number of decay prongs");
1580 Double_t d0dummy[3]={0.,0.,0.};
1581 AliAODRecoDecayHF aodDplusMC(vtxTrue,origD,3,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
1589 for(Int_t iprong=0;iprong<3;iprong++){
1591 AliAODTrack *trad = (AliAODTrack*)d->GetDaughter(iprong);
1592 Int_t labd= trad->GetLabel();
1594 AliAODMCParticle *dau = (AliAODMCParticle*)arrayMC->At(labd);
1596 Int_t labm = dau->GetMother();
1598 AliAODMCParticle *mot = (AliAODMCParticle*)arrayMC->At(labm);
1600 if(TMath::Abs(mot->GetPdgCode())==310 || TMath::Abs(mot->GetPdgCode())==130 || TMath::Abs(mot->GetPdgCode())==321){
1601 if(d->PtProng(iprong)<=1)factor[iprong]=1./.7;
1602 else factor[iprong]=1./.6;
1605 if(TMath::Abs(mot->GetPdgCode())==3122) {
1606 factor[iprong]=1./0.25;
1616 for(Int_t k=0;k<3;k++)fact=fact*factor[k];
1624 for (Int_t iProng = 0; iProng<nProng; iProng++){
1625 AliAODMCParticle* mcPartDaughter=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(labDau[iProng]));
1626 if(!mcPartDaughter)
return kFALSE;
1627 Double_t eta = mcPartDaughter->Eta();
1628 Double_t pt = mcPartDaughter->Pt();
1629 if (TMath::Abs(eta) > 0.9 || pt < 0.1)
return kFALSE;
TH1F * fCosxy[3 *kMaxPtBins]
!hist. for Cosxy (topol+PID)
THnSparseF * fMCAccPrompt
!histo for StepMCAcc for Dplus prompt (pt,y,ptB)
TH2F * fPhiEtaCand
! hist. with eta/phi distribution of candidates
Double_t NormalizedDecayLengthXY() const
Double_t NormalizedDecayLength() const
Bool_t fUseStrangeness
flag for access to MC
TH1F * fSigVertHist[3 *kMaxPtBins]
!hist. for sigVert (topol+PID)
static Int_t CheckDplusDecay(AliStack *stack, Int_t label, Int_t *arrayDauLab)
AliRDHFCutsDplustoKpipi * fRDCutsAnalysis
list of cuts
virtual void UserCreateOutputObjects()
Implementation of interface methods.
Int_t GetIsSelectedPID() const
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
THnSparseF * fHistMassPtImpPar[5]
! histograms for impact parameter and cut variation study
TH2F * fYVsPtSigNoPid
! hist. of Y vs. Pt (MC, only sig, w/o PID)
void Getd0MeasMinusExpProng(Int_t ip, Double_t magf, Double_t &d0diff, Double_t &errd0diff) const
TH1F * fPtpi1Hist[3 *kMaxPtBins]
!hist. for PtPi1 (topol+PID)
Int_t GetIsSelectedCuts() const
Int_t IsEventSelectedInCentrality(AliVEvent *event)
Bool_t HasSelectionBit(Int_t i) const
TH3F * fYVsPt
! hist. of Y vs. Pt vs. Mass (topol+PID cuts)
virtual void Terminate(Option_t *option)
TH1F * fDLxy[3 *kMaxPtBins]
!hist. for DLxy (topol+PID)
void UnsetOwnPrimaryVtx()
Int_t fEtaSelection
flag to do LS analysis
Bool_t fDoTrackVarHist
flag to activate impact paramter histos
Float_t fLowerImpPar
nunber of bins in impact parameter histos
TH2F * fHistCentrality[3]
!hist. for cent distr (all,sel ev, )
TH1F * fPtMaxHistLS[3 *kMaxPtBins]
!hist. for LS cuts variable 5 (topol+PID)
Double_t ImpParXY() const
TH1F * fSPDMult
! hist. of spd mult
virtual ~AliAnalysisTaskSEDplus()
Bool_t fReadMC
flag for filling ntuple 0 no NTuple 1 big Ntuple 2 small NTuple
Int_t GetLSHistoIndex(Int_t iPtBin) const
Int_t GetSignalHistoIndex(Int_t iPtBin) const
THnSparseF * fHistTrackVar
! histograms for track cuts study
UInt_t GetPIDTrackTPCTOFBitMap(AliAODTrack *track) const
Int_t GetWhyRejection() const
Double_t CosPointingAngleXY() const
TH1F * fMassHistNoPid[3 *kMaxPtBins]
!hist. for inv mass (w/o PID)
TList * fListCuts
width of one bin in output histos
Bool_t FillRecoCand(AliVEvent *event, AliAODRecoDecayHF3Prong *rd3)
TList * fOutput
! list send on output slot 0
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
Bool_t fCutsDistr
flag to use bitmask
static Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPart, Bool_t searchUpToQuark=kTRUE)
Double_t GetMaxVtxZ() const
void LSAnalysis(TClonesArray *arrayOppositeSign, TClonesArray *arrayLikeSign, AliAODEvent *aod, AliAODVertex *vtx1, Int_t nDplusOS)
void SetBinWidth(Float_t w)
Int_t GetBackgroundHistoIndex(Int_t iPtBin) const
TH1F * fCosPHist[3 *kMaxPtBins]
!hist. for PointingAngle (topol+PID)
Bool_t HasBadDaughters() const
TH2F * fYVsPtSig
! hist. of Y vs. Pt (MC, only sig, topol+PID cuts)
Float_t fHigherImpPar
lower limit in impact parameter (um)
Class for cuts on AOD reconstructed D+->Kpipi.
TH1F * fMassHistLS[5 *kMaxPtBins]
!hist. for LS inv mass (topol+PID)
void CreateImpactParameterHistos()
static Int_t GetNumberOfTrackletsInEtaRange(AliAODEvent *ev, Double_t mineta, Double_t maxeta)
Int_t fFillNtuple
limits for the Pt bins
TH1F * fSumd02Hist[3 *kMaxPtBins]
!hist. for sum d02 (topol+PID)
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
void CreateTrackVarHistos()
void FillMCAcceptanceHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader)
TH1F * fMassHistPlus[3 *kMaxPtBins]
!hist. for D+ inv mass (topol+PID cuts)
TH2F * fPtVsMass
! hist. of pt vs. mass (topol+PID cuts)
AliAODVertex * GetOwnPrimaryVtx() const
Double_t GetSigmaVert(const AliAODEvent *aod=0x0)
Int_t fDoLS
higher limit in impact parameter (um)
TH1F * fPtpi2Hist[3 *kMaxPtBins]
!hist. for PtPi2 (topol+PID)
TH2F * fPhiEtaCandSigReg
! hist. eta/phi of candidates in D+ mass region
Float_t GetCentrality(AliAODEvent *aodEvent)
Double_t InvMassDplus() const
Float_t GetTrueImpactParameter(const AliAODMCHeader *mcHeader, TClonesArray *arrayMC, const AliAODMCParticle *partDp) const
Int_t fNImpParBins
flag for quark/hadron level identification of prompt and feeddown
TH1F * fDLenHistLS[3 *kMaxPtBins]
!hist. for LS cuts variable 2 (topol+PID)
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)
TH3F * fYVsPtNoPid
! hist. of Y vs. Pt vs. Mass(w/o PID)
Int_t GetHistoIndex(Int_t iPtBin) const
THnSparseF * fMCAccBFeed
!histo for StepMCAcc for Dplus FD (pt,y,ptB)
TH1F * fMassHist[3 *kMaxPtBins]
!hist. for inv mass (topol+PID cuts)
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
TH2F * fPtVsMassNoPid
! hist. of pt vs. mass (w/o PID)
Double_t DecayLengthXY() const
static Double_t GetBeautyMotherPt(TClonesArray *arrayMC, AliAODMCParticle *mcPart)
Bool_t CheckAcc(TClonesArray *arrayMC, Int_t nProng, Int_t *labDau)
Bool_t GetIsPrimaryWithoutDaughters() const
TH1F * fSumd02HistLS[3 *kMaxPtBins]
!hist. for LS cuts variable 3 (topol+PID)
Bool_t IsEventSelected(AliVEvent *event)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999, Double_t spherocity=-99.)
TH1F * fHistNEvents
!hist. for No. of events
TH1F * fCosPHistLS[3 *kMaxPtBins]
!hist. for LS cuts variable 1 (topol+PID)
TH1F * fPtKHist[3 *kMaxPtBins]
!hist. for PtK (topol+PID)
Float_t fBinWidth
Number of Pt Bins.
void SetMassLimits(Float_t range)
ClassImp(AliAnalysisTaskCRC) AliAnalysisTaskCRC
void CleanOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod, AliAODVertex *origownvtx) const
Int_t fSystem
eta region to accept D+ 0=all, -1 = negative, 1 = positive
TH2F * fCorreld0Kd0pi[3]
!hist. for d0k*d0pi vs. d0k*d0pi (topol+PID)
virtual void UserExec(Option_t *option)
TH1F * fDLenHist[3 *kMaxPtBins]
!hist. for Dec Length (topol+PID)
Bool_t fDoImpPar
flag to activate cuts distr histos
AliNormalizationCounter * fCounter
Cuts for Analysis.
TH1F * fSigVertHistLS[3 *kMaxPtBins]
!hist. for LS cuts variable 4 (topol+PID)
Bool_t fUseBit
flag to enhance strangeness in MC to fit to data
Double_t fArrayBinLimits[kMaxPtBins+1]
void CreateLikeSignHistos()
Double_t CosPointingAngle() const
Float_t GetStrangenessWeights(const AliAODRecoDecayHF3Prong *d, TClonesArray *arrayMC, Float_t factor[3]) const
TH1F * fDCAHist[3 *kMaxPtBins]
!hist. for DCA (topol+PID)
Float_t fLowmasslimit
upper inv mass limit for histos
TH1F * fMassHistMinus[3 *kMaxPtBins]
!hist. for D- inv mass (topol+PID cuts)
Int_t GetUseCentrality() const
Bool_t RecalcOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
Int_t PtBin(Double_t pt) const
Double_t DecayLength() const
TNtuple * fNtupleDplus
! output ntuple
Bool_t fStepMCAcc
flag to activate track variable cut studies
Int_t fNPtBins
lower inv mass limit for histos
Bool_t fUseQuarkTagInKine
flag to activate histos for StepMCAcc
TH1F * fDCAHistLS[3 *kMaxPtBins]
!hist. for LS cuts variable 6 (topol+PID)
void CreateMCAcceptanceHistos()
TH1F * fPtMaxHist[3 *kMaxPtBins]
!hist. for Pt Max (topol+PID)