25 #include <TParticle.h> 27 #include <TObjArray.h> 29 #include <TDatabasePDG.h> 30 #include <AliAnalysisDataSlot.h> 31 #include <AliAnalysisDataContainer.h> 34 #include "AliVertex.h" 35 #include "AliVVertex.h" 36 #include "AliESDVertex.h" 37 #include "AliVertexerTracks.h" 38 #include "AliMCEvent.h" 39 #include "AliAnalysisManager.h" 40 #include "AliAODMCHeader.h" 41 #include "AliAODHandler.h" 43 #include "AliExternalTrackParam.h" 44 #include "AliNeutralTrackParam.h" 45 #include "AliAODVertex.h" 46 #include "AliAODRecoDecay.h" 52 #include "AliESDtrack.h" 53 #include "AliAODMCParticle.h" 55 #include "AliAODEvent.h" 73 fB0InvMass_PassCut1(0),
74 fB0InvMassMinusD_PassCut1(0),
75 fDplusInvMass_PassCut1(0),
76 fDplusInvMass_DplusMCmatch(0),
77 fDplusInvMass_MCmatch(0),
79 fBInvMass_MCmatch_PassCut1(0),
80 fB0InvMassMinusD_MCmatch_PassCut1(0),
90 fDplusNormalizedDecayLength(0),
98 fBNormalizedDecayLength(0),
106 fDplusEta_MCmatch(0),
107 fDplusPhi_MCmatch(0),
108 fDplusPointing_MCmatch(0),
109 fDplusDecayLength_MCmatch(0),
110 fDplusNormalizedDecayLength_MCmatch(0),
111 fDplusSigmaVert_MCmatch(0),
115 fBPointing_MCmatch(0),
116 fBPointingXY_MCmatch(0),
117 fBDecayLength_MCmatch(0),
118 fBNormalizedDecayLength_MCmatch(0),
121 fproductd0_MCmatch(0),
127 fd0MMExppiMCmatch(0),
128 fd0MMExpDDaughters(0),
129 fd0MMExpDDaughters_MCmatch(0),
134 fBDplusPt_MCmatch(0),
145 fUseQuarkTagInKine(kTRUE),
148 fInvertedTopomaticCutOnDDaughters(0),
160 fDplusMassLowLimit(1.845),
161 fDplusMassUpLimit(1.895),
175 for(
Int_t i=0; i<kMaxPtBins; i++){
177 fDplusInvMassBin[i]=0;
178 fB0InvMassBin_MCmatch[i]=0;
179 fB0InvMassBin_MCmatch_PassCut1[i]=0;
180 fDplusInvMassBin_PassCut1[i]=0;
181 fB0InvMassBin_MCmatch_PassCut1[i]=0;
182 fDplusInvMassBin_MCmatch[i]=0;
183 fB0InvMassBin_PassCut1[i]=0;
184 fDplusInvMassBin_PassCut1[i]=0;
185 fB0InvMassBinMinusD_PassCut1[i]=0;
186 fB0InvMassBinMinusD_MCmatch_PassCut1[i]=0;
188 fBDecayLengthBin[i]=0;
189 fBNormalizedDecayLengthBin[i]=0;
191 fBPointingXYBin[i]=0;
196 fDplusPointingBin[i]=0;
197 fDplusDecayLengthBin[i]=0;
198 fDplusNormalizedDecayLengthBin[i]=0;
199 fDplusSigmaVertBin[i]=0;
201 fBDecayLengthBin_MCmatch[i]=0;
202 fBNormalizedDecayLengthBin_MCmatch[i]=0;
203 fBPointingBin_MCmatch[i]=0;
204 fBPointingXYBin_MCmatch[i]=0;
205 fDplusd0Bin_MCmatch[i]=0;
206 fBpTBin_MCmatch[i]=0;
207 fDpluspTBin_MCmatch[i]=0;
208 fproductd0Bin_MCmatch[i]=0;
209 fDplusPointingBin_MCmatch[i]=0;
210 fDplusDecayLengthBin_MCmatch[i]=0;
211 fDplusNormalizedDecayLengthBin_MCmatch[i]=0;
212 fDplusSigmaVertBin_MCmatch[i]=0;
215 fd0MMExpDBin_MCmatch[i]=0;
217 fd0MMExppiBin_MCmatch[i]=0;
218 fd0MMExpDDaughtersBin[i]=0;
219 fd0MMExpDDaughtersBin_MCmatch[i]=0;
224 fBDplusPtBin_MCmatch[i]=0;
226 fBpiPtBin_MCmatch[i]=0;
246 fB0InvMass_PassCut1(0),
247 fB0InvMassMinusD_PassCut1(0),
248 fDplusInvMass_PassCut1(0),
249 fDplusInvMass_DplusMCmatch(0),
250 fBInvMass_MCmatch(0),
251 fBInvMass_MCmatch_PassCut1(0),
252 fB0InvMassMinusD_MCmatch_PassCut1(0),
261 fDplusDecayLength(0),
262 fDplusNormalizedDecayLength(0),
270 fBNormalizedDecayLength(0),
278 fDplusEta_MCmatch(0),
279 fDplusPhi_MCmatch(0),
280 fDplusPointing_MCmatch(0),
281 fDplusDecayLength_MCmatch(0),
282 fDplusNormalizedDecayLength_MCmatch(0),
283 fDplusSigmaVert_MCmatch(0),
287 fBPointing_MCmatch(0),
288 fBPointingXY_MCmatch(0),
289 fBDecayLength_MCmatch(0),
290 fBNormalizedDecayLength_MCmatch(0),
293 fproductd0_MCmatch(0),
294 fDplusInvMass_MCmatch(0),
300 fd0MMExppiMCmatch(0),
301 fd0MMExpDDaughters(0),
302 fd0MMExpDDaughters_MCmatch(0),
307 fBDplusPt_MCmatch(0),
317 fUseQuarkTagInKine(kTRUE),
318 fRDCutsAnalysis(dpluscutsana),
320 fInvertedTopomaticCutOnDDaughters(0),
332 fDplusMassLowLimit(1.845),
333 fDplusMassUpLimit(1.895),
398 Info(
"AliAnalysisTaskSEB0toDminuspi",
"Calling Constructor");
402 DefineOutput(1,TList::Class());
403 DefineOutput(2,TList::Class());
404 DefineOutput(3,AliNormalizationCounter::Class());
405 DefineOutput(4,AliRDHFCutsDplustoKpipi::Class());
422 Int_t missingbins=4-nbins%4;
423 nbins=nbins+missingbins;
426 printf(
"AliAnalysisTaskSEDplus::SetBinWidth: W-bin width of %f will produce histograms not rebinnable by 4. New width set to %f\n",w,width);
429 if(fDebug>1) printf(
"AliAnalysisTaskSEDplus::SetBinWidth: width set to %f\n",width);
442 Info(
"~AliAnalysisTaskSEB0toDminuspi",
"Calling Destructor");
579 if(fDebug > 1) printf(
"AnalysisTaskSEB0toDminuspi::Init() \n");
583 analysis->SetName(
"AnalysisCuts");
598 Error(
"UserExec",
"NO EVENT FOUND!");
604 TClonesArray *array3Prong = 0;
614 if(!aodEvent && AODEvent() && IsStandardAOD()) {
617 aodEvent =
dynamic_cast<AliAODEvent*
> (AODEvent());
620 AliAODHandler* aodHandler = (AliAODHandler*)
621 ((AliAnalysisManager::GetAnalysisManager())->GetOutputEventHandler());
622 if(aodHandler->GetExtensions()) {
623 AliAODExtension *ext = (AliAODExtension*)aodHandler->GetExtensions()->FindObject(
"AliAOD.VertexingHF.root");
625 array3Prong=(TClonesArray*)aodFromExt->GetList()->FindObject(
"Charm3Prong");
628 array3Prong=(TClonesArray*)aodEvent->GetList()->FindObject(
"Charm3Prong");
634 if(!aodEvent->GetPrimaryVertex() || TMath::Abs(aodEvent->GetMagneticField())<0.001)
return;
638 if (array3Prong->GetEntriesFast()==0)
return;
643 TClonesArray *mcArray = 0;
644 AliAODMCHeader *mcHeader=0;
647 mcArray = (TClonesArray*)aodEvent->GetList()->FindObject(AliAODMCParticle::StdBranchName());
649 printf(
"AliAnalysisTaskSEDplus::UserExec: MC particles branch not found!\n");
653 mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
655 printf(
"AliAnalysisTaskSEDplus::UserExec: MC header branch not found!\n");
673 Int_t pdgDgDplustoKpipi[3]={321,211,211};
674 Int_t pdgDgB0toDminuspi[2]={411,211};
677 AliAODVertex *primaryVertex = (AliAODVertex*)aodEvent->GetPrimaryVertex();
678 if(!primaryVertex)
return;
679 if(primaryVertex->GetNContributors()<1)
return;
682 AliInfo(
"Could not find array of Charm3Prong, skipping the event");
685 else AliDebug(2, Form(
"Found %d vertices",array3Prong->GetEntriesFast()));
687 Int_t nSelectedAna =0;
688 Int_t nSelectedProd =0;
695 Double_t xdummy=0.,ydummy=0.,dca,dcaB, e[2];
696 Double_t d0z0B[2],covd0z0B[3],d0B[2],d0errB[2],d0z0[2],covd0z0[3],d0[2],d0err[2];
700 Int_t n3Prong = array3Prong->GetEntriesFast();
708 for (
Int_t i3Prong = 0; i3Prong < n3Prong; i3Prong++) {
729 Double_t etaD=theDminusparticle->Eta();
730 Double_t phiD=theDminusparticle->Phi();
744 Double_t ptCand = theDminusparticle->Pt();
747 AliAODVertex *origownvtx=0x0;
762 if(TMath::Abs(theDminusparticle->Charge())!=1){
768 labDp = theDminusparticle->MatchToMC(411,mcArray,3,pdgDgDplustoKpipi);
770 AliAODMCParticle *partDp = (AliAODMCParticle*)mcArray->At(labDp);
773 pdgCode=TMath::Abs(partDp->GetPdgCode());
778 AliAODMCParticle *partMomDp = (AliAODMCParticle*)mcArray->At(partDp->GetMother());
782 AliAODMCParticle *partMomDp = (AliAODMCParticle*)mcArray->At(partDp->GetMother());
783 if(!partMomDp)
continue;
786 if(TMath::Abs(partMomDp->GetPdgCode())==511 && ((partMomDp->GetLastDaughter()-partMomDp->GetFirstDaughter())==1)){
787 AliAODMCParticle* B0Dau2=0;
788 if(labDp== (partMomDp->GetFirstDaughter()-1)) B0Dau2 = (AliAODMCParticle*)mcArray->At(partMomDp->GetLastDaughter()-1);
789 else if(labDp== (partMomDp->GetLastDaughter()-1)) B0Dau2 = (AliAODMCParticle*)mcArray->At(partMomDp->GetFirstDaughter()-1);
790 if (B0Dau2) {
if(TMath::Abs(B0Dau2->GetPdgCode())==211)
fCEvents->Fill(10);}
830 AliExternalTrackParam *trackDminus =
new AliExternalTrackParam();
831 trackDminus->CopyFromVTrack(theDminusparticle);
851 Int_t arrayMCB0label[50];
858 for (
Int_t i=0; i<aodEvent->GetNumberOfTracks(); i++){
861 AliAODTrack* aodTrack = (AliAODTrack*)aodEvent->GetTrack(i);
863 if(aodTrack->GetID() == Id_prong0 ||aodTrack->GetID() == Id_prong1 || aodTrack->GetID() == Id_prong2)
continue;
868 if(!(aodTrack->TestFilterMask(BIT(4)))){
fCEvents->Fill(20);
continue;}
871 if(aodTrack->Pt()<0.5)
continue;
878 if (TMath::Abs(aodTrack->Eta())>0.8)
continue;
883 if(nSigmaTPCpi<-3 || nSigmaTPCpi>3 ){
fCEvents->Fill(12);
885 if(nSigmaTOFpi<-3 || nSigmaTOFpi>3){
889 if(aodTrack->Charge()==theDminusparticle->Charge()){
897 AliExternalTrackParam et4;
898 et4.CopyFromVTrack(static_cast<AliAODTrack*>(aodEvent->GetTrack(i)));
901 trackDminus->PropagateToDCA(primaryVertex,bz,100.,d0z0B,covd0z0B);
903 d0errB[0] = TMath::Sqrt(covd0z0B[0]);
904 et4.PropagateToDCA(primaryVertex,bz,100.,d0z0B,covd0z0B);
906 d0errB[1] = TMath::Sqrt(covd0z0B[0]);
908 dcaB=et4.GetDCA(trackDminus,bz,xdummy,ydummy);
911 b012_B.Add(trackDminus); b012_B.Add(&et4);
921 pxB[0] = trackDminus-> Px();
922 pyB[0] = trackDminus-> Py();
923 pzB[0] = trackDminus-> Pz();
924 pxB[1] = aodTrack-> Px();
925 pyB[1] = aodTrack-> Py();
926 pzB[1] = aodTrack-> Pz();
934 idB[1]= aodTrack->GetID();
938 if(!B0Dminuspi)
continue;
942 B0Dminuspi->GetSecondaryVtx()->AddDaughter(theDminusparticle);
943 B0Dminuspi->GetSecondaryVtx()->AddDaughter(aodTrack);
957 arrayMCB0label[iB0count]=-1;
962 arrayMCB0label[iB0count] = B0Dminuspi->
MatchToMCB3Prong(511,411, pdgDgB0toDminuspi, pdgDgDplustoKpipi, mcArray);
963 if(arrayMCB0label[iB0count]>(-1)){
992 if(iB0count>0)
FillSpectrum(iB0count, arrayMCB0label,bz);
997 B0evtcount+=iB0count;
1006 AliDebug(2, Form(
"Found %i Reco particles that are D+!!",nOS));
1007 AliDebug(2, Form(
"Found %i Reco particles that are B0!!",B0evtcount));
1022 AliAnalysisTaskSE::Terminate();
1026 printf(
"ERROR: fOutput not available\n");
1040 Info(
"UserCreateOutputObjects",
"CreateOutputObjects of task %s\n", GetName());
1046 fOutput->SetName(
"PtIntegrated");
1072 fCEvents =
new TH1F(
"fCEvents",
"conter",30,0.5,30.5);
1073 fCEvents->GetXaxis()->SetBinLabel(1,
"n Events");
1074 fCEvents->GetXaxis()->SetBinLabel(2,
"w primary vtx");
1075 fCEvents->GetXaxis()->SetBinLabel(3,
"selected/ w array3prong");
1076 fCEvents->GetXaxis()->SetBinLabel(4,
"D+ candidates");
1077 fCEvents->GetXaxis()->SetBinLabel(5,
"D+ rejected for DplusCuts");
1078 fCEvents->GetXaxis()->SetBinLabel(6,
"D+ rejected for topological + PID selection ");
1079 fCEvents->GetXaxis()->SetBinLabel(7,
"D+ rejected for charge");
1080 fCEvents->GetXaxis()->SetBinLabel(8,
"MC D+ primary orig=4");
1081 fCEvents->GetXaxis()->SetBinLabel(9,
"MC D+ feed-down orig=5");
1082 fCEvents->GetXaxis()->SetBinLabel(10,
"MC B->D pi");
1084 fCEvents->GetXaxis()->SetBinLabel(11,
"D+ candidates to be associated with a pion");
1085 fCEvents->GetXaxis()->SetBinLabel(12,
"pion cadidate rejected for PID");
1086 fCEvents->GetXaxis()->SetBinLabel(13,
"pion candidate rejected because of charge");
1087 fCEvents->GetXaxis()->SetBinLabel(14,
"pion candidate passing selections");
1089 fCEvents->GetXaxis()->SetBinLabel(15,
"B0 candidate");
1090 fCEvents->GetXaxis()->SetBinLabel(16,
"B0 candidate matched MC");
1091 fCEvents->GetXaxis()->SetBinLabel(17,
"B0 passing set cut 1");
1092 fCEvents->GetXaxis()->SetBinLabel(18,
"B0 passing set cut 1 matched MC");
1093 fCEvents->GetXaxis()->SetBinLabel(19,
"D + not in fiducial accaptance");
1094 fCEvents->GetXaxis()->SetBinLabel(20,
"aodtrack rejected for filterbit 4 ");
1095 fCEvents->GetXaxis()->SetBinLabel(21,
"pion tracks before cuts");
1098 fCEvents->GetXaxis()->SetTitle(
"1");
1099 fCEvents->GetYaxis()->SetTitle(
"counts");
1109 fDplusInvMass =
new TH1F(
"fDplusInvMass",
"Dplus invariant mass;GeV", 500, 1.75, 1.95 );
1115 fDplusInvMass_PassCut1 =
new TH1F(
"fDplusInvMass_PassCut1",
"D+ invariant mass with Cut1 implemented;GeV", 500, 1.75, 1.95);
1117 fDplusInvMass_DplusMCmatch =
new TH1F(
"fDplusInvMass_DplusMCmatch",
"Dplus invariant mass (Dplus matched);GeV", 500, 1.75, 1.95);
1122 fpiPt =
new TH1F(
"fpiPt",
"Pt of pion (from B0 selected)", 200, 0, 20);
1123 fpiEta =
new TH1F(
"fpiEta",
"Eta of pion (from B0 selected)", 200, -1, 1);
1124 fpiPhi =
new TH1F(
"fpiPhi",
"Phi of pion (from B0 selected)", 200, 0, 7);
1125 fDplusPt =
new TH1F(
"fDplusPt",
"Pt of Dplus (from B0 selected)",100, 0, 50);
1126 fDplusEta =
new TH1F(
"fDplusEta",
"Eta of Dplus (from B0 selected)", 200, -1, 1);
1127 fDplusPhi =
new TH1F(
"fDplusPhi",
"Phi of Dplus (from B0 selected)", 200, 0, 7);
1128 fDplusPointing =
new TH1F(
"fDplusPointing",
"CosPointingAngle of Dplus (from B0 selected)", 200, 0., 1.);
1129 fDplusDecayLength =
new TH1F(
"fDplusDecayLength",
"Decay Length of D+ (B0 selected)", 200, 0, 0.5);
1131 fDplusSigmaVert =
new TH1F(
"fDplusSigmaVert",
"Sigma vertex of D+ (B0 selected)", 200, 0, 0.5);
1132 fBPt =
new TH1F(
"fBPt",
"Pt of B0 (B0 selected)", 100, 0, 50);
1133 fBEta =
new TH1F(
"fBEta",
"Eta of B0 (B0 selected)", 200, -1, 1);
1134 fBPhi =
new TH1F(
"fBPhi",
"Phi of B0 (B0 selected)", 200, 0, 7);
1135 fBPointing =
new TH1F(
"fBPointing",
"CosPointingAngle of B0 (B0 selected)", 200, 0., 1.);
1136 fBPointingXY =
new TH1F(
"fBPointingXY",
"CosPointingAngleXY of B0 (B0 selected)", 200, 0., 1.);
1137 fBDecayLength =
new TH1F(
"fBDecayLength",
"Decay Length of B0 (B0 selected)", 200, 0, 0.5);
1138 fBNormalizedDecayLength =
new TH1F(
"fBNormalizedDecayLength",
"Normalized Decay Length of B0 (B0 selected)", 200, 0, 20);
1139 fDplusd0 =
new TH1F(
"fDplusd0",
"|d0| Dplus to prim vtx(B0 selected)", 200, 0, 0.25);
1140 fpid0 =
new TH1F(
"fpid0",
"|d0| pion to prim vtx(B0 selected)", 200, 0, 0.25);
1141 fproductd0 =
new TH1F(
"fproductd0",
"d0 pion x d0 Dplus (B0 selected)", 200, -0.001, 0.001);
1142 fpiPt_MCmatch =
new TH1F(
"fpiPt_MCmatch",
"Pt of pion (MCmatched B0)", 200, 0, 20);
1143 fpiEta_MCmatch =
new TH1F(
"fpiEta_MCmatch",
"Eta of pion (MCmatched B0)", 200, -1, 1);
1144 fpiPhi_MCmatch =
new TH1F(
"fpiPhi_MCmatch",
"Phi of pion (MCmatched B0)", 200, 0, 7);
1145 fDplusPt_MCmatch =
new TH1F(
"fDplusPt_MCmatch",
"Pt of Dplus (MCmatched B0)", 100, 0, 50);
1146 fDplusEta_MCmatch =
new TH1F(
"fDplusEta_MCmatch",
"Eta of Dplus (MCmatched B0)", 200, -1, 1);
1147 fDplusPhi_MCmatch =
new TH1F(
"fDplusPhi_MCmatch",
"Phi of Dplus (MCmatched B0)", 200, 0, 7);
1148 fDplusPointing_MCmatch =
new TH1F(
"fDplusPointing_MCmatch",
"CosPointingAngle of Dplus (MCmatched B0)", 200, 0., 1.);
1151 fDplusSigmaVert_MCmatch =
new TH1F(
"fDplusSigmaVert_MCmatch",
"Sigma vertex of D+ (MC matched B0)", 200, 0, 0.5);
1152 fBPt_MCmatch =
new TH1F(
"fBPt_MCmatch",
"Pt of B0 (MCmatched B0)", 100, 0, 50);
1153 fBEta_MCmatch =
new TH1F(
"fBEta_MCmatch",
"Eta of B0 (MCmatched B0)", 200, -1, 1);
1154 fBPhi_MCmatch =
new TH1F(
"fBPhi_MCmatch",
"Phi of B0 (MCmatched B0)", 200, 0, 7);
1155 fBPointing_MCmatch =
new TH1F(
"fBPointing_MCmatch",
"CosPointingAngle of B0 (MCmatched B0)", 200, 0., 1.);
1156 fBPointingXY_MCmatch =
new TH1F(
"fBPointingXY_MCmatch",
"CosPointingAngleXY of B0 (MC matched B0)", 200, 0., 1.);
1157 fBDecayLength_MCmatch =
new TH1F(
"fBDecayLength_MCmatch",
"Decay Length of B0 (MCmatched B0)", 200, 0, 0.5);
1159 fDplusd0_MCmatch =
new TH1F(
"fDplusd0_MCmatch",
"|d0| Dplus to prim vtx(MCmatched B0)", 200, 0, 0.25);
1160 fpid0_MCmatch =
new TH1F(
"fpid0_MCmatch",
"|d0| pi to prim vtx(MCmatched B0)", 200, 0, 0.25);
1161 fproductd0_MCmatch =
new TH1F(
"fproductd0_MCmatch",
"d0 pion x d0 Dplus (MCmatched B0)", 200, -0.001, 0.001);
1162 fDplusInvMass_MCmatch =
new TH1F(
"fDplusInvMass_MCmatch",
"D+ invariant mass (MCmatched B0);GeV", 500, 1.75, 1.95);
1166 fd0MMExpD =
new TH1F(
"fd0MMExpD",
"Topomatic variable for D", 200, -10.0,10.);
1167 fd0MMExpDMCmatch =
new TH1F(
"fd0MMExpDMCmatch",
"Topomatic variable for D from B matched to MC", 200, -10,10.);
1168 fd0MMExppi =
new TH1F(
"fd0MMExppi",
"Topomatic variable for pi ", 200, -10.0,10.);
1169 fd0MMExppiMCmatch =
new TH1F(
"fd0MMExppiMCmatch",
"Topomatic variable for pi from B matched to MC", 200, -10,10.);
1170 fd0MMExpDDaughters =
new TH1F(
"fd0MMExpDDaughters",
"Topomatic variable for D daughters", 200, -10.0,10.);
1171 fd0MMExpDDaughters_MCmatch =
new TH1F(
"fd0MMExpDDaughters_MCmatch",
"Topomatic variable for D daughters with B matched to MC", 200, -10,10.);
1173 fcosoa=
new TH1F(
"fcosoa",
"cos opening angle", 200, -1.10,1.10);
1174 fcosoa_MCmatch=
new TH1F(
"fcosoa_MCmatch",
"cos opening angle MC", 200, -1.10,1.1);
1177 fBDplusPt =
new TH2F(
"fBDplusPt",
";B pT;D pT", 100, 0, 50,100,0,50);
1178 fBpiPt =
new TH2F(
"fBpiPt",
";B pT;pi pT", 100, 0, 50,100,0,50);
1262 for(
Int_t i=0; i<fNPtBins; i++){
1263 HistName.Form(
"fB0InvMass_bin%d",i);
1266 HistName.Form(
"fDplusInvMass_bin%d",i);
1267 fDplusInvMassBin[i]=
new TH1F(HistName.Data(), HistName.Data(), 500, 1.819, 1.919 );
1269 HistName.Form(
"fB0InvMass_bin%d_MCmatch",i);
1272 HistName.Form(
"fB0InvMass_bin%d_MCmatch_PassCut1",i);
1276 HistName.Form(
"fB0InvMassMinusD_bin%d_PassCut1",i);
1279 HistName.Form(
"fDplusInvMass_bin%d_MCmatch",i);
1282 HistName.Form(
"fB0InvMass_bin%d_PassCut1",i);
1285 HistName.Form(
"fB0InvMassMinusD_bin%d_MCmatch_PassCut1",i);
1288 HistName.Form(
"fDplusInvMass_bin%d_PassCut1",i);
1293 HistName.Form(
"fBDecayLengthBin_bin%d",i);
1294 fBDecayLengthBin[i]=
new TH1F(HistName.Data(), HistName.Data(), 200, 0, 0.5);
1295 HistName.Form(
"fBNormalizedDecayLengthBin_bin%d",i);
1297 HistName.Form(
"fBPointingBin_bin%d",i);
1298 fBPointingBin[i]=
new TH1F(HistName.Data(), HistName.Data(), 200, 0, 1.);
1299 HistName.Form(
"fBPointingXYBin_bin%d",i);
1300 fBPointingXYBin[i]=
new TH1F(HistName.Data(), HistName.Data(), 200, 0, 1.);
1301 HistName.Form(
"fDplusd0Bin_bin%d",i);
1302 fDplusd0Bin[i]=
new TH1F(HistName.Data(), HistName.Data(), 200, 0, 0.25);
1303 HistName.Form(
"fBpTBin_bin%d",i);
1304 fBpTBin[i]=
new TH1F(HistName.Data(), HistName.Data(), 100, 0, 50);
1305 HistName.Form(
"fDpluspTBin_bin%d",i);
1306 fDpluspTBin[i]=
new TH1F(HistName.Data(), HistName.Data(), 100, 0, 50);
1307 HistName.Form(
"fproductd0Bin_bin%d",i);
1308 fproductd0Bin[i]=
new TH1F(HistName.Data(), HistName.Data(), 200, -0.001, 0.001);
1309 HistName.Form(
"fDplusPointingBin_bin%d",i);
1311 HistName.Form(
"fDplusDecayLengthBin_bin%d",i);
1313 HistName.Form(
"fDplusNormalizedDecayLengthBin_bin%d",i);
1315 HistName.Form(
"fDplusSigmaVertBin_bin%d",i);
1318 HistName.Form(
"fBDecayLengthBin_MCmatch_bin%d",i);
1320 HistName.Form(
"fBNormalizedDecayLengthBin_MCmatch_bin%d",i);
1322 HistName.Form(
"fBPointingBin_MCmatch_bin%d",i);
1324 HistName.Form(
"fBPointingXYBin_MCmatch_bin%d",i);
1326 HistName.Form(
"fDplusd0Bin_MCmatch_bin%d",i);
1328 HistName.Form(
"fBpTBin_MCmatch_bin%d",i);
1329 fBpTBin_MCmatch[i]=
new TH1F(HistName.Data(), HistName.Data(), 100, 0, 50);
1330 HistName.Form(
"fDpluspTBin_MCmatch_bin%d",i);
1332 HistName.Form(
"fproductd0Bin_MCmatch_bin%d",i);
1334 HistName.Form(
"fDplusPointingBin_MCmatch_bin%d",i);
1336 HistName.Form(
"fDplusDecayLengthBin_MCmatch_bin%d",i);
1338 HistName.Form(
"fDplusNormalizedDecayLengthBin_MCmatch_bin%d",i);
1340 HistName.Form(
"fDplusSigmaVertBin_MCmatch_bin%d",i);
1343 HistName.Form(
"fd0MMExpD_bin%d",i);
1344 fd0MMExpDBin[i] =
new TH1F(HistName.Data(), HistName.Data(), 200, -10.0,10.);
1345 HistName.Form(
"fd0MMExpD_MCmatch_bin%d",i);
1347 HistName.Form(
"fd0MMExppi_bin%d",i);
1348 fd0MMExppiBin[i] =
new TH1F(HistName.Data(), HistName.Data(), 200, -10.0,10.);
1349 HistName.Form(
"fd0MMExppi_MCmatch_bin%d",i);
1351 HistName.Form(
"fd0MMExpDDaughtersBin%d",i);
1353 HistName.Form(
" fd0MMExpDDaughters_MCmatch_bin%d",i);
1356 HistName.Form(
"fBDplusPtBin_bin%d",i);
1357 fBDplusPtBin[i]=
new TH2F(HistName.Data(), HistName.Data(), 100, 0, 50,100,0,50);
1358 HistName.Form(
"fBpiPtBin_bin%d",i);
1359 fBpiPtBin[i]=
new TH2F(HistName.Data(), HistName.Data(), 100, 0, 50,100,0,50);
1360 HistName.Form(
"fBDplusPtBin_bin%d_MCmatch",i);
1362 HistName.Form(
"fBpiPtBin_bin%d_MCmatch",i);
1434 if (nB0 ==0)
return;
1438 UInt_t prongs[2]={411,211};
1441 for(
Int_t i=0; i<3; i++) {
1444 Double_t normdd0= diffIP/errdiffIP;
1447 if(i==0) dd0min=normdd0;
1448 else if(TMath::Abs(normdd0)<TMath::Abs(dd0min)) dd0min=normdd0;
1458 Double_t B0InvMass, d01, d02, productd0;
1460 for (
int iB0 =0; iB0<nB0; iB0++){
1464 B0InvMass =
fArrayB0[iB0]->InvMass2Prongs(0 , 1 ,prongs[0], prongs[1]);
1465 AliAODTrack* aodTrack = (AliAODTrack*)
fArrayB0[iB0]->GetSecondaryVtx()->GetDaughter(1);
1466 d01 = TMath::Abs(
fArrayB0[iB0]->Getd0Prong(0));
1467 d02 = TMath::Abs(
fArrayB0[iB0]->Getd0Prong(1));
1471 fArrayB0[iB0]->Getd0MeasMinusExpProng(0,Bfield,diffIPMCD,errdiffIPMCD);
1472 Double_t normdd0MCD= diffIPMCD/errdiffIPMCD;
1474 Double_t diffIPMCpi, errdiffIPMCpi;
1475 fArrayB0[iB0]->Getd0MeasMinusExpProng(1,Bfield,diffIPMCpi,errdiffIPMCpi);
1476 Double_t normdd0MCpi= diffIPMCpi/errdiffIPMCpi;
1482 if(arrayMClabel[iB0] > (-1)){
1489 if(arrayMClabel[iB0] > (-1)) {
1523 fpiPt->Fill(aodTrack->Pt());
1524 fpiEta->Fill(aodTrack->Eta());
1525 fpiPhi->Fill(aodTrack->Phi());
1543 if(arrayMClabel[iB0] > (-1)){
1607 if(arrayMClabel[iB0] > (-1)){
1648 AliESDVertex *vertexESD = 0;
1649 AliAODVertex *vertexAOD = 0;
1652 AliVertexerTracks *vertexer =
new AliVertexerTracks(bField);
1653 vertexer->SetVtxStart((AliESDVertex*)primary);
1654 vertexESD = (AliESDVertex*)vertexer->VertexForSelectedESDTracks(tracks);
1655 delete vertexer; vertexer=NULL;
1657 if(!vertexESD)
return vertexAOD;
1660 if(vertexESD->GetNContributors()!=tracks->GetEntriesFast()) {
1662 delete vertexESD; vertexESD=NULL;
1672 for(
Int_t a=0;a<3;a++)pos[a]=0.;
1673 for(
Int_t b=0;b<6;b++)cov[b]=0.;
1676 vertexESD->GetXYZ(pos);
1677 vertexESD->GetCovMatrix(cov);
1680 Double_t vertRadius2=pos[0]*pos[0]+pos[1]*pos[1];
1683 delete vertexESD; vertexESD=NULL;
1687 chi2perNDF = vertexESD->GetChi2toNDF();
1688 dispersion = vertexESD->GetDispersion();
1689 delete vertexESD; vertexESD=NULL;
1690 Int_t nprongs= tracks->GetEntriesFast();
1691 vertexAOD =
new AliAODVertex(pos,cov,chi2perNDF,0x0,-1,AliAODVertex::kUndef,nprongs);
TH1F * fDplusSigmaVert
!hist. for D sigma vertex (after cut)
TH1F * fDplusSigmaVertBin_MCmatch[kMaxPtBins]
!hist. for D sigma vertex (after cut) matched to B0 in MC in pT bins
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 * fDplusSigmaVert_MCmatch
!hist. for D sigma vertex (after cut) matched to B0 in MC
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 * fDplusSigmaVertBin[kMaxPtBins]
!hist. for D sigma vertex (after cut) in pT bins
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)
Functions to check the decay tree.
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 XY
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
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
Double_t GetSigmaVert(const AliAODEvent *aod=0x0)
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 * fBPointingXYBin[kMaxPtBins]
!hist. for B cos pointing XY (after cut) in pT bins
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 * fBPointingXY
!hist. for B cos poining XY (after cut)
TH1F * fDplusEta
!hist. for D eta (after cut)
TH1F * fproductd0_MCmatch
!hist. for d0 product (after cut) matched to B0 in MC
TH1F * fBPointingXY_MCmatch
!hist. for B pointing XY (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
Double_t fcosBXY
cut to applied on B selection: B cos pointing
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 * fBPointingXYBin_MCmatch[kMaxPtBins]
!hist. for B cos pointnig XY (after cut) matched to B0 in MC in pT bins
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