19 #include <TClonesArray.h> 23 #include <TParticle.h> 24 #include "AliMCEvent.h" 25 #include "AliAODEvent.h" 26 #include "AliAODMCHeader.h" 27 #include "AliGenEventHeader.h" 28 #include "AliAODMCParticle.h" 53 fMinEtaForTracklets(-1.),
54 fMaxEtaForTracklets(1.)
77 Double_t errSigSq=errsignal*errsignal;
78 Double_t errBkgSq=errbackground*errbackground;
79 Double_t sigPlusBkg=signal+background;
80 if(sigPlusBkg>0. && signal>0.){
81 significance = signal/TMath::Sqrt(signal+background);
82 errsignificance = significance*TMath::Sqrt((errSigSq+errBkgSq)/(4.*sigPlusBkg*sigPlusBkg)+(background/sigPlusBkg)*errSigSq/signal/signal);
95 c[0]=0.626657; c[1]=0.; c[2]=-0.09694; c[3]=0.02754; c[4]=-0.002283;
98 c[0]=0.; c[1]=0.25; c[2]=-0.011414; c[3]=-0.034726; c[4]=0.006815;
101 return c[0]*x+c[1]*x*x+c[2]*x*x*x+c[3]*x*x*x*x+c[4]*x*x*x*x*x;
106 return TMath::Sqrt(TMath::Pi()/8)*x*TMath::Exp(-x*x/4)*(TMath::BesselI0(x*x/4)+TMath::BesselI1(x*x/4));
127 if(y1*y2>0)
return -1;
132 while((x2-x1)>0.0001){
142 ymed=
Pol(xmed,2)-res;
145 if((y1*ymed)<0) x2=xmed;
146 if((y2*ymed)<0)x1=xmed;
147 if(ymed==0)
return xmed;
157 Double_t chifull=chisub*TMath::Sqrt(2);
158 if(k==1)
return ResolK1(chifull);
159 else if(k==2)
return Pol(chifull,2);
161 printf(
"k should be <=2\n");
169 if(!hSubEvCorr)
return 1.;
176 if(!hSubEvCorr)
return 1.;
178 printf(
"%f\n",resSub);
184 if(!hSubEvCorr)
return 1.;
186 printf(
"%f\n",resSub);
192 AliAODTracklets* tracklets=ev->GetTracklets();
193 Int_t nTr=tracklets->GetNumberOfTracklets();
195 for(
Int_t iTr=0; iTr<nTr; iTr++){
196 Double_t theta=tracklets->GetTheta(iTr);
197 Double_t eta=-TMath::Log(TMath::Tan(theta/2.));
198 if(eta>mineta && eta<maxeta) count++;
207 for(
Int_t i=0;i<arrayMC->GetEntriesFast();i++){
208 AliAODMCParticle *
part=(AliAODMCParticle*)arrayMC->UncheckedAt(i);
211 if(charge!=0 && eta>mineta && eta<maxeta) nChargedMC++;
220 for(
Int_t i=0;i<arrayMC->GetEntriesFast();i++){
221 AliAODMCParticle *
part=(AliAODMCParticle*)arrayMC->UncheckedAt(i);
224 if(charge!=0 && eta>mineta && eta<maxeta){
225 if(part->IsPrimary())nChargedMC++;
235 for(
Int_t i=0;i<arrayMC->GetEntriesFast();i++){
236 AliAODMCParticle *
part=(AliAODMCParticle*)arrayMC->UncheckedAt(i);
239 if(charge!=0 && eta>mineta && eta<maxeta){
240 if(part->IsPhysicalPrimary())nChargedMC++;
255 for(
Int_t iCh = 32; iCh < 64; ++iCh) {
256 Double_t mult = ev->GetVZEROEqMultiplicity(iCh);
269 for(
Int_t iCh = 0; iCh < 32; ++iCh) {
270 Double_t mult = ev->GetVZEROEqMultiplicity(iCh);
277 void AliVertexingHFUtils::AveragePt(
Float_t& averagePt,
Float_t& errorPt,
Float_t ptmin,
Float_t ptmax,
TH2F* hMassD,
Float_t massFromFit,
Float_t sigmaFromFit, TF1* funcB2,
Float_t sigmaRangeForSig,
Float_t sigmaRangeForBkg,
Float_t minMass,
Float_t maxMass,
Int_t rebin){
282 Int_t start=hMassD->FindBin(ptmin);
283 Int_t end=hMassD->FindBin(ptmax)-1;
284 const Int_t nx=end-start;
285 TH2F *hMassDpt=
new TH2F(
"hptmass",
"hptmass",nx,ptmin,ptmax,hMassD->GetNbinsY(),hMassD->GetYaxis()->GetBinLowEdge(1),hMassD->GetYaxis()->GetBinLowEdge(hMassD->GetNbinsY())+hMassD->GetYaxis()->GetBinWidth(hMassD->GetNbinsY()));
286 for(
Int_t ix=start;ix<end;ix++){
287 for(
Int_t iy=1;iy<=hMassD->GetNbinsY();iy++){
288 hMassDpt->SetBinContent(ix-start+1,iy,hMassD->GetBinContent(ix,iy));
289 hMassDpt->SetBinError(ix-start+1,iy,hMassD->GetBinError(ix,iy));
293 Double_t minMassSig=massFromFit-sigmaRangeForSig*sigmaFromFit;
294 Double_t maxMassSig=massFromFit+sigmaRangeForSig*sigmaFromFit;
295 Int_t minBinSig=hMassD->GetYaxis()->FindBin(minMassSig);
296 Int_t maxBinSig=hMassD->GetYaxis()->FindBin(maxMassSig);
297 Double_t minMassSigBin=hMassD->GetYaxis()->GetBinLowEdge(minBinSig);
298 Double_t maxMassSigBin=hMassD->GetYaxis()->GetBinLowEdge(maxBinSig)+hMassD->GetYaxis()->GetBinWidth(maxBinSig);
301 Double_t maxMassBkgLow=massFromFit-sigmaRangeForBkg*sigmaFromFit;
302 Int_t minBinBkgLow=TMath::Max(hMassD->GetYaxis()->FindBin(minMass),2);
303 Int_t maxBinBkgLow=hMassD->GetYaxis()->FindBin(maxMassBkgLow);
304 Double_t minMassBkgLowBin=hMassD->GetYaxis()->GetBinLowEdge(minBinBkgLow);
305 Double_t maxMassBkgLowBin=hMassD->GetYaxis()->GetBinLowEdge(maxBinBkgLow)+hMassD->GetYaxis()->GetBinWidth(maxBinBkgLow);
306 Double_t minMassBkgHi=massFromFit+sigmaRangeForBkg*sigmaFromFit;
307 Int_t minBinBkgHi=hMassD->GetYaxis()->FindBin(minMassBkgHi);
308 Int_t maxBinBkgHi=TMath::Min(hMassD->GetYaxis()->FindBin(maxMass),hMassD->GetNbinsY()-1);
309 Double_t minMassBkgHiBin=hMassD->GetYaxis()->GetBinLowEdge(minBinBkgHi);
310 Double_t maxMassBkgHiBin=hMassD->GetYaxis()->GetBinLowEdge(maxBinBkgHi)+hMassD->GetYaxis()->GetBinWidth(maxBinBkgHi);
313 Double_t bkgSig=funcB2->Integral(minMassSigBin,maxMassSigBin);
314 Double_t bkgLow=funcB2->Integral(minMassBkgLowBin,maxMassBkgLowBin);
315 Double_t bkgHi=funcB2->Integral(minMassBkgHiBin,maxMassBkgHiBin);
318 TH1F* hMptBkgLo=(TH1F*)hMassDpt->ProjectionX(
"hPtBkgLoBin",minBinBkgLow,maxBinBkgLow);
319 TH1F* hMptBkgHi=(TH1F*)hMassDpt->ProjectionX(
"hPtBkgHiBin",minBinBkgHi,maxBinBkgHi);
320 TH1F* hMptSigReg=(TH1F*)hMassDpt->ProjectionX(
"hCPtBkgSigBin",minBinSig,maxBinSig);
322 hMptBkgLo->Rebin(rebin);
323 hMptBkgHi->Rebin(rebin);
324 hMptSigReg->Rebin(rebin);
328 TH1F* hMptBkgLoScal=(TH1F*)hMptBkgLo->Clone(
"hPtBkgLoScalBin");
329 hMptBkgLoScal->Scale(bkgSig/bkgLow);
330 TH1F* hMptBkgHiScal=(TH1F*)hMptBkgHi->Clone(
"hPtBkgHiScalBin");
331 hMptBkgHiScal->Scale(bkgSig/bkgHi);
333 TH1F* hMptBkgAver=0x0;
334 hMptBkgAver=(TH1F*)hMptBkgLoScal->Clone(
"hPtBkgAverBin");
335 hMptBkgAver->Add(hMptBkgHiScal);
336 hMptBkgAver->Scale(0.5);
337 TH1F* hMptSig=(TH1F*)hMptSigReg->Clone(
"hCPtSigBin");
338 hMptSig->Add(hMptBkgAver,-1.);
340 averagePt = hMptSig->GetMean();
341 errorPt = hMptSig->GetMeanError();
346 delete hMptBkgLoScal;
347 delete hMptBkgHiScal;
356 const Double32_t *mean = aodEv->GetT0TOF();
357 if(mean && mean[0]<9999.)
return kTRUE;
364 if(!partD || !arrayMC || !mcHeader)
return 99999.;
365 Int_t code=partD->GetPdgCode();
366 if(TMath::Abs(code)!=421)
return 99999.;
369 mcHeader->GetVertex(vtxTrue);
371 partD->XvYvZv(origD);
373 Double_t pXdauTrue[2],pYdauTrue[2],pZdauTrue[2];
374 for(
Int_t iDau=0; iDau<2; iDau++){
380 Int_t nDau=partD->GetNDaughters();
381 Int_t labelFirstDau = partD->GetDaughter(0);
383 for(
Int_t iDau=0; iDau<2; iDau++){
384 Int_t ind = labelFirstDau+iDau;
385 AliAODMCParticle*
part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
387 printf(
"Daughter particle not found in MC array");
390 pXdauTrue[iDau]=part->Px();
391 pYdauTrue[iDau]=part->Py();
392 pZdauTrue[iDau]=part->Pz();
399 AliAODRecoDecayHF aodDvsMC(vtxTrue,origD,2,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
407 if(!partD || !arrayMC || !mcHeader)
return 99999.;
408 Int_t code=partD->GetPdgCode();
409 if(TMath::Abs(code)!=411)
return 99999.;
412 mcHeader->GetVertex(vtxTrue);
414 partD->XvYvZv(origD);
416 Double_t pXdauTrue[3],pYdauTrue[3],pZdauTrue[3];
417 for(
Int_t iDau=0; iDau<3; iDau++){
423 Int_t nDau=partD->GetNDaughters();
424 Int_t labelFirstDau = partD->GetDaughter(0);
426 for(
Int_t iDau=0; iDau<3; iDau++){
427 Int_t ind = labelFirstDau+iDau;
428 AliAODMCParticle*
part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
430 printf(
"Daughter particle not found in MC array");
433 pXdauTrue[iDau]=part->Px();
434 pYdauTrue[iDau]=part->Py();
435 pZdauTrue[iDau]=part->Pz();
439 for(
Int_t iDau=0; iDau<2; iDau++){
440 Int_t ind = labelFirstDau+iDau;
441 AliAODMCParticle*
part =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(ind));
443 printf(
"Daughter particle not found in MC array");
446 Int_t pdgCode=TMath::Abs(part->GetPdgCode());
447 if(pdgCode==211 || pdgCode==321){
448 pXdauTrue[theDau]=part->Px();
449 pYdauTrue[theDau]=part->Py();
450 pZdauTrue[theDau]=part->Pz();
453 Int_t nDauRes=part->GetNDaughters();
455 Int_t labelFirstDauRes = part->GetDaughter(0);
456 for(
Int_t iDauRes=0; iDauRes<2; iDauRes++){
457 Int_t indDR = labelFirstDauRes+iDauRes;
458 AliAODMCParticle* partDR =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indDR));
460 printf(
"Daughter particle not found in MC array");
464 Int_t pdgCodeDR=TMath::Abs(partDR->GetPdgCode());
465 if(pdgCodeDR==211 || pdgCodeDR==321){
466 pXdauTrue[theDau]=partDR->Px();
467 pYdauTrue[theDau]=partDR->Py();
468 pZdauTrue[theDau]=partDR->Pz();
476 printf(
"Wrong number of decay prongs");
482 AliAODRecoDecayHF aodDvsMC(vtxTrue,origD,3,charge,pXdauTrue,pYdauTrue,pZdauTrue,d0dummy);
496 if(TMath::Abs(vtxZ)>10.0){
498 return uncorrectedNacc;
502 printf(
"ERROR: Missing TProfile for correction of multiplicity\n");
503 return uncorrectedNacc;
506 Double_t localAvg = estimatorAvg->GetBinContent(estimatorAvg->FindBin(vtxZ));
508 Double_t deltaM = uncorrectedNacc*(refMult/localAvg - 1);
510 Double_t correctedNacc = uncorrectedNacc + (deltaM>0 ? 1 : -1) *
gRandom->Poisson(TMath::Abs(deltaM));
512 return correctedNacc;
519 TList *lh=header->GetCocktailHeaders();
520 Int_t nh=lh->GetEntries();
521 for(
Int_t i=0;i<nh;i++){
522 AliGenEventHeader* gh=(AliGenEventHeader*)lh->At(i);
524 Int_t npart=gh->NProduced();
525 if(label>=nsumpart && label<(nsumpart+npart))
return genname;
536 Int_t lab=TMath::Abs(track->GetLabel());
541 while(nameGen.IsWhitespace()){
542 AliAODMCParticle *mcpart= (AliAODMCParticle*)arrayMC->At(lab);
544 printf(
"AliVertexingHFUtils::IsTrackInjected - BREAK: No valid AliAODMCParticle at label %i\n",lab);
547 Int_t mother = mcpart->GetMother();
549 printf(
"AliVertexingHFUtils::IsTrackInjected - BREAK: Reached primary particle without valid mother\n");
569 if(nameGen.IsWhitespace() || nameGen.Contains(
"ijing"))
return kFALSE;
577 Int_t nprongs=cand->GetNProngs();
578 for(
Int_t i=0;i<nprongs;i++){
579 AliAODTrack *daugh=(AliAODTrack*)cand->GetDaughter(i);
590 AliDebug(2,
"Bachelor is injected, the whole candidate is then injected");
593 AliAODv0* v0 = cand->
Getv0();
594 Int_t nprongs = v0->GetNProngs();
595 for(
Int_t i = 0; i < nprongs; i++){
596 AliAODTrack *daugh = (AliAODTrack*)v0->GetDaughter(i);
598 AliDebug(2, Form(
"V0 daughter number %d is injected, the whole candidate is then injected", i));
610 mother = mcPart->GetFirstMother();
612 Int_t abspdgGranma =0;
614 Bool_t isQuarkFound=kFALSE;
617 TParticle* mcGranma = mcEvent->Particle(mother);
619 pdgGranma = mcGranma->GetPdgCode();
620 abspdgGranma = TMath::Abs(pdgGranma);
621 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
624 if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
625 mother = mcGranma->GetFirstMother();
627 printf(
"CheckOrigin: Failed casting the mother particle!");
631 if(searchUpToQuark && !isQuarkFound)
return 0;
632 if(isFromB)
return 5;
642 mother = mcPart->GetMother();
644 Int_t abspdgGranma =0;
646 Bool_t isQuarkFound=kFALSE;
649 AliAODMCParticle* mcGranma =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(mother));
651 pdgGranma = mcGranma->GetPdgCode();
652 abspdgGranma = TMath::Abs(pdgGranma);
653 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
656 if(abspdgGranma==4 || abspdgGranma==5) isQuarkFound=kTRUE;
657 mother = mcGranma->GetMother();
659 printf(
"AliVertexingHFUtils::CheckOrigin: Failed casting the mother particle!");
663 if(searchUpToQuark && !isQuarkFound)
return 0;
664 if(isFromB)
return 5;
674 mother = mcPart->GetMother();
676 Int_t abspdgGranma =0;
679 AliAODMCParticle* mcGranma =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(mother));
681 pdgGranma = mcGranma->GetPdgCode();
682 abspdgGranma = TMath::Abs(pdgGranma);
683 if ((abspdgGranma > 500 && abspdgGranma < 600) || (abspdgGranma > 5000 && abspdgGranma < 6000)){
684 return mcGranma->Pt();
686 if(abspdgGranma==4)
return -999.;
687 if(abspdgGranma==5)
return -1.;
688 mother = mcGranma->GetMother();
690 printf(
"AliVertexingHFUtils::GetBeautyMotherPt: Failed casting the mother particle!");
700 if(label<0)
return -1;
701 TParticle* mcPart = mcEvent->Particle(label);
702 Int_t pdgD=mcPart->GetPdgCode();
703 if(TMath::Abs(pdgD)!=421)
return -1;
705 Int_t nDau=mcPart->GetNDaughters();
708 Int_t daughter0 = mcPart->GetDaughter(0);
709 Int_t daughter1 = mcPart->GetDaughter(1);
710 TParticle* mcPartDaughter0 = mcEvent->Particle(daughter0);
711 TParticle* mcPartDaughter1 = mcEvent->Particle(daughter1);
712 if(!mcPartDaughter0 || !mcPartDaughter1)
return -1;
713 arrayDauLab[0]=daughter0;
714 arrayDauLab[1]=daughter1;
715 Int_t pdgCode0=mcPartDaughter0->GetPdgCode();
716 Int_t pdgCode1=mcPartDaughter1->GetPdgCode();
717 if(!(TMath::Abs(pdgCode0)==321 && TMath::Abs(pdgCode1)==211) &&
718 !(TMath::Abs(pdgCode0)==211 && TMath::Abs(pdgCode1)==321)){
721 if(TMath::Abs(pdgCode0)==321 && (pdgD*pdgCode0)>0)
return -1;
722 if(TMath::Abs(pdgCode1)==321 && (pdgD*pdgCode1)>0)
return -1;
723 if((pdgCode0*pdgCode1)>0)
return -1;
724 Double_t sumPxDau=mcPartDaughter0->Px()+mcPartDaughter1->Px();
725 Double_t sumPyDau=mcPartDaughter0->Py()+mcPartDaughter1->Py();
726 Double_t sumPzDau=mcPartDaughter0->Pz()+mcPartDaughter1->Pz();
727 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -2;
728 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -2;
729 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -2;
733 if(nDau==3 || nDau==4){
740 Int_t labelFirstDau = mcPart->GetDaughter(0);
741 for(
Int_t iDau=0; iDau<nDau; iDau++){
742 Int_t indDau = labelFirstDau+iDau;
743 if(indDau<0)
return -1;
744 TParticle* dau=mcEvent->Particle(indDau);
746 Int_t pdgdau=dau->GetPdgCode();
747 if(TMath::Abs(pdgdau)==321){
748 if(pdgD>0 && pdgdau>0)
return -1;
749 if(pdgD<0 && pdgdau<0)
return -1;
754 arrayDauLab[nFoundKpi++]=indDau;
755 if(nFoundKpi>4)
return -1;
756 }
else if(TMath::Abs(pdgdau)==211){
761 arrayDauLab[nFoundKpi++]=indDau;
762 if(nFoundKpi>4)
return -1;
763 }
else if(TMath::Abs(pdgdau)==113 || TMath::Abs(pdgdau)==313){
764 Int_t nResDau=dau->GetNDaughters();
765 if(nResDau!=2)
return -1;
766 Int_t indFirstResDau=dau->GetDaughter(0);
767 for(
Int_t resDau=0; resDau<2; resDau++){
768 Int_t indResDau=indFirstResDau+resDau;
769 if(indResDau<0)
return -1;
770 TParticle* resdau=mcEvent->Particle(indResDau);
771 if(!resdau)
return -1;
772 Int_t pdgresdau=resdau->GetPdgCode();
773 if(TMath::Abs(pdgresdau)==321){
774 if(pdgD>0 && pdgresdau>0)
return -1;
775 if(pdgD<0 && pdgresdau<0)
return -1;
777 sumPxDau+=resdau->Px();
778 sumPyDau+=resdau->Py();
779 sumPzDau+=resdau->Pz();
780 arrayDauLab[nFoundKpi++]=indResDau;
781 if(nFoundKpi>4)
return -1;
783 if(TMath::Abs(pdgresdau)==211){
785 sumPxDau+=resdau->Px();
786 sumPyDau+=resdau->Py();
787 sumPzDau+=resdau->Pz();
788 arrayDauLab[nFoundKpi++]=indResDau;
789 if(nFoundKpi>4)
return -1;
796 if(nPions!=3)
return -1;
797 if(nKaons!=1)
return -1;
798 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -1;
799 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -1;
800 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -1;
810 Int_t pdgD=mcPart->GetPdgCode();
811 if(TMath::Abs(pdgD)!=421)
return -1;
813 Int_t nDau=mcPart->GetNDaughters();
816 Int_t daughter0 = mcPart->GetDaughter(0);
817 Int_t daughter1 = mcPart->GetDaughter(1);
818 AliAODMCParticle* mcPartDaughter0 =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(daughter0));
819 AliAODMCParticle* mcPartDaughter1 =
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(daughter1));
820 if(!mcPartDaughter0 || !mcPartDaughter1)
return -1;
821 arrayDauLab[0]=daughter0;
822 arrayDauLab[1]=daughter1;
823 Int_t pdgCode0=mcPartDaughter0->GetPdgCode();
824 Int_t pdgCode1=mcPartDaughter1->GetPdgCode();
825 if(!(TMath::Abs(pdgCode0)==321 && TMath::Abs(pdgCode1)==211) &&
826 !(TMath::Abs(pdgCode0)==211 && TMath::Abs(pdgCode1)==321)){
829 if(TMath::Abs(pdgCode0)==321 && (pdgD*pdgCode0)>0)
return -1;
830 if(TMath::Abs(pdgCode1)==321 && (pdgD*pdgCode1)>0)
return -1;
831 if((pdgCode0*pdgCode1)>0)
return -1;
832 Double_t sumPxDau=mcPartDaughter0->Px()+mcPartDaughter1->Px();
833 Double_t sumPyDau=mcPartDaughter0->Py()+mcPartDaughter1->Py();
834 Double_t sumPzDau=mcPartDaughter0->Pz()+mcPartDaughter1->Pz();
835 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -2;
836 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -2;
837 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -2;
841 if(nDau==3 || nDau==4){
848 Int_t labelFirstDau = mcPart->GetDaughter(0);
849 for(
Int_t iDau=0; iDau<nDau; iDau++){
850 Int_t indDau = labelFirstDau+iDau;
851 if(indDau<0)
return -1;
852 AliAODMCParticle* dau=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indDau));
854 Int_t pdgdau=dau->GetPdgCode();
855 if(TMath::Abs(pdgdau)==321){
856 if(pdgD>0 && pdgdau>0)
return -1;
857 if(pdgD<0 && pdgdau<0)
return -1;
862 arrayDauLab[nFoundKpi++]=indDau;
863 if(nFoundKpi>4)
return -1;
864 }
else if(TMath::Abs(pdgdau)==211){
869 arrayDauLab[nFoundKpi++]=indDau;
870 if(nFoundKpi>4)
return -1;
871 }
else if(TMath::Abs(pdgdau)==113 || TMath::Abs(pdgdau)==313){
872 Int_t nResDau=dau->GetNDaughters();
873 if(nResDau!=2)
return -1;
874 Int_t indFirstResDau=dau->GetDaughter(0);
875 for(
Int_t resDau=0; resDau<2; resDau++){
876 Int_t indResDau=indFirstResDau+resDau;
877 if(indResDau<0)
return -1;
878 AliAODMCParticle* resdau=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indResDau));
879 if(!resdau)
return -1;
880 Int_t pdgresdau=resdau->GetPdgCode();
881 if(TMath::Abs(pdgresdau)==321){
882 if(pdgD>0 && pdgresdau>0)
return -1;
883 if(pdgD<0 && pdgresdau<0)
return -1;
885 sumPxDau+=resdau->Px();
886 sumPyDau+=resdau->Py();
887 sumPzDau+=resdau->Pz();
888 arrayDauLab[nFoundKpi++]=indResDau;
889 if(nFoundKpi>4)
return -1;
891 if(TMath::Abs(pdgresdau)==211){
893 sumPxDau+=resdau->Px();
894 sumPyDau+=resdau->Py();
895 sumPzDau+=resdau->Pz();
896 arrayDauLab[nFoundKpi++]=indResDau;
897 if(nFoundKpi>4)
return -1;
904 if(nPions!=3)
return -1;
905 if(nKaons!=1)
return -1;
906 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -1;
907 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -1;
908 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -1;
917 if(label<0)
return -1;
918 TParticle* mcPart = mcEvent->Particle(label);
919 Int_t pdgD=mcPart->GetPdgCode();
920 if(TMath::Abs(pdgD)!=411)
return -1;
922 Int_t nDau=mcPart->GetNDaughters();
923 Int_t labelFirstDau = mcPart->GetDaughter(0);
931 if(nDau==3 || nDau==2){
932 for(
Int_t iDau=0; iDau<nDau; iDau++){
933 Int_t indDau = labelFirstDau+iDau;
934 if(indDau<0)
return -1;
935 TParticle* dau=mcEvent->Particle(indDau);
937 Int_t pdgdau=dau->GetPdgCode();
938 if(TMath::Abs(pdgdau)==321){
939 if(pdgD*pdgdau>0)
return -1;
944 arrayDauLab[nFoundKpi++]=indDau;
945 if(nFoundKpi>3)
return -1;
946 }
else if(TMath::Abs(pdgdau)==211){
947 if(pdgD*pdgdau<0)
return -1;
952 arrayDauLab[nFoundKpi++]=indDau;
953 if(nFoundKpi>3)
return -1;
954 }
else if(TMath::Abs(pdgdau)==313){
955 Int_t nResDau=dau->GetNDaughters();
956 if(nResDau!=2)
return -1;
957 Int_t indFirstResDau=dau->GetDaughter(0);
958 for(
Int_t resDau=0; resDau<2; resDau++){
959 Int_t indResDau=indFirstResDau+resDau;
960 if(indResDau<0)
return -1;
961 TParticle* resdau=mcEvent->Particle(indResDau);
962 if(!resdau)
return -1;
963 Int_t pdgresdau=resdau->GetPdgCode();
964 if(TMath::Abs(pdgresdau)==321){
965 if(pdgD*pdgresdau>0)
return -1;
966 sumPxDau+=resdau->Px();
967 sumPyDau+=resdau->Py();
968 sumPzDau+=resdau->Pz();
970 arrayDauLab[nFoundKpi++]=indResDau;
971 if(nFoundKpi>3)
return -1;
973 if(TMath::Abs(pdgresdau)==211){
974 if(pdgD*pdgresdau<0)
return -1;
975 sumPxDau+=resdau->Px();
976 sumPyDau+=resdau->Py();
977 sumPzDau+=resdau->Pz();
979 arrayDauLab[nFoundKpi++]=indResDau;
980 if(nFoundKpi>3)
return -1;
987 if(nPions!=2)
return -1;
988 if(nKaons!=1)
return -1;
989 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -2;
990 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -2;
991 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -2;
992 if(nDau==3)
return 1;
993 else if(nDau==2)
return 2;
1004 Int_t pdgD=mcPart->GetPdgCode();
1005 if(TMath::Abs(pdgD)!=411)
return -1;
1007 Int_t nDau=mcPart->GetNDaughters();
1008 Int_t labelFirstDau = mcPart->GetDaughter(0);
1016 if(nDau==3 || nDau==2){
1017 for(
Int_t iDau=0; iDau<nDau; iDau++){
1018 Int_t indDau = labelFirstDau+iDau;
1019 if(indDau<0)
return -1;
1020 AliAODMCParticle* dau=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indDau));
1022 Int_t pdgdau=dau->GetPdgCode();
1023 if(TMath::Abs(pdgdau)==321){
1024 if(pdgD*pdgdau>0)
return -1;
1026 sumPxDau+=dau->Px();
1027 sumPyDau+=dau->Py();
1028 sumPzDau+=dau->Pz();
1029 arrayDauLab[nFoundKpi++]=indDau;
1030 if(nFoundKpi>3)
return -1;
1031 }
else if(TMath::Abs(pdgdau)==211){
1032 if(pdgD*pdgdau<0)
return -1;
1034 sumPxDau+=dau->Px();
1035 sumPyDau+=dau->Py();
1036 sumPzDau+=dau->Pz();
1037 arrayDauLab[nFoundKpi++]=indDau;
1038 if(nFoundKpi>3)
return -1;
1039 }
else if(TMath::Abs(pdgdau)==313){
1040 Int_t nResDau=dau->GetNDaughters();
1041 if(nResDau!=2)
return -1;
1042 Int_t indFirstResDau=dau->GetDaughter(0);
1043 for(
Int_t resDau=0; resDau<2; resDau++){
1044 Int_t indResDau=indFirstResDau+resDau;
1045 if(indResDau<0)
return -1;
1046 AliAODMCParticle* resdau=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indResDau));
1047 if(!resdau)
return -1;
1048 Int_t pdgresdau=resdau->GetPdgCode();
1049 if(TMath::Abs(pdgresdau)==321){
1050 if(pdgD*pdgresdau>0)
return -1;
1051 sumPxDau+=resdau->Px();
1052 sumPyDau+=resdau->Py();
1053 sumPzDau+=resdau->Pz();
1055 arrayDauLab[nFoundKpi++]=indResDau;
1056 if(nFoundKpi>3)
return -1;
1058 if(TMath::Abs(pdgresdau)==211){
1059 if(pdgD*pdgresdau<0)
return -1;
1060 sumPxDau+=resdau->Px();
1061 sumPyDau+=resdau->Py();
1062 sumPzDau+=resdau->Pz();
1064 arrayDauLab[nFoundKpi++]=indResDau;
1065 if(nFoundKpi>3)
return -1;
1072 if(nPions!=2)
return -1;
1073 if(nKaons!=1)
return -1;
1074 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -2;
1075 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -2;
1076 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -2;
1077 if(nDau==3)
return 1;
1078 else if(nDau==2)
return 2;
1088 if(label<0)
return -1;
1089 TParticle* mcPart = mcEvent->Particle(label);
1090 Int_t pdgD=mcPart->GetPdgCode();
1091 if(TMath::Abs(pdgD)!=411)
return -1;
1093 Int_t nDau=mcPart->GetNDaughters();
1094 Int_t labelFirstDau = mcPart->GetDaughter(0);
1104 if(nDau==3 || nDau==2){
1105 for(
Int_t iDau=0; iDau<nDau; iDau++){
1106 Int_t indDau = labelFirstDau+iDau;
1107 if(indDau<0)
return -1;
1108 TParticle* dau=mcEvent->Particle(indDau);
1110 Int_t pdgdau=dau->GetPdgCode();
1111 if(TMath::Abs(pdgdau)==321){
1113 sumPxDau+=dau->Px();
1114 sumPyDau+=dau->Py();
1115 sumPzDau+=dau->Pz();
1116 arrayDauLab[nFoundKpi++]=indDau;
1117 if(nFoundKpi>3)
return -1;
1118 }
else if(TMath::Abs(pdgdau)==211){
1120 sumPxDau+=dau->Px();
1121 sumPyDau+=dau->Py();
1122 sumPzDau+=dau->Pz();
1123 arrayDauLab[nFoundKpi++]=indDau;
1124 if(nFoundKpi>3)
return -1;
1125 }
else if(TMath::Abs(pdgdau)==313 || TMath::Abs(pdgdau)==333){
1126 if(TMath::Abs(pdgdau)==313) isk0st=kTRUE;
1127 if(TMath::Abs(pdgdau)==333) isPhi=kTRUE;
1128 Int_t nResDau=dau->GetNDaughters();
1129 if(nResDau!=2)
return -1;
1130 Int_t indFirstResDau=dau->GetDaughter(0);
1131 for(
Int_t resDau=0; resDau<2; resDau++){
1132 Int_t indResDau=indFirstResDau+resDau;
1133 if(indResDau<0)
return -1;
1134 TParticle* resdau=mcEvent->Particle(indResDau);
1135 if(!resdau)
return -1;
1136 Int_t pdgresdau=resdau->GetPdgCode();
1137 if(TMath::Abs(pdgresdau)==321){
1138 sumPxDau+=resdau->Px();
1139 sumPyDau+=resdau->Py();
1140 sumPzDau+=resdau->Pz();
1142 arrayDauLab[nFoundKpi++]=indResDau;
1143 if(nFoundKpi>3)
return -1;
1145 if(TMath::Abs(pdgresdau)==211){
1146 sumPxDau+=resdau->Px();
1147 sumPyDau+=resdau->Py();
1148 sumPzDau+=resdau->Pz();
1150 arrayDauLab[nFoundKpi++]=indResDau;
1151 if(nFoundKpi>3)
return -1;
1158 if(nPions!=1)
return -1;
1159 if(nKaons!=2)
return -1;
1160 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -2;
1161 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -2;
1162 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -2;
1163 if(nDau==3)
return 3;
1165 if(isk0st)
return 2;
1177 Int_t pdgD=mcPart->GetPdgCode();
1178 if(TMath::Abs(pdgD)!=411)
return -1;
1180 Int_t nDau=mcPart->GetNDaughters();
1181 Int_t labelFirstDau = mcPart->GetDaughter(0);
1191 if(nDau==3 || nDau==2){
1192 for(
Int_t iDau=0; iDau<nDau; iDau++){
1193 Int_t indDau = labelFirstDau+iDau;
1194 if(indDau<0)
return -1;
1195 AliAODMCParticle* dau=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indDau));
1197 Int_t pdgdau=dau->GetPdgCode();
1198 if(TMath::Abs(pdgdau)==321){
1200 sumPxDau+=dau->Px();
1201 sumPyDau+=dau->Py();
1202 sumPzDau+=dau->Pz();
1203 arrayDauLab[nFoundKpi++]=indDau;
1204 if(nFoundKpi>3)
return -1;
1205 }
else if(TMath::Abs(pdgdau)==211){
1207 sumPxDau+=dau->Px();
1208 sumPyDau+=dau->Py();
1209 sumPzDau+=dau->Pz();
1210 arrayDauLab[nFoundKpi++]=indDau;
1211 if(nFoundKpi>3)
return -1;
1212 }
else if(TMath::Abs(pdgdau)==313 || TMath::Abs(pdgdau)==333){
1213 if(TMath::Abs(pdgdau)==313) isk0st=kTRUE;
1214 if(TMath::Abs(pdgdau)==333) isPhi=kTRUE;
1215 Int_t nResDau=dau->GetNDaughters();
1216 if(nResDau!=2)
return -1;
1217 Int_t indFirstResDau=dau->GetDaughter(0);
1218 for(
Int_t resDau=0; resDau<2; resDau++){
1219 Int_t indResDau=indFirstResDau+resDau;
1220 if(indResDau<0)
return -1;
1221 AliAODMCParticle* resdau=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indResDau));
1222 if(!resdau)
return -1;
1223 Int_t pdgresdau=resdau->GetPdgCode();
1224 if(TMath::Abs(pdgresdau)==321){
1225 sumPxDau+=resdau->Px();
1226 sumPyDau+=resdau->Py();
1227 sumPzDau+=resdau->Pz();
1229 arrayDauLab[nFoundKpi++]=indResDau;
1230 if(nFoundKpi>3)
return -1;
1232 if(TMath::Abs(pdgresdau)==211){
1233 sumPxDau+=resdau->Px();
1234 sumPyDau+=resdau->Py();
1235 sumPzDau+=resdau->Pz();
1237 arrayDauLab[nFoundKpi++]=indResDau;
1238 if(nFoundKpi>3)
return -1;
1245 if(nPions!=1)
return -1;
1246 if(nKaons!=2)
return -1;
1247 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -2;
1248 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -2;
1249 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -2;
1250 if(nDau==3)
return 3;
1252 if(isk0st)
return 2;
1264 if(label<0)
return -1;
1265 TParticle* mcPart = mcEvent->Particle(label);
1266 Int_t pdgD=mcPart->GetPdgCode();
1267 if(TMath::Abs(pdgD)!=411)
return -1;
1269 Int_t nDau=mcPart->GetNDaughters();
1270 Int_t labelFirstDau = mcPart->GetDaughter(0);
1279 for(
Int_t iDau=0; iDau<nDau; iDau++){
1280 Int_t indDau = labelFirstDau+iDau;
1281 if(indDau<0)
return -1;
1282 TParticle* dau=mcEvent->Particle(indDau);
1284 Int_t pdgdau=dau->GetPdgCode();
1285 if(TMath::Abs(pdgdau)==211){
1287 sumPxDau+=dau->Px();
1288 sumPyDau+=dau->Py();
1289 sumPzDau+=dau->Pz();
1290 arrayDauLab[nFoundpi++]=indDau;
1291 if(nFoundpi>3)
return -1;
1292 }
else if(TMath::Abs(pdgdau)==311){
1293 codeV0=TMath::Abs(pdgdau);
1296 Int_t nK0Dau=dau->GetNDaughters();
1297 if(nK0Dau!=1)
return -1;
1298 Int_t indK0s=dau->GetDaughter(0);
1299 if(indK0s<0)
return -1;
1300 v0=mcEvent->Particle(indK0s);
1302 Int_t pdgK0sl=v0->GetPdgCode();
1303 codeV0=TMath::Abs(pdgK0sl);
1305 Int_t nV0Dau=v0->GetNDaughters();
1306 if(nV0Dau!=2)
return -1;
1307 Int_t indFirstV0Dau=v0->GetDaughter(0);
1308 for(
Int_t v0Dau=0; v0Dau<2; v0Dau++){
1309 Int_t indV0Dau=indFirstV0Dau+v0Dau;
1310 if(indV0Dau<0)
return -1;
1311 TParticle* v0dau=mcEvent->Particle(indV0Dau);
1312 if(!v0dau)
return -1;
1313 Int_t pdgv0dau=v0dau->GetPdgCode();
1314 if(TMath::Abs(pdgv0dau)==211){
1315 sumPxDau+=v0dau->Px();
1316 sumPyDau+=v0dau->Py();
1317 sumPzDau+=v0dau->Pz();
1319 arrayDauLab[nFoundpi++]=indV0Dau;
1320 if(nFoundpi>3)
return -1;
1327 if(nPions!=3)
return -1;
1328 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -2;
1329 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -2;
1330 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -2;
1331 if(codeV0==310)
return 1;
1342 if(label<0)
return -1;
1343 TParticle* mcPart = mcEvent->Particle(label);
1344 Int_t pdgD=mcPart->GetPdgCode();
1345 if(TMath::Abs(pdgD)!=431)
return -1;
1347 Int_t nDau=mcPart->GetNDaughters();
1348 Int_t labelFirstDau = mcPart->GetDaughter(0);
1359 if(nDau==3 || nDau==2){
1360 for(
Int_t iDau=0; iDau<nDau; iDau++){
1361 Int_t indDau = labelFirstDau+iDau;
1362 if(indDau<0)
return -1;
1363 TParticle* dau=mcEvent->Particle(indDau);
1365 Int_t pdgdau=dau->GetPdgCode();
1366 if(TMath::Abs(pdgdau)==321){
1368 sumPxDau+=dau->Px();
1369 sumPyDau+=dau->Py();
1370 sumPzDau+=dau->Pz();
1371 arrayDauLab[nFoundKpi++]=indDau;
1372 if(nFoundKpi>3)
return -1;
1373 }
else if(TMath::Abs(pdgdau)==211){
1375 sumPxDau+=dau->Px();
1376 sumPyDau+=dau->Py();
1377 sumPzDau+=dau->Pz();
1378 arrayDauLab[nFoundKpi++]=indDau;
1379 if(nFoundKpi>3)
return -1;
1380 }
else if(TMath::Abs(pdgdau)==313 || TMath::Abs(pdgdau)==333){
1381 if(TMath::Abs(pdgdau)==313) isk0st=kTRUE;
1382 if(TMath::Abs(pdgdau)==333) isPhi=kTRUE;
1383 if(TMath::Abs(pdgdau)==9010221) isf0=kTRUE;
1384 Int_t nResDau=dau->GetNDaughters();
1385 if(nResDau!=2)
return -1;
1386 Int_t indFirstResDau=dau->GetDaughter(0);
1387 for(
Int_t resDau=0; resDau<2; resDau++){
1388 Int_t indResDau=indFirstResDau+resDau;
1389 if(indResDau<0)
return -1;
1390 TParticle* resdau=mcEvent->Particle(indResDau);
1391 if(!resdau)
return -1;
1392 Int_t pdgresdau=resdau->GetPdgCode();
1393 if(TMath::Abs(pdgresdau)==321){
1394 sumPxDau+=resdau->Px();
1395 sumPyDau+=resdau->Py();
1396 sumPzDau+=resdau->Pz();
1398 arrayDauLab[nFoundKpi++]=indResDau;
1399 if(nFoundKpi>3)
return -1;
1401 if(TMath::Abs(pdgresdau)==211){
1402 sumPxDau+=resdau->Px();
1403 sumPyDau+=resdau->Py();
1404 sumPzDau+=resdau->Pz();
1406 arrayDauLab[nFoundKpi++]=indResDau;
1407 if(nFoundKpi>3)
return -1;
1414 if(nPions!=1)
return -1;
1415 if(nKaons!=2)
return -1;
1416 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -2;
1417 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -2;
1418 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -2;
1419 if(nDau==3)
return 3;
1421 if(isk0st)
return 2;
1434 if(label<0)
return -1;
1435 TParticle* mcPart = mcEvent->Particle(label);
1436 Int_t pdgD=mcPart->GetPdgCode();
1437 if(TMath::Abs(pdgD)!=431)
return -1;
1439 Int_t nDau=mcPart->GetNDaughters();
1440 Int_t labelFirstDau = mcPart->GetDaughter(0);
1450 for(
Int_t iDau=0; iDau<nDau; iDau++){
1451 Int_t indDau = labelFirstDau+iDau;
1452 if(indDau<0)
return -1;
1453 TParticle* dau=mcEvent->Particle(indDau);
1455 Int_t pdgdau=dau->GetPdgCode();
1456 if(TMath::Abs(pdgdau)==211){
1458 sumPxDau+=dau->Px();
1459 sumPyDau+=dau->Py();
1460 sumPzDau+=dau->Pz();
1461 arrayDauLab[nFoundKpi++]=indDau;
1462 if(nFoundKpi>3)
return -1;
1463 }
else if(TMath::Abs(pdgdau)==321){
1465 sumPxDau+=dau->Px();
1466 sumPyDau+=dau->Py();
1467 sumPzDau+=dau->Pz();
1468 arrayDauLab[nFoundKpi++]=indDau;
1469 if(nFoundKpi>3)
return -1;
1470 }
else if(TMath::Abs(pdgdau)==311){
1471 codeV0=TMath::Abs(pdgdau);
1474 Int_t nK0Dau=dau->GetNDaughters();
1475 if(nK0Dau!=1)
return -1;
1476 Int_t indK0s=dau->GetDaughter(0);
1477 if(indK0s<0)
return -1;
1478 v0=mcEvent->Particle(indK0s);
1480 Int_t pdgK0sl=v0->GetPdgCode();
1481 codeV0=TMath::Abs(pdgK0sl);
1483 Int_t nV0Dau=v0->GetNDaughters();
1484 if(nV0Dau!=2)
return -1;
1485 Int_t indFirstV0Dau=v0->GetDaughter(0);
1486 for(
Int_t v0Dau=0; v0Dau<2; v0Dau++){
1487 Int_t indV0Dau=indFirstV0Dau+v0Dau;
1488 if(indV0Dau<0)
return -1;
1489 TParticle* v0dau=mcEvent->Particle(indV0Dau);
1490 if(!v0dau)
return -1;
1491 Int_t pdgv0dau=v0dau->GetPdgCode();
1492 if(TMath::Abs(pdgv0dau)==211){
1493 sumPxDau+=v0dau->Px();
1494 sumPyDau+=v0dau->Py();
1495 sumPzDau+=v0dau->Pz();
1497 arrayDauLab[nFoundKpi++]=indV0Dau;
1498 if(nFoundKpi>3)
return -1;
1505 if(nPions!=2)
return -1;
1506 if(nKaons!=1)
return -1;
1507 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -2;
1508 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -2;
1509 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -2;
1510 if(codeV0==310)
return 1;
1521 Int_t pdgD=mcPart->GetPdgCode();
1522 if(TMath::Abs(pdgD)!=431)
return -1;
1524 Int_t nDau=mcPart->GetNDaughters();
1525 Int_t labelFirstDau = mcPart->GetDaughter(0);
1536 if(nDau==3 || nDau==2){
1537 for(
Int_t iDau=0; iDau<nDau; iDau++){
1538 Int_t indDau = labelFirstDau+iDau;
1539 if(indDau<0)
return -1;
1540 AliAODMCParticle* dau=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indDau));
1542 Int_t pdgdau=dau->GetPdgCode();
1543 if(TMath::Abs(pdgdau)==321){
1545 sumPxDau+=dau->Px();
1546 sumPyDau+=dau->Py();
1547 sumPzDau+=dau->Pz();
1548 arrayDauLab[nFoundKpi++]=indDau;
1549 if(nFoundKpi>3)
return -1;
1550 }
else if(TMath::Abs(pdgdau)==211){
1552 sumPxDau+=dau->Px();
1553 sumPyDau+=dau->Py();
1554 sumPzDau+=dau->Pz();
1555 arrayDauLab[nFoundKpi++]=indDau;
1556 if(nFoundKpi>3)
return -1;
1557 }
else if(TMath::Abs(pdgdau)==313 || TMath::Abs(pdgdau)==333){
1558 if(TMath::Abs(pdgdau)==313) isk0st=kTRUE;
1559 if(TMath::Abs(pdgdau)==333) isPhi=kTRUE;
1560 if(TMath::Abs(pdgdau)==9010221) isf0=kTRUE;
1561 Int_t nResDau=dau->GetNDaughters();
1562 if(nResDau!=2)
return -1;
1563 Int_t indFirstResDau=dau->GetDaughter(0);
1564 for(
Int_t resDau=0; resDau<2; resDau++){
1565 Int_t indResDau=indFirstResDau+resDau;
1566 if(indResDau<0)
return -1;
1567 AliAODMCParticle* resdau=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indResDau));
1568 if(!resdau)
return -1;
1569 Int_t pdgresdau=resdau->GetPdgCode();
1570 if(TMath::Abs(pdgresdau)==321){
1571 sumPxDau+=resdau->Px();
1572 sumPyDau+=resdau->Py();
1573 sumPzDau+=resdau->Pz();
1575 arrayDauLab[nFoundKpi++]=indResDau;
1576 if(nFoundKpi>3)
return -1;
1578 if(TMath::Abs(pdgresdau)==211){
1579 sumPxDau+=resdau->Px();
1580 sumPyDau+=resdau->Py();
1581 sumPzDau+=resdau->Pz();
1583 arrayDauLab[nFoundKpi++]=indResDau;
1584 if(nFoundKpi>3)
return -1;
1591 if(nPions!=1)
return -1;
1592 if(nKaons!=2)
return -1;
1593 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -2;
1594 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -2;
1595 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -2;
1596 if(nDau==3)
return 3;
1598 if(isk0st)
return 2;
1611 if(label<0)
return -1;
1612 TParticle* mcPart = mcEvent->Particle(label);
1613 Int_t pdgD=mcPart->GetPdgCode();
1614 if(TMath::Abs(pdgD)!=413)
return -1;
1616 Int_t nDau=mcPart->GetNDaughters();
1617 if(nDau!=2)
return -1;
1619 Int_t labelFirstDau = mcPart->GetDaughter(0);
1627 for(
Int_t iDau=0; iDau<nDau; iDau++){
1628 Int_t indDau = labelFirstDau+iDau;
1629 if(indDau<0)
return -1;
1630 TParticle* dau=mcEvent->Particle(indDau);
1632 Int_t pdgdau=dau->GetPdgCode();
1633 if(TMath::Abs(pdgdau)==421){
1634 Int_t nResDau=dau->GetNDaughters();
1635 if(nResDau!=2)
return -1;
1636 Int_t indFirstResDau=dau->GetDaughter(0);
1637 for(
Int_t resDau=0; resDau<2; resDau++){
1638 Int_t indResDau=indFirstResDau+resDau;
1639 if(indResDau<0)
return -1;
1640 TParticle* resdau=mcEvent->Particle(indResDau);
1641 if(!resdau)
return -1;
1642 Int_t pdgresdau=resdau->GetPdgCode();
1643 if(TMath::Abs(pdgresdau)==321){
1644 if(pdgD*pdgresdau>0)
return -1;
1645 sumPxDau+=resdau->Px();
1646 sumPyDau+=resdau->Py();
1647 sumPzDau+=resdau->Pz();
1649 arrayDauLab[nFoundKpi++]=indResDau;
1650 if(nFoundKpi>3)
return -1;
1652 if(TMath::Abs(pdgresdau)==211){
1653 if(pdgD*pdgresdau<0)
return -1;
1654 sumPxDau+=resdau->Px();
1655 sumPyDau+=resdau->Py();
1656 sumPzDau+=resdau->Pz();
1658 arrayDauLab[nFoundKpi++]=indResDau;
1659 if(nFoundKpi>3)
return -1;
1662 }
else if(TMath::Abs(pdgdau)==211){
1663 if(pdgD*pdgdau<0)
return -1;
1665 sumPxDau+=dau->Px();
1666 sumPyDau+=dau->Py();
1667 sumPzDau+=dau->Pz();
1668 arrayDauLab[nFoundKpi++]=indDau;
1669 if(nFoundKpi>3)
return -1;
1673 if(nPions!=2)
return -1;
1674 if(nKaons!=1)
return -1;
1675 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -2;
1676 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -2;
1677 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -2;
1686 Int_t pdgD=mcPart->GetPdgCode();
1687 if(TMath::Abs(pdgD)!=413)
return -1;
1689 Int_t nDau=mcPart->GetNDaughters();
1690 if(nDau!=2)
return -1;
1692 Int_t labelFirstDau = mcPart->GetDaughter(0);
1700 for(
Int_t iDau=0; iDau<nDau; iDau++){
1701 Int_t indDau = labelFirstDau+iDau;
1702 if(indDau<0)
return -1;
1703 AliAODMCParticle* dau=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indDau));
1705 Int_t pdgdau=dau->GetPdgCode();
1706 if(TMath::Abs(pdgdau)==421){
1707 Int_t nResDau=dau->GetNDaughters();
1708 if(nResDau!=2)
return -1;
1709 Int_t indFirstResDau=dau->GetDaughter(0);
1710 for(
Int_t resDau=0; resDau<2; resDau++){
1711 Int_t indResDau=indFirstResDau+resDau;
1712 if(indResDau<0)
return -1;
1713 AliAODMCParticle* resdau=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indResDau));
1714 if(!resdau)
return -1;
1715 Int_t pdgresdau=resdau->GetPdgCode();
1716 if(TMath::Abs(pdgresdau)==321){
1717 if(pdgD*pdgresdau>0)
return -1;
1718 sumPxDau+=resdau->Px();
1719 sumPyDau+=resdau->Py();
1720 sumPzDau+=resdau->Pz();
1722 arrayDauLab[nFoundKpi++]=indResDau;
1723 if(nFoundKpi>3)
return -1;
1725 if(TMath::Abs(pdgresdau)==211){
1726 if(pdgD*pdgresdau<0)
return -1;
1727 sumPxDau+=resdau->Px();
1728 sumPyDau+=resdau->Py();
1729 sumPzDau+=resdau->Pz();
1731 arrayDauLab[nFoundKpi++]=indResDau;
1732 if(nFoundKpi>3)
return -1;
1735 }
else if(TMath::Abs(pdgdau)==211){
1736 if(pdgD*pdgdau<0)
return -1;
1738 sumPxDau+=dau->Px();
1739 sumPyDau+=dau->Py();
1740 sumPzDau+=dau->Pz();
1741 arrayDauLab[nFoundKpi++]=indDau;
1742 if(nFoundKpi>3)
return -1;
1746 if(nPions!=2)
return -1;
1747 if(nKaons!=1)
return -1;
1748 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -2;
1749 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -2;
1750 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -2;
1759 if(label<0)
return -1;
1760 TParticle* mcPart = mcEvent->Particle(label);
1761 Int_t pdgD=mcPart->GetPdgCode();
1762 if(TMath::Abs(pdgD)!=4122)
return -1;
1764 Int_t nDau=mcPart->GetNDaughters();
1765 Int_t labelFirstDau = mcPart->GetDaughter(0);
1775 if(nDau==3 || nDau==2){
1776 for(
Int_t iDau=0; iDau<nDau; iDau++){
1777 Int_t indDau = labelFirstDau+iDau;
1778 if(indDau<0)
return -1;
1779 TParticle* dau=mcEvent->Particle(indDau);
1781 Int_t pdgdau=dau->GetPdgCode();
1782 if(TMath::Abs(pdgdau)==321){
1784 sumPxDau+=dau->Px();
1785 sumPyDau+=dau->Py();
1786 sumPzDau+=dau->Pz();
1787 arrayDauLab[nFoundpKpi++]=indDau;
1788 if(nFoundpKpi>3)
return -1;
1789 }
else if(TMath::Abs(pdgdau)==211){
1791 sumPxDau+=dau->Px();
1792 sumPyDau+=dau->Py();
1793 sumPzDau+=dau->Pz();
1794 arrayDauLab[nFoundpKpi++]=indDau;
1795 if(nFoundpKpi>3)
return -1;
1796 }
else if(TMath::Abs(pdgdau)==2212){
1798 sumPxDau+=dau->Px();
1799 sumPyDau+=dau->Py();
1800 sumPzDau+=dau->Pz();
1801 arrayDauLab[nFoundpKpi++]=indDau;
1802 if(nFoundpKpi>3)
return -1;
1803 }
else if(TMath::Abs(pdgdau)==313 || TMath::Abs(pdgdau)==3124 ||
1804 TMath::Abs(pdgdau)==2224){
1805 codeRes=TMath::Abs(pdgdau);
1806 Int_t nResDau=dau->GetNDaughters();
1807 if(nResDau!=2)
return -1;
1808 Int_t indFirstResDau=dau->GetDaughter(0);
1809 for(
Int_t resDau=0; resDau<2; resDau++){
1810 Int_t indResDau=indFirstResDau+resDau;
1811 if(indResDau<0)
return -1;
1812 TParticle* resdau=mcEvent->Particle(indResDau);
1813 if(!resdau)
return -1;
1814 Int_t pdgresdau=resdau->GetPdgCode();
1815 if(TMath::Abs(pdgresdau)==321){
1816 sumPxDau+=resdau->Px();
1817 sumPyDau+=resdau->Py();
1818 sumPzDau+=resdau->Pz();
1820 arrayDauLab[nFoundpKpi++]=indResDau;
1821 if(nFoundpKpi>3)
return -1;
1822 }
else if(TMath::Abs(pdgresdau)==211){
1823 sumPxDau+=resdau->Px();
1824 sumPyDau+=resdau->Py();
1825 sumPzDau+=resdau->Pz();
1827 arrayDauLab[nFoundpKpi++]=indResDau;
1828 if(nFoundpKpi>3)
return -1;
1829 }
else if(TMath::Abs(pdgresdau)==2212){
1830 sumPxDau+=resdau->Px();
1831 sumPyDau+=resdau->Py();
1832 sumPzDau+=resdau->Pz();
1834 arrayDauLab[nFoundpKpi++]=indResDau;
1835 if(nFoundpKpi>3)
return -1;
1842 if(nPions!=1)
return -1;
1843 if(nKaons!=1)
return -1;
1844 if(nProtons!=1)
return -1;
1845 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -2;
1846 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -2;
1847 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -2;
1848 if(nDau==3)
return 1;
1850 if(codeRes==313)
return 2;
1851 else if(codeRes==2224)
return 3;
1852 else if(codeRes==3124)
return 4;
1863 Int_t pdgD=mcPart->GetPdgCode();
1864 if(TMath::Abs(pdgD)!=4122)
return -1;
1866 Int_t nDau=mcPart->GetNDaughters();
1867 Int_t labelFirstDau = mcPart->GetDaughter(0);
1877 if(nDau==3 || nDau==2){
1878 for(
Int_t iDau=0; iDau<nDau; iDau++){
1879 Int_t indDau = labelFirstDau+iDau;
1880 if(indDau<0)
return -1;
1881 AliAODMCParticle* dau=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indDau));
1883 Int_t pdgdau=dau->GetPdgCode();
1884 if(TMath::Abs(pdgdau)==321){
1886 sumPxDau+=dau->Px();
1887 sumPyDau+=dau->Py();
1888 sumPzDau+=dau->Pz();
1889 arrayDauLab[nFoundpKpi++]=indDau;
1890 if(nFoundpKpi>3)
return -1;
1891 }
else if(TMath::Abs(pdgdau)==211){
1893 sumPxDau+=dau->Px();
1894 sumPyDau+=dau->Py();
1895 sumPzDau+=dau->Pz();
1896 arrayDauLab[nFoundpKpi++]=indDau;
1897 if(nFoundpKpi>3)
return -1;
1898 }
else if(TMath::Abs(pdgdau)==2212){
1900 sumPxDau+=dau->Px();
1901 sumPyDau+=dau->Py();
1902 sumPzDau+=dau->Pz();
1903 arrayDauLab[nFoundpKpi++]=indDau;
1904 if(nFoundpKpi>3)
return -1;
1905 }
else if(TMath::Abs(pdgdau)==313 || TMath::Abs(pdgdau)==3124 ||
1906 TMath::Abs(pdgdau)==2224){
1907 codeRes=TMath::Abs(pdgdau);
1908 Int_t nResDau=dau->GetNDaughters();
1909 if(nResDau!=2)
return -1;
1910 Int_t indFirstResDau=dau->GetDaughter(0);
1911 for(
Int_t resDau=0; resDau<2; resDau++){
1912 Int_t indResDau=indFirstResDau+resDau;
1913 if(indResDau<0)
return -1;
1914 AliAODMCParticle* resdau=
dynamic_cast<AliAODMCParticle*
>(arrayMC->At(indResDau));
1915 if(!resdau)
return -1;
1916 Int_t pdgresdau=resdau->GetPdgCode();
1917 if(TMath::Abs(pdgresdau)==321){
1918 sumPxDau+=resdau->Px();
1919 sumPyDau+=resdau->Py();
1920 sumPzDau+=resdau->Pz();
1922 arrayDauLab[nFoundpKpi++]=indResDau;
1923 if(nFoundpKpi>3)
return -1;
1924 }
else if(TMath::Abs(pdgresdau)==211){
1925 sumPxDau+=resdau->Px();
1926 sumPyDau+=resdau->Py();
1927 sumPzDau+=resdau->Pz();
1929 arrayDauLab[nFoundpKpi++]=indResDau;
1930 if(nFoundpKpi>3)
return -1;
1931 }
else if(TMath::Abs(pdgresdau)==2212){
1932 sumPxDau+=resdau->Px();
1933 sumPyDau+=resdau->Py();
1934 sumPzDau+=resdau->Pz();
1936 arrayDauLab[nFoundpKpi++]=indResDau;
1937 if(nFoundpKpi>3)
return -1;
1944 if(nPions!=1)
return -1;
1945 if(nKaons!=1)
return -1;
1946 if(nProtons!=1)
return -1;
1947 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -2;
1948 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -2;
1949 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -2;
1950 if(nDau==3)
return 1;
1952 if(codeRes==313)
return 2;
1953 else if(codeRes==2224)
return 3;
1954 else if(codeRes==3124)
return 4;
1964 if(label<0)
return -1;
1965 TParticle* mcPart = mcEvent->Particle(label);
1966 Int_t pdgD=mcPart->GetPdgCode();
1967 if(TMath::Abs(pdgD)!=4122)
return -1;
1969 Int_t nDau=mcPart->GetNDaughters();
1970 Int_t labelFirstDau = mcPart->GetDaughter(0);
1980 for(
Int_t iDau=0; iDau<nDau; iDau++){
1981 Int_t indDau = labelFirstDau+iDau;
1982 if(indDau<0)
return -1;
1983 TParticle* dau=mcEvent->Particle(indDau);
1985 Int_t pdgdau=dau->GetPdgCode();
1986 if(TMath::Abs(pdgdau)==211){
1988 sumPxDau+=dau->Px();
1989 sumPyDau+=dau->Py();
1990 sumPzDau+=dau->Pz();
1991 arrayDauLab[nFoundppi++]=indDau;
1992 if(nFoundppi>3)
return -1;
1993 }
else if(TMath::Abs(pdgdau)==2212){
1995 sumPxDau+=dau->Px();
1996 sumPyDau+=dau->Py();
1997 sumPzDau+=dau->Pz();
1998 arrayDauLab[nFoundppi++]=indDau;
1999 if(nFoundppi>3)
return -1;
2000 }
else if(TMath::Abs(pdgdau)==311 || TMath::Abs(pdgdau)==3122){
2001 codeV0=TMath::Abs(pdgdau);
2004 Int_t nK0Dau=dau->GetNDaughters();
2005 if(nK0Dau!=1)
return -1;
2006 Int_t indK0s=dau->GetDaughter(0);
2007 if(indK0s<0)
return -1;
2008 v0=mcEvent->Particle(indK0s);
2010 Int_t pdgK0sl=v0->GetPdgCode();
2011 codeV0=TMath::Abs(pdgK0sl);
2013 Int_t nV0Dau=v0->GetNDaughters();
2014 if(nV0Dau!=2)
return -1;
2015 Int_t indFirstV0Dau=v0->GetDaughter(0);
2016 for(
Int_t v0Dau=0; v0Dau<2; v0Dau++){
2017 Int_t indV0Dau=indFirstV0Dau+v0Dau;
2018 if(indV0Dau<0)
return -1;
2019 TParticle* v0dau=mcEvent->Particle(indV0Dau);
2020 if(!v0dau)
return -1;
2021 Int_t pdgv0dau=v0dau->GetPdgCode();
2022 if(TMath::Abs(pdgv0dau)==211){
2023 sumPxDau+=v0dau->Px();
2024 sumPyDau+=v0dau->Py();
2025 sumPzDau+=v0dau->Pz();
2027 arrayDauLab[nFoundppi++]=indV0Dau;
2028 if(nFoundppi>3)
return -1;
2029 }
else if(TMath::Abs(pdgv0dau)==2212){
2030 sumPxDau+=v0dau->Px();
2031 sumPyDau+=v0dau->Py();
2032 sumPzDau+=v0dau->Pz();
2034 arrayDauLab[nFoundppi++]=indV0Dau;
2035 if(nFoundppi>3)
return -1;
2042 if(nPions!=2)
return -1;
2043 if(nProtons!=1)
return -1;
2044 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -2;
2045 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -2;
2046 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -2;
2047 if(codeV0==310)
return 1;
2048 else if(codeV0==3122)
return 2;
2059 if(label<0)
return -1;
2060 TParticle* mcPart = mcEvent->Particle(label);
2061 Int_t pdgD=mcPart->GetPdgCode();
2062 if(TMath::Abs(pdgD)!=4232)
return -1;
2064 Int_t nDau=mcPart->GetNDaughters();
2065 if(nDau!=3)
return -1;
2067 Int_t labelFirstDau = mcPart->GetDaughter(0);
2075 for(
Int_t iDau=0; iDau<nDau; iDau++){
2076 Int_t indDau = labelFirstDau+iDau;
2077 if(indDau<0)
return -1;
2078 TParticle* dau=mcEvent->Particle(indDau);
2080 Int_t pdgdau=dau->GetPdgCode();
2081 if(TMath::Abs(pdgdau)==3312){
2082 if(pdgD*pdgdau<0)
return -1;
2083 sumPxDau+=dau->Px();
2084 sumPyDau+=dau->Py();
2085 sumPzDau+=dau->Pz();
2087 arrayDauLab[nFoundXi++]=indDau;
2090 if(TMath::Abs(pdgdau)==211){
2091 if(pdgD*pdgdau<0)
return -1;
2093 sumPxDau+=dau->Px();
2094 sumPyDau+=dau->Py();
2095 sumPzDau+=dau->Pz();
2096 arrayDauLab[nFoundXi++]=indDau;
2097 if(nFoundXi>3)
return -1;
2101 if(nPions!=2)
return -1;
2102 if(nXi!=1)
return -1;
2103 if(TMath::Abs(mcPart->Px()-sumPxDau)>0.001)
return -2;
2104 if(TMath::Abs(mcPart->Py()-sumPyDau)>0.001)
return -2;
2105 if(TMath::Abs(mcPart->Pz()-sumPzDau)>0.001)
return -2;
2117 Int_t nTracks=aod->GetNumberOfTracks();
2124 if(ptMin<0.) ptMin=0.;
2126 for(
Int_t it=0; it<nTracks; it++) {
2127 AliAODTrack *tr=
dynamic_cast<AliAODTrack*
>(aod->GetTrack(it));
2132 if(eta<etaMin || eta>etaMax)
continue;
2133 if(pt<ptMin || pt>ptMax)
continue;
2134 Bool_t fb1 = tr->TestFilterBit(filtbit1);
2135 Bool_t fb2 = tr->TestFilterBit(filtbit2);
2136 Bool_t tpcRefit=tr->GetStatus() & AliAODTrack::kTPCrefit;
2137 if(filtbit1==1 && !tpcRefit) fb1=kFALSE;
2138 if(filtbit2==1 && !tpcRefit) fb2=kFALSE;
2139 if( !(fb1 || fb2) )
continue;
2142 s00 += (px * px)/pt;
2143 s01 += (py * px)/pt;
2144 s11 += (py * py)/pt;
2149 if(nSelTracks<minMult)
return -0.5;
2158 Double_t lambda1=((s00+s11)+TMath::Sqrt((s00+s11)*(s00+s11)-4*(s00*s11-s01*s01)))/2.;
2159 Double_t lambda2=((s00+s11)-TMath::Sqrt((s00+s11)*(s00+s11)-4*(s00*s11-s01*s01)))/2.;
2160 if(TMath::Abs(lambda2)<0.00001 && TMath::Abs(lambda1)<0.00001) sphericity=0;
2161 if(TMath::Abs(lambda1+lambda2)>0.000001) sphericity=2*TMath::Min(lambda1,lambda2)/(lambda1+lambda2);
2177 Int_t nTracks=aod->GetNumberOfTracks();
2184 for(
Int_t it=0; it<nTracks; it++) {
2185 AliAODTrack *tr=
dynamic_cast<AliAODTrack*
>(aod->GetTrack(it));
2190 if(eta<etaMin || eta>etaMax)
continue;
2191 if(pt<ptMin || pt>ptMax)
continue;
2192 if(nTrksToSkip>0 && idToSkip){
2195 for(
Int_t jt=0; jt<nTrksToSkip; jt++){
2196 if(trid==idToSkip[jt]) keep=kFALSE;
2200 Bool_t fb1 = tr->TestFilterBit(filtbit1);
2201 Bool_t fb2 = tr->TestFilterBit(filtbit2);
2202 Bool_t tpcRefit=tr->GetStatus() & AliAODTrack::kTPCrefit;
2203 if(filtbit1==1 && !tpcRefit) fb1=kFALSE;
2204 if(filtbit2==1 && !tpcRefit) fb2=kFALSE;
2205 if( !(fb1 || fb2) )
continue;
2206 ptArr[nSelTracks]=pt;
2207 phiArr[nSelTracks]=phi;
2212 if(nSelTracks<minMult){spherocity = -0.5;
return;}
2216 for(
Int_t i=0; i<360/phiStepSizeDeg; ++i){
2221 for(
Int_t j=0; j<nSelTracks; ++j){
2222 Double_t pxA=ptArr[j]*TMath::Cos(phiArr[j]);
2223 Double_t pyA=ptArr[j]*TMath::Sin(phiArr[j]);
2224 numer+=TMath::Abs(ny*pxA - nx*pyA);
2226 Double_t pFull=numer*numer/(sumpt*sumpt);
2227 if(pFull<spherocity){
2236 spherocity*=(TMath::Pi()*TMath::Pi()/4.);
2249 Int_t nParticles=arrayMC->GetEntriesFast();
2250 Int_t nSelParticles=0;
2256 for(
Int_t ip=0; ip<nParticles; ip++) {
2257 AliAODMCParticle *
part=(AliAODMCParticle*)arrayMC->UncheckedAt(ip);
2263 Bool_t isPhysPrim = part->IsPhysicalPrimary();
2264 if(!isPhysPrim)
continue;
2265 if(charge==0)
continue;
2266 if(eta<etaMin || eta>etaMax)
continue;
2267 if(pt<ptMin || pt>ptMax)
continue;
2269 ptArr[nSelParticles]=pt;
2270 phiArr[nSelParticles]=phi;
2275 if(nSelParticles<minMult){spherocity = -0.5;
return;}
2279 for(
Int_t i=0; i<360/phiStepSizeDeg; ++i){
2284 for(
Int_t j=0; j<nSelParticles; ++j){
2285 Double_t pxA=ptArr[j]*TMath::Cos(phiArr[j]);
2286 Double_t pyA=ptArr[j]*TMath::Sin(phiArr[j]);
2287 numer+=TMath::Abs(ny*pxA - nx*pyA);
2289 Double_t pFull=numer*numer/(sumpt*sumpt);
2290 if(pFull<spherocity){
2299 spherocity*=(TMath::Pi()*TMath::Pi()/4.);
2312 Int_t nBinOrig=hOrig->GetNbinsX();
2313 Int_t firstBinOrig=1;
2314 Int_t lastBinOrig=nBinOrig;
2315 Int_t nBinOrigUsed=nBinOrig;
2316 Int_t nBinFinal=nBinOrig/reb;
2318 firstBinOrig=firstUse;
2319 nBinFinal=(nBinOrig-firstUse+1)/reb;
2320 nBinOrigUsed=nBinFinal*reb;
2321 lastBinOrig=firstBinOrig+nBinOrigUsed-1;
2323 Int_t exc=nBinOrigUsed%reb;
2326 lastBinOrig=firstBinOrig+nBinOrigUsed-1;
2330 printf(
"Rebin from %d bins to %d bins -- Used bins=%d in range %d-%d\n",nBinOrig,nBinFinal,nBinOrigUsed,firstBinOrig,lastBinOrig);
2331 Float_t lowLim=hOrig->GetXaxis()->GetBinLowEdge(firstBinOrig);
2332 Float_t hiLim=hOrig->GetXaxis()->GetBinUpEdge(lastBinOrig);
2333 TH1D* hRebin=
new TH1D(Form(
"%s-rebin",hOrig->GetName()),hOrig->GetTitle(),nBinFinal,lowLim,hiLim);
2334 Int_t lastSummed=firstBinOrig-1;
2335 for(
Int_t iBin=1;iBin<=nBinFinal; iBin++){
2338 for(
Int_t iOrigBin=0;iOrigBin<reb;iOrigBin++){
2339 sum+=hOrig->GetBinContent(lastSummed+1);
2340 sume2+=(hOrig->GetBinError(lastSummed+1)*hOrig->GetBinError(lastSummed+1));
2343 hRebin->SetBinContent(iBin,sum);
2344 hRebin->SetBinError(iBin,TMath::Sqrt(sume2));
2352 Int_t binmin=TMath::Max(1,hData->FindBin(hMC->GetXaxis()->GetXmin()));
2356 for(
Int_t j=binmin; j<hData->GetNbinsX(); j++){
2358 for(
Int_t k=1; k<hMC->GetNbinsX(); k++){
2359 Double_t delta=TMath::Abs(hMC->GetBinLowEdge(k)-hData->GetBinLowEdge(j));
2368 Int_t binmax=TMath::Min(hData->GetNbinsX(),hData->FindBin(hMC->GetXaxis()->GetXmax()*0.99999));
2372 for(
Int_t j=binmax; j>1; j--){
2374 for(
Int_t k=hMC->GetNbinsX(); k>400; k--){
2375 Double_t delta=TMath::Abs(hMC->GetBinLowEdge(k+1)-hData->GetBinLowEdge(j+1));
2385 Double_t min=hData->GetBinLowEdge(binminD);
2386 Double_t max=hData->GetBinLowEdge(binmaxD)+hData->GetBinWidth(binmaxD);
2387 Double_t minMC=hMC->GetBinLowEdge(binminMC);
2388 Double_t maxMC=hMC->GetBinLowEdge(binmaxMC)+hMC->GetBinWidth(binmaxMC);
2389 Double_t width=hData->GetBinWidth(binminD);
2390 Double_t widthMC=hMC->GetBinWidth(binminMC);
2392 if(TMath::Abs(minMC-min)>0.0001*min || TMath::Abs(maxMC-max)>0.0001*max){
2393 printf(
"Cannot adapt range and rebin histo:\n");
2394 printf(
"Range for data histo: %f-%f GeV/c2 bins %d-%d width=%f\n",min,max,binminD,binmaxD,width);
2395 printf(
"Range for reflection histo: %f-%f GeV/c2 bins %d-%d width=%f\n",minMC,maxMC,binminMC,binmaxMC,widthMC);
2400 if(TMath::Abs(rebin-TMath::Nint(rebin))>0.001){
2401 printf(
"Cannot adapt histo: rebin %f issue, width MC = %f, width hData=%f (check=%f)\n",rebin,widthMC,width,TMath::Abs(rebin-TMath::Nint(rebin)));
2405 Int_t nBinsNew=binmaxD-binminD+1;
2407 TString stype=hMC->ClassName();
2408 if(stype.Contains(
"TH1F")){
2409 hOut=
new TH1F(Form(
"%s-rebinned",hMC->GetName()),hMC->GetTitle(),nBinsNew,min,max);
2410 }
else if(stype.Contains(
"TH1D")){
2411 hOut=
new TH1D(Form(
"%s-rebinned",hMC->GetName()),hMC->GetTitle(),nBinsNew,min,max);
2413 printf(
"Wrong type %s\n",stype.Data());
2417 for(
Int_t j=1; j<=hMC->GetNbinsX(); j++){
2419 Int_t binFin=hOut->FindBin(m);
2420 if(binFin>=1 && binFin<=nBinsNew){
2421 hOut->AddBinContent(binFin,hMC->GetBinContent(j));
static void GetSpherocity(AliAODEvent *aod, Double_t &spherocity, Double_t &phiRef, Double_t etaMin=-0.8, Double_t etaMax=0.8, Double_t ptMin=0.15, Double_t ptMax=10., Int_t filtbit1=256, Int_t filtbit2=512, Int_t minMult=3, Double_t phiStepSizeDeg=0.1, Int_t nTrksToSkip=0, Int_t *idToSkip=0x0)
Functions for event shape variables.
static Int_t CheckD0Decay(AliMCEvent *mcEvent, Int_t label, Int_t *arrayDauLab)
static void AveragePt(Float_t &averagePt, Float_t &errorPt, Float_t ptmin, Float_t ptmax, TH2F *hMassD, Float_t massFromFit, Float_t sigmaFromFit, TF1 *funcB2, Float_t sigmaRangeForSig=2.5, Float_t sigmaRangeForBkg=4.5, Float_t minMass=0., Float_t maxMass=3., Int_t rebin=1)
Functions for computing average pt.
static TH1D * RebinHisto(TH1 *hOrig, Int_t reb, Int_t firstUse=-1)
Rebinning of invariant mass histograms.
static Int_t CheckDplusDecay(AliMCEvent *mcEvent, Int_t label, Int_t *arrayDauLab)
static Int_t CheckDsDecay(AliMCEvent *mcEvent, Int_t label, Int_t *arrayDauLab)
static Int_t CheckLcpKpiDecay(AliMCEvent *mcEvent, Int_t label, Int_t *arrayDauLab)
Double_t ImpParXY() const
static TString GetGenerator(Int_t label, AliAODMCHeader *header)
Double_t Pol(Double_t x) const
static Double_t GetFullEvResolLowLim(const TH1F *hSubEvCorr, Int_t k=1)
static TH1 * AdaptTemplateRangeAndBinning(const TH1 *hRef, TH1 *hData, Double_t minFit, Double_t maxFit)
static Int_t CheckOrigin(TClonesArray *arrayMC, AliAODMCParticle *mcPart, Bool_t searchUpToQuark=kTRUE)
Functions to check the decay tree.
TString part
use mixed event to constrain combinatorial background
void GetTrackPrimaryGenerator(AliAODTrack *track, AliAODMCHeader *header, TClonesArray *arrayMC, TString &nameGen)
Double_t fMinEtaForTracklets
sub-event resolution = sqrt(<cos[n(phiA-phiB)] >)
Double_t fSubRes
ratio of measured harmonic to event plane harmonic
static Int_t CheckDplusK0spiDecay(AliMCEvent *mcEvent, Int_t label, Int_t *arrayDauLab)
static Int_t CheckXicXipipiDecay(AliMCEvent *mcEvent, Int_t label, Int_t *arrayDauLab)
static Int_t CheckLcV0bachelorDecay(AliMCEvent *mcEvent, Int_t label, Int_t *arrayDauLab)
Double_t fMaxEtaForTracklets
min eta for counting tracklets
static Double_t GetVZEROCEqualizedMultiplicity(AliAODEvent *ev)
static Double_t GetFullEvResolHighLim(const TH1F *hSubEvCorr, Int_t k=1)
static void GetGeneratedSpherocity(TClonesArray *arrayMC, Double_t &spherocity, Double_t &phiRef, Double_t etaMin=-0.8, Double_t etaMax=0.8, Double_t ptMin=0.15, Double_t ptMax=10., Int_t minMult=3, Double_t phiStepSizeDeg=0.1)
static Double_t ResolK1(Double_t x)
static Int_t GetNumberOfTrackletsInEtaRange(AliAODEvent *ev, Double_t mineta, Double_t maxeta)
Double_t GetFullEvResol() const
static Int_t CheckDplusKKpiDecay(AliMCEvent *mcEvent, Int_t label, Int_t *arrayDauLab)
static Bool_t CheckT0TriggerFired(AliAODEvent *aodEv)
Functions for processing trigger information.
AliAODTrack * GetBachelor() const
static Double_t GetSubEvResolLowLim(const TH1F *hSubEvCorr)
Bool_t HasCascadeCandidateAnyDaughInjected(AliAODRecoCascadeHF *cand, AliAODMCHeader *header, TClonesArray *arrayMC)
Bool_t IsCandidateInjected(AliAODRecoDecayHF *cand, AliAODMCHeader *header, TClonesArray *arrayMC)
static Int_t CheckDstarDecay(AliMCEvent *mcEvent, Int_t label, Int_t *arrayDauLab)
static Double_t GetBeautyMotherPt(TClonesArray *arrayMC, AliAODMCParticle *mcPart)
static void ComputeSignificance(Double_t signal, Double_t errsignal, Double_t background, Double_t errbackground, Double_t &significance, Double_t &errsignificance)
Significance calculator.
static Double_t GetCorrectedNtracklets(TProfile *estimatorAvg, Double_t uncorrectedNacc, Double_t vtxZ, Double_t refMult)
Double_t GetSubEvResol() const
Bool_t IsTrackInjected(AliAODTrack *track, AliAODMCHeader *header, TClonesArray *arrayMC)
static Int_t GetGeneratedPhysicalPrimariesInEtaRange(TClonesArray *arrayMC, Double_t mineta, Double_t maxeta)
static Double_t GetVZEROAEqualizedMultiplicity(AliAODEvent *ev)
Utilities for V0 multiplicity checks.
static Double_t GetTrueImpactParameterDzero(AliAODMCHeader *mcHeader, TClonesArray *arrayMC, AliAODMCParticle *partDp)
Functions for computing true impact parameter of D meson.
static Int_t CheckDsK0sKDecay(AliMCEvent *mcEvent, Int_t label, Int_t *arrayDauLab)
static Double_t GetSubEvResolHighLim(const TH1F *hSubEvCorr)
static Double_t GetTrueImpactParameterDplus(AliAODMCHeader *mcHeader, TClonesArray *arrayMC, AliAODMCParticle *partDp)
static Double_t GetSphericity(AliAODEvent *aod, Double_t etaMin=-0.8, Double_t etaMax=0.8, Double_t ptMin=0.15, Double_t ptMax=10., Int_t filtbit1=256, Int_t filtbit2=512, Int_t minMult=3)
static Int_t GetGeneratedMultiplicityInEtaRange(TClonesArray *arrayMC, Double_t mineta, Double_t maxeta)
static Int_t GetGeneratedPrimariesInEtaRange(TClonesArray *arrayMC, Double_t mineta, Double_t maxeta)
Class with functions useful for different D2H analyses //.