25 #include <TParticle.h>
27 #include <TObjArray.h>
29 #include <TDatabasePDG.h>
30 #include <AliAnalysisDataSlot.h>
31 #include <AliAnalysisDataContainer.h>
35 #include "AliVertex.h"
36 #include "AliVVertex.h"
37 #include "AliESDVertex.h"
38 #include "AliVertexerTracks.h"
39 #include "AliMCEvent.h"
40 #include "AliAnalysisManager.h"
41 #include "AliAODMCHeader.h"
42 #include "AliAODHandler.h"
44 #include "AliExternalTrackParam.h"
45 #include "AliNeutralTrackParam.h"
46 #include "AliAODVertex.h"
47 #include "AliAODRecoDecay.h"
53 #include "AliESDtrack.h"
54 #include "AliAODMCParticle.h"
56 #include "AliAODEvent.h"
74 fB0InvMass_PassCut1(0),
75 fB0InvMassMinusD_PassCut1(0),
76 fDplusInvMass_PassCut1(0),
77 fDplusInvMass_DplusMCmatch(0),
78 fDplusInvMass_MCmatch(0),
80 fBInvMass_MCmatch_PassCut1(0),
81 fB0InvMassMinusD_MCmatch_PassCut1(0),
91 fDplusNormalizedDecayLength(0),
97 fBNormalizedDecayLength(0),
105 fDplusEta_MCmatch(0),
106 fDplusPhi_MCmatch(0),
107 fDplusPointing_MCmatch(0),
108 fDplusDecayLength_MCmatch(0),
109 fDplusNormalizedDecayLength_MCmatch(0),
113 fBPointing_MCmatch(0),
114 fBDecayLength_MCmatch(0),
115 fBNormalizedDecayLength_MCmatch(0),
118 fproductd0_MCmatch(0),
124 fd0MMExppiMCmatch(0),
125 fd0MMExpDDaughters(0),
126 fd0MMExpDDaughters_MCmatch(0),
131 fBDplusPt_MCmatch(0),
142 fUseQuarkTagInKine(kTRUE),
145 fInvertedTopomaticCutOnDDaughters(0),
156 fDplusMassLowLimit(1.845),
157 fDplusMassUpLimit(1.895),
171 for(
Int_t i=0; i<kMaxPtBins; i++){
173 fDplusInvMassBin[i]=0;
174 fB0InvMassBin_MCmatch[i]=0;
175 fB0InvMassBin_MCmatch_PassCut1[i]=0;
176 fDplusInvMassBin_PassCut1[i]=0;
177 fB0InvMassBin_MCmatch_PassCut1[i]=0;
178 fDplusInvMassBin_MCmatch[i]=0;
179 fB0InvMassBin_PassCut1[i]=0;
180 fDplusInvMassBin_PassCut1[i]=0;
181 fB0InvMassBinMinusD_PassCut1[i]=0;
182 fB0InvMassBinMinusD_MCmatch_PassCut1[i]=0;
184 fBDecayLengthBin[i]=0;
185 fBNormalizedDecayLengthBin[i]=0;
191 fDplusPointingBin[i]=0;
192 fDplusDecayLengthBin[i]=0;
193 fDplusNormalizedDecayLengthBin[i]=0;
195 fBDecayLengthBin_MCmatch[i]=0;
196 fBNormalizedDecayLengthBin_MCmatch[i]=0;
197 fBPointingBin_MCmatch[i]=0;
198 fDplusd0Bin_MCmatch[i]=0;
199 fBpTBin_MCmatch[i]=0;
200 fDpluspTBin_MCmatch[i]=0;
201 fproductd0Bin_MCmatch[i]=0;
202 fDplusPointingBin_MCmatch[i]=0;
203 fDplusDecayLengthBin_MCmatch[i]=0;
204 fDplusNormalizedDecayLengthBin_MCmatch[i]=0;
207 fd0MMExpDBin_MCmatch[i]=0;
209 fd0MMExppiBin_MCmatch[i]=0;
210 fd0MMExpDDaughtersBin[i]=0;
211 fd0MMExpDDaughtersBin_MCmatch[i]=0;
216 fBDplusPtBin_MCmatch[i]=0;
218 fBpiPtBin_MCmatch[i]=0;
238 fB0InvMass_PassCut1(0),
239 fB0InvMassMinusD_PassCut1(0),
240 fDplusInvMass_PassCut1(0),
241 fDplusInvMass_DplusMCmatch(0),
242 fBInvMass_MCmatch(0),
243 fBInvMass_MCmatch_PassCut1(0),
244 fB0InvMassMinusD_MCmatch_PassCut1(0),
253 fDplusDecayLength(0),
254 fDplusNormalizedDecayLength(0),
260 fBNormalizedDecayLength(0),
268 fDplusEta_MCmatch(0),
269 fDplusPhi_MCmatch(0),
270 fDplusPointing_MCmatch(0),
271 fDplusDecayLength_MCmatch(0),
272 fDplusNormalizedDecayLength_MCmatch(0),
276 fBPointing_MCmatch(0),
277 fBDecayLength_MCmatch(0),
278 fBNormalizedDecayLength_MCmatch(0),
281 fproductd0_MCmatch(0),
282 fDplusInvMass_MCmatch(0),
288 fd0MMExppiMCmatch(0),
289 fd0MMExpDDaughters(0),
290 fd0MMExpDDaughters_MCmatch(0),
295 fBDplusPt_MCmatch(0),
305 fUseQuarkTagInKine(kTRUE),
306 fRDCutsAnalysis(dpluscutsana),
308 fInvertedTopomaticCutOnDDaughters(0),
319 fDplusMassLowLimit(1.845),
320 fDplusMassUpLimit(1.895),
381 Info(
"AliAnalysisTaskSEB0toDminuspi",
"Calling Constructor");
385 DefineOutput(1,TList::Class());
386 DefineOutput(2,TList::Class());
387 DefineOutput(3,AliNormalizationCounter::Class());
388 DefineOutput(4,AliRDHFCutsDplustoKpipi::Class());
405 Int_t missingbins=4-nbins%4;
406 nbins=nbins+missingbins;
409 printf(
"AliAnalysisTaskSEDplus::SetBinWidth: W-bin width of %f will produce histograms not rebinnable by 4. New width set to %f\n",w,width);
412 if(fDebug>1) printf(
"AliAnalysisTaskSEDplus::SetBinWidth: width set to %f\n",width);
425 Info(
"~AliAnalysisTaskSEB0toDminuspi",
"Calling Destructor");
553 if(fDebug > 1) printf(
"AnalysisTaskSEB0toDminuspi::Init() \n");
557 analysis->SetName(
"AnalysisCuts");
572 Error(
"UserExec",
"NO EVENT FOUND!");
578 TClonesArray *array3Prong = 0;
588 if(!aodEvent && AODEvent() && IsStandardAOD()) {
591 aodEvent =
dynamic_cast<AliAODEvent*
> (AODEvent());
594 AliAODHandler* aodHandler = (AliAODHandler*)
595 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
596 if(aodHandler->GetExtensions()) {
597 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
599 array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject(
"Charm3Prong");
602 array3Prong=(TClonesArray*)aodEvent->GetList()->FindObject(
"Charm3Prong");
608 if(!aodEvent->GetPrimaryVertex() || TMath::Abs(aodEvent->GetMagneticField())<0.001)
return;
612 if (array3Prong->GetEntriesFast()==0)
return;
617 TClonesArray *mcArray = 0;
618 AliAODMCHeader *mcHeader=0;
621 mcArray = (TClonesArray*)aodEvent->GetList()->FindObject(AliAODMCParticle::StdBranchName());
623 printf(
"AliAnalysisTaskSEDplus::UserExec: MC particles branch not found!\n");
627 mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
629 printf(
"AliAnalysisTaskSEDplus::UserExec: MC header branch not found!\n");
646 Int_t pdgDgDplustoKpipi[3]={321,211,211};
647 Int_t pdgDgB0toDminuspi[2]={411,211};
650 AliAODVertex *primaryVertex = (AliAODVertex*)aodEvent->GetPrimaryVertex();
651 if(!primaryVertex)
return;
652 if(primaryVertex->GetNContributors()<1)
return;
655 AliInfo(
"Could not find array of Charm3Prong, skipping the event");
658 else AliDebug(2, Form(
"Found %d vertices",array3Prong->GetEntriesFast()));
660 Int_t nSelectedAna =0;
661 Int_t nSelectedProd =0;
668 Double_t xdummy=0.,ydummy=0.,dca,dcaB, e[2];
669 Double_t d0z0B[2],covd0z0B[3],d0B[2],d0errB[2],d0z0[2],covd0z0[3],d0[2],d0err[2];
673 Int_t n3Prong = array3Prong->GetEntriesFast();
681 for (
Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
702 Double_t etaD=theDminusparticle->Eta();
703 Double_t phiD=theDminusparticle->Phi();
717 Double_t ptCand = theDminusparticle->Pt();
720 AliAODVertex *origownvtx=0x0;
735 if(TMath::Abs(theDminusparticle->Charge())!=1){
741 labDp = theDminusparticle->MatchToMC(411,mcArray,3,pdgDgDplustoKpipi);
743 AliAODMCParticle *partDp = (AliAODMCParticle*)mcArray->At(labDp);
746 pdgCode=TMath::Abs(partDp->GetPdgCode());
751 AliAODMCParticle *partMomDp = (AliAODMCParticle*)mcArray->At(partDp->GetMother());
755 AliAODMCParticle *partMomDp = (AliAODMCParticle*)mcArray->At(partDp->GetMother());
756 if(!partMomDp)
continue;
759 if(TMath::Abs(partMomDp->GetPdgCode())==511 && ((partMomDp->GetLastDaughter()-partMomDp->GetFirstDaughter())==1)){
760 AliAODMCParticle* B0Dau2=0;
761 if(labDp== (partMomDp->GetFirstDaughter()-1)) B0Dau2 = (AliAODMCParticle*)mcArray->At(partMomDp->GetLastDaughter()-1);
762 else if(labDp== (partMomDp->GetLastDaughter()-1)) B0Dau2 = (AliAODMCParticle*)mcArray->At(partMomDp->GetFirstDaughter()-1);
763 if (B0Dau2) {
if(TMath::Abs(B0Dau2->GetPdgCode())==211)
fCEvents->Fill(10);}
803 AliExternalTrackParam *trackDminus =
new AliExternalTrackParam();
804 trackDminus->CopyFromVTrack(theDminusparticle);
824 Int_t arrayMCB0label[50];
831 for (
Int_t i=0; i<aodEvent->GetNumberOfTracks(); i++){
834 AliAODTrack* aodTrack = (AliAODTrack*)aodEvent->GetTrack(i);
836 if(aodTrack->GetID() == Id_prong0 ||aodTrack->GetID() == Id_prong1 || aodTrack->GetID() == Id_prong2)
continue;
841 if(!(aodTrack->TestFilterMask(BIT(4)))){
fCEvents->Fill(20);
continue;}
844 if(aodTrack->Pt()<0.5)
continue;
851 if (TMath::Abs(aodTrack->Eta())>0.8)
continue;
856 if(nSigmaTPCpi<-3 || nSigmaTPCpi>3 ){
fCEvents->Fill(12);
858 if(nSigmaTOFpi<-3 || nSigmaTOFpi>3){
862 if(aodTrack->Charge()==theDminusparticle->Charge()){
870 AliExternalTrackParam et4;
871 et4.CopyFromVTrack(static_cast<AliAODTrack*>(aodEvent->GetTrack(i)));
874 trackDminus->PropagateToDCA(primaryVertex,bz,100.,d0z0B,covd0z0B);
876 d0errB[0] = TMath::Sqrt(covd0z0B[0]);
877 et4.PropagateToDCA(primaryVertex,bz,100.,d0z0B,covd0z0B);
879 d0errB[1] = TMath::Sqrt(covd0z0B[0]);
881 dcaB=et4.GetDCA(trackDminus,bz,xdummy,ydummy);
884 b012_B.Add(trackDminus); b012_B.Add(&et4);
894 pxB[0] = trackDminus-> Px();
895 pyB[0] = trackDminus-> Py();
896 pzB[0] = trackDminus-> Pz();
897 pxB[1] = aodTrack-> Px();
898 pyB[1] = aodTrack-> Py();
899 pzB[1] = aodTrack-> Pz();
907 idB[1]= aodTrack->GetID();
911 if(!B0Dminuspi)
continue;
915 B0Dminuspi->GetSecondaryVtx()->AddDaughter(theDminusparticle);
916 B0Dminuspi->GetSecondaryVtx()->AddDaughter(aodTrack);
930 arrayMCB0label[iB0count]=-1;
935 arrayMCB0label[iB0count] = B0Dminuspi->
MatchToMCB3Prong(511,411, pdgDgB0toDminuspi, pdgDgDplustoKpipi, mcArray);
936 if(arrayMCB0label[iB0count]>(-1)){
965 if(iB0count>0)
FillSpectrum(iB0count, arrayMCB0label,bz);
970 B0evtcount+=iB0count;
979 AliDebug(2, Form(
"Found %i Reco particles that are D+!!",nOS));
980 AliDebug(2, Form(
"Found %i Reco particles that are B0!!",B0evtcount));
995 AliAnalysisTaskSE::Terminate();
999 printf(
"ERROR: fOutput not available\n");
1013 Info(
"UserCreateOutputObjects",
"CreateOutputObjects of task %s\n", GetName());
1019 fOutput->SetName(
"PtIntegrated");
1045 fCEvents =
new TH1F(
"fCEvents",
"conter",30,0.5,30.5);
1046 fCEvents->GetXaxis()->SetBinLabel(1,
"n Events");
1047 fCEvents->GetXaxis()->SetBinLabel(2,
"w primary vtx");
1048 fCEvents->GetXaxis()->SetBinLabel(3,
"selected/ w array3prong");
1049 fCEvents->GetXaxis()->SetBinLabel(4,
"D+ candidates");
1050 fCEvents->GetXaxis()->SetBinLabel(5,
"D+ rejected for DplusCuts");
1051 fCEvents->GetXaxis()->SetBinLabel(6,
"D+ rejected for topological + PID selection ");
1052 fCEvents->GetXaxis()->SetBinLabel(7,
"D+ rejected for charge");
1053 fCEvents->GetXaxis()->SetBinLabel(8,
"MC D+ primary orig=4");
1054 fCEvents->GetXaxis()->SetBinLabel(9,
"MC D+ feed-down orig=5");
1055 fCEvents->GetXaxis()->SetBinLabel(10,
"MC B->D pi");
1057 fCEvents->GetXaxis()->SetBinLabel(11,
"D+ candidates to be associated with a pion");
1058 fCEvents->GetXaxis()->SetBinLabel(12,
"pion cadidate rejected for PID");
1059 fCEvents->GetXaxis()->SetBinLabel(13,
"pion candidate rejected because of charge");
1060 fCEvents->GetXaxis()->SetBinLabel(14,
"pion candidate passing selections");
1062 fCEvents->GetXaxis()->SetBinLabel(15,
"B0 candidate");
1063 fCEvents->GetXaxis()->SetBinLabel(16,
"B0 candidate matched MC");
1064 fCEvents->GetXaxis()->SetBinLabel(17,
"B0 passing set cut 1");
1065 fCEvents->GetXaxis()->SetBinLabel(18,
"B0 passing set cut 1 matched MC");
1066 fCEvents->GetXaxis()->SetBinLabel(19,
"D + not in fiducial accaptance");
1067 fCEvents->GetXaxis()->SetBinLabel(20,
"aodtrack rejected for filterbit 4 ");
1068 fCEvents->GetXaxis()->SetBinLabel(21,
"pion tracks before cuts");
1071 fCEvents->GetXaxis()->SetTitle(
"1");
1072 fCEvents->GetYaxis()->SetTitle(
"counts");
1082 fDplusInvMass =
new TH1F(
"fDplusInvMass",
"Dplus invariant mass;GeV", 500, 1.75, 1.95 );
1088 fDplusInvMass_PassCut1 =
new TH1F(
"fDplusInvMass_PassCut1",
"D+ invariant mass with Cut1 implemented;GeV", 500, 1.75, 1.95);
1090 fDplusInvMass_DplusMCmatch =
new TH1F(
"fDplusInvMass_DplusMCmatch",
"Dplus invariant mass (Dplus matched);GeV", 500, 1.75, 1.95);
1095 fpiPt =
new TH1F(
"fpiPt",
"Pt of pion (from B0 selected)", 200, 0, 20);
1096 fpiEta =
new TH1F(
"fpiEta",
"Eta of pion (from B0 selected)", 200, -1, 1);
1097 fpiPhi =
new TH1F(
"fpiPhi",
"Phi of pion (from B0 selected)", 200, 0, 7);
1098 fDplusPt =
new TH1F(
"fDplusPt",
"Pt of Dplus (from B0 selected)",100, 0, 50);
1099 fDplusEta =
new TH1F(
"fDplusEta",
"Eta of Dplus (from B0 selected)", 200, -1, 1);
1100 fDplusPhi =
new TH1F(
"fDplusPhi",
"Phi of Dplus (from B0 selected)", 200, 0, 7);
1101 fDplusPointing =
new TH1F(
"fDplusPointing",
"CosPointingAngle of Dplus (from B0 selected)", 200, 0., 1.);
1102 fDplusDecayLength =
new TH1F(
"fDplusDecayLength",
"Decay Length of D+ (B0 selected)", 200, 0, 0.5);
1104 fBPt =
new TH1F(
"fBPt",
"Pt of B0 (B0 selected)", 100, 0, 50);
1105 fBEta =
new TH1F(
"fBEta",
"Eta of B0 (B0 selected)", 200, -1, 1);
1106 fBPhi =
new TH1F(
"fBPhi",
"Phi of B0 (B0 selected)", 200, 0, 7);
1107 fBPointing =
new TH1F(
"fBPointing",
"CosPointingAngle of B0 (B0 selected)", 200, 0., 1.);
1108 fBDecayLength =
new TH1F(
"fBDecayLength",
"Decay Length of B0 (B0 selected)", 200, 0, 0.5);
1109 fBNormalizedDecayLength =
new TH1F(
"fBNormalizedDecayLength",
"Normalized Decay Length of B0 (B0 selected)", 200, 0, 20);
1110 fDplusd0 =
new TH1F(
"fDplusd0",
"|d0| Dplus to prim vtx(B0 selected)", 200, 0, 0.25);
1111 fpid0 =
new TH1F(
"fpid0",
"|d0| pion to prim vtx(B0 selected)", 200, 0, 0.25);
1112 fproductd0 =
new TH1F(
"fproductd0",
"d0 pion x d0 Dplus (B0 selected)", 200, -0.001, 0.001);
1113 fpiPt_MCmatch =
new TH1F(
"fpiPt_MCmatch",
"Pt of pion (MCmatched B0)", 200, 0, 20);
1114 fpiEta_MCmatch =
new TH1F(
"fpiEta_MCmatch",
"Eta of pion (MCmatched B0)", 200, -1, 1);
1115 fpiPhi_MCmatch =
new TH1F(
"fpiPhi_MCmatch",
"Phi of pion (MCmatched B0)", 200, 0, 7);
1116 fDplusPt_MCmatch =
new TH1F(
"fDplusPt_MCmatch",
"Pt of Dplus (MCmatched B0)", 100, 0, 50);
1117 fDplusEta_MCmatch =
new TH1F(
"fDplusEta_MCmatch",
"Eta of Dplus (MCmatched B0)", 200, -1, 1);
1118 fDplusPhi_MCmatch =
new TH1F(
"fDplusPhi_MCmatch",
"Phi of Dplus (MCmatched B0)", 200, 0, 7);
1119 fDplusPointing_MCmatch =
new TH1F(
"fDplusPointing_MCmatch",
"CosPointingAngle of Dplus (MCmatched B0)", 200, 0., 1.);
1122 fBPt_MCmatch =
new TH1F(
"fBPt_MCmatch",
"Pt of B0 (MCmatched B0)", 100, 0, 50);
1123 fBEta_MCmatch =
new TH1F(
"fBEta_MCmatch",
"Eta of B0 (MCmatched B0)", 200, -1, 1);
1124 fBPhi_MCmatch =
new TH1F(
"fBPhi_MCmatch",
"Phi of B0 (MCmatched B0)", 200, 0, 7);
1125 fBPointing_MCmatch =
new TH1F(
"fBPointing_MCmatch",
"CosPointingAngle of B0 (MCmatched B0)", 200, 0., 1.);
1126 fBDecayLength_MCmatch =
new TH1F(
"fBDecayLength_MCmatch",
"Decay Length of B0 (MCmatched B0)", 200, 0, 0.5);
1128 fDplusd0_MCmatch =
new TH1F(
"fDplusd0_MCmatch",
"|d0| Dplus to prim vtx(MCmatched B0)", 200, 0, 0.25);
1129 fpid0_MCmatch =
new TH1F(
"fpid0_MCmatch",
"|d0| pi to prim vtx(MCmatched B0)", 200, 0, 0.25);
1130 fproductd0_MCmatch =
new TH1F(
"fproductd0_MCmatch",
"d0 pion x d0 Dplus (MCmatched B0)", 200, -0.001, 0.001);
1131 fDplusInvMass_MCmatch =
new TH1F(
"fDplusInvMass_MCmatch",
"D+ invariant mass (MCmatched B0);GeV", 500, 1.75, 1.95);
1135 fd0MMExpD =
new TH1F(
"fd0MMExpD",
"Topomatic variable for D", 200, -10.0,10.);
1136 fd0MMExpDMCmatch =
new TH1F(
"fd0MMExpDMCmatch",
"Topomatic variable for D from B matched to MC", 200, -10,10.);
1137 fd0MMExppi =
new TH1F(
"fd0MMExppi",
"Topomatic variable for pi ", 200, -10.0,10.);
1138 fd0MMExppiMCmatch =
new TH1F(
"fd0MMExppiMCmatch",
"Topomatic variable for pi from B matched to MC", 200, -10,10.);
1139 fd0MMExpDDaughters =
new TH1F(
"fd0MMExpDDaughters",
"Topomatic variable for D daughters", 200, -10.0,10.);
1140 fd0MMExpDDaughters_MCmatch =
new TH1F(
"fd0MMExpDDaughters_MCmatch",
"Topomatic variable for D daughters with B matched to MC", 200, -10,10.);
1142 fcosoa=
new TH1F(
"fcosoa",
"cos opening angle", 200, -1.10,1.10);
1143 fcosoa_MCmatch=
new TH1F(
"fcosoa_MCmatch",
"cos opening angle MC", 200, -1.10,1.1);
1146 fBDplusPt =
new TH2F(
"fBDplusPt",
";B pT;D pT", 100, 0, 50,100,0,50);
1147 fBpiPt =
new TH2F(
"fBpiPt",
";B pT;pi pT", 100, 0, 50,100,0,50);
1227 for(
Int_t i=0; i<fNPtBins; i++){
1228 HistName.Form(
"fB0InvMass_bin%d",i);
1231 HistName.Form(
"fDplusInvMass_bin%d",i);
1232 fDplusInvMassBin[i]=
new TH1F(HistName.Data(), HistName.Data(), 500, 1.819, 1.919 );
1234 HistName.Form(
"fB0InvMass_bin%d_MCmatch",i);
1237 HistName.Form(
"fB0InvMass_bin%d_MCmatch_PassCut1",i);
1241 HistName.Form(
"fB0InvMassMinusD_bin%d_PassCut1",i);
1244 HistName.Form(
"fDplusInvMass_bin%d_MCmatch",i);
1247 HistName.Form(
"fB0InvMass_bin%d_PassCut1",i);
1250 HistName.Form(
"fB0InvMassMinusD_bin%d_MCmatch_PassCut1",i);
1253 HistName.Form(
"fDplusInvMass_bin%d_PassCut1",i);
1258 HistName.Form(
"fBDecayLengthBin_bin%d",i);
1259 fBDecayLengthBin[i]=
new TH1F(HistName.Data(), HistName.Data(), 200, 0, 0.5);
1260 HistName.Form(
"fBNormalizedDecayLengthBin_bin%d",i);
1262 HistName.Form(
"fBPointingBin_bin%d",i);
1263 fBPointingBin[i]=
new TH1F(HistName.Data(), HistName.Data(), 200, 0, 1.);
1264 HistName.Form(
"fDplusd0Bin_bin%d",i);
1265 fDplusd0Bin[i]=
new TH1F(HistName.Data(), HistName.Data(), 200, 0, 0.25);
1266 HistName.Form(
"fBpTBin_bin%d",i);
1267 fBpTBin[i]=
new TH1F(HistName.Data(), HistName.Data(), 100, 0, 50);
1268 HistName.Form(
"fDpluspTBin_bin%d",i);
1269 fDpluspTBin[i]=
new TH1F(HistName.Data(), HistName.Data(), 100, 0, 50);
1270 HistName.Form(
"fproductd0Bin_bin%d",i);
1271 fproductd0Bin[i]=
new TH1F(HistName.Data(), HistName.Data(), 200, -0.001, 0.001);
1272 HistName.Form(
"fDplusPointingBin_bin%d",i);
1274 HistName.Form(
"fDplusDecayLengthBin_bin%d",i);
1276 HistName.Form(
"fDplusNormalizedDecayLengthBin_bin%d",i);
1279 HistName.Form(
"fBDecayLengthBin_MCmatch_bin%d",i);
1281 HistName.Form(
"fBNormalizedDecayLengthBin_MCmatch_bin%d",i);
1283 HistName.Form(
"fBPointingBin_MCmatch_bin%d",i);
1285 HistName.Form(
"fDplusd0Bin_MCmatch_bin%d",i);
1287 HistName.Form(
"fBpTBin_MCmatch_bin%d",i);
1288 fBpTBin_MCmatch[i]=
new TH1F(HistName.Data(), HistName.Data(), 100, 0, 50);
1289 HistName.Form(
"fDpluspTBin_MCmatch_bin%d",i);
1291 HistName.Form(
"fproductd0Bin_MCmatch_bin%d",i);
1293 HistName.Form(
"fDplusPointingBin_MCmatch_bin%d",i);
1295 HistName.Form(
"fDplusDecayLengthBin_MCmatch_bin%d",i);
1297 HistName.Form(
"fDplusNormalizedDecayLengthBin_MCmatch_bin%d",i);
1300 HistName.Form(
"fd0MMExpD_bin%d",i);
1301 fd0MMExpDBin[i] =
new TH1F(HistName.Data(), HistName.Data(), 200, -10.0,10.);
1302 HistName.Form(
"fd0MMExpD_MCmatch_bin%d",i);
1304 HistName.Form(
"fd0MMExppi_bin%d",i);
1305 fd0MMExppiBin[i] =
new TH1F(HistName.Data(), HistName.Data(), 200, -10.0,10.);
1306 HistName.Form(
"fd0MMExppi_MCmatch_bin%d",i);
1308 HistName.Form(
"fd0MMExpDDaughtersBin%d",i);
1310 HistName.Form(
" fd0MMExpDDaughters_MCmatch_bin%d",i);
1313 HistName.Form(
"fBDplusPtBin_bin%d",i);
1314 fBDplusPtBin[i]=
new TH2F(HistName.Data(), HistName.Data(), 100, 0, 50,100,0,50);
1315 HistName.Form(
"fBpiPtBin_bin%d",i);
1316 fBpiPtBin[i]=
new TH2F(HistName.Data(), HistName.Data(), 100, 0, 50,100,0,50);
1317 HistName.Form(
"fBDplusPtBin_bin%d_MCmatch",i);
1319 HistName.Form(
"fBpiPtBin_bin%d_MCmatch",i);
1387 if (nB0 ==0)
return;
1391 UInt_t prongs[2]={411,211};
1394 for(
Int_t i=0; i<3; i++) {
1397 Double_t normdd0= diffIP/errdiffIP;
1400 if(i==0) dd0min=normdd0;
1401 else if(TMath::Abs(normdd0)<TMath::Abs(dd0min)) dd0min=normdd0;
1412 Double_t B0InvMass, d01, d02, productd0;
1414 for (
int iB0 =0; iB0<nB0; iB0++){
1418 B0InvMass =
fArrayB0[iB0]->InvMass2Prongs(0 , 1 ,prongs[0], prongs[1]);
1419 AliAODTrack* aodTrack = (AliAODTrack*)
fArrayB0[iB0]->GetSecondaryVtx()->GetDaughter(1);
1420 d01 = TMath::Abs(
fArrayB0[iB0]->Getd0Prong(0));
1421 d02 = TMath::Abs(
fArrayB0[iB0]->Getd0Prong(1));
1425 fArrayB0[iB0]->Getd0MeasMinusExpProng(0,Bfield,diffIPMCD,errdiffIPMCD);
1426 Double_t normdd0MCD= diffIPMCD/errdiffIPMCD;
1428 Double_t diffIPMCpi, errdiffIPMCpi;
1429 fArrayB0[iB0]->Getd0MeasMinusExpProng(1,Bfield,diffIPMCpi,errdiffIPMCpi);
1430 Double_t normdd0MCpi= diffIPMCpi/errdiffIPMCpi;
1436 if(arrayMClabel[iB0] > (-1)){
1445 if(arrayMClabel[iB0] > (-1)) {
1480 fpiPt->Fill(aodTrack->Pt());
1481 fpiEta->Fill(aodTrack->Eta());
1482 fpiPhi->Fill(aodTrack->Phi());
1497 if(arrayMClabel[iB0] > (-1)){
1554 if(arrayMClabel[iB0] > (-1)){
1595 AliESDVertex *vertexESD = 0;
1596 AliAODVertex *vertexAOD = 0;
1599 AliVertexerTracks *vertexer =
new AliVertexerTracks(bField);
1600 vertexer->SetVtxStart((AliESDVertex*)primary);
1601 vertexESD = (AliESDVertex*)vertexer->VertexForSelectedESDTracks(tracks);
1602 delete vertexer; vertexer=NULL;
1604 if(!vertexESD)
return vertexAOD;
1607 if(vertexESD->GetNContributors()!=tracks->GetEntriesFast()) {
1609 delete vertexESD; vertexESD=NULL;
1619 for(
Int_t a=0;a<3;a++)pos[a]=0.;
1620 for(
Int_t b=0;b<6;b++)cov[b]=0.;
1623 vertexESD->GetXYZ(pos);
1624 vertexESD->GetCovMatrix(cov);
1627 Double_t vertRadius2=pos[0]*pos[0]+pos[1]*pos[1];
1630 delete vertexESD; vertexESD=NULL;
1634 chi2perNDF = vertexESD->GetChi2toNDF();
1635 dispersion = vertexESD->GetDispersion();
1636 delete vertexESD; vertexESD=NULL;
1637 Int_t nprongs= tracks->GetEntriesFast();
1638 vertexAOD =
new AliAODVertex(pos,cov,chi2perNDF,0x0,-1,AliAODVertex::kUndef,nprongs);
Double_t NormalizedDecayLengthXY() const
TH1F * fBDecayLength_MCmatch
!hist. for B decay length (after cut) matched to B0 in MC
Double_t fTopomaticD
cut to applied on B selection: B norm decay length XY
TH1F * fDplusPhi_MCmatch
!hist. for D phi (after cut) matched to B0 in MC
Int_t fEtaSelection
flag to use bitmask
Double_t fBMassUpLimit
BMassLowLimit for histo.
TH1F * fpid0_MCmatch
!hist. for pion d0 (after cut) matched to B0 in MC
TH1F * fBPhi_MCmatch
!hist. for B phi (after cut) matched to B0 in MC
AliNormalizationCounter * fCounter
TH1F * fDplusDecayLength_MCmatch
!hist. for D decay length (after cut) matched to B0 in MC
TH1F * fBpTBin_MCmatch[kMaxPtBins]
!hist. for B pT (after cut) matched to B0 in MC in pT bins
Int_t GetIsSelectedPID() const
TH1F * fBPt
!hist. for B Pt (after cut)
Double_t fTopomaticpi
cut to applied on B selection: D topomatic
TH1F * fBInvMass_MCmatch
!hist. for B0 mass matched to B0 in MC
void StoreCandidates(AliVEvent *, Int_t nCand=0, Bool_t flagFilter=kTRUE)
void Getd0MeasMinusExpProng(Int_t ip, Double_t magf, Double_t &d0diff, Double_t &errd0diff) const
TH2F * fBDplusPt
!hist of B pT vs D pT
TList * fOutputBins
! User output for different pt bins
TH1F * fDplusInvMass_DplusMCmatch
!hist. for D+ mass matched to B0 in MC
TH1F * fDplusd0
!hist. for D d0 (after cut)
TH1F * fBNormalizedDecayLength
!hist. for B norm decay lengthXY (after cut)
AliAnalysisTaskSEB0toDminuspi()
Int_t GetIsSelectedCuts() const
virtual void UserCreateOutputObjects()
Bool_t HasSelectionBit(Int_t i) const
TH1F * fd0MMExpDMCmatch
!hist. for D topomatic (after cut) matched to B0 in MC
TH1F * fDpluspTBin_MCmatch[kMaxPtBins]
!hist. for D pT (after cut) matched to B0 in MC in pT bins
TH1F * fDplusInvMassBin_PassCut1[kMaxPtBins]
!hist. for D mass after cut matched to B0 in MC in pT bins
TH1F * fBDecayLengthBin[kMaxPtBins]
!hist. for B decay length (after cut) in pT bins
TH1F * fDplusNormalizedDecayLengthBin[kMaxPtBins]
!hist. for D norm decay length XY (after cut) in pT bins
Double_t fpTpi
cut to applied on B selection: pT D
void UnsetOwnPrimaryVtx()
TH1F * fpiPt_MCmatch
!hist. for pi Pt (after cut) matched to B0 in MC
TH1F * fcosoa_MCmatch
!hist. for cos opening angle between D and pion (after cut) matched to B0 in MC
TH1F * fBDecayLengthBin_MCmatch[kMaxPtBins]
!hist. for B decay length (after cut) in pT bins
TH1F * fDplusPt
!hist. for D Pt (after cut)
void FillSpectrum(Int_t nB0, Int_t *arrayMClabel, Double_t Bfield)
TH1F * fd0MMExpDDaughters
!hist. for D daughters topomatic (after cut)
TH1F * fDplusNormalizedDecayLength
!hist. for D norm decay lengthXY (after cut)
TH1F * fpiPhi_MCmatch
!hist. for pi phi (after cut) matched to B0 in MC
TH2F * fBDplusPtBin_MCmatch[kMaxPtBins]
!hist of B pT vs D pT matched to B0 in MC in pT bins
Float_t fBinWidth
BMassUpLimit for histo.
virtual Bool_t IsInFiducialAcceptance(Double_t pt, Double_t y) const
AliAODVertex * RecalculateVertex(const AliVVertex *old, TObjArray *tracks, Double_t bField)
static Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPart, Bool_t searchUpToQuark=kTRUE)
TH1F * fd0MMExpDDaughtersBin[kMaxPtBins]
!hist. for D daughters topomatic (after cut) in pT bins
TH1F * fBpTBin[kMaxPtBins]
!hist. for B pT (after cut) in pT bins
TH1F * fBInvMass_MCmatch_PassCut1
!hist. for B0 mass after cut matched to B0 in MC
TH1F * fDplusDecayLength
!hist. for D decay length (after cut)
TH1F * fd0MMExppi
!hist. for pion topomatic (after cut)
AliAODPidHF * GetPidHF() const
TH1F * fpiPhi
!hist. for pion phi (after cut)
TH1F * fDplusPointingBin[kMaxPtBins]
!hist. for D cos pointing (after cut) in pT bins
Double_t fcosB
cut to applied on B selection: product d0
void SetBMassLimits(Float_t lowlimit, Float_t uplimit)
Double_t fdlB
cut to applied on B selection: B cos pointing
TH1F * fBPointing
!hist. for B cos poining (after cut)
TH1F * fB0InvMass_PassCut1
!hist. for B0 mass after cut
TH1F * fB0InvMassBin_MCmatch_PassCut1[kMaxPtBins]
!hist. for B0 mass after cut matched to B0 in MC in pT bins
TH1F * fBEta_MCmatch
!hist. for B eta (after cut) matched to B0 in MC
TH1F * fd0MMExpDDaughtersBin_MCmatch[kMaxPtBins]
!hist. for D daughters topomatic (after cut) matched to B0 in MC in pT bins
Class for cuts on AOD reconstructed D+->Kpipi.
TH1F * fBNormalizedDecayLengthBin[kMaxPtBins]
!hist. for B norm decay length XY (after cut) in pT bins
void SetBinWidth(Float_t w)
TH1F * fB0InvMassBin_MCmatch[kMaxPtBins]
!hist. for B0 mass matched to B0 in MC in pT bins
TH1F * fBNormalizedDecayLengthBin_MCmatch[kMaxPtBins]
!hist. for B norm decay length XY (after cut) in pT bins
TH1F * fDplusEta_MCmatch
!hist. for D eta (after cut) matched to B0 in MC
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
TH1F * fd0MMExpDDaughters_MCmatch
!hist. for D daughters topomatic (after cut) matched to B0 in MC
TH1F * fDplusInvMass
!hist. for D+ mass
ClassImp(AliAnalysisTaskSEB0toDminuspi) AliAnalysisTaskSEB0toDminuspi
TH1F * fDplusPt_MCmatch
!hist. for D pT (after cut) matched to B0 in MC
TH1F * fd0MMExppiBin_MCmatch[kMaxPtBins]
!hist. for pion topomatic (after cut) matched to B0 in MC in pT bins
TH1F * fB0InvMassBin_PassCut1[kMaxPtBins]
!hist. for B0 mass after cut in pT bins
Int_t fEvents
Counter for normalization slot.
TH1F * fpiEta_MCmatch
!hist. for pi eta (after cut) matched to B0 in MC
TH1F * fd0MMExppiMCmatch
!hist. for pion topomatic (after cut) matched to B0 in MC
Double_t fDplusMassUpLimit
DplusMassLowLimit to select D.
AliAODVertex * GetOwnPrimaryVtx() const
TH1F * fproductd0
!hist. for d0 product (after cut)
TH1F * fDplusPointing_MCmatch
!hist. for D cos pointing (after cut) matched to B0 in MC
TH1F * fpiPt
!hist. for pion Pt (after cut)
TH1F * fDplusInvMassBin[kMaxPtBins]
!hist. for D+ mass in pT bins
TH2F * fBDplusPt_MCmatch
!hist of B pT vs D pT matched to B0 in MC
TH1F * fDplusPhi
!hist. for D phi (after cut)
TH1F * fd0MMExppiBin[kMaxPtBins]
!hist. for pion topomatic (after cut) in pT bins
TH1F * fDplusPointing
!hist. for D cos pointing (after cut)
void SetProngIDs(Int_t nIDs, UShort_t *id)
TH1F * fDplusNormalizedDecayLength_MCmatch
!hist. for D norm dec length XY(after cut) matched to B0 in MC
TH1F * fDpluspTBin[kMaxPtBins]
!hist. for D pT (after cut) in pT bins
TH1F * fB0InvMassBinMinusD_PassCut1[kMaxPtBins]
!hist. for B0minusD mass after cut in MC in pT bins
TH1F * fBPointingBin_MCmatch[kMaxPtBins]
!hist. for B cos pointnig (after cut) matched to B0 in MC in pT bins
UShort_t GetProngID(Int_t ip) const
Double_t InvMassDplus() const
virtual void Terminate(Option_t *option)
TH1F * fd0MMExpDBin_MCmatch[kMaxPtBins]
!hist. for D topomatic (after cut) matched to B0 in MC in pT bins
TH1F * fDplusDecayLengthBin[kMaxPtBins]
!hist. for D decay length (after cut) in pT bins
TH1F * fBEta
!hist. for B eta (after cut)
AliPIDResponse * GetPidResponse() const
TH1F * fDplusInvMassBin_MCmatch[kMaxPtBins]
!hist. for D+ mass matched to B0 in MC in pT bins
std::vector< AliAODRecoDecayHF2Prong * > fArrayB0
Cuts for Analysis.
TH2F * fBpiPtBin[kMaxPtBins]
!hist of B pT vs pion pT in pT bins
TH1F * fd0MMExpDBin[kMaxPtBins]
!hist. for D topomatic (after cut) in pT bins
Double_t fDplusMassLowLimit
flag to activate cuts distr histos
TList * fListCuts
! list of cuts
void SetPrimaryVtxRef(TObject *vtx)
primary vertex
TH2F * fBpiPt
!hist of B pT vs pion pT
virtual void UserExec(Option_t *option)
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
TH1F * fDplusd0Bin_MCmatch[kMaxPtBins]
!hist. for D d0 (after cut) matched to B0 in MC in pT bins
Double_t fprodd0
cut to applied on B selection: pT pion
TH1F * fDplusDecayLengthBin_MCmatch[kMaxPtBins]
!hist. for D decay length (after cut) matched to B0 in MC in pT bins
static Double_t GetBeautyMotherPt(TClonesArray *arrayMC, AliAODMCParticle *mcPart)
Bool_t fUseBit
n. of events
TH1F * fDplusPointingBin_MCmatch[kMaxPtBins]
!hist. for D pointing (after cut) matched to B0 in MC in pT bins
TH1F * fBNormalizedDecayLength_MCmatch
!hist. for B norm dec length XY (after cut) matched to B0 in MC
TH1F * fB0InvMassMinusD_PassCut1
!hist. for B0minusD mass after cut
Bool_t GetIsPrimaryWithoutDaughters() const
Bool_t IsEventSelected(AliVEvent *event)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999, Double_t spherocity=-99.)
TH2F * fBpiPt_MCmatch
!hist of B pT vs pion pT matched to B0 in MC
TH1F * fBPt_MCmatch
!hist. for B pt (after cut) matched to B0 in MC
TH1F * fDplusd0_MCmatch
!hist. for D d0 (after cut) matched to B0 in MC
TH2F * fBpiPtBin_MCmatch[kMaxPtBins]
!hist of B pT vs pion pT matched to B0 in MC in pT bins
TH1F * fDplusNormalizedDecayLengthBin_MCmatch[kMaxPtBins]
!hist. for D norm dec length XY (after cut) matched to B0 in MC in pT bins
TH1F * fpid0
!hist. for pion d0 (after cut)
void CleanOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod, AliAODVertex *origownvtx) const
Double_t fInvertedTopomaticCutOnDDaughters
width of one bin in B mass output histos
AliRDHFCutsDplustoKpipi * fRDCutsAnalysis
Double_t fBMassLowLimit
DplusMassUpLimit to select D.
TH1F * fBPointing_MCmatch
!hist. for B pointing (after cut) matched to B0 in MC
TH1F * fB0InvMassBinMinusD_MCmatch_PassCut1[kMaxPtBins]
!hist. for B0minusD mass after cut matched to B0 in MC in pT bins
TH1F * fDplusEta
!hist. for D eta (after cut)
TH1F * fproductd0_MCmatch
!hist. for d0 product (after cut) matched to B0 in MC
TH1F * fproductd0Bin_MCmatch[kMaxPtBins]
!hist. for product d0 (after cut) matched to B0 in MC in pT bins
Bool_t fUseQuarkTagInKine
flag to add histo in pT bins
TH1F * fB0InvMassBin[kMaxPtBins]
!hist. for B0 mass in pT bins
TH1F * fDplusInvMass_MCmatch
!hist. for (after cut) matched to B0 in MC
Double_t fcosoaDpi
cut to applied on B selection: pion topomatic
TH2F * fBDplusPtBin[kMaxPtBins]
!hist of B pT vs D pT in pT bins
TH1F * fBPhi
!hist. for B phi (after cut)
Double_t fpTD
only candidates with a minimum topomatic of fUseInvertedTopomaticCutOnDDaughters are considered ...
Double_t fNdlBXY
cut to applied on B selection: B decay length
Bool_t kbins
flag for access to MC
Double_t CosPointingAngle() const
TH1F * fproductd0Bin[kMaxPtBins]
!hist. for d0 product (after cut) in pT bins
TH1F * fd0MMExpD
!hist. for D topomatic (after cut)
TH1F * fB0InvMassMinusD_MCmatch_PassCut1
!hist. for B0minusD mass after cut matched to B0 in MC
Bool_t RecalcOwnPrimaryVtx(AliAODRecoDecayHF *d, AliAODEvent *aod) const
TH1F * fBPointingBin[kMaxPtBins]
!hist. for B cos pointing (after cut) in pT bins
virtual ~AliAnalysisTaskSEB0toDminuspi()
Int_t PtBin(Double_t pt) const
TH1F * fB0InvMass
!hist. for B0 mass
Double_t DecayLength() const
TH1F * fCEvents
!hist. for No. of events
TH1F * fDplusInvMass_PassCut1
!hist. for D+ mass after cut
TH1F * fcosoa
!hist. for cos opening angle between D and pion (after cut)
TH1F * fDplusd0Bin[kMaxPtBins]
!hist. for D d0 (after cut) in pT bins
Bool_t fReadMC
eta region to accept D+ 0=all, -1 = negative, 1 = positive
TH1F * fpiEta
!hist. for pion eta (after cut)
TH1F * fBDecayLength
!hist. for B decay length (after cut)
TList * fOutput
! User output
Int_t MatchToMCB3Prong(Int_t pdgabs, Int_t pdgabs3prong, Int_t *pdgBDg, Int_t *pdgDg3prong, TClonesArray *mcArray) const