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",6,-0.5,5.5);
531 fHistNCandidates->GetXaxis()->SetBinLabel(5,
"D+ after Topological+SingleTrack cuts");
532 fHistNCandidates->GetXaxis()->SetBinLabel(6,
"D+ after Topological+SingleTrack+PID cuts");
557 fHistCentrality[1]=
new TH2F(
"hCentrMult(selectedCent)",
"centrality(selectedCent)",100,0.5,30000.5,40,0.,100.);
558 fHistCentrality[2]=
new TH2F(
"hCentrMult(OutofCent)",
"centrality(OutofCent)",100,0.5,30000.5,40,0.,100.);
559 for(
Int_t i=0;i<3;i++){
567 hisname.Form(
"hMassNoPidPt%d",i);
570 hisname.Form(
"hCosPAllPt%d",i);
571 fCosPHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
573 hisname.Form(
"hDLenAllPt%d",i);
574 fDLenHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
576 hisname.Form(
"hSumd02AllPt%d",i);
577 fSumd02Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
579 hisname.Form(
"hSigVertAllPt%d",i);
580 fSigVertHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
582 hisname.Form(
"hPtMaxAllPt%d",i);
583 fPtMaxHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
585 hisname.Form(
"hPtKPt%d",i);
586 fPtKHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
588 hisname.Form(
"hPtpi1Pt%d",i);
589 fPtpi1Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
591 hisname.Form(
"hPtpi2Pt%d",i);
592 fPtpi2Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
594 hisname.Form(
"hDCAAllPt%d",i);
595 fDCAHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
598 hisname.Form(
"hDLxyPt%d",i);
599 fDLxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
600 fDLxy[index]->Sumw2();
601 hisname.Form(
"hCosxyPt%d",i);
602 fCosxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
605 hisname.Form(
"hMassPt%dTC",i);
608 hisname.Form(
"hMassPt%dTCPlus",i);
611 hisname.Form(
"hMassPt%dTCMinus",i);
616 hisname.Form(
"hSigNoPidPt%d",i);
619 hisname.Form(
"hCosPSigPt%d",i);
620 fCosPHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
622 hisname.Form(
"hDLenSigPt%d",i);
623 fDLenHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
625 hisname.Form(
"hSumd02SigPt%d",i);
626 fSumd02Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
628 hisname.Form(
"hSigVertSigPt%d",i);
629 fSigVertHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
631 hisname.Form(
"hPtMaxSigPt%d",i);
632 fPtMaxHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
634 hisname.Form(
"hPtKSigPt%d",i);
635 fPtKHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
637 hisname.Form(
"hPtpi1SigPt%d",i);
638 fPtpi1Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
640 hisname.Form(
"hPtpi2SigPt%d",i);
641 fPtpi2Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
644 hisname.Form(
"hDCASigPt%d",i);
645 fDCAHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
648 hisname.Form(
"hDLxySigPt%d",i);
649 fDLxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
650 fDLxy[index]->Sumw2();
651 hisname.Form(
"hCosxySigPt%d",i);
652 fCosxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
654 hisname.Form(
"hSigPt%dTC",i);
657 hisname.Form(
"hSigPt%dTCPlus",i);
660 hisname.Form(
"hSigPt%dTCMinus",i);
666 hisname.Form(
"hBkgNoPidPt%d",i);
669 hisname.Form(
"hCosPBkgPt%d",i);
670 fCosPHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
672 hisname.Form(
"hDLenBkgPt%d",i);
673 fDLenHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
675 hisname.Form(
"hSumd02BkgPt%d",i);
676 fSumd02Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
678 hisname.Form(
"hSigVertBkgPt%d",i);
679 fSigVertHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
681 hisname.Form(
"hPtMaxBkgPt%d",i);
682 fPtMaxHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
684 hisname.Form(
"hPtKBkgPt%d",i);
685 fPtKHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
687 hisname.Form(
"hPtpi1BkgPt%d",i);
688 fPtpi1Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
690 hisname.Form(
"hPtpi2BkgPt%d",i);
691 fPtpi2Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
693 hisname.Form(
"hDCABkgPt%d",i);
694 fDCAHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
697 hisname.Form(
"hDLxyBkgPt%d",i);
698 fDLxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
699 fDLxy[index]->Sumw2();
700 hisname.Form(
"hCosxyBkgPt%d",i);
701 fCosxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
705 hisname.Form(
"hBkgPt%dTC",i);
708 hisname.Form(
"hBkgPt%dTCPlus",i);
711 hisname.Form(
"hBkgPt%dTCMinus",i);
742 for(
Int_t i=0; i<3; i++){
751 for(
Int_t jb=0; jb<=300; jb++) ptBinLims[jb]=0.1*(
Double_t)jb;
752 for(
Int_t jb=301; jb<=440; jb++) ptBinLims[jb]=ptBinLims[300]+0.5*(
Double_t)(jb-300);
761 fYVsPtNoPid=
new TH3F(
"hYVsPtNoPid",
"YvsPt (no PID)",40,0.,20.,80,-2.,2.,nbins,
fLowmasslimit,
fUpmasslimit);
762 fYVsPt=
new TH3F(
"hYVsPt",
"YvsPt",40,0.,20.,80,-2.,2.,nbins,
fLowmasslimit,
fUpmasslimit);
763 fYVsPtSigNoPid=
new TH2F(
"hYVsPtSigNoPid",
"YvsPt (MC, only sig., no PID)",40,0.,20.,80,-2.,2.);
764 fYVsPtSig=
new TH2F(
"hYVsPtSig",
"YvsPt (MC, only Sig)",40,0.,20.,80,-2.,2.);
765 fPhiEtaCand=
new TH2F(
"hPhiEtaCand",
"phi vs. eta candidates",20,-1.,1.,50,0.,2*TMath::Pi());
766 fPhiEtaCandSigReg=
new TH2F(
"hPhiEtaCandSigReg",
"phi vs. eta candidates",20,-1.,1.,50,0.,2*TMath::Pi());
771 fSPDMult =
new TH1F(
"hSPDMult",
"Tracklets multiplicity; Tracklets ; Entries",200,0.,maxmult);
787 fDaughterClass->GetXaxis()->SetBinLabel(1,
"AliAODTrack - good ID");
788 fDaughterClass->GetXaxis()->SetBinLabel(2,
"AliAODTrack - charge0");
790 fDaughterClass->GetXaxis()->SetBinLabel(4,
"AliAODTrack - neg ID");
791 fDaughterClass->GetXaxis()->SetBinLabel(5,
"AliAODTrack - different ID");
792 fDaughterClass->GetXaxis()->SetBinLabel(6,
"AliAODRecoDecayHF2Prong");
793 fDaughterClass->GetXaxis()->SetBinLabel(7,
"AliAODRecoDecayHF3Prong");
796 fDeltaID =
new TH1F(
"hDeltaID",
" ; GetDaughter->GetID() - GetProngID()",20001,-10000.5,10000.5);
798 fIDDauVsIDTra =
new TH2F(
"hIDDauVsIDTra",
" ; GetProngID() ; GetDaughter->GetID()",1001,-500.5,500.5,1001,-500.5,500.5);
800 fIDDauVsIDTra =
new TH2F(
"hIDDauVsIDTra",
" ; GetProngID() ; GetDaughter->GetID()",1000,-30000,30000,1000,-30000,30000);
807 TString normName=
"NormalizationCounter";
808 AliAnalysisDataContainer *cont = GetOutputSlot(3)->GetContainer();
809 if(cont)normName=(
TString)cont->GetName();
825 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");
833 fNtupleDplus =
new TNtuple(
"fNtupleDplus",
"D +",
"pdg:Pt:InvMass:d0:origin");
854 if (matchingAODdeltaAODlevel<0 || (matchingAODdeltaAODlevel==0 &&
fAODProtection==1)) {
861 TClonesArray *array3Prong = 0;
862 TClonesArray *arrayLikeSign =0;
863 if(!aod && AODEvent() && IsStandardAOD()) {
869 AliAODHandler* aodHandler = (AliAODHandler*)
870 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
871 if(aodHandler->GetExtensions()) {
872 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
874 array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject(
"Charm3Prong");
875 arrayLikeSign=(TClonesArray*)aodFromExt->GetList()->FindObject(
"LikeSign3Prong");
878 array3Prong=(TClonesArray*)aod->GetList()->FindObject(
"Charm3Prong");
879 arrayLikeSign=(TClonesArray*)aod->GetList()->FindObject(
"LikeSign3Prong");
882 if(!aod || !array3Prong) {
883 printf(
"AliAnalysisTaskSEDplus::UserExec: Charm3Prong branch not found!\n");
886 if(!arrayLikeSign &&
fDoLS) {
887 printf(
"AliAnalysisTaskSEDplus::UserExec: LikeSign3Prong branch not found!\n");
893 if(!aod->GetPrimaryVertex()||TMath::Abs(aod->GetMagneticField())<0.001)
return;
900 Int_t runNumber=aod->GetRunNumber();
904 Float_t ntracks=aod->GetNumberOfTracks();
916 TClonesArray *arrayMC=0;
917 AliAODMCHeader *mcHeader=0;
920 arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
922 printf(
"AliAnalysisTaskSEDplus::UserExec: MC particles branch not found!\n");
927 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
929 printf(
"AliAnalysisTaskSEDplus::UserExec: MC header branch not found!\n");
934 if(aod->GetTriggerMask()==0 &&
935 (runNumber>=195344 && runNumber<=195677)){
957 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
963 Int_t n3Prong = array3Prong->GetEntriesFast();
968 Int_t pdgDgDplustoKpipi[3]={321,211,211};
975 for (
Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
984 Int_t nSelectednopid=0,nSelected=0;
985 for (
Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
999 for(
Int_t jdau=0; jdau<3; jdau++){
1002 TString cname=odau->ClassName();
1003 if(cname.Contains(
"AliAODTrack")){
1004 AliAODTrack* tr=(AliAODTrack*)d->GetDaughter(jdau);
1005 if(tr->Charge()==0){
1009 Int_t idRecov=tr->GetID();
1010 Int_t dId=idRecov-idStored;
1024 }
else if(cname.Contains(
"AliAODRecoDecayHF2")){
1027 }
else if(cname.Contains(
"AliAODRecoDecayHF3")){
1030 }
else if(cname.Contains(
"AliAODRecoCascadeHF")){
1044 Bool_t passSingleTrackCuts=kTRUE;
1049 if(!passSingleTrackCuts)
continue;
1069 AliAODVertex *origownvtx=0x0;
1078 Bool_t isFeeddown=kFALSE;
1083 labDp = d->MatchToMC(411,arrayMC,3,pdgDgDplustoKpipi);
1085 AliAODMCParticle *partDp = (AliAODMCParticle*)arrayMC->At(labDp);
1087 pdgCode=TMath::Abs(partDp->GetPdgCode());
1106 if(passTopolAndPIDCuts) {
1107 fYVsPt->Fill(ptCand,rapid,invMass);
1112 if(passTopolAndPIDCuts)
fYVsPtSig->Fill(ptCand,rapid, invMass);
1119 Double_t dlen=0,cosp=0,dlenxy=0,cospxy=0, ndlenxy=0, dd0max=0;
1123 sumD02=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
1125 for(
Int_t idau=0;idau<3;idau++)
if(d->GetDCA(idau)>maxdca) maxdca=d->GetDCA(idau);
1131 for(
Int_t i=0; i<3; i++) {
1133 if(d->PtProng(i)<minPtDau) minPtDau=d->PtProng(i);
1136 Double_t normdd0= diffIP/errdiffIP;
1137 if(i==0) dd0max=normdd0;
1138 else if(TMath::Abs(normdd0)>TMath::Abs(dd0max)) dd0max=normdd0;
1144 if(passTopolAndPIDCuts) resSel=2;
1145 if(
fSystem==1) dd0max = TMath::Abs(dd0max);
1148 Double_t arrayForSparse[
kVarForSparse]={invMass,ptCand,TMath::Abs(impparXY),resSel,minPtDau,sigvert,cosp,cospxy,dlen,dlenxy,ndlenxy,dd0max,(
Double_t)tracklets};
1150 Double_t arrayForSparseFD[
kVarForSparseFD]={invMass,ptCand,TMath::Abs(impparXY),resSel,minPtDau,sigvert,cosp,cospxy,dlen,dlenxy,ndlenxy,dd0max,(
Double_t)tracklets,ptB};
1161 for(
int i = 0; i < 3; i++) {
1162 Double_t ptTrack = 0, nCrossedRowsTPC = 0, nClustersTPC = 0, ratioCRowsFClu = 0, isSig = 0;
1163 track = (AliAODTrack*)d->GetDaughter(i);
1164 AliESDtrack esdTrack(track);
1165 esdTrack.SetTPCClusterMap(track->GetTPCClusterMap());
1166 esdTrack.SetTPCSharedMap(track->GetTPCSharedMap());
1167 esdTrack.SetTPCPointsF(track->GetTPCNclsF());
1168 ptTrack = track->Pt();
1169 nCrossedRowsTPC = esdTrack.GetTPCCrossedRows();
1170 nClustersTPC = esdTrack.GetTPCNcls();
1171 if(esdTrack.GetTPCNclsF()>0) {
1172 ratioCRowsFClu = nCrossedRowsTPC / esdTrack.GetTPCNclsF();
1174 if(isPrimary) isSig = 1.;
1175 else if(isFeeddown) isSig = 2.;
1179 if(passTopolAndPIDCuts){
1196 if(passTopolAndPIDCuts){
1200 if(d->GetCharge()>0){
1204 else if(d->GetCharge()<0){
1216 fPtKHist[index]->Fill(d->PtProng(1));
1220 fDLxy[index]->Fill(ndlenxy);
1221 fCosxy[index]->Fill(cospxy);
1222 fCorreld0Kd0pi[0]->Fill(d->Getd0Prong(0)*d->Getd0Prong(1),d->Getd0Prong(2)*d->Getd0Prong(1));
1232 if(isFeeddown) tmp[0]+=5000.;
1237 tmp[5]=d->GetCharge();
1242 tmp[9]=d->PtProng(0);
1243 tmp[10]=d->PtProng(1);
1244 tmp[11]=d->PtProng(2);
1245 tmp[12]=d->PProng(0);
1246 tmp[13]=d->PProng(1);
1247 tmp[14]=d->PProng(2);
1256 tmp[23]=d->Getd0Prong(0);
1257 tmp[24]=d->Getd0Prong(1);
1258 tmp[25]=d->Getd0Prong(2);
1271 if(isFeeddown) tmp[0]+=5000.;
1277 if(isPrimary&&labDp>=0)flagOrigin=1;
1278 if(isFeeddown&&labDp>=0)flagOrigin=2;
1279 if(!(labDp>=0))flagOrigin=3;
1293 else if(isFeeddown){
1300 else if(isFeeddown){
1309 if(passTopolAndPIDCuts){
1316 fDLxy[index]->Fill(ndlenxy);
1317 fCosxy[index]->Fill(cospxy);
1318 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];
1322 fPtKHist[index]->Fill(d->PtProng(1),fact);
1325 fDCAHist[index]->Fill(maxdca,fact);
1326 fCorreld0Kd0pi[1]->Fill(d->Getd0Prong(0)*d->Getd0Prong(1),d->Getd0Prong(2)*d->Getd0Prong(1));
1344 if(
fDoLS && arrayLikeSign)
LSAnalysis(array3Prong,arrayLikeSign,aod,vtx1,nOS);
1374 hisname.Form(
"hLSPt%d",i);
1378 hisname.Form(
"hCosPAllPt%dLS",i);
1381 hisname.Form(
"hDLenAllPt%dLS",i);
1384 hisname.Form(
"hSumd02AllPt%dLS",i);
1387 hisname.Form(
"hSigVertAllPt%dLS",i);
1390 hisname.Form(
"hPtMaxAllPt%dLS",i);
1393 hisname.Form(
"hDCAAllPt%dLS",i);
1394 fDCAHistLS[index]=
new TH1F(hisname.Data(),hisname.Data(),
nbins,0.,0.1);
1400 hisname.Form(
"hLSPt%dnw",i);
1404 hisname.Form(
"hCosPSigPt%dLS",i);
1407 hisname.Form(
"hDLenSigPt%dLS",i);
1410 hisname.Form(
"hSumd02SigPt%dLS",i);
1413 hisname.Form(
"hSigVertSigPt%dLS",i);
1416 hisname.Form(
"hPtMaxSigPt%dLS",i);
1419 hisname.Form(
"hDCASigPt%dLS",i);
1420 fDCAHistLS[index]=
new TH1F(hisname.Data(),hisname.Data(),
nbins,0.,0.1);
1426 hisname.Form(
"hLSPt%dLCntrip",i);
1430 hisname.Form(
"hCosPBkgPt%dLS",i);
1433 hisname.Form(
"hDLenBkgPt%dLS",i);
1436 hisname.Form(
"hSumd02BkgPt%dLS",i);
1439 hisname.Form(
"hSigVertBkgPt%dLS",i);
1442 hisname.Form(
"hPtMaxBkgPt%dLS",i);
1445 hisname.Form(
"hDCABkgPt%dLS",i);
1446 fDCAHistLS[index]=
new TH1F(hisname.Data(),hisname.Data(),
nbins,0.,0.1);
1450 hisname.Form(
"hLSPt%dLCntripsinglecut",i);
1455 hisname.Form(
"hLSPt%dspc",i);
1493 "Mass vs. pt vs.imppar - All",
1496 "Mass vs. pt vs.imppar - promptD",
1499 "Mass vs. pt vs.imppar - DfromB",
1502 "Mass vs. pt vs.true imppar -DfromB",
1505 "Mass vs. pt vs.imppar - backgr.",
1508 for(
Int_t i=0; i<5; i++){
1528 Int_t nnormdlbins=30;
1540 Int_t nptmindaubins;
1638 nmultbins = maxmult-minmult;
1642 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}"};
1644 Int_t nbins[
kVarForSparse]={nmassbins,
nptbins,nd0bins,nselbins,nptmindaubins,nsigvertbins,ncospbins,ncospxybins,ndeclbins,ndeclxybins,nnormdlbins,nd0d0expbins,nmultbins};
1645 Double_t xmin[
kVarForSparse]={
fLowmasslimit,
ptmin,
d0min,minsel,minptmindau,minsigvert,mincosp,mincospxy,mindecl,mindeclxy,minnormdl,mind0d0,minmult};
1646 Double_t xmax[
kVarForSparse]={
fUpmasslimit,
ptmax,
d0max,maxsel,maxptmindau,maxsigvert,maxcosp,maxcospxy,maxdecl,maxdeclxy,maxnormdl,maxd0d0,maxmult};
1649 Int_t nbinsFD[
kVarForSparseFD]={nmassbins,
nptbins,nd0bins,nselbins,nptmindaubins,nsigvertbins,ncospbins,ncospxybins,ndeclbins,ndeclbins,nnormdlbins,nd0d0expbins,nmultbins,84};
1650 Double_t xminFD[
kVarForSparseFD]={
fLowmasslimit,
ptmin,
d0min,minsel,minptmindau,minsigvert,mincosp,mincospxy,mindecl,mindeclxy,minnormdl,mind0d0,minmult,-2};
1651 Double_t xmaxFD[
kVarForSparseFD]={
fUpmasslimit,
ptmax,
d0max,maxsel,maxptmindau,maxsigvert,maxcosp,maxcospxy,maxdecl,maxdeclxy,maxnormdl,maxd0d0,maxmult,40};
1655 "Mass vs. pt vs. cut vars - All",
1658 "Mass vs. pt vs. cut vars - promptD",
1661 "Mass vs. pt vs. cut vars - DfromB",
1664 for(
Int_t i=0; i<3; i++){
1684 fHistTrackVar->GetAxis(1)->SetTitle(
"k#pi#pi inv. mass (GeV/c^{2})");
1688 fHistTrackVar->GetAxis(5)->SetTitle(
"TPC clust./cross.rows");
1699 const Int_t nVarPrompt = 3;
1700 const Int_t nVarFD = 4;
1707 nmultbins=multmax-multmin;
1714 Int_t nbinsPrompt[nVarPrompt]={200,100,nmultbins};
1715 Int_t nbinsFD[nVarFD]={200,100,nmultbins,200};
1717 Double_t xminPrompt[nVarPrompt] = {0.,-1.,multmin};
1718 Double_t xmaxPrompt[nVarPrompt] = {40.,1.,multmax};
1720 Double_t xminFD[nVarFD] = {0.,-1.,multmin,0.};
1721 Double_t xmaxFD[nVarFD] = {40.,1.,multmax,40.};
1724 fMCAccPrompt =
new THnSparseF(
"hMCAccPrompt",
"kStepMCAcceptance pt vs. y vs. Ntracklets - promptD",nVarPrompt,nbinsPrompt,xminPrompt,xmaxPrompt);
1730 fMCAccBFeed =
new THnSparseF(
"hMCAccBFeed",
"kStepMCAcceptance pt vs. y vs. Ntracklets vs. ptB - DfromB",nVarFD,nbinsFD,xminFD,xmaxFD);
1731 fMCAccBFeed->GetAxis(0)->SetTitle(
"p_{T} (GeV/c)");
1734 fMCAccBFeed->GetAxis(3)->SetTitle(
"p_{T}^{B} (GeV/c)");
1744 const Int_t nProng = 3;
1746 Double_t zMCVertex = mcHeader->GetVtxZ();
1748 for(
Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++){
1749 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(iPart));
1750 if (TMath::Abs(mcPart->GetPdgCode()) == 411){
1755 Bool_t isGoodDecay=kFALSE;
1756 Int_t labDau[4]={-1,-1,-1,-1};
1758 Bool_t isFidAcc = kFALSE;
1761 if(deca > 0) isGoodDecay=kTRUE;
1768 isInAcc=
CheckAcc(arrayMC,nProng,labDau);
1774 Double_t arrayMCprompt[3] = {mcPart->Pt(),mcPart->Y(),(
Double_t)tracklets};
1781 Double_t arrayMCFD[4] = {mcPart->Pt(),mcPart->Y(),(
Double_t)tracklets,ptB};
1796 if(fDebug > 1) printf(
"AnalysisTaskSEDplus: Terminate() \n");
1800 printf(
"ERROR: fOutput not available\n");
1806 printf(
"Number of analyzed events = %d\n",(
Int_t)
fHistNEvents->GetBinContent(10));
1808 printf(
"ERROR: fHistNEvents not available\n");
1819 mcHeader->GetVertex(vtxTrue);
1821 partDp->XvYvZv(origD);
1823 Double_t pXdauTrue[3],pYdauTrue[3],pZdauTrue[3];
1824 for(
Int_t iDau=0; iDau<3; iDau++){
1830 Int_t nDau=partDp->GetNDaughters();
1831 Int_t labelFirstDau = partDp->GetDaughter(0);
1833 for(
Int_t iDau=0; iDau<3; iDau++){
1834 Int_t ind = labelFirstDau+iDau;
1835 AliAODMCParticle*
part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
1837 AliError(
"Daughter particle not found in MC array");
1840 pXdauTrue[iDau]=part->Px();
1841 pYdauTrue[iDau]=part->Py();
1842 pZdauTrue[iDau]=part->Pz();
1846 for(
Int_t iDau=0; iDau<2; iDau++){
1847 Int_t ind = labelFirstDau+iDau;
1848 AliAODMCParticle*
part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
1850 AliError(
"Daughter particle not found in MC array");
1853 Int_t pdgCode=TMath::Abs(part->GetPdgCode());
1854 if(pdgCode==211 || pdgCode==321){
1855 pXdauTrue[theDau]=part->Px();
1856 pYdauTrue[theDau]=part->Py();
1857 pZdauTrue[theDau]=part->Pz();
1860 Int_t nDauRes=part->GetNDaughters();
1862 Int_t labelFirstDauRes = part->GetDaughter(0);
1863 for(
Int_t iDauRes=0; iDauRes<2; iDauRes++){
1864 Int_t indDR = labelFirstDauRes+iDauRes;
1865 AliAODMCParticle* partDR =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indDR));
1867 AliError(
"Daughter particle not found in MC array");
1871 Int_t pdgCodeDR=TMath::Abs(partDR->GetPdgCode());
1872 if(pdgCodeDR==211 || pdgCodeDR==321){
1873 pXdauTrue[theDau]=partDR->Px();
1874 pYdauTrue[theDau]=partDR->Py();
1875 pZdauTrue[theDau]=partDR->Pz();
1883 AliError(
"Wrong number of decay prongs");
1889 AliAODRecoDecayHF aodDplusMC(vtxTrue,origD,3,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
1897 for(
Int_t iprong=0;iprong<3;iprong++){
1899 AliAODTrack *trad = (AliAODTrack*)d->GetDaughter(iprong);
1900 Int_t labd= trad->GetLabel();
1902 AliAODMCParticle *dau = (AliAODMCParticle*)arrayMC->At(labd);
1904 Int_t labm = dau->GetMother();
1906 AliAODMCParticle *mot = (AliAODMCParticle*)arrayMC->At(labm);
1908 if(TMath::Abs(mot->GetPdgCode())==310 || TMath::Abs(mot->GetPdgCode())==130 || TMath::Abs(mot->GetPdgCode())==321){
1909 if(d->PtProng(iprong)<=1)factor[iprong]=1./.7;
1910 else factor[iprong]=1./.6;
1913 if(TMath::Abs(mot->GetPdgCode())==3122) {
1914 factor[iprong]=1./0.25;
1924 for(
Int_t k=0;k<3;k++)fact=fact*factor[k];
1932 for (
Int_t iProng = 0; iProng<nProng; iProng++){
1933 AliAODMCParticle* mcPartDaughter=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(labDau[iProng]));
1934 if(!mcPartDaughter)
return kFALSE;
1935 Double_t eta = mcPartDaughter->Eta();
1936 Double_t pt = mcPartDaughter->Pt();
1937 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)
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
TString part
use mixed event to constrain combinatorial background
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)
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)