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+PID cuts");
481 fHistNEvents->GetXaxis()->SetBinLabel(12,
"D+ not on-the-fly reco");
491 fHistCentrality[0]=
new TH2F(
"hCentrMult",
"centrality",100,0.5,30000.5,40,0.,100.);
492 fHistCentrality[1]=
new TH2F(
"hCentrMult(selectedCent)",
"centrality(selectedCent)",100,0.5,30000.5,40,0.,100.);
493 fHistCentrality[2]=
new TH2F(
"hCentrMult(OutofCent)",
"centrality(OutofCent)",100,0.5,30000.5,40,0.,100.);
494 for(Int_t i=0;i<3;i++){
502 hisname.Form(
"hMassNoPidPt%d",i);
505 hisname.Form(
"hCosPAllPt%d",i);
506 fCosPHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
508 hisname.Form(
"hDLenAllPt%d",i);
509 fDLenHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
511 hisname.Form(
"hSumd02AllPt%d",i);
512 fSumd02Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
514 hisname.Form(
"hSigVertAllPt%d",i);
515 fSigVertHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
517 hisname.Form(
"hPtMaxAllPt%d",i);
518 fPtMaxHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
520 hisname.Form(
"hPtKPt%d",i);
521 fPtKHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
523 hisname.Form(
"hPtpi1Pt%d",i);
524 fPtpi1Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
526 hisname.Form(
"hPtpi2Pt%d",i);
527 fPtpi2Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
529 hisname.Form(
"hDCAAllPt%d",i);
530 fDCAHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
533 hisname.Form(
"hDLxyPt%d",i);
534 fDLxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
535 fDLxy[index]->Sumw2();
536 hisname.Form(
"hCosxyPt%d",i);
537 fCosxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
540 hisname.Form(
"hMassPt%dTC",i);
543 hisname.Form(
"hMassPt%dTCPlus",i);
546 hisname.Form(
"hMassPt%dTCMinus",i);
553 hisname.Form(
"hSigNoPidPt%d",i);
556 hisname.Form(
"hCosPSigPt%d",i);
557 fCosPHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
559 hisname.Form(
"hDLenSigPt%d",i);
560 fDLenHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
562 hisname.Form(
"hSumd02SigPt%d",i);
563 fSumd02Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
565 hisname.Form(
"hSigVertSigPt%d",i);
566 fSigVertHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
568 hisname.Form(
"hPtMaxSigPt%d",i);
569 fPtMaxHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
571 hisname.Form(
"hPtKSigPt%d",i);
572 fPtKHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
574 hisname.Form(
"hPtpi1SigPt%d",i);
575 fPtpi1Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
577 hisname.Form(
"hPtpi2SigPt%d",i);
578 fPtpi2Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
581 hisname.Form(
"hDCASigPt%d",i);
582 fDCAHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
585 hisname.Form(
"hDLxySigPt%d",i);
586 fDLxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
587 fDLxy[index]->Sumw2();
588 hisname.Form(
"hCosxySigPt%d",i);
589 fCosxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
591 hisname.Form(
"hSigPt%dTC",i);
594 hisname.Form(
"hSigPt%dTCPlus",i);
597 hisname.Form(
"hSigPt%dTCMinus",i);
603 hisname.Form(
"hBkgNoPidPt%d",i);
606 hisname.Form(
"hCosPBkgPt%d",i);
607 fCosPHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
609 hisname.Form(
"hDLenBkgPt%d",i);
610 fDLenHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
612 hisname.Form(
"hSumd02BkgPt%d",i);
613 fSumd02Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
615 hisname.Form(
"hSigVertBkgPt%d",i);
616 fSigVertHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
618 hisname.Form(
"hPtMaxBkgPt%d",i);
619 fPtMaxHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
621 hisname.Form(
"hPtKBkgPt%d",i);
622 fPtKHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
624 hisname.Form(
"hPtpi1BkgPt%d",i);
625 fPtpi1Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
627 hisname.Form(
"hPtpi2BkgPt%d",i);
628 fPtpi2Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
630 hisname.Form(
"hDCABkgPt%d",i);
631 fDCAHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
634 hisname.Form(
"hDLxyBkgPt%d",i);
635 fDLxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
636 fDLxy[index]->Sumw2();
637 hisname.Form(
"hCosxyBkgPt%d",i);
638 fCosxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
642 hisname.Form(
"hBkgPt%dTC",i);
645 hisname.Form(
"hBkgPt%dTCPlus",i);
648 hisname.Form(
"hBkgPt%dTCMinus",i);
675 fCorreld0Kd0pi[0]=
new TH2F(
"hCorreld0Kd0piAll",
"",100,-0.02,0.02,100,-0.02,0.02);
676 fCorreld0Kd0pi[1]=
new TH2F(
"hCorreld0Kd0piSig",
"",100,-0.02,0.02,100,-0.02,0.02);
677 fCorreld0Kd0pi[2]=
new TH2F(
"hCorreld0Kd0piBkg",
"",100,-0.02,0.02,100,-0.02,0.02);
679 for(Int_t i=0; i<3; i++){
688 fYVsPtNoPid=
new TH3F(
"hYVsPtNoPid",
"YvsPt (no PID)",40,0.,20.,80,-2.,2.,nbins,
fLowmasslimit,
fUpmasslimit);
689 fYVsPt=
new TH3F(
"hYVsPt",
"YvsPt",40,0.,20.,80,-2.,2.,nbins,
fLowmasslimit,
fUpmasslimit);
690 fYVsPtSigNoPid=
new TH2F(
"hYVsPtSigNoPid",
"YvsPt (MC, only sig., no PID)",40,0.,20.,80,-2.,2.);
691 fYVsPtSig=
new TH2F(
"hYVsPtSig",
"YvsPt (MC, only Sig)",40,0.,20.,80,-2.,2.);
692 fPhiEtaCand=
new TH2F(
"hPhiEtaCand",
"phi vs. eta candidates",20,-1.,1.,50,0.,2*TMath::Pi());
693 fPhiEtaCandSigReg=
new TH2F(
"hPhiEtaCandSigReg",
"phi vs. eta candidates",20,-1.,1.,50,0.,2*TMath::Pi());
698 fSPDMult =
new TH1F(
"hSPDMult",
"Tracklets multiplicity; Tracklets ; Entries",200,0.,maxmult);
711 TString normName=
"NormalizationCounter";
712 AliAnalysisDataContainer *cont = GetOutputSlot(3)->GetContainer();
713 if(cont)normName=(TString)cont->GetName();
728 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");
736 fNtupleDplus =
new TNtuple(
"fNtupleDplus",
"D +",
"pdg:Pt:InvMass:d0:origin");
749 AliAODEvent *aod =
dynamic_cast<AliAODEvent*
> (InputEvent());
751 TClonesArray *array3Prong = 0;
752 TClonesArray *arrayLikeSign =0;
753 if(!aod && AODEvent() && IsStandardAOD()) {
756 aod =
dynamic_cast<AliAODEvent*
> (AODEvent());
759 AliAODHandler* aodHandler = (AliAODHandler*)
760 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
761 if(aodHandler->GetExtensions()) {
762 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
763 AliAODEvent *aodFromExt = ext->GetAOD();
764 array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject(
"Charm3Prong");
765 arrayLikeSign=(TClonesArray*)aodFromExt->GetList()->FindObject(
"LikeSign3Prong");
768 array3Prong=(TClonesArray*)aod->GetList()->FindObject(
"Charm3Prong");
769 arrayLikeSign=(TClonesArray*)aod->GetList()->FindObject(
"LikeSign3Prong");
772 if(!aod || !array3Prong) {
773 printf(
"AliAnalysisTaskSEDplus::UserExec: Charm3Prong branch not found!\n");
776 if(!arrayLikeSign &&
fDoLS) {
777 printf(
"AliAnalysisTaskSEDplus::UserExec: LikeSign3Prong branch not found!\n");
783 if(!aod->GetPrimaryVertex()||TMath::Abs(aod->GetMagneticField())<0.001)
return;
789 Int_t runNumber=aod->GetRunNumber();
793 Float_t ntracks=aod->GetNumberOfTracks();
803 TClonesArray *arrayMC=0;
804 AliAODMCHeader *mcHeader=0;
807 arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
809 printf(
"AliAnalysisTaskSEDplus::UserExec: MC particles branch not found!\n");
814 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
816 printf(
"AliAnalysisTaskSEDplus::UserExec: MC header branch not found!\n");
821 if(aod->GetTriggerMask()==0 &&
822 (runNumber>=195344 && runNumber<=195677)){
844 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
850 Int_t n3Prong = array3Prong->GetEntriesFast();
855 Int_t pdgDgDplustoKpipi[3]={321,211,211};
862 for (Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
871 Int_t nSelectednopid=0,nSelected=0;
872 for (Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
889 Double_t etaD=d->Eta();
890 Double_t phiD=d->Phi();
896 Bool_t unsetvtx=kFALSE;
902 Double_t ptCand = d->Pt();
905 Bool_t recVtx=kFALSE;
906 AliAODVertex *origownvtx=0x0;
914 Bool_t isPrimary=kFALSE;
915 Bool_t isFeeddown=kFALSE;
917 Float_t trueImpParXY=0.;
920 labDp = d->MatchToMC(411,arrayMC,3,pdgDgDplustoKpipi);
922 AliAODMCParticle *partDp = (AliAODMCParticle*)arrayMC->At(labDp);
924 pdgCode=TMath::Abs(partDp->GetPdgCode());
942 Double_t rapid=d->
YDplus();
944 if(passTopolAndPIDCuts) {
945 fYVsPt->Fill(ptCand,rapid,invMass);
950 if(passTopolAndPIDCuts)
fYVsPtSig->Fill(ptCand,rapid, invMass);
956 Double_t minPtDau=999.,
ptmax=0,maxdca=0,sigvert=0,sumD02=0;
957 Double_t dlen=0,cosp=0,dlenxy=0,cospxy=0, ndlenxy=0, dd0max=0;
961 sumD02=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
963 for(Int_t idau=0;idau<3;idau++)
if(d->GetDCA(idau)>maxdca) maxdca=d->GetDCA(idau);
969 for(Int_t i=0; i<3; i++) {
971 if(d->PtProng(i)<minPtDau) minPtDau=d->PtProng(i);
972 Double_t diffIP, errdiffIP;
974 Double_t normdd0= diffIP/errdiffIP;
975 if(i==0) dd0max=normdd0;
976 else if(TMath::Abs(normdd0)>TMath::Abs(dd0max)) dd0max=normdd0;
979 Double_t impparXY=d->
ImpParXY()*10000.;
982 if(passTopolAndPIDCuts) resSel=2;
985 Double_t arrayForSparse[
kVarForSparse]={invMass,ptCand,impparXY,resSel,minPtDau,sigvert,cosp,cospxy,dlen,dlenxy,ndlenxy,dd0max};
987 Double_t arrayForSparseFD[
kVarForSparseFD]={invMass,ptCand,impparXY,resSel,minPtDau,sigvert,cosp,cospxy,dlen,dlenxy,ndlenxy,dd0max,ptB};
988 Double_t arrayForSparseTrue[
kVarForSparseFD]={invMass,ptCand,trueImpParXY,resSel,minPtDau,sigvert,cosp,cospxy,dlen,dlenxy,ndlenxy,dd0max,ptB};
989 Double_t flagOrigin = 0;
993 for(
int i = 0; i < 3; i++) {
994 Double_t ptTrack = 0, nCrossedRowsTPC = 0, nClustersTPC = 0, ratioCRowsFClu = 0, isSig = 0;
995 track = (AliAODTrack*)d->GetDaughter(i);
996 AliESDtrack esdTrack(track);
997 esdTrack.SetTPCClusterMap(track->GetTPCClusterMap());
998 esdTrack.SetTPCSharedMap(track->GetTPCSharedMap());
999 esdTrack.SetTPCPointsF(track->GetTPCNclsF());
1000 ptTrack = track->Pt();
1001 nCrossedRowsTPC = esdTrack.GetTPCCrossedRows();
1002 nClustersTPC = esdTrack.GetTPCNcls();
1003 if(esdTrack.GetTPCNclsF()>0) {
1004 ratioCRowsFClu = nCrossedRowsTPC / esdTrack.GetTPCNclsF();
1005 if(labDp>=0) isSig = 1.;
1007 Double_t arrayForTrackSparse[
kVarForTrackSparse]={ptCand,invMass,ptTrack,nClustersTPC,nCrossedRowsTPC,ratioCRowsFClu,isSig};
1008 if(passTopolAndPIDCuts){
1024 if(passTopolAndPIDCuts){
1039 fPtKHist[index]->Fill(d->PtProng(1));
1043 fDLxy[index]->Fill(ndlenxy);
1044 fCosxy[index]->Fill(cospxy);
1045 fCorreld0Kd0pi[0]->Fill(d->Getd0Prong(0)*d->Getd0Prong(1),d->Getd0Prong(2)*d->Getd0Prong(1));
1055 if(isFeeddown) tmp[0]+=5000.;
1060 tmp[5]=d->GetCharge();
1065 tmp[9]=d->PtProng(0);
1066 tmp[10]=d->PtProng(1);
1067 tmp[11]=d->PtProng(2);
1068 tmp[12]=d->PProng(0);
1069 tmp[13]=d->PProng(1);
1070 tmp[14]=d->PProng(2);
1079 tmp[23]=d->Getd0Prong(0);
1080 tmp[24]=d->Getd0Prong(1);
1081 tmp[25]=d->Getd0Prong(2);
1094 if(isFeeddown) tmp[0]+=5000.;
1100 if(isPrimary&&labDp>=0)flagOrigin=1;
1101 if(isFeeddown&&labDp>=0)flagOrigin=2;
1102 if(!(labDp>=0))flagOrigin=3;
1117 else if(isFeeddown){
1127 if(passTopolAndPIDCuts){
1130 Float_t factor[3]={1.,1.,1.};
1134 fDLxy[index]->Fill(ndlenxy);
1135 fCosxy[index]->Fill(cospxy);
1136 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];
1140 fPtKHist[index]->Fill(d->PtProng(1),fact);
1143 fDCAHist[index]->Fill(maxdca,fact);
1144 fCorreld0Kd0pi[1]->Fill(d->Getd0Prong(0)*d->Getd0Prong(1),d->Getd0Prong(2)*d->Getd0Prong(1));
1162 if(
fDoLS && arrayLikeSign)
LSAnalysis(array3Prong,arrayLikeSign,aod,vtx1,nOS);
1183 hisname.Form(
"hLSPt%d",i);
1187 hisname.Form(
"hCosPAllPt%dLS",i);
1190 hisname.Form(
"hDLenAllPt%dLS",i);
1193 hisname.Form(
"hSumd02AllPt%dLS",i);
1196 hisname.Form(
"hSigVertAllPt%dLS",i);
1199 hisname.Form(
"hPtMaxAllPt%dLS",i);
1202 hisname.Form(
"hDCAAllPt%dLS",i);
1203 fDCAHistLS[index]=
new TH1F(hisname.Data(),hisname.Data(),
nbins,0.,0.1);
1209 hisname.Form(
"hLSPt%dnw",i);
1213 hisname.Form(
"hCosPSigPt%dLS",i);
1216 hisname.Form(
"hDLenSigPt%dLS",i);
1219 hisname.Form(
"hSumd02SigPt%dLS",i);
1222 hisname.Form(
"hSigVertSigPt%dLS",i);
1225 hisname.Form(
"hPtMaxSigPt%dLS",i);
1228 hisname.Form(
"hDCASigPt%dLS",i);
1229 fDCAHistLS[index]=
new TH1F(hisname.Data(),hisname.Data(),
nbins,0.,0.1);
1235 hisname.Form(
"hLSPt%dLCntrip",i);
1239 hisname.Form(
"hCosPBkgPt%dLS",i);
1242 hisname.Form(
"hDLenBkgPt%dLS",i);
1245 hisname.Form(
"hSumd02BkgPt%dLS",i);
1248 hisname.Form(
"hSigVertBkgPt%dLS",i);
1251 hisname.Form(
"hPtMaxBkgPt%dLS",i);
1254 hisname.Form(
"hDCABkgPt%dLS",i);
1255 fDCAHistLS[index]=
new TH1F(hisname.Data(),hisname.Data(),
nbins,0.,0.1);
1259 hisname.Form(
"hLSPt%dLCntripsinglecut",i);
1264 hisname.Form(
"hLSPt%dspc",i);
1295 Int_t nptmindaubins=10;
1296 Double_t minptmindau=0.2;
1297 Double_t maxptmindau=1.2;
1299 Int_t nsigvertbins=25;
1300 Double_t minsigvert=0.010;
1301 Double_t maxsigvert=0.035;
1304 Double_t minsel=0.5;
1305 Double_t maxsel=2.5;
1307 Int_t ncospbins=100;
1308 Double_t mincosp=0.90;
1309 Double_t maxcosp=1.;
1311 Int_t ncospxybins=30;
1312 Double_t mincospxy=0.97;
1313 Double_t maxcospxy=1.;
1316 Double_t mindecl=0.;
1317 Double_t maxdecl=0.7;
1319 Int_t ndeclxybins=70;
1320 Double_t mindeclxy=0.;
1321 Double_t maxdeclxy=0.7;
1323 Int_t nnormdlbins=30;
1324 Double_t minnormdl=0.;
1325 Double_t maxnormdl=30.;
1327 Int_t nd0d0expbins=40;
1328 Double_t mind0d0=-10.;
1329 Double_t maxd0d0=10.;
1333 TString axTit[
kVarForSparse]={
"M_{K#pi#pi} (GeV/c^{2})",
"p_{T} (GeV/c)",
"Imp Par (#mum)",
"passTopolPID",
"min. daughter p_{T} (GeV/c)",
1334 "sigmaVertex",
"cos(#theta_{P})",
"cos(#theta_{P}^{xy})",
"decL (cm)",
"decL XY (cm)",
"Norm decL XY",
"Norm max d0-d0exp"};
1336 Int_t
nbins[
kVarForSparse]={nmassbins,
nptbins,
fNImpParBins,nselbins,nptmindaubins,nsigvertbins,ncospbins,ncospxybins,ndeclbins,ndeclxybins,nnormdlbins,nd0d0expbins};
1337 Double_t xmin[
kVarForSparse]={
fLowmasslimit,
ptmin,
fLowerImpPar,minsel,minptmindau,minsigvert,mincosp,mincospxy,mindecl,mindeclxy,minnormdl,mind0d0};
1338 Double_t xmax[
kVarForSparse]={
fUpmasslimit,
ptmax,
fHigherImpPar,maxsel,maxptmindau,maxsigvert,maxcosp,maxcospxy,maxdecl,maxdeclxy,maxnormdl,maxd0d0};
1341 Int_t nbinsFD[
kVarForSparseFD]={nmassbins,
nptbins,
fNImpParBins,nselbins,nptmindaubins,nsigvertbins,ncospbins,ncospxybins,ndeclbins,ndeclbins,nnormdlbins,nd0d0expbins,84};
1342 Double_t xminFD[
kVarForSparseFD]={
fLowmasslimit,
ptmin,
fLowerImpPar,minsel,minptmindau,minsigvert,mincosp,mincospxy,mindecl,mindeclxy,minnormdl,mind0d0,-2};
1343 Double_t xmaxFD[
kVarForSparseFD]={
fUpmasslimit,
ptmax,
fHigherImpPar,maxsel,maxptmindau,maxsigvert,maxcosp,maxcospxy,maxdecl,maxdeclxy,maxnormdl,maxd0d0,40};
1348 "Mass vs. pt vs.imppar - All",
1351 "Mass vs. pt vs.imppar - promptD",
1354 "Mass vs. pt vs.imppar - DfromB",
1357 "Mass vs. pt vs.true imppar -DfromB",
1360 "Mass vs. pt vs.imppar - backgr.",
1364 for(Int_t i=0; i<5; i++){
1383 fHistTrackVar->GetAxis(1)->SetTitle(
"k#pi#pi inv. mass (GeV/c^{2})");
1387 fHistTrackVar->GetAxis(5)->SetTitle(
"TPC clust./cross.rows");
1398 const Int_t nVarPrompt = 2;
1399 const Int_t nVarFD = 3;
1401 Int_t nbinsPrompt[nVarPrompt]={200,100};
1402 Int_t nbinsFD[nVarFD]={200,100,200};
1404 Double_t xminPrompt[nVarPrompt] = {0.,-1.};
1405 Double_t xmaxPrompt[nVarPrompt] = {40.,1.};
1407 Double_t xminFD[nVarFD] = {0.,-1.,0.};
1408 Double_t xmaxFD[nVarFD] = {40.,1.,40.};
1411 fMCAccPrompt =
new THnSparseF(
"hMCAccPrompt",
"kStepMCAcceptance pt vs. y - promptD",nVarPrompt,nbinsPrompt,xminPrompt,xmaxPrompt);
1416 fMCAccBFeed =
new THnSparseF(
"hMCAccBFeed",
"kStepMCAcceptance pt vs. y vs. ptB - DfromB",nVarFD,nbinsFD,xminFD,xmaxFD);
1417 fMCAccBFeed->GetAxis(0)->SetTitle(
"p_{T} (GeV/c)");
1419 fMCAccBFeed->GetAxis(2)->SetTitle(
"p_{T}^{B} (GeV/c)");
1429 const Int_t nProng = 3;
1431 Double_t zMCVertex = mcHeader->GetVtxZ();
1433 for(Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++){
1434 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(iPart));
1435 if (TMath::Abs(mcPart->GetPdgCode()) == 411){
1440 Bool_t isGoodDecay=kFALSE;
1441 Int_t labDau[4]={-1,-1,-1,-1};
1442 Bool_t isInAcc = kFALSE;
1443 Bool_t isFidAcc = kFALSE;
1446 if(deca > 0) isGoodDecay=kTRUE;
1453 isInAcc=
CheckAcc(arrayMC,nProng,labDau);
1459 Double_t arrayMCprompt[2] = {mcPart->Pt(),mcPart->Y()};
1466 Double_t arrayMCFD[3] = {mcPart->Pt(),mcPart->Y(),ptB};
1481 if(fDebug > 1) printf(
"AnalysisTaskSEDplus: Terminate() \n");
1483 fOutput =
dynamic_cast<TList*
> (GetOutputData(1));
1485 printf(
"ERROR: fOutput not available\n");
1491 printf(
"Number of analyzed events = %d\n",(Int_t)
fHistNEvents->GetBinContent(2));
1493 printf(
"ERROR: fHistNEvents not available\n");
1503 Double_t vtxTrue[3];
1504 mcHeader->GetVertex(vtxTrue);
1506 partDp->XvYvZv(origD);
1507 Short_t
charge=partDp->Charge();
1508 Double_t pXdauTrue[3],pYdauTrue[3],pZdauTrue[3];
1509 for(Int_t iDau=0; iDau<3; iDau++){
1515 Int_t nDau=partDp->GetNDaughters();
1516 Int_t labelFirstDau = partDp->GetDaughter(0);
1518 for(Int_t iDau=0; iDau<3; iDau++){
1519 Int_t ind = labelFirstDau+iDau;
1520 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
1522 AliError(
"Daughter particle not found in MC array");
1525 pXdauTrue[iDau]=part->Px();
1526 pYdauTrue[iDau]=part->Py();
1527 pZdauTrue[iDau]=part->Pz();
1531 for(Int_t iDau=0; iDau<2; iDau++){
1532 Int_t ind = labelFirstDau+iDau;
1533 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
1535 AliError(
"Daughter particle not found in MC array");
1538 Int_t pdgCode=TMath::Abs(part->GetPdgCode());
1539 if(pdgCode==211 || pdgCode==321){
1540 pXdauTrue[theDau]=part->Px();
1541 pYdauTrue[theDau]=part->Py();
1542 pZdauTrue[theDau]=part->Pz();
1545 Int_t nDauRes=part->GetNDaughters();
1547 Int_t labelFirstDauRes = part->GetDaughter(0);
1548 for(Int_t iDauRes=0; iDauRes<2; iDauRes++){
1549 Int_t indDR = labelFirstDauRes+iDauRes;
1550 AliAODMCParticle* partDR =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indDR));
1552 AliError(
"Daughter particle not found in MC array");
1556 Int_t pdgCodeDR=TMath::Abs(partDR->GetPdgCode());
1557 if(pdgCodeDR==211 || pdgCodeDR==321){
1558 pXdauTrue[theDau]=partDR->Px();
1559 pYdauTrue[theDau]=partDR->Py();
1560 pZdauTrue[theDau]=partDR->Pz();
1568 AliError(
"Wrong number of decay prongs");
1573 Double_t d0dummy[3]={0.,0.,0.};
1574 AliAODRecoDecayHF aodDplusMC(vtxTrue,origD,3,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
1582 for(Int_t iprong=0;iprong<3;iprong++){
1584 AliAODTrack *trad = (AliAODTrack*)d->GetDaughter(iprong);
1585 Int_t labd= trad->GetLabel();
1587 AliAODMCParticle *dau = (AliAODMCParticle*)arrayMC->At(labd);
1589 Int_t labm = dau->GetMother();
1591 AliAODMCParticle *mot = (AliAODMCParticle*)arrayMC->At(labm);
1593 if(TMath::Abs(mot->GetPdgCode())==310 || TMath::Abs(mot->GetPdgCode())==130 || TMath::Abs(mot->GetPdgCode())==321){
1594 if(d->PtProng(iprong)<=1)factor[iprong]=1./.7;
1595 else factor[iprong]=1./.6;
1598 if(TMath::Abs(mot->GetPdgCode())==3122) {
1599 factor[iprong]=1./0.25;
1609 for(Int_t k=0;k<3;k++)fact=fact*factor[k];
1617 for (Int_t iProng = 0; iProng<nProng; iProng++){
1618 AliAODMCParticle* mcPartDaughter=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(labDau[iProng]));
1619 if(!mcPartDaughter)
return kFALSE;
1620 Double_t eta = mcPartDaughter->Eta();
1621 Double_t pt = mcPartDaughter->Pt();
1622 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.
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)