28 #include <TClonesArray.h> 33 #include <TDatabasePDG.h> 34 #include "AliAnalysisManager.h" 36 #include "AliAODHandler.h" 37 #include "AliAODEvent.h" 38 #include "AliAODVertex.h" 39 #include "AliAODTrack.h" 42 #include "AliAnalysisTaskSE.h" 100 fLowmasslimit(1.765),
109 fUseStrangeness(kFALSE),
114 fDoTrackVarHist(kFALSE),
116 fUseQuarkTagInKine(kTRUE),
118 fLowerImpPar(-1000.),
119 fHigherImpPar(1000.),
129 for(
Int_t i=0;i<3;i++){
219 for(
Int_t i=0;i<3;i++){
229 DefineOutput(1,TList::Class());
232 DefineOutput(2,TList::Class());
234 DefineOutput(3,AliNormalizationCounter::Class());
238 DefineOutput(4,TNtuple::Class());
302 for(
Int_t i=0;i<3;i++){
306 for(
Int_t i=0;i<5;i++){
309 for(
Int_t i=0;i<3;i++){
363 Int_t missingbins=4-nbins%4;
364 nbins=nbins+missingbins;
367 printf(
"AliAnalysisTaskSEDplus::SetBinWidth: W-bin width of %f will produce histograms not rebinnable by 4. New width set to %f\n",w,width);
370 if(fDebug>1) printf(
"AliAnalysisTaskSEDplus::SetBinWidth: width set to %f\n",width);
384 if(fDebug>1)printf(
"started LS\n");
391 Int_t nPosTrks=0,nNegTrks=0;
392 Int_t nOStriplets = arrayOppositeSign->GetEntriesFast();
395 Int_t nLikeSign = arrayLikeSign->GetEntriesFast();
399 for(
Int_t iLikeSign = 0; iLikeSign < nLikeSign; iLikeSign++) {
409 if(iPtBin<0)
continue;
410 Int_t sign= d->GetCharge();
423 histLSPlus->Fill(invMass);
426 histLSMinus->Fill(invMass);
432 Double_t sumD02=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
436 for(
Int_t i=0;i<3;i++){
437 if(d->PtProng(i)>
ptmax)ptmax=d->PtProng(i);
456 if(nDplusLS!=0)wei3 = (
Float_t)nDplusOS/(
Float_t)(nDplusLS+nDminusLS);
457 Float_t weiplus=1.,weiminus=1.;
458 Float_t wei4plus=1.,wei4minus=1.;
460 if(nPosTrks>2)weiplus=3.*(
Float_t)nNegTrks/((
Float_t)nPosTrks-2.);
461 if(nDplusLS>2)wei4plus=3.*(
Float_t)nDminusLS/((
Float_t)nDplusLS-2.);
462 if(nNegTrks>2)weiminus=3.*(
Float_t)nPosTrks/((
Float_t)nNegTrks-2.);
463 if(nDminusLS>2)wei4minus=3.*(
Float_t)nDplusLS/((
Float_t)nDminusLS-2.);
474 delete histLSPlus;histLSPlus=0;
475 delete histLSMinus;histLSMinus=0;
477 if(fDebug>1) printf(
"LS analysis terminated\n");
485 if(fDebug > 1) printf(
"AnalysisTaskSEDplus::Init() \n");
491 analysis->SetName(
"AnalysisCuts");
504 if(fDebug > 1) printf(
"AnalysisTaskSEDplus::UserCreateOutputObjects() \n");
509 fOutput->SetName(
"OutputHistos");
511 fHistNEvents =
new TH1F(
"fHistNEvents",
"number of events ",10,-0.5,9.5);
512 fHistNEvents->GetXaxis()->SetBinLabel(1,
"nEvents read");
513 fHistNEvents->GetXaxis()->SetBinLabel(2,
"Rejected due to mismatch in trees");
514 fHistNEvents->GetXaxis()->SetBinLabel(3,
"nEvents with good AOD");
515 fHistNEvents->GetXaxis()->SetBinLabel(4,
"Rejected due to trigger");
516 fHistNEvents->GetXaxis()->SetBinLabel(5,
"Rejected due to vertex reco");
517 fHistNEvents->GetXaxis()->SetBinLabel(6,
"Rejected due to pileup");
518 fHistNEvents->GetXaxis()->SetBinLabel(7,
"Rejected due to centrality");
519 fHistNEvents->GetXaxis()->SetBinLabel(8,
"Rejected due to vtxz");
520 fHistNEvents->GetXaxis()->SetBinLabel(9,
"Rejected due to Physics Sel");
521 fHistNEvents->GetXaxis()->SetBinLabel(10,
"nEvents accepted");
526 fHistNCandidates =
new TH1F(
"hNCandidates",
"number of candidates",7,-0.5,6.5);
531 fHistNCandidates->GetXaxis()->SetBinLabel(5,
"D+ after Topological+SingleTrack cuts");
532 fHistNCandidates->GetXaxis()->SetBinLabel(6,
"D+ after Topological+SingleTrack+PID cuts");
558 fHistCentrality[1]=
new TH2F(
"hCentrMult(selectedCent)",
"centrality(selectedCent)",100,0.5,30000.5,40,0.,100.);
559 fHistCentrality[2]=
new TH2F(
"hCentrMult(OutofCent)",
"centrality(OutofCent)",100,0.5,30000.5,40,0.,100.);
560 for(
Int_t i=0;i<3;i++){
568 hisname.Form(
"hMassNoPidPt%d",i);
571 hisname.Form(
"hCosPAllPt%d",i);
572 fCosPHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
574 hisname.Form(
"hDLenAllPt%d",i);
575 fDLenHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
577 hisname.Form(
"hSumd02AllPt%d",i);
578 fSumd02Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
580 hisname.Form(
"hSigVertAllPt%d",i);
581 fSigVertHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
583 hisname.Form(
"hPtMaxAllPt%d",i);
584 fPtMaxHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
586 hisname.Form(
"hPtKPt%d",i);
587 fPtKHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
589 hisname.Form(
"hPtpi1Pt%d",i);
590 fPtpi1Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
592 hisname.Form(
"hPtpi2Pt%d",i);
593 fPtpi2Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
595 hisname.Form(
"hDCAAllPt%d",i);
596 fDCAHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
599 hisname.Form(
"hDLxyPt%d",i);
600 fDLxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
601 fDLxy[index]->Sumw2();
602 hisname.Form(
"hCosxyPt%d",i);
603 fCosxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
606 hisname.Form(
"hMassPt%dTC",i);
609 hisname.Form(
"hMassPt%dTCPlus",i);
612 hisname.Form(
"hMassPt%dTCMinus",i);
617 hisname.Form(
"hSigNoPidPt%d",i);
620 hisname.Form(
"hCosPSigPt%d",i);
621 fCosPHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
623 hisname.Form(
"hDLenSigPt%d",i);
624 fDLenHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
626 hisname.Form(
"hSumd02SigPt%d",i);
627 fSumd02Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
629 hisname.Form(
"hSigVertSigPt%d",i);
630 fSigVertHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
632 hisname.Form(
"hPtMaxSigPt%d",i);
633 fPtMaxHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
635 hisname.Form(
"hPtKSigPt%d",i);
636 fPtKHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
638 hisname.Form(
"hPtpi1SigPt%d",i);
639 fPtpi1Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
641 hisname.Form(
"hPtpi2SigPt%d",i);
642 fPtpi2Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
645 hisname.Form(
"hDCASigPt%d",i);
646 fDCAHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
649 hisname.Form(
"hDLxySigPt%d",i);
650 fDLxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
651 fDLxy[index]->Sumw2();
652 hisname.Form(
"hCosxySigPt%d",i);
653 fCosxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
655 hisname.Form(
"hSigPt%dTC",i);
658 hisname.Form(
"hSigPt%dTCPlus",i);
661 hisname.Form(
"hSigPt%dTCMinus",i);
667 hisname.Form(
"hBkgNoPidPt%d",i);
670 hisname.Form(
"hCosPBkgPt%d",i);
671 fCosPHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
673 hisname.Form(
"hDLenBkgPt%d",i);
674 fDLenHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
676 hisname.Form(
"hSumd02BkgPt%d",i);
677 fSumd02Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
679 hisname.Form(
"hSigVertBkgPt%d",i);
680 fSigVertHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
682 hisname.Form(
"hPtMaxBkgPt%d",i);
683 fPtMaxHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
685 hisname.Form(
"hPtKBkgPt%d",i);
686 fPtKHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
688 hisname.Form(
"hPtpi1BkgPt%d",i);
689 fPtpi1Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
691 hisname.Form(
"hPtpi2BkgPt%d",i);
692 fPtpi2Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
694 hisname.Form(
"hDCABkgPt%d",i);
695 fDCAHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
698 hisname.Form(
"hDLxyBkgPt%d",i);
699 fDLxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
700 fDLxy[index]->Sumw2();
701 hisname.Form(
"hCosxyBkgPt%d",i);
702 fCosxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
706 hisname.Form(
"hBkgPt%dTC",i);
709 hisname.Form(
"hBkgPt%dTCPlus",i);
712 hisname.Form(
"hBkgPt%dTCMinus",i);
743 for(
Int_t i=0; i<3; i++){
752 for(
Int_t jb=0; jb<=300; jb++) ptBinLims[jb]=0.1*(
Double_t)jb;
753 for(
Int_t jb=301; jb<=440; jb++) ptBinLims[jb]=ptBinLims[300]+0.5*(
Double_t)(jb-300);
762 fYVsPtNoPid=
new TH3F(
"hYVsPtNoPid",
"YvsPt (no PID)",40,0.,20.,80,-2.,2.,nbins,
fLowmasslimit,
fUpmasslimit);
763 fYVsPt=
new TH3F(
"hYVsPt",
"YvsPt",40,0.,20.,80,-2.,2.,nbins,
fLowmasslimit,
fUpmasslimit);
764 fYVsPtSigNoPid=
new TH2F(
"hYVsPtSigNoPid",
"YvsPt (MC, only sig., no PID)",40,0.,20.,80,-2.,2.);
765 fYVsPtSig=
new TH2F(
"hYVsPtSig",
"YvsPt (MC, only Sig)",40,0.,20.,80,-2.,2.);
766 fPhiEtaCand=
new TH2F(
"hPhiEtaCand",
"phi vs. eta candidates",20,-1.,1.,50,0.,2*TMath::Pi());
767 fPhiEtaCandSigReg=
new TH2F(
"hPhiEtaCandSigReg",
"phi vs. eta candidates",20,-1.,1.,50,0.,2*TMath::Pi());
772 fSPDMult =
new TH1F(
"hSPDMult",
"Tracklets multiplicity; Tracklets ; Entries",200,0.,maxmult);
788 fDaughterClass->GetXaxis()->SetBinLabel(1,
"AliAODTrack - good ID");
789 fDaughterClass->GetXaxis()->SetBinLabel(2,
"AliAODTrack - charge0");
791 fDaughterClass->GetXaxis()->SetBinLabel(4,
"AliAODTrack - neg ID");
792 fDaughterClass->GetXaxis()->SetBinLabel(5,
"AliAODTrack - different ID");
793 fDaughterClass->GetXaxis()->SetBinLabel(6,
"AliAODRecoDecayHF2Prong");
794 fDaughterClass->GetXaxis()->SetBinLabel(7,
"AliAODRecoDecayHF3Prong");
797 fDeltaID =
new TH1F(
"hDeltaID",
" ; GetDaughter->GetID() - GetProngID()",20001,-10000.5,10000.5);
799 fIDDauVsIDTra =
new TH2F(
"hIDDauVsIDTra",
" ; GetProngID() ; GetDaughter->GetID()",1001,-500.5,500.5,1001,-500.5,500.5);
801 fIDDauVsIDTra =
new TH2F(
"hIDDauVsIDTra",
" ; GetProngID() ; GetDaughter->GetID()",1000,-30000,30000,1000,-30000,30000);
808 TString normName=
"NormalizationCounter";
809 AliAnalysisDataContainer *cont = GetOutputSlot(3)->GetContainer();
810 if(cont)normName=(
TString)cont->GetName();
826 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");
834 fNtupleDplus =
new TNtuple(
"fNtupleDplus",
"D +",
"pdg:Pt:InvMass:d0:origin");
855 if (matchingAODdeltaAODlevel<0 || (matchingAODdeltaAODlevel==0 &&
fAODProtection==1)) {
862 TClonesArray *array3Prong = 0;
863 TClonesArray *arrayLikeSign =0;
864 if(!aod && AODEvent() && IsStandardAOD()) {
870 AliAODHandler* aodHandler = (AliAODHandler*)
871 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
872 if(aodHandler->GetExtensions()) {
873 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
875 array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject(
"Charm3Prong");
876 arrayLikeSign=(TClonesArray*)aodFromExt->GetList()->FindObject(
"LikeSign3Prong");
879 array3Prong=(TClonesArray*)aod->GetList()->FindObject(
"Charm3Prong");
880 arrayLikeSign=(TClonesArray*)aod->GetList()->FindObject(
"LikeSign3Prong");
883 if(!aod || !array3Prong) {
884 printf(
"AliAnalysisTaskSEDplus::UserExec: Charm3Prong branch not found!\n");
887 if(!arrayLikeSign &&
fDoLS) {
888 printf(
"AliAnalysisTaskSEDplus::UserExec: LikeSign3Prong branch not found!\n");
894 if(!aod->GetPrimaryVertex()||TMath::Abs(aod->GetMagneticField())<0.001)
return;
901 Int_t runNumber=aod->GetRunNumber();
905 Float_t ntracks=aod->GetNumberOfTracks();
917 TClonesArray *arrayMC=0;
918 AliAODMCHeader *mcHeader=0;
921 arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
923 printf(
"AliAnalysisTaskSEDplus::UserExec: MC particles branch not found!\n");
928 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
930 printf(
"AliAnalysisTaskSEDplus::UserExec: MC header branch not found!\n");
935 if(aod->GetTriggerMask()==0 &&
936 (runNumber>=195344 && runNumber<=195677)){
958 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
964 Int_t n3Prong = array3Prong->GetEntriesFast();
969 Int_t pdgDgDplustoKpipi[3]={321,211,211};
976 for (
Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
985 Int_t nSelectednopid=0,nSelected=0;
986 for (
Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
995 for(
Int_t jdau=0; jdau<3; jdau++){
996 AliAODTrack *tr=vHF->
GetProng(aod,d,jdau);
997 arrTracks.AddAt(tr,jdau);
1010 for(
Int_t jdau=0; jdau<3; jdau++){
1013 TString cname=odau->ClassName();
1014 if(cname.Contains(
"AliAODTrack")){
1015 AliAODTrack* tr=(AliAODTrack*)d->GetDaughter(jdau);
1016 if(tr->Charge()==0){
1020 Int_t idRecov=tr->GetID();
1021 Int_t dId=idRecov-idStored;
1035 }
else if(cname.Contains(
"AliAODRecoDecayHF2")){
1038 }
else if(cname.Contains(
"AliAODRecoDecayHF3")){
1041 }
else if(cname.Contains(
"AliAODRecoCascadeHF")){
1055 Bool_t passSingleTrackCuts=kTRUE;
1060 if(!passSingleTrackCuts)
continue;
1080 AliAODVertex *origownvtx=0x0;
1089 Bool_t isFeeddown=kFALSE;
1094 labDp = d->MatchToMC(411,arrayMC,3,pdgDgDplustoKpipi);
1096 AliAODMCParticle *partDp = (AliAODMCParticle*)arrayMC->At(labDp);
1098 pdgCode=TMath::Abs(partDp->GetPdgCode());
1117 if(passTopolAndPIDCuts) {
1118 fYVsPt->Fill(ptCand,rapid,invMass);
1123 if(passTopolAndPIDCuts)
fYVsPtSig->Fill(ptCand,rapid, invMass);
1130 Double_t dlen=0,cosp=0,dlenxy=0,cospxy=0, ndlenxy=0, dd0max=0;
1134 sumD02=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
1136 for(
Int_t idau=0;idau<3;idau++)
if(d->GetDCA(idau)>maxdca) maxdca=d->GetDCA(idau);
1142 for(
Int_t i=0; i<3; i++) {
1144 if(d->PtProng(i)<minPtDau) minPtDau=d->PtProng(i);
1147 Double_t normdd0= diffIP/errdiffIP;
1148 if(i==0) dd0max=normdd0;
1149 else if(TMath::Abs(normdd0)>TMath::Abs(dd0max)) dd0max=normdd0;
1155 if(passTopolAndPIDCuts) resSel=2;
1156 if(
fSystem==1) dd0max = TMath::Abs(dd0max);
1159 Double_t arrayForSparse[
kVarForSparse]={invMass,ptCand,TMath::Abs(impparXY),resSel,minPtDau,sigvert,cosp,cospxy,dlen,dlenxy,ndlenxy,dd0max,(
Double_t)tracklets};
1161 Double_t arrayForSparseFD[
kVarForSparseFD]={invMass,ptCand,TMath::Abs(impparXY),resSel,minPtDau,sigvert,cosp,cospxy,dlen,dlenxy,ndlenxy,dd0max,(
Double_t)tracklets,ptB};
1172 for(
int i = 0; i < 3; i++) {
1173 Double_t ptTrack = 0, nCrossedRowsTPC = 0, nClustersTPC = 0, ratioCRowsFClu = 0, isSig = 0;
1174 track = (AliAODTrack*)d->GetDaughter(i);
1175 AliESDtrack esdTrack(track);
1176 esdTrack.SetTPCClusterMap(track->GetTPCClusterMap());
1177 esdTrack.SetTPCSharedMap(track->GetTPCSharedMap());
1178 esdTrack.SetTPCPointsF(track->GetTPCNclsF());
1179 ptTrack = track->Pt();
1180 nCrossedRowsTPC = esdTrack.GetTPCCrossedRows();
1181 nClustersTPC = esdTrack.GetTPCNcls();
1182 if(esdTrack.GetTPCNclsF()>0) {
1183 ratioCRowsFClu = nCrossedRowsTPC / esdTrack.GetTPCNclsF();
1185 if(isPrimary) isSig = 1.;
1186 else if(isFeeddown) isSig = 2.;
1190 if(passTopolAndPIDCuts){
1207 if(passTopolAndPIDCuts){
1211 if(d->GetCharge()>0){
1215 else if(d->GetCharge()<0){
1227 fPtKHist[index]->Fill(d->PtProng(1));
1231 fDLxy[index]->Fill(ndlenxy);
1232 fCosxy[index]->Fill(cospxy);
1233 fCorreld0Kd0pi[0]->Fill(d->Getd0Prong(0)*d->Getd0Prong(1),d->Getd0Prong(2)*d->Getd0Prong(1));
1243 if(isFeeddown) tmp[0]+=5000.;
1248 tmp[5]=d->GetCharge();
1253 tmp[9]=d->PtProng(0);
1254 tmp[10]=d->PtProng(1);
1255 tmp[11]=d->PtProng(2);
1256 tmp[12]=d->PProng(0);
1257 tmp[13]=d->PProng(1);
1258 tmp[14]=d->PProng(2);
1267 tmp[23]=d->Getd0Prong(0);
1268 tmp[24]=d->Getd0Prong(1);
1269 tmp[25]=d->Getd0Prong(2);
1282 if(isFeeddown) tmp[0]+=5000.;
1288 if(isPrimary&&labDp>=0)flagOrigin=1;
1289 if(isFeeddown&&labDp>=0)flagOrigin=2;
1290 if(!(labDp>=0))flagOrigin=3;
1304 else if(isFeeddown){
1311 else if(isFeeddown){
1320 if(passTopolAndPIDCuts){
1327 fDLxy[index]->Fill(ndlenxy);
1328 fCosxy[index]->Fill(cospxy);
1329 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];
1333 fPtKHist[index]->Fill(d->PtProng(1),fact);
1336 fDCAHist[index]->Fill(maxdca,fact);
1337 fCorreld0Kd0pi[1]->Fill(d->Getd0Prong(0)*d->Getd0Prong(1),d->Getd0Prong(2)*d->Getd0Prong(1));
1355 if(
fDoLS && arrayLikeSign)
LSAnalysis(array3Prong,arrayLikeSign,aod,vtx1,nOS);
1385 hisname.Form(
"hLSPt%d",i);
1389 hisname.Form(
"hCosPAllPt%dLS",i);
1392 hisname.Form(
"hDLenAllPt%dLS",i);
1395 hisname.Form(
"hSumd02AllPt%dLS",i);
1398 hisname.Form(
"hSigVertAllPt%dLS",i);
1401 hisname.Form(
"hPtMaxAllPt%dLS",i);
1404 hisname.Form(
"hDCAAllPt%dLS",i);
1405 fDCAHistLS[index]=
new TH1F(hisname.Data(),hisname.Data(),
nbins,0.,0.1);
1411 hisname.Form(
"hLSPt%dnw",i);
1415 hisname.Form(
"hCosPSigPt%dLS",i);
1418 hisname.Form(
"hDLenSigPt%dLS",i);
1421 hisname.Form(
"hSumd02SigPt%dLS",i);
1424 hisname.Form(
"hSigVertSigPt%dLS",i);
1427 hisname.Form(
"hPtMaxSigPt%dLS",i);
1430 hisname.Form(
"hDCASigPt%dLS",i);
1431 fDCAHistLS[index]=
new TH1F(hisname.Data(),hisname.Data(),
nbins,0.,0.1);
1437 hisname.Form(
"hLSPt%dLCntrip",i);
1441 hisname.Form(
"hCosPBkgPt%dLS",i);
1444 hisname.Form(
"hDLenBkgPt%dLS",i);
1447 hisname.Form(
"hSumd02BkgPt%dLS",i);
1450 hisname.Form(
"hSigVertBkgPt%dLS",i);
1453 hisname.Form(
"hPtMaxBkgPt%dLS",i);
1456 hisname.Form(
"hDCABkgPt%dLS",i);
1457 fDCAHistLS[index]=
new TH1F(hisname.Data(),hisname.Data(),
nbins,0.,0.1);
1461 hisname.Form(
"hLSPt%dLCntripsinglecut",i);
1466 hisname.Form(
"hLSPt%dspc",i);
1504 "Mass vs. pt vs.imppar - All",
1507 "Mass vs. pt vs.imppar - promptD",
1510 "Mass vs. pt vs.imppar - DfromB",
1513 "Mass vs. pt vs.true imppar -DfromB",
1516 "Mass vs. pt vs.imppar - backgr.",
1519 for(
Int_t i=0; i<5; i++){
1539 Int_t nnormdlbins=30;
1551 Int_t nptmindaubins;
1649 nmultbins = maxmult-minmult;
1653 TString axTit[
kVarForSparse]={
"M_{K#pi#pi} (GeV/c^{2})",
"p_{T} (GeV/c)",
"Imp Par (#mum)",
"passTopolPID",
"min. daughter p_{T} (GeV/c)",
"sigmaVertex",
"cos(#theta_{P})",
"cos(#theta_{P}^{xy})",
"decL (cm)",
"decL XY (cm)",
"Norm decL XY",
"Norm max d0-d0exp",
"N_{trkls}"};
1655 Int_t nbins[
kVarForSparse]={nmassbins,
nptbins,nd0bins,nselbins,nptmindaubins,nsigvertbins,ncospbins,ncospxybins,ndeclbins,ndeclxybins,nnormdlbins,nd0d0expbins,nmultbins};
1656 Double_t xmin[
kVarForSparse]={
fLowmasslimit,
ptmin,
d0min,minsel,minptmindau,minsigvert,mincosp,mincospxy,mindecl,mindeclxy,minnormdl,mind0d0,minmult};
1657 Double_t xmax[
kVarForSparse]={
fUpmasslimit,
ptmax,
d0max,maxsel,maxptmindau,maxsigvert,maxcosp,maxcospxy,maxdecl,maxdeclxy,maxnormdl,maxd0d0,maxmult};
1660 Int_t nbinsFD[
kVarForSparseFD]={nmassbins,
nptbins,nd0bins,nselbins,nptmindaubins,nsigvertbins,ncospbins,ncospxybins,ndeclbins,ndeclbins,nnormdlbins,nd0d0expbins,nmultbins,84};
1661 Double_t xminFD[
kVarForSparseFD]={
fLowmasslimit,
ptmin,
d0min,minsel,minptmindau,minsigvert,mincosp,mincospxy,mindecl,mindeclxy,minnormdl,mind0d0,minmult,-2};
1662 Double_t xmaxFD[
kVarForSparseFD]={
fUpmasslimit,
ptmax,
d0max,maxsel,maxptmindau,maxsigvert,maxcosp,maxcospxy,maxdecl,maxdeclxy,maxnormdl,maxd0d0,maxmult,40};
1666 "Mass vs. pt vs. cut vars - All",
1669 "Mass vs. pt vs. cut vars - promptD",
1672 "Mass vs. pt vs. cut vars - DfromB",
1675 for(
Int_t i=0; i<3; i++){
1695 fHistTrackVar->GetAxis(1)->SetTitle(
"k#pi#pi inv. mass (GeV/c^{2})");
1699 fHistTrackVar->GetAxis(5)->SetTitle(
"TPC clust./cross.rows");
1710 const Int_t nVarPrompt = 3;
1711 const Int_t nVarFD = 4;
1718 nmultbins=multmax-multmin;
1725 Int_t nbinsPrompt[nVarPrompt]={200,100,nmultbins};
1726 Int_t nbinsFD[nVarFD]={200,100,nmultbins,200};
1728 Double_t xminPrompt[nVarPrompt] = {0.,-1.,multmin};
1729 Double_t xmaxPrompt[nVarPrompt] = {40.,1.,multmax};
1731 Double_t xminFD[nVarFD] = {0.,-1.,multmin,0.};
1732 Double_t xmaxFD[nVarFD] = {40.,1.,multmax,40.};
1735 fMCAccPrompt =
new THnSparseF(
"hMCAccPrompt",
"kStepMCAcceptance pt vs. y vs. Ntracklets - promptD",nVarPrompt,nbinsPrompt,xminPrompt,xmaxPrompt);
1741 fMCAccBFeed =
new THnSparseF(
"hMCAccBFeed",
"kStepMCAcceptance pt vs. y vs. Ntracklets vs. ptB - DfromB",nVarFD,nbinsFD,xminFD,xmaxFD);
1742 fMCAccBFeed->GetAxis(0)->SetTitle(
"p_{T} (GeV/c)");
1745 fMCAccBFeed->GetAxis(3)->SetTitle(
"p_{T}^{B} (GeV/c)");
1755 const Int_t nProng = 3;
1757 Double_t zMCVertex = mcHeader->GetVtxZ();
1759 for(
Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++){
1760 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(iPart));
1761 if (TMath::Abs(mcPart->GetPdgCode()) == 411){
1766 Bool_t isGoodDecay=kFALSE;
1767 Int_t labDau[4]={-1,-1,-1,-1};
1769 Bool_t isFidAcc = kFALSE;
1772 if(deca > 0) isGoodDecay=kTRUE;
1779 isInAcc=
CheckAcc(arrayMC,nProng,labDau);
1785 Double_t arrayMCprompt[3] = {mcPart->Pt(),mcPart->Y(),(
Double_t)tracklets};
1792 Double_t arrayMCFD[4] = {mcPart->Pt(),mcPart->Y(),(
Double_t)tracklets,ptB};
1807 if(fDebug > 1) printf(
"AnalysisTaskSEDplus: Terminate() \n");
1811 printf(
"ERROR: fOutput not available\n");
1817 printf(
"Number of analyzed events = %d\n",(
Int_t)
fHistNEvents->GetBinContent(10));
1819 printf(
"ERROR: fHistNEvents not available\n");
1830 mcHeader->GetVertex(vtxTrue);
1832 partDp->XvYvZv(origD);
1834 Double_t pXdauTrue[3],pYdauTrue[3],pZdauTrue[3];
1835 for(
Int_t iDau=0; iDau<3; iDau++){
1841 Int_t nDau=partDp->GetNDaughters();
1842 Int_t labelFirstDau = partDp->GetDaughter(0);
1844 for(
Int_t iDau=0; iDau<3; iDau++){
1845 Int_t ind = labelFirstDau+iDau;
1846 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
1848 AliError(
"Daughter particle not found in MC array");
1851 pXdauTrue[iDau]=part->Px();
1852 pYdauTrue[iDau]=part->Py();
1853 pZdauTrue[iDau]=part->Pz();
1857 for(
Int_t iDau=0; iDau<2; iDau++){
1858 Int_t ind = labelFirstDau+iDau;
1859 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
1861 AliError(
"Daughter particle not found in MC array");
1864 Int_t pdgCode=TMath::Abs(part->GetPdgCode());
1865 if(pdgCode==211 || pdgCode==321){
1866 pXdauTrue[theDau]=part->Px();
1867 pYdauTrue[theDau]=part->Py();
1868 pZdauTrue[theDau]=part->Pz();
1871 Int_t nDauRes=part->GetNDaughters();
1873 Int_t labelFirstDauRes = part->GetDaughter(0);
1874 for(
Int_t iDauRes=0; iDauRes<2; iDauRes++){
1875 Int_t indDR = labelFirstDauRes+iDauRes;
1876 AliAODMCParticle* partDR =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indDR));
1878 AliError(
"Daughter particle not found in MC array");
1882 Int_t pdgCodeDR=TMath::Abs(partDR->GetPdgCode());
1883 if(pdgCodeDR==211 || pdgCodeDR==321){
1884 pXdauTrue[theDau]=partDR->Px();
1885 pYdauTrue[theDau]=partDR->Py();
1886 pZdauTrue[theDau]=partDR->Pz();
1894 AliError(
"Wrong number of decay prongs");
1900 AliAODRecoDecayHF aodDplusMC(vtxTrue,origD,3,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
1908 for(
Int_t iprong=0;iprong<3;iprong++){
1910 AliAODTrack *trad = (AliAODTrack*)d->GetDaughter(iprong);
1911 Int_t labd= trad->GetLabel();
1913 AliAODMCParticle *dau = (AliAODMCParticle*)arrayMC->At(labd);
1915 Int_t labm = dau->GetMother();
1917 AliAODMCParticle *mot = (AliAODMCParticle*)arrayMC->At(labm);
1919 if(TMath::Abs(mot->GetPdgCode())==310 || TMath::Abs(mot->GetPdgCode())==130 || TMath::Abs(mot->GetPdgCode())==321){
1920 if(d->PtProng(iprong)<=1)factor[iprong]=1./.7;
1921 else factor[iprong]=1./.6;
1924 if(TMath::Abs(mot->GetPdgCode())==3122) {
1925 factor[iprong]=1./0.25;
1935 for(
Int_t k=0;k<3;k++)fact=fact*factor[k];
1943 for (
Int_t iProng = 0; iProng<nProng; iProng++){
1944 AliAODMCParticle* mcPartDaughter=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(labDau[iProng]));
1945 if(!mcPartDaughter)
return kFALSE;
1946 Double_t eta = mcPartDaughter->Eta();
1947 Double_t pt = mcPartDaughter->Pt();
1948 if (TMath::Abs(eta) > 0.9 || pt < 0.1)
return kFALSE;
THnSparseF * fMCAccPrompt
!histo for StepMCAcc for Dplus prompt (pt,y,ptB)
Bool_t fCutOnTrckl
maximum number of tracklets
TH2F * fPhiEtaCand
! hist. with eta/phi distribution of candidates
Double_t NormalizedDecayLengthXY() const
TH1F ** fSigVertHist
!hist. for sigVert (topol+PID)
TH1F ** fSumd02HistLS
!hist. for LS cuts variable 3 (topol+PID)
AliAODTrack * GetProng(AliVEvent *event, AliAODRecoDecayHF *rd, Int_t iprong)
Double_t NormalizedDecayLength() const
void FillMCAcceptanceHistos(TClonesArray *arrayMC, AliAODMCHeader *mcHeader, Int_t tracklets)
Bool_t fUseStrangeness
flag for access to MC
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
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
static Int_t CheckDplusDecay(AliMCEvent *mcEvent, Int_t label, Int_t *arrayDauLab)
TH1F ** fMassHistLS
!hist. for LS inv mass (topol+PID)
Int_t fAODProtection
flag for filling ntuple 0 no NTuple 1 big Ntuple 2 small NTuple
Int_t GetIsSelectedCuts() const
TH2F * fPtVsMassPlus
! hist. of pt vs. mass, D+ candidates (topol+PID cuts)
Bool_t fDoSparse
flag to activate impact paramter histos
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)
void UnsetOwnPrimaryVtx()
TH1F ** fMassHistMinus
! hist. for D- inv mass (topol+PID cuts)
TH1F ** fSumd02Hist
!hist. for sum d02 (topol+PID)
Int_t fEtaSelection
flag to do LS analysis
Bool_t fDoTrackVarHist
flag to activate sparses for cut variation study
Float_t fLowerImpPar
nunber of bins in impact parameter histos
TH2F * fHistCentrality[3]
!hist. for cent distr (all,sel ev, )
Double_t ImpParXY() const
TH1F * fSPDMult
! hist. of spd mult
virtual ~AliAnalysisTaskSEDplus()
static Int_t CheckMatchingAODdeltaAODevents()
Int_t GetLSHistoIndex(Int_t iPtBin) const
TH1F ** fCosxy
!hist. for Cosxy (topol+PID)
Int_t GetSignalHistoIndex(Int_t iPtBin) const
THnSparseF * fHistTrackVar
! histograms for track cuts study
UInt_t GetPIDTrackTPCTOFBitMap(AliAODTrack *track) const
Int_t GetWhyRejection() const
TH1F ** fPtpi1Hist
!hist. for PtPi1 (topol+PID)
Double_t CosPointingAngleXY() const
TH1F ** fDLenHistLS
!hist. for LS cuts variable 2 (topol+PID)
TList * fListCuts
width of one bin in output histos
Bool_t FillRecoCand(AliVEvent *event, AliAODRecoDecayHF3Prong *rd3)
TAxis * GetAxis(TDirectory *dir, const char *name, Bool_t verbose=true)
TH2F * fPtVsMassGoodDaus
! hist. of pt vs. mass (topol+PID cuts)
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
TH1F ** fPtMaxHist
!hist. for Pt Max (topol+PID)
static Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPart, Bool_t searchUpToQuark=kTRUE)
Functions to check the decay tree.
TH1F ** fDCAHistLS
!hist. for LS cuts variable 6 (topol+PID)
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
Bool_t HasBadDaughters() const
TH2F * fYVsPtSig
! hist. of Y vs. Pt (MC, only sig, topol+PID cuts)
TH1F ** fPtKHist
!hist. for PtK (topol+PID)
Float_t fHigherImpPar
lower limit in impact parameter (um)
Class for cuts on AOD reconstructed D+->Kpipi.
void CreateImpactParameterHistos()
static Int_t GetNumberOfTrackletsInEtaRange(AliAODEvent *ev, Double_t mineta, Double_t maxeta)
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
TH1F ** fMassHistPlus
! hist. for D+ inv mass (topol+PID cuts)
void CreateTrackVarHistos()
void CreateCutVarsSparses()
TH2F * fPtVsMassBadDaus
! hist. of pt vs. mass (topol+PID cuts)
TH2F * fPtVsMass
! hist. of pt vs. mass (topol+PID cuts)
AliAODVertex * GetOwnPrimaryVtx() const
Double_t GetSigmaVert(const AliAODEvent *aod=0x0)
TH1F ** fPtMaxHistLS
!hist. for LS cuts variable 5 (topol+PID)
Int_t fDoLS
higher limit in impact parameter (um)
virtual Int_t PreSelect(TObjArray aodTracks)
TH2F * fPhiEtaCandSigReg
! hist. eta/phi of candidates in D+ mass region
Float_t GetCentrality(AliAODEvent *aodEvent)
UShort_t GetProngID(Int_t ip) const
Double_t InvMassDplus() const
Float_t GetTrueImpactParameter(const AliAODMCHeader *mcHeader, TClonesArray *arrayMC, const AliAODMCParticle *partDp) const
TH1F * fDaughterClass
! hist
Int_t fNImpParBins
flag for quark/hadron level identification of prompt and feeddown
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)
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
TH1F ** fMassHistNoPid
! hist. for inv mass (w/o PID)
TH1F ** fMassHist
! hist. for inv mass (topol+PID cuts)
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 ** fDLenHist
!hist. for Dec Length (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
Float_t fBinWidth
Number of Pt Bins.
void SetMassLimits(Float_t range)
TH1F ** fCosPHistLS
!hist. for LS cuts variable 1 (topol+PID)
TH1F ** fCosPHist
!hist. for PointingAngle (topol+PID)
TH1F ** fDCAHist
!hist. for DCA (topol+PID)
void CleanOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod, AliAODVertex *origownvtx) const
TH2F * fIDDauVsIDTra
! hist
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)
Bool_t fDoImpPar
flag to activate cuts distr histos
AliNormalizationCounter * fCounter
Cuts for Analysis.
Int_t fNtrcklMin
0=pp,1=PbPb
Bool_t fUseBit
flag to enhance strangeness in MC to fit to data
TH1F ** fDLxy
!hist. for DLxy (topol+PID)
void CreateLikeSignHistos()
TH2F * fPtVsMassMinus
! hist. of pt vs. mass, D- candidates (topol+PID cuts)
TH1F ** fSigVertHistLS
!hist. for LS cuts variable 4 (topol+PID)
Double_t CosPointingAngle() const
Float_t GetStrangenessWeights(const AliAODRecoDecayHF3Prong *d, TClonesArray *arrayMC, Float_t factor[3]) const
Float_t fLowmasslimit
upper inv mass limit for histos
Int_t GetUseCentrality() const
Bool_t RecalcOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
TH1F * fHistNCandidates
! hist. for No. of candidates
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
THnSparseF * fSparseCutVars[3]
! histograms for cut variation study
Int_t fNtrcklMax
minimum number of tracklets
void CreateMCAcceptanceHistos()
TList * OpenFile(const char *fname)
TH1F ** fPtpi2Hist
!hist. for PtPi2 (topol+PID)