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"
85 fUseStrangeness(kFALSE),
90 fDoTrackVarHist(kFALSE),
92 fUseQuarkTagInKine(kTRUE),
102 for(
Int_t i=0;i<3;i++){
137 for(
Int_t i=0;i<kMaxPtBins+1;i++){
155 fPtVsMassGoodDaus(0),
161 fPhiEtaCandSigReg(0),
168 fLowmasslimit(1.765),
172 fRDCutsAnalysis(dpluscutsana),
174 fFillNtuple(fillNtuple),
177 fUseStrangeness(kFALSE),
182 fDoTrackVarHist(kFALSE),
184 fUseQuarkTagInKine(kTRUE),
186 fLowerImpPar(-1000.),
187 fHigherImpPar(1000.),
197 for(
Int_t i=0;i<3;i++){
232 for(
Int_t i=0;i<kMaxPtBins+1;i++){
239 DefineOutput(1,TList::Class());
242 DefineOutput(2,TList::Class());
244 DefineOutput(3,AliNormalizationCounter::Class());
248 DefineOutput(4,TNtuple::Class());
287 for(
Int_t i=0;i<3;i++){
291 for(
Int_t i=0;i<5;i++){
294 for(
Int_t i=0;i<3;i++){
346 Int_t missingbins=4-nbins%4;
347 nbins=nbins+missingbins;
350 printf(
"AliAnalysisTaskSEDplus::SetBinWidth: W-bin width of %f will produce histograms not rebinnable by 4. New width set to %f\n",w,width);
353 if(fDebug>1) printf(
"AliAnalysisTaskSEDplus::SetBinWidth: width set to %f\n",width);
367 if(fDebug>1)printf(
"started LS\n");
374 Int_t nPosTrks=0,nNegTrks=0;
375 Int_t nOStriplets = arrayOppositeSign->GetEntriesFast();
378 Int_t nLikeSign = arrayLikeSign->GetEntriesFast();
382 for(
Int_t iLikeSign = 0; iLikeSign < nLikeSign; iLikeSign++) {
392 if(iPtBin<0)
continue;
393 Int_t sign= d->GetCharge();
406 histLSPlus->Fill(invMass);
409 histLSMinus->Fill(invMass);
415 Double_t sumD02=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
419 for(
Int_t i=0;i<3;i++){
420 if(d->PtProng(i)>
ptmax)ptmax=d->PtProng(i);
439 if(nDplusLS!=0)wei3 = (
Float_t)nDplusOS/(
Float_t)(nDplusLS+nDminusLS);
440 Float_t weiplus=1.,weiminus=1.;
441 Float_t wei4plus=1.,wei4minus=1.;
443 if(nPosTrks>2)weiplus=3.*(
Float_t)nNegTrks/((
Float_t)nPosTrks-2.);
444 if(nDplusLS>2)wei4plus=3.*(
Float_t)nDminusLS/((
Float_t)nDplusLS-2.);
445 if(nNegTrks>2)weiminus=3.*(
Float_t)nPosTrks/((
Float_t)nNegTrks-2.);
446 if(nDminusLS>2)wei4minus=3.*(
Float_t)nDplusLS/((
Float_t)nDminusLS-2.);
457 delete histLSPlus;histLSPlus=0;
458 delete histLSMinus;histLSMinus=0;
460 if(fDebug>1) printf(
"LS analysis terminated\n");
468 if(fDebug > 1) printf(
"AnalysisTaskSEDplus::Init() \n");
474 analysis->SetName(
"AnalysisCuts");
487 if(fDebug > 1) printf(
"AnalysisTaskSEDplus::UserCreateOutputObjects() \n");
492 fOutput->SetName(
"OutputHistos");
494 fHistNEvents =
new TH1F(
"fHistNEvents",
"number of events ",10,-0.5,9.5);
495 fHistNEvents->GetXaxis()->SetBinLabel(1,
"nEvents read");
496 fHistNEvents->GetXaxis()->SetBinLabel(2,
"Rejected due to mismatch in trees");
497 fHistNEvents->GetXaxis()->SetBinLabel(3,
"nEvents with good AOD");
498 fHistNEvents->GetXaxis()->SetBinLabel(4,
"Rejected due to trigger");
499 fHistNEvents->GetXaxis()->SetBinLabel(5,
"Rejected due to vertex reco");
500 fHistNEvents->GetXaxis()->SetBinLabel(6,
"Rejected due to pileup");
501 fHistNEvents->GetXaxis()->SetBinLabel(7,
"Rejected due to centrality");
502 fHistNEvents->GetXaxis()->SetBinLabel(8,
"Rejected due to vtxz");
503 fHistNEvents->GetXaxis()->SetBinLabel(9,
"Rejected due to Physics Sel");
504 fHistNEvents->GetXaxis()->SetBinLabel(10,
"nEvents accepted");
509 fHistNCandidates =
new TH1F(
"hNCandidates",
"number of candidates",6,-0.5,5.5);
514 fHistNCandidates->GetXaxis()->SetBinLabel(5,
"D+ after Topological+SingleTrack cuts");
515 fHistNCandidates->GetXaxis()->SetBinLabel(6,
"D+ after Topological+SingleTrack+PID cuts");
525 fHistCentrality[1]=
new TH2F(
"hCentrMult(selectedCent)",
"centrality(selectedCent)",100,0.5,30000.5,40,0.,100.);
526 fHistCentrality[2]=
new TH2F(
"hCentrMult(OutofCent)",
"centrality(OutofCent)",100,0.5,30000.5,40,0.,100.);
527 for(
Int_t i=0;i<3;i++){
535 hisname.Form(
"hMassNoPidPt%d",i);
538 hisname.Form(
"hCosPAllPt%d",i);
539 fCosPHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
541 hisname.Form(
"hDLenAllPt%d",i);
542 fDLenHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
544 hisname.Form(
"hSumd02AllPt%d",i);
545 fSumd02Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
547 hisname.Form(
"hSigVertAllPt%d",i);
548 fSigVertHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
550 hisname.Form(
"hPtMaxAllPt%d",i);
551 fPtMaxHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
553 hisname.Form(
"hPtKPt%d",i);
554 fPtKHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
556 hisname.Form(
"hPtpi1Pt%d",i);
557 fPtpi1Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
559 hisname.Form(
"hPtpi2Pt%d",i);
560 fPtpi2Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
562 hisname.Form(
"hDCAAllPt%d",i);
563 fDCAHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
566 hisname.Form(
"hDLxyPt%d",i);
567 fDLxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
568 fDLxy[index]->Sumw2();
569 hisname.Form(
"hCosxyPt%d",i);
570 fCosxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
573 hisname.Form(
"hMassPt%dTC",i);
576 hisname.Form(
"hMassPt%dTCPlus",i);
579 hisname.Form(
"hMassPt%dTCMinus",i);
584 hisname.Form(
"hSigNoPidPt%d",i);
587 hisname.Form(
"hCosPSigPt%d",i);
588 fCosPHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
590 hisname.Form(
"hDLenSigPt%d",i);
591 fDLenHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
593 hisname.Form(
"hSumd02SigPt%d",i);
594 fSumd02Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
596 hisname.Form(
"hSigVertSigPt%d",i);
597 fSigVertHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
599 hisname.Form(
"hPtMaxSigPt%d",i);
600 fPtMaxHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
602 hisname.Form(
"hPtKSigPt%d",i);
603 fPtKHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
605 hisname.Form(
"hPtpi1SigPt%d",i);
606 fPtpi1Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
608 hisname.Form(
"hPtpi2SigPt%d",i);
609 fPtpi2Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
612 hisname.Form(
"hDCASigPt%d",i);
613 fDCAHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
616 hisname.Form(
"hDLxySigPt%d",i);
617 fDLxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
618 fDLxy[index]->Sumw2();
619 hisname.Form(
"hCosxySigPt%d",i);
620 fCosxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
622 hisname.Form(
"hSigPt%dTC",i);
625 hisname.Form(
"hSigPt%dTCPlus",i);
628 hisname.Form(
"hSigPt%dTCMinus",i);
634 hisname.Form(
"hBkgNoPidPt%d",i);
637 hisname.Form(
"hCosPBkgPt%d",i);
638 fCosPHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,1.);
640 hisname.Form(
"hDLenBkgPt%d",i);
641 fDLenHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.5);
643 hisname.Form(
"hSumd02BkgPt%d",i);
644 fSumd02Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,1.);
646 hisname.Form(
"hSigVertBkgPt%d",i);
647 fSigVertHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
649 hisname.Form(
"hPtMaxBkgPt%d",i);
650 fPtMaxHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.5,5.);
652 hisname.Form(
"hPtKBkgPt%d",i);
653 fPtKHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
655 hisname.Form(
"hPtpi1BkgPt%d",i);
656 fPtpi1Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
658 hisname.Form(
"hPtpi2BkgPt%d",i);
659 fPtpi2Hist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,5.);
661 hisname.Form(
"hDCABkgPt%d",i);
662 fDCAHist[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,0.1);
665 hisname.Form(
"hDLxyBkgPt%d",i);
666 fDLxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,0.,10.);
667 fDLxy[index]->Sumw2();
668 hisname.Form(
"hCosxyBkgPt%d",i);
669 fCosxy[index]=
new TH1F(hisname.Data(),hisname.Data(),100,-1,1.);
673 hisname.Form(
"hBkgPt%dTC",i);
676 hisname.Form(
"hBkgPt%dTCPlus",i);
679 hisname.Form(
"hBkgPt%dTCMinus",i);
710 for(
Int_t i=0; i<3; i++){
721 fYVsPtNoPid=
new TH3F(
"hYVsPtNoPid",
"YvsPt (no PID)",40,0.,20.,80,-2.,2.,nbins,
fLowmasslimit,
fUpmasslimit);
722 fYVsPt=
new TH3F(
"hYVsPt",
"YvsPt",40,0.,20.,80,-2.,2.,nbins,
fLowmasslimit,
fUpmasslimit);
723 fYVsPtSigNoPid=
new TH2F(
"hYVsPtSigNoPid",
"YvsPt (MC, only sig., no PID)",40,0.,20.,80,-2.,2.);
724 fYVsPtSig=
new TH2F(
"hYVsPtSig",
"YvsPt (MC, only Sig)",40,0.,20.,80,-2.,2.);
725 fPhiEtaCand=
new TH2F(
"hPhiEtaCand",
"phi vs. eta candidates",20,-1.,1.,50,0.,2*TMath::Pi());
726 fPhiEtaCandSigReg=
new TH2F(
"hPhiEtaCandSigReg",
"phi vs. eta candidates",20,-1.,1.,50,0.,2*TMath::Pi());
731 fSPDMult =
new TH1F(
"hSPDMult",
"Tracklets multiplicity; Tracklets ; Entries",200,0.,maxmult);
745 fDaughterClass->GetXaxis()->SetBinLabel(1,
"AliAODTrack - good ID");
746 fDaughterClass->GetXaxis()->SetBinLabel(2,
"AliAODTrack - charge0");
748 fDaughterClass->GetXaxis()->SetBinLabel(4,
"AliAODTrack - neg ID");
749 fDaughterClass->GetXaxis()->SetBinLabel(5,
"AliAODTrack - different ID");
750 fDaughterClass->GetXaxis()->SetBinLabel(6,
"AliAODRecoDecayHF2Prong");
751 fDaughterClass->GetXaxis()->SetBinLabel(7,
"AliAODRecoDecayHF3Prong");
754 fDeltaID =
new TH1F(
"hDeltaID",
" ; GetDaughter->GetID() - GetProngID()",20001,-10000.5,10000.5);
756 fIDDauVsIDTra =
new TH2F(
"hIDDauVsIDTra",
" ; GetProngID() ; GetDaughter->GetID()",1001,-500.5,500.5,1001,-500.5,500.5);
758 fIDDauVsIDTra =
new TH2F(
"hIDDauVsIDTra",
" ; GetProngID() ; GetDaughter->GetID()",1000,-30000,30000,1000,-30000,30000);
765 TString normName=
"NormalizationCounter";
766 AliAnalysisDataContainer *cont = GetOutputSlot(3)->GetContainer();
767 if(cont)normName=(
TString)cont->GetName();
783 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");
791 fNtupleDplus =
new TNtuple(
"fNtupleDplus",
"D +",
"pdg:Pt:InvMass:d0:origin");
812 if (matchingAODdeltaAODlevel<0 || (matchingAODdeltaAODlevel==0 &&
fAODProtection==1)) {
819 TClonesArray *array3Prong = 0;
820 TClonesArray *arrayLikeSign =0;
821 if(!aod && AODEvent() && IsStandardAOD()) {
827 AliAODHandler* aodHandler = (AliAODHandler*)
828 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
829 if(aodHandler->GetExtensions()) {
830 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
832 array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject(
"Charm3Prong");
833 arrayLikeSign=(TClonesArray*)aodFromExt->GetList()->FindObject(
"LikeSign3Prong");
836 array3Prong=(TClonesArray*)aod->GetList()->FindObject(
"Charm3Prong");
837 arrayLikeSign=(TClonesArray*)aod->GetList()->FindObject(
"LikeSign3Prong");
840 if(!aod || !array3Prong) {
841 printf(
"AliAnalysisTaskSEDplus::UserExec: Charm3Prong branch not found!\n");
844 if(!arrayLikeSign &&
fDoLS) {
845 printf(
"AliAnalysisTaskSEDplus::UserExec: LikeSign3Prong branch not found!\n");
851 if(!aod->GetPrimaryVertex()||TMath::Abs(aod->GetMagneticField())<0.001)
return;
858 Int_t runNumber=aod->GetRunNumber();
862 Float_t ntracks=aod->GetNumberOfTracks();
873 TClonesArray *arrayMC=0;
874 AliAODMCHeader *mcHeader=0;
877 arrayMC = (TClonesArray*)aod->GetList()->FindObject(AliAODMCParticle::StdBranchName());
879 printf(
"AliAnalysisTaskSEDplus::UserExec: MC particles branch not found!\n");
884 mcHeader = (AliAODMCHeader*)aod->GetList()->FindObject(AliAODMCHeader::StdBranchName());
886 printf(
"AliAnalysisTaskSEDplus::UserExec: MC header branch not found!\n");
891 if(aod->GetTriggerMask()==0 &&
892 (runNumber>=195344 && runNumber<=195677)){
914 AliAODVertex *vtx1 = (AliAODVertex*)aod->GetPrimaryVertex();
920 Int_t n3Prong = array3Prong->GetEntriesFast();
925 Int_t pdgDgDplustoKpipi[3]={321,211,211};
932 for (
Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
941 Int_t nSelectednopid=0,nSelected=0;
942 for (
Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
956 for(
Int_t jdau=0; jdau<3; jdau++){
959 TString cname=odau->ClassName();
960 if(cname.Contains(
"AliAODTrack")){
961 AliAODTrack* tr=(AliAODTrack*)d->GetDaughter(jdau);
966 Int_t idRecov=tr->GetID();
967 Int_t dId=idRecov-idStored;
981 }
else if(cname.Contains(
"AliAODRecoDecayHF2")){
984 }
else if(cname.Contains(
"AliAODRecoDecayHF3")){
987 }
else if(cname.Contains(
"AliAODRecoCascadeHF")){
1001 Bool_t passSingleTrackCuts=kTRUE;
1006 if(!passSingleTrackCuts)
continue;
1026 AliAODVertex *origownvtx=0x0;
1035 Bool_t isFeeddown=kFALSE;
1040 labDp = d->MatchToMC(411,arrayMC,3,pdgDgDplustoKpipi);
1042 AliAODMCParticle *partDp = (AliAODMCParticle*)arrayMC->At(labDp);
1044 pdgCode=TMath::Abs(partDp->GetPdgCode());
1063 if(passTopolAndPIDCuts) {
1064 fYVsPt->Fill(ptCand,rapid,invMass);
1069 if(passTopolAndPIDCuts)
fYVsPtSig->Fill(ptCand,rapid, invMass);
1076 Double_t dlen=0,cosp=0,dlenxy=0,cospxy=0, ndlenxy=0, dd0max=0;
1080 sumD02=d->Getd0Prong(0)*d->Getd0Prong(0)+d->Getd0Prong(1)*d->Getd0Prong(1)+d->Getd0Prong(2)*d->Getd0Prong(2);
1082 for(
Int_t idau=0;idau<3;idau++)
if(d->GetDCA(idau)>maxdca) maxdca=d->GetDCA(idau);
1088 for(
Int_t i=0; i<3; i++) {
1090 if(d->PtProng(i)<minPtDau) minPtDau=d->PtProng(i);
1093 Double_t normdd0= diffIP/errdiffIP;
1094 if(i==0) dd0max=normdd0;
1095 else if(TMath::Abs(normdd0)>TMath::Abs(dd0max)) dd0max=normdd0;
1101 if(passTopolAndPIDCuts) resSel=2;
1102 if(
fSystem==1) dd0max = TMath::Abs(dd0max);
1105 Double_t arrayForSparse[
kVarForSparse]={invMass,ptCand,TMath::Abs(impparXY),resSel,minPtDau,sigvert,cosp,cospxy,dlen,dlenxy,ndlenxy,dd0max};
1107 Double_t arrayForSparseFD[
kVarForSparseFD]={invMass,ptCand,TMath::Abs(impparXY),resSel,minPtDau,sigvert,cosp,cospxy,dlen,dlenxy,ndlenxy,dd0max,ptB};
1118 for(
int i = 0; i < 3; i++) {
1119 Double_t ptTrack = 0, nCrossedRowsTPC = 0, nClustersTPC = 0, ratioCRowsFClu = 0, isSig = 0;
1120 track = (AliAODTrack*)d->GetDaughter(i);
1121 AliESDtrack esdTrack(track);
1122 esdTrack.SetTPCClusterMap(track->GetTPCClusterMap());
1123 esdTrack.SetTPCSharedMap(track->GetTPCSharedMap());
1124 esdTrack.SetTPCPointsF(track->GetTPCNclsF());
1125 ptTrack = track->Pt();
1126 nCrossedRowsTPC = esdTrack.GetTPCCrossedRows();
1127 nClustersTPC = esdTrack.GetTPCNcls();
1128 if(esdTrack.GetTPCNclsF()>0) {
1129 ratioCRowsFClu = nCrossedRowsTPC / esdTrack.GetTPCNclsF();
1131 if(isPrimary) isSig = 1.;
1132 else if(isFeeddown) isSig = 2.;
1136 if(passTopolAndPIDCuts){
1153 if(passTopolAndPIDCuts){
1167 fPtKHist[index]->Fill(d->PtProng(1));
1171 fDLxy[index]->Fill(ndlenxy);
1172 fCosxy[index]->Fill(cospxy);
1173 fCorreld0Kd0pi[0]->Fill(d->Getd0Prong(0)*d->Getd0Prong(1),d->Getd0Prong(2)*d->Getd0Prong(1));
1183 if(isFeeddown) tmp[0]+=5000.;
1188 tmp[5]=d->GetCharge();
1193 tmp[9]=d->PtProng(0);
1194 tmp[10]=d->PtProng(1);
1195 tmp[11]=d->PtProng(2);
1196 tmp[12]=d->PProng(0);
1197 tmp[13]=d->PProng(1);
1198 tmp[14]=d->PProng(2);
1207 tmp[23]=d->Getd0Prong(0);
1208 tmp[24]=d->Getd0Prong(1);
1209 tmp[25]=d->Getd0Prong(2);
1222 if(isFeeddown) tmp[0]+=5000.;
1228 if(isPrimary&&labDp>=0)flagOrigin=1;
1229 if(isFeeddown&&labDp>=0)flagOrigin=2;
1230 if(!(labDp>=0))flagOrigin=3;
1244 else if(isFeeddown){
1251 else if(isFeeddown){
1260 if(passTopolAndPIDCuts){
1267 fDLxy[index]->Fill(ndlenxy);
1268 fCosxy[index]->Fill(cospxy);
1269 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];
1273 fPtKHist[index]->Fill(d->PtProng(1),fact);
1276 fDCAHist[index]->Fill(maxdca,fact);
1277 fCorreld0Kd0pi[1]->Fill(d->Getd0Prong(0)*d->Getd0Prong(1),d->Getd0Prong(2)*d->Getd0Prong(1));
1295 if(
fDoLS && arrayLikeSign)
LSAnalysis(array3Prong,arrayLikeSign,aod,vtx1,nOS);
1316 hisname.Form(
"hLSPt%d",i);
1320 hisname.Form(
"hCosPAllPt%dLS",i);
1323 hisname.Form(
"hDLenAllPt%dLS",i);
1326 hisname.Form(
"hSumd02AllPt%dLS",i);
1329 hisname.Form(
"hSigVertAllPt%dLS",i);
1332 hisname.Form(
"hPtMaxAllPt%dLS",i);
1335 hisname.Form(
"hDCAAllPt%dLS",i);
1336 fDCAHistLS[index]=
new TH1F(hisname.Data(),hisname.Data(),
nbins,0.,0.1);
1342 hisname.Form(
"hLSPt%dnw",i);
1346 hisname.Form(
"hCosPSigPt%dLS",i);
1349 hisname.Form(
"hDLenSigPt%dLS",i);
1352 hisname.Form(
"hSumd02SigPt%dLS",i);
1355 hisname.Form(
"hSigVertSigPt%dLS",i);
1358 hisname.Form(
"hPtMaxSigPt%dLS",i);
1361 hisname.Form(
"hDCASigPt%dLS",i);
1362 fDCAHistLS[index]=
new TH1F(hisname.Data(),hisname.Data(),
nbins,0.,0.1);
1368 hisname.Form(
"hLSPt%dLCntrip",i);
1372 hisname.Form(
"hCosPBkgPt%dLS",i);
1375 hisname.Form(
"hDLenBkgPt%dLS",i);
1378 hisname.Form(
"hSumd02BkgPt%dLS",i);
1381 hisname.Form(
"hSigVertBkgPt%dLS",i);
1384 hisname.Form(
"hPtMaxBkgPt%dLS",i);
1387 hisname.Form(
"hDCABkgPt%dLS",i);
1388 fDCAHistLS[index]=
new TH1F(hisname.Data(),hisname.Data(),
nbins,0.,0.1);
1392 hisname.Form(
"hLSPt%dLCntripsinglecut",i);
1397 hisname.Form(
"hLSPt%dspc",i);
1435 "Mass vs. pt vs.imppar - All",
1438 "Mass vs. pt vs.imppar - promptD",
1441 "Mass vs. pt vs.imppar - DfromB",
1444 "Mass vs. pt vs.true imppar -DfromB",
1447 "Mass vs. pt vs.imppar - backgr.",
1450 for(
Int_t i=0; i<5; i++){
1470 Int_t nnormdlbins=30;
1480 Int_t nptmindaubins;
1571 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"};
1573 Int_t nbins[
kVarForSparse]={nmassbins,
nptbins,nd0bins,nselbins,nptmindaubins,nsigvertbins,ncospbins,ncospxybins,ndeclbins,ndeclxybins,nnormdlbins,nd0d0expbins};
1574 Double_t xmin[
kVarForSparse]={
fLowmasslimit,
ptmin,
d0min,minsel,minptmindau,minsigvert,mincosp,mincospxy,mindecl,mindeclxy,minnormdl,mind0d0};
1575 Double_t xmax[
kVarForSparse]={
fUpmasslimit,
ptmax,
d0max,maxsel,maxptmindau,maxsigvert,maxcosp,maxcospxy,maxdecl,maxdeclxy,maxnormdl,maxd0d0};
1578 Int_t nbinsFD[
kVarForSparseFD]={nmassbins,
nptbins,nd0bins,nselbins,nptmindaubins,nsigvertbins,ncospbins,ncospxybins,ndeclbins,ndeclbins,nnormdlbins,nd0d0expbins,84};
1579 Double_t xminFD[
kVarForSparseFD]={
fLowmasslimit,
ptmin,
d0min,minsel,minptmindau,minsigvert,mincosp,mincospxy,mindecl,mindeclxy,minnormdl,mind0d0,-2};
1580 Double_t xmaxFD[
kVarForSparseFD]={
fUpmasslimit,
ptmax,
d0max,maxsel,maxptmindau,maxsigvert,maxcosp,maxcospxy,maxdecl,maxdeclxy,maxnormdl,maxd0d0,40};
1585 "Mass vs. pt vs. cut vars - All",
1588 "Mass vs. pt vs. cut vars - promptD",
1591 "Mass vs. pt vs. cut vars - DfromB",
1594 for(
Int_t i=0; i<3; i++){
1614 fHistTrackVar->GetAxis(1)->SetTitle(
"k#pi#pi inv. mass (GeV/c^{2})");
1618 fHistTrackVar->GetAxis(5)->SetTitle(
"TPC clust./cross.rows");
1629 const Int_t nVarPrompt = 2;
1630 const Int_t nVarFD = 3;
1632 Int_t nbinsPrompt[nVarPrompt]={200,100};
1633 Int_t nbinsFD[nVarFD]={200,100,200};
1635 Double_t xminPrompt[nVarPrompt] = {0.,-1.};
1636 Double_t xmaxPrompt[nVarPrompt] = {40.,1.};
1638 Double_t xminFD[nVarFD] = {0.,-1.,0.};
1639 Double_t xmaxFD[nVarFD] = {40.,1.,40.};
1642 fMCAccPrompt =
new THnSparseF(
"hMCAccPrompt",
"kStepMCAcceptance pt vs. y - promptD",nVarPrompt,nbinsPrompt,xminPrompt,xmaxPrompt);
1647 fMCAccBFeed =
new THnSparseF(
"hMCAccBFeed",
"kStepMCAcceptance pt vs. y vs. ptB - DfromB",nVarFD,nbinsFD,xminFD,xmaxFD);
1648 fMCAccBFeed->GetAxis(0)->SetTitle(
"p_{T} (GeV/c)");
1650 fMCAccBFeed->GetAxis(2)->SetTitle(
"p_{T}^{B} (GeV/c)");
1660 const Int_t nProng = 3;
1662 Double_t zMCVertex = mcHeader->GetVtxZ();
1664 for(
Int_t iPart=0; iPart<arrayMC->GetEntriesFast(); iPart++){
1665 AliAODMCParticle* mcPart =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(iPart));
1666 if (TMath::Abs(mcPart->GetPdgCode()) == 411){
1671 Bool_t isGoodDecay=kFALSE;
1672 Int_t labDau[4]={-1,-1,-1,-1};
1674 Bool_t isFidAcc = kFALSE;
1677 if(deca > 0) isGoodDecay=kTRUE;
1684 isInAcc=
CheckAcc(arrayMC,nProng,labDau);
1690 Double_t arrayMCprompt[2] = {mcPart->Pt(),mcPart->Y()};
1697 Double_t arrayMCFD[3] = {mcPart->Pt(),mcPart->Y(),ptB};
1712 if(fDebug > 1) printf(
"AnalysisTaskSEDplus: Terminate() \n");
1716 printf(
"ERROR: fOutput not available\n");
1722 printf(
"Number of analyzed events = %d\n",(
Int_t)
fHistNEvents->GetBinContent(10));
1724 printf(
"ERROR: fHistNEvents not available\n");
1735 mcHeader->GetVertex(vtxTrue);
1737 partDp->XvYvZv(origD);
1739 Double_t pXdauTrue[3],pYdauTrue[3],pZdauTrue[3];
1740 for(
Int_t iDau=0; iDau<3; iDau++){
1746 Int_t nDau=partDp->GetNDaughters();
1747 Int_t labelFirstDau = partDp->GetDaughter(0);
1749 for(
Int_t iDau=0; iDau<3; iDau++){
1750 Int_t ind = labelFirstDau+iDau;
1751 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
1753 AliError(
"Daughter particle not found in MC array");
1756 pXdauTrue[iDau]=part->Px();
1757 pYdauTrue[iDau]=part->Py();
1758 pZdauTrue[iDau]=part->Pz();
1762 for(
Int_t iDau=0; iDau<2; iDau++){
1763 Int_t ind = labelFirstDau+iDau;
1764 AliAODMCParticle* part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
1766 AliError(
"Daughter particle not found in MC array");
1769 Int_t pdgCode=TMath::Abs(part->GetPdgCode());
1770 if(pdgCode==211 || pdgCode==321){
1771 pXdauTrue[theDau]=part->Px();
1772 pYdauTrue[theDau]=part->Py();
1773 pZdauTrue[theDau]=part->Pz();
1776 Int_t nDauRes=part->GetNDaughters();
1778 Int_t labelFirstDauRes = part->GetDaughter(0);
1779 for(
Int_t iDauRes=0; iDauRes<2; iDauRes++){
1780 Int_t indDR = labelFirstDauRes+iDauRes;
1781 AliAODMCParticle* partDR =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indDR));
1783 AliError(
"Daughter particle not found in MC array");
1787 Int_t pdgCodeDR=TMath::Abs(partDR->GetPdgCode());
1788 if(pdgCodeDR==211 || pdgCodeDR==321){
1789 pXdauTrue[theDau]=partDR->Px();
1790 pYdauTrue[theDau]=partDR->Py();
1791 pZdauTrue[theDau]=partDR->Pz();
1799 AliError(
"Wrong number of decay prongs");
1805 AliAODRecoDecayHF aodDplusMC(vtxTrue,origD,3,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
1813 for(
Int_t iprong=0;iprong<3;iprong++){
1815 AliAODTrack *trad = (AliAODTrack*)d->GetDaughter(iprong);
1816 Int_t labd= trad->GetLabel();
1818 AliAODMCParticle *dau = (AliAODMCParticle*)arrayMC->At(labd);
1820 Int_t labm = dau->GetMother();
1822 AliAODMCParticle *mot = (AliAODMCParticle*)arrayMC->At(labm);
1824 if(TMath::Abs(mot->GetPdgCode())==310 || TMath::Abs(mot->GetPdgCode())==130 || TMath::Abs(mot->GetPdgCode())==321){
1825 if(d->PtProng(iprong)<=1)factor[iprong]=1./.7;
1826 else factor[iprong]=1./.6;
1829 if(TMath::Abs(mot->GetPdgCode())==3122) {
1830 factor[iprong]=1./0.25;
1840 for(
Int_t k=0;k<3;k++)fact=fact*factor[k];
1848 for (
Int_t iProng = 0; iProng<nProng; iProng++){
1849 AliAODMCParticle* mcPartDaughter=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(labDau[iProng]));
1850 if(!mcPartDaughter)
return kFALSE;
1851 Double_t eta = mcPartDaughter->Eta();
1852 Double_t pt = mcPartDaughter->Pt();
1853 if (TMath::Abs(eta) > 0.9 || pt < 0.1)
return kFALSE;
TH1F * fCosxy[3 *kMaxPtBins]
!hist. for Cosxy (topol+PID)
THnSparseF * fMCAccPrompt
!histo for StepMCAcc for Dplus prompt (pt,y,ptB)
TH2F * fPhiEtaCand
! hist. with eta/phi distribution of candidates
Double_t NormalizedDecayLengthXY() const
Double_t NormalizedDecayLength() const
Bool_t fUseStrangeness
flag for access to MC
TH1F * fSigVertHist[3 *kMaxPtBins]
!hist. for sigVert (topol+PID)
static Int_t CheckDplusDecay(AliStack *stack, Int_t label, Int_t *arrayDauLab)
AliRDHFCutsDplustoKpipi * fRDCutsAnalysis
list of cuts
virtual void UserCreateOutputObjects()
Implementation of interface methods.
Int_t GetIsSelectedPID() const
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
THnSparseF * fHistMassPtImpPar[5]
! histograms for impact parameter
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 fAODProtection
flag for filling ntuple 0 no NTuple 1 big Ntuple 2 small NTuple
Int_t GetIsSelectedCuts() const
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)
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 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, )
TH1F * fPtMaxHistLS[3 *kMaxPtBins]
!hist. for LS cuts variable 5 (topol+PID)
Double_t ImpParXY() const
TH1F * fSPDMult
! hist. of spd mult
virtual ~AliAnalysisTaskSEDplus()
static Int_t CheckMatchingAODdeltaAODevents()
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)
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
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)
void CreateCutVarsSparses()
TH1F * fMassHistPlus[3 *kMaxPtBins]
!hist. for D+ inv mass (topol+PID cuts)
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)
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)
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
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
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)
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
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
TH1F * fDCAHistLS[3 *kMaxPtBins]
!hist. for LS cuts variable 6 (topol+PID)
void CreateMCAcceptanceHistos()
TList * OpenFile(const char *fname)
TH1F * fPtMaxHist[3 *kMaxPtBins]
!hist. for Pt Max (topol+PID)