From 0ba436add114038aff0a464ee51ad8644585e9dd Mon Sep 17 00:00:00 2001 From: emarroqu <85475510+emarroqu@users.noreply.github.com> Date: Thu, 13 Apr 2023 11:07:16 -0300 Subject: [PATCH 01/51] Update AddTaskSPDData.C --- PWGMM/Mult/macros/AddTaskSPDData.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGMM/Mult/macros/AddTaskSPDData.C b/PWGMM/Mult/macros/AddTaskSPDData.C index 3eb2cf705b7..16aa6e51e36 100644 --- a/PWGMM/Mult/macros/AddTaskSPDData.C +++ b/PWGMM/Mult/macros/AddTaskSPDData.C @@ -1,4 +1,4 @@ -AliSPDpPbAnalysisTaskData* AddMyTask(TString name = "name") +AliSPDpPbAnalysisTaskData* AddTaskSPDData(TString name = "name") { // get the manager via the static access member. since it's static, you don't need // to create an instance of the class here to call the function @@ -29,4 +29,4 @@ AliSPDpPbAnalysisTaskData* AddMyTask(TString name = "name") // in the end, this macro returns a pointer to your task. this will be convenient later on // when you will run your analysis in an analysis train on grid return task; -} \ No newline at end of file +} From dfd4a54778a24f6c3f9658f07f3e3df88a428d71 Mon Sep 17 00:00:00 2001 From: emarroqu <85475510+emarroqu@users.noreply.github.com> Date: Thu, 13 Apr 2023 11:08:03 -0300 Subject: [PATCH 02/51] Update AddTaskSPDSim.C --- PWGMM/Mult/macros/AddTaskSPDSim.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGMM/Mult/macros/AddTaskSPDSim.C b/PWGMM/Mult/macros/AddTaskSPDSim.C index 70d84612a04..658986b495e 100644 --- a/PWGMM/Mult/macros/AddTaskSPDSim.C +++ b/PWGMM/Mult/macros/AddTaskSPDSim.C @@ -1,4 +1,4 @@ -AliSPDpPbAnalysisTask* AddMyTask(TString name = "name") +AliSPDpPbAnalysisTask* AddTaskSPDSim(TString name = "name") { // get the manager via the static access member. since it's static, you don't need // to create an instance of the class here to call the function @@ -29,4 +29,4 @@ AliSPDpPbAnalysisTask* AddMyTask(TString name = "name") // in the end, this macro returns a pointer to your task. this will be convenient later on // when you will run your analysis in an analysis train on grid return task; -} \ No newline at end of file +} From 4dc48530e3d383ae80ae102bcfd53cc276fef430 Mon Sep 17 00:00:00 2001 From: Anjaly Menon Date: Sat, 15 Apr 2023 16:17:48 -0500 Subject: [PATCH 03/51] added event mixing background for k+K- correlation --- .../AliAnalysisTaskKaon2PC.cxx | 448 ++++++++++++++++-- .../KaonCorrelations/AliAnalysisTaskKaon2PC.h | 53 ++- 2 files changed, 447 insertions(+), 54 deletions(-) diff --git a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx index 9c0f5246d12..06300e05b4d 100644 --- a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx +++ b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx @@ -64,6 +64,9 @@ fLpTCut(0.4), fUpTCut(0.8), fEtaCut(0.8), fSigCut(2.0), +fBit(96), +fCentMin(20), +fCentMax(30), //V0 cuts fDecayLv0Cut(8.05), fLpTv0Cut(0.4), @@ -88,6 +91,7 @@ fNsigmaKaon(0), fNsigmaTOFK(0), fNsigmaTOFKaon(0), fNsigmaTPCTOFK(0), +fHistTOFKch(0), //track and event observables fVtx(0), fClusters(0), @@ -138,12 +142,16 @@ fHistKPosKNeg(0), //mixing fSelectedKCh(0), fSelectedK0s(0), +fSelectedKpos(0), +fSelectedKneg(0), fPoolMgr(0x0), fPoolMaxNEvents(1000), fPoolMinNTracks(10000), fMinEventsToMix(10), fNzVtxBins(10), fNCentBins(15), +fKpKnCorr(kTRUE), +fK0KchCorr(kFALSE), /* fNOfSamples(1.0), fSampleIndex(0.0), @@ -151,6 +159,14 @@ fSampleIndex(0.0), hPt(0), hPt_kPos(0), fHistCF_Bg(0), +fHistCF_KpKn_Bg(0), +//MC Truth +fMCK0(0), +fMCKpos(0), +fMCKneg(0), +fHistKpKnMC(0), +fHistK0KchMC(0), +fHistGenMultiplicity(0), //eventcuts fEventCuts(0) @@ -171,6 +187,9 @@ fLpTCut(0.4), fUpTCut(0.8), fEtaCut(0.8), fSigCut(2.0), +fBit(96), +fCentMin(20), +fCentMax(30), //V0 cuts fDecayLv0Cut(8.05), fLpTv0Cut(0.4), @@ -195,6 +214,7 @@ fNsigmaKaon(0), fNsigmaTOFK(0), fNsigmaTOFKaon(0), fNsigmaTPCTOFK(0), +fHistTOFKch(0), //track and event observables fVtx(0), fClusters(0), @@ -245,12 +265,16 @@ fHistKPosKNeg(0), //mixing fSelectedKCh(0), fSelectedK0s(0), +fSelectedKpos(0), +fSelectedKneg(0), fPoolMgr(0x0), fPoolMaxNEvents(1000), fPoolMinNTracks(10000), fMinEventsToMix(10), fNzVtxBins(10), fNCentBins(15), +fKpKnCorr(kTRUE), +fK0KchCorr(kFALSE), /* fNOfSamples(1.0), fSampleIndex(0.0), @@ -258,6 +282,14 @@ fSampleIndex(0.0), hPt(0), hPt_kPos(0), fHistCF_Bg(0), +fHistCF_KpKn_Bg(0), +//MC Truth +fMCK0(0), +fMCKpos(0), +fMCKneg(0), +fHistKpKnMC(0), +fHistK0KchMC(0), +fHistGenMultiplicity(0), //eventcuts fEventCuts(0) @@ -276,6 +308,8 @@ AliAnalysisTaskKaon2PC::~AliAnalysisTaskKaon2PC() } if(fSelectedK0s) delete fSelectedK0s; if(fSelectedKCh) delete fSelectedKCh; + if(fSelectedKpos) delete fSelectedKpos; + if(fSelectedKneg) delete fSelectedKneg; } //_____________________________________________________________________________ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() @@ -287,6 +321,7 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() // to an output file. fzVtxBins = {-10.0,-8.0,-6.0,-4.0,-2.0,0.0,2.0,4.0,6.0,8.0,10.0}; // 10 bins + //fzVtxBins = {-10.0,-9.0,-8.0,-7.0,-6.0,-5.0,-4.0,-3.0,-2.0,-1.0,0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0}; // 20 bins //fCentBins = {0,5,10,15,20,25,30,35,40,45,50,60,70,80,90,100}; fCentBins = { 0, 1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100.1 }; // 15 bins //fsampleBins = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}; @@ -355,6 +390,9 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fNsigmaTPCTOFK->GetYaxis()->SetTitle("n#sigma_{TOF} of Kaon"); fNsigmaTPCTOFK->SetOption("colz"); + fHistTOFKch = new TH2F("fHistTOFKch", "", 500, 0.2,2,700,0,2); + //fHistTOFKch->SetOption(); + //track and event observables fVtx = new TH1F("fVtx", "PV_{z} distribution of Tracks", 100, -13, 13); fClusters = new TH1F("fClusters", "TPCClusters distribution", 500, 1, 170); @@ -438,15 +476,15 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() f2DHistNegRap->GetXaxis()->SetTitle("Rapidity"); f2DHistNegRap->SetOption("colz"); - fHistPosPhiEta = new TH3F("fHistPosPhiEta", "",60,0,2*Pi, 60,-0.8, 0.8,100,0,100); + fHistPosPhiEta = new TH2F("fHistPosPhiEta", "",60,0,2*Pi, 60,-0.8, 0.8); fHistPosPhiEta->GetXaxis()->SetTitle("Track Eta"); fHistPosPhiEta->SetOption("SURF1"); - fHistNegPhiEta = new TH3F("fHistNegPhiEta", "",60,0,2*Pi, 60,-0.8, 0.8,100,0,100); + fHistNegPhiEta = new TH2F("fHistNegPhiEta", "",60,0,2*Pi, 60,-0.8, 0.8); fHistNegPhiEta->GetXaxis()->SetTitle("Track Eta"); fHistNegPhiEta->SetOption("SURF1"); - fHistK0PhiEta = new TH3F("fHistK0PhiEta", "", 60,0,2*Pi,60,-0.8, 0.8,100,0,100); + fHistK0PhiEta = new TH2F("fHistK0PhiEta", "", 60,0,2*Pi,60,-0.8, 0.8); fHistK0PhiEta->GetXaxis()->SetTitle("V0 Phi (in radians)"); fHistK0PhiEta->SetOption("SURF1"); @@ -466,17 +504,17 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fHistKChKChPhi = new TH2F("fHistKChKChPhi", "C(#Delta#phi) of Kch-Kch ",32,-0.5*Pi,1.5*Pi,100,0,100); fHistKChKChPhi->SetOption("SURF1"); - fHistCF = new TH3F("fHistCF","Number of pairs of K^{+/-} and K^{0}",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6,100,0,100 ); + fHistCF = new TH2F("fHistCF","Number of pairs of K^{+/-} and K^{0}",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); fHistCF->GetXaxis()->SetTitle("#Delta#phi "); fHistCF->GetYaxis()->SetTitle("#Delta#eta"); fHistCF->SetOption("SURF1"); - fHistKPosKNeg = new TH3F("fHistKPosKNeg","K^{+}-K^{-} Correlation",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6,100,0,100 ); + fHistKPosKNeg = new TH2F("fHistKPosKNeg","K^{+}-K^{-} Correlation",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); fHistKPosKNeg->GetXaxis()->SetTitle("#Delta#phi "); fHistKPosKNeg->GetYaxis()->SetTitle("#Delta#eta"); fHistKPosKNeg->SetOption("SURF1"); - fHistKChKCh = new TH3F("fHistKChKCh","Kch-Kch Correlation",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6,100,0,100 ); + fHistKChKCh = new TH2F("fHistKChKCh","Kch-Kch Correlation",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); fHistKChKCh->GetXaxis()->SetTitle("#Delta#phi "); fHistKChKCh->GetYaxis()->SetTitle("#Delta#eta"); fHistKChKCh->SetOption("SURF1"); @@ -487,9 +525,51 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fHistCF_Bg = new TH2F("fHistCF_Bg","Background for CF of K^{+/-} and K^{0}",32,-0.5*Pi,1.5*Pi,32,-1.6,1.6); fHistCF_Bg->SetOption("SURF1"); + fHistCF_KpKn_Bg = new TH2F("fHistCF_KpKn_Bg","Background for CF of K^{+} and K^{-}",32,-0.5*Pi,1.5*Pi,32,-1.6,1.6); + fHistCF_KpKn_Bg->SetOption("SURF1"); + + hPt = new TH1F("hPt", "Track pT distribution", 100, 0, 2); hPt_kPos = new TH1F("hPt_kPos", "Track pT distribution", 100, 0, 2); + // MC Truth histograms + + //+++++++++++++++++++++ MC ++++++++++++++++++++++++++ + + Int_t bins[4] = {100,32,32,100}; + Double_t min[4] = {0.2,0,-0.8,0.4}; + Double_t max[4] = {1.0,2*Pi,0.8,0.6}; + + fMCK0 = new THnSparseF("fMCK0","fMCK0",4,bins,min,max); + fMCK0->GetAxis(0)->SetTitle("p_{T} of K^{0}_{S}"); + fMCK0->GetAxis(1)->SetTitle("#phi"); + fMCK0->GetAxis(2)->SetTitle("#eta"); + fMCK0->GetAxis(3)->SetTitle("mass"); + + fMCKpos = new THnSparseF("fMCKpos","fMCKpos",4,bins,min,max); + fMCKpos->GetAxis(0)->SetTitle("p_{T} of K^{+}"); + fMCKpos->GetAxis(1)->SetTitle("#phi of K^{+}"); + fMCKpos->GetAxis(2)->SetTitle("#eta of K^{+}"); + fMCKpos->GetAxis(3)->SetTitle("mass of K^{+}"); + + fMCKneg = new THnSparseF("fMCKneg","fMCKneg",4,bins,min,max); + fMCKneg->GetAxis(0)->SetTitle("p_{T} of K^{-}"); + fMCKneg->GetAxis(1)->SetTitle("#phi of K^{-}"); + fMCKneg->GetAxis(2)->SetTitle("#eta of K^{-}"); + fMCKneg->GetAxis(3)->SetTitle("mass of K^{-}"); + + fHistKpKnMC = new TH2F("fHistKpKnMC","K^{+}-K^{-} Correlation for MC Truth",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); + fHistKpKnMC->GetXaxis()->SetTitle("#Delta#phi "); + fHistKpKnMC->GetYaxis()->SetTitle("#Delta#eta"); + fHistKpKnMC->SetOption("SURF1"); + + fHistK0KchMC = new TH2F("fHistK0KchMC","K^{+}-K^{-} Correlation for MC Truth",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); + fHistK0KchMC->GetXaxis()->SetTitle("#Delta#phi "); + fHistK0KchMC->GetYaxis()->SetTitle("#Delta#eta"); + fHistK0KchMC->SetOption("SURF1"); + + fHistGenMultiplicity = new TH1D ("fHistGenMultiplicity","fHistGenMultiplicity",500,0,500); + fOutputList->Add(fEnergy); fOutputList->Add(fEnergyCuts); fOutputList->Add(fPID); @@ -501,6 +581,7 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fOutputList->Add(fNsigmaTOFK); fOutputList->Add(fNsigmaTOFKaon); fOutputList->Add(fNsigmaTPCTOFK); + fOutputList->Add(fHistTOFKch); fOutputList->Add(fVtx); fOutputList->Add(fClusters); @@ -552,6 +633,14 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fOutputList->Add(hPt_kPos); fOutputList->Add(fHistCF_Bg); + fOutputList->Add(fHistCF_KpKn_Bg); + + fOutputList->Add(fMCK0); + fOutputList->Add(fMCKpos); + fOutputList->Add(fMCKneg); + fOutputList->Add(fHistKpKnMC); + fOutputList->Add(fHistK0KchMC); + fOutputList->Add(fHistGenMultiplicity); fEventCuts.AddQAplotsToList(fOutputList); PostData(1, fOutputList); @@ -594,11 +683,15 @@ Bool_t AliAnalysisTaskKaon2PC::AcceptTrack(const AliAODTrack *Trk) { Double_t nSigmaTOFkaon = fPIDResponse->NumberOfSigmasTOF(Trk, AliPID::kKaon); Double_t nSigmaTOFelectron = fPIDResponse->NumberOfSigmasTOF(Trk, AliPID::kElectron); Double_t nSigmaTOFpion = fPIDResponse->NumberOfSigmasTOF(Trk, AliPID::kPion); - if (fabs(nSigmakaon) > fSigCut) return kFALSE; if (fabs(nSigmaelectron) < 2.0) return kFALSE; // excluding electrons via TPC if (fabs(nSigmapion) < 2.0) return kFALSE; // excluding pions via TPC if (fabs(nSigmaproton) < 2.0) return kFALSE; // excluding pions via TPC - + //if (fabs(nSigmakaon < 3.0) && (nSigmapion < 3.0)) return kFALSE; + //if (fabs(nSigmakaon < 3.0) && (nSigmaproton < 3.0)) return kFALSE; + //if (fabs(nSigmakaon < 3.0) && (nSigmaelectron < 3.0)) return kFALSE; + if (fabs(nSigmakaon) > fSigCut) return kFALSE; + if (fabs(nSigmaTOFkaon) > 3.0) return kFALSE; + return kTRUE; } @@ -617,6 +710,21 @@ Bool_t AliAnalysisTaskKaon2PC::AcceptNegTrack(const AliAODTrack *Trk) { return kTRUE; } + +//_____________________________________________________________________________ + +Double_t AliAnalysisTaskKaon2PC::Beta(const AliAODTrack *track) +{ + Double_t startTime = fPIDResponse->GetTOFResponse().GetStartTime(((AliVTrack*)track)->P()); //in ps + Double_t stoptime = track->GetTOFsignal(); + Double_t c = TMath::C()*1.E-9; // m/ns + Double_t length = fPIDResponse->GetTOFResponse().GetExpectedSignal(track,AliPID::kKaon)*1E-3*c; + stoptime -= startTime; + Double_t scaleStopTime = stoptime*1E-3; + scaleStopTime = scaleStopTime*c; + return length/scaleStopTime; +} + //___________________________ v0 selection with no pT cut _________________________ Bool_t AliAnalysisTaskKaon2PC::AcceptV0(const AliAODv0 *v0, Double_t *vertex) { @@ -624,23 +732,23 @@ Bool_t AliAnalysisTaskKaon2PC::AcceptV0(const AliAODv0 *v0, Double_t *vertex) { if (v0->GetOnFlyStatus()) return kFALSE; Double_t length = v0->DecayLengthV0(vertex); if (length > fDecayLv0Cut) return kFALSE; - Double_t dcaDau =v0->DcaV0Daughters(); - if (dcaDau > 0.8) return kFALSE; + Double_t dcaDau = v0->DcaV0Daughters(); + if (TMath::Abs(dcaDau) > 0.8) return kFALSE; Double_t pT = v0->Pt(); //Double_t pT=TMath::Sqrt(v0->Pt2V0()); if (fabs(v0->Eta()) > fEtav0Cut) return kFALSE; Double_t DCAtoPV = v0->DcaV0ToPrimVertex(); if (DCAtoPV > 0.1 ) return kFALSE; Double_t dcaPosToPV = v0->DcaPosToPrimVertex(); - if (dcaPosToPV < fDcaPosToPrimVtxv0Cut) return kFALSE; + if (TMath::Abs(dcaPosToPV) < fDcaPosToPrimVtxv0Cut && fDcaPosToPrimVtxv0Cut != -999) return kFALSE; Double_t dcaNegToPV = v0->DcaNegToPrimVertex(); - if (dcaNegToPV < fDcaNegToPrimVtxv0Cut) return kFALSE; + if (TMath::Abs(dcaNegToPV) < fDcaNegToPrimVtxv0Cut && fDcaNegToPrimVtxv0Cut != -999) return kFALSE; Double_t etaPos = v0->PseudoRapPos(); - if (fabs(etaPos) > fEtaPosv0Cut) return kFALSE; + if (fabs(etaPos) > fEtaPosv0Cut && fEtaPosv0Cut != -999) return kFALSE; Double_t etaNeg = v0->PseudoRapNeg(); - if (fabs(etaNeg) > fEtaNegv0Cut) return kFALSE; + if (fabs(etaNeg) > fEtaNegv0Cut && fEtaNegv0Cut != -999) return kFALSE; Double_t cosPA= v0->CosPointingAngle(vertex); - if (cosPA < fCosPACut) return kFALSE; + if (cosPA < fCosPACut && fCosPACut != -999) return kFALSE; Double_t armpt = v0->PtArmV0(); Double_t alpha = v0->AlphaV0(); if (armpt < 0.2*fabs(alpha)) return kFALSE; @@ -662,6 +770,41 @@ Bool_t AliAnalysisTaskKaon2PC::AcceptV0(const AliAODv0 *v0, Double_t *vertex) { return kTRUE; } +// MC Truth Booleans + +Bool_t AliAnalysisTaskKaon2PC::SelectK0TracksMC(AliMCParticle *mcTrack ) { + Int_t mcPartPdg = mcTrack->PdgCode(); + Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); + Bool_t SelectK0 = mcPartPdg==310&& (isPhysPrim); + if (SelectK0) return kFALSE; + return kTRUE; +} + +Bool_t AliAnalysisTaskKaon2PC::SelectKPosTracksMC(AliMCParticle *mcTrack ) { + Int_t mcPartPdg = mcTrack->PdgCode(); + Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); + Bool_t SelectKpos = mcPartPdg==321&& (isPhysPrim); + if (SelectKpos) return kFALSE; + return kTRUE; +} + +Bool_t AliAnalysisTaskKaon2PC::SelectKNegTracksMC(AliMCParticle *mcTrack ) { + Int_t mcPartPdg = mcTrack->PdgCode(); + Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); + Bool_t SelectKneg = mcPartPdg==-321&& (isPhysPrim); + if (SelectKneg) return kFALSE; + return kTRUE; +} + +Bool_t AliAnalysisTaskKaon2PC::SelectKchTracksMC(AliMCParticle *mcTrack ) { + Int_t mcPartPdg = mcTrack->PdgCode(); + Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); + Bool_t SelectKch = mcPartPdg==321&& mcPartPdg==-321&& (isPhysPrim); + if (SelectKch) return kFALSE; + return kTRUE; +} + + //_____________________________________________________________________________ void AliAnalysisTaskKaon2PC::RunData() { @@ -693,13 +836,13 @@ void AliAnalysisTaskKaon2PC::RunData() { fVtx->Fill(PVz); //Multiplicity selection - AliMultSelection *MultSelection = (AliMultSelection*)fAOD->FindListObject("MultSelection"); - if(!MultSelection) return; + //AliMultSelection *MultSelection = (AliMultSelection*)fAOD->FindListObject("MultSelection"); + //if(!MultSelection) return; //centrality - double CentV0M = MultSelection->GetMultiplicityPercentile("V0M"); //centrality - - //if (40.0 < CentV0M >90.0) return; + //double CentV0M = MultSelection->GetMultiplicityPercentile("V0M"); //centrality + Double_t CentV0M = fEventCuts.GetCentrality(); //centrality + if ((CentV0M < fCentMin)||(CentV0M > fCentMax)) return; //======== PID loop (no pT cut) =========== @@ -793,14 +936,14 @@ void AliAnalysisTaskKaon2PC::RunData() { Double_t DPhi = fabs(track1Phi - track2Phi); FillDPhiHist(DPhi,fHistKChKChPhi,CentV0M); - Fill2DHist(DPhi,DEta,fHistKChKCh,CentV0M); + Fill2DHist(DPhi,DEta,fHistKChKCh); } } //======== K+K- Correlation Loop ========== - for(Int_t i(0); i < iTracks; i++) { + for(Int_t i(0); i < fSelectedKpos->GetEntriesFast(); i++) { AliAODTrack* track1 = dynamic_cast(fAOD->GetTrack(i)); if(!track1) continue; if (!AcceptTrack(track1)) continue; @@ -809,7 +952,7 @@ void AliAnalysisTaskKaon2PC::RunData() { Double_t track1PosPhi = track1->Phi(); Double_t track1PosEta = track1->Eta(); - for(Int_t j(0); j < iTracks; j++) { + for(Int_t j(0); j < fSelectedKneg->GetEntriesFast(); j++) { AliAODTrack* track2 = dynamic_cast(fAOD->GetTrack(j)); if(!track2) continue; if (!AcceptTrack(track2)) continue; @@ -822,7 +965,7 @@ void AliAnalysisTaskKaon2PC::RunData() { Double_t DEtaPN = fabs(track1PosEta - track2NegEta); FillDPhiHist(DPhiPN,fHistKPosKNegPhi,CentV0M); - Fill2DHist(DPhiPN,DEtaPN,fHistKPosKNeg,CentV0M); + Fill2DHist(DPhiPN,DEtaPN,fHistKPosKNeg); } } @@ -831,16 +974,27 @@ void AliAnalysisTaskKaon2PC::RunData() { fSelectedKCh = new TObjArray; fSelectedKCh->SetOwner(kTRUE); +fSelectedKpos = new TObjArray; +fSelectedKpos->SetOwner(kTRUE); + +fSelectedKneg = new TObjArray; +fSelectedKneg->SetOwner(kTRUE); + for(Int_t i=0; i < iTracks; i++) { AliAODTrack* track = dynamic_cast(fAOD->GetTrack(i)); if(!track) continue; if (!AcceptTrack(track)) continue; - fSelectedKCh->Add((AliAODTrack*)track); + Double_t TOFsignal = track->GetTOFsignal(); + Float_t beta = 0.0; + beta = Beta(track); Int_t chargetrack = track->Charge(); Double_t trackPhi = track->Phi(); Double_t trackEta = track->Eta(); Double_t trackPt = track->Pt(); + //cout << "TOFsignal is" << TOFsignal << endl; + fHistTOFKch->Fill(trackPt, beta); + fSelectedKCh->Add((AliAODTrack*)track); //fill single particle charged kaon histograms fHistKChPhi->Fill(trackPhi); @@ -850,17 +1004,19 @@ for(Int_t i=0; i < iTracks; i++) { f2DHistChRap->Fill(track->Y(),CentV0M); if (chargetrack > 0) { + fSelectedKpos->Add((AliAODTrack*)track); fHistKpPhi->Fill(trackPhi); f2DHistPosPhi->Fill(trackPhi,CentV0M); f2DHistPosEta->Fill(trackEta,CentV0M); - fHistPosPhiEta->Fill(trackPhi,trackEta,CentV0M); + fHistPosPhiEta->Fill(trackPhi,trackEta); f2DHistPosRap->Fill(track->Y(0.493),CentV0M); } if (chargetrack < 0) { + fSelectedKneg->Add((AliAODTrack*)track); fHistKnPhi->Fill(trackPhi); f2DHistNegPhi->Fill(trackPhi,CentV0M); f2DHistNegEta->Fill(trackEta,CentV0M); - fHistNegPhiEta->Fill(trackPhi,trackEta,CentV0M); + fHistNegPhiEta->Fill(trackPhi,trackEta); f2DHistNegRap->Fill(track->Y(0.493),CentV0M); } fHistPhi->Fill(track->Phi()); @@ -870,6 +1026,12 @@ for(Int_t i=0; i < iTracks; i++) { Int_t nSelectedKCh = fSelectedKCh->GetEntries(); cout << " nSelectedKCh is " << nSelectedKCh << endl; +Int_t nSelectedKpos = fSelectedKpos->GetEntries(); +cout << " nSelectedKpos is " << nSelectedKpos << endl; + +Int_t nSelectedKneg = fSelectedKneg->GetEntries(); +cout << " nSelectedKneg is " << nSelectedKneg << endl; + //======== Neutral Kaon Selection ========== fSelectedK0s = new TObjArray; fSelectedK0s->SetOwner(kTRUE); @@ -894,7 +1056,7 @@ for(Int_t j=0; j < nv0s; j++) { fSelectedK0s->Add(v0); //fill single particle neutral kaon histograms fHistK0Phi->Fill(V0Phi); - fHistK0PhiEta->Fill(V0Phi,V0Eta,CentV0M); + fHistK0PhiEta->Fill(V0Phi,V0Eta); f2DHistK0Phi->Fill(V0Phi,CentV0M); f2DHistK0Eta->Fill(V0Eta,CentV0M); fHistPPionPhi->Fill(pTrack->Phi()); @@ -903,6 +1065,9 @@ for(Int_t j=0; j < nv0s; j++) { Int_t nSelectedK0s = fSelectedK0s->GetEntries(); cout << " nSelectedK0s is " << nSelectedK0s << endl; +//((TH1F*)((AliDirList*)fOutput3->FindObject("Track"))->FindObject("nTracksBf"))->Fill(nTracks); +//((TH1F*)((AliDirList*)fOutput3->FindObject("Track"))->FindObject("nTracksAf"))->Fill(nSelectedTracks); + //======== Kch-K0s Correlation Analysis ========== for(Int_t i = 0; i < fSelectedK0s->GetEntriesFast(); i++){ AliAODv0 * v0 = (AliAODv0*)fSelectedK0s->At(i); @@ -954,7 +1119,7 @@ cout << " nSelectedK0s is " << nSelectedK0s << endl; fHistCFPhi->Fill(2*Pi-(deltaPhi),-deltaEta); } - Fill2DHist(deltaPhi,deltaEta,fHistCF,CentV0M); + Fill2DHist(deltaPhi,deltaEta,fHistCF); if (deltaPhi > Pi) deltaPhi = Pi-(deltaPhi-Pi); fHistDPhi->Fill(deltaPhi); @@ -975,17 +1140,18 @@ fHistMult->Fill(iTracks); fHistCent->Fill(CentV0M); //================== mixing ============================ (You can create a seperate function FillCorrelationsMixed() later) +if (fK0KchCorr){ -AliEventPool *pool = fPoolMgr->GetEventPool(CentV0M, PVz); -if(pool) {cout << "Good news....!!!!!!! Pool found.. " << endl; } -if(!pool) { AliError(Form("No pool found for centrality = %f, zVtx = %f", CentV0M,PVz)); return; } +AliEventPool *pool1 = fPoolMgr->GetEventPool(CentV0M, PVz); +if(pool1) {cout << "Good news....!!!!!!! Pool found.. " << endl; } +if(!pool1) { AliError(Form("No pool found for centrality = %f, zVtx = %f", CentV0M,PVz)); return; } -if(pool->IsReady() || pool->NTracksInPool() > fPoolMinNTracks || pool->GetCurrentNEvents() >= fMinEventsToMix) { +if(pool1->IsReady() || pool1->NTracksInPool() > fPoolMinNTracks || pool1->GetCurrentNEvents() >= fMinEventsToMix) { -Int_t nMix = pool->GetCurrentNEvents(); +Int_t nMix = pool1->GetCurrentNEvents(); for (Int_t jMix=0; jMix< nMix; jMix++){ - TObjArray* bgTracks = pool->GetEvent(jMix); //bgTracks are from the mixed events + TObjArray* bgTracks = pool1->GetEvent(jMix); //bgTracks are from the mixed events for(Int_t iTrig(0); iTrig < fSelectedK0s->GetEntries(); iTrig++){ AliVParticle* K0Trig = dynamic_cast(fSelectedK0s->At(iTrig)); @@ -1022,16 +1188,195 @@ Int_t nMix = pool->GetCurrentNEvents(); TObjArray* tracksClone = (TObjArray*) fSelectedKCh->Clone(); tracksClone->SetOwner(kTRUE); - pool->UpdatePool(tracksClone); + pool1->UpdatePool(tracksClone); + +} + +//================== mixing ============================ (for k+k- CF) + +if (fKpKnCorr){ + +AliEventPool *pool2 = fPoolMgr->GetEventPool(CentV0M, PVz); +if(pool2) {cout << "Good news....!!!!!!! Pool found.. " << endl; } +if(!pool2) { AliError(Form("No pool found for centrality = %f, zVtx = %f", CentV0M,PVz)); return; } + +if(pool2->IsReady() || pool2->NTracksInPool() > fPoolMinNTracks || pool2->GetCurrentNEvents() >= fMinEventsToMix) { + +Int_t nMix = pool2->GetCurrentNEvents(); + + for (Int_t jMix=0; jMix< nMix; jMix++){ + TObjArray* bgTracks2 = pool2->GetEvent(jMix); //bgTracks are from the mixed events + + for(Int_t iTrig(0); iTrig < fSelectedKpos->GetEntries(); iTrig++){ + AliVParticle* KposTrig = dynamic_cast(fSelectedKpos->At(iTrig)); + if(!KposTrig) continue; + + for (Int_t iAss(0); iAss < bgTracks2->GetEntries(); iAss++){ + AliVParticle* KnegAssoc = dynamic_cast (bgTracks2->At(iAss)); + if(!KnegAssoc) continue; + + Double_t DPhiMix = fabs(KposTrig->Phi() - KnegAssoc->Phi()); + Double_t DEtaMix = fabs(KposTrig->Eta() - KnegAssoc->Eta()); + + if (DPhiMix > Pi) DPhiMix = Pi-(DPhiMix-Pi); + + fHistCF_KpKn_Bg->Fill(DPhiMix, DEtaMix); + fHistCF_KpKn_Bg->Fill(DPhiMix, -DEtaMix); + + if (DPhiMix < 0.5*Pi ) { + fHistCF_KpKn_Bg->Fill(-DPhiMix, DEtaMix); + fHistCF_KpKn_Bg->Fill(-DPhiMix,-DEtaMix); + } + else { + fHistCF_KpKn_Bg->Fill(2*Pi-(DPhiMix), DEtaMix); + fHistCF_KpKn_Bg->Fill(2*Pi-(DPhiMix),-DEtaMix); + } + + } //end of k- loop end + + } // end of k+ trigger loop + + } //end of mixing event loop + +}//end of pool +TObjArray* tracksClone2 = (TObjArray*) fSelectedKneg->Clone(); +tracksClone2->SetOwner(kTRUE); +pool2->UpdatePool(tracksClone2); + +} } //end of RunData function +//=================== MC Truth Correlation function ======== + +void AliAnalysisTaskKaon2PC::RunMC() { + +Int_t nAcceptedParticles =0; +AliMCParticle *mcTrack = 0x0; +fmcEvent = dynamic_cast (MCEvent()); +if(!fmcEvent){ + Printf("No MC particle branch found"); + return; + } + +AliVVertex * mcVertex = (AliVVertex*)fmcEvent->GetPrimaryVertex(); +fPV[2] = mcVertex->GetZ(); +if (TMath::Abs(fPV[2])>=10) return; + +Int_t nMCTracks = fmcEvent->GetNumberOfTracks(); // MC Truth, Total number of tracks per event +AliVTrack *genTrackMix = 0x0; + +for (Int_t i = 0; i < nMCTracks; i++){ + AliMCParticle *mcTrack = (AliMCParticle*)fmcEvent->GetTrack(i); + if (!mcTrack) { + Error("ReadEventAODMC", "Could not receive particle %d", i); + continue; + } + + Double_t trackPseudorap = mcTrack->Eta(); + if( mcTrack->IsPhysicalPrimary()&&mcTrack->Charge()!=0&&((trackPseudorap>-0.8&&trackPseudorap<0.8))) { + nAcceptedParticles += 1; + } + } + +cout << "number of accepted particles from MC tracks is"<< nAcceptedParticles << endl; +fHistGenMultiplicity->Fill(nAcceptedParticles); + +AliMCParticle *mcMotherParticle = 0x0; +AliMCParticle* daughter0 = 0x0; +AliMCParticle* daughter1 = 0x0; +Bool_t SelectK0; +Bool_t SelectKpos; +Bool_t SelectKneg; + +for (Int_t i = 0; i < nMCTracks; i++){ + mcTrack = (AliMCParticle*)fmcEvent->GetTrack(i); + if (!mcTrack) continue; + + Int_t mcPartPdg = mcTrack->PdgCode(); + Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); + + SelectK0 = mcPartPdg==310&& (isPhysPrim); // (8010 total. When we include only primary, 7546)-310 for neutral + SelectKpos = mcPartPdg==321&& (isPhysPrim); // 321 is the code for positive kaons + SelectKneg = mcPartPdg==-321&& (isPhysPrim); // 321 is the code for positive kaons + + Double_t TrackPt = mcTrack->Pt(); + Double_t TrackPhi = mcTrack->Phi(); + Double_t TrackEta = mcTrack->Eta(); + Double_t TrackMass = mcTrack->M(); + + Double_t KaonVariables[4]= {TrackPt, TrackPhi, TrackEta, TrackMass}; + if(SelectK0) fMCK0->Fill(KaonVariables); + if(SelectKpos) fMCKpos->Fill(KaonVariables); + if(SelectKneg) fMCKneg->Fill(KaonVariables); + + Bool_t TrIsPrim = mcTrack->IsPhysicalPrimary(); + Bool_t TrCharge = (mcTrack->Charge())!=0; + Short_t cha; + if (mcTrack->Charge()>0) cha=1.; + else if (mcTrack->Charge()<0) cha= -1.; + else cha =0; + +} + + +for (Int_t i = 0; i < nMCTracks; i++){ + AliMCParticle *mcTrack1 = (AliMCParticle*)fmcEvent->GetTrack(i); + if (!SelectKPosTracksMC(mcTrack1)) continue; + if (!mcTrack1) continue; + Double_t trackPseudorap = mcTrack1->Eta(); + if(! (mcTrack1->IsPhysicalPrimary()&&mcTrack1->Charge()!=0&&((trackPseudorap>-0.8&&trackPseudorap<0.8)))) continue; + Double_t phi1 = mcTrack1->Phi(); + Double_t eta1 = mcTrack1->Eta(); + + for (Int_t j = i+1; j < nMCTracks; j++){ + AliMCParticle *mcTrack2 = (AliMCParticle*)fmcEvent->GetTrack(j); + if (!SelectKNegTracksMC(mcTrack2)) continue; + if (!mcTrack2) continue; + Double_t trackPseudorap = mcTrack2->Eta(); + if(! (mcTrack2->IsPhysicalPrimary()&&mcTrack2->Charge()!=0&&((trackPseudorap>-0.8&&trackPseudorap<0.8)))) continue; + Double_t phi2 = mcTrack2->Phi(); + Double_t eta2 = mcTrack2->Eta(); + Double_t DEta = fabs(eta1 - eta2); + Double_t DPhi = fabs(phi1 - phi2); + Fill2DHistMCTruth(DPhi,DEta,fHistKpKnMC); + } + +} + +for (Int_t i = 0; i < nMCTracks; i++){ + AliMCParticle *mcTrack1 = (AliMCParticle*)fmcEvent->GetTrack(i); + if (!SelectK0TracksMC(mcTrack1)) continue; + if (!mcTrack1) continue; + Double_t trackPseudorap = mcTrack1->Eta(); + if(! (mcTrack1->IsPhysicalPrimary()&&mcTrack1->Charge()!=0&&((trackPseudorap>-0.8&&trackPseudorap<0.8)))) continue; + Double_t phi1 = mcTrack1->Phi(); + Double_t eta1 = mcTrack1->Eta(); + + for (Int_t j = i+1; j < nMCTracks; j++){ + AliMCParticle *mcTrack2 = (AliMCParticle*)fmcEvent->GetTrack(j); + if (!SelectKchTracksMC(mcTrack2)) continue; + if (!mcTrack2) continue; + Double_t trackPseudorap = mcTrack2->Eta(); + if(! (mcTrack2->IsPhysicalPrimary()&&mcTrack2->Charge()!=0&&((trackPseudorap>-0.8&&trackPseudorap<0.8)))) continue; + Double_t phi2 = mcTrack2->Phi(); + Double_t eta2 = mcTrack2->Eta(); + Double_t DEta = fabs(eta1 - eta2); + Double_t DPhi = fabs(phi1 - phi2); + Fill2DHistMCTruth(DPhi,DEta,fHistK0KchMC); + } + +} + +} + //_____________________________________________________________________________ void AliAnalysisTaskKaon2PC::UserExec(Option_t *) { if (!fAnalysisMC) { RunData(); } + if (fAnalysisMC) { RunMC(); } // deleting TObjArrays //fSelectedK0s->Clear(); @@ -1042,19 +1387,19 @@ void AliAnalysisTaskKaon2PC::UserExec(Option_t *) //==================== Filling functions ========================= -void AliAnalysisTaskKaon2PC::Fill2DHist(Double_t DPhi, Double_t DEta, TH3F* hist, Double_t fWeight=1){ +void AliAnalysisTaskKaon2PC::Fill2DHist(Double_t DPhi, Double_t DEta, TH2F* hist){ DPhi = fabs(DPhi); DEta = fabs(DEta); if (DPhi > Pi) DPhi = Pi-(DPhi-Pi); - hist->Fill(DPhi,DEta,fWeight); - hist->Fill(DPhi,-DEta,fWeight); + hist->Fill(DPhi,DEta); + hist->Fill(DPhi,-DEta); if (DPhi < 0.5*Pi ) { - hist->Fill(-DPhi, DEta,fWeight); - hist->Fill(-DPhi,-DEta,fWeight); + hist->Fill(-DPhi, DEta); + hist->Fill(-DPhi,-DEta); } else { - hist->Fill(2*Pi-(DPhi), DEta,fWeight); - hist->Fill(2*Pi-(DPhi),-DEta,fWeight); + hist->Fill(2*Pi-(DPhi), DEta); + hist->Fill(2*Pi-(DPhi),-DEta); } } @@ -1069,6 +1414,23 @@ void AliAnalysisTaskKaon2PC::FillDPhiHist(Double_t DPhi, TH2F* hist, Double_t fW hist->Fill(2*Pi-(DPhi),fWeight); } } + +void AliAnalysisTaskKaon2PC::Fill2DHistMCTruth(Double_t DPhi, Double_t DEta, TH2F* hist){ + DPhi = fabs(DPhi); + DEta = fabs(DEta); + if (DPhi > Pi) DPhi = Pi-(DPhi-Pi); + hist->Fill(DPhi,DEta); + hist->Fill(DPhi,-DEta); + if (DPhi < 0.5*Pi ) { + hist->Fill(-DPhi, DEta); + hist->Fill(-DPhi,-DEta); + } + else { + hist->Fill(2*Pi-(DPhi), DEta); + hist->Fill(2*Pi-(DPhi),-DEta); + } +} + //_____________________________________________________________________________ void AliAnalysisTaskKaon2PC::Terminate(Option_t *) { diff --git a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h index 406e72d347b..bddcfbfb620 100644 --- a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h +++ b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h @@ -23,6 +23,9 @@ class TH1F; class TH2F; class TH3F; class AliPIDResponse; +class AliMCParticle; +class THnSparse; +class AliAODv0; class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE { public: @@ -36,27 +39,37 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE Bool_t AcceptTrack(const AliAODTrack* Trk); Bool_t AcceptPosTrack(const AliAODTrack* Trk); Bool_t AcceptNegTrack(const AliAODTrack* Trk); + Double_t Beta(const AliAODTrack *track); Bool_t AcceptV0(const AliAODv0 *v0, Double_t *vertex); + Bool_t SelectK0TracksMC(AliMCParticle *mcTrack); + Bool_t SelectKPosTracksMC(AliMCParticle *mcTrack); + Bool_t SelectKNegTracksMC(AliMCParticle *mcTrack); + Bool_t SelectKchTracksMC(AliMCParticle *mcTrack); virtual void UserExec(Option_t* option); virtual void Terminate(Option_t* option); - virtual void Fill2DHist(Double_t DPhi, Double_t DEta, TH3F* hist, Double_t fWeight); + virtual void Fill2DHist(Double_t DPhi, Double_t DEta, TH2F* hist); virtual void FillDPhiHist(Double_t DPhi, TH2F* hist, Double_t fWeight); + virtual void Fill2DHistMCTruth(Double_t DPhi, Double_t DEta, TH2F* hist); AliEventCuts fEventCuts; // event cuts void SetMCRead(Bool_t flag) {fAnalysisMC = flag;} + void SetFilterBit(Int_t filterbit) {fBit = filterbit;} + //void SetPtLimits(Double_t ptmin, Double_t ptmax) { fLpTCut = ptmin; fUpTCut=ptmax; } + //void SetEtaLimit(Double_t etalimit) { fEta = etalimit; } //mixing //void SetNofSamples(Int_t n) { fNOfSamples = n; } //sampling setter void SetCentBinsForMixing(Int_t nofBins, std::vector bins) { fNCentBins = nofBins; fCentBins = bins; } private: void RunData(); - + void RunMC(); + AliAODEvent* fAOD; //! input event TList* fOutputList; //! output list AliPIDResponse* fPIDResponse; //! pid response object’ - TH1F* fEnergy; //! dummy histogram - TH1F* fEnergyCuts; //! dummy histogram + TH1F* fEnergy; //! dummy histogram + TH1F* fEnergyCuts; //! dummy histogram TH2F* fPID; //! dummy histogram TH2F* fPIDKaon; //! dummy histogram TH2F* fPIDK; //! dummy histogram @@ -66,11 +79,12 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE TH2F* fNsigmaTOFK; //! dummy histogram TH2F* fNsigmaTOFKaon; //! dummy histogram TH2F* fNsigmaTPCTOFK; //! dummy histogram + TH2F* fHistTOFKch; //! dummy histogram TH1F* fVtx; //! dummy histogram TH1F* fClusters; //! dummy histogram TH1F* fHistNEvents; //! dummy histogram - TH1F* fHistNV0; //! dummy histogram + TH1F* fHistNV0; //! dummy histogram TH1F* fHistEta; //! dummy histogram TH1F* fHistDEta; //! dummy histogram TH1F* fHistPhi; //! dummy histogram @@ -102,29 +116,44 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE TH2F* f2DHistNegEta; //! dummy histogram TH2F* f2DHistNegRap; //! dummy histogram - TH3F* fHistK0PhiEta; //! dummy histogram - TH3F* fHistPosPhiEta; //! dummy histogram - TH3F* fHistNegPhiEta; //! dummy histogram + TH2F* fHistK0PhiEta; //! dummy histogram + TH2F* fHistPosPhiEta; //! dummy histogram + TH2F* fHistNegPhiEta; //! dummy histogram TH2F* fHistCFPhi; //! dummy histogram TH2F* fHistCFEta; //! dummy histogram TH2F* fHistKChKChPhi; //! dummy histogram TH2F* fHistKPosKNegPhi; //! dummy histogram - TH3F* fHistCF; //! dummy histogram - TH3F* fHistKChKCh; //! dummy histogram - TH3F* fHistKPosKNeg; //! dummy histogram + TH2F* fHistCF; //! dummy histogram + TH2F* fHistKChKCh; //! dummy histogram + TH2F* fHistKPosKNeg; //! dummy histogram TH1F* hPt; TH1F* hPt_kPos; TH2F* fHistCF_Bg; + TH2F* fHistCF_KpKn_Bg; + + AliMCEvent* fmcEvent; + THnSparse* fMCK0; + THnSparse* fMCKpos; + THnSparse* fMCKneg; + TH2F* fHistKpKnMC; + TH2F* fHistK0KchMC; + TH1D* fHistGenMultiplicity; + Double_t fPV[3]; Bool_t fAnalysisMC; // enable MC study Bool_t fRejectEventPileUp; // enable to use Pile-up cuts + Bool_t fKpKnCorr; + Bool_t fK0KchCorr; Double_t PVx; Double_t PVy; Double_t PVz; + Double_t fBit; + Double_t fCentMin; + Double_t fCentMax; Double_t fLpTCut; //not a pointer??? Double_t fUpTCut; Double_t fEtaCut; @@ -146,6 +175,8 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE TObjArray* fSelectedKCh; //! TObjArray* fSelectedK0s; //! + TObjArray* fSelectedKpos; //! + TObjArray* fSelectedKneg; //! AliEventPoolManager* fPoolMgr; //! event pool manager for Event Mixing // Int_t fNOfSamples; // std::vector fsampleBins; //sampling From d79afa5c70b4bf66486fd7291b1bafc3e6f9a81b Mon Sep 17 00:00:00 2001 From: Anjaly Menon Date: Sat, 15 Apr 2023 16:45:14 -0500 Subject: [PATCH 04/51] Revert "added event mixing background for k+K- correlation" This reverts commit 4dc48530e3d383ae80ae102bcfd53cc276fef430. added event mixing background for k+K- correlation --- .../AliAnalysisTaskKaon2PC.cxx | 448 ++---------------- .../KaonCorrelations/AliAnalysisTaskKaon2PC.h | 53 +-- 2 files changed, 54 insertions(+), 447 deletions(-) diff --git a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx index 06300e05b4d..9c0f5246d12 100644 --- a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx +++ b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx @@ -64,9 +64,6 @@ fLpTCut(0.4), fUpTCut(0.8), fEtaCut(0.8), fSigCut(2.0), -fBit(96), -fCentMin(20), -fCentMax(30), //V0 cuts fDecayLv0Cut(8.05), fLpTv0Cut(0.4), @@ -91,7 +88,6 @@ fNsigmaKaon(0), fNsigmaTOFK(0), fNsigmaTOFKaon(0), fNsigmaTPCTOFK(0), -fHistTOFKch(0), //track and event observables fVtx(0), fClusters(0), @@ -142,16 +138,12 @@ fHistKPosKNeg(0), //mixing fSelectedKCh(0), fSelectedK0s(0), -fSelectedKpos(0), -fSelectedKneg(0), fPoolMgr(0x0), fPoolMaxNEvents(1000), fPoolMinNTracks(10000), fMinEventsToMix(10), fNzVtxBins(10), fNCentBins(15), -fKpKnCorr(kTRUE), -fK0KchCorr(kFALSE), /* fNOfSamples(1.0), fSampleIndex(0.0), @@ -159,14 +151,6 @@ fSampleIndex(0.0), hPt(0), hPt_kPos(0), fHistCF_Bg(0), -fHistCF_KpKn_Bg(0), -//MC Truth -fMCK0(0), -fMCKpos(0), -fMCKneg(0), -fHistKpKnMC(0), -fHistK0KchMC(0), -fHistGenMultiplicity(0), //eventcuts fEventCuts(0) @@ -187,9 +171,6 @@ fLpTCut(0.4), fUpTCut(0.8), fEtaCut(0.8), fSigCut(2.0), -fBit(96), -fCentMin(20), -fCentMax(30), //V0 cuts fDecayLv0Cut(8.05), fLpTv0Cut(0.4), @@ -214,7 +195,6 @@ fNsigmaKaon(0), fNsigmaTOFK(0), fNsigmaTOFKaon(0), fNsigmaTPCTOFK(0), -fHistTOFKch(0), //track and event observables fVtx(0), fClusters(0), @@ -265,16 +245,12 @@ fHistKPosKNeg(0), //mixing fSelectedKCh(0), fSelectedK0s(0), -fSelectedKpos(0), -fSelectedKneg(0), fPoolMgr(0x0), fPoolMaxNEvents(1000), fPoolMinNTracks(10000), fMinEventsToMix(10), fNzVtxBins(10), fNCentBins(15), -fKpKnCorr(kTRUE), -fK0KchCorr(kFALSE), /* fNOfSamples(1.0), fSampleIndex(0.0), @@ -282,14 +258,6 @@ fSampleIndex(0.0), hPt(0), hPt_kPos(0), fHistCF_Bg(0), -fHistCF_KpKn_Bg(0), -//MC Truth -fMCK0(0), -fMCKpos(0), -fMCKneg(0), -fHistKpKnMC(0), -fHistK0KchMC(0), -fHistGenMultiplicity(0), //eventcuts fEventCuts(0) @@ -308,8 +276,6 @@ AliAnalysisTaskKaon2PC::~AliAnalysisTaskKaon2PC() } if(fSelectedK0s) delete fSelectedK0s; if(fSelectedKCh) delete fSelectedKCh; - if(fSelectedKpos) delete fSelectedKpos; - if(fSelectedKneg) delete fSelectedKneg; } //_____________________________________________________________________________ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() @@ -321,7 +287,6 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() // to an output file. fzVtxBins = {-10.0,-8.0,-6.0,-4.0,-2.0,0.0,2.0,4.0,6.0,8.0,10.0}; // 10 bins - //fzVtxBins = {-10.0,-9.0,-8.0,-7.0,-6.0,-5.0,-4.0,-3.0,-2.0,-1.0,0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0}; // 20 bins //fCentBins = {0,5,10,15,20,25,30,35,40,45,50,60,70,80,90,100}; fCentBins = { 0, 1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100.1 }; // 15 bins //fsampleBins = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}; @@ -390,9 +355,6 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fNsigmaTPCTOFK->GetYaxis()->SetTitle("n#sigma_{TOF} of Kaon"); fNsigmaTPCTOFK->SetOption("colz"); - fHistTOFKch = new TH2F("fHistTOFKch", "", 500, 0.2,2,700,0,2); - //fHistTOFKch->SetOption(); - //track and event observables fVtx = new TH1F("fVtx", "PV_{z} distribution of Tracks", 100, -13, 13); fClusters = new TH1F("fClusters", "TPCClusters distribution", 500, 1, 170); @@ -476,15 +438,15 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() f2DHistNegRap->GetXaxis()->SetTitle("Rapidity"); f2DHistNegRap->SetOption("colz"); - fHistPosPhiEta = new TH2F("fHistPosPhiEta", "",60,0,2*Pi, 60,-0.8, 0.8); + fHistPosPhiEta = new TH3F("fHistPosPhiEta", "",60,0,2*Pi, 60,-0.8, 0.8,100,0,100); fHistPosPhiEta->GetXaxis()->SetTitle("Track Eta"); fHistPosPhiEta->SetOption("SURF1"); - fHistNegPhiEta = new TH2F("fHistNegPhiEta", "",60,0,2*Pi, 60,-0.8, 0.8); + fHistNegPhiEta = new TH3F("fHistNegPhiEta", "",60,0,2*Pi, 60,-0.8, 0.8,100,0,100); fHistNegPhiEta->GetXaxis()->SetTitle("Track Eta"); fHistNegPhiEta->SetOption("SURF1"); - fHistK0PhiEta = new TH2F("fHistK0PhiEta", "", 60,0,2*Pi,60,-0.8, 0.8); + fHistK0PhiEta = new TH3F("fHistK0PhiEta", "", 60,0,2*Pi,60,-0.8, 0.8,100,0,100); fHistK0PhiEta->GetXaxis()->SetTitle("V0 Phi (in radians)"); fHistK0PhiEta->SetOption("SURF1"); @@ -504,17 +466,17 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fHistKChKChPhi = new TH2F("fHistKChKChPhi", "C(#Delta#phi) of Kch-Kch ",32,-0.5*Pi,1.5*Pi,100,0,100); fHistKChKChPhi->SetOption("SURF1"); - fHistCF = new TH2F("fHistCF","Number of pairs of K^{+/-} and K^{0}",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); + fHistCF = new TH3F("fHistCF","Number of pairs of K^{+/-} and K^{0}",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6,100,0,100 ); fHistCF->GetXaxis()->SetTitle("#Delta#phi "); fHistCF->GetYaxis()->SetTitle("#Delta#eta"); fHistCF->SetOption("SURF1"); - fHistKPosKNeg = new TH2F("fHistKPosKNeg","K^{+}-K^{-} Correlation",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); + fHistKPosKNeg = new TH3F("fHistKPosKNeg","K^{+}-K^{-} Correlation",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6,100,0,100 ); fHistKPosKNeg->GetXaxis()->SetTitle("#Delta#phi "); fHistKPosKNeg->GetYaxis()->SetTitle("#Delta#eta"); fHistKPosKNeg->SetOption("SURF1"); - fHistKChKCh = new TH2F("fHistKChKCh","Kch-Kch Correlation",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); + fHistKChKCh = new TH3F("fHistKChKCh","Kch-Kch Correlation",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6,100,0,100 ); fHistKChKCh->GetXaxis()->SetTitle("#Delta#phi "); fHistKChKCh->GetYaxis()->SetTitle("#Delta#eta"); fHistKChKCh->SetOption("SURF1"); @@ -525,51 +487,9 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fHistCF_Bg = new TH2F("fHistCF_Bg","Background for CF of K^{+/-} and K^{0}",32,-0.5*Pi,1.5*Pi,32,-1.6,1.6); fHistCF_Bg->SetOption("SURF1"); - fHistCF_KpKn_Bg = new TH2F("fHistCF_KpKn_Bg","Background for CF of K^{+} and K^{-}",32,-0.5*Pi,1.5*Pi,32,-1.6,1.6); - fHistCF_KpKn_Bg->SetOption("SURF1"); - - hPt = new TH1F("hPt", "Track pT distribution", 100, 0, 2); hPt_kPos = new TH1F("hPt_kPos", "Track pT distribution", 100, 0, 2); - // MC Truth histograms - - //+++++++++++++++++++++ MC ++++++++++++++++++++++++++ - - Int_t bins[4] = {100,32,32,100}; - Double_t min[4] = {0.2,0,-0.8,0.4}; - Double_t max[4] = {1.0,2*Pi,0.8,0.6}; - - fMCK0 = new THnSparseF("fMCK0","fMCK0",4,bins,min,max); - fMCK0->GetAxis(0)->SetTitle("p_{T} of K^{0}_{S}"); - fMCK0->GetAxis(1)->SetTitle("#phi"); - fMCK0->GetAxis(2)->SetTitle("#eta"); - fMCK0->GetAxis(3)->SetTitle("mass"); - - fMCKpos = new THnSparseF("fMCKpos","fMCKpos",4,bins,min,max); - fMCKpos->GetAxis(0)->SetTitle("p_{T} of K^{+}"); - fMCKpos->GetAxis(1)->SetTitle("#phi of K^{+}"); - fMCKpos->GetAxis(2)->SetTitle("#eta of K^{+}"); - fMCKpos->GetAxis(3)->SetTitle("mass of K^{+}"); - - fMCKneg = new THnSparseF("fMCKneg","fMCKneg",4,bins,min,max); - fMCKneg->GetAxis(0)->SetTitle("p_{T} of K^{-}"); - fMCKneg->GetAxis(1)->SetTitle("#phi of K^{-}"); - fMCKneg->GetAxis(2)->SetTitle("#eta of K^{-}"); - fMCKneg->GetAxis(3)->SetTitle("mass of K^{-}"); - - fHistKpKnMC = new TH2F("fHistKpKnMC","K^{+}-K^{-} Correlation for MC Truth",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); - fHistKpKnMC->GetXaxis()->SetTitle("#Delta#phi "); - fHistKpKnMC->GetYaxis()->SetTitle("#Delta#eta"); - fHistKpKnMC->SetOption("SURF1"); - - fHistK0KchMC = new TH2F("fHistK0KchMC","K^{+}-K^{-} Correlation for MC Truth",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); - fHistK0KchMC->GetXaxis()->SetTitle("#Delta#phi "); - fHistK0KchMC->GetYaxis()->SetTitle("#Delta#eta"); - fHistK0KchMC->SetOption("SURF1"); - - fHistGenMultiplicity = new TH1D ("fHistGenMultiplicity","fHistGenMultiplicity",500,0,500); - fOutputList->Add(fEnergy); fOutputList->Add(fEnergyCuts); fOutputList->Add(fPID); @@ -581,7 +501,6 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fOutputList->Add(fNsigmaTOFK); fOutputList->Add(fNsigmaTOFKaon); fOutputList->Add(fNsigmaTPCTOFK); - fOutputList->Add(fHistTOFKch); fOutputList->Add(fVtx); fOutputList->Add(fClusters); @@ -633,14 +552,6 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fOutputList->Add(hPt_kPos); fOutputList->Add(fHistCF_Bg); - fOutputList->Add(fHistCF_KpKn_Bg); - - fOutputList->Add(fMCK0); - fOutputList->Add(fMCKpos); - fOutputList->Add(fMCKneg); - fOutputList->Add(fHistKpKnMC); - fOutputList->Add(fHistK0KchMC); - fOutputList->Add(fHistGenMultiplicity); fEventCuts.AddQAplotsToList(fOutputList); PostData(1, fOutputList); @@ -683,15 +594,11 @@ Bool_t AliAnalysisTaskKaon2PC::AcceptTrack(const AliAODTrack *Trk) { Double_t nSigmaTOFkaon = fPIDResponse->NumberOfSigmasTOF(Trk, AliPID::kKaon); Double_t nSigmaTOFelectron = fPIDResponse->NumberOfSigmasTOF(Trk, AliPID::kElectron); Double_t nSigmaTOFpion = fPIDResponse->NumberOfSigmasTOF(Trk, AliPID::kPion); + if (fabs(nSigmakaon) > fSigCut) return kFALSE; if (fabs(nSigmaelectron) < 2.0) return kFALSE; // excluding electrons via TPC if (fabs(nSigmapion) < 2.0) return kFALSE; // excluding pions via TPC if (fabs(nSigmaproton) < 2.0) return kFALSE; // excluding pions via TPC - //if (fabs(nSigmakaon < 3.0) && (nSigmapion < 3.0)) return kFALSE; - //if (fabs(nSigmakaon < 3.0) && (nSigmaproton < 3.0)) return kFALSE; - //if (fabs(nSigmakaon < 3.0) && (nSigmaelectron < 3.0)) return kFALSE; - if (fabs(nSigmakaon) > fSigCut) return kFALSE; - if (fabs(nSigmaTOFkaon) > 3.0) return kFALSE; - + return kTRUE; } @@ -710,21 +617,6 @@ Bool_t AliAnalysisTaskKaon2PC::AcceptNegTrack(const AliAODTrack *Trk) { return kTRUE; } - -//_____________________________________________________________________________ - -Double_t AliAnalysisTaskKaon2PC::Beta(const AliAODTrack *track) -{ - Double_t startTime = fPIDResponse->GetTOFResponse().GetStartTime(((AliVTrack*)track)->P()); //in ps - Double_t stoptime = track->GetTOFsignal(); - Double_t c = TMath::C()*1.E-9; // m/ns - Double_t length = fPIDResponse->GetTOFResponse().GetExpectedSignal(track,AliPID::kKaon)*1E-3*c; - stoptime -= startTime; - Double_t scaleStopTime = stoptime*1E-3; - scaleStopTime = scaleStopTime*c; - return length/scaleStopTime; -} - //___________________________ v0 selection with no pT cut _________________________ Bool_t AliAnalysisTaskKaon2PC::AcceptV0(const AliAODv0 *v0, Double_t *vertex) { @@ -732,23 +624,23 @@ Bool_t AliAnalysisTaskKaon2PC::AcceptV0(const AliAODv0 *v0, Double_t *vertex) { if (v0->GetOnFlyStatus()) return kFALSE; Double_t length = v0->DecayLengthV0(vertex); if (length > fDecayLv0Cut) return kFALSE; - Double_t dcaDau = v0->DcaV0Daughters(); - if (TMath::Abs(dcaDau) > 0.8) return kFALSE; + Double_t dcaDau =v0->DcaV0Daughters(); + if (dcaDau > 0.8) return kFALSE; Double_t pT = v0->Pt(); //Double_t pT=TMath::Sqrt(v0->Pt2V0()); if (fabs(v0->Eta()) > fEtav0Cut) return kFALSE; Double_t DCAtoPV = v0->DcaV0ToPrimVertex(); if (DCAtoPV > 0.1 ) return kFALSE; Double_t dcaPosToPV = v0->DcaPosToPrimVertex(); - if (TMath::Abs(dcaPosToPV) < fDcaPosToPrimVtxv0Cut && fDcaPosToPrimVtxv0Cut != -999) return kFALSE; + if (dcaPosToPV < fDcaPosToPrimVtxv0Cut) return kFALSE; Double_t dcaNegToPV = v0->DcaNegToPrimVertex(); - if (TMath::Abs(dcaNegToPV) < fDcaNegToPrimVtxv0Cut && fDcaNegToPrimVtxv0Cut != -999) return kFALSE; + if (dcaNegToPV < fDcaNegToPrimVtxv0Cut) return kFALSE; Double_t etaPos = v0->PseudoRapPos(); - if (fabs(etaPos) > fEtaPosv0Cut && fEtaPosv0Cut != -999) return kFALSE; + if (fabs(etaPos) > fEtaPosv0Cut) return kFALSE; Double_t etaNeg = v0->PseudoRapNeg(); - if (fabs(etaNeg) > fEtaNegv0Cut && fEtaNegv0Cut != -999) return kFALSE; + if (fabs(etaNeg) > fEtaNegv0Cut) return kFALSE; Double_t cosPA= v0->CosPointingAngle(vertex); - if (cosPA < fCosPACut && fCosPACut != -999) return kFALSE; + if (cosPA < fCosPACut) return kFALSE; Double_t armpt = v0->PtArmV0(); Double_t alpha = v0->AlphaV0(); if (armpt < 0.2*fabs(alpha)) return kFALSE; @@ -770,41 +662,6 @@ Bool_t AliAnalysisTaskKaon2PC::AcceptV0(const AliAODv0 *v0, Double_t *vertex) { return kTRUE; } -// MC Truth Booleans - -Bool_t AliAnalysisTaskKaon2PC::SelectK0TracksMC(AliMCParticle *mcTrack ) { - Int_t mcPartPdg = mcTrack->PdgCode(); - Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); - Bool_t SelectK0 = mcPartPdg==310&& (isPhysPrim); - if (SelectK0) return kFALSE; - return kTRUE; -} - -Bool_t AliAnalysisTaskKaon2PC::SelectKPosTracksMC(AliMCParticle *mcTrack ) { - Int_t mcPartPdg = mcTrack->PdgCode(); - Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); - Bool_t SelectKpos = mcPartPdg==321&& (isPhysPrim); - if (SelectKpos) return kFALSE; - return kTRUE; -} - -Bool_t AliAnalysisTaskKaon2PC::SelectKNegTracksMC(AliMCParticle *mcTrack ) { - Int_t mcPartPdg = mcTrack->PdgCode(); - Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); - Bool_t SelectKneg = mcPartPdg==-321&& (isPhysPrim); - if (SelectKneg) return kFALSE; - return kTRUE; -} - -Bool_t AliAnalysisTaskKaon2PC::SelectKchTracksMC(AliMCParticle *mcTrack ) { - Int_t mcPartPdg = mcTrack->PdgCode(); - Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); - Bool_t SelectKch = mcPartPdg==321&& mcPartPdg==-321&& (isPhysPrim); - if (SelectKch) return kFALSE; - return kTRUE; -} - - //_____________________________________________________________________________ void AliAnalysisTaskKaon2PC::RunData() { @@ -836,13 +693,13 @@ void AliAnalysisTaskKaon2PC::RunData() { fVtx->Fill(PVz); //Multiplicity selection - //AliMultSelection *MultSelection = (AliMultSelection*)fAOD->FindListObject("MultSelection"); - //if(!MultSelection) return; + AliMultSelection *MultSelection = (AliMultSelection*)fAOD->FindListObject("MultSelection"); + if(!MultSelection) return; //centrality - //double CentV0M = MultSelection->GetMultiplicityPercentile("V0M"); //centrality - Double_t CentV0M = fEventCuts.GetCentrality(); //centrality - if ((CentV0M < fCentMin)||(CentV0M > fCentMax)) return; + double CentV0M = MultSelection->GetMultiplicityPercentile("V0M"); //centrality + + //if (40.0 < CentV0M >90.0) return; //======== PID loop (no pT cut) =========== @@ -936,14 +793,14 @@ void AliAnalysisTaskKaon2PC::RunData() { Double_t DPhi = fabs(track1Phi - track2Phi); FillDPhiHist(DPhi,fHistKChKChPhi,CentV0M); - Fill2DHist(DPhi,DEta,fHistKChKCh); + Fill2DHist(DPhi,DEta,fHistKChKCh,CentV0M); } } //======== K+K- Correlation Loop ========== - for(Int_t i(0); i < fSelectedKpos->GetEntriesFast(); i++) { + for(Int_t i(0); i < iTracks; i++) { AliAODTrack* track1 = dynamic_cast(fAOD->GetTrack(i)); if(!track1) continue; if (!AcceptTrack(track1)) continue; @@ -952,7 +809,7 @@ void AliAnalysisTaskKaon2PC::RunData() { Double_t track1PosPhi = track1->Phi(); Double_t track1PosEta = track1->Eta(); - for(Int_t j(0); j < fSelectedKneg->GetEntriesFast(); j++) { + for(Int_t j(0); j < iTracks; j++) { AliAODTrack* track2 = dynamic_cast(fAOD->GetTrack(j)); if(!track2) continue; if (!AcceptTrack(track2)) continue; @@ -965,7 +822,7 @@ void AliAnalysisTaskKaon2PC::RunData() { Double_t DEtaPN = fabs(track1PosEta - track2NegEta); FillDPhiHist(DPhiPN,fHistKPosKNegPhi,CentV0M); - Fill2DHist(DPhiPN,DEtaPN,fHistKPosKNeg); + Fill2DHist(DPhiPN,DEtaPN,fHistKPosKNeg,CentV0M); } } @@ -974,27 +831,16 @@ void AliAnalysisTaskKaon2PC::RunData() { fSelectedKCh = new TObjArray; fSelectedKCh->SetOwner(kTRUE); -fSelectedKpos = new TObjArray; -fSelectedKpos->SetOwner(kTRUE); - -fSelectedKneg = new TObjArray; -fSelectedKneg->SetOwner(kTRUE); - for(Int_t i=0; i < iTracks; i++) { AliAODTrack* track = dynamic_cast(fAOD->GetTrack(i)); if(!track) continue; if (!AcceptTrack(track)) continue; - Double_t TOFsignal = track->GetTOFsignal(); + fSelectedKCh->Add((AliAODTrack*)track); - Float_t beta = 0.0; - beta = Beta(track); Int_t chargetrack = track->Charge(); Double_t trackPhi = track->Phi(); Double_t trackEta = track->Eta(); Double_t trackPt = track->Pt(); - //cout << "TOFsignal is" << TOFsignal << endl; - fHistTOFKch->Fill(trackPt, beta); - fSelectedKCh->Add((AliAODTrack*)track); //fill single particle charged kaon histograms fHistKChPhi->Fill(trackPhi); @@ -1004,19 +850,17 @@ for(Int_t i=0; i < iTracks; i++) { f2DHistChRap->Fill(track->Y(),CentV0M); if (chargetrack > 0) { - fSelectedKpos->Add((AliAODTrack*)track); fHistKpPhi->Fill(trackPhi); f2DHistPosPhi->Fill(trackPhi,CentV0M); f2DHistPosEta->Fill(trackEta,CentV0M); - fHistPosPhiEta->Fill(trackPhi,trackEta); + fHistPosPhiEta->Fill(trackPhi,trackEta,CentV0M); f2DHistPosRap->Fill(track->Y(0.493),CentV0M); } if (chargetrack < 0) { - fSelectedKneg->Add((AliAODTrack*)track); fHistKnPhi->Fill(trackPhi); f2DHistNegPhi->Fill(trackPhi,CentV0M); f2DHistNegEta->Fill(trackEta,CentV0M); - fHistNegPhiEta->Fill(trackPhi,trackEta); + fHistNegPhiEta->Fill(trackPhi,trackEta,CentV0M); f2DHistNegRap->Fill(track->Y(0.493),CentV0M); } fHistPhi->Fill(track->Phi()); @@ -1026,12 +870,6 @@ for(Int_t i=0; i < iTracks; i++) { Int_t nSelectedKCh = fSelectedKCh->GetEntries(); cout << " nSelectedKCh is " << nSelectedKCh << endl; -Int_t nSelectedKpos = fSelectedKpos->GetEntries(); -cout << " nSelectedKpos is " << nSelectedKpos << endl; - -Int_t nSelectedKneg = fSelectedKneg->GetEntries(); -cout << " nSelectedKneg is " << nSelectedKneg << endl; - //======== Neutral Kaon Selection ========== fSelectedK0s = new TObjArray; fSelectedK0s->SetOwner(kTRUE); @@ -1056,7 +894,7 @@ for(Int_t j=0; j < nv0s; j++) { fSelectedK0s->Add(v0); //fill single particle neutral kaon histograms fHistK0Phi->Fill(V0Phi); - fHistK0PhiEta->Fill(V0Phi,V0Eta); + fHistK0PhiEta->Fill(V0Phi,V0Eta,CentV0M); f2DHistK0Phi->Fill(V0Phi,CentV0M); f2DHistK0Eta->Fill(V0Eta,CentV0M); fHistPPionPhi->Fill(pTrack->Phi()); @@ -1065,9 +903,6 @@ for(Int_t j=0; j < nv0s; j++) { Int_t nSelectedK0s = fSelectedK0s->GetEntries(); cout << " nSelectedK0s is " << nSelectedK0s << endl; -//((TH1F*)((AliDirList*)fOutput3->FindObject("Track"))->FindObject("nTracksBf"))->Fill(nTracks); -//((TH1F*)((AliDirList*)fOutput3->FindObject("Track"))->FindObject("nTracksAf"))->Fill(nSelectedTracks); - //======== Kch-K0s Correlation Analysis ========== for(Int_t i = 0; i < fSelectedK0s->GetEntriesFast(); i++){ AliAODv0 * v0 = (AliAODv0*)fSelectedK0s->At(i); @@ -1119,7 +954,7 @@ cout << " nSelectedK0s is " << nSelectedK0s << endl; fHistCFPhi->Fill(2*Pi-(deltaPhi),-deltaEta); } - Fill2DHist(deltaPhi,deltaEta,fHistCF); + Fill2DHist(deltaPhi,deltaEta,fHistCF,CentV0M); if (deltaPhi > Pi) deltaPhi = Pi-(deltaPhi-Pi); fHistDPhi->Fill(deltaPhi); @@ -1140,18 +975,17 @@ fHistMult->Fill(iTracks); fHistCent->Fill(CentV0M); //================== mixing ============================ (You can create a seperate function FillCorrelationsMixed() later) -if (fK0KchCorr){ -AliEventPool *pool1 = fPoolMgr->GetEventPool(CentV0M, PVz); -if(pool1) {cout << "Good news....!!!!!!! Pool found.. " << endl; } -if(!pool1) { AliError(Form("No pool found for centrality = %f, zVtx = %f", CentV0M,PVz)); return; } +AliEventPool *pool = fPoolMgr->GetEventPool(CentV0M, PVz); +if(pool) {cout << "Good news....!!!!!!! Pool found.. " << endl; } +if(!pool) { AliError(Form("No pool found for centrality = %f, zVtx = %f", CentV0M,PVz)); return; } -if(pool1->IsReady() || pool1->NTracksInPool() > fPoolMinNTracks || pool1->GetCurrentNEvents() >= fMinEventsToMix) { +if(pool->IsReady() || pool->NTracksInPool() > fPoolMinNTracks || pool->GetCurrentNEvents() >= fMinEventsToMix) { -Int_t nMix = pool1->GetCurrentNEvents(); +Int_t nMix = pool->GetCurrentNEvents(); for (Int_t jMix=0; jMix< nMix; jMix++){ - TObjArray* bgTracks = pool1->GetEvent(jMix); //bgTracks are from the mixed events + TObjArray* bgTracks = pool->GetEvent(jMix); //bgTracks are from the mixed events for(Int_t iTrig(0); iTrig < fSelectedK0s->GetEntries(); iTrig++){ AliVParticle* K0Trig = dynamic_cast(fSelectedK0s->At(iTrig)); @@ -1188,195 +1022,16 @@ Int_t nMix = pool1->GetCurrentNEvents(); TObjArray* tracksClone = (TObjArray*) fSelectedKCh->Clone(); tracksClone->SetOwner(kTRUE); - pool1->UpdatePool(tracksClone); - -} - -//================== mixing ============================ (for k+k- CF) - -if (fKpKnCorr){ - -AliEventPool *pool2 = fPoolMgr->GetEventPool(CentV0M, PVz); -if(pool2) {cout << "Good news....!!!!!!! Pool found.. " << endl; } -if(!pool2) { AliError(Form("No pool found for centrality = %f, zVtx = %f", CentV0M,PVz)); return; } - -if(pool2->IsReady() || pool2->NTracksInPool() > fPoolMinNTracks || pool2->GetCurrentNEvents() >= fMinEventsToMix) { - -Int_t nMix = pool2->GetCurrentNEvents(); - - for (Int_t jMix=0; jMix< nMix; jMix++){ - TObjArray* bgTracks2 = pool2->GetEvent(jMix); //bgTracks are from the mixed events - - for(Int_t iTrig(0); iTrig < fSelectedKpos->GetEntries(); iTrig++){ - AliVParticle* KposTrig = dynamic_cast(fSelectedKpos->At(iTrig)); - if(!KposTrig) continue; - - for (Int_t iAss(0); iAss < bgTracks2->GetEntries(); iAss++){ - AliVParticle* KnegAssoc = dynamic_cast (bgTracks2->At(iAss)); - if(!KnegAssoc) continue; - - Double_t DPhiMix = fabs(KposTrig->Phi() - KnegAssoc->Phi()); - Double_t DEtaMix = fabs(KposTrig->Eta() - KnegAssoc->Eta()); - - if (DPhiMix > Pi) DPhiMix = Pi-(DPhiMix-Pi); - - fHistCF_KpKn_Bg->Fill(DPhiMix, DEtaMix); - fHistCF_KpKn_Bg->Fill(DPhiMix, -DEtaMix); - - if (DPhiMix < 0.5*Pi ) { - fHistCF_KpKn_Bg->Fill(-DPhiMix, DEtaMix); - fHistCF_KpKn_Bg->Fill(-DPhiMix,-DEtaMix); - } - else { - fHistCF_KpKn_Bg->Fill(2*Pi-(DPhiMix), DEtaMix); - fHistCF_KpKn_Bg->Fill(2*Pi-(DPhiMix),-DEtaMix); - } - - } //end of k- loop end - - } // end of k+ trigger loop - - } //end of mixing event loop - -}//end of pool + pool->UpdatePool(tracksClone); -TObjArray* tracksClone2 = (TObjArray*) fSelectedKneg->Clone(); -tracksClone2->SetOwner(kTRUE); -pool2->UpdatePool(tracksClone2); - -} } //end of RunData function -//=================== MC Truth Correlation function ======== - -void AliAnalysisTaskKaon2PC::RunMC() { - -Int_t nAcceptedParticles =0; -AliMCParticle *mcTrack = 0x0; -fmcEvent = dynamic_cast (MCEvent()); -if(!fmcEvent){ - Printf("No MC particle branch found"); - return; - } - -AliVVertex * mcVertex = (AliVVertex*)fmcEvent->GetPrimaryVertex(); -fPV[2] = mcVertex->GetZ(); -if (TMath::Abs(fPV[2])>=10) return; - -Int_t nMCTracks = fmcEvent->GetNumberOfTracks(); // MC Truth, Total number of tracks per event -AliVTrack *genTrackMix = 0x0; - -for (Int_t i = 0; i < nMCTracks; i++){ - AliMCParticle *mcTrack = (AliMCParticle*)fmcEvent->GetTrack(i); - if (!mcTrack) { - Error("ReadEventAODMC", "Could not receive particle %d", i); - continue; - } - - Double_t trackPseudorap = mcTrack->Eta(); - if( mcTrack->IsPhysicalPrimary()&&mcTrack->Charge()!=0&&((trackPseudorap>-0.8&&trackPseudorap<0.8))) { - nAcceptedParticles += 1; - } - } - -cout << "number of accepted particles from MC tracks is"<< nAcceptedParticles << endl; -fHistGenMultiplicity->Fill(nAcceptedParticles); - -AliMCParticle *mcMotherParticle = 0x0; -AliMCParticle* daughter0 = 0x0; -AliMCParticle* daughter1 = 0x0; -Bool_t SelectK0; -Bool_t SelectKpos; -Bool_t SelectKneg; - -for (Int_t i = 0; i < nMCTracks; i++){ - mcTrack = (AliMCParticle*)fmcEvent->GetTrack(i); - if (!mcTrack) continue; - - Int_t mcPartPdg = mcTrack->PdgCode(); - Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); - - SelectK0 = mcPartPdg==310&& (isPhysPrim); // (8010 total. When we include only primary, 7546)-310 for neutral - SelectKpos = mcPartPdg==321&& (isPhysPrim); // 321 is the code for positive kaons - SelectKneg = mcPartPdg==-321&& (isPhysPrim); // 321 is the code for positive kaons - - Double_t TrackPt = mcTrack->Pt(); - Double_t TrackPhi = mcTrack->Phi(); - Double_t TrackEta = mcTrack->Eta(); - Double_t TrackMass = mcTrack->M(); - - Double_t KaonVariables[4]= {TrackPt, TrackPhi, TrackEta, TrackMass}; - if(SelectK0) fMCK0->Fill(KaonVariables); - if(SelectKpos) fMCKpos->Fill(KaonVariables); - if(SelectKneg) fMCKneg->Fill(KaonVariables); - - Bool_t TrIsPrim = mcTrack->IsPhysicalPrimary(); - Bool_t TrCharge = (mcTrack->Charge())!=0; - Short_t cha; - if (mcTrack->Charge()>0) cha=1.; - else if (mcTrack->Charge()<0) cha= -1.; - else cha =0; - -} - - -for (Int_t i = 0; i < nMCTracks; i++){ - AliMCParticle *mcTrack1 = (AliMCParticle*)fmcEvent->GetTrack(i); - if (!SelectKPosTracksMC(mcTrack1)) continue; - if (!mcTrack1) continue; - Double_t trackPseudorap = mcTrack1->Eta(); - if(! (mcTrack1->IsPhysicalPrimary()&&mcTrack1->Charge()!=0&&((trackPseudorap>-0.8&&trackPseudorap<0.8)))) continue; - Double_t phi1 = mcTrack1->Phi(); - Double_t eta1 = mcTrack1->Eta(); - - for (Int_t j = i+1; j < nMCTracks; j++){ - AliMCParticle *mcTrack2 = (AliMCParticle*)fmcEvent->GetTrack(j); - if (!SelectKNegTracksMC(mcTrack2)) continue; - if (!mcTrack2) continue; - Double_t trackPseudorap = mcTrack2->Eta(); - if(! (mcTrack2->IsPhysicalPrimary()&&mcTrack2->Charge()!=0&&((trackPseudorap>-0.8&&trackPseudorap<0.8)))) continue; - Double_t phi2 = mcTrack2->Phi(); - Double_t eta2 = mcTrack2->Eta(); - Double_t DEta = fabs(eta1 - eta2); - Double_t DPhi = fabs(phi1 - phi2); - Fill2DHistMCTruth(DPhi,DEta,fHistKpKnMC); - } - -} - -for (Int_t i = 0; i < nMCTracks; i++){ - AliMCParticle *mcTrack1 = (AliMCParticle*)fmcEvent->GetTrack(i); - if (!SelectK0TracksMC(mcTrack1)) continue; - if (!mcTrack1) continue; - Double_t trackPseudorap = mcTrack1->Eta(); - if(! (mcTrack1->IsPhysicalPrimary()&&mcTrack1->Charge()!=0&&((trackPseudorap>-0.8&&trackPseudorap<0.8)))) continue; - Double_t phi1 = mcTrack1->Phi(); - Double_t eta1 = mcTrack1->Eta(); - - for (Int_t j = i+1; j < nMCTracks; j++){ - AliMCParticle *mcTrack2 = (AliMCParticle*)fmcEvent->GetTrack(j); - if (!SelectKchTracksMC(mcTrack2)) continue; - if (!mcTrack2) continue; - Double_t trackPseudorap = mcTrack2->Eta(); - if(! (mcTrack2->IsPhysicalPrimary()&&mcTrack2->Charge()!=0&&((trackPseudorap>-0.8&&trackPseudorap<0.8)))) continue; - Double_t phi2 = mcTrack2->Phi(); - Double_t eta2 = mcTrack2->Eta(); - Double_t DEta = fabs(eta1 - eta2); - Double_t DPhi = fabs(phi1 - phi2); - Fill2DHistMCTruth(DPhi,DEta,fHistK0KchMC); - } - -} - -} - //_____________________________________________________________________________ void AliAnalysisTaskKaon2PC::UserExec(Option_t *) { if (!fAnalysisMC) { RunData(); } - if (fAnalysisMC) { RunMC(); } // deleting TObjArrays //fSelectedK0s->Clear(); @@ -1387,19 +1042,19 @@ void AliAnalysisTaskKaon2PC::UserExec(Option_t *) //==================== Filling functions ========================= -void AliAnalysisTaskKaon2PC::Fill2DHist(Double_t DPhi, Double_t DEta, TH2F* hist){ +void AliAnalysisTaskKaon2PC::Fill2DHist(Double_t DPhi, Double_t DEta, TH3F* hist, Double_t fWeight=1){ DPhi = fabs(DPhi); DEta = fabs(DEta); if (DPhi > Pi) DPhi = Pi-(DPhi-Pi); - hist->Fill(DPhi,DEta); - hist->Fill(DPhi,-DEta); + hist->Fill(DPhi,DEta,fWeight); + hist->Fill(DPhi,-DEta,fWeight); if (DPhi < 0.5*Pi ) { - hist->Fill(-DPhi, DEta); - hist->Fill(-DPhi,-DEta); + hist->Fill(-DPhi, DEta,fWeight); + hist->Fill(-DPhi,-DEta,fWeight); } else { - hist->Fill(2*Pi-(DPhi), DEta); - hist->Fill(2*Pi-(DPhi),-DEta); + hist->Fill(2*Pi-(DPhi), DEta,fWeight); + hist->Fill(2*Pi-(DPhi),-DEta,fWeight); } } @@ -1414,23 +1069,6 @@ void AliAnalysisTaskKaon2PC::FillDPhiHist(Double_t DPhi, TH2F* hist, Double_t fW hist->Fill(2*Pi-(DPhi),fWeight); } } - -void AliAnalysisTaskKaon2PC::Fill2DHistMCTruth(Double_t DPhi, Double_t DEta, TH2F* hist){ - DPhi = fabs(DPhi); - DEta = fabs(DEta); - if (DPhi > Pi) DPhi = Pi-(DPhi-Pi); - hist->Fill(DPhi,DEta); - hist->Fill(DPhi,-DEta); - if (DPhi < 0.5*Pi ) { - hist->Fill(-DPhi, DEta); - hist->Fill(-DPhi,-DEta); - } - else { - hist->Fill(2*Pi-(DPhi), DEta); - hist->Fill(2*Pi-(DPhi),-DEta); - } -} - //_____________________________________________________________________________ void AliAnalysisTaskKaon2PC::Terminate(Option_t *) { diff --git a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h index bddcfbfb620..406e72d347b 100644 --- a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h +++ b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h @@ -23,9 +23,6 @@ class TH1F; class TH2F; class TH3F; class AliPIDResponse; -class AliMCParticle; -class THnSparse; -class AliAODv0; class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE { public: @@ -39,37 +36,27 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE Bool_t AcceptTrack(const AliAODTrack* Trk); Bool_t AcceptPosTrack(const AliAODTrack* Trk); Bool_t AcceptNegTrack(const AliAODTrack* Trk); - Double_t Beta(const AliAODTrack *track); Bool_t AcceptV0(const AliAODv0 *v0, Double_t *vertex); - Bool_t SelectK0TracksMC(AliMCParticle *mcTrack); - Bool_t SelectKPosTracksMC(AliMCParticle *mcTrack); - Bool_t SelectKNegTracksMC(AliMCParticle *mcTrack); - Bool_t SelectKchTracksMC(AliMCParticle *mcTrack); virtual void UserExec(Option_t* option); virtual void Terminate(Option_t* option); - virtual void Fill2DHist(Double_t DPhi, Double_t DEta, TH2F* hist); + virtual void Fill2DHist(Double_t DPhi, Double_t DEta, TH3F* hist, Double_t fWeight); virtual void FillDPhiHist(Double_t DPhi, TH2F* hist, Double_t fWeight); - virtual void Fill2DHistMCTruth(Double_t DPhi, Double_t DEta, TH2F* hist); AliEventCuts fEventCuts; // event cuts void SetMCRead(Bool_t flag) {fAnalysisMC = flag;} - void SetFilterBit(Int_t filterbit) {fBit = filterbit;} - //void SetPtLimits(Double_t ptmin, Double_t ptmax) { fLpTCut = ptmin; fUpTCut=ptmax; } - //void SetEtaLimit(Double_t etalimit) { fEta = etalimit; } //mixing //void SetNofSamples(Int_t n) { fNOfSamples = n; } //sampling setter void SetCentBinsForMixing(Int_t nofBins, std::vector bins) { fNCentBins = nofBins; fCentBins = bins; } private: void RunData(); - void RunMC(); - + AliAODEvent* fAOD; //! input event TList* fOutputList; //! output list AliPIDResponse* fPIDResponse; //! pid response object’ - TH1F* fEnergy; //! dummy histogram - TH1F* fEnergyCuts; //! dummy histogram + TH1F* fEnergy; //! dummy histogram + TH1F* fEnergyCuts; //! dummy histogram TH2F* fPID; //! dummy histogram TH2F* fPIDKaon; //! dummy histogram TH2F* fPIDK; //! dummy histogram @@ -79,12 +66,11 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE TH2F* fNsigmaTOFK; //! dummy histogram TH2F* fNsigmaTOFKaon; //! dummy histogram TH2F* fNsigmaTPCTOFK; //! dummy histogram - TH2F* fHistTOFKch; //! dummy histogram TH1F* fVtx; //! dummy histogram TH1F* fClusters; //! dummy histogram TH1F* fHistNEvents; //! dummy histogram - TH1F* fHistNV0; //! dummy histogram + TH1F* fHistNV0; //! dummy histogram TH1F* fHistEta; //! dummy histogram TH1F* fHistDEta; //! dummy histogram TH1F* fHistPhi; //! dummy histogram @@ -116,44 +102,29 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE TH2F* f2DHistNegEta; //! dummy histogram TH2F* f2DHistNegRap; //! dummy histogram - TH2F* fHistK0PhiEta; //! dummy histogram - TH2F* fHistPosPhiEta; //! dummy histogram - TH2F* fHistNegPhiEta; //! dummy histogram + TH3F* fHistK0PhiEta; //! dummy histogram + TH3F* fHistPosPhiEta; //! dummy histogram + TH3F* fHistNegPhiEta; //! dummy histogram TH2F* fHistCFPhi; //! dummy histogram TH2F* fHistCFEta; //! dummy histogram TH2F* fHistKChKChPhi; //! dummy histogram TH2F* fHistKPosKNegPhi; //! dummy histogram - TH2F* fHistCF; //! dummy histogram - TH2F* fHistKChKCh; //! dummy histogram - TH2F* fHistKPosKNeg; //! dummy histogram + TH3F* fHistCF; //! dummy histogram + TH3F* fHistKChKCh; //! dummy histogram + TH3F* fHistKPosKNeg; //! dummy histogram TH1F* hPt; TH1F* hPt_kPos; TH2F* fHistCF_Bg; - TH2F* fHistCF_KpKn_Bg; - - AliMCEvent* fmcEvent; - THnSparse* fMCK0; - THnSparse* fMCKpos; - THnSparse* fMCKneg; - TH2F* fHistKpKnMC; - TH2F* fHistK0KchMC; - TH1D* fHistGenMultiplicity; - Double_t fPV[3]; Bool_t fAnalysisMC; // enable MC study Bool_t fRejectEventPileUp; // enable to use Pile-up cuts - Bool_t fKpKnCorr; - Bool_t fK0KchCorr; Double_t PVx; Double_t PVy; Double_t PVz; - Double_t fBit; - Double_t fCentMin; - Double_t fCentMax; Double_t fLpTCut; //not a pointer??? Double_t fUpTCut; Double_t fEtaCut; @@ -175,8 +146,6 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE TObjArray* fSelectedKCh; //! TObjArray* fSelectedK0s; //! - TObjArray* fSelectedKpos; //! - TObjArray* fSelectedKneg; //! AliEventPoolManager* fPoolMgr; //! event pool manager for Event Mixing // Int_t fNOfSamples; // std::vector fsampleBins; //sampling From 251481b8c5940e2a09fc3b3012ddccdf33d8b83e Mon Sep 17 00:00:00 2001 From: Anjaly Menon Date: Sat, 15 Apr 2023 17:12:53 -0500 Subject: [PATCH 05/51] Added event mixing background for K+K- Correlation,Selection cut for charged Kaon track changed --- .../AliAnalysisTaskKaon2PC.cxx | 591 ++++++++++++++---- .../KaonCorrelations/AliAnalysisTaskKaon2PC.h | 54 +- 2 files changed, 518 insertions(+), 127 deletions(-) diff --git a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx index 9c0f5246d12..28968b9a408 100644 --- a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx +++ b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// AliAnalysisTaskKaon2PC: +// Kaon2PC: // Description: Analysis task to calculate Two-Particle Angular Correlation Functions of Neutral and Charged Kaons // Author: Anjaly Sasikumar Menon // (anjaly.sasikumar.menon@cern.ch) @@ -44,15 +44,15 @@ #include "AliAODVZERO.h" #include "AliVParticle.h" #include "TLorentzVector.h" -#include "AliAnalysisTaskKaon2PC.h" +#include "Kaon2PC.h" -class AliAnalysisTaskKaon2PC; // This analysis class +class Kaon2PC; // This analysis class using namespace std; // std namespace: so you can do things like 'cout' -ClassImp(AliAnalysisTaskKaon2PC) // classimp: necessary for root +ClassImp(Kaon2PC) // classimp: necessary for root const Double_t Pi = TMath::Pi(); -AliAnalysisTaskKaon2PC::AliAnalysisTaskKaon2PC() : AliAnalysisTaskSE(), +Kaon2PC::Kaon2PC() : AliAnalysisTaskSE(), fAOD(0), fOutputList(0), fPIDResponse(0), @@ -64,6 +64,9 @@ fLpTCut(0.4), fUpTCut(0.8), fEtaCut(0.8), fSigCut(2.0), +fBit(96), +fCentMin(20), +fCentMax(30), //V0 cuts fDecayLv0Cut(8.05), fLpTv0Cut(0.4), @@ -88,6 +91,7 @@ fNsigmaKaon(0), fNsigmaTOFK(0), fNsigmaTOFKaon(0), fNsigmaTPCTOFK(0), +fHistTOFKch(0), //track and event observables fVtx(0), fClusters(0), @@ -138,12 +142,16 @@ fHistKPosKNeg(0), //mixing fSelectedKCh(0), fSelectedK0s(0), +fSelectedKpos(0), +fSelectedKneg(0), fPoolMgr(0x0), fPoolMaxNEvents(1000), fPoolMinNTracks(10000), fMinEventsToMix(10), fNzVtxBins(10), fNCentBins(15), +fKpKnCorr(kTRUE), +fK0KchCorr(kFALSE), /* fNOfSamples(1.0), fSampleIndex(0.0), @@ -151,6 +159,14 @@ fSampleIndex(0.0), hPt(0), hPt_kPos(0), fHistCF_Bg(0), +fHistCF_KpKn_Bg(0), +//MC Truth +fMCK0(0), +fMCKpos(0), +fMCKneg(0), +fHistKpKnMC(0), +fHistK0KchMC(0), +fHistGenMultiplicity(0), //eventcuts fEventCuts(0) @@ -159,7 +175,7 @@ fEventCuts(0) // this is used by root for IO purposes, it needs to remain empty } //_____________________________________________________________________________ -AliAnalysisTaskKaon2PC::AliAnalysisTaskKaon2PC(const char* name) : AliAnalysisTaskSE(name), +Kaon2PC::Kaon2PC(const char* name) : AliAnalysisTaskSE(name), fAOD(0), fOutputList(0), fPIDResponse(0), @@ -171,6 +187,9 @@ fLpTCut(0.4), fUpTCut(0.8), fEtaCut(0.8), fSigCut(2.0), +fBit(96), +fCentMin(20), +fCentMax(30), //V0 cuts fDecayLv0Cut(8.05), fLpTv0Cut(0.4), @@ -195,6 +214,7 @@ fNsigmaKaon(0), fNsigmaTOFK(0), fNsigmaTOFKaon(0), fNsigmaTPCTOFK(0), +fHistTOFKch(0), //track and event observables fVtx(0), fClusters(0), @@ -245,12 +265,16 @@ fHistKPosKNeg(0), //mixing fSelectedKCh(0), fSelectedK0s(0), +fSelectedKpos(0), +fSelectedKneg(0), fPoolMgr(0x0), fPoolMaxNEvents(1000), fPoolMinNTracks(10000), fMinEventsToMix(10), fNzVtxBins(10), fNCentBins(15), +fKpKnCorr(kTRUE), +fK0KchCorr(kFALSE), /* fNOfSamples(1.0), fSampleIndex(0.0), @@ -258,6 +282,14 @@ fSampleIndex(0.0), hPt(0), hPt_kPos(0), fHistCF_Bg(0), +fHistCF_KpKn_Bg(0), +//MC Truth +fMCK0(0), +fMCKpos(0), +fMCKneg(0), +fHistKpKnMC(0), +fHistK0KchMC(0), +fHistGenMultiplicity(0), //eventcuts fEventCuts(0) @@ -268,7 +300,7 @@ fEventCuts(0) DefineOutput(1, TList::Class()); } //_____________________________________________________________________________ -AliAnalysisTaskKaon2PC::~AliAnalysisTaskKaon2PC() +Kaon2PC::~Kaon2PC() { // destructor if(fOutputList) { @@ -276,9 +308,11 @@ AliAnalysisTaskKaon2PC::~AliAnalysisTaskKaon2PC() } if(fSelectedK0s) delete fSelectedK0s; if(fSelectedKCh) delete fSelectedKCh; + if(fSelectedKpos) delete fSelectedKpos; + if(fSelectedKneg) delete fSelectedKneg; } //_____________________________________________________________________________ -void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() +void Kaon2PC::UserCreateOutputObjects() { // create output objects // this function is called ONCE at the start of your analysis (RUNTIME) @@ -287,6 +321,7 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() // to an output file. fzVtxBins = {-10.0,-8.0,-6.0,-4.0,-2.0,0.0,2.0,4.0,6.0,8.0,10.0}; // 10 bins + //fzVtxBins = {-10.0,-9.0,-8.0,-7.0,-6.0,-5.0,-4.0,-3.0,-2.0,-1.0,0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0}; // 20 bins //fCentBins = {0,5,10,15,20,25,30,35,40,45,50,60,70,80,90,100}; fCentBins = { 0, 1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100.1 }; // 15 bins //fsampleBins = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}; @@ -355,6 +390,9 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fNsigmaTPCTOFK->GetYaxis()->SetTitle("n#sigma_{TOF} of Kaon"); fNsigmaTPCTOFK->SetOption("colz"); + fHistTOFKch = new TH2F("fHistTOFKch", "", 500, 0.2,2,700,0,2); + //fHistTOFKch->SetOption(); + //track and event observables fVtx = new TH1F("fVtx", "PV_{z} distribution of Tracks", 100, -13, 13); fClusters = new TH1F("fClusters", "TPCClusters distribution", 500, 1, 170); @@ -438,15 +476,15 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() f2DHistNegRap->GetXaxis()->SetTitle("Rapidity"); f2DHistNegRap->SetOption("colz"); - fHistPosPhiEta = new TH3F("fHistPosPhiEta", "",60,0,2*Pi, 60,-0.8, 0.8,100,0,100); + fHistPosPhiEta = new TH2F("fHistPosPhiEta", "",60,0,2*Pi, 60,-0.8, 0.8); fHistPosPhiEta->GetXaxis()->SetTitle("Track Eta"); fHistPosPhiEta->SetOption("SURF1"); - fHistNegPhiEta = new TH3F("fHistNegPhiEta", "",60,0,2*Pi, 60,-0.8, 0.8,100,0,100); + fHistNegPhiEta = new TH2F("fHistNegPhiEta", "",60,0,2*Pi, 60,-0.8, 0.8); fHistNegPhiEta->GetXaxis()->SetTitle("Track Eta"); fHistNegPhiEta->SetOption("SURF1"); - fHistK0PhiEta = new TH3F("fHistK0PhiEta", "", 60,0,2*Pi,60,-0.8, 0.8,100,0,100); + fHistK0PhiEta = new TH2F("fHistK0PhiEta", "", 60,0,2*Pi,60,-0.8, 0.8); fHistK0PhiEta->GetXaxis()->SetTitle("V0 Phi (in radians)"); fHistK0PhiEta->SetOption("SURF1"); @@ -466,17 +504,17 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fHistKChKChPhi = new TH2F("fHistKChKChPhi", "C(#Delta#phi) of Kch-Kch ",32,-0.5*Pi,1.5*Pi,100,0,100); fHistKChKChPhi->SetOption("SURF1"); - fHistCF = new TH3F("fHistCF","Number of pairs of K^{+/-} and K^{0}",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6,100,0,100 ); + fHistCF = new TH2F("fHistCF","Number of pairs of K^{+/-} and K^{0}",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); fHistCF->GetXaxis()->SetTitle("#Delta#phi "); fHistCF->GetYaxis()->SetTitle("#Delta#eta"); fHistCF->SetOption("SURF1"); - fHistKPosKNeg = new TH3F("fHistKPosKNeg","K^{+}-K^{-} Correlation",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6,100,0,100 ); + fHistKPosKNeg = new TH2F("fHistKPosKNeg","K^{+}-K^{-} Correlation",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); fHistKPosKNeg->GetXaxis()->SetTitle("#Delta#phi "); fHistKPosKNeg->GetYaxis()->SetTitle("#Delta#eta"); fHistKPosKNeg->SetOption("SURF1"); - fHistKChKCh = new TH3F("fHistKChKCh","Kch-Kch Correlation",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6,100,0,100 ); + fHistKChKCh = new TH2F("fHistKChKCh","Kch-Kch Correlation",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); fHistKChKCh->GetXaxis()->SetTitle("#Delta#phi "); fHistKChKCh->GetYaxis()->SetTitle("#Delta#eta"); fHistKChKCh->SetOption("SURF1"); @@ -487,9 +525,51 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fHistCF_Bg = new TH2F("fHistCF_Bg","Background for CF of K^{+/-} and K^{0}",32,-0.5*Pi,1.5*Pi,32,-1.6,1.6); fHistCF_Bg->SetOption("SURF1"); + fHistCF_KpKn_Bg = new TH2F("fHistCF_KpKn_Bg","Background for CF of K^{+} and K^{-}",32,-0.5*Pi,1.5*Pi,32,-1.6,1.6); + fHistCF_KpKn_Bg->SetOption("SURF1"); + + hPt = new TH1F("hPt", "Track pT distribution", 100, 0, 2); hPt_kPos = new TH1F("hPt_kPos", "Track pT distribution", 100, 0, 2); + // MC Truth histograms + + //+++++++++++++++++++++ MC ++++++++++++++++++++++++++ + + Int_t bins[4] = {100,32,32,100}; + Double_t min[4] = {0.2,0,-0.8,0.4}; + Double_t max[4] = {1.0,2*Pi,0.8,0.6}; + + fMCK0 = new THnSparseF("fMCK0","fMCK0",4,bins,min,max); + fMCK0->GetAxis(0)->SetTitle("p_{T} of K^{0}_{S}"); + fMCK0->GetAxis(1)->SetTitle("#phi"); + fMCK0->GetAxis(2)->SetTitle("#eta"); + fMCK0->GetAxis(3)->SetTitle("mass"); + + fMCKpos = new THnSparseF("fMCKpos","fMCKpos",4,bins,min,max); + fMCKpos->GetAxis(0)->SetTitle("p_{T} of K^{+}"); + fMCKpos->GetAxis(1)->SetTitle("#phi of K^{+}"); + fMCKpos->GetAxis(2)->SetTitle("#eta of K^{+}"); + fMCKpos->GetAxis(3)->SetTitle("mass of K^{+}"); + + fMCKneg = new THnSparseF("fMCKneg","fMCKneg",4,bins,min,max); + fMCKneg->GetAxis(0)->SetTitle("p_{T} of K^{-}"); + fMCKneg->GetAxis(1)->SetTitle("#phi of K^{-}"); + fMCKneg->GetAxis(2)->SetTitle("#eta of K^{-}"); + fMCKneg->GetAxis(3)->SetTitle("mass of K^{-}"); + + fHistKpKnMC = new TH2F("fHistKpKnMC","K^{+}-K^{-} Correlation for MC Truth",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); + fHistKpKnMC->GetXaxis()->SetTitle("#Delta#phi "); + fHistKpKnMC->GetYaxis()->SetTitle("#Delta#eta"); + fHistKpKnMC->SetOption("SURF1"); + + fHistK0KchMC = new TH2F("fHistK0KchMC","K^{+}-K^{-} Correlation for MC Truth",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); + fHistK0KchMC->GetXaxis()->SetTitle("#Delta#phi "); + fHistK0KchMC->GetYaxis()->SetTitle("#Delta#eta"); + fHistK0KchMC->SetOption("SURF1"); + + fHistGenMultiplicity = new TH1D ("fHistGenMultiplicity","fHistGenMultiplicity",500,0,500); + fOutputList->Add(fEnergy); fOutputList->Add(fEnergyCuts); fOutputList->Add(fPID); @@ -501,6 +581,7 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fOutputList->Add(fNsigmaTOFK); fOutputList->Add(fNsigmaTOFKaon); fOutputList->Add(fNsigmaTPCTOFK); + fOutputList->Add(fHistTOFKch); fOutputList->Add(fVtx); fOutputList->Add(fClusters); @@ -552,13 +633,21 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fOutputList->Add(hPt_kPos); fOutputList->Add(fHistCF_Bg); + fOutputList->Add(fHistCF_KpKn_Bg); + + fOutputList->Add(fMCK0); + fOutputList->Add(fMCKpos); + fOutputList->Add(fMCKneg); + fOutputList->Add(fHistKpKnMC); + fOutputList->Add(fHistK0KchMC); + fOutputList->Add(fHistGenMultiplicity); fEventCuts.AddQAplotsToList(fOutputList); PostData(1, fOutputList); } -void AliAnalysisTaskKaon2PC::SetTrackCuts(Double_t c1, Double_t c2, Double_t c3, Double_t c4) { +void Kaon2PC::SetTrackCuts(Double_t c1, Double_t c2, Double_t c3, Double_t c4) { fLpTCut = c1; fUpTCut = c2; @@ -566,7 +655,7 @@ void AliAnalysisTaskKaon2PC::SetTrackCuts(Double_t c1, Double_t c2, Double_t c3, fSigCut = c4; } -void AliAnalysisTaskKaon2PC::SetV0TrackCuts(Double_t c5, Double_t c6, Double_t c7, Double_t c8, Double_t c9, Double_t c10, Double_t c11, Double_t c12, Double_t c13, Double_t c14, Double_t c15) { +void Kaon2PC::SetV0TrackCuts(Double_t c5, Double_t c6, Double_t c7, Double_t c8, Double_t c9, Double_t c10, Double_t c11, Double_t c12, Double_t c13, Double_t c14, Double_t c15) { fDecayLv0Cut = c5; fLpTv0Cut = c6; @@ -582,7 +671,7 @@ void AliAnalysisTaskKaon2PC::SetV0TrackCuts(Double_t c5, Double_t c6, Double_t c } //_____________________________________________________________________________ -Bool_t AliAnalysisTaskKaon2PC::AcceptTrack(const AliAODTrack *Trk) { +Bool_t Kaon2PC::AcceptTrack(const AliAODTrack *Trk) { if (!Trk->TestFilterBit(96)) return kFALSE; if (Trk->Charge() == 0) return kFALSE; //excluding neutral particles if (Trk->Pt() <= fLpTCut || Trk->Pt() >= fUpTCut) return kFALSE; // pt cut @@ -594,17 +683,21 @@ Bool_t AliAnalysisTaskKaon2PC::AcceptTrack(const AliAODTrack *Trk) { Double_t nSigmaTOFkaon = fPIDResponse->NumberOfSigmasTOF(Trk, AliPID::kKaon); Double_t nSigmaTOFelectron = fPIDResponse->NumberOfSigmasTOF(Trk, AliPID::kElectron); Double_t nSigmaTOFpion = fPIDResponse->NumberOfSigmasTOF(Trk, AliPID::kPion); - if (fabs(nSigmakaon) > fSigCut) return kFALSE; if (fabs(nSigmaelectron) < 2.0) return kFALSE; // excluding electrons via TPC if (fabs(nSigmapion) < 2.0) return kFALSE; // excluding pions via TPC if (fabs(nSigmaproton) < 2.0) return kFALSE; // excluding pions via TPC - + //if (fabs(nSigmakaon < 3.0) && (nSigmapion < 3.0)) return kFALSE; + //if (fabs(nSigmakaon < 3.0) && (nSigmaproton < 3.0)) return kFALSE; + //if (fabs(nSigmakaon < 3.0) && (nSigmaelectron < 3.0)) return kFALSE; + if (fabs(nSigmakaon) > fSigCut) return kFALSE; + if (fabs(nSigmaTOFkaon) > 3.0) return kFALSE; + return kTRUE; } //_____________________________________________________________________________ -Bool_t AliAnalysisTaskKaon2PC::AcceptPosTrack(const AliAODTrack *Trk) { +Bool_t Kaon2PC::AcceptPosTrack(const AliAODTrack *Trk) { if(Trk->Charge() < 0) return kFALSE; // excluding negative tracks return kTRUE; @@ -612,35 +705,50 @@ Bool_t AliAnalysisTaskKaon2PC::AcceptPosTrack(const AliAODTrack *Trk) { //_____________________________________________________________________________ -Bool_t AliAnalysisTaskKaon2PC::AcceptNegTrack(const AliAODTrack *Trk) { +Bool_t Kaon2PC::AcceptNegTrack(const AliAODTrack *Trk) { if(Trk->Charge() > 0) return kFALSE; // excluding positive tracks return kTRUE; } + +//_____________________________________________________________________________ + +Double_t Kaon2PC::Beta(const AliAODTrack *track) +{ + Double_t startTime = fPIDResponse->GetTOFResponse().GetStartTime(((AliVTrack*)track)->P()); //in ps + Double_t stoptime = track->GetTOFsignal(); + Double_t c = TMath::C()*1.E-9; // m/ns + Double_t length = fPIDResponse->GetTOFResponse().GetExpectedSignal(track,AliPID::kKaon)*1E-3*c; + stoptime -= startTime; + Double_t scaleStopTime = stoptime*1E-3; + scaleStopTime = scaleStopTime*c; + return length/scaleStopTime; +} + //___________________________ v0 selection with no pT cut _________________________ -Bool_t AliAnalysisTaskKaon2PC::AcceptV0(const AliAODv0 *v0, Double_t *vertex) { +Bool_t Kaon2PC::AcceptV0(const AliAODv0 *v0, Double_t *vertex) { if (v0->GetOnFlyStatus()) return kFALSE; Double_t length = v0->DecayLengthV0(vertex); if (length > fDecayLv0Cut) return kFALSE; - Double_t dcaDau =v0->DcaV0Daughters(); - if (dcaDau > 0.8) return kFALSE; + Double_t dcaDau = v0->DcaV0Daughters(); + if (TMath::Abs(dcaDau) > 0.8) return kFALSE; Double_t pT = v0->Pt(); //Double_t pT=TMath::Sqrt(v0->Pt2V0()); if (fabs(v0->Eta()) > fEtav0Cut) return kFALSE; Double_t DCAtoPV = v0->DcaV0ToPrimVertex(); if (DCAtoPV > 0.1 ) return kFALSE; Double_t dcaPosToPV = v0->DcaPosToPrimVertex(); - if (dcaPosToPV < fDcaPosToPrimVtxv0Cut) return kFALSE; + if (TMath::Abs(dcaPosToPV) < fDcaPosToPrimVtxv0Cut && fDcaPosToPrimVtxv0Cut != -999) return kFALSE; Double_t dcaNegToPV = v0->DcaNegToPrimVertex(); - if (dcaNegToPV < fDcaNegToPrimVtxv0Cut) return kFALSE; + if (TMath::Abs(dcaNegToPV) < fDcaNegToPrimVtxv0Cut && fDcaNegToPrimVtxv0Cut != -999) return kFALSE; Double_t etaPos = v0->PseudoRapPos(); - if (fabs(etaPos) > fEtaPosv0Cut) return kFALSE; + if (fabs(etaPos) > fEtaPosv0Cut && fEtaPosv0Cut != -999) return kFALSE; Double_t etaNeg = v0->PseudoRapNeg(); - if (fabs(etaNeg) > fEtaNegv0Cut) return kFALSE; + if (fabs(etaNeg) > fEtaNegv0Cut && fEtaNegv0Cut != -999) return kFALSE; Double_t cosPA= v0->CosPointingAngle(vertex); - if (cosPA < fCosPACut) return kFALSE; + if (cosPA < fCosPACut && fCosPACut != -999) return kFALSE; Double_t armpt = v0->PtArmV0(); Double_t alpha = v0->AlphaV0(); if (armpt < 0.2*fabs(alpha)) return kFALSE; @@ -662,9 +770,44 @@ Bool_t AliAnalysisTaskKaon2PC::AcceptV0(const AliAODv0 *v0, Double_t *vertex) { return kTRUE; } +// MC Truth Booleans + +Bool_t Kaon2PC::SelectK0TracksMC(AliMCParticle *mcTrack ) { + Int_t mcPartPdg = mcTrack->PdgCode(); + Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); + Bool_t SelectK0 = mcPartPdg==310&& (isPhysPrim); + if (SelectK0) return kFALSE; + return kTRUE; +} + +Bool_t Kaon2PC::SelectKPosTracksMC(AliMCParticle *mcTrack ) { + Int_t mcPartPdg = mcTrack->PdgCode(); + Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); + Bool_t SelectKpos = mcPartPdg==321&& (isPhysPrim); + if (SelectKpos) return kFALSE; + return kTRUE; +} + +Bool_t Kaon2PC::SelectKNegTracksMC(AliMCParticle *mcTrack ) { + Int_t mcPartPdg = mcTrack->PdgCode(); + Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); + Bool_t SelectKneg = mcPartPdg==-321&& (isPhysPrim); + if (SelectKneg) return kFALSE; + return kTRUE; +} + +Bool_t Kaon2PC::SelectKchTracksMC(AliMCParticle *mcTrack ) { + Int_t mcPartPdg = mcTrack->PdgCode(); + Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); + Bool_t SelectKch = mcPartPdg==321&& mcPartPdg==-321&& (isPhysPrim); + if (SelectKch) return kFALSE; + return kTRUE; +} + + //_____________________________________________________________________________ -void AliAnalysisTaskKaon2PC::RunData() { +void Kaon2PC::RunData() { fAOD = dynamic_cast(InputEvent()); if(!fAOD) return; @@ -693,13 +836,13 @@ void AliAnalysisTaskKaon2PC::RunData() { fVtx->Fill(PVz); //Multiplicity selection - AliMultSelection *MultSelection = (AliMultSelection*)fAOD->FindListObject("MultSelection"); - if(!MultSelection) return; + //AliMultSelection *MultSelection = (AliMultSelection*)fAOD->FindListObject("MultSelection"); + //if(!MultSelection) return; //centrality - double CentV0M = MultSelection->GetMultiplicityPercentile("V0M"); //centrality - - //if (40.0 < CentV0M >90.0) return; + //double CentV0M = MultSelection->GetMultiplicityPercentile("V0M"); //centrality + Double_t CentV0M = fEventCuts.GetCentrality(); //centrality + if ((CentV0M < fCentMin)||(CentV0M > fCentMax)) return; //======== PID loop (no pT cut) =========== @@ -769,78 +912,32 @@ void AliAnalysisTaskKaon2PC::RunData() { if (pT <= fLpTv0Cut || pT >= fUpTv0Cut) continue; fHistMK0Cuts->Fill(v0->MassK0Short()); } - -//======== KchKch Correlation Loop ========== - - for(Int_t i(0); i < iTracks; i++) { - AliAODTrack* track1 = dynamic_cast(fAOD->GetTrack(i)); - if(!track1) continue; - if (!AcceptTrack(track1)) continue; - - Int_t chargetrack = track1->Charge(); - Double_t track1Phi = track1->Phi(); - Double_t track1Eta = track1->Eta(); - - for(Int_t j(i+1); j < iTracks; j++) { - AliAODTrack* track2 = dynamic_cast(fAOD->GetTrack(j)); - if(!track2) continue; - if (!AcceptTrack(track2)) continue; - - Double_t track2Phi = track2->Phi(); - Double_t track2Eta = track2->Eta(); - - Double_t DEta = fabs(track1Eta - track2Eta); - Double_t DPhi = fabs(track1Phi - track2Phi); - - FillDPhiHist(DPhi,fHistKChKChPhi,CentV0M); - Fill2DHist(DPhi,DEta,fHistKChKCh,CentV0M); - } - - } - -//======== K+K- Correlation Loop ========== - - for(Int_t i(0); i < iTracks; i++) { - AliAODTrack* track1 = dynamic_cast(fAOD->GetTrack(i)); - if(!track1) continue; - if (!AcceptTrack(track1)) continue; - if (!AcceptPosTrack(track1)) continue; - - Double_t track1PosPhi = track1->Phi(); - Double_t track1PosEta = track1->Eta(); - - for(Int_t j(0); j < iTracks; j++) { - AliAODTrack* track2 = dynamic_cast(fAOD->GetTrack(j)); - if(!track2) continue; - if (!AcceptTrack(track2)) continue; - if (!AcceptNegTrack(track2)) continue; - - Double_t track2NegPhi = track2->Phi(); - Double_t track2NegEta = track2->Eta(); - - Double_t DPhiPN = fabs(track1PosPhi - track2NegPhi); - Double_t DEtaPN = fabs(track1PosEta - track2NegEta); - - FillDPhiHist(DPhiPN,fHistKPosKNegPhi,CentV0M); - Fill2DHist(DPhiPN,DEtaPN,fHistKPosKNeg,CentV0M); - } - } - //======== Charged Kaon Track Selection ========== fSelectedKCh = new TObjArray; fSelectedKCh->SetOwner(kTRUE); +fSelectedKpos = new TObjArray; +fSelectedKpos->SetOwner(kTRUE); + +fSelectedKneg = new TObjArray; +fSelectedKneg->SetOwner(kTRUE); + for(Int_t i=0; i < iTracks; i++) { AliAODTrack* track = dynamic_cast(fAOD->GetTrack(i)); if(!track) continue; if (!AcceptTrack(track)) continue; - fSelectedKCh->Add((AliAODTrack*)track); + Double_t TOFsignal = track->GetTOFsignal(); + Float_t beta = 0.0; + beta = Beta(track); Int_t chargetrack = track->Charge(); Double_t trackPhi = track->Phi(); Double_t trackEta = track->Eta(); Double_t trackPt = track->Pt(); + //cout << "TOFsignal is" << TOFsignal << endl; + fHistTOFKch->Fill(trackPt, beta); + fSelectedKCh->Add((AliAODTrack*)track); //fill single particle charged kaon histograms fHistKChPhi->Fill(trackPhi); @@ -850,17 +947,19 @@ for(Int_t i=0; i < iTracks; i++) { f2DHistChRap->Fill(track->Y(),CentV0M); if (chargetrack > 0) { + fSelectedKpos->Add((AliAODTrack*)track); fHistKpPhi->Fill(trackPhi); f2DHistPosPhi->Fill(trackPhi,CentV0M); f2DHistPosEta->Fill(trackEta,CentV0M); - fHistPosPhiEta->Fill(trackPhi,trackEta,CentV0M); + fHistPosPhiEta->Fill(trackPhi,trackEta); f2DHistPosRap->Fill(track->Y(0.493),CentV0M); } if (chargetrack < 0) { + fSelectedKneg->Add((AliAODTrack*)track); fHistKnPhi->Fill(trackPhi); f2DHistNegPhi->Fill(trackPhi,CentV0M); f2DHistNegEta->Fill(trackEta,CentV0M); - fHistNegPhiEta->Fill(trackPhi,trackEta,CentV0M); + fHistNegPhiEta->Fill(trackPhi,trackEta); f2DHistNegRap->Fill(track->Y(0.493),CentV0M); } fHistPhi->Fill(track->Phi()); @@ -870,6 +969,12 @@ for(Int_t i=0; i < iTracks; i++) { Int_t nSelectedKCh = fSelectedKCh->GetEntries(); cout << " nSelectedKCh is " << nSelectedKCh << endl; +Int_t nSelectedKpos = fSelectedKpos->GetEntries(); +cout << " nSelectedKpos is " << nSelectedKpos << endl; + +Int_t nSelectedKneg = fSelectedKneg->GetEntries(); +cout << " nSelectedKneg is " << nSelectedKneg << endl; + //======== Neutral Kaon Selection ========== fSelectedK0s = new TObjArray; fSelectedK0s->SetOwner(kTRUE); @@ -894,7 +999,7 @@ for(Int_t j=0; j < nv0s; j++) { fSelectedK0s->Add(v0); //fill single particle neutral kaon histograms fHistK0Phi->Fill(V0Phi); - fHistK0PhiEta->Fill(V0Phi,V0Eta,CentV0M); + fHistK0PhiEta->Fill(V0Phi,V0Eta); f2DHistK0Phi->Fill(V0Phi,CentV0M); f2DHistK0Eta->Fill(V0Eta,CentV0M); fHistPPionPhi->Fill(pTrack->Phi()); @@ -903,7 +1008,66 @@ for(Int_t j=0; j < nv0s; j++) { Int_t nSelectedK0s = fSelectedK0s->GetEntries(); cout << " nSelectedK0s is " << nSelectedK0s << endl; -//======== Kch-K0s Correlation Analysis ========== +//((TH1F*)((AliDirList*)fOutput3->FindObject("Track"))->FindObject("nTracksBf"))->Fill(nTracks); +//((TH1F*)((AliDirList*)fOutput3->FindObject("Track"))->FindObject("nTracksAf"))->Fill(nSelectedTracks); + +//======== KchKch Correlation Loop ========== + + for(Int_t i(0); i < fSelectedKCh->GetEntriesFast(); i++) { + AliAODTrack* track1 = dynamic_cast(fSelectedKCh->At(i)); + if(!track1) continue; + if (!AcceptTrack(track1)) continue; + + Int_t chargetrack = track1->Charge(); + Double_t track1Phi = track1->Phi(); + Double_t track1Eta = track1->Eta(); + + for(Int_t j(i+1); j < fSelectedKCh->GetEntriesFast(); j++) { + AliAODTrack* track2 = dynamic_cast(fSelectedKCh->At(j)); + if(!track2) continue; + if (!AcceptTrack(track2)) continue; + + Double_t track2Phi = track2->Phi(); + Double_t track2Eta = track2->Eta(); + + Double_t DEta = fabs(track1Eta - track2Eta); + Double_t DPhi = fabs(track1Phi - track2Phi); + + FillDPhiHist(DPhi,fHistKChKChPhi,CentV0M); + Fill2DHist(DPhi,DEta,fHistKChKCh); + } + + } + +//======== K+K- Correlation Loop ========== + + for(Int_t i(0); i < fSelectedKpos->GetEntriesFast(); i++) { + AliAODTrack* track1 = dynamic_cast(fSelectedKpos->At(i)); + if(!track1) continue; + if (!AcceptTrack(track1)) continue; + if (!AcceptPosTrack(track1)) continue; + + Double_t track1PosPhi = track1->Phi(); + Double_t track1PosEta = track1->Eta(); + + for(Int_t j(0); j < fSelectedKneg->GetEntriesFast(); j++) { + AliAODTrack* track2 = dynamic_cast(fSelectedKneg->At(i)); + if(!track2) continue; + if (!AcceptTrack(track2)) continue; + if (!AcceptNegTrack(track2)) continue; + + Double_t track2NegPhi = track2->Phi(); + Double_t track2NegEta = track2->Eta(); + + Double_t DPhiPN = fabs(track1PosPhi - track2NegPhi); + Double_t DEtaPN = fabs(track1PosEta - track2NegEta); + + FillDPhiHist(DPhiPN,fHistKPosKNegPhi,CentV0M); + Fill2DHist(DPhiPN,DEtaPN,fHistKPosKNeg); + } + } + +//======== K0s-Kch Correlation Analysis ========== for(Int_t i = 0; i < fSelectedK0s->GetEntriesFast(); i++){ AliAODv0 * v0 = (AliAODv0*)fSelectedK0s->At(i); if(!v0) continue; @@ -954,7 +1118,7 @@ cout << " nSelectedK0s is " << nSelectedK0s << endl; fHistCFPhi->Fill(2*Pi-(deltaPhi),-deltaEta); } - Fill2DHist(deltaPhi,deltaEta,fHistCF,CentV0M); + Fill2DHist(deltaPhi,deltaEta,fHistCF); if (deltaPhi > Pi) deltaPhi = Pi-(deltaPhi-Pi); fHistDPhi->Fill(deltaPhi); @@ -975,17 +1139,18 @@ fHistMult->Fill(iTracks); fHistCent->Fill(CentV0M); //================== mixing ============================ (You can create a seperate function FillCorrelationsMixed() later) +if (fK0KchCorr){ -AliEventPool *pool = fPoolMgr->GetEventPool(CentV0M, PVz); -if(pool) {cout << "Good news....!!!!!!! Pool found.. " << endl; } -if(!pool) { AliError(Form("No pool found for centrality = %f, zVtx = %f", CentV0M,PVz)); return; } +AliEventPool *pool1 = fPoolMgr->GetEventPool(CentV0M, PVz); +if(pool1) {cout << "Good news....!!!!!!! Pool found.. " << endl; } +if(!pool1) { AliError(Form("No pool found for centrality = %f, zVtx = %f", CentV0M,PVz)); return; } -if(pool->IsReady() || pool->NTracksInPool() > fPoolMinNTracks || pool->GetCurrentNEvents() >= fMinEventsToMix) { +if(pool1->IsReady() || pool1->NTracksInPool() > fPoolMinNTracks || pool1->GetCurrentNEvents() >= fMinEventsToMix) { -Int_t nMix = pool->GetCurrentNEvents(); +Int_t nMix = pool1->GetCurrentNEvents(); for (Int_t jMix=0; jMix< nMix; jMix++){ - TObjArray* bgTracks = pool->GetEvent(jMix); //bgTracks are from the mixed events + TObjArray* bgTracks = pool1->GetEvent(jMix); //bgTracks are from the mixed events for(Int_t iTrig(0); iTrig < fSelectedK0s->GetEntries(); iTrig++){ AliVParticle* K0Trig = dynamic_cast(fSelectedK0s->At(iTrig)); @@ -1022,16 +1187,195 @@ Int_t nMix = pool->GetCurrentNEvents(); TObjArray* tracksClone = (TObjArray*) fSelectedKCh->Clone(); tracksClone->SetOwner(kTRUE); - pool->UpdatePool(tracksClone); + pool1->UpdatePool(tracksClone); + +} + +//================== mixing ============================ (for k+k- CF) + +if (fKpKnCorr){ + +AliEventPool *pool2 = fPoolMgr->GetEventPool(CentV0M, PVz); +if(pool2) {cout << "Good news....!!!!!!! Pool found.. " << endl; } +if(!pool2) { AliError(Form("No pool found for centrality = %f, zVtx = %f", CentV0M,PVz)); return; } + +if(pool2->IsReady() || pool2->NTracksInPool() > fPoolMinNTracks || pool2->GetCurrentNEvents() >= fMinEventsToMix) { + +Int_t nMix = pool2->GetCurrentNEvents(); + + for (Int_t jMix=0; jMix< nMix; jMix++){ + TObjArray* bgTracks2 = pool2->GetEvent(jMix); //bgTracks are from the mixed events + + for(Int_t iTrig(0); iTrig < fSelectedKpos->GetEntries(); iTrig++){ + AliVParticle* KposTrig = dynamic_cast(fSelectedKpos->At(iTrig)); + if(!KposTrig) continue; + + for (Int_t iAss(0); iAss < bgTracks2->GetEntries(); iAss++){ + AliVParticle* KnegAssoc = dynamic_cast (bgTracks2->At(iAss)); + if(!KnegAssoc) continue; + + Double_t DPhiMix = fabs(KposTrig->Phi() - KnegAssoc->Phi()); + Double_t DEtaMix = fabs(KposTrig->Eta() - KnegAssoc->Eta()); + + if (DPhiMix > Pi) DPhiMix = Pi-(DPhiMix-Pi); + + fHistCF_KpKn_Bg->Fill(DPhiMix, DEtaMix); + fHistCF_KpKn_Bg->Fill(DPhiMix, -DEtaMix); + + if (DPhiMix < 0.5*Pi ) { + fHistCF_KpKn_Bg->Fill(-DPhiMix, DEtaMix); + fHistCF_KpKn_Bg->Fill(-DPhiMix,-DEtaMix); + } + else { + fHistCF_KpKn_Bg->Fill(2*Pi-(DPhiMix), DEtaMix); + fHistCF_KpKn_Bg->Fill(2*Pi-(DPhiMix),-DEtaMix); + } + + } //end of k- loop end + } // end of k+ trigger loop + + } //end of mixing event loop + +}//end of pool + +TObjArray* tracksClone2 = (TObjArray*) fSelectedKneg->Clone(); +tracksClone2->SetOwner(kTRUE); +pool2->UpdatePool(tracksClone2); + +} } //end of RunData function +//=================== MC Truth Correlation function ======== + +void Kaon2PC::RunMC() { + +Int_t nAcceptedParticles =0; +AliMCParticle *mcTrack = 0x0; +fmcEvent = dynamic_cast (MCEvent()); +if(!fmcEvent){ + Printf("No MC particle branch found"); + return; + } + +AliVVertex * mcVertex = (AliVVertex*)fmcEvent->GetPrimaryVertex(); +fPV[2] = mcVertex->GetZ(); +if (TMath::Abs(fPV[2])>=10) return; + +Int_t nMCTracks = fmcEvent->GetNumberOfTracks(); // MC Truth, Total number of tracks per event +AliVTrack *genTrackMix = 0x0; + +for (Int_t i = 0; i < nMCTracks; i++){ + AliMCParticle *mcTrack = (AliMCParticle*)fmcEvent->GetTrack(i); + if (!mcTrack) { + Error("ReadEventAODMC", "Could not receive particle %d", i); + continue; + } + + Double_t trackPseudorap = mcTrack->Eta(); + if( mcTrack->IsPhysicalPrimary()&&mcTrack->Charge()!=0&&((trackPseudorap>-0.8&&trackPseudorap<0.8))) { + nAcceptedParticles += 1; + } + } + +cout << "number of accepted particles from MC tracks is"<< nAcceptedParticles << endl; +fHistGenMultiplicity->Fill(nAcceptedParticles); + +AliMCParticle *mcMotherParticle = 0x0; +AliMCParticle* daughter0 = 0x0; +AliMCParticle* daughter1 = 0x0; +Bool_t SelectK0; +Bool_t SelectKpos; +Bool_t SelectKneg; + +for (Int_t i = 0; i < nMCTracks; i++){ + mcTrack = (AliMCParticle*)fmcEvent->GetTrack(i); + if (!mcTrack) continue; + + Int_t mcPartPdg = mcTrack->PdgCode(); + Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); + + SelectK0 = mcPartPdg==310&& (isPhysPrim); // (8010 total. When we include only primary, 7546)-310 for neutral + SelectKpos = mcPartPdg==321&& (isPhysPrim); // 321 is the code for positive kaons + SelectKneg = mcPartPdg==-321&& (isPhysPrim); // 321 is the code for positive kaons + + Double_t TrackPt = mcTrack->Pt(); + Double_t TrackPhi = mcTrack->Phi(); + Double_t TrackEta = mcTrack->Eta(); + Double_t TrackMass = mcTrack->M(); + + Double_t KaonVariables[4]= {TrackPt, TrackPhi, TrackEta, TrackMass}; + if(SelectK0) fMCK0->Fill(KaonVariables); + if(SelectKpos) fMCKpos->Fill(KaonVariables); + if(SelectKneg) fMCKneg->Fill(KaonVariables); + + Bool_t TrIsPrim = mcTrack->IsPhysicalPrimary(); + Bool_t TrCharge = (mcTrack->Charge())!=0; + Short_t cha; + if (mcTrack->Charge()>0) cha=1.; + else if (mcTrack->Charge()<0) cha= -1.; + else cha =0; + +} + + +for (Int_t i = 0; i < nMCTracks; i++){ + AliMCParticle *mcTrack1 = (AliMCParticle*)fmcEvent->GetTrack(i); + if (!SelectKPosTracksMC(mcTrack1)) continue; + if (!mcTrack1) continue; + Double_t trackPseudorap = mcTrack1->Eta(); + if(! (mcTrack1->IsPhysicalPrimary()&&mcTrack1->Charge()!=0&&((trackPseudorap>-0.8&&trackPseudorap<0.8)))) continue; + Double_t phi1 = mcTrack1->Phi(); + Double_t eta1 = mcTrack1->Eta(); + + for (Int_t j = i+1; j < nMCTracks; j++){ + AliMCParticle *mcTrack2 = (AliMCParticle*)fmcEvent->GetTrack(j); + if (!SelectKNegTracksMC(mcTrack2)) continue; + if (!mcTrack2) continue; + Double_t trackPseudorap = mcTrack2->Eta(); + if(! (mcTrack2->IsPhysicalPrimary()&&mcTrack2->Charge()!=0&&((trackPseudorap>-0.8&&trackPseudorap<0.8)))) continue; + Double_t phi2 = mcTrack2->Phi(); + Double_t eta2 = mcTrack2->Eta(); + Double_t DEta = fabs(eta1 - eta2); + Double_t DPhi = fabs(phi1 - phi2); + Fill2DHistMCTruth(DPhi,DEta,fHistKpKnMC); + } + +} + +for (Int_t i = 0; i < nMCTracks; i++){ + AliMCParticle *mcTrack1 = (AliMCParticle*)fmcEvent->GetTrack(i); + if (!SelectK0TracksMC(mcTrack1)) continue; + if (!mcTrack1) continue; + Double_t trackPseudorap = mcTrack1->Eta(); + if(! (mcTrack1->IsPhysicalPrimary()&&mcTrack1->Charge()!=0&&((trackPseudorap>-0.8&&trackPseudorap<0.8)))) continue; + Double_t phi1 = mcTrack1->Phi(); + Double_t eta1 = mcTrack1->Eta(); + + for (Int_t j = i+1; j < nMCTracks; j++){ + AliMCParticle *mcTrack2 = (AliMCParticle*)fmcEvent->GetTrack(j); + if (!SelectKchTracksMC(mcTrack2)) continue; + if (!mcTrack2) continue; + Double_t trackPseudorap = mcTrack2->Eta(); + if(! (mcTrack2->IsPhysicalPrimary()&&mcTrack2->Charge()!=0&&((trackPseudorap>-0.8&&trackPseudorap<0.8)))) continue; + Double_t phi2 = mcTrack2->Phi(); + Double_t eta2 = mcTrack2->Eta(); + Double_t DEta = fabs(eta1 - eta2); + Double_t DPhi = fabs(phi1 - phi2); + Fill2DHistMCTruth(DPhi,DEta,fHistK0KchMC); + } + +} + +} + //_____________________________________________________________________________ -void AliAnalysisTaskKaon2PC::UserExec(Option_t *) +void Kaon2PC::UserExec(Option_t *) { if (!fAnalysisMC) { RunData(); } + if (fAnalysisMC) { RunMC(); } // deleting TObjArrays //fSelectedK0s->Clear(); @@ -1042,23 +1386,23 @@ void AliAnalysisTaskKaon2PC::UserExec(Option_t *) //==================== Filling functions ========================= -void AliAnalysisTaskKaon2PC::Fill2DHist(Double_t DPhi, Double_t DEta, TH3F* hist, Double_t fWeight=1){ +void Kaon2PC::Fill2DHist(Double_t DPhi, Double_t DEta, TH2F* hist){ DPhi = fabs(DPhi); DEta = fabs(DEta); if (DPhi > Pi) DPhi = Pi-(DPhi-Pi); - hist->Fill(DPhi,DEta,fWeight); - hist->Fill(DPhi,-DEta,fWeight); + hist->Fill(DPhi,DEta); + hist->Fill(DPhi,-DEta); if (DPhi < 0.5*Pi ) { - hist->Fill(-DPhi, DEta,fWeight); - hist->Fill(-DPhi,-DEta,fWeight); + hist->Fill(-DPhi, DEta); + hist->Fill(-DPhi,-DEta); } else { - hist->Fill(2*Pi-(DPhi), DEta,fWeight); - hist->Fill(2*Pi-(DPhi),-DEta,fWeight); + hist->Fill(2*Pi-(DPhi), DEta); + hist->Fill(2*Pi-(DPhi),-DEta); } } -void AliAnalysisTaskKaon2PC::FillDPhiHist(Double_t DPhi, TH2F* hist, Double_t fWeight=1){ +void Kaon2PC::FillDPhiHist(Double_t DPhi, TH2F* hist, Double_t fWeight=1){ DPhi = fabs(DPhi); if (DPhi > Pi) DPhi = Pi-(DPhi-Pi); hist->Fill(DPhi,fWeight); @@ -1069,8 +1413,25 @@ void AliAnalysisTaskKaon2PC::FillDPhiHist(Double_t DPhi, TH2F* hist, Double_t fW hist->Fill(2*Pi-(DPhi),fWeight); } } + +void Kaon2PC::Fill2DHistMCTruth(Double_t DPhi, Double_t DEta, TH2F* hist){ + DPhi = fabs(DPhi); + DEta = fabs(DEta); + if (DPhi > Pi) DPhi = Pi-(DPhi-Pi); + hist->Fill(DPhi,DEta); + hist->Fill(DPhi,-DEta); + if (DPhi < 0.5*Pi ) { + hist->Fill(-DPhi, DEta); + hist->Fill(-DPhi,-DEta); + } + else { + hist->Fill(2*Pi-(DPhi), DEta); + hist->Fill(2*Pi-(DPhi),-DEta); + } +} + //_____________________________________________________________________________ -void AliAnalysisTaskKaon2PC::Terminate(Option_t *) +void Kaon2PC::Terminate(Option_t *) { if(fPoolMgr) delete fPoolMgr; } diff --git a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h index 406e72d347b..81a1ccadec1 100644 --- a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h +++ b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h @@ -23,6 +23,9 @@ class TH1F; class TH2F; class TH3F; class AliPIDResponse; +class AliMCParticle; +class THnSparse; +class AliAODv0; class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE { public: @@ -36,27 +39,37 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE Bool_t AcceptTrack(const AliAODTrack* Trk); Bool_t AcceptPosTrack(const AliAODTrack* Trk); Bool_t AcceptNegTrack(const AliAODTrack* Trk); + Double_t Beta(const AliAODTrack *track); Bool_t AcceptV0(const AliAODv0 *v0, Double_t *vertex); + Bool_t SelectK0TracksMC(AliMCParticle *mcTrack); + Bool_t SelectKPosTracksMC(AliMCParticle *mcTrack); + Bool_t SelectKNegTracksMC(AliMCParticle *mcTrack); + Bool_t SelectKchTracksMC(AliMCParticle *mcTrack); virtual void UserExec(Option_t* option); virtual void Terminate(Option_t* option); - virtual void Fill2DHist(Double_t DPhi, Double_t DEta, TH3F* hist, Double_t fWeight); + virtual void Fill2DHist(Double_t DPhi, Double_t DEta, TH2F* hist); virtual void FillDPhiHist(Double_t DPhi, TH2F* hist, Double_t fWeight); + virtual void Fill2DHistMCTruth(Double_t DPhi, Double_t DEta, TH2F* hist); AliEventCuts fEventCuts; // event cuts void SetMCRead(Bool_t flag) {fAnalysisMC = flag;} + void SetFilterBit(Int_t filterbit) {fBit = filterbit;} + //void SetPtLimits(Double_t ptmin, Double_t ptmax) { fLpTCut = ptmin; fUpTCut=ptmax; } + //void SetEtaLimit(Double_t etalimit) { fEta = etalimit; } //mixing //void SetNofSamples(Int_t n) { fNOfSamples = n; } //sampling setter void SetCentBinsForMixing(Int_t nofBins, std::vector bins) { fNCentBins = nofBins; fCentBins = bins; } private: void RunData(); - + void RunMC(); + AliAODEvent* fAOD; //! input event TList* fOutputList; //! output list AliPIDResponse* fPIDResponse; //! pid response object’ - TH1F* fEnergy; //! dummy histogram - TH1F* fEnergyCuts; //! dummy histogram + TH1F* fEnergy; //! dummy histogram + TH1F* fEnergyCuts; //! dummy histogram TH2F* fPID; //! dummy histogram TH2F* fPIDKaon; //! dummy histogram TH2F* fPIDK; //! dummy histogram @@ -66,11 +79,12 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE TH2F* fNsigmaTOFK; //! dummy histogram TH2F* fNsigmaTOFKaon; //! dummy histogram TH2F* fNsigmaTPCTOFK; //! dummy histogram + TH2F* fHistTOFKch; //! dummy histogram TH1F* fVtx; //! dummy histogram TH1F* fClusters; //! dummy histogram TH1F* fHistNEvents; //! dummy histogram - TH1F* fHistNV0; //! dummy histogram + TH1F* fHistNV0; //! dummy histogram TH1F* fHistEta; //! dummy histogram TH1F* fHistDEta; //! dummy histogram TH1F* fHistPhi; //! dummy histogram @@ -102,29 +116,44 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE TH2F* f2DHistNegEta; //! dummy histogram TH2F* f2DHistNegRap; //! dummy histogram - TH3F* fHistK0PhiEta; //! dummy histogram - TH3F* fHistPosPhiEta; //! dummy histogram - TH3F* fHistNegPhiEta; //! dummy histogram + TH2F* fHistK0PhiEta; //! dummy histogram + TH2F* fHistPosPhiEta; //! dummy histogram + TH2F* fHistNegPhiEta; //! dummy histogram TH2F* fHistCFPhi; //! dummy histogram TH2F* fHistCFEta; //! dummy histogram TH2F* fHistKChKChPhi; //! dummy histogram TH2F* fHistKPosKNegPhi; //! dummy histogram - TH3F* fHistCF; //! dummy histogram - TH3F* fHistKChKCh; //! dummy histogram - TH3F* fHistKPosKNeg; //! dummy histogram + TH2F* fHistCF; //! dummy histogram + TH2F* fHistKChKCh; //! dummy histogram + TH2F* fHistKPosKNeg; //! dummy histogram TH1F* hPt; TH1F* hPt_kPos; TH2F* fHistCF_Bg; + TH2F* fHistCF_KpKn_Bg; + AliMCEvent* fmcEvent; + THnSparse* fMCK0; + THnSparse* fMCKpos; + THnSparse* fMCKneg; + TH2F* fHistKpKnMC; + TH2F* fHistK0KchMC; + TH1D* fHistGenMultiplicity; + + Double_t fPV[3]; Bool_t fAnalysisMC; // enable MC study Bool_t fRejectEventPileUp; // enable to use Pile-up cuts + Bool_t fKpKnCorr; + Bool_t fK0KchCorr; Double_t PVx; Double_t PVy; Double_t PVz; + Double_t fBit; + Double_t fCentMin; + Double_t fCentMax; Double_t fLpTCut; //not a pointer??? Double_t fUpTCut; Double_t fEtaCut; @@ -141,11 +170,12 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE Double_t fSigPosv0Cut; Double_t fSigNegv0Cut; - // mixing TObjArray* fSelectedKCh; //! TObjArray* fSelectedK0s; //! + TObjArray* fSelectedKpos; //! + TObjArray* fSelectedKneg; //! AliEventPoolManager* fPoolMgr; //! event pool manager for Event Mixing // Int_t fNOfSamples; // std::vector fsampleBins; //sampling From a5f96982df2635c100d40774f78ca7dac223719a Mon Sep 17 00:00:00 2001 From: maciacco Date: Mon, 17 Apr 2023 17:51:58 +0200 Subject: [PATCH 06/51] apply custom pid calibration from file + variable renaming --- .../AliAnalysisTaskKaonXiCorrelation.cxx | 48 ++++++++++++++++--- .../AliAnalysisTaskKaonXiCorrelation.h | 8 ++++ 2 files changed, 50 insertions(+), 6 deletions(-) diff --git a/PWGLF/STRANGENESS/KaonXiCorrelation/AliAnalysisTaskKaonXiCorrelation.cxx b/PWGLF/STRANGENESS/KaonXiCorrelation/AliAnalysisTaskKaonXiCorrelation.cxx index fa405001b7f..08280906678 100644 --- a/PWGLF/STRANGENESS/KaonXiCorrelation/AliAnalysisTaskKaonXiCorrelation.cxx +++ b/PWGLF/STRANGENESS/KaonXiCorrelation/AliAnalysisTaskKaonXiCorrelation.cxx @@ -11,7 +11,9 @@ using std::string; // ROOT includes #include #include +#include #include +#include #include #include #include @@ -112,6 +114,13 @@ void AliAnalysisTaskKaonXiCorrelation::UserCreateOutputObjects() } } + const char* det[] = {"ITS", "TPC", "TOF"}; + TFile calib_file(fCustomPidPath.data()); + for (int iD = 0; iD < 3; ++iD) + { + fCustomPidCalib[iD] = (TH3F*)calib_file.Get(Form("fCustom%spidCalib", det[iD])); + } + fList = new TList(); fList->SetOwner(kTRUE); fEventCuts.AddQAplotsToList(fList); @@ -138,7 +147,7 @@ void AliAnalysisTaskKaonXiCorrelation::UserExec(Option_t *) fMCEvent = MCEvent(); } - double bFfield{ev->GetMagneticField()}; + double bField{ev->GetMagneticField()}; fRecCollision.fCent = fEventCuts.GetCentrality(fEstimator); if (fRecCollision.fCent < fMinCentrality || fRecCollision.fCent > fMaxCentrality) { @@ -161,7 +170,7 @@ void AliAnalysisTaskKaonXiCorrelation::UserExec(Option_t *) tgr |= kCentral; if (handl->IsEventSelected() & AliVEvent::kSemiCentral) tgr |= kSemiCentral; - int magField = bFfield > 0 ? kPositiveB : 0; + int magField = bField > 0 ? kPositiveB : 0; fRecCollision.fTrigger = tgr + magField; fPID = handl->GetPIDResponse(); @@ -194,9 +203,9 @@ void AliAnalysisTaskKaonXiCorrelation::UserExec(Option_t *) double dcaMag = std::sqrt(dca[1] * dca[1] + dca[0] * dca[0]); bool tof = HasTOF(aodTrack); - double itsNsigma = fPID->NumberOfSigmasITS(aodTrack, AliPID::kKaon); - double tpcNsigma = fPID->NumberOfSigmasTPC(aodTrack, AliPID::kKaon); - double tofNsigma = tof ? fPID->NumberOfSigmasTOF(aodTrack, AliPID::kKaon) : -999.f; + double itsNsigma = GetCustomNsigma(aodTrack, fRecCollision.fCent, 0); + double tpcNsigma = GetCustomNsigma(aodTrack, fRecCollision.fCent, 1); + double tofNsigma = tof ? GetCustomNsigma(aodTrack, fRecCollision.fCent, 2) : -999.f; if (!aodTrack->TestFilterBit(fFilterBit) && fFilterBit) continue; @@ -355,7 +364,7 @@ void AliAnalysisTaskKaonXiCorrelation::UserExec(Option_t *) double cosPAV0 = casc->CosPointingAngle(pv); // TOF matching - bool hasTOFhit = !pTrackCasc->GetTOFBunchCrossing(bFfield) || !nTrackCasc->GetTOFBunchCrossing(bFfield) || !bTrackCasc->GetTOFBunchCrossing(bFfield); + bool hasTOFhit = !pTrackCasc->GetTOFBunchCrossing(bField) || !nTrackCasc->GetTOFBunchCrossing(bField) || !bTrackCasc->GetTOFBunchCrossing(bField); // track status: ( fCasc_NegTrackStatus & AliESDtrack::kITSrefit ) is the codition to check kITSrefit bool hasITSrefit = (nTrackCasc->GetStatus() & AliVTrack::kITSrefit) || (pTrackCasc->GetStatus() & AliVTrack::kITSrefit) || (bTrackCasc->GetStatus() & AliVTrack::kITSrefit); @@ -696,4 +705,31 @@ bool AliAnalysisTaskKaonXiCorrelation::HasTwoXiFromSameDaughters(std::vectorNumberOfSigmasITS(t, AliPID::kKaon); + break; + case 1: + nsigma = fPID->NumberOfSigmasTPC(t, AliPID::kKaon); + break; + case 2: + nsigma = fPID->NumberOfSigmasTOF(t, AliPID::kKaon); + break; + } + if (fUseCustomPid && fCustomPidCalib[det]) { + int binX = fCustomPidCalib[det]->GetXaxis()->FindBin(cent); + int binY = fCustomPidCalib[det]->GetYaxis()->FindBin(t->Pt()); + int binZ = fCustomPidCalib[det]->GetZaxis()->FindBin(t->Eta()); + double muCalib = fCustomPidCalib[det]->GetBinContent(binX, binY, binZ); + double sigCalib = fCustomPidCalib[det]->GetBinError(binX, binY, binZ); + if (muCalib > 1.e-12 || sigCalib > 1.e-12){ + return ( nsigma - muCalib ) / sigCalib; + } + } + return nsigma; } \ No newline at end of file diff --git a/PWGLF/STRANGENESS/KaonXiCorrelation/AliAnalysisTaskKaonXiCorrelation.h b/PWGLF/STRANGENESS/KaonXiCorrelation/AliAnalysisTaskKaonXiCorrelation.h index 7892ca3d687..4229f0b90f1 100644 --- a/PWGLF/STRANGENESS/KaonXiCorrelation/AliAnalysisTaskKaonXiCorrelation.h +++ b/PWGLF/STRANGENESS/KaonXiCorrelation/AliAnalysisTaskKaonXiCorrelation.h @@ -14,6 +14,7 @@ class AliPIDResponse; class TH2F; +class TH3F; class TList; class TTree; @@ -161,6 +162,9 @@ class AliAnalysisTaskKaonXiCorrelation : public AliAnalysisTaskSE { void SetBDTPath(const char *path = "") { fBDTPath = path; } void SetPtBinsBDT(int nBins, double *ptBins) { fPtBinsBDT.Set(nBins+1,ptBins); } + void SetCustomPidPath(const char* path = "") { fCustomPidPath = path; }; + void SetUseCustomPid(const bool toggle = true) { fUseCustomPid = toggle; }; + // Setters for Kaon track cuts private: @@ -251,12 +255,16 @@ class AliAnalysisTaskKaonXiCorrelation : public AliAnalysisTaskSE { TArrayD fPtBinsBDT; std::string fBDTPath = ""; + std::string fCustomPidPath = ""; + TH3F* fCustomPidCalib[3] = {nullptr, nullptr, nullptr}; + bool fUseCustomPid = false; float Eta2y(float pt, float m, float eta) const; int WhichBDT(double pt); int GetITScls(AliAODTrack *track, int &nSPD, int &nSDD, int &nSSD); bool HasTOF(AliAODTrack *track); bool HasTwoXiFromSameDaughters(std::vector daughters); + double GetCustomNsigma(AliAODTrack *t, double cent, int det = 0); /// \cond CLASSDEF ClassDef(AliAnalysisTaskKaonXiCorrelation, 1); From d0445b06ce35969124cf8a96a402d66571b04c01 Mon Sep 17 00:00:00 2001 From: Anjaly Menon Date: Mon, 17 Apr 2023 11:34:46 -0500 Subject: [PATCH 07/51] fixed a typo --- .../AliAnalysisTaskKaon2PC.cxx | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx index 28968b9a408..402c526ac8f 100644 --- a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx +++ b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// Kaon2PC: +// AliAnalysisTaskKaon2PC: // Description: Analysis task to calculate Two-Particle Angular Correlation Functions of Neutral and Charged Kaons // Author: Anjaly Sasikumar Menon // (anjaly.sasikumar.menon@cern.ch) @@ -44,15 +44,15 @@ #include "AliAODVZERO.h" #include "AliVParticle.h" #include "TLorentzVector.h" -#include "Kaon2PC.h" +#include "AliAnalysisTaskKaon2PC.h" -class Kaon2PC; // This analysis class +class AliAnalysisTaskKaon2PC; // This analysis class using namespace std; // std namespace: so you can do things like 'cout' -ClassImp(Kaon2PC) // classimp: necessary for root +ClassImp(AliAnalysisTaskKaon2PC) // classimp: necessary for root const Double_t Pi = TMath::Pi(); -Kaon2PC::Kaon2PC() : AliAnalysisTaskSE(), +AliAnalysisTaskKaon2PC::AliAnalysisTaskKaon2PC() : AliAnalysisTaskSE(), fAOD(0), fOutputList(0), fPIDResponse(0), @@ -175,7 +175,7 @@ fEventCuts(0) // this is used by root for IO purposes, it needs to remain empty } //_____________________________________________________________________________ -Kaon2PC::Kaon2PC(const char* name) : AliAnalysisTaskSE(name), +AliAnalysisTaskKaon2PC::AliAnalysisTaskKaon2PC(const char* name) : AliAnalysisTaskSE(name), fAOD(0), fOutputList(0), fPIDResponse(0), @@ -300,7 +300,7 @@ fEventCuts(0) DefineOutput(1, TList::Class()); } //_____________________________________________________________________________ -Kaon2PC::~Kaon2PC() +AliAnalysisTaskKaon2PC::~AliAnalysisTaskKaon2PC() { // destructor if(fOutputList) { @@ -312,7 +312,7 @@ Kaon2PC::~Kaon2PC() if(fSelectedKneg) delete fSelectedKneg; } //_____________________________________________________________________________ -void Kaon2PC::UserCreateOutputObjects() +void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() { // create output objects // this function is called ONCE at the start of your analysis (RUNTIME) @@ -647,7 +647,7 @@ void Kaon2PC::UserCreateOutputObjects() } -void Kaon2PC::SetTrackCuts(Double_t c1, Double_t c2, Double_t c3, Double_t c4) { +void AliAnalysisTaskKaon2PC::SetTrackCuts(Double_t c1, Double_t c2, Double_t c3, Double_t c4) { fLpTCut = c1; fUpTCut = c2; @@ -655,7 +655,7 @@ void Kaon2PC::SetTrackCuts(Double_t c1, Double_t c2, Double_t c3, Double_t c4) { fSigCut = c4; } -void Kaon2PC::SetV0TrackCuts(Double_t c5, Double_t c6, Double_t c7, Double_t c8, Double_t c9, Double_t c10, Double_t c11, Double_t c12, Double_t c13, Double_t c14, Double_t c15) { +void AliAnalysisTaskKaon2PC::SetV0TrackCuts(Double_t c5, Double_t c6, Double_t c7, Double_t c8, Double_t c9, Double_t c10, Double_t c11, Double_t c12, Double_t c13, Double_t c14, Double_t c15) { fDecayLv0Cut = c5; fLpTv0Cut = c6; @@ -671,7 +671,7 @@ void Kaon2PC::SetV0TrackCuts(Double_t c5, Double_t c6, Double_t c7, Double_t c8, } //_____________________________________________________________________________ -Bool_t Kaon2PC::AcceptTrack(const AliAODTrack *Trk) { +Bool_t AliAnalysisTaskKaon2PC::AcceptTrack(const AliAODTrack *Trk) { if (!Trk->TestFilterBit(96)) return kFALSE; if (Trk->Charge() == 0) return kFALSE; //excluding neutral particles if (Trk->Pt() <= fLpTCut || Trk->Pt() >= fUpTCut) return kFALSE; // pt cut @@ -697,7 +697,7 @@ Bool_t Kaon2PC::AcceptTrack(const AliAODTrack *Trk) { //_____________________________________________________________________________ -Bool_t Kaon2PC::AcceptPosTrack(const AliAODTrack *Trk) { +Bool_t AliAnalysisTaskKaon2PC::AcceptPosTrack(const AliAODTrack *Trk) { if(Trk->Charge() < 0) return kFALSE; // excluding negative tracks return kTRUE; @@ -705,7 +705,7 @@ Bool_t Kaon2PC::AcceptPosTrack(const AliAODTrack *Trk) { //_____________________________________________________________________________ -Bool_t Kaon2PC::AcceptNegTrack(const AliAODTrack *Trk) { +Bool_t AliAnalysisTaskKaon2PC::AcceptNegTrack(const AliAODTrack *Trk) { if(Trk->Charge() > 0) return kFALSE; // excluding positive tracks return kTRUE; @@ -713,7 +713,7 @@ Bool_t Kaon2PC::AcceptNegTrack(const AliAODTrack *Trk) { //_____________________________________________________________________________ -Double_t Kaon2PC::Beta(const AliAODTrack *track) +Double_t AliAnalysisTaskKaon2PC::Beta(const AliAODTrack *track) { Double_t startTime = fPIDResponse->GetTOFResponse().GetStartTime(((AliVTrack*)track)->P()); //in ps Double_t stoptime = track->GetTOFsignal(); @@ -727,7 +727,7 @@ Double_t Kaon2PC::Beta(const AliAODTrack *track) //___________________________ v0 selection with no pT cut _________________________ -Bool_t Kaon2PC::AcceptV0(const AliAODv0 *v0, Double_t *vertex) { +Bool_t AliAnalysisTaskKaon2PC::AcceptV0(const AliAODv0 *v0, Double_t *vertex) { if (v0->GetOnFlyStatus()) return kFALSE; Double_t length = v0->DecayLengthV0(vertex); @@ -772,7 +772,7 @@ Bool_t Kaon2PC::AcceptV0(const AliAODv0 *v0, Double_t *vertex) { // MC Truth Booleans -Bool_t Kaon2PC::SelectK0TracksMC(AliMCParticle *mcTrack ) { +Bool_t AliAnalysisTaskKaon2PC::SelectK0TracksMC(AliMCParticle *mcTrack ) { Int_t mcPartPdg = mcTrack->PdgCode(); Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); Bool_t SelectK0 = mcPartPdg==310&& (isPhysPrim); @@ -780,7 +780,7 @@ Bool_t Kaon2PC::SelectK0TracksMC(AliMCParticle *mcTrack ) { return kTRUE; } -Bool_t Kaon2PC::SelectKPosTracksMC(AliMCParticle *mcTrack ) { +Bool_t AliAnalysisTaskKaon2PC::SelectKPosTracksMC(AliMCParticle *mcTrack ) { Int_t mcPartPdg = mcTrack->PdgCode(); Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); Bool_t SelectKpos = mcPartPdg==321&& (isPhysPrim); @@ -788,7 +788,7 @@ Bool_t Kaon2PC::SelectKPosTracksMC(AliMCParticle *mcTrack ) { return kTRUE; } -Bool_t Kaon2PC::SelectKNegTracksMC(AliMCParticle *mcTrack ) { +Bool_t AliAnalysisTaskKaon2PC::SelectKNegTracksMC(AliMCParticle *mcTrack ) { Int_t mcPartPdg = mcTrack->PdgCode(); Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); Bool_t SelectKneg = mcPartPdg==-321&& (isPhysPrim); @@ -796,7 +796,7 @@ Bool_t Kaon2PC::SelectKNegTracksMC(AliMCParticle *mcTrack ) { return kTRUE; } -Bool_t Kaon2PC::SelectKchTracksMC(AliMCParticle *mcTrack ) { +Bool_t AliAnalysisTaskKaon2PC::SelectKchTracksMC(AliMCParticle *mcTrack ) { Int_t mcPartPdg = mcTrack->PdgCode(); Bool_t isPhysPrim = mcTrack->IsPhysicalPrimary(); Bool_t SelectKch = mcPartPdg==321&& mcPartPdg==-321&& (isPhysPrim); @@ -807,7 +807,7 @@ Bool_t Kaon2PC::SelectKchTracksMC(AliMCParticle *mcTrack ) { //_____________________________________________________________________________ -void Kaon2PC::RunData() { +void AliAnalysisTaskKaon2PC::RunData() { fAOD = dynamic_cast(InputEvent()); if(!fAOD) return; @@ -1249,7 +1249,7 @@ pool2->UpdatePool(tracksClone2); //=================== MC Truth Correlation function ======== -void Kaon2PC::RunMC() { +void AliAnalysisTaskKaon2PC::RunMC() { Int_t nAcceptedParticles =0; AliMCParticle *mcTrack = 0x0; @@ -1372,7 +1372,7 @@ for (Int_t i = 0; i < nMCTracks; i++){ //_____________________________________________________________________________ -void Kaon2PC::UserExec(Option_t *) +void AliAnalysisTaskKaon2PC::UserExec(Option_t *) { if (!fAnalysisMC) { RunData(); } if (fAnalysisMC) { RunMC(); } @@ -1386,7 +1386,7 @@ void Kaon2PC::UserExec(Option_t *) //==================== Filling functions ========================= -void Kaon2PC::Fill2DHist(Double_t DPhi, Double_t DEta, TH2F* hist){ +void AliAnalysisTaskKaon2PC::Fill2DHist(Double_t DPhi, Double_t DEta, TH2F* hist){ DPhi = fabs(DPhi); DEta = fabs(DEta); if (DPhi > Pi) DPhi = Pi-(DPhi-Pi); @@ -1402,7 +1402,7 @@ void Kaon2PC::Fill2DHist(Double_t DPhi, Double_t DEta, TH2F* hist){ } } -void Kaon2PC::FillDPhiHist(Double_t DPhi, TH2F* hist, Double_t fWeight=1){ +void AliAnalysisTaskKaon2PC::FillDPhiHist(Double_t DPhi, TH2F* hist, Double_t fWeight=1){ DPhi = fabs(DPhi); if (DPhi > Pi) DPhi = Pi-(DPhi-Pi); hist->Fill(DPhi,fWeight); @@ -1414,7 +1414,7 @@ void Kaon2PC::FillDPhiHist(Double_t DPhi, TH2F* hist, Double_t fWeight=1){ } } -void Kaon2PC::Fill2DHistMCTruth(Double_t DPhi, Double_t DEta, TH2F* hist){ +void AliAnalysisTaskKaon2PC::Fill2DHistMCTruth(Double_t DPhi, Double_t DEta, TH2F* hist){ DPhi = fabs(DPhi); DEta = fabs(DEta); if (DPhi > Pi) DPhi = Pi-(DPhi-Pi); @@ -1431,7 +1431,7 @@ void Kaon2PC::Fill2DHistMCTruth(Double_t DPhi, Double_t DEta, TH2F* hist){ } //_____________________________________________________________________________ -void Kaon2PC::Terminate(Option_t *) +void AliAnalysisTaskKaon2PC::Terminate(Option_t *) { if(fPoolMgr) delete fPoolMgr; } From b3ac9e4b0b30fc57308010947df1cc3e4b67a127 Mon Sep 17 00:00:00 2001 From: Raymond Ehlers Date: Mon, 17 Apr 2023 09:56:08 -0700 Subject: [PATCH 08/51] Add track skim versioning, tag for photon at part level --- .../UserTasks/AliAnalysisTaskTrackSkim.cxx | 112 +++++++++++++++--- .../UserTasks/AliAnalysisTaskTrackSkim.h | 31 +++-- 2 files changed, 119 insertions(+), 24 deletions(-) diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskTrackSkim.cxx b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskTrackSkim.cxx index f53c836e001..097606b5da0 100644 --- a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskTrackSkim.cxx +++ b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskTrackSkim.cxx @@ -4,6 +4,7 @@ #include "AliAnalysisTaskTrackSkim.h" +#include #include #include @@ -49,6 +50,11 @@ namespace PWGJE namespace EMCALJetTasks { +const std::map AliAnalysisTaskTrackSkim::fgkMCUtilsGeneratorMap = { + { "kPythia", AliMCAnalysisUtils::generator::kPythia }, + { "kHerwig", AliMCAnalysisUtils::generator::kHerwig } +}; + /** * Track skimming task for jet analysis */ @@ -61,6 +67,9 @@ AliAnalysisTaskTrackSkim::AliAnalysisTaskTrackSkim() fYAMLConfig(), fConfigurationInitialized{false}, fChargeScaling{false}, + fEncodeAdditionalParticleInformation{false}, + fMCAnalysisUtilsGenerator{AliMCAnalysisUtils::generator::kPythia}, + fMCAnalysisUtils{nullptr}, fNAcceptedFirstTrackCollection{nullptr}, fTriggerBitINT7{false}, fCentralityForTree{-1}, @@ -86,6 +95,9 @@ AliAnalysisTaskTrackSkim::AliAnalysisTaskTrackSkim(const char* name) fYAMLConfig(), fConfigurationInitialized{false}, fChargeScaling{false}, + fEncodeAdditionalParticleInformation{false}, + fMCAnalysisUtilsGenerator{AliMCAnalysisUtils::generator::kPythia}, + fMCAnalysisUtils{nullptr}, fNAcceptedFirstTrackCollection{nullptr}, fTriggerBitINT7{false}, fCentralityForTree{-1}, @@ -116,6 +128,9 @@ AliAnalysisTaskTrackSkim::AliAnalysisTaskTrackSkim( : fYAMLConfig(other.fYAMLConfig), fConfigurationInitialized(other.fConfigurationInitialized), fChargeScaling{other.fChargeScaling}, + fEncodeAdditionalParticleInformation{fEncodeAdditionalParticleInformation}, + fMCAnalysisUtilsGenerator{other.fMCAnalysisUtilsGenerator}, + fMCAnalysisUtils{nullptr}, fNAcceptedFirstTrackCollection{nullptr}, fTriggerBitINT7{other.fTriggerBitINT7}, fCentralityForTree{other.fCentralityForTree}, @@ -141,6 +156,15 @@ AliAnalysisTaskTrackSkim& AliAnalysisTaskTrackSkim::operator=( return *this; } +AliMCAnalysisUtils * AliAnalysisTaskTrackSkim::GetMCAnalysisUtils() +{ + if (!fMCAnalysisUtils){ + fMCAnalysisUtils = new AliMCAnalysisUtils(); + fMCAnalysisUtils->SetMCGenerator(fMCAnalysisUtilsGenerator); + } + return fMCAnalysisUtils; +} + /** * Retrieve task properties from the YAML configuration. */ @@ -156,12 +180,23 @@ void AliAnalysisTaskTrackSkim::RetrieveAndSetTaskPropertiesFromYAMLConfig() fMinCent = centRange.first; fMaxCent = centRange.second; } - bool chargeScaling; - res = fYAMLConfig.GetProperty({ baseName, "chargeScaling" }, chargeScaling, false); + // Scale pt by the charge to encode the charge + res = fYAMLConfig.GetProperty({ baseName, "chargeScaling" }, fChargeScaling, false); if (res) { - fChargeScaling = chargeScaling; AliDebugStream(3) << "Charge scaling enabled.\n"; } + // Settings for additional encoded particle information + res = fYAMLConfig.GetProperty({baseName, "encodeAdditionalParticleInformation"}, fEncodeAdditionalParticleInformation, false); + if (res) { + AliDebugStream(3) << "Will encode additional particle level information.\n"; + } + // MC utils generator + std::string tempStr = ""; + res = fYAMLConfig.GetProperty({baseName, "MCAnalysisUtilsGenerator"}, tempStr, false); + if (res) { + AliDebugStream(3) << "MC analysis utils generator set to '" << tempStr << "'.\n"; + fMCAnalysisUtilsGenerator = fgkMCUtilsGeneratorMap.at(tempStr); + } } /** @@ -201,6 +236,9 @@ void AliAnalysisTaskTrackSkim::AddParticleLabelsToMap(std::mapGetContainer()->GetName(); - fTreeSkim = new TTree(nameoutput, nameoutput); - // Ensure that the size of the trees in memory is reasoanble + std::string outputName = GetOutputSlot(2)->GetContainer()->GetName(); + // Add version to tree name so we can keep track of the outputs. + outputName += "_v" + std::to_string(fOutputVersion); + fTreeSkim = new TTree(outputName.c_str(), outputName.c_str()); + // Ensure that the size of the trees in memory is reasonable int nEnabledTrees = 1; fTreeSkim->SetMaxVirtualSize(1.e+8/nEnabledTrees); @@ -226,7 +266,7 @@ void AliAnalysisTaskTrackSkim::SetupTree() // Nothing } // PbPb specific - // NOTE: We use the centrality selection as a proxy for PbPb because the beam type isn't relisable + // NOTE: We use the centrality selection as a proxy for PbPb because the beam type isn't reliable // until after the tree is already setup. if ((fMinCent != -999) && (fMaxCent != -999)) { fTreeSkim->Branch("centrality", &fCentralityForTree); @@ -239,11 +279,17 @@ void AliAnalysisTaskTrackSkim::SetupTree() // Always want the first set of kinematics variables. AddParticleKinematicsToMap(fFirstTrackCollectionKinematics); if (fIsPythia) { - // Add further informaton for pythia. + // Add further information for pythia. AddParticleLabelsToMap(fFirstTrackCollectionLabels); // NOTE: At detector level, the particle ID is apparently returned as 0. // So we skip storing it here by removing it. fFirstTrackCollectionLabels.erase("particle_ID"); + // NOTE: We also skip the encoded information since we don't have a use for it + // for data/det level as of April 2023. + // NOTE: Only remove if it's already there... + if (fEncodeAdditionalParticleInformation) { + fFirstTrackCollectionLabels.erase("encoded_information"); + } AddParticleKinematicsToMap(fSecondTrackCollectionKinematics); AddParticleLabelsToMap(fSecondTrackCollectionLabels); } @@ -367,6 +413,35 @@ void AliAnalysisTaskTrackSkim::ClearTree() } } +std::string AliAnalysisTaskTrackSkim::GetMCHeaderName() +{ + AliGenEventHeader * eventHeader = MCEvent()->GenEventHeader(); + return eventHeader->ClassName(); +} + +/** + * NOTE: We encode only for particle level because this won't work for detector level + */ +void AliAnalysisTaskTrackSkim::EncodeAdditionalParticleLevelInformation(AliVParticle * particle) +{ + std::bitset<32> information; + + // Check photon types + AliMCAnalysisUtils * mcAnalysisUtils = GetMCAnalysisUtils(); + TString headerName = GetMCHeaderName(); + // Using 1 for cluster E as convention since I don't think it's relevant for particle level. + Int_t tag = GetMCAnalysisUtils()->CheckOrigin(particle->GetLabel(), MCEvent(), headerName, 1.); + if(GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCPrompt)) { + information.set(EncodedInformation_t::kPhotonPrompt); + } + if (GetMCAnalysisUtils()->CheckTagBit(tag, AliMCAnalysisUtils::kMCFragmentation)) { + information.set(EncodedInformation_t::kPhotonFragmentation); + } + + // Finally, store the encoded information + fSecondTrackCollectionLabels["encoded_information"].push_back(static_cast(information.to_ulong())); +} + Bool_t AliAnalysisTaskTrackSkim::FillHistograms() { // Reset @@ -390,13 +465,13 @@ Bool_t AliAnalysisTaskTrackSkim::FillHistograms() AliErrorStream() << GetName() << ": Unable to retrieve particles in slot 0!\n"; return false; } - + for (auto particle : particles->accepted()) { if(fChargeScaling && particle->Charge() < 0) { fFirstTrackCollectionKinematics["pt"].push_back(particle->Pt()*-1); } - else { - fFirstTrackCollectionKinematics["pt"].push_back(particle->Pt()); + else { + fFirstTrackCollectionKinematics["pt"].push_back(particle->Pt()); } fFirstTrackCollectionKinematics["eta"].push_back(particle->Eta()); fFirstTrackCollectionKinematics["phi"].push_back(particle->Phi()); @@ -429,6 +504,8 @@ Bool_t AliAnalysisTaskTrackSkim::FillHistograms() fSecondTrackCollectionLabels["particle_ID"].push_back(particle->PdgCode()); // Label fSecondTrackCollectionLabels["label"].push_back(particle->GetLabel()); + // Encode additional particle level information + EncodeAdditionalParticleLevelInformation(particle); } } @@ -504,12 +581,10 @@ std::string AliAnalysisTaskTrackSkim::toString() const else { tempSS << "disabled.\n"; } - tempSS << "\tCharge scaling: "; - if (fChargeScaling) { - tempSS << "enabled.\n"; - } - else { - tempSS << "disabled.\n"; + tempSS << "\tCharge scaling: " << fChargeScaling; + tempSS << "\tEncode additional particle information: " << fEncodeAdditionalParticleInformation; + if (fEncodeAdditionalParticleInformation && fMCAnalysisUtils) { + tempSS << "\t\tMC analysis utils generator: " << fMCAnalysisUtils->GetMCGeneratorString() << "\n"; } // Particle variables: tempSS << "Particle variables:\n"; @@ -589,6 +664,9 @@ void swap(PWGJE::EMCALJetTasks::AliAnalysisTaskTrackSkim& first, swap(first.fYAMLConfig, second.fYAMLConfig); swap(first.fConfigurationInitialized, second.fConfigurationInitialized); swap(first.fChargeScaling, second.fChargeScaling); + swap(first.fEncodeAdditionalParticleInformation, second.fEncodeAdditionalParticleInformation); + swap(first.fMCAnalysisUtilsGenerator, second.fMCAnalysisUtilsGenerator); + swap(first.fMCAnalysisUtils, second.fMCAnalysisUtils); swap(first.fNAcceptedFirstTrackCollection, second.fNAcceptedFirstTrackCollection); swap(first.fTriggerBitINT7, second.fTriggerBitINT7), swap(first.fCentralityForTree, second.fCentralityForTree), diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskTrackSkim.h b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskTrackSkim.h index 9f17c277164..ff02b20ad40 100644 --- a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskTrackSkim.h +++ b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskTrackSkim.h @@ -8,7 +8,7 @@ * Track skimming for jet analysis. Borrows from HFTreeCreator. * * @author Raymond Ehlers , ORNL - * @date 1 Auguust 2021 + * @date 1 August 2021 */ #include @@ -28,6 +28,7 @@ class AliEmcalJetFinder; #include "AliAnalysisTaskEmcalJet.h" #include "AliYAMLConfiguration.h" +#include "AliMCAnalysisUtils.h" // operator<< has to be forward declared carefully to stay in the global namespace so that it works with CINT. // For generally how to keep the operator in the global namespace, See: https://stackoverflow.com/a/38801633 @@ -46,6 +47,13 @@ namespace EMCALJetTasks { class AliAnalysisTaskTrackSkim : public AliAnalysisTaskEmcalJet { public: + enum EncodedInformation_t { + kNone = 0, //! fgkMCUtilsGeneratorMap; //!> fFirstTrackCollectionKinematics; //!> fFirstTrackCollectionLabels; //!> fSecondTrackCollectionKinematics; //! Date: Mon, 17 Apr 2023 16:18:33 -0400 Subject: [PATCH 09/51] AliAnalysisTaskNewJetSubstructure - add flag for pileup cuts --- .../AliAnalysisTaskNewJetSubstructure.cxx | 12 +- .../AliAnalysisTaskNewJetSubstructure.h | 119 +++++++++--------- 2 files changed, 73 insertions(+), 58 deletions(-) diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskNewJetSubstructure.cxx b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskNewJetSubstructure.cxx index 0483e2e2114..da69ac8cd90 100644 --- a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskNewJetSubstructure.cxx +++ b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskNewJetSubstructure.cxx @@ -60,7 +60,8 @@ AliAnalysisTaskNewJetSubstructure::AliAnalysisTaskNewJetSubstructure() fEtaCutValue(0.02), fMagFieldPolarity(1), fDerivSubtrOrder(0), fPtJet(0x0), fHLundIterative(0x0), fHLundIterativeMC(0x0), fHLundIterativeMCDet(0x0), fHCheckResolutionSubjets(0x0), - fStoreDetLevelJets(0), fTreeSubstructure(0), fDoSubJet(0), fDoFlow(0), fQVectorReader(0) + fStoreDetLevelJets(0), fTreeSubstructure(0), fDoSubJet(0), fDoFlow(0), fQVectorReader(0), + fRejectTPCPileup(kFALSE) { for (Int_t i = 0; i < 18; i++) { @@ -88,7 +89,8 @@ AliAnalysisTaskNewJetSubstructure::AliAnalysisTaskNewJetSubstructure( fEtaCutValue(0.02), fMagFieldPolarity(1), fDerivSubtrOrder(0), fPtJet(0x0), fHLundIterative(0x0), fHLundIterativeMC(0x0), fHLundIterativeMCDet(0x0), fHCheckResolutionSubjets(0x0), - fStoreDetLevelJets(0), fTreeSubstructure(0), fDoSubJet(0), fDoFlow(0), fQVectorReader(0) + fStoreDetLevelJets(0), fTreeSubstructure(0), fDoSubJet(0), fDoFlow(0), fQVectorReader(0), + fRejectTPCPileup(kFALSE) { // Standard constructor. @@ -240,6 +242,12 @@ Bool_t AliAnalysisTaskNewJetSubstructure::Run() { // Run analysis code here, if needed. It will be executed before // FillHistograms(). + if (fRejectTPCPileup) { //possible bug occurs here, use with caution + fAliEventCuts.SetRejectTPCPileupWithITSTPCnCluCorr(kTRUE,1); + Bool_t acceptEventCuts = fAliEventCuts.AcceptEvent(InputEvent()); + if(!acceptEventCuts) return kFALSE; + } + return kTRUE; } diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskNewJetSubstructure.h b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskNewJetSubstructure.h index bfded3bfefb..a89af31419e 100644 --- a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskNewJetSubstructure.h +++ b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskNewJetSubstructure.h @@ -42,57 +42,63 @@ class AliAnalysisTaskNewJetSubstructure : public AliAnalysisTaskEmcalJet { void Terminate(Option_t *option); // Setters - void SetJetContainer(Int_t c) { fContainer = c; } - void SetMinFractionShared(Double_t f) { fMinFractionShared = f; } - void SetJetShapeType(JetShapeType t) { fJetShapeType = t; } - void SetJetShapeSub(JetShapeSub t) { fJetShapeSub = t; } - void SetJetSelection(JetSelectionType t) { fJetSelection = t; } - void SetJetPtThreshold(Float_t f) { fPtThreshold = f; } - void SetRMatching(Float_t f) { fRMatching = f; } - - void SetCentralitySelectionOn(Bool_t t) { fCentSelectOn = t; } - void SetOneConstSelectionOn(Bool_t t) { fOneConstSelectOn = t; } - void SetCheckTracksOn(Bool_t t) { fTrackCheckPlots = t; } - void SetFillLundMC(Bool_t t) { fDoFillMCLund = t; } - void SetCheckResolution(Bool_t t) { fCheckResolution = t; } - void SetSubjetCutoff(Float_t t) { fSubjetCutoff = t; } - void SetMinPtConst(Float_t t) { fMinPtConst = t;} - void SetHardCutoff(Float_t t) { fHardCutoff = t; } - void SetDoTwoTrack(Bool_t t) { fDoTwoTrack = t; } - void SetCutDoubleCounts(Bool_t t) {fCutDoubleCounts = t;} - void SetDoAreaIterative(Bool_t t) { fDoAreaIterative = t; } - void SetPowerAlgorithm(Float_t t) { fPowerAlgo = t; } - void SetMagFieldPol(Float_t t) { fMagFieldPolarity = t; } - void SetMinCentrality(Float_t t) { fCentMin = t; } - void SetMaxCentrality(Float_t t) { fCentMax = t; } - void SetDerivativeSubtractionOrder(Int_t c) { fDerivSubtrOrder = c; } - void SetDetLevelJetsOn(Bool_t t) { fStoreDetLevelJets = t; } - void SetDoSubJetStudy(Bool_t t) { fDoSubJet = t; } - void SetDoFlow(Bool_t t) { fDoFlow = t; } + void SetJetContainer(Int_t c) { fContainer = c; } + void SetMinFractionShared(Double_t f) { fMinFractionShared = f; } + void SetJetShapeType(JetShapeType t) { fJetShapeType = t; } + void SetJetShapeSub(JetShapeSub t) { fJetShapeSub = t; } + void SetJetSelection(JetSelectionType t) { fJetSelection = t; } + void SetJetPtThreshold(Float_t f) { fPtThreshold = f; } + void SetRMatching(Float_t f) { fRMatching = f; } + + void SetCentralitySelectionOn(Bool_t t) { fCentSelectOn = t; } + void SetOneConstSelectionOn(Bool_t t) { fOneConstSelectOn = t; } + void SetCheckTracksOn(Bool_t t) { fTrackCheckPlots = t; } + void SetFillLundMC(Bool_t t) { fDoFillMCLund = t; } + void SetCheckResolution(Bool_t t) { fCheckResolution = t; } + void SetSubjetCutoff(Float_t t) { fSubjetCutoff = t; } + void SetMinPtConst(Float_t t) { fMinPtConst = t;} + void SetHardCutoff(Float_t t) { fHardCutoff = t; } + void SetDoTwoTrack(Bool_t t) { fDoTwoTrack = t; } + void SetCutDoubleCounts(Bool_t t) { fCutDoubleCounts = t;} + void SetDoAreaIterative(Bool_t t) { fDoAreaIterative = t; } + void SetPowerAlgorithm(Float_t t) { fPowerAlgo = t; } + void SetMagFieldPol(Float_t t) { fMagFieldPolarity = t; } + void SetMinCentrality(Float_t t) { fCentMin = t; } + void SetMaxCentrality(Float_t t) { fCentMax = t; } + void SetDerivativeSubtractionOrder(Int_t c) { fDerivSubtrOrder = c; } + void SetDetLevelJetsOn(Bool_t t) { fStoreDetLevelJets = t; } + void SetDoSubJetStudy(Bool_t t) { fDoSubJet = t; } + void SetDoFlow(Bool_t t) { fDoFlow = t; } + void SetRejectTPCPileup(Bool_t val) { fRejectTPCPileup = val;} + protected: - Bool_t RetrieveEventObjects(); - Bool_t Run(); - Bool_t FillHistograms(); + Bool_t RetrieveEventObjects(); + Bool_t Run(); + Bool_t FillHistograms(); - Float_t GetJetMass(AliEmcalJet *jet, Int_t jetContNb); - Float_t Angularity(AliEmcalJet *jet, Int_t jetContNb); - Float_t GetJetAngularity(AliEmcalJet *jet, Int_t jetContNb); + Float_t GetJetMass(AliEmcalJet *jet, Int_t jetContNb); + Float_t Angularity(AliEmcalJet *jet, Int_t jetContNb); + Float_t GetJetAngularity(AliEmcalJet *jet, Int_t jetContNb); Double_t RelativePhi(Double_t mphi, Double_t vphi); - void IterativeParents(AliEmcalJet *fJet, AliJetContainer *fJetCont, fastjet::PseudoJet *sub1, fastjet::PseudoJet *sub2,std::vector* const1, std::vector* const2); - void IterativeParentsPP(AliEmcalJet *fJet, AliJetContainer *fJetCont, fastjet::PseudoJet *sub1, fastjet::PseudoJet *sub2,std::vector* const1, std::vector* const2); - void IterativeParentsAreaBased(AliEmcalJet *fJet, AliJetContainer *fJetCont); - void IterativeParentsMCAverage(AliEmcalJet *fJet, Int_t km, Double_t &aver1, - Double_t &aver2, Double_t &aver3, - Double_t &aver4, fastjet::PseudoJet *sub1, fastjet::PseudoJet *sub2, std::vector* const1, std::vector* const2); - void IterativeParentsMCAveragePP(AliEmcalJet *fJet, Int_t km, Double_t &aver1, - Double_t &aver2, Double_t &aver3, - Double_t &aver4, fastjet::PseudoJet *sub1, fastjet::PseudoJet *sub2, std::vector* const1, std::vector* const2); - void CheckSubjetResolution(AliEmcalJet *fJet, AliJetContainer *fJetCont, - AliEmcalJet *fJetM, AliJetContainer *fJetContM); - // Bool_t CheckClosePartner(Int_t index, AliEmcalJet *fJet, AliVParticle *fTrack, AliParticleContainer *fTrackCont); - Bool_t CheckClosePartner(AliEmcalJet* jet, PWG::JETFW::AliEmcalParticleJetConstituent & part1); - Bool_t CompareSubjets(fastjet::PseudoJet *subDet, fastjet::PseudoJet *subHyb, std::vector *constDet, std::vector* constHyb); + void IterativeParents(AliEmcalJet *fJet, AliJetContainer *fJetCont, fastjet::PseudoJet *sub1, + fastjet::PseudoJet *sub2,std::vector* const1, std::vector* const2); + void IterativeParentsPP(AliEmcalJet *fJet, AliJetContainer *fJetCont, fastjet::PseudoJet *sub1, + fastjet::PseudoJet *sub2,std::vector* const1, std::vector* const2); + void IterativeParentsAreaBased(AliEmcalJet *fJet, AliJetContainer *fJetCont); + void IterativeParentsMCAverage(AliEmcalJet *fJet, Int_t km, Double_t &aver1, + Double_t &aver2, Double_t &aver3, Double_t &aver4, fastjet::PseudoJet *sub1, fastjet::PseudoJet *sub2, + std::vector* const1, std::vector* const2); + void IterativeParentsMCAveragePP(AliEmcalJet *fJet, Int_t km, Double_t &aver1, + Double_t &aver2, Double_t &aver3, Double_t &aver4, fastjet::PseudoJet *sub1, fastjet::PseudoJet *sub2, + std::vector* const1, std::vector* const2); + void CheckSubjetResolution(AliEmcalJet *fJet, AliJetContainer *fJetCont, + AliEmcalJet *fJetM, AliJetContainer *fJetContM); + + //Bool_t CheckClosePartner(Int_t index, AliEmcalJet *fJet, AliVParticle *fTrack, AliParticleContainer *fTrackCont); + Bool_t CheckClosePartner(AliEmcalJet* jet, PWG::JETFW::AliEmcalParticleJetConstituent & part1); + Bool_t CompareSubjets(fastjet::PseudoJet *subDet, fastjet::PseudoJet *subHyb, std::vector *constDet, + std::vector* constHyb); Int_t fContainer; ///< jets to be analyzed 0 for Base, 1 for subtracted. Float_t fMinFractionShared; ///< only fill histos for jets if shared fraction // larger than X @@ -126,18 +132,19 @@ class AliAnalysisTaskNewJetSubstructure : public AliAnalysisTaskEmcalJet { Bool_t fDoFlow; ///< store the event plane AliAnalysisTaskJetQnVectors* fQVectorReader; ///< Reader for the Qn vector Double_t fEPangleV0M; ///< event-plane angle V0M + Bool_t fRejectTPCPileup; ///< TPC pileup rejection - TH1F *fPtJet; ///< + TH1F *fPtJet; ///< - THnSparse *fHLundIterative; ///< iterative declustering - THnSparse *fHLundIterativeMC; ///< iterative declustering - THnSparse *fHLundIterativeMCDet; ///< iterative declustering + THnSparse *fHLundIterative; ///< iterative declustering + THnSparse *fHLundIterativeMC; ///< iterative declustering + THnSparse *fHLundIterativeMCDet; ///< iterative declustering THnSparse - *fHCheckResolutionSubjets; ///< to evaluate energy resolution of subjets - ///< as function fo apperture angle + *fHCheckResolutionSubjets; ///< to evaluate energy resolution of subjets + ///< as function fo apperture angle - TTree *fTreeSubstructure; ///< Tree with tagging variables subtracted MC or true - // MC or raw + TTree *fTreeSubstructure; ///< Tree with tagging variables subtracted MC or true + // MC or raw private: AliAnalysisTaskNewJetSubstructure( @@ -145,6 +152,6 @@ class AliAnalysisTaskNewJetSubstructure : public AliAnalysisTaskEmcalJet { AliAnalysisTaskNewJetSubstructure & operator=(const AliAnalysisTaskNewJetSubstructure &); // not implemented - ClassDef(AliAnalysisTaskNewJetSubstructure, 12) + ClassDef(AliAnalysisTaskNewJetSubstructure, 13) }; #endif From 444113753eb98752c89519eba39fb3a9006abdcb Mon Sep 17 00:00:00 2001 From: Anjaly Menon Date: Mon, 17 Apr 2023 17:28:10 -0500 Subject: [PATCH 10/51] Updated the event mixing algorithm --- .../AliAnalysisTaskKaon2PC.cxx | 59 +++++++++---------- .../KaonCorrelations/AliAnalysisTaskKaon2PC.h | 1 + 2 files changed, 29 insertions(+), 31 deletions(-) diff --git a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx index 402c526ac8f..6e5783f44af 100644 --- a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx +++ b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx @@ -151,7 +151,7 @@ fMinEventsToMix(10), fNzVtxBins(10), fNCentBins(15), fKpKnCorr(kTRUE), -fK0KchCorr(kFALSE), +fK0KchCorr(kTRUE), /* fNOfSamples(1.0), fSampleIndex(0.0), @@ -274,7 +274,7 @@ fMinEventsToMix(10), fNzVtxBins(10), fNCentBins(15), fKpKnCorr(kTRUE), -fK0KchCorr(kFALSE), +fK0KchCorr(kTRUE), /* fNOfSamples(1.0), fSampleIndex(0.0), @@ -976,6 +976,7 @@ Int_t nSelectedKneg = fSelectedKneg->GetEntries(); cout << " nSelectedKneg is " << nSelectedKneg << endl; //======== Neutral Kaon Selection ========== + fSelectedK0s = new TObjArray; fSelectedK0s->SetOwner(kTRUE); @@ -1139,18 +1140,18 @@ fHistMult->Fill(iTracks); fHistCent->Fill(CentV0M); //================== mixing ============================ (You can create a seperate function FillCorrelationsMixed() later) -if (fK0KchCorr){ +AliEventPool *pool = fPoolMgr->GetEventPool(CentV0M, PVz); +if(pool) {cout << "Good news....!!!!!!! Pool found.. " << endl; } +if(!pool) { AliError(Form("No pool found for centrality = %f, zVtx = %f", CentV0M,PVz)); return; } -AliEventPool *pool1 = fPoolMgr->GetEventPool(CentV0M, PVz); -if(pool1) {cout << "Good news....!!!!!!! Pool found.. " << endl; } -if(!pool1) { AliError(Form("No pool found for centrality = %f, zVtx = %f", CentV0M,PVz)); return; } +if (fK0KchCorr){ -if(pool1->IsReady() || pool1->NTracksInPool() > fPoolMinNTracks || pool1->GetCurrentNEvents() >= fMinEventsToMix) { +if(pool->IsReady() || pool->NTracksInPool() > fPoolMinNTracks || pool->GetCurrentNEvents() >= fMinEventsToMix) { -Int_t nMix = pool1->GetCurrentNEvents(); +Int_t nMix = pool->GetCurrentNEvents(); for (Int_t jMix=0; jMix< nMix; jMix++){ - TObjArray* bgTracks = pool1->GetEvent(jMix); //bgTracks are from the mixed events + TObjArray* bgTracks = pool->GetEvent(jMix); //bgTracks are from the mixed events for(Int_t iTrig(0); iTrig < fSelectedK0s->GetEntries(); iTrig++){ AliVParticle* K0Trig = dynamic_cast(fSelectedK0s->At(iTrig)); @@ -1185,37 +1186,32 @@ Int_t nMix = pool1->GetCurrentNEvents(); }//end of pool - TObjArray* tracksClone = (TObjArray*) fSelectedKCh->Clone(); - tracksClone->SetOwner(kTRUE); - pool1->UpdatePool(tracksClone); - } //================== mixing ============================ (for k+k- CF) if (fKpKnCorr){ -AliEventPool *pool2 = fPoolMgr->GetEventPool(CentV0M, PVz); -if(pool2) {cout << "Good news....!!!!!!! Pool found.. " << endl; } -if(!pool2) { AliError(Form("No pool found for centrality = %f, zVtx = %f", CentV0M,PVz)); return; } - -if(pool2->IsReady() || pool2->NTracksInPool() > fPoolMinNTracks || pool2->GetCurrentNEvents() >= fMinEventsToMix) { +if(pool->IsReady() || pool->NTracksInPool() > fPoolMinNTracks || pool->GetCurrentNEvents() >= fMinEventsToMix) { -Int_t nMix = pool2->GetCurrentNEvents(); +Int_t nMix = pool->GetCurrentNEvents(); for (Int_t jMix=0; jMix< nMix; jMix++){ - TObjArray* bgTracks2 = pool2->GetEvent(jMix); //bgTracks are from the mixed events + TObjArray* bgTracks2 = pool->GetEvent(jMix); //bgTracks are from the mixed events - for(Int_t iTrig(0); iTrig < fSelectedKpos->GetEntries(); iTrig++){ - AliVParticle* KposTrig = dynamic_cast(fSelectedKpos->At(iTrig)); - if(!KposTrig) continue; + for(Int_t iTrig(0); iTrig < fSelectedKCh->GetEntries(); iTrig++){ + AliVParticle* KaonTrig = dynamic_cast(fSelectedKCh->At(iTrig)); + if(!KaonTrig) continue; for (Int_t iAss(0); iAss < bgTracks2->GetEntries(); iAss++){ - AliVParticle* KnegAssoc = dynamic_cast (bgTracks2->At(iAss)); - if(!KnegAssoc) continue; - Double_t DPhiMix = fabs(KposTrig->Phi() - KnegAssoc->Phi()); - Double_t DEtaMix = fabs(KposTrig->Eta() - KnegAssoc->Eta()); + AliVParticle* KaonAssoc = dynamic_cast (bgTracks2->At(iAss)); + + if(!KaonAssoc) continue; + if( KaonAssoc->Charge() != KaonTrig->Charge() ) continue; + + Double_t DPhiMix = fabs(KaonTrig->Phi() - KaonAssoc->Phi()); + Double_t DEtaMix = fabs(KaonTrig->Eta() - KaonAssoc->Eta()); if (DPhiMix > Pi) DPhiMix = Pi-(DPhiMix-Pi); @@ -1239,12 +1235,13 @@ Int_t nMix = pool2->GetCurrentNEvents(); }//end of pool -TObjArray* tracksClone2 = (TObjArray*) fSelectedKneg->Clone(); -tracksClone2->SetOwner(kTRUE); -pool2->UpdatePool(tracksClone2); - } +TObjArray* tracksClone = (TObjArray*) fSelectedKCh->Clone(); +tracksClone->SetOwner(kTRUE); +pool->UpdatePool(tracksClone); + + } //end of RunData function //=================== MC Truth Correlation function ======== diff --git a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h index 81a1ccadec1..bddcfbfb620 100644 --- a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h +++ b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h @@ -170,6 +170,7 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE Double_t fSigPosv0Cut; Double_t fSigNegv0Cut; + // mixing TObjArray* fSelectedKCh; //! From 06f76b6400b196aaf741ad240a626108df82ae42 Mon Sep 17 00:00:00 2001 From: Antonio Paz Date: Tue, 18 Apr 2023 00:56:26 -0600 Subject: [PATCH 11/51] Redefined the new 2D pt histos to be consistent with other flatenicity 2D plots --- PWGMM/UE/UeKNO/AliAnalysisTaskFlatenicity.cxx | 123 +++++++++--------- PWGMM/UE/UeKNO/AliAnalysisTaskFlatenicity.h | 34 +++-- 2 files changed, 77 insertions(+), 80 deletions(-) diff --git a/PWGMM/UE/UeKNO/AliAnalysisTaskFlatenicity.cxx b/PWGMM/UE/UeKNO/AliAnalysisTaskFlatenicity.cxx index 3ce5bd3b6da..b34525490bc 100644 --- a/PWGMM/UE/UeKNO/AliAnalysisTaskFlatenicity.cxx +++ b/PWGMM/UE/UeKNO/AliAnalysisTaskFlatenicity.cxx @@ -90,9 +90,11 @@ Double_t Ptbins[nPtbins + 1] = { const Int_t nCent = 9; Double_t centClass[nCent + 1] = {0.0, 1.0, 5.0, 10.0, 20.0, 30.0, 40.0, 50.0, 70.0, 100.0}; + const Int_t nFlatClass = 8; Double_t FlatClass[nFlatClass + 1] = {0.0, 0.01, 0.05, 0.10, 0.20, 0.30, 0.40, 0.50, 1.0}; + // const Int_t nCent = 2; // Double_t centClass[nCent + 1] = {0.0, 50.0, 100.0}; const Int_t nDet = 4; @@ -122,8 +124,8 @@ ClassImp(AliAnalysisTaskFlatenicity) // classimp: necessary for root hCountAuthV0m(0), hCountProdu_FlatMC(0), hCountAuth_FlatMC(0), hMultMCmVsV0M(0), hMultMCaVsV0M(0), hMultMCcVsV0M(0), hMultmVsV0M(0), hMultmVsV0Malice(0), hMultaVsV0M(0), hMultcVsV0M(0), hV0MBadruns(0), - hChgProdu_pt(0), hChgAuth_pt(0), hChgProdu_V0_pt(0), hChgAuth_V0_pt(0), - hChgProdu_Flat_pt(0), hChgAuth_Flat_pt(0) { + hChgProdu_All_pt(0), hChgAuth_All_pt(0), hChgProdu_pt_V0(0), + hChgAuth_pt_V0(0), hChgProdu_pt_Flat(0), hChgAuth_pt_Flat(0) { for (Int_t i_c = 0; i_c < nCent; ++i_c) { hFlatVsPtV0M[i_c] = 0; } @@ -172,8 +174,8 @@ AliAnalysisTaskFlatenicity::AliAnalysisTaskFlatenicity(const char *name) hCountAuthV0m(0), hCountProdu_FlatMC(0), hCountAuth_FlatMC(0), hMultMCmVsV0M(0), hMultMCaVsV0M(0), hMultMCcVsV0M(0), hMultmVsV0M(0), hMultmVsV0Malice(0), hMultaVsV0M(0), hMultcVsV0M(0), hV0MBadruns(0), - hChgProdu_pt(0), hChgAuth_pt(0), hChgProdu_V0_pt(0), hChgAuth_V0_pt(0), - hChgProdu_Flat_pt(0), hChgAuth_Flat_pt(0) + hChgProdu_All_pt(0), hChgAuth_All_pt(0), hChgProdu_pt_V0(0), + hChgAuth_pt_V0(0), hChgProdu_pt_Flat(0), hChgAuth_pt_Flat(0) { for (Int_t i_c = 0; i_c < nCent; ++i_c) { @@ -238,18 +240,12 @@ void AliAnalysisTaskFlatenicity::UserCreateOutputObjects() { fCuts->SetMaxChi2PerClusterTPC(4); fCuts->SetMaxDCAToVertexZ(2); // fCuts->SetCutGeoNcrNcl(3., 130., 1.5, 0.85, 0.7); - //! ap Cut eliminated because Omar doesn't have it - // as requested on mail april 9, 2023 // fCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8); - //! ap Repeated cut // fCuts->SetMaxChi2PerClusterTPC(4); - //! ap Repeated cut // fCuts->SetMaxDCAToVertexZ(2); - //! ap Repeated cut fCuts->SetMaxChi2PerClusterITS(36); fCuts->SetMaxDCAToVertexXYPtDep("0.0105+0.0350/pt^1.1"); // fCuts->SetMaxChi2PerClusterITS(36); - //! ap Repeated cut fTrackFilter->AddCuts(fCuts); float min_flat = -0.01; @@ -405,48 +401,53 @@ void AliAnalysisTaskFlatenicity::UserCreateOutputObjects() { fOutputList->Add(hMultMCcVsV0M); // hCountEvent = new TH1D("hCountEvent", "event counter", 2, 0.5, 2.5); - hCountProduV0m = - new TH1D("hCountProduV0m", "CountChgV0m_prod", nCent, centClass); + hCountProduV0m = new TH1D("hCountProduV0m", "CountChgV0m_prod;Events;V0m", + nCent, centClass); fOutputList->Add(hCountProduV0m); - hCountAuthV0m = - new TH1D("hCountAuthV0m", "CountChgV0m_auth", nCent, centClass); + hCountAuthV0m = new TH1D("hCountAuthV0m", "CountChgV0m_auth;Events;V0m", + nCent, centClass); fOutputList->Add(hCountAuthV0m); - hCountProdu_FlatMC = new TH1D("hCountProdu_FlatMC", "CountChgFlat_prod", - nFlatClass, FlatClass); + hCountProdu_FlatMC = + new TH1D("hCountProdu_FlatMC", "CountChgFlat_prod;Events;Flatenicity", + nbins_flat, min_flat, max_flat); fOutputList->Add(hCountProdu_FlatMC); - hCountAuth_FlatMC = new TH1D("hCountAuth_FlatMC", "CountChgFlat_auth", - nFlatClass, FlatClass); + hCountAuth_FlatMC = + new TH1D("hCountAuth_FlatMC", "CountChgFlat_auth;Events;Flatenicity", + nbins_flat, min_flat, max_flat); fOutputList->Add(hCountAuth_FlatMC); - hChgProdu_pt = new TH1D("hChgProdu_pt", "hChgProdu_pt", nPtbins, Ptbins); - fOutputList->Add(hChgProdu_pt); + hChgProdu_All_pt = + new TH1D("hChgProdu_All_pt", + "hChgProdu_All_pt;;#it{p}_{T} (GeV/#it{c})", nPtbins, Ptbins); + fOutputList->Add(hChgProdu_All_pt); - hChgProdu_V0_pt = - new TH2D("hChgProdu_V0_pt", "; #it{p}_{T} (GeV/#it{c}); V0M Percentile", - nPtbins, Ptbins, nCent, centClass); - fOutputList->Add(hChgProdu_V0_pt); + hChgAuth_All_pt = + new TH1D("hChgAuth_All_pt", "hChgAuth_All_pt;;#it{p}_{T} (GeV/#it{c})", + nPtbins, Ptbins); + fOutputList->Add(hChgAuth_All_pt); - hChgProdu_Flat_pt = - new TH2D("hChgProdu_Flat_pt", - "; #it{p}_{T} (GeV/#it{c}); Flatenicity Percentile", nPtbins, - Ptbins, nFlatClass, FlatClass); - fOutputList->Add(hChgProdu_Flat_pt); + hChgProdu_pt_V0 = + new TH2D("hChgProdu_pt_V0", "; V0M Percentile; #it{p}_{T} (GeV/#it{c})", + nCent, centClass, nPtbins, Ptbins); + fOutputList->Add(hChgProdu_pt_V0); - hChgAuth_pt = new TH1D("hChgAuth_pt", "hChgAuth_pt", nPtbins, Ptbins); - fOutputList->Add(hChgAuth_pt); + hChgAuth_pt_V0 = + new TH2D("hChgAuth_pt_V0", "; V0M Percentile; #it{p}_{T} (GeV/#it{c})", + nCent, centClass, nPtbins, Ptbins); + fOutputList->Add(hChgAuth_pt_V0); - hChgAuth_V0_pt = - new TH2D("hChgAuth_V0_pt", "; #it{p}_{T} (GeV/#it{c}); V0M Percentile", - nPtbins, Ptbins, nCent, centClass); - fOutputList->Add(hChgAuth_V0_pt); + hChgAuth_pt_Flat = + new TH2D("hChgAuth_pt_Flat", "; Flatenicity; #it{p}_{T} (GeV/#it{c})", + nbins_flat, min_flat, max_flat, nPtbins, Ptbins); + fOutputList->Add(hChgAuth_pt_Flat); - hChgAuth_Flat_pt = new TH2D( - "hChgAuth_Flat_pt", "; #it{p}_{T} (GeV/#it{c}); Flatenicity Percentile", - nPtbins, Ptbins, nFlatClass, FlatClass); - fOutputList->Add(hChgAuth_Flat_pt); + hChgProdu_pt_Flat = + new TH2D("hChgProdu_pt_Flat", "; Flatenicity; #it{p}_{T} (GeV/#it{c})", + nbins_flat, min_flat, max_flat, nPtbins, Ptbins); + fOutputList->Add(hChgProdu_pt_Flat); } hActivityV0DataSectBefore = new TProfile( @@ -564,10 +565,10 @@ void AliAnalysisTaskFlatenicity::UserExec(Option_t *) { fv0mpercentile = fMultSelection->GetMultiplicityPercentile("V0M"); int v0multalice = fMultSelection->GetEstimator("V0M")->GetValue(); - fFlatPercentileMC = -1; + fFlatAltMC = -1; if (fUseMC) { - fFlatPercentileMC = GetFlatenicityMC(); - // if (fFlatPercentileMC >= 0) {} + fFlatAltMC = GetFlatenicityMC(); + // if (fFlatAltMC >= 0) {} } vector ptMC; @@ -610,9 +611,6 @@ void AliAnalysisTaskFlatenicity::UserExec(Option_t *) { GetMCchargedDetDists(fnDetec, ptDetMC, idDetMC); } - // const AliVVertex *vtTrc = fMC->GetPrimaryVertex(); - // if (!vtTrc) return; - hCounter->Fill(3.0); // good multiplicity @@ -622,17 +620,11 @@ void AliAnalysisTaskFlatenicity::UserExec(Option_t *) { // << fMultSelection << endl; hCounter->Fill(4.0); - //! ap This counter seems superfluos, and - // hCounter 4.0 will have same counts as - // hCounter 3.0 // Multiplicity Estimation // fv0mpercentile = -999; // fv0mpercentile = fMultSelection->GetMultiplicityPercentile("V0M"); // int v0multalice = fMultSelection->GetEstimator("V0M")->GetValue(); hCounter->Fill(10.0); - //! ap This counter seems superfluos, and - // hCounter 10.0 will have same counts as - // hCounter 4.0 for (Int_t i_c = 0; i_c < nCent; ++i_c) { if (fv0mpercentile >= centClass[i_c] && @@ -659,6 +651,7 @@ void AliAnalysisTaskFlatenicity::UserExec(Option_t *) { if (fUseMC) { if (isGoodVtxPosMC) { ExtractMultiplicitiesMC(); + float activityMC[4] = {0, 0, 0, 0}; activityMC[0] = fmultADCmc; activityMC[1] = fmultV0Cmc; @@ -675,6 +668,7 @@ void AliAnalysisTaskFlatenicity::UserExec(Option_t *) { hCombinedMultmc[2]->Fill(com3mc, fmultTPCmc); } } + // these values were obtained from LHC16l pass 2 (and MC) float avData[4] = {1819.91, 55.6384, 27.6564, 449.373}; float avExpect[4] = {9.18629, 15.1672, 11.934, 7.47469}; @@ -703,11 +697,13 @@ void AliAnalysisTaskFlatenicity::UserExec(Option_t *) { hCombinedMult[0]->Fill(com1, fmultTPC); hCombinedMult[1]->Fill(com2, fmultTPC); hCombinedMult[2]->Fill(com3, fmultTPC); + if (fUseMC) { hRmCombinedMult[0]->Fill(com1, com1mc); hRmCombinedMult[1]->Fill(com2, com2mc); hRmCombinedMult[2]->Fill(com3, com3mc); } + fFlat = flatenicity_v0; // default V0 if (fDetFlat == "VO_TPC") { fFlat = (flatenicity_v0 + flatenicity_tpc) / 2.0; @@ -719,7 +715,6 @@ void AliAnalysisTaskFlatenicity::UserExec(Option_t *) { fFlat = flatenicity_v0; } - hFlatV0vsFlatTPC->Fill(flatenicity_tpc, flatenicity_v0); fFlatMC = -1; if ((fUseMC) && (fmultV0Cmc) > 0 && (fmultV0Amc > 0)) { fFlatMC = GetFlatenicityMC(); @@ -737,6 +732,9 @@ void AliAnalysisTaskFlatenicity::UserExec(Option_t *) { MakeMCanalysis(); } } + + hFlatV0vsFlatTPC->Fill(flatenicity_tpc, flatenicity_v0); + if ((fFlat >= 0) && (fmultV0C) > 0 && (fmultV0A > 0)) { hFlatenicityBefore->Fill(fFlat); if (flatenicity_v0 < 0.9 && flatenicity_tpc < 0.9) { @@ -1207,6 +1205,7 @@ Double_t AliAnalysisTaskFlatenicity::GetFlatenicityMC() { } sRho_tmp /= (1.0 * nCells * nCells); Float_t sRho = TMath::Sqrt(sRho_tmp); + if (mRho > 0) { if (fRemoveTrivialScaling) { flatenicity = TMath::Sqrt(1.0 * nMult) * sRho / mRho; @@ -1478,7 +1477,7 @@ Int_t AliAnalysisTaskFlatenicity::FillMCarray(vector &ptArray, continue; if (TMath::Abs(particle->Eta()) > fEtaCut) continue; - if (particle->Pt() < 0.0) + if (particle->Pt() < fPtMin) continue; if (TMath::Abs(particle->Charge()) < 0.1) continue; @@ -1601,15 +1600,16 @@ void AliAnalysisTaskFlatenicity::GetMCchargedTrueDists( if (multGen < 1) return; + //! ap The INEL>0 condition // hCountEvent->Fill(1.0); hCountProduV0m->Fill(fv0mpercentile); - hCountProdu_FlatMC->Fill(fFlatPercentileMC); + hCountProdu_FlatMC->Fill(fFlatAltMC); for (Int_t i = 0; i < multGen; ++i) { - hChgProdu_pt->Fill(ptGen[i]); - hChgProdu_V0_pt->Fill(ptGen[i], fv0mpercentile); - hChgProdu_Flat_pt->Fill(ptGen[i], fFlatPercentileMC); + hChgProdu_All_pt->Fill(ptGen[i]); + hChgProdu_pt_V0->Fill(fv0mpercentile, ptGen[i]); + hChgProdu_pt_Flat->Fill(fFlatAltMC, ptGen[i]); } } @@ -1619,12 +1619,13 @@ void AliAnalysisTaskFlatenicity::GetMCchargedDetDists( if (multRec < 1) return; + //! ap The INEL>0 condition hCountAuthV0m->Fill(fv0mpercentile); - hCountAuth_FlatMC->Fill(fFlatPercentileMC); + hCountAuth_FlatMC->Fill(fFlatAltMC); for (Int_t i = 0; i < multRec; ++i) { - hChgAuth_pt->Fill(ptRec[i]); - hChgAuth_V0_pt->Fill(ptRec[i], fv0mpercentile); - hChgAuth_Flat_pt->Fill(ptRec[i], fFlatPercentileMC); + hChgAuth_All_pt->Fill(ptRec[i]); + hChgAuth_pt_V0->Fill(fv0mpercentile, ptRec[i]); + hChgAuth_pt_Flat->Fill(fFlatAltMC, ptRec[i]); } } diff --git a/PWGMM/UE/UeKNO/AliAnalysisTaskFlatenicity.h b/PWGMM/UE/UeKNO/AliAnalysisTaskFlatenicity.h index 0edff37da62..25496ae2255 100644 --- a/PWGMM/UE/UeKNO/AliAnalysisTaskFlatenicity.h +++ b/PWGMM/UE/UeKNO/AliAnalysisTaskFlatenicity.h @@ -2,8 +2,6 @@ /* See cxx source for full Copyright notice */ /* Add a description of your MPI analysis */ - - #ifndef AliAnalysisTaskFlatenicity_H #define AliAnalysisTaskFlatenicity_H @@ -44,12 +42,10 @@ class AliAnalysisTaskFlatenicity : public AliAnalysisTaskSE { void ExtractMultiplicitiesMC(); void MakeMCanalysis(); void MakeDataanalysis(); - void GetMCchargedTrueDists( Int_t multGen, - const std::vector &ptGen, - const std::vector &idGen); - void GetMCchargedDetDists( Int_t multRec, - const std::vector &ptRec, - const std::vector &idRec); + void GetMCchargedTrueDists(Int_t multGen, const std::vector &ptGen, + const std::vector &idGen); + void GetMCchargedDetDists(Int_t multRec, const std::vector &ptRec, + const std::vector &idRec); void SetPtMin(Double_t val) { fPtMin = val; @@ -67,11 +63,11 @@ class AliAnalysisTaskFlatenicity : public AliAnalysisTaskSE { } bool HasRecVertex(); - + Int_t FillMCarray(std::vector &pt, std::vector &id); - Int_t FillArray(std::vector &pt, std::vector &id, - std::vector &isprim); + Int_t FillArray(std::vector &pt, std::vector &id, + std::vector &isprim); protected: private: @@ -108,7 +104,7 @@ class AliAnalysisTaskFlatenicity : public AliAnalysisTaskSE { Double_t fPtMin; Double_t ftrackmult08; Double_t fv0mpercentile; - Double_t fFlatPercentileMC; + Double_t fFlatAltMC; Float_t fFlat; Float_t fFlatMC; AliMultSelection *fMultSelection; @@ -133,7 +129,7 @@ class AliAnalysisTaskFlatenicity : public AliAnalysisTaskSE { TH1D *hEtamc; TH1D *hEtamcAlice; TH1D *hCounter; -// TH1D *hCountEvent; + // TH1D *hCountEvent; TH1D *hCountProduV0m; TH1D *hCountAuthV0m; TH1D *hCountProdu_FlatMC; @@ -146,12 +142,12 @@ class AliAnalysisTaskFlatenicity : public AliAnalysisTaskSE { TH2D *hMultaVsV0M; TH2D *hMultcVsV0M; TH1D *hV0MBadruns; - TH1D *hChgProdu_pt; - TH1D *hChgAuth_pt; - TH2D *hChgProdu_V0_pt; - TH2D *hChgAuth_V0_pt; - TH2D *hChgProdu_Flat_pt; - TH2D *hChgAuth_Flat_pt; + TH1D *hChgProdu_All_pt; + TH1D *hChgAuth_All_pt; + TH2D *hChgProdu_pt_V0; + TH2D *hChgAuth_pt_V0; + TH2D *hChgProdu_pt_Flat; + TH2D *hChgAuth_pt_Flat; TH2D *hFlatVsPtV0M[9]; TH2D *hFlatVsPtV0MMC[9]; TH2D *hComponentsMult[4]; From f4a2a4c8e5aeb6ec1d71e15e3ab1b42270230e75 Mon Sep 17 00:00:00 2001 From: Nasir Mehdi Malik <89008506+namalikgit@users.noreply.github.com> Date: Tue, 18 Apr 2023 12:35:57 +0530 Subject: [PATCH 12/51] changed histo axis range and bins --- .../macros/mini/AddTaskLstarpp_sp.C | 42 +++++++++++-------- .../macros/mini/ConfigureLstarpp_sp.C | 20 +++++++-- 2 files changed, 40 insertions(+), 22 deletions(-) diff --git a/PWGLF/RESONANCES/macros/mini/AddTaskLstarpp_sp.C b/PWGLF/RESONANCES/macros/mini/AddTaskLstarpp_sp.C index 1a860ce0527..425aa6464f0 100644 --- a/PWGLF/RESONANCES/macros/mini/AddTaskLstarpp_sp.C +++ b/PWGLF/RESONANCES/macros/mini/AddTaskLstarpp_sp.C @@ -64,6 +64,7 @@ AliRsnMiniAnalysisTask * AddTaskLstarpp_sp Int_t pairCutSetID=0, Int_t mixingConfigID=0, Int_t aodFilterBit=5, + Int_t spBin=500, Int_t customQualityCutsID=1, AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutPrCandidate = AliRsnCutSetDaughterParticle::kTPCTOFpidLstar, AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutKaCandidate = AliRsnCutSetDaughterParticle::kTPCTOFpidLstar, @@ -146,8 +147,8 @@ AliRsnMiniAnalysisTask * AddTaskLstarpp_sp if(isPP){ if(MultBins==1) task->UseMultiplicity("AliMultSelection_V0M"); - else if(MultBins==2) task->UseMultiplicity("AliMultSelection_SPDTracklets08");// C here - else if(MultBins==3) task->UseMultiplicity("AliMultSelection_SPDTracklets08to15"); + else if(MultBins==2) task->UseMultiplicity("AliMultSelection_SPDTracklets");// C here + else if(MultBins==3) task->UseMultiplicity("AliMultSelection_RefMult08"); else task->UseMultiplicity("QUALITY"); }else task->UseCentrality("V0M"); @@ -227,6 +228,21 @@ AliRsnMiniAnalysisTask * AddTaskLstarpp_sp // -- EVENT-ONLY COMPUTATIONS ------------------------------------------------------------------- + + Double_t multbins[200]; + int j,nmult=0; + if(triggerMask==AliVEvent::kHighMultV0){ + for(j=0;j<10;j++){multbins[nmult]=0.001*j; nmult++;} + for(j=1;j<10;j++){multbins[nmult]=0.01*j; nmult++;} + for(j=1;j<=10;j++){multbins[nmult]=0.1*j; nmult++;} + }else{ + for(j=0;j<10;j++){multbins[nmult]=0.1*j; nmult++;} + for(j=1;j<=100;j++){multbins[nmult]=j; nmult++;} + } + nmult--; + + + //vertex Int_t vtxID=task->CreateValue(AliRsnMiniValue::kVz,kFALSE); AliRsnMiniOutput* outVtx=task->CreateOutput("eventVtx","HIST","EVENT"); @@ -235,29 +251,19 @@ AliRsnMiniAnalysisTask * AddTaskLstarpp_sp //multiplicity or centrality Int_t multID=task->CreateValue(AliRsnMiniValue::kMult,kFALSE); AliRsnMiniOutput* outMult=task->CreateOutput("eventMult","HIST","EVENT"); - - Int_t multb; - Double_t multlow,multhigh; - if(isPP && !MultBins){ - multb =400; - multlow=0.; - multhigh=400.;} - else{multb =110; - multlow=0.; - multhigh=110.;} - - outMult->AddAxis(multID,multb,multlow,multhigh); + if(isPP && !MultBins) outMult->AddAxis(multID,400,0.5,400.5); + else outMult->AddAxis(multID,110,0.,110.); TH2F* hvz=new TH2F("hVzVsCent","",110,0.,110., 240,-12.0,12.0); task->SetEventQAHist("vz",hvz);//plugs this histogram into the fHAEventVz data member - TH2F* hmc=new TH2F("MultiVsCent","", 110,0.,110., multb,multlow,multhigh); + TH2F* hmc=new TH2F("MultiVsCent","", nmult,multbins, 101,-0.5,100.5); hmc->GetYaxis()->SetTitle("QUALITY"); task->SetEventQAHist("multicent",hmc);//plugs this histogram into the fHAEventMultiCent data member - TH2F* hsp=new TH2F("hSpherocityVsCent","",110,0.,110., 100.,0.,1.); + TH2F* hsp=new TH2F("hSpherocityVsCent","",nmult,multbins,spBin,0.0,1.0); task->SetEventQAHist("spherocitycent",hsp);//plugs this histogram into the fHASpherocityCent data member // -- PAIR CUTS (common to all resonances) ------------------------------------------------------ @@ -272,11 +278,11 @@ AliRsnMiniAnalysisTask * AddTaskLstarpp_sp // -- CONFIG ANALYSIS -------------------------------------------------------------------------- #if !defined (__CINT__) || defined (__CLING__) - if (!ConfigureLstarpp_sp(task, isMC, isPP, "", cutsPair, aodFilterBit, customQualityCutsID, cutPrCandidate, cutKaCandidate, nsigmaPr, nsigmaKa,nsigmaTOFPr, nsigmaTOFKa, enableMonitor,triggerMask)) return 0x0; + if (!ConfigureLstarpp_sp(task, isMC, isPP, "", cutsPair, aodFilterBit,spBin, customQualityCutsID, cutPrCandidate, cutKaCandidate, nsigmaPr, nsigmaKa,nsigmaTOFPr, nsigmaTOFKa, enableMonitor,triggerMask)) return 0x0; #else gROOT->LoadMacro("$ALICE_PHYSICS/PWGLF/RESONANCES/macros/mini/ConfigureLstarpp_sp.C"); // gROOT->LoadMacro("ConfigureLstarpp_sp.C"); - if (!ConfigureLstarpp_sp(task, isMC, isPP, "", cutsPair, aodFilterBit, customQualityCutsID, cutPrCandidate, cutKaCandidate, nsigmaPr, nsigmaKa,nsigmaTOFPr, nsigmaTOFKa, enableMonitor,triggerMask)) return 0x0; + if (!ConfigureLstarpp_sp(task, isMC, isPP, "", cutsPair, aodFilterBit,spBin, customQualityCutsID, cutPrCandidate, cutKaCandidate, nsigmaPr, nsigmaKa,nsigmaTOFPr, nsigmaTOFKa, enableMonitor,triggerMask)) return 0x0; #endif diff --git a/PWGLF/RESONANCES/macros/mini/ConfigureLstarpp_sp.C b/PWGLF/RESONANCES/macros/mini/ConfigureLstarpp_sp.C index 4a39a73a2c4..6972e618f00 100644 --- a/PWGLF/RESONANCES/macros/mini/ConfigureLstarpp_sp.C +++ b/PWGLF/RESONANCES/macros/mini/ConfigureLstarpp_sp.C @@ -30,6 +30,7 @@ Bool_t ConfigureLstarpp_sp const char *suffix, AliRsnCutSet *cutsPair, Int_t aodFilterBit = 5, + Int_t _spBin=500, Int_t customQualityCutsID=AliRsnCutSetDaughterParticle::kDisableCustom, AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutPrCandidate = AliRsnCutSetDaughterParticle::kTPCTOFpidLstar13ppTeV, AliRsnCutSetDaughterParticle::ERsnDaughterCutSet cutKaCandidate = AliRsnCutSetDaughterParticle::kTPCTOFpidLstar13ppTeV, @@ -143,6 +144,17 @@ Bool_t ConfigureLstarpp_sp Int_t cutID2 [12] = {iCutK ,iCutK ,iCutK ,iCutK ,iCutK ,iCutK ,iCutK ,iCutK ,iCutK ,iCutK ,iCutK ,iCutK }; Int_t PDGCode [12] = {3124 ,3124 ,3124 ,3124 ,3124 ,3124 ,3124 ,-3124 ,3124 ,-3124 ,3124 ,-3124 }; + Double_t multbins[200]; + int j,nmult=0; + if(triggerMask==AliVEvent::kHighMultV0){ + for(j=0;j<10;j++){multbins[nmult]=0.001*j; nmult++;} + for(j=1;j<10;j++){multbins[nmult]=0.01*j; nmult++;} + for(j=1;j<=10;j++){multbins[nmult]=0.1*j; nmult++;} + }else{ + for(j=0;j<10;j++){multbins[nmult]=0.1*j; nmult++;} + for(j=1;j<=10;j++){multbins[nmult]=j; nmult++;} + } + for (Int_t i = 0; i < 12; i++) { if (!use[i]) continue; AliRsnMiniOutput *out = task->CreateOutput(Form("Lstar_%s%s", name[i].Data(), suffix), output[i].Data(), comp[i].Data()); @@ -158,19 +170,19 @@ Bool_t ConfigureLstarpp_sp // axis X: invmass (or resolution) if (useIM[i]) - out->AddAxis(imID, 120, 1.4, 2.0); + out->AddAxis(imID, 240, 1.4, 2.0); else out->AddAxis(resID, 200, -0.02, 0.02); //axis Y: transverse momentum of pair as default - else chosen value - out->AddAxis(ptID,100,0.,10.);//default use mother pt + out->AddAxis(ptID,200,0.,10.);//default use mother pt // axis Z: centrality-multiplicity // axis Z: centrality-multiplicity if(isPP && !MultBins) out->AddAxis(centID, 400, 0., 400.); - else out->AddAxis(centID, 110, 0., 110.); + else out->AddAxis(centID,nmult,multbins); // axis W: pseudorapidity @@ -178,7 +190,7 @@ Bool_t ConfigureLstarpp_sp // axis J: rapidity //out->AddAxis(yID, 12, -0.6, 0.6); - out->AddAxis(SpherocityID, 100,0.,1.); + out->AddAxis(SpherocityID, _spBin,0.,1.); } return kTRUE; From 06b90af0b1a4801f6de69ff200ac3ed98e3a71e8 Mon Sep 17 00:00:00 2001 From: nburmaso Date: Tue, 18 Apr 2023 11:15:23 +0300 Subject: [PATCH 13/51] Fixing bugs: array initialization, passing TBits to functions --- OADB/AliTriggerAnalysis.cxx | 4 ++-- OADB/AliTriggerAnalysis.h | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/OADB/AliTriggerAnalysis.cxx b/OADB/AliTriggerAnalysis.cxx index 6b601fd2355..7a05e4825cf 100644 --- a/OADB/AliTriggerAnalysis.cxx +++ b/OADB/AliTriggerAnalysis.cxx @@ -1176,14 +1176,14 @@ void AliTriggerAnalysis::ApplyTOFefficiency(TBits& fired) { } //------------------------------------------------------------------------------------------------- -Bool_t AliTriggerAnalysis::IsOMUfired(const TBits& maxipads) { +Bool_t AliTriggerAnalysis::IsOMUfired(TBits maxipads) { UInt_t nFired = maxipads.CountBits(); if (nFired < 2) return false; if (nFired > 6) return false; Bool_t fLTMarray[36]; - for (bool ltm : fLTMarray) + for (bool& ltm : fLTMarray) ltm = false; for (Int_t ltm = 0; ltm < 72; ltm++) { for (Int_t ch = 0; ch < 23; ch++) { diff --git a/OADB/AliTriggerAnalysis.h b/OADB/AliTriggerAnalysis.h index 43bd6f69463..5f4959faea2 100644 --- a/OADB/AliTriggerAnalysis.h +++ b/OADB/AliTriggerAnalysis.h @@ -93,8 +93,8 @@ class AliTriggerAnalysis : public AliOADBTriggerAnalysis{ void FillHistograms(const AliVEvent* event, Bool_t onlineDecision, Bool_t offlineDecision); void FillTriggerClasses(const AliVEvent* event); - void SetSPDGFOEfficiency(TH1D* hist) { delete fSPDGFOEfficiency; fSPDGFOEfficiency = hist; } - void SetTOFMaxipadEfficiency(TH2F* hist) { delete fTOFMaxipadEfficiency; fTOFMaxipadEfficiency = hist; } + void SetSPDGFOEfficiency(TH1D* hist) { fSPDGFOEfficiency = hist; } + void SetTOFMaxipadEfficiency(TH2F* hist) { fTOFMaxipadEfficiency = hist; } void SetDoFMD(Bool_t flag = kTRUE) {fDoFMD = flag;} TObject* GetHistogram(const char* histName); @@ -105,14 +105,14 @@ class AliTriggerAnalysis : public AliOADBTriggerAnalysis{ void PrintTriggerClasses() const; void Browse(TBrowser *b); -protected: +//protected: Int_t FMDHitCombinations(const AliESDEvent* aEsd, AliceSide side, Int_t fillHists = 0); // TOF trigger helpers void GetTOFFiredMaxipads(const AliVEvent* event, TBits& maxipads); void ApplyTOFefficiency(TBits& fired); - Bool_t IsOM2fired(const TBits& maxipads) { return maxipads.CountBits() >= 2; } - Bool_t IsOMUfired(const TBits& maxipads); + Bool_t IsOM2fired(TBits maxipads) { return maxipads.CountBits() >= 2; } + Bool_t IsOMUfired(TBits maxipads); // SPD trigger helpers void GetSPDFiredChips(const AliVEvent* event, TBits& chips); From e01a4c5bb2a0781a18d22c05c557a2ad1f28b472 Mon Sep 17 00:00:00 2001 From: nburmaso Date: Tue, 18 Apr 2023 11:19:10 +0300 Subject: [PATCH 14/51] Remove debug comment --- OADB/AliTriggerAnalysis.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OADB/AliTriggerAnalysis.h b/OADB/AliTriggerAnalysis.h index 5f4959faea2..da947ad5de4 100644 --- a/OADB/AliTriggerAnalysis.h +++ b/OADB/AliTriggerAnalysis.h @@ -105,7 +105,7 @@ class AliTriggerAnalysis : public AliOADBTriggerAnalysis{ void PrintTriggerClasses() const; void Browse(TBrowser *b); -//protected: +protected: Int_t FMDHitCombinations(const AliESDEvent* aEsd, AliceSide side, Int_t fillHists = 0); // TOF trigger helpers From d104e1640b586c812092fcc835b541fff280a4dc Mon Sep 17 00:00:00 2001 From: Fabio Catalano Date: Tue, 18 Apr 2023 11:37:04 +0200 Subject: [PATCH 15/51] Improve logging --- .../AliAnalysisTaskHFSimpleVertices.cxx | 53 ++++++++++--------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/PWGHF/vertexingHF/AliAnalysisTaskHFSimpleVertices.cxx b/PWGHF/vertexingHF/AliAnalysisTaskHFSimpleVertices.cxx index 1809735cecb..153449bb45f 100644 --- a/PWGHF/vertexingHF/AliAnalysisTaskHFSimpleVertices.cxx +++ b/PWGHF/vertexingHF/AliAnalysisTaskHFSimpleVertices.cxx @@ -857,18 +857,6 @@ void AliAnalysisTaskHFSimpleVertices::InitFromJson(TString filename) fTriggerMask = triggerMask[triggerMaskFromJSON]; } - Double_t ptmintrack2 = GetJsonFloat(filename.Data(), "hf-track-index-skim-creator-tag-sel-tracks", "ptMinTrack2Prong"); - printf("Min pt track (2 prong)= %g\n", ptmintrack2); - if (ptmintrack2 > 0) - fTrackCuts2pr->SetPtRange(ptmintrack2, 1.e10); - Double_t ptmintrack3 = GetJsonFloat(filename.Data(), "hf-track-index-skim-creator-tag-sel-tracks", "ptMinTrack3Prong"); - printf("Min pt track (3 prong)= %g\n", ptmintrack3); - if (ptmintrack3 > 0) - fTrackCuts3pr->SetPtRange(ptmintrack3, 1.e10); - Double_t ptmintrackb = GetJsonFloat(filename.Data(), "hf-track-index-skim-creator-tag-sel-tracks", "ptMinTrackBach"); - printf("Min pt track (bachelor)= %g\n", ptmintrackb); - if (ptmintrackb > 0) - fTrackCutsBach->SetPtRange(ptmintrackb, 1.e10); Int_t do3Prongs = GetJsonInteger(filename.Data(), "hf-track-index-skim-creator", "do3Prong"); printf("do3Prong = %d\n", do3Prongs); if (do3Prongs > 0) @@ -897,6 +885,20 @@ void AliAnalysisTaskHFSimpleVertices::InitFromJson(TString filename) printf("selectionFlagLc = %d\n", selectLcpKpi); if (selectLcpKpi >= 0) fSelectLcpKpi = selectLcpKpi; + + printf("------- TRACK SELECTIONS -------\n"); + Double_t ptmintrack2 = GetJsonFloat(filename.Data(), "hf-track-index-skim-creator-tag-sel-tracks", "ptMinTrack2Prong"); + printf("Min pt track (2 prong)= %g\n", ptmintrack2); + if (ptmintrack2 > 0) + fTrackCuts2pr->SetPtRange(ptmintrack2, 1.e10); + Double_t ptmintrack3 = GetJsonFloat(filename.Data(), "hf-track-index-skim-creator-tag-sel-tracks", "ptMinTrack3Prong"); + printf("Min pt track (3 prong)= %g\n", ptmintrack3); + if (ptmintrack3 > 0) + fTrackCuts3pr->SetPtRange(ptmintrack3, 1.e10); + Double_t ptmintrackb = GetJsonFloat(filename.Data(), "hf-track-index-skim-creator-tag-sel-tracks", "ptMinTrackBach"); + printf("Min pt track (bachelor)= %g\n", ptmintrackb); + if (ptmintrackb > 0) + fTrackCutsBach->SetPtRange(ptmintrackb, 1.e10); Int_t minncluTPC = GetJsonInteger(filename.Data(), "hf-track-index-skim-creator-tag-sel-tracks", "tpcNClsFoundMin"); if (minncluTPC > 0) printf("minncluTPC = %d\n", minncluTPC); @@ -918,13 +920,14 @@ void AliAnalysisTaskHFSimpleVertices::InitFromJson(TString filename) for (Int_t ib = 0; ib < nptbinlimsSingleTrack - 1; ib++) { for (Int_t jc = 0; jc < nc2Prong; jc++) { fSingleTrackCuts2Prong[ib][jc] = cutsSingleTrack2Prong[ib][jc]; - AliInfo(Form("2prong %d, %d, %g", ib, jc, cutsSingleTrack2Prong[ib][jc])); } + AliInfo(Form("2prong track cuts: %g < pt < %g; %g < DCAxy to primary < %g", fPtBinLimsSingleTrack[ib], fPtBinLimsSingleTrack[ib + 1], fSingleTrackCuts2Prong[ib][0], fSingleTrackCuts2Prong[ib][1])); for (Int_t jc = 0; jc < nc3Prong; jc++) { fSingleTrackCuts3Prong[ib][jc] = cutsSingleTrack3Prong[ib][jc]; - AliInfo(Form("3prong %d %d, %d, %g", nc2Prong, ib, jc, cutsSingleTrack2Prong[ib][jc])); } + AliInfo(Form("3prong track cuts: %g < pt < %g; %g < DCAxy to primary < %g", fPtBinLimsSingleTrack[ib], fPtBinLimsSingleTrack[ib + 1], fSingleTrackCuts3Prong[ib][0], fSingleTrackCuts3Prong[ib][1])); } + Double_t etamax2 = GetJsonFloat(filename.Data(), "hf-track-index-skim-creator-tag-sel-tracks", "etaMaxTrack2Prong"); printf("Max eta (2 prong) = %g\n", etamax2); if (etamax2 > 0) @@ -1056,7 +1059,7 @@ void AliAnalysisTaskHFSimpleVertices::InitFromJson(TString filename) for (Int_t jc = 0; jc < ncDzeroSkims; jc++) { fDzeroSkimCuts[ib][jc] = cutsDzeroSkims[ib][jc]; } - AliInfo(Form("Dzero cuts: %g < pt < %g ; %g < mass < %g ; cospoint > %g ; d0xd0 < %g\n", fPtBinLimsDzeroSkims[ib], fPtBinLimsDzeroSkims[ib + 1], fDzeroSkimCuts[ib][0], fDzeroSkimCuts[ib][1], fDzeroSkimCuts[ib][2], fDzeroSkimCuts[ib][3])); + AliInfo(Form("Dzero cuts: %g < pt < %g; %g < mass < %g; cospoint > %g; d0xd0 < %g", fPtBinLimsDzeroSkims[ib], fPtBinLimsDzeroSkims[ib + 1], fDzeroSkimCuts[ib][0], fDzeroSkimCuts[ib][1], fDzeroSkimCuts[ib][2], fDzeroSkimCuts[ib][3])); } for (Int_t ib = 0; ib < nptbinlimsJpsiSkims; ib++) { @@ -1066,7 +1069,7 @@ void AliAnalysisTaskHFSimpleVertices::InitFromJson(TString filename) for (Int_t jc = 0; jc < ncJpsiSkims; jc++) { fJpsiSkimCuts[ib][jc] = cutsJpsiSkims[ib][jc]; } - AliInfo(Form("J/psi cuts: %g < pt < %g ; %g < mass < %g ; cospoint > %g ; d0xd0 < %g\n", fPtBinLimsJpsiSkims[ib], fPtBinLimsJpsiSkims[ib + 1], fJpsiSkimCuts[ib][0], fJpsiSkimCuts[ib][1], fJpsiSkimCuts[ib][2], fJpsiSkimCuts[ib][3])); + AliInfo(Form("J/psi cuts: %g < pt < %g; %g < mass < %g; cospoint > %g; d0xd0 < %g", fPtBinLimsJpsiSkims[ib], fPtBinLimsJpsiSkims[ib + 1], fJpsiSkimCuts[ib][0], fJpsiSkimCuts[ib][1], fJpsiSkimCuts[ib][2], fJpsiSkimCuts[ib][3])); } for (Int_t ib = 0; ib < nptbinlimsDplusSkims; ib++) { @@ -1076,7 +1079,7 @@ void AliAnalysisTaskHFSimpleVertices::InitFromJson(TString filename) for (Int_t jc = 0; jc < ncDplusSkims; jc++) { fDplusSkimCuts[ib][jc] = cutsDplusSkims[ib][jc]; } - AliInfo(Form("Dplus cuts: %g < pt < %g ; %g < mass < %g ; cospoint > %g ; declen > %g\n", fPtBinLimsDplusSkims[ib], fPtBinLimsDplusSkims[ib + 1], fDplusSkimCuts[ib][0], fDplusSkimCuts[ib][1], fDplusSkimCuts[ib][2], fDplusSkimCuts[ib][3])); + AliInfo(Form("Dplus cuts: %g < pt < %g; %g < mass < %g; cospoint > %g; declen > %g", fPtBinLimsDplusSkims[ib], fPtBinLimsDplusSkims[ib + 1], fDplusSkimCuts[ib][0], fDplusSkimCuts[ib][1], fDplusSkimCuts[ib][2], fDplusSkimCuts[ib][3])); } for (Int_t ib = 0; ib < nptbinlimsDsSkims; ib++) { @@ -1086,7 +1089,7 @@ void AliAnalysisTaskHFSimpleVertices::InitFromJson(TString filename) for (Int_t jc = 0; jc < ncDsSkims; jc++) { fDsSkimCuts[ib][jc] = cutsDsSkims[ib][jc]; } - AliInfo(Form("Ds cuts: %g < pt < %g ; %g < mass < %g ; cospoint > %g ; declen > %g\n", fPtBinLimsDsSkims[ib], fPtBinLimsDsSkims[ib + 1], fDsSkimCuts[ib][0], fDsSkimCuts[ib][1], fDsSkimCuts[ib][2], fDsSkimCuts[ib][3])); + AliInfo(Form("Ds cuts: %g < pt < %g; %g < mass < %g; cospoint > %g; declen > %g", fPtBinLimsDsSkims[ib], fPtBinLimsDsSkims[ib + 1], fDsSkimCuts[ib][0], fDsSkimCuts[ib][1], fDsSkimCuts[ib][2], fDsSkimCuts[ib][3])); } for (Int_t ib = 0; ib < nptbinlimsLcSkims; ib++) { @@ -1096,7 +1099,7 @@ void AliAnalysisTaskHFSimpleVertices::InitFromJson(TString filename) for (Int_t jc = 0; jc < ncLcSkims; jc++) { fLcSkimCuts[ib][jc] = cutsLcSkims[ib][jc]; } - AliInfo(Form("Lc cuts: %g < pt < %g ; %g < mass < %g ; cospoint > %g ; declen > %g\n", fPtBinLimsLcSkims[ib], fPtBinLimsLcSkims[ib + 1], fLcSkimCuts[ib][0], fLcSkimCuts[ib][1], fLcSkimCuts[ib][2], fLcSkimCuts[ib][3])); + AliInfo(Form("Lc cuts: %g < pt < %g; %g < mass < %g; cospoint > %g; declen > %g", fPtBinLimsLcSkims[ib], fPtBinLimsLcSkims[ib + 1], fLcSkimCuts[ib][0], fLcSkimCuts[ib][1], fLcSkimCuts[ib][2], fLcSkimCuts[ib][3])); } for (Int_t ib = 0; ib < nptbinlimsXicSkims; ib++) { @@ -1106,7 +1109,7 @@ void AliAnalysisTaskHFSimpleVertices::InitFromJson(TString filename) for (Int_t jc = 0; jc < ncXicSkims; jc++) { fXicSkimCuts[ib][jc] = cutsXicSkims[ib][jc]; } - AliInfo(Form("Xic cuts: %g < pt < %g ; %g < mass < %g ; cospoint > %g ; declen > %g\n", fPtBinLimsXicSkims[ib], fPtBinLimsXicSkims[ib + 1], fXicSkimCuts[ib][0], fXicSkimCuts[ib][1], fXicSkimCuts[ib][2], fXicSkimCuts[ib][3])); + AliInfo(Form("Xic cuts: %g < pt < %g; %g < mass < %g; cospoint > %g; declen > %g", fPtBinLimsXicSkims[ib], fPtBinLimsXicSkims[ib + 1], fXicSkimCuts[ib][0], fXicSkimCuts[ib][1], fXicSkimCuts[ib][2], fXicSkimCuts[ib][3])); } Double_t cutcpaV0 = GetJsonFloat(filename.Data(), "hf-track-index-skim-creator-cascades", "cpaV0Min"); @@ -1160,7 +1163,7 @@ void AliAnalysisTaskHFSimpleVertices::InitFromJson(TString filename) for (Int_t jc = 0; jc < ncDzero; jc++) { fDzeroCuts[ib][jc] = cutsDzero[ib][jc]; } - AliInfo(Form("Dzero cuts: %g < pt < %g ; %g < mass < %g ; cospoint > %g ; d0xd0 < %g\n", fPtBinLimsDzero[ib], fPtBinLimsDzero[ib + 1], fDzeroCuts[ib][0], fDzeroCuts[ib][1], fDzeroCuts[ib][2], fDzeroCuts[ib][3])); + AliInfo(Form("Dzero cuts: %g < pt < %g; %g < mass < %g; cospoint > %g; d0xd0 < %g", fPtBinLimsDzero[ib], fPtBinLimsDzero[ib + 1], fDzeroCuts[ib][0], fDzeroCuts[ib][1], fDzeroCuts[ib][2], fDzeroCuts[ib][3])); } for (Int_t ib = 0; ib < nptbinlimsJpsi; ib++) { @@ -1170,7 +1173,7 @@ void AliAnalysisTaskHFSimpleVertices::InitFromJson(TString filename) for (Int_t jc = 0; jc < ncJpsi; jc++) { fJpsiCuts[ib][jc] = cutsJpsi[ib][jc]; } - AliInfo(Form("J/psi cuts: %g < pt < %g ; %g < mass < %g ; cospoint > %g ; d0xd0 < %g\n", fPtBinLimsJpsi[ib], fPtBinLimsJpsi[ib + 1], fJpsiCuts[ib][0], fJpsiCuts[ib][1], fJpsiCuts[ib][2], fJpsiCuts[ib][3])); + AliInfo(Form("J/psi cuts: %g < pt < %g; %g < mass < %g; cospoint > %g; d0xd0 < %g", fPtBinLimsJpsi[ib], fPtBinLimsJpsi[ib + 1], fJpsiCuts[ib][0], fJpsiCuts[ib][1], fJpsiCuts[ib][2], fJpsiCuts[ib][3])); } for (Int_t ib = 0; ib < nptbinlimsDplus; ib++) { @@ -1180,7 +1183,7 @@ void AliAnalysisTaskHFSimpleVertices::InitFromJson(TString filename) for (Int_t jc = 0; jc < ncDplus; jc++) { fDplusCuts[ib][jc] = cutsDplus[ib][jc]; } - AliInfo(Form("Dplus cuts: %g < pt < %g ; %g < mass < %g ; cospoint > %g ; declen > %g\n", fPtBinLimsDplus[ib], fPtBinLimsDplus[ib + 1], fDplusCuts[ib][0], fDplusCuts[ib][1], fDplusCuts[ib][2], fDplusCuts[ib][3])); + AliInfo(Form("Dplus cuts: %g < pt < %g; deltamass < %g; pt Pi > %g; pt K > %g; declen > %g; normdeclenxy > %g; cospoint > %g; cospointxy > %g; maxnormdeltaIP < %g; ", fPtBinLimsDplus[ib], fPtBinLimsDplus[ib + 1], fDplusCuts[ib][0], fDplusCuts[ib][1], fDplusCuts[ib][2], fDplusCuts[ib][3], fDplusCuts[ib][4], fDplusCuts[ib][5], fDplusCuts[ib][6], fDplusCuts[ib][7])); } for (Int_t ib = 0; ib < nptbinlimsDs; ib++) { @@ -1190,7 +1193,7 @@ void AliAnalysisTaskHFSimpleVertices::InitFromJson(TString filename) for (Int_t jc = 0; jc < ncDs; jc++) { fDsCuts[ib][jc] = cutsDs[ib][jc]; } - AliInfo(Form("Ds cuts: %g < pt < %g ; deltamass < %g ; pt Pi > %g ; pt K > %g ; declen > %g ; normdeclenxy > %g ; cospoint > %g ; cospointxy > %g ; impparxy < %g ; deltamassKK < %g ; cos3PiKPhi > %g\n", fPtBinLimsDs[ib], fPtBinLimsDs[ib + 1], fDsCuts[ib][0], fDsCuts[ib][1], fDsCuts[ib][2], fDsCuts[ib][3], fDsCuts[ib][4], fDsCuts[ib][5], fDsCuts[ib][6], fDsCuts[ib][7], fDsCuts[ib][8], fDsCuts[ib][9])); + AliInfo(Form("Ds cuts: %g < pt < %g; deltamass < %g; pt Pi > %g; pt K > %g; declen > %g; normdeclenxy > %g; cospoint > %g; cospointxy > %g; impparxy < %g; deltamassKK < %g; cos3PiKPhi > %g", fPtBinLimsDs[ib], fPtBinLimsDs[ib + 1], fDsCuts[ib][0], fDsCuts[ib][1], fDsCuts[ib][2], fDsCuts[ib][3], fDsCuts[ib][4], fDsCuts[ib][5], fDsCuts[ib][6], fDsCuts[ib][7], fDsCuts[ib][8], fDsCuts[ib][9])); } for (Int_t ib = 0; ib < nptbinlimsLc; ib++) { @@ -1200,7 +1203,7 @@ void AliAnalysisTaskHFSimpleVertices::InitFromJson(TString filename) for (Int_t jc = 0; jc < ncLc; jc++) { fLcCuts[ib][jc] = cutsLc[ib][jc]; } - AliInfo(Form("Lc candidate selection cuts: %g < pt < %g ; delta mass < %g ; pt p > %g ; pt K > %g ; pt Pi > %g ; Chi2PCA < %g ; declen > %g ; cospoint > %g\n", fPtBinLimsLc[ib], fPtBinLimsLc[ib + 1], fLcCuts[ib][0], fLcCuts[ib][1], fLcCuts[ib][2], fLcCuts[ib][3], fLcCuts[ib][4], fLcCuts[ib][5], fLcCuts[ib][6])); + AliInfo(Form("Lc candidate selection cuts: %g < pt < %g; delta mass < %g; pt p > %g; pt K > %g; pt Pi > %g; Chi2PCA < %g; declen > %g; cospoint > %g", fPtBinLimsLc[ib], fPtBinLimsLc[ib + 1], fLcCuts[ib][0], fLcCuts[ib][1], fLcCuts[ib][2], fLcCuts[ib][3], fLcCuts[ib][4], fLcCuts[ib][5], fLcCuts[ib][6])); } printf("---------------------------------------------\n"); From 926717d298839d9fb4c276095afb1a6ac2201502 Mon Sep 17 00:00:00 2001 From: mwaelde Date: Tue, 18 Apr 2023 15:30:34 +0200 Subject: [PATCH 16/51] update streamer and add macro parameter --- PWGDQ/dielectron/LMEE/AliAnalysisTaskOmegaDielectron_AccEff.h | 4 ++-- .../macrosLMEE/AddTask_mwaelde_AcceptanceEfficiency.C | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGDQ/dielectron/LMEE/AliAnalysisTaskOmegaDielectron_AccEff.h b/PWGDQ/dielectron/LMEE/AliAnalysisTaskOmegaDielectron_AccEff.h index e9c7e2378b9..b929f5d21c1 100644 --- a/PWGDQ/dielectron/LMEE/AliAnalysisTaskOmegaDielectron_AccEff.h +++ b/PWGDQ/dielectron/LMEE/AliAnalysisTaskOmegaDielectron_AccEff.h @@ -78,8 +78,8 @@ class AliAnalysisTaskOmegaDielectron_AccEff : public AliAnalysisTaskSE { AliMCEvent* fMCEvent; //! fFilter_TrackCuts; //! fFilter_PID; //! fFilter_TrackCuts; + std::vector fFilter_PID; AliPIDResponse* fPIDResponse; //!SelectCollisionCandidates(AliVEvent::kINT7);// kAnyINT From a9645b31364fc53d28ae38e97f307848be769317 Mon Sep 17 00:00:00 2001 From: caitiebeattie Date: Tue, 18 Apr 2023 09:42:21 -0400 Subject: [PATCH 17/51] AliAnalysisTaskJetQnVectors - fix to QA plot --- PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskJetQnVectors.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskJetQnVectors.cxx b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskJetQnVectors.cxx index 171d1e626f6..321dc2700d7 100644 --- a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskJetQnVectors.cxx +++ b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskJetQnVectors.cxx @@ -339,7 +339,6 @@ void AliAnalysisTaskJetQnVectors::UserExec(Option_t */*option*/) fHistNEvents->Fill(3); return; } - fHistCentrality->Fill(cent); const AliAODVertex *vertex = fAOD->GetPrimaryVertex(); if(!vertex || TMath::Abs(vertex->GetZ())>10. || vertex->GetNContributors()<=0) { @@ -354,6 +353,8 @@ void AliAnalysisTaskJetQnVectors::UserExec(Option_t */*option*/) return;} } + fHistCentrality->Fill(cent); + //choose calibration file to use (run numbers specific to 2018 pass3) AliJEQnVectorHandler *fJEQnVecHandler; if (fAOD->GetRunNumber() <= 296623) fJEQnVecHandler = fJEQnVecHandler1; //child1 From 99693b890918f40ec527505b45010041dfeb3092 Mon Sep 17 00:00:00 2001 From: Hannah Bossi Date: Tue, 18 Apr 2023 20:38:45 +0200 Subject: [PATCH 18/51] [PWGJE/EMCALJetTasks/]: Added generalized kT clustering for pp and MC. --- .../AliAnalysisTaskNewJetSubstructure.cxx | 40 +++++++++++-------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskNewJetSubstructure.cxx b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskNewJetSubstructure.cxx index da69ac8cd90..8e22cc59c3c 100644 --- a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskNewJetSubstructure.cxx +++ b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskNewJetSubstructure.cxx @@ -943,16 +943,16 @@ void AliAnalysisTaskNewJetSubstructure::IterativeParentsPP( fInputVectors.push_back(PseudoTracks); } - fastjet::JetAlgorithm jetalgo(fastjet::cambridge_algorithm); - fastjet::JetDefinition fJetDef(jetalgo, 1., - static_cast(0), - fastjet::BestFJ30); + // fastjet::JetAlgorithm jetalgo(fastjet::cambridge_algorithm); + // fastjet::JetDefinition fJetDef(jetalgo, 1., + // static_cast(0), + // fastjet::BestFJ30); fastjet::GhostedAreaSpec ghost_spec(1, 1, 0.05); - // fastjet::JetAlgorithm jetalgo(fastjet::genkt_algorithm); - // fastjet::JetDefinition fJetDef(jetalgo, 1., fPowerAlgo, - // static_cast(0), - // fastjet::BestFJ30); + fastjet::JetAlgorithm jetalgo(fastjet::genkt_algorithm); + fastjet::JetDefinition fJetDef(jetalgo, 1., fPowerAlgo, + static_cast(0), + fastjet::BestFJ30); fastjet::AreaDefinition fAreaDef(fastjet::passive_area, ghost_spec); try { @@ -1068,11 +1068,15 @@ void AliAnalysisTaskNewJetSubstructure::IterativeParentsMCAverage( - fastjet::JetAlgorithm jetalgo(fastjet::cambridge_algorithm); + // fastjet::JetAlgorithm jetalgo(fastjet::cambridge_algorithm); + // fastjet::JetDefinition fJetDef(jetalgo, 1., + // static_cast(0), + // fastjet::BestFJ30); - fastjet::JetDefinition fJetDef(jetalgo, 1., - static_cast(0), - fastjet::BestFJ30); + fastjet::JetAlgorithm jetalgo(fastjet::genkt_algorithm); + fastjet::JetDefinition fJetDef(jetalgo, 1., fPowerAlgo, + static_cast(0), + fastjet::BestFJ30); try { @@ -1177,11 +1181,15 @@ void AliAnalysisTaskNewJetSubstructure::IterativeParentsMCAveragePP( } - fastjet::JetAlgorithm jetalgo(fastjet::cambridge_algorithm); + // fastjet::JetAlgorithm jetalgo(fastjet::cambridge_algorithm); - fastjet::JetDefinition fJetDef(jetalgo, 1., - static_cast(0), - fastjet::BestFJ30); + // fastjet::JetDefinition fJetDef(jetalgo, 1., + // static_cast(0), + // fastjet::BestFJ30); + fastjet::JetAlgorithm jetalgo(fastjet::genkt_algorithm); + fastjet::JetDefinition fJetDef(jetalgo, 1., fPowerAlgo, + static_cast(0), + fastjet::BestFJ30); try { From 4fff396904f34ed3e568bb9c0b0c52db70a70cd4 Mon Sep 17 00:00:00 2001 From: Raymond Ehlers Date: Tue, 18 Apr 2023 13:58:15 -0700 Subject: [PATCH 19/51] Fix typos in formatting of status --- .../EMCALJetTasks/UserTasks/AliAnalysisTaskTrackSkim.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskTrackSkim.cxx b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskTrackSkim.cxx index 097606b5da0..8954bb62781 100644 --- a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskTrackSkim.cxx +++ b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskTrackSkim.cxx @@ -581,10 +581,10 @@ std::string AliAnalysisTaskTrackSkim::toString() const else { tempSS << "disabled.\n"; } - tempSS << "\tCharge scaling: " << fChargeScaling; - tempSS << "\tEncode additional particle information: " << fEncodeAdditionalParticleInformation; - if (fEncodeAdditionalParticleInformation && fMCAnalysisUtils) { - tempSS << "\t\tMC analysis utils generator: " << fMCAnalysisUtils->GetMCGeneratorString() << "\n"; + tempSS << "\tCharge scaling: " << fChargeScaling << "\n"; + tempSS << "\tEncode additional particle information: " << fEncodeAdditionalParticleInformation << "\n"; + if (fEncodeAdditionalParticleInformation) { + tempSS << "\t\tMC analysis utils generator: " << fMCAnalysisUtilsGenerator << "\n"; } // Particle variables: tempSS << "Particle variables:\n"; From 05d1eb7ab86331bd45b4ca3630d19fd7b12eab0a Mon Sep 17 00:00:00 2001 From: Steffimro Date: Wed, 19 Apr 2023 09:16:08 +0200 Subject: [PATCH 20/51] PWGGA: Timing Cut Eff. Study --- PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C b/PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C index aeb5bf6ba8a..0271a0ce220 100644 --- a/PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C +++ b/PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C @@ -1101,6 +1101,8 @@ void AddTask_GammaCalo_pPb( cuts.AddCutCalo("80010113","24466540ha01cc00000","0163103100000010"); // non-lin 2 } else if (trainConfig == 519) { cuts.AddCutCalo("80010113","244665300a01cc00000","0163103100000010"); // no timing cut for timing cut studies + cuts.AddCutCalo("80010113","24466530ua01cc00000","0163103100000010"); // non-lin 1 + } else if (trainConfig == 520) { // JJ MC cuts.AddCutCalo("80010123","24466420ha012200000","0163103100000010"); // standard From af662b682dfa2c93d8cebd65f2b08c77fda5300b Mon Sep 17 00:00:00 2001 From: dsarkar <60989535+dsarkaralice@users.noreply.github.com> Date: Wed, 19 Apr 2023 11:12:42 +0200 Subject: [PATCH 21/51] Update AliAnalysisTaskCorrForFlowFMD.cxx --- PWGCF/FLOW/GF/AliAnalysisTaskCorrForFlowFMD.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGCF/FLOW/GF/AliAnalysisTaskCorrForFlowFMD.cxx b/PWGCF/FLOW/GF/AliAnalysisTaskCorrForFlowFMD.cxx index 34c2afe1fae..9be20f15125 100644 --- a/PWGCF/FLOW/GF/AliAnalysisTaskCorrForFlowFMD.cxx +++ b/PWGCF/FLOW/GF/AliAnalysisTaskCorrForFlowFMD.cxx @@ -523,6 +523,7 @@ void AliAnalysisTaskCorrForFlowFMD::UserExec(Option_t *) if(fDoPHI && fPhiSigcount < 1) continue;//for Phi correlation to fill, at least one Phi candidate needed (biasing event selection) } + fhEventCounter->Fill("Used in corr",1); FillCorrelations(i); FillCorrelationsMixed(i); From 2378a40404bb03d8b79ea32ec4d37028dbbf1b56 Mon Sep 17 00:00:00 2001 From: Steffimro Date: Wed, 19 Apr 2023 11:45:58 +0200 Subject: [PATCH 22/51] PWGGA: New Timing Cut Efficiency -50-50 ns --- PWGGA/GammaConvBase/AliCaloPhotonCuts.cxx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/PWGGA/GammaConvBase/AliCaloPhotonCuts.cxx b/PWGGA/GammaConvBase/AliCaloPhotonCuts.cxx index a37f2284cd8..c5a3955c9fb 100644 --- a/PWGGA/GammaConvBase/AliCaloPhotonCuts.cxx +++ b/PWGGA/GammaConvBase/AliCaloPhotonCuts.cxx @@ -5632,6 +5632,19 @@ Bool_t AliCaloPhotonCuts::SetTimingCut(Int_t timing) fFuncTimingEfficiencyMCSimClusterHighPt = new TF1("FuncTimingEfficiencyMCSimClusterHighPt", "[0]"); fFuncTimingEfficiencyMCSimClusterHighPt->SetParameter(0, 1.0); break; + + case 35: //z PHOS timing cut, pPb8TeV Trigger 30ns from Dmitri + if (!fUseTimeDiff) fUseTimeDiff=1; + fMinTimeDiff=-50e-9; + fMaxTimeDiff=50e-9;//30ns + fUseTimingEfficiencyMCSimCluster = 1; + fTimingEfficiencyMCSimClusterLowPtEnd = 5.5; + fTimingEfficiencyMCSimClusterHighPtStart = 100e+00; + fFuncTimingEfficiencyMCSimCluster = new TF1("FuncTimingEfficiencyMCSimCluster", "exp(([0]+[1]*x-[2]*x*x+x*x*x)/(1.-[3]*x+[4]*x*x+x*x*x))"); + fFuncTimingEfficiencyMCSimCluster->SetParameters(-243758, 366174, 134973, -1.0137e+06, 9.13693e+06); + fFuncTimingEfficiencyMCSimClusterHighPt = new TF1("FuncTimingEfficiencyMCSimClusterHighPt", "(x<[3])*(((1.-[2])*exp(-([1]*(x-[0]))))+[2])+(x>[3])*((((1.-[2])*exp(-([1]*([3]-[0]))))+[2])+((x-[3])*[4]))"); + fFuncTimingEfficiencyMCSimClusterHighPt->SetParameters(5.50000e+00, 2.62837e-01, 9.84211e-01, 9.25566e+00, 0.00000e+00); + break; default: AliError(Form("Timing Cut not defined %d",timing)); return kFALSE; From 60e2ea137b1d44a0bd07e1b21981e21a8d78277a Mon Sep 17 00:00:00 2001 From: Steffimro Date: Wed, 19 Apr 2023 11:49:34 +0200 Subject: [PATCH 23/51] PWGGA: New Timing Cut Efficiency --- PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C b/PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C index 0271a0ce220..1deb71c936e 100644 --- a/PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C +++ b/PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C @@ -1102,6 +1102,7 @@ void AddTask_GammaCalo_pPb( } else if (trainConfig == 519) { cuts.AddCutCalo("80010113","244665300a01cc00000","0163103100000010"); // no timing cut for timing cut studies cuts.AddCutCalo("80010113","24466530ua01cc00000","0163103100000010"); // non-lin 1 + cuts.AddCutCalo("80010113","24466530za01cc00000","0163103100000010"); // non-lin 1 and timing cut -50-50 ns new } else if (trainConfig == 520) { // JJ MC From 79073af60e12aa76e62cfa668108773a655347c1 Mon Sep 17 00:00:00 2001 From: Nima Zardoshti Date: Wed, 19 Apr 2023 11:38:45 +0200 Subject: [PATCH 24/51] adding a new analysis task for HF EE correlators --- .../AliAnalysisTaskHFEECorrelators.cxx | 1226 +++++++++++++++++ .../AliAnalysisTaskHFEECorrelators.h | 256 ++++ .../AliAnalysisTaskHFSubstructure.h | 3 +- PWGJE/FlavourJetTasks/CMakeLists.txt | 1 + .../PWGJEFlavourJetTasksLinkDef.h | 1 + .../macros/AddTaskHFEECorrelators.C | 163 +++ 6 files changed, 1648 insertions(+), 2 deletions(-) create mode 100644 PWGJE/FlavourJetTasks/AliAnalysisTaskHFEECorrelators.cxx create mode 100644 PWGJE/FlavourJetTasks/AliAnalysisTaskHFEECorrelators.h create mode 100644 PWGJE/FlavourJetTasks/macros/AddTaskHFEECorrelators.C diff --git a/PWGJE/FlavourJetTasks/AliAnalysisTaskHFEECorrelators.cxx b/PWGJE/FlavourJetTasks/AliAnalysisTaskHFEECorrelators.cxx new file mode 100644 index 00000000000..e8831dfb2c8 --- /dev/null +++ b/PWGJE/FlavourJetTasks/AliAnalysisTaskHFEECorrelators.cxx @@ -0,0 +1,1226 @@ +/************************************************************************* + * Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +// C++ +#include +#include + +// Root +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Aliroot general +#include "AliAnalysisDataContainer.h" +#include "AliAnalysisDataSlot.h" +#include "AliAnalysisManager.h" +#include "AliEMCALGeometry.h" +#include "AliLog.h" +#include "AliVEventHandler.h" + +// Aliroot HF +#include "AliAODRecoCascadeHF.h" +#include "AliAODRecoDecayHF2Prong.h" +#include "AliAnalysisVertexingHF.h" +#include "AliHFAODMCParticleContainer.h" +#include "AliHFTrackContainer.h" +#include "AliRDHFCutsD0toKpi.h" +#include "AliRDHFCutsDStartoKpipi.h" + +// Aliroot EMCal jet framework +#include "AliEmcalJet.h" +#include "AliEmcalJetTask.h" +#include "AliEmcalParticle.h" +#include "AliFJWrapper.h" +#include "AliJetContainer.h" +#include "AliParticleContainer.h" +#include "AliRhoParameter.h" + +#include "AliAnalysisTaskHFEECorrelators.h" + +#include "FJ_includes.h" + +using std::cout; +using std::endl; + +ClassImp(AliAnalysisTaskHFEECorrelators) + + //________________________________________________________________________ + AliAnalysisTaskHFEECorrelators::AliAnalysisTaskHFEECorrelators() + : AliAnalysisTaskEmcal("AliAnalysisTaskHFEECorrelators", kTRUE), + fJetShapeType(kData), + fECandidateType(kD0toKpi), + fIncludeInclusive(kFALSE), + fIsBDecay(kFALSE), + fRejectISR(kFALSE), + fPromptReject(kFALSE), + fAlienConnect(kFALSE), + fBranchName(0), + fCutsType(0), + fCandidatePDG(421), + fRejectedOrigin(0), + fAcceptedDecay(kDecayD0toKpi), + fCandidateMinPt(2.0), + fCandidateMaxY(0.8), + fJetRadius(0.4), + fJetMinPt(0.0), + fTrackingEfficiency(1.0), + fCandidateArray(0), + fAodEvent(0), + fRDHFCuts(0), + fFastJetWrapper(0), + fFastJetWrapper_Truth(0), + fShapesVar_Constituents_E(0), + fShapesVar_Constituents_E_Truth(0), + fShapesVar_Constituents_pT(0), + fShapesVar_Constituents_pT_Truth(0), + fShapesVar_Constituents_Phi(0), + fShapesVar_Constituents_Phi_Truth(0), + fShapesVar_Constituents_Rap(0), + fShapesVar_Constituents_Rap_Truth(0), + + fTreeJet(0), + fTreeConstituents(0), + fhEvent(0x0) + +{ + for (Int_t i = 0; i < nVar; i++) { + fShapesVar[i] = 0; + } + SetMakeGeneralHistograms(kTRUE); + DefineOutput(1, TList::Class()); + DefineOutput(2, TTree::Class()); + DefineOutput(3, TTree::Class()); +} + +//________________________________________________________________________ +AliAnalysisTaskHFEECorrelators::AliAnalysisTaskHFEECorrelators(const char* name) + : AliAnalysisTaskEmcal(name, kTRUE), + fJetShapeType(kData), + fECandidateType(kD0toKpi), + fIncludeInclusive(kFALSE), + fIsBDecay(kFALSE), + fRejectISR(kFALSE), + fPromptReject(kFALSE), + fAlienConnect(kFALSE), + fBranchName(0), + fCutsType(0), + fCandidatePDG(421), + fRejectedOrigin(0), + fAcceptedDecay(kDecayD0toKpi), + fCandidateMinPt(2.0), + fCandidateMaxY(0.8), + fJetRadius(0.4), + fJetMinPt(0.0), + fTrackingEfficiency(1.0), + fCandidateArray(0), + fAodEvent(0), + fRDHFCuts(0), + fFastJetWrapper(0), + fFastJetWrapper_Truth(0), + fShapesVar_Constituents_E(0), + fShapesVar_Constituents_E_Truth(0), + fShapesVar_Constituents_pT(0), + fShapesVar_Constituents_pT_Truth(0), + fShapesVar_Constituents_Phi(0), + fShapesVar_Constituents_Phi_Truth(0), + fShapesVar_Constituents_Rap(0), + fShapesVar_Constituents_Rap_Truth(0), + + fTreeJet(0), + fTreeConstituents(0), + fhEvent(0x0) { + // Standard constructor. + for (Int_t i = 0; i < nVar; i++) { + fShapesVar[i] = 0; + } + SetMakeGeneralHistograms(kTRUE); + DefineOutput(1, TList::Class()); + DefineOutput(2, TTree::Class()); + DefineOutput(3, TTree::Class()); +} + +//________________________________________________________________________ +AliAnalysisTaskHFEECorrelators::~AliAnalysisTaskHFEECorrelators() { + // Destructor. +} + +//________________________________________________________________________ +void AliAnalysisTaskHFEECorrelators::UserCreateOutputObjects() { + // Create user output. + + AliAnalysisTaskEmcal::UserCreateOutputObjects(); + + Bool_t oldStatus = TH1::AddDirectoryStatus(); + TH1::AddDirectory(kFALSE); + TH1::AddDirectory(oldStatus); + // create a tree used for the MC data and making a 4D response matrix + + const char* nameoutput = GetOutputSlot(2)->GetContainer()->GetName(); + fTreeJet = new TTree(nameoutput, nameoutput); + TString* fShapesVarNames = new TString[nVar]; + fShapesVarNames[0] = "pT_Jet"; + fShapesVarNames[1] = "pT_Jet_Truth"; + fShapesVarNames[2] = "pT_D"; + fShapesVarNames[3] = "pT_D_Truth"; + fShapesVarNames[4] = "Inv_M_D"; + fShapesVarNames[5] = "Inv_M_D_Truth"; + fShapesVarNames[6] = "Flag_D"; + fShapesVarNames[7] = "Flag_D_Truth"; + fShapesVarNames[8] = "Prompt_PDG"; + fShapesVarNames[9] = "Prompt_PDG_Truth"; + fShapesVarNames[10] = "Mass_Jet"; + fShapesVarNames[11] = "Mass_Jet_Truth"; + //fShapesVarNames[12] = "Eta_Jet"; + //fShapesVarNames[13] = "Eta_Jet_Truth"; + //fShapesVarNames[14] = "Eta_D"; + //fShapesVarNames[15] = "Eta_D_Truth"; + //fShapesVarNames[16] = "Y_D"; + //fShapesVarNames[17] = "Y_D_Truth"; + + for (Int_t ivar = 0; ivar < nVar; ivar++) { + cout << "looping over variables" << endl; + fTreeJet->Branch(fShapesVarNames[ivar].Data(), &fShapesVar[ivar], Form("%s/D", fShapesVarNames[ivar].Data())); + } + + const char* nameoutput_Constituents = GetOutputSlot(3)->GetContainer()->GetName(); + fTreeConstituents = new TTree(nameoutput_Constituents, nameoutput_Constituents); + TString* fShapesVarNames_Constituents = new TString[nVar_Constituents]; + fShapesVarNames_Constituents[0] = "E"; + fShapesVarNames_Constituents[1] = "E_Truth"; + fShapesVarNames_Constituents[2] = "pT"; + fShapesVarNames_Constituents[3] = "pT_Truth"; + fShapesVarNames_Constituents[4] = "Phi"; + fShapesVarNames_Constituents[5] = "Phi_Truth"; + fShapesVarNames_Constituents[6] = "Rap"; + fShapesVarNames_Constituents[7] = "Rap_Truth"; + fTreeConstituents->Branch(fShapesVarNames_Constituents[0].Data(), &fShapesVar_Constituents_E, 0, 1); + fTreeConstituents->Branch(fShapesVarNames_Constituents[1].Data(), &fShapesVar_Constituents_E_Truth, 0, 1); + fTreeConstituents->Branch(fShapesVarNames_Constituents[2].Data(), &fShapesVar_Constituents_pT, 0, 1); + fTreeConstituents->Branch(fShapesVarNames_Constituents[3].Data(), &fShapesVar_Constituents_pT_Truth, 0, 1); + fTreeConstituents->Branch(fShapesVarNames_Constituents[4].Data(), &fShapesVar_Constituents_Phi, 0, 1); + fTreeConstituents->Branch(fShapesVarNames_Constituents[5].Data(), &fShapesVar_Constituents_Phi_Truth, 0, 1); + fTreeConstituents->Branch(fShapesVarNames_Constituents[6].Data(), &fShapesVar_Constituents_Rap, 0, 1); + fTreeConstituents->Branch(fShapesVarNames_Constituents[7].Data(), &fShapesVar_Constituents_Rap_Truth, 0, 1); + + fhEvent = new TH1D("fhEvent", "fhEvent", 40, -0.5, 39.5); + fOutput->Add(fhEvent); + + PostData(1, fOutput); + PostData(2, fTreeJet); + PostData(3, fTreeConstituents); + // delete [] fShapesVarNames; +} + +//________________________________________________________________________ +Bool_t AliAnalysisTaskHFEECorrelators::Run() { + // Run analysis code here, if needed. It will be executed before FillHistograms(). + + return kTRUE; +} +//________________________________________________________________________ +Bool_t AliAnalysisTaskHFEECorrelators::FillHistograms() { + Int_t Matching_AOD_deltaAODlevel = AliRDHFCuts::CheckMatchingAODdeltaAODevents(); + if (Matching_AOD_deltaAODlevel <= 0) return kTRUE; + + fhEvent->Fill(0); + // if(fCutsFileName.Contains("alien://") && fAlienConnect) TGrid::Connect("alien://"); + // TFile* Cuts_File = TFile::Open(fCutsFileName); + // TString cutsname="D0toKpiCuts"; + // if (fCutsType!="") cutsname += TString::Format("_%s", fCutsType.Data()); + // fRDHFCuts = dynamic_cast(fCutsFile->Get(cutsname)); + + fAodEvent = dynamic_cast(fInputEvent); + + if (!fRDHFCuts->IsEventSelected(fAodEvent)) return kTRUE; + fhEvent->Fill(1); + fFastJetWrapper = new AliFJWrapper("fastjetwrapper", "fastjetwrapper"); + fFastJetWrapper->SetAreaType(fastjet::active_area); + fFastJetWrapper->SetGhostArea(0.005); + fFastJetWrapper->SetR(fJetRadius); + fFastJetWrapper->SetAlgorithm(fastjet::antikt_algorithm); + fFastJetWrapper->SetRecombScheme(static_cast(0)); + + fFastJetWrapper_Truth = new AliFJWrapper("fastjetwrapper_truth", "fastjetwrapper_truth"); + + if (fJetShapeType == kData || fJetShapeType == kDetSignal || fJetShapeType == kDetBackground || fJetShapeType == kDetReflection || fJetShapeType == kDet) { + TRandom3 Random; + Random.SetSeed(0); + Double_t Random_Number; + + fCandidateArray = dynamic_cast(fAodEvent->GetList()->FindObject("D0toKpi")); + + AliHFAODMCParticleContainer* Particle_Container = NULL; + if (fJetShapeType != kData) Particle_Container = (AliHFAODMCParticleContainer*)GetParticleContainer(1); + // if (!Particle_Container) continue; + + std::vector D_Candidates_Vector; + D_Candidates_Vector.clear(); + + Int_t N_DMesons = 0; + // AliHFTrackContainer* Track_Container=(AliHFTrackContainer *) GetTrackContainer(0); + AliHFTrackContainer* Track_Container = dynamic_cast(GetTrackContainer(0)); + if (!Track_Container) return kTRUE; + Track_Container->SetDMesonCandidate(NULL); + for (Int_t i_D = 0; i_D < fCandidateArray->GetEntriesFast(); i_D++) { + AliAODRecoDecayHF2Prong* D_Candidate = static_cast(fCandidateArray->At(i_D)); + if (!D_Candidate) continue; + if (!fRDHFCuts->IsInFiducialAcceptance(D_Candidate->Pt(), D_Candidate->Y(fCandidatePDG))) continue; + + Int_t Mass_Hypo_Type = fRDHFCuts->IsSelected(D_Candidate, AliRDHFCuts::kAll, fAodEvent); + Int_t N_Mass_Hypotheses = 1; + if (Mass_Hypo_Type <= 0 || Mass_Hypo_Type > 3) + continue; + else if (Mass_Hypo_Type == 3) + N_Mass_Hypotheses = 2; + fhEvent->Fill(2); + Int_t Matched_Truth_Particle_PDG = 0; + Int_t Is_Prompt_Correct_Quark_PDG = -1; + if (fJetShapeType != kData) { + const Int_t D_Candidtae_N_Daughters = 2; + Int_t D_Candidtae_Daughters_PDG[D_Candidtae_N_Daughters] = {211, 321}; + Int_t D_Candidate_MatchedTruth_Label = D_Candidate->MatchToMC(fCandidatePDG, Particle_Container->GetArray(), D_Candidtae_N_Daughters, D_Candidtae_Daughters_PDG); + Bool_t Is_Prompt_Correct_Quark = kFALSE; + if (D_Candidate_MatchedTruth_Label >= 0) { + AliAODMCParticle* Matched_Truth_Particle = static_cast(Particle_Container->GetArray()->At(D_Candidate_MatchedTruth_Label)); + if (Matched_Truth_Particle) { + fhEvent->Fill(3); + + Int_t Matched_Truth_Particle_Mother_Label = Matched_Truth_Particle->GetMother(); + while (Matched_Truth_Particle_Mother_Label >= 0) { + AliAODMCParticle* Matched_Truth_Particle_Mother = static_cast(Particle_Container->GetArray()->At(Matched_Truth_Particle_Mother_Label)); + if (Matched_Truth_Particle_Mother) { + Int_t Original_Quark_PDG = 4; + if (fIsBDecay) Original_Quark_PDG = 5; + if (TMath::Abs(Matched_Truth_Particle_Mother->GetPdgCode()) == Original_Quark_PDG) Is_Prompt_Correct_Quark = kTRUE; + if (TMath::Abs(Matched_Truth_Particle_Mother->GetPdgCode()) == 4) { + Is_Prompt_Correct_Quark_PDG = 4; + fhEvent->Fill(4); + break; + } + if (TMath::Abs(Matched_Truth_Particle_Mother->GetPdgCode()) == 5) { + Is_Prompt_Correct_Quark_PDG = 5; + fhEvent->Fill(5); + break; + } + if (Matched_Truth_Particle_Mother_Label == Matched_Truth_Particle_Mother->GetMother()) break; + Matched_Truth_Particle_Mother_Label = Matched_Truth_Particle_Mother->GetMother(); + } + else + break; + // delete Matched_Truth_Particle_Mother; + } + Matched_Truth_Particle_PDG = Matched_Truth_Particle->PdgCode(); + } + // delete Matched_Truth_Particle; + } + // else continue; + if (fPromptReject && !Is_Prompt_Correct_Quark) continue; + + // if (TMath::Abs(Matched_Truth_Particle_PDG)!=fCandidatePDG) continue; + } + + Double_t Inv_Mass_D = 0.0; + + if (D_Candidate->Pt() < fCandidateMinPt) continue; + if (D_Candidate->Pt() > 5.0) { + if (TMath::Abs(D_Candidate->Y(fCandidatePDG)) > 0.8) continue; + } + else { + if (D_Candidate->Y(fCandidatePDG) < 0.2 / 15 * D_Candidate->Pt() * D_Candidate->Pt() - 1.9 / 15 * D_Candidate->Pt() - 0.5 || D_Candidate->Y(fCandidatePDG) > -0.2 / 15 * D_Candidate->Pt() * D_Candidate->Pt() + 1.9 / 15 * D_Candidate->Pt() + 0.5) continue; + } + + if (Mass_Hypo_Type == 1) { + if (fJetShapeType == kData || fJetShapeType == kDet || (fJetShapeType == kDetSignal && Matched_Truth_Particle_PDG == fCandidatePDG) || (fJetShapeType == kDetBackground && Matched_Truth_Particle_PDG != fCandidatePDG) || (fJetShapeType == kDetReflection && Matched_Truth_Particle_PDG == -fCandidatePDG)) { + Inv_Mass_D = D_Candidate->InvMassD0(); + fhEvent->Fill(6); + } + else { + fhEvent->Fill(7); + continue; + } + } + + if (Mass_Hypo_Type == 2) { + if (fJetShapeType == kData || fJetShapeType == kDet || (fJetShapeType == kDetSignal && Matched_Truth_Particle_PDG == -fCandidatePDG) || (fJetShapeType == kDetBackground && Matched_Truth_Particle_PDG != -fCandidatePDG) || (fJetShapeType == kDetReflection && Matched_Truth_Particle_PDG == fCandidatePDG)) { + Inv_Mass_D = D_Candidate->InvMassD0bar(); + fhEvent->Fill(8); + } + else { + fhEvent->Fill(9); + continue; + } + } + + for (Int_t i_Mass_Hypotheses = 0; i_Mass_Hypotheses < N_Mass_Hypotheses; i_Mass_Hypotheses++) { + if (Mass_Hypo_Type == 3) { + if (i_Mass_Hypotheses == 0) { + if (fJetShapeType == kData || fJetShapeType == kDet || (fJetShapeType == kDetSignal && Matched_Truth_Particle_PDG == fCandidatePDG) || (fJetShapeType == kDetBackground && Matched_Truth_Particle_PDG != fCandidatePDG) || (fJetShapeType == kDetReflection && Matched_Truth_Particle_PDG == -fCandidatePDG)) { + Inv_Mass_D = D_Candidate->InvMassD0(); + fhEvent->Fill(11); + } + else { + fhEvent->Fill(12); + continue; + } + } + if (i_Mass_Hypotheses == 1) { + if (fJetShapeType == kData || fJetShapeType == kDet || (fJetShapeType == kDetSignal && Matched_Truth_Particle_PDG == -fCandidatePDG) || (fJetShapeType == kDetBackground && Matched_Truth_Particle_PDG != -fCandidatePDG) || (fJetShapeType == kDetReflection && Matched_Truth_Particle_PDG == fCandidatePDG)) { + Inv_Mass_D = D_Candidate->InvMassD0bar(); + fhEvent->Fill(13); + } + else { + fhEvent->Fill(14); + continue; + } + } + } + // Random_Number=Random.Rndm(); + // if(Random_Number > fTrackingEfficiency*fTrackingEfficiency) continue; // here it shows that the D did not get reconstructed cause one of the daughters was missing...however should we do this before incase the same daughter is involved multiple times? + fFastJetWrapper->Clear(); + AliTLorentzVector D_Candidate_LorentzVector(0, 0, 0, 0); + D_Candidate_LorentzVector.SetPtEtaPhiM(D_Candidate->Pt(), D_Candidate->Eta(), D_Candidate->Phi(), Inv_Mass_D); + fFastJetWrapper->AddInputVector(D_Candidate_LorentzVector.Px(), D_Candidate_LorentzVector.Py(), D_Candidate_LorentzVector.Pz(), D_Candidate_LorentzVector.E(), 0); + Track_Container->SetDMesonCandidate(D_Candidate); + AliAODTrack* Track = NULL; + for (Int_t i_Track = 0; i_Track < Track_Container->GetNTracks(); i_Track++) { + Track = static_cast(Track_Container->GetAcceptParticle(i_Track)); + if (!Track) continue; + if (Track->Pt() > 100.0 || TMath::Abs(Track->Eta()) > 0.9) continue; + Random_Number = Random.Rndm(); + if (Random_Number > fTrackingEfficiency) continue; + fFastJetWrapper->AddInputVector(Track->Px(), Track->Py(), Track->Pz(), Track->E(), i_Track + 100); + } + // delete Track; + + fFastJetWrapper->Run(); + std::vector Inclusive_Jets = fFastJetWrapper->GetInclusiveJets(); + for (UInt_t i_Jet = 0; i_Jet < Inclusive_Jets.size(); i_Jet++) { + Bool_t Is_D_Jet = kFALSE; + if (Inclusive_Jets[i_Jet].perp() < fJetMinPt) continue; + if (TMath::Abs(Inclusive_Jets[i_Jet].pseudorapidity()) > 0.9 - fJetRadius) continue; + std::vector Constituents(fFastJetWrapper->GetJetConstituents(i_Jet)); + for (UInt_t i_Constituents = 0; i_Constituents < Constituents.size(); i_Constituents++) { + if (Constituents[i_Constituents].user_index() == 0) Is_D_Jet = kTRUE; + break; + } + if (!Is_D_Jet) continue; + fhEvent->Fill(10); + fShapesVar_Constituents_E.clear(); + fShapesVar_Constituents_pT.clear(); + fShapesVar_Constituents_Phi.clear(); + fShapesVar_Constituents_Rap.clear(); + + std::vector jetConstituents(fFastJetWrapper->GetJetConstituents(i_Jet)); + for (Int_t i = 0; i < jetConstituents.size(); i++) { + fShapesVar_Constituents_E.push_back(jetConstituents[i].E()); + fShapesVar_Constituents_pT.push_back(jetConstituents[i].perp()); + fShapesVar_Constituents_Phi.push_back(jetConstituents[i].phi()); + fShapesVar_Constituents_Rap.push_back(jetConstituents[i].rap()); + } + + + + // for (Int_t i_Mass_Hypotheses=0; i_Mass_HypothesesFill(15); + N_DMesons++; + + Double_t Flag_D = -1.0; + if (Mass_Hypo_Type == 1) + Flag_D = 1.0; + else if (Mass_Hypo_Type == 2) + Flag_D = 2.0; + else if (Mass_Hypo_Type == 3 && i_Mass_Hypotheses == 0) + Flag_D = 3.0; + else if (Mass_Hypo_Type == 3 && i_Mass_Hypotheses == 1) + Flag_D = 4.0; + + fShapesVar[0] = Inclusive_Jets[i_Jet].perp(); + fShapesVar[1] = 0.0; + fShapesVar[2] = D_Candidate->Pt(); + fShapesVar[3] = 0.0; + fShapesVar[4] = Inv_Mass_D; + fShapesVar[5] = 0.0; + fShapesVar[6] = Flag_D; + if (fJetShapeType == kData) + fShapesVar[7] = 0.0; + else + fShapesVar[7] = Matched_Truth_Particle_PDG; + fShapesVar[8] = Is_Prompt_Correct_Quark_PDG; + fShapesVar[9] = 0.0; + fShapesVar[10] = Inclusive_Jets[i_Jet].m(); + fShapesVar[11] = 0.0; + // fShapesVar[12] = TMath::Abs(Inclusive_Jets[i_Jet].pseudorapidity()); + // fShapesVar[13] = 0.0; + // fShapesVar[14] = Dmeson_Eta; + // fShapesVar[15] = 0.0; + // fShapesVar[16] = Dmeson_Y; + // fShapesVar[17] = 0.0; + + + fTreeJet->Fill(); + fTreeConstituents->Fill(); + } + } + // delete D_Candidate; + } + if (N_DMesons == 0) fhEvent->Fill(16); + if (N_DMesons == 1) fhEvent->Fill(17); + if (N_DMesons == 2) fhEvent->Fill(18); + if (N_DMesons == 3) fhEvent->Fill(19); + if (N_DMesons == 4) fhEvent->Fill(20); + if (N_DMesons == 5) fhEvent->Fill(21); + if (N_DMesons == 6) fhEvent->Fill(22); + + // delete Track_Container; + // if (fJetShapeType != kData) delete Particle_Container; + } + + if (fJetShapeType == kTrueDet) { + TRandom3 Random; + Random.SetSeed(0); + Double_t Random_Number; + + AliHFAODMCParticleContainer* Particle_Container = (AliHFAODMCParticleContainer*)GetParticleContainer(1); + Particle_Container->SetSpecialPDG(fCandidatePDG); + Particle_Container->SetRejectedOriginMap(fRejectedOrigin); + Particle_Container->SetAcceptedDecayMap(fAcceptedDecay); + Particle_Container->SetRejectISR(fRejectISR); //is this correct to do? + Particle_Container->SetCharge(AliParticleContainer::EChargeCut_t::kCharged); + + std::vector Inclusive_Jets_Truth; + std::vector> Inclusive_Jets_Truth_Labels; + std::vector Unmatched_Truth_Level_D; + Int_t NMatched_DMeson_Jets = 0; + + // Double_t NTracks=0; + // Double_t NTracks_Truth=0; + // Double_t Jet_Eta=0; + // Double_t Jet_Eta_Truth=0; + // Double_t Dmeson_Eta=0; + // Double_t Dmeson_Eta_Truth=0; + // Double_t Dmeson_Y=0; + // Double_t Dmeson_Y_Truth=0; + + if (Particle_Container->IsSpecialPDGFound()) { + fhEvent->Fill(2); + + fFastJetWrapper_Truth->SetAreaType(fastjet::active_area); + fFastJetWrapper_Truth->SetGhostArea(0.005); + fFastJetWrapper_Truth->SetR(fJetRadius); + fFastJetWrapper_Truth->SetAlgorithm(fastjet::antikt_algorithm); + fFastJetWrapper_Truth->SetRecombScheme(static_cast(0)); + fFastJetWrapper_Truth->Clear(); + + AliAODMCParticle* Truth_Particle = NULL; + Int_t NTruthD = 0; + for (Int_t i_Particle = 0; i_Particle < Particle_Container->GetNParticles(); i_Particle++) { + Truth_Particle = static_cast(Particle_Container->GetAcceptMCParticle(i_Particle)); + if (!Truth_Particle) continue; + // if (TMath::Abs(Truth_Particle->Eta())>0.9) continue; + if (TMath::Abs(Truth_Particle->PdgCode()) == fCandidatePDG) { + if (Truth_Particle->Pt() < fCandidateMinPt) continue; + if (Truth_Particle->Pt() > 5.0) { + if (TMath::Abs(Truth_Particle->Y()) > 0.8) continue; + } + else { + if (Truth_Particle->Y() < 0.2 / 15 * Truth_Particle->Pt() * Truth_Particle->Pt() - 1.9 / 15 * Truth_Particle->Pt() - 0.5 || Truth_Particle->Y() > -0.2 / 15 * Truth_Particle->Pt() * Truth_Particle->Pt() + 1.9 / 15 * Truth_Particle->Pt() + 0.5) continue; + } + std::pair Inclusive_Jet_Truth_Labels; + Inclusive_Jet_Truth_Labels.first = Truth_Particle->GetLabel(); + Inclusive_Jet_Truth_Labels.second = NTruthD; + Inclusive_Jets_Truth_Labels.push_back(Inclusive_Jet_Truth_Labels); + Unmatched_Truth_Level_D.push_back(NTruthD); + fFastJetWrapper_Truth->AddInputVector(Truth_Particle->Px(), Truth_Particle->Py(), Truth_Particle->Pz(), Truth_Particle->E(), NTruthD); + NTruthD++; + } + else { + if (TMath::Abs(Truth_Particle->Eta()) > 0.9) continue; //no pT cut? + fFastJetWrapper_Truth->AddInputVector(Truth_Particle->Px(), Truth_Particle->Py(), Truth_Particle->Pz(), Truth_Particle->E(), i_Particle + 100); + } + } + // delete Truth_Particle; + fFastJetWrapper_Truth->Run(); + Inclusive_Jets_Truth = fFastJetWrapper_Truth->GetInclusiveJets(); + if (NTruthD == 0) fhEvent->Fill(3); + if (NTruthD == 1) fhEvent->Fill(4); + if (NTruthD == 2) fhEvent->Fill(5); + if (NTruthD == 3) fhEvent->Fill(6); + if (NTruthD == 4) fhEvent->Fill(7); + if (NTruthD == 5) fhEvent->Fill(8); + if (NTruthD == 6) fhEvent->Fill(9); + } + + fCandidateArray = dynamic_cast(fAodEvent->GetList()->FindObject("D0toKpi")); + AliHFTrackContainer* Track_Container = (AliHFTrackContainer*)GetTrackContainer(0); + if (!Track_Container) return kTRUE; + Track_Container->SetDMesonCandidate(NULL); + + for (Int_t i_D = 0; i_D < fCandidateArray->GetEntriesFast(); i_D++) { + AliAODRecoDecayHF2Prong* D_Candidate = static_cast(fCandidateArray->At(i_D)); + if (!D_Candidate) continue; + if (!fRDHFCuts->IsInFiducialAcceptance(D_Candidate->Pt(), D_Candidate->Y(fCandidatePDG))) continue; + + Int_t Mass_Hypo_Type = fRDHFCuts->IsSelected(D_Candidate, AliRDHFCuts::kAll, fAodEvent); + if (Mass_Hypo_Type <= 0 || Mass_Hypo_Type > 3) continue; + fhEvent->Fill(10); + + Int_t Matched_Truth_Particle_PDG = 0; + + const Int_t D_Candidtae_N_Daughters = 2; + Int_t D_Candidtae_Daughters_PDG[D_Candidtae_N_Daughters] = {211, 321}; + Int_t D_Candidate_MatchedTruth_Label = D_Candidate->MatchToMC(fCandidatePDG, Particle_Container->GetArray(), D_Candidtae_N_Daughters, D_Candidtae_Daughters_PDG); + Bool_t Is_Prompt_Correct_Quark = kFALSE; + Int_t Is_Prompt_Correct_Quark_PDG = -1; + AliAODMCParticle* Matched_Truth_Particle; + if (D_Candidate_MatchedTruth_Label >= 0) { + Matched_Truth_Particle = static_cast(Particle_Container->GetArray()->At(D_Candidate_MatchedTruth_Label)); + if (Matched_Truth_Particle) { + fhEvent->Fill(11); + + Int_t Matched_Truth_Particle_Mother_Label = Matched_Truth_Particle->GetMother(); + while (Matched_Truth_Particle_Mother_Label >= 0) { + AliAODMCParticle* Matched_Truth_Particle_Mother = static_cast(Particle_Container->GetArray()->At(Matched_Truth_Particle_Mother_Label)); + if (Matched_Truth_Particle_Mother) { + Int_t Original_Quark_PDG = 4; + if (fIsBDecay) Original_Quark_PDG = 5; + if (TMath::Abs(Matched_Truth_Particle_Mother->GetPdgCode()) == 4) { + fhEvent->Fill(12); + Is_Prompt_Correct_Quark_PDG = 4; + break; + } + if (TMath::Abs(Matched_Truth_Particle_Mother->GetPdgCode()) == 5) { + fhEvent->Fill(13); + Is_Prompt_Correct_Quark_PDG = 5; + break; + } + if (TMath::Abs(Matched_Truth_Particle_Mother->GetPdgCode()) == Original_Quark_PDG) Is_Prompt_Correct_Quark = kTRUE; + if (Matched_Truth_Particle_Mother_Label == Matched_Truth_Particle_Mother->GetMother()) break; + Matched_Truth_Particle_Mother_Label = Matched_Truth_Particle_Mother->GetMother(); + } + else + break; + // delete Matched_Truth_Particle_Mother; + } + Matched_Truth_Particle_PDG = Matched_Truth_Particle->PdgCode(); + } + } + else + continue; + if (fPromptReject && !Is_Prompt_Correct_Quark) continue; + + if (Mass_Hypo_Type == 1 && Matched_Truth_Particle_PDG != fCandidatePDG) { + fhEvent->Fill(14); + continue; + } + else + fhEvent->Fill(15); + if (Mass_Hypo_Type == 2 && Matched_Truth_Particle_PDG != -fCandidatePDG) { + fhEvent->Fill(16); + continue; + } + else + fhEvent->Fill(17); + if (Mass_Hypo_Type == 3 && TMath::Abs(Matched_Truth_Particle_PDG) != fCandidatePDG) { + fhEvent->Fill(18); + continue; + } + else { + fhEvent->Fill(19); + if (Matched_Truth_Particle_PDG == fCandidatePDG) fhEvent->Fill(20); + if (Matched_Truth_Particle_PDG == -fCandidatePDG) fhEvent->Fill(21); + } + + Double_t Inv_Mass_D = 0.0; + Double_t Inv_Mass_D_Truth = 0.0; + + if (D_Candidate->Pt() < fCandidateMinPt) continue; + + if (Mass_Hypo_Type == 1 || (Mass_Hypo_Type == 3 && Matched_Truth_Particle_PDG == fCandidatePDG)) { + Inv_Mass_D = D_Candidate->InvMassD0(); + // Inv_Mass_D_Truth=Matched_Truth_Particle->InvMassD0(); + Inv_Mass_D_Truth = 0.0; + } + if (Mass_Hypo_Type == 2 || (Mass_Hypo_Type == 3 && Matched_Truth_Particle_PDG == -fCandidatePDG)) { + Inv_Mass_D = D_Candidate->InvMassD0bar(); + // Inv_Mass_D_Truth=Matched_Truth_Particle->InvMassD0bar(); + Inv_Mass_D_Truth = 0.0; + } + + // Random_Number=Random.Rndm(); + // if(Random_Number > fTrackingEfficiency*fTrackingEfficiency) continue; + + fFastJetWrapper->Clear(); + AliTLorentzVector D_Candidate_LorentzVector(0, 0, 0, 0); + D_Candidate_LorentzVector.SetPtEtaPhiM(D_Candidate->Pt(), D_Candidate->Eta(), D_Candidate->Phi(), Inv_Mass_D); + // if (TMath::Abs(D_Candidate->Eta())>0.9) continue; + // Dmeson_Eta=TMath::Abs(D_Candidate->Eta()); + // Dmeson_Y=TMath::Abs(D_Candidate->Y(fCandidatePDG)); + fFastJetWrapper->AddInputVector(D_Candidate_LorentzVector.Px(), D_Candidate_LorentzVector.Py(), D_Candidate_LorentzVector.Pz(), D_Candidate_LorentzVector.E(), 0); + + if (!Track_Container) continue; + Track_Container->SetDMesonCandidate(D_Candidate); + AliAODTrack* Track = NULL; + for (Int_t i_Track = 0; i_Track < Track_Container->GetNTracks(); i_Track++) { + Track = static_cast(Track_Container->GetAcceptParticle(i_Track)); + if (!Track) continue; + if (Track->Pt() > 100.0 || TMath::Abs(Track->Eta()) > 0.9) continue; + Random_Number = Random.Rndm(); + if (Random_Number > fTrackingEfficiency) continue; + fFastJetWrapper->AddInputVector(Track->Px(), Track->Py(), Track->Pz(), Track->E(), i_Track + 100); + } + // delete Track; + fFastJetWrapper->Run(); + + std::vector Inclusive_Jets = fFastJetWrapper->GetInclusiveJets(); + for (UInt_t i_Jet = 0; i_Jet < Inclusive_Jets.size(); i_Jet++) { + Bool_t Is_D_Jet = kFALSE; + if (Inclusive_Jets[i_Jet].perp() < fJetMinPt) continue; + // Jet_Eta=TMath::Abs(Inclusive_Jets[i_Jet].pseudorapidity()); + if (TMath::Abs(Inclusive_Jets[i_Jet].pseudorapidity()) > 0.9 - fJetRadius) continue; + std::vector Constituents(fFastJetWrapper->GetJetConstituents(i_Jet)); + // NTracks=Constituents.size(); + for (UInt_t i_Constituents = 0; i_Constituents < Constituents.size(); i_Constituents++) { + if (Constituents[i_Constituents].user_index() == 0) { + Is_D_Jet = kTRUE; + break; + } + } + + if (!Is_D_Jet) continue; + fhEvent->Fill(22); + + Int_t i_Matched_D_Jet_Truth = -1; + for (UInt_t k = 0; k < Inclusive_Jets_Truth_Labels.size(); k++) { + if (Inclusive_Jets_Truth_Labels[k].first == D_Candidate_MatchedTruth_Label) i_Matched_D_Jet_Truth = Inclusive_Jets_Truth_Labels[k].second; + } + + for (UInt_t i_Jet_Truth = 0; i_Jet_Truth < Inclusive_Jets_Truth.size(); i_Jet_Truth++) { + Bool_t Is_Jet_Truth_Matched = kFALSE; + if (TMath::Abs(Inclusive_Jets_Truth[i_Jet_Truth].pseudorapidity()) > 0.9 - fJetRadius) continue; + // Jet_Eta_Truth=TMath::Abs(Inclusive_Jets_Truth[i_Jet_Truth].pseudorapidity()); + std::vector Constituents_Truth(fFastJetWrapper_Truth->GetJetConstituents(i_Jet_Truth)); + // NTracks_Truth=Constituents_Truth.size(); + for (UInt_t i_Constituents_Truth = 0; i_Constituents_Truth < Constituents_Truth.size(); i_Constituents_Truth++) { + if (Constituents_Truth[i_Constituents_Truth].user_index() == i_Matched_D_Jet_Truth) { + Is_Jet_Truth_Matched = kTRUE; + // Dmeson_Eta_Truth=TMath::Abs(Constituents_Truth[i_Constituents_Truth].pseudorapidity()); + // Dmeson_Y_Truth=TMath::Abs(Constituents_Truth[i_Constituents_Truth].rapidity()); + for (UInt_t i_Unmacthed_D = 0; i_Unmacthed_D < Unmatched_Truth_Level_D.size(); i_Unmacthed_D++) { + if (Unmatched_Truth_Level_D[i_Unmacthed_D] == i_Matched_D_Jet_Truth) Unmatched_Truth_Level_D.erase(Unmatched_Truth_Level_D.begin() + i_Unmacthed_D); + } + } + } + if (!Is_Jet_Truth_Matched) continue; + fhEvent->Fill(23); + NMatched_DMeson_Jets++; + + fShapesVar_Constituents_E.clear(); + fShapesVar_Constituents_pT.clear(); + fShapesVar_Constituents_Phi.clear(); + fShapesVar_Constituents_Rap.clear(); + + std::vector jetConstituents(fFastJetWrapper->GetJetConstituents(i_Jet)); + + for (Int_t i = 0; i < jetConstituents.size(); i++) { + fShapesVar_Constituents_E.push_back(jetConstituents[i].E()); + fShapesVar_Constituents_pT.push_back(jetConstituents[i].perp()); + fShapesVar_Constituents_Phi.push_back(jetConstituents[i].phi()); + fShapesVar_Constituents_Rap.push_back(jetConstituents[i].rap()); + } + + fShapesVar_Constituents_E_Truth.clear(); + fShapesVar_Constituents_pT_Truth.clear(); + fShapesVar_Constituents_Phi_Truth.clear(); + fShapesVar_Constituents_Rap_Truth.clear(); + + std::vector jetConstituents_Truth(fFastJetWrapper_Truth->GetJetConstituents(i_Jet_Truth)); + + for (Int_t i = 0; i < jetConstituents_Truth.size(); i++) { + fShapesVar_Constituents_E_Truth.push_back(jetConstituents_Truth[i].E()); + fShapesVar_Constituents_pT_Truth.push_back(jetConstituents_Truth[i].perp()); + fShapesVar_Constituents_Phi_Truth.push_back(jetConstituents_Truth[i].phi()); + fShapesVar_Constituents_Rap_Truth.push_back(jetConstituents_Truth[i].rap()); + } + + + + // set detector level flags + Double_t Flag_D = -1.0; + if (Mass_Hypo_Type == 1) + Flag_D = 1.0; + else if (Mass_Hypo_Type == 2) + Flag_D = 2.0; + else if (Mass_Hypo_Type == 3 && Matched_Truth_Particle->GetPdgCode() == fCandidatePDG) + Flag_D = 3.0; + else if (Mass_Hypo_Type == 3 && Matched_Truth_Particle->GetPdgCode() == -fCandidatePDG) + Flag_D = 4.0; + + Double_t Flag_D_Truth = -1.0; + if (Matched_Truth_Particle->GetPdgCode() == fCandidatePDG) Flag_D_Truth = 1.0; + if (Matched_Truth_Particle->GetPdgCode() == -fCandidatePDG) Flag_D_Truth = 2.0; + + fShapesVar[0] = Inclusive_Jets[i_Jet].perp(); + fShapesVar[1] = Inclusive_Jets_Truth[i_Jet_Truth].perp(); + fShapesVar[2] = D_Candidate->Pt(); + fShapesVar[3] = Matched_Truth_Particle->Pt(); + fShapesVar[4] = Inv_Mass_D; + fShapesVar[5] = Inv_Mass_D_Truth; + fShapesVar[6] = Flag_D; + fShapesVar[7] = Flag_D_Truth; + fShapesVar[8] = Is_Prompt_Correct_Quark_PDG; + fShapesVar[9] = 0.0; + fShapesVar[10] = Inclusive_Jets[i_Jet].m(); + fShapesVar[11] = Inclusive_Jets_Truth[i_Jet_Truth].m(); + + + fTreeJet->Fill(); + fTreeConstituents->Fill(); + } + } + // delete Matched_Truth_Particle; + // delete D_Candidate; + } + // delete Track_Container; + if (NMatched_DMeson_Jets == 0) fhEvent->Fill(24); + if (NMatched_DMeson_Jets == 1) fhEvent->Fill(25); + if (NMatched_DMeson_Jets == 2) fhEvent->Fill(26); + if (NMatched_DMeson_Jets == 3) fhEvent->Fill(27); + if (NMatched_DMeson_Jets == 4) fhEvent->Fill(28); + if (NMatched_DMeson_Jets == 5) fhEvent->Fill(29); + if (NMatched_DMeson_Jets == 6) fhEvent->Fill(30); + + if (fIncludeInclusive) { + if (Unmatched_Truth_Level_D.size() == 0) fhEvent->Fill(31); + if (Unmatched_Truth_Level_D.size() == 1) fhEvent->Fill(32); + if (Unmatched_Truth_Level_D.size() == 2) fhEvent->Fill(33); + if (Unmatched_Truth_Level_D.size() == 3) fhEvent->Fill(34); + if (Unmatched_Truth_Level_D.size() == 4) fhEvent->Fill(35); + if (Unmatched_Truth_Level_D.size() == 5) fhEvent->Fill(36); + if (Unmatched_Truth_Level_D.size() == 6) fhEvent->Fill(37); + + for (UInt_t i_Jet_Truth = 0; i_Jet_Truth < Inclusive_Jets_Truth.size(); i_Jet_Truth++) { + AliAODMCParticle* Truth_D_Particle = NULL; + Bool_t Is_Unmatched_D = kFALSE; + Int_t D_Meson_Matched_Index = -1; + if (TMath::Abs(Inclusive_Jets_Truth[i_Jet_Truth].pseudorapidity()) > 0.9 - fJetRadius) continue; + // Jet_Eta_Truth=TMath::Abs(Inclusive_Jets_Truth[i_Jet_Truth].pseudorapidity()); + if (Inclusive_Jets_Truth[i_Jet_Truth].perp() < fJetMinPt) continue; + std::vector Constituents_Truth(fFastJetWrapper_Truth->GetJetConstituents(i_Jet_Truth)); + // NTracks_Truth=Constituents_Truth.size(); + for (UInt_t i_Constituents_Truth = 0; i_Constituents_Truth < Constituents_Truth.size(); i_Constituents_Truth++) { + for (UInt_t i_Unmacthed_D = 0; i_Unmacthed_D < Unmatched_Truth_Level_D.size(); i_Unmacthed_D++) { + if (Constituents_Truth[i_Constituents_Truth].user_index() == Unmatched_Truth_Level_D[i_Unmacthed_D]) { + Is_Unmatched_D = kTRUE; + D_Meson_Matched_Index = Constituents_Truth[i_Constituents_Truth].user_index(); + for (UInt_t i_MC_Label = 0; i_MC_Label < Inclusive_Jets_Truth_Labels.size(); i_MC_Label++) { + if (Inclusive_Jets_Truth_Labels[i_MC_Label].second == Constituents_Truth[i_Constituents_Truth].user_index()) { + Truth_D_Particle = static_cast(Particle_Container->GetArray()->At(Inclusive_Jets_Truth_Labels[i_MC_Label].first)); + // Dmeson_Eta_Truth=TMath::Abs(Truth_D_Particle->Eta()); + // Dmeson_Y_Truth=TMath::Abs(Truth_D_Particle->Y()); + } + } + } + } + } + if (!Is_Unmatched_D) continue; + fhEvent->Fill(38); + + Bool_t Is_Prompt_Correct_Quark = kFALSE; + Int_t Is_Prompt_Correct_Quark_PDG = -1; + Int_t Truth_D_Particle_Mother_Label = Truth_D_Particle->GetMother(); + while (Truth_D_Particle_Mother_Label >= 0) { + AliAODMCParticle* Truth_D_Particle_Mother = static_cast(Particle_Container->GetArray()->At(Truth_D_Particle_Mother_Label)); + if (Truth_D_Particle_Mother) { + Int_t Original_Quark_PDG = 4; + if (fIsBDecay) Original_Quark_PDG = 5; + if (TMath::Abs(Truth_D_Particle_Mother->GetPdgCode()) == 4) { + fhEvent->Fill(39); + Is_Prompt_Correct_Quark_PDG = 4; + break; + } + if (TMath::Abs(Truth_D_Particle_Mother->GetPdgCode()) == 5) { + fhEvent->Fill(40); + Is_Prompt_Correct_Quark_PDG = 5; + break; + } + if (TMath::Abs(Truth_D_Particle_Mother->GetPdgCode()) == Original_Quark_PDG) Is_Prompt_Correct_Quark = kTRUE; + if (Truth_D_Particle_Mother_Label == Truth_D_Particle_Mother->GetMother()) break; + Truth_D_Particle_Mother_Label = Truth_D_Particle_Mother->GetMother(); + } + else + break; + // delete Truth_D_Particle_Mother; + } + + if (fPromptReject && !Is_Prompt_Correct_Quark) continue; + + fShapesVar_Constituents_E_Truth.clear(); + fShapesVar_Constituents_pT_Truth.clear(); + fShapesVar_Constituents_Phi_Truth.clear(); + fShapesVar_Constituents_Rap_Truth.clear(); + + std::vector jetConstituents_Truth(fFastJetWrapper_Truth->GetJetConstituents(i_Jet_Truth)); + + for (Int_t i = 0; i < jetConstituents_Truth.size(); i++) { + fShapesVar_Constituents_E_Truth.push_back(jetConstituents_Truth[i].E()); + fShapesVar_Constituents_pT_Truth.push_back(jetConstituents_Truth[i].perp()); + fShapesVar_Constituents_Phi_Truth.push_back(jetConstituents_Truth[i].phi()); + fShapesVar_Constituents_Rap_Truth.push_back(jetConstituents_Truth[i].rap()); + } + + Double_t Inv_Mass_D_Truth = 0.0; + Double_t Flag_D_Truth = -1.0; + if (Truth_D_Particle->GetPdgCode() == fCandidatePDG) { + // Inv_Mass_D_Truth=Truth_D_Particle->InvMassD0(); + Inv_Mass_D_Truth = 0.0; + Flag_D_Truth = 3.0; + } + if (Truth_D_Particle->GetPdgCode() == -fCandidatePDG) { + // Inv_Mass_D_Truth=Truth_D_Particle->InvMassD0bar(); + Inv_Mass_D_Truth = 0.0; + Flag_D_Truth = 4.0; + } + + fShapesVar[0] = 0.0; + fShapesVar[1] = Inclusive_Jets_Truth[i_Jet_Truth].perp(); + fShapesVar[2] = 0.0; + fShapesVar[3] = Truth_D_Particle->Pt(); + fShapesVar[4] = 0.0; + fShapesVar[5] = Inv_Mass_D_Truth; + fShapesVar[6] = 0.0; + fShapesVar[7] = Flag_D_Truth; + fShapesVar[8] = Is_Prompt_Correct_Quark_PDG; + fShapesVar[9] = 0.0; + fShapesVar[10] = 0.0; + fShapesVar[11] = Inclusive_Jets_Truth[i_Jet_Truth].m(); + // fShapesVar[12] = 0.0; + // fShapesVar[13] = Jet_Eta_Truth; + // fShapesVar[14] = 0.0; + // fShapesVar[15] = Dmeson_Eta_Truth; + // fShapesVar[16] = 0.0; + // fShapesVar[17] = Dmeson_Y_Truth; + + + + fTreeJet->Fill(); + fTreeConstituents->Fill(); + + // delete Truth_D_Particle; + } + } + // delete Particle_Container; + } + + if (fJetShapeType == kTrue) { + // truth level only jet finding + + Double_t NTracks_Truth = 0; + Double_t Jet_Eta_Truth = -5.0; + Double_t Dmeson_Eta_Truth = -5.0; + Double_t Dmeson_Y_Truth = -5.0; + + AliHFAODMCParticleContainer* Particle_Container = (AliHFAODMCParticleContainer*)GetParticleContainer(0); + Particle_Container->SetSpecialPDG(fCandidatePDG); + Particle_Container->SetRejectedOriginMap(fRejectedOrigin); + Particle_Container->SetAcceptedDecayMap(fAcceptedDecay); + Particle_Container->SetRejectISR(fRejectISR); + Particle_Container->SetCharge(AliParticleContainer::EChargeCut_t::kCharged); + + std::vector Inclusive_Jets_Truth; + std::vector> Inclusive_Jets_Truth_Labels; + + if (Particle_Container->IsSpecialPDGFound()) { + fhEvent->Fill(2); + + fFastJetWrapper_Truth->SetAreaType(fastjet::active_area); + fFastJetWrapper_Truth->SetGhostArea(0.005); + fFastJetWrapper_Truth->SetR(fJetRadius); + fFastJetWrapper_Truth->SetAlgorithm(fastjet::antikt_algorithm); + fFastJetWrapper_Truth->SetRecombScheme(static_cast(1)); + fFastJetWrapper_Truth->Clear(); + + AliAODMCParticle* Truth_Particle = NULL; + Int_t NTruthD = 0; + for (Int_t i_Particle = 0; i_Particle < Particle_Container->GetNParticles(); i_Particle++) { + Truth_Particle = static_cast(Particle_Container->GetAcceptMCParticle(i_Particle)); + if (!Truth_Particle) continue; + if (TMath::Abs(Truth_Particle->GetPdgCode()) == fCandidatePDG) { + fhEvent->Fill(3); + std::pair Inclusive_Jet_Truth_Labels; + Inclusive_Jet_Truth_Labels.first = Truth_Particle->GetLabel(); + Inclusive_Jet_Truth_Labels.second = NTruthD; + Inclusive_Jets_Truth_Labels.push_back(Inclusive_Jet_Truth_Labels); + fFastJetWrapper_Truth->AddInputVector(Truth_Particle->Px(), Truth_Particle->Py(), Truth_Particle->Pz(), Truth_Particle->E(), NTruthD); + NTruthD++; + } + else + fFastJetWrapper_Truth->AddInputVector(Truth_Particle->Px(), Truth_Particle->Py(), Truth_Particle->Pz(), Truth_Particle->E(), i_Particle + 100); + } + // delete Truth_Particle; + fFastJetWrapper_Truth->Run(); + Inclusive_Jets_Truth = fFastJetWrapper_Truth->GetInclusiveJets(); + + for (UInt_t i_Jet_Truth = 0; i_Jet_Truth < Inclusive_Jets_Truth.size(); i_Jet_Truth++) { + AliAODMCParticle* Truth_D_Particle = NULL; + Bool_t Is_DJet_Truth = kFALSE; + Int_t D_Meson_Matched_Index = -1; + // if (TMath::Abs(Inclusive_Jets_Truth[i_Jet_Truth].pseudorapidity()) > 0.9-fJetRadius) continue; + Jet_Eta_Truth = TMath::Abs(Inclusive_Jets_Truth[i_Jet_Truth].pseudorapidity()); + std::vector Constituents_Truth(fFastJetWrapper_Truth->GetJetConstituents(i_Jet_Truth)); + NTracks_Truth = Constituents_Truth.size(); + for (UInt_t i_Constituents_Truth = 0; i_Constituents_Truth < Constituents_Truth.size(); i_Constituents_Truth++) { + if (Constituents_Truth[i_Constituents_Truth].user_index() >= 0 && Constituents_Truth[i_Constituents_Truth].user_index() < NTruthD) { + D_Meson_Matched_Index = Constituents_Truth[i_Constituents_Truth].user_index(); + Is_DJet_Truth = kTRUE; + for (UInt_t i_MC_Label = 0; i_MC_Label < Inclusive_Jets_Truth_Labels.size(); i_MC_Label++) { + if (Inclusive_Jets_Truth_Labels[i_MC_Label].second == Constituents_Truth[i_Constituents_Truth].user_index()) { + Truth_D_Particle = static_cast(Particle_Container->GetArray()->At(Inclusive_Jets_Truth_Labels[i_MC_Label].first)); + Dmeson_Eta_Truth = TMath::Abs(Truth_D_Particle->Eta()); + Dmeson_Y_Truth = TMath::Abs(Truth_D_Particle->Y()); + } + } + } + } + + if (!Is_DJet_Truth) fhEvent->Fill(4); + if (Is_DJet_Truth) fhEvent->Fill(5); + + if (!fIncludeInclusive && !Is_DJet_Truth) continue; + + Bool_t Is_Prompt_Correct_Quark = kFALSE; + Int_t Is_Prompt_Correct_Quark_PDG = -1; + Int_t Truth_D_Particle_Mother_Label = Truth_D_Particle->GetMother(); + while (Truth_D_Particle_Mother_Label >= 0) { + AliAODMCParticle* Truth_D_Particle_Mother = static_cast(Particle_Container->GetArray()->At(Truth_D_Particle_Mother_Label)); + if (Truth_D_Particle_Mother) { + Int_t Original_Quark_PDG = 4; + if (fIsBDecay) Original_Quark_PDG = 5; + if (TMath::Abs(Truth_D_Particle_Mother->GetPdgCode()) == Original_Quark_PDG) Is_Prompt_Correct_Quark = kTRUE; + if (TMath::Abs(Truth_D_Particle_Mother->GetPdgCode()) == 4) { + fhEvent->Fill(6); + Is_Prompt_Correct_Quark_PDG = 4; + break; + } + if (TMath::Abs(Truth_D_Particle_Mother->GetPdgCode()) == 5) { + fhEvent->Fill(7); + Is_Prompt_Correct_Quark_PDG = 5; + break; + } + if (Truth_D_Particle_Mother_Label == Truth_D_Particle_Mother->GetMother()) break; + Truth_D_Particle_Mother_Label = Truth_D_Particle_Mother->GetMother(); + } + else + break; + // delete Truth_D_Particle_Mother; + } + + if (fPromptReject && !Is_Prompt_Correct_Quark) continue; + fhEvent->Fill(8); + + + if (Truth_D_Particle->Pt() < fCandidateMinPt) continue; + if (Truth_D_Particle->Pt() > 5.0) { + if (TMath::Abs(Truth_D_Particle->Y()) > 0.8) continue; + } + else { + if (Truth_D_Particle->Y() < 0.2 / 15 * Truth_D_Particle->Pt() * Truth_D_Particle->Pt() - 1.9 / 15 * Truth_D_Particle->Pt() - 0.5 || Truth_D_Particle->Y() > -0.2 / 15 * Truth_D_Particle->Pt() * Truth_D_Particle->Pt() + 1.9 / 15 * Truth_D_Particle->Pt() + 0.5) continue; + } + + + fShapesVar_Constituents_E_Truth.clear(); + fShapesVar_Constituents_pT_Truth.clear(); + fShapesVar_Constituents_Phi_Truth.clear(); + fShapesVar_Constituents_Rap_Truth.clear(); + + std::vector jetConstituents_Truth(fFastJetWrapper_Truth->GetJetConstituents(i_Jet_Truth)); + + for (Int_t i = 0; i < jetConstituents_Truth.size(); i++) { + fShapesVar_Constituents_E_Truth.push_back(jetConstituents_Truth[i].E()); + fShapesVar_Constituents_pT_Truth.push_back(jetConstituents_Truth[i].perp()); + fShapesVar_Constituents_Phi_Truth.push_back(jetConstituents_Truth[i].phi()); + fShapesVar_Constituents_Rap_Truth.push_back(jetConstituents_Truth[i].rap()); + } + + Double_t Inv_Mass_D_Truth = 0.0; + Double_t Flag_D_Truth = -1.0; + Double_t D_Pt = -1.0; + if (fIncludeInclusive && !Is_DJet_Truth) { + Flag_D_Truth = 0.0; + } + else if (Is_DJet_Truth) { + if (Truth_D_Particle->GetPdgCode() == fCandidatePDG) { + // Inv_Mass_D_Truth=Truth_D_Particle->InvMassD0(); + Inv_Mass_D_Truth = 0.0; + Flag_D_Truth = 1.0; + D_Pt = Truth_D_Particle->Pt(); + fhEvent->Fill(9); + } + if (Truth_D_Particle->GetPdgCode() == -fCandidatePDG) { + // Inv_Mass_D_Truth=Truth_D_Particle->InvMassD0bar(); + Inv_Mass_D_Truth = 0.0; + Flag_D_Truth = 2.0; + D_Pt = Truth_D_Particle->Pt(); + fhEvent->Fill(10); + } + } + + fShapesVar[0] = 0.0; + fShapesVar[1] = Inclusive_Jets_Truth[i_Jet_Truth].perp(); + fShapesVar[2] = 0.0; + fShapesVar[3] = D_Pt; + fShapesVar[4] = 0.0; + fShapesVar[5] = Inv_Mass_D_Truth; + fShapesVar[6] = 0.0; + fShapesVar[7] = Flag_D_Truth; + fShapesVar[8] = 0.0; + fShapesVar[9] = Is_Prompt_Correct_Quark_PDG; + fShapesVar[10] = 0.0; + fShapesVar[11] = Inclusive_Jets_Truth[i_Jet_Truth].m(); + // fShapesVar[12] = 0.0; + // fShapesVar[13] = Jet_Eta_Truth; + // fShapesVar[14] = 0.0; + // fShapesVar[15] = Dmeson_Eta_Truth; + // fShapesVar[16] = 0.0; + // fShapesVar[17] = Dmeson_Y_Truth; + + + + fTreeJet->Fill(); + fTreeConstituents->Fill(); + + + // delete Truth_D_Particle; + } + if (NTruthD == 0) fhEvent->Fill(11); + if (NTruthD == 1) fhEvent->Fill(12); + if (NTruthD == 2) fhEvent->Fill(13); + if (NTruthD == 3) fhEvent->Fill(14); + if (NTruthD == 4) fhEvent->Fill(15); + if (NTruthD == 5) fhEvent->Fill(16); + if (NTruthD == 6) fhEvent->Fill(17); + } + // delete Particle_Container; + } + + if (fJetShapeType == kDataInclusive) { + TRandom3 Random; + Random.SetSeed(0); + Double_t Random_Number; + + AliHFTrackContainer* Track_Container = dynamic_cast(GetTrackContainer(0)); + if (!Track_Container) return kTRUE; + // Track_Container->SetDMesonCandidate(NULL); + fFastJetWrapper->Clear(); + // Double_t NTracks=0; + // Double_t Jet_Eta=-5.0; + // Double_t HardestTrack_Eta=-5.0; + // Double_t HardestTrack_Y=-5.0; + Double_t HardestTrack_Pt = -5.0; + AliAODTrack* Track = NULL; + for (Int_t i_Track = 0; i_Track < Track_Container->GetNTracks(); i_Track++) { + Track = static_cast(Track_Container->GetAcceptParticle(i_Track)); + if (!Track) continue; + if (Track->Pt() > 100.0 || TMath::Abs(Track->Eta()) > 0.9) continue; + Random_Number = Random.Rndm(); + if (Random_Number > fTrackingEfficiency) continue; + fFastJetWrapper->AddInputVector(Track->Px(), Track->Py(), Track->Pz(), Track->E(), i_Track + 100); + } + fFastJetWrapper->Run(); + std::vector Inclusive_Jets = fFastJetWrapper->GetInclusiveJets(); + for (UInt_t i_Jet = 0; i_Jet < Inclusive_Jets.size(); i_Jet++) { + if (Inclusive_Jets[i_Jet].perp() < fJetMinPt) continue; + if (TMath::Abs(Inclusive_Jets[i_Jet].pseudorapidity()) > 0.9 - fJetRadius) continue; + // Jet_Eta=TMath::Abs(Inclusive_Jets[i_Jet].pseudorapidity()); + fhEvent->Fill(23); + + HardestTrack_Pt = -5.0; + std::vector Constituents(fFastJetWrapper->GetJetConstituents(i_Jet)); + // NTracks=Constituents.size(); + for (UInt_t i_Constituents = 0; i_Constituents < Constituents.size(); i_Constituents++) { + if (Constituents[i_Constituents].perp() > HardestTrack_Pt) { + HardestTrack_Pt = Constituents[i_Constituents].perp(); + // HardestTrack_Eta=TMath::Abs(Constituents[i_Constituents].pseudorapidity()); + // HardestTrack_Y=TMath::Abs(Constituents[i_Constituents].rapidity()); + } + } + + std::vector jetConstituents(fFastJetWrapper->GetJetConstituents(i_Jet)); + + for (Int_t i = 0; i < jetConstituents.size(); i++) { + fShapesVar_Constituents_E.push_back(jetConstituents[i].E()); + fShapesVar_Constituents_pT.push_back(jetConstituents[i].perp()); + fShapesVar_Constituents_Phi.push_back(jetConstituents[i].phi()); + fShapesVar_Constituents_Rap.push_back(jetConstituents[i].rap()); + } + + fShapesVar[0] = Inclusive_Jets[i_Jet].perp(); + fShapesVar[1] = 0.0; + fShapesVar[2] = HardestTrack_Pt; + fShapesVar[3] = 0.0; + fShapesVar[4] = 0.0; + fShapesVar[5] = 0.0; + fShapesVar[6] = 0.0; + fShapesVar[7] = 0.0; + fShapesVar[8] = 0.0; + fShapesVar[9] = 0.0; + fShapesVar[10] = Inclusive_Jets[i_Jet].m(); + fShapesVar[11] = 0.0; + // fShapesVar[12] = Jet_Eta; + // fShapesVar[13] = 0.0; + // fShapesVar[14] = HardestTrack_Eta; + // fShapesVar[15] = 0.0; + // fShapesVar[16] = HardestTrack_Y; + // fShapesVar[17] = 0.0; + + + + + fTreeJet->Fill(); + fTreeConstituents->Fill(); + } + } + + delete fFastJetWrapper_Truth; + delete fFastJetWrapper; + + return kTRUE; +} + +//________________________________________________________________________ +Bool_t AliAnalysisTaskHFEECorrelators::RetrieveEventObjects() { + // + // retrieve event objects + // + if (!AliAnalysisTaskEmcal::RetrieveEventObjects()) return kFALSE; + + return kTRUE; +} + +//_______________________________________________________________________ +void AliAnalysisTaskHFEECorrelators::Terminate(Option_t*) { + // Called once at the end of the analysis. +} diff --git a/PWGJE/FlavourJetTasks/AliAnalysisTaskHFEECorrelators.h b/PWGJE/FlavourJetTasks/AliAnalysisTaskHFEECorrelators.h new file mode 100644 index 00000000000..37741e242b8 --- /dev/null +++ b/PWGJE/FlavourJetTasks/AliAnalysisTaskHFEECorrelators.h @@ -0,0 +1,256 @@ +/// \class AliAnalysisTaskHFEECorrelators +/// \brief Analysis task for D meson jets +/// +/// This task selects D meson candidates according to predefined cuts, +/// then runs a jet finder to reconstruct the jets that contain +/// the D meson candidates. +/// +/// The main output is stored in a THnSparse histogram or in a TTree. +/// +/// \author Nima Zardoshti + +#ifndef ALIANALYSISTASKHFEECORRELATORS_H +#define ALIANALYSISTASKHFEECORRELATORS_H + +/************************************************************************** + * Copyright(c) 1998-2016, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +class TClonesArray; +class AliRDHFCuts; +class AliAODEvent; +class AliAODRecoDecay; +class AliAODRecoDecayHF2Prong; +class AliAODRecoCascadeHF; +class AliVParticle; +class AliAODMCParticle; +class AliHFAODMCParticleContainer; +class AliHFTrackContainer; +class AliParticleContainer; +class AliClusterContainer; +class THnSparse; +class AliFJWrapper; +class THashList; +class TTree; +class AliEMCALGeometry; +class TRandom; +class AliRhoParameter; +class TFile; + +//C++ +#include +#include +#include +#include + +#include "AliTLorentzVector.h" +#include "THistManager.h" + +#include "AliAnalysisTaskEmcal.h" +#include "AliJetContainer.h" +#include "TFile.h" +#include "AliRDHFCutsD0toKpi.h" + + +class AliAnalysisTaskHFEECorrelators : public AliAnalysisTaskEmcal +{ + public: + + class AliEventNotFound : public std::exception + { + public: + AliEventNotFound(const std::string& class_name, const std::string& method_name); +#if !(defined(__CINT__) || defined(__MAKECINT__)) + const char* what() const noexcept; +#endif + + + private: + std::string fClassName ; + std::string fAccessMethodName ; + std::string fWhat ; + }; + + typedef AliJetContainer::EJetType_t EJetType_t; + typedef AliJetContainer::EJetAlgo_t EJetAlgo_t; + typedef AliJetContainer::ERecoScheme_t ERecoScheme_t; + + enum JetShapeType { + kData = 0, + kDetSignal = 1, + kDetBackground = 2, + kDetReflection = 3, + kTrueDet = 4, + kTrue = 5, + kDataInclusive = 6, + kDet = 7, + }; + enum EMesonOrigin_t { + kUnknownQuark = BIT(0), + kFromDown = BIT(1), + kFromUp = BIT(2), + kFromStrange = BIT(3), + kFromCharm = BIT(4), + kFromBottom = BIT(5), + kFromTop = BIT(6), + kFromGluon = BIT(7), + kAnyOrigin = kUnknownQuark | kFromDown | kFromUp | kFromStrange | kFromCharm | kFromBottom | kFromTop | kFromGluon + }; + + enum EMesonDecayChannel_t { + kAnyDecay = 0, + kUnknownDecay = BIT(0), + kDecayD0toKpi = BIT(1), + kDecayDStartoKpipi = BIT(2) + }; + + enum TreeSize { + nVar = 12, + nVar_Constituents =8 + }; + + //enum ECandidateType_t { kD0toKpi, kDstartoKpipi, kD0toKpiLikeSign }; + enum ECandidateType_t {kD0toKpi}; + + AliAnalysisTaskHFEECorrelators(); + AliAnalysisTaskHFEECorrelators(const char *name); + virtual ~AliAnalysisTaskHFEECorrelators(); + + + + + AliAnalysisTaskHFEECorrelators* AddTaskAliAnalysisTaskHFEECorrelators(const char * ntracksData, + const char * ntracksTrue, + const char * ntracksDet, + const Double_t R, + AliAnalysisTaskHFEECorrelators::ECandidateType_t ECandidateType = AliAnalysisTaskHFEECorrelators::kD0toKpi, + AliAnalysisTaskHFEECorrelators::JetShapeType jetShapeType = AliAnalysisTaskHFEECorrelators::kData); + + + + + + + void UserCreateOutputObjects(); + void Terminate(Option_t *option); + + JetShapeType fJetShapeType; + ECandidateType_t fECandidateType; + + + void SetJetShapeType(JetShapeType tJetShapeType) {fJetShapeType = tJetShapeType;} + void SetECandidateType_t (ECandidateType_t ECandidateType) {fECandidateType = ECandidateType;} + + void SetIncludeInclusive(Bool_t IncludeInclusive) {fIncludeInclusive = IncludeInclusive;} + Bool_t GetIncludeInclusive() {return fIncludeInclusive;} + void SetIsBDecay(Bool_t IsBDecay) {fIsBDecay = IsBDecay;} + Bool_t GetIsBDecay() {return fIsBDecay;} + void SetBranchName(TString BranchName) {fBranchName = BranchName;} + TString GetBranchName() {return fBranchName;} + void SetCutsType(TString CutsType) {fCutsType = CutsType;} + TString GetCutsType() {return fCutsType;} + void SetCandidatePDG(Int_t CandidatePDG) {fCandidatePDG = CandidatePDG;} + TString GetCandidatePDG() {return fCandidatePDG;} + + void SetCandidateMinPt(Double_t CandidateMinPt) {fCandidateMinPt = CandidateMinPt;} + Double_t GetCandidatMinPt() {return fCandidateMinPt;} + void SetCandidateMaxY(Double_t CandidateMaxY) {fCandidateMaxY = CandidateMaxY;} + Double_t GetCandidateMaxY() {return fCandidateMaxY;} + + void SetJetRadius(Double_t JetRadius) {fJetRadius = JetRadius;} + Double_t GetJetRadius() {return fJetRadius;} + void SetJetMinPt(Double_t JetMinPt) {fJetMinPt = JetMinPt;} + Double_t GetJetMinPt() {return fJetMinPt;} + void SetTrackingEfficiency(Double_t TrackingEfficiency) {fTrackingEfficiency = TrackingEfficiency;} + Double_t GetTrackingEfficiency() {return fTrackingEfficiency;} + void SetRejectedOrigin(UInt_t RejectedOrigin) {fRejectedOrigin = RejectedOrigin;} + void SetAcceptedDecay(UInt_t AcceptedDecay) {fAcceptedDecay = AcceptedDecay;} + void SetRejectISR(Bool_t RejectISR) {fRejectISR = RejectISR;} + Bool_t GetRejectISR() {return fRejectISR;} + void SetPromptReject(Bool_t PromptReject) {fPromptReject = PromptReject;} + Bool_t GetPromptRejectR() {return fPromptReject;} + void SetAlienConnect(Bool_t AlienConnect) {fAlienConnect = AlienConnect;} + void SetCuts(TString CutsFileName) {TFile *fCutsFile = TFile::Open(CutsFileName); + TString cutsname="D0toKpiCuts"; + if (fCutsType!="") cutsname += TString::Format("_%s", fCutsType.Data()); + fRDHFCuts = dynamic_cast(fCutsFile->Get(cutsname));} + + + + + protected: + + Bool_t RetrieveEventObjects(); + Bool_t Run() ; + Bool_t FillHistograms() ; + Bool_t fIncludeInclusive ; + Bool_t fIsBDecay ; + Bool_t fRejectISR ; + Bool_t fPromptReject ; + Bool_t fAlienConnect ; + + TString fBranchName ; + TString fCutsType; + Int_t fCandidatePDG ; + UInt_t fRejectedOrigin ; + UInt_t fAcceptedDecay ; + + Double_t fCandidateMinPt ; + Double_t fCandidateMaxY ; + + Double_t fJetRadius ; + Double_t fJetMinPt ; + Double_t fTrackingEfficiency ; + Double_t fShapesVar[nVar] ; + + + + TClonesArray *fCandidateArray ; + + AliAODEvent *fAodEvent ; + + AliRDHFCuts *fRDHFCuts; + AliFJWrapper *fFastJetWrapper; //! fShapesVar_Constituents_E; + std::vector fShapesVar_Constituents_E_Truth; + std::vector fShapesVar_Constituents_pT; + std::vector fShapesVar_Constituents_pT_Truth; + std::vector fShapesVar_Constituents_Phi; + std::vector fShapesVar_Constituents_Phi_Truth; + std::vector fShapesVar_Constituents_Rap; + std::vector fShapesVar_Constituents_Rap_Truth; + TTree *fTreeJet; + TTree *fTreeConstituents; + + + + + TH1D *fhEvent; + + + friend class AliAnalysisTaskDmesonJetsSub; + friend class OutputHandler; + + private: + + AliAnalysisTaskHFEECorrelators(const AliAnalysisTaskHFEECorrelators&); + AliAnalysisTaskHFEECorrelators &operator=(const AliAnalysisTaskHFEECorrelators&); + + ClassDef(AliAnalysisTaskHFEECorrelators, 1) + + }; + +#endif diff --git a/PWGJE/FlavourJetTasks/AliAnalysisTaskHFSubstructure.h b/PWGJE/FlavourJetTasks/AliAnalysisTaskHFSubstructure.h index fd7781ab5e7..f5bfb4a1a85 100644 --- a/PWGJE/FlavourJetTasks/AliAnalysisTaskHFSubstructure.h +++ b/PWGJE/FlavourJetTasks/AliAnalysisTaskHFSubstructure.h @@ -7,8 +7,7 @@ /// /// The main output is stored in a THnSparse histogram or in a TTree. /// -/// \author Salvatore Aiola , Yale University -/// \date Oct 13, 2017 +/// \author Nima Zardoshti #ifndef ALIANALYSISTASKHFSUBSTRUCTURE_H #define ALIANALYSISTASKHFSUBSTRUCTURE_H diff --git a/PWGJE/FlavourJetTasks/CMakeLists.txt b/PWGJE/FlavourJetTasks/CMakeLists.txt index 093d622878f..d2181a07f3c 100644 --- a/PWGJE/FlavourJetTasks/CMakeLists.txt +++ b/PWGJE/FlavourJetTasks/CMakeLists.txt @@ -67,6 +67,7 @@ if(FASTJET_FOUND) AliAnalysisTaskHFSubstructure.cxx AliDJetTTreeReader.cxx AliDJetTHnReader.cxx + AliAnalysisTaskHFEECorrelators.cxx AliAnalysisTaskHFJetIPQA.cxx ) endif(FASTJET_FOUND) diff --git a/PWGJE/FlavourJetTasks/PWGJEFlavourJetTasksLinkDef.h b/PWGJE/FlavourJetTasks/PWGJEFlavourJetTasksLinkDef.h index 1552b2058ce..fb4b85d08fe 100644 --- a/PWGJE/FlavourJetTasks/PWGJEFlavourJetTasksLinkDef.h +++ b/PWGJE/FlavourJetTasks/PWGJEFlavourJetTasksLinkDef.h @@ -80,6 +80,7 @@ #pragma link C++ class AliAnalysisTaskDmesonJetsDetectorResponse+; #pragma link C++ class AliAnalysisTaskHFSubstructure+; +#pragma link C++ class AliAnalysisTaskHFEECorrelators+; #pragma link C++ class AliHFAODMCParticleContainer+; diff --git a/PWGJE/FlavourJetTasks/macros/AddTaskHFEECorrelators.C b/PWGJE/FlavourJetTasks/macros/AddTaskHFEECorrelators.C new file mode 100644 index 00000000000..db8fe106028 --- /dev/null +++ b/PWGJE/FlavourJetTasks/macros/AddTaskHFEECorrelators.C @@ -0,0 +1,163 @@ +AliAnalysisTaskHFEECorrelators* AddTaskHFSubstructure(const char * ntracksData, + const char * ntracksDet, + const char * ntracksTrue, + const Double_t R, + const Double_t CandidateMinPt, + const Double_t CandidateMaxRap, + AliAnalysisTaskHFEECorrelators::ECandidateType_t ECandidateType = AliAnalysisTaskHFEECorrelators::kD0toKpi, + AliAnalysisTaskHFEECorrelators::JetShapeType jetShapeType = AliAnalysisTaskHFEECorrelators::kData, Bool_t IncludeInclusive=kFALSE) { + + + + AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); + if (!mgr) + { + Error("AddTaskHFSubstructure","No analysis manager found."); + return 0; + } + Bool_t ismc=kFALSE; + ismc = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE; + + // Check the analysis type using the event handlers connected to the analysis manager. + //============================================================================== + if (!mgr->GetInputEventHandler()) + { + ::Error("AliAnalysisTaskHFEECorrelators", "This task requires an input event handler"); + return NULL; + } + TString wagonName1, wagonName2,wagonName3; + TString tag=""; + if (ECandidateType == AliAnalysisTaskHFEECorrelators::kD0toKpi) tag="kD0toKpi"; + if (jetShapeType==AliAnalysisTaskHFEECorrelators::kData || jetShapeType==AliAnalysisTaskHFEECorrelators::kDataInclusive){ + wagonName1 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%s",ntracksData,tag.Data()); + wagonName2 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTree",ntracksData,tag.Data()); + wagonName3 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTreeSplittings",ntracksData,tag.Data()); + } + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDetSignal || jetShapeType == AliAnalysisTaskHFEECorrelators::kDetBackground || jetShapeType == AliAnalysisTaskHFEECorrelators::kDetReflection || jetShapeType == AliAnalysisTaskHFEECorrelators::kTrueDet || jetShapeType == AliAnalysisTaskHFEECorrelators::kDet){ + wagonName1 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%s",ntracksDet,tag.Data()); + wagonName2 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTree",ntracksDet,tag.Data()); + wagonName3 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTreeSplittings",ntracksDet,tag.Data()); + } + if (jetShapeType==AliAnalysisTaskHFEECorrelators::kTrue){ + wagonName1 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%s",ntracksTrue,tag.Data()); + wagonName2 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTree",ntracksTrue,tag.Data()); + wagonName3 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTreeSplittings",ntracksTrue,tag.Data()); + } + //Configure jet tagger task + AliAnalysisTaskHFEECorrelators *task = new AliAnalysisTaskHFEECorrelators(wagonName1); + + + task->SetECandidateType_t(ECandidateType); + task->SetJetShapeType(jetShapeType); + task->SetJetRadius(R); + task->SetIncludeInclusive(IncludeInclusive); + task->SetCandidateMinPt(CandidateMinPt); + task->SetCandidateMaxY(CandidateMaxRap); + + // AliParticleContainer *trackContData=0x0; //why not track containers? + //AliParticleContainer *trackContDet=0x0; + //AliParticleContainer *trackContTrue=0x0; + + + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kData || jetShapeType == AliAnalysisTaskHFEECorrelators::kDataInclusive){ + AliHFTrackContainer* trackContData = new AliHFTrackContainer(ntracksData); + task->AdoptParticleContainer(trackContData); + } + else if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDetSignal || jetShapeType == AliAnalysisTaskHFEECorrelators::kDetBackground || jetShapeType == AliAnalysisTaskHFEECorrelators::kDetReflection || jetShapeType == AliAnalysisTaskHFEECorrelators::kTrueDet || jetShapeType == AliAnalysisTaskHFEECorrelators::kDet){ + AliHFTrackContainer* trackContDet = new AliHFTrackContainer(ntracksDet); + task->AdoptParticleContainer(trackContDet); + AliMCParticleContainer* trackContTrue = new AliHFAODMCParticleContainer(ntracksTrue); + trackContTrue->SetEtaLimits(-1.5, 1.5); + trackContTrue->SetPtLimits(0, 1000); + task->AdoptParticleContainer(trackContTrue); + } + else if (jetShapeType == AliAnalysisTaskHFEECorrelators::kTrue){ + AliMCParticleContainer* trackContTrue = new AliHFAODMCParticleContainer(ntracksTrue); + trackContTrue->SetEtaLimits(-1.5, 1.5); + trackContTrue->SetPtLimits(0, 1000); + task->AdoptParticleContainer(trackContTrue); + } + + + + + task->SetUseAliAnaUtils(kFALSE); + + mgr->AddTask(task); + + //Connnect input + mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer() ); + + //Connect output + TString contName1(wagonName1); + TString contName2(wagonName2); + TString contName3(wagonName3); + + contName2 += "_Splittings"; + + + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kData){ + contName1 += "_Data"; + contName2 += "_Data"; + contName3 += "_Data"; + } + + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDetSignal){ + contName1 += "_DetSignal"; + contName2 += "_DetSignal"; + contName3 += "_DetSignal"; + } + + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDetBackground){ + contName1 += "_DetBackground"; + contName2 += "_DetBackground"; + contName3 += "_DetBackground"; + } + + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDetReflection){ + contName1 += "_DetReflection"; + contName2 += "_DetReflection"; + contName3 += "_DetReflection"; + } + + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kTrueDet){ + contName1 += "_TrueDet"; + contName2 += "_TrueDet"; + contName3 += "_TrueDet"; + } + + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kTrue){ + contName1 += "_True"; + contName2 += "_True"; + contName3 += "_True"; + } + if (IncludeInclusive){ + contName1 += "_Inclusive"; + contName2 += "_Inclusive"; + contName3 += "_Inclusive"; + } + + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDataInclusive){ + contName1 += "_DataInclusive"; + contName2 += "_DataInclusive"; + contName3 += "_DataInclusive"; + } + + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDet){ + contName1 += "_Det"; + contName2 += "_Det"; + contName3 += "_Det"; + } + + + TString outputfile = Form("%s",AliAnalysisManager::GetCommonFileName()); + AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contName1.Data(), TList::Class(),AliAnalysisManager::kOutputContainer,outputfile); + mgr->ConnectOutput(task,1,coutput1); + AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(contName2.Data(), TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile); + mgr->ConnectOutput(task,2,coutput2); + AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(contName3.Data(), TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile); + mgr->ConnectOutput(task,3,coutput3); + + return task; + +} \ No newline at end of file From d7dc65259946b6d1f5fd4b202d70072f0b7ac91b Mon Sep 17 00:00:00 2001 From: Panos Christakoglou Date: Wed, 19 Apr 2023 14:44:53 +0200 Subject: [PATCH 25/51] Adding the booking --- PWG/FLOW/Base/AliFlowAnalysisWithMixedHarmonics.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWG/FLOW/Base/AliFlowAnalysisWithMixedHarmonics.cxx b/PWG/FLOW/Base/AliFlowAnalysisWithMixedHarmonics.cxx index 57297065694..55ab5ef1373 100644 --- a/PWG/FLOW/Base/AliFlowAnalysisWithMixedHarmonics.cxx +++ b/PWG/FLOW/Base/AliFlowAnalysisWithMixedHarmonics.cxx @@ -1014,6 +1014,7 @@ void AliFlowAnalysisWithMixedHarmonics::BookAllAllEventQuantities() this->BookDefault(); if(fCalculateVsM){this->BookVsM();} + if(fCalculateVsZDC){this->BookVsZDC();} if(fEvaluateDifferential3pCorrelator){this->BookDifferential();} } // end of void AliFlowAnalysisWithMixedHarmonics::BookAllAllEventQuantities() From a714aab5ac67cd0120397936d6b070f0c07388f1 Mon Sep 17 00:00:00 2001 From: echizzal Date: Wed, 19 Apr 2023 16:39:22 +0200 Subject: [PATCH 26/51] Pair cleaner on pair level --- .../FemtoDream/AliFemtoDreamCollConfig.cxx | 4 ++++ .../FemtoDream/AliFemtoDreamCollConfig.h | 9 ++++++- .../FemtoDream/AliFemtoDreamControlSample.cxx | 16 +++++++++++++ .../FemtoDream/AliFemtoDreamControlSample.h | 3 ++- .../AliFemtoDreamHigherPairMath.cxx | 24 +++++++++++++++++++ .../FemtoDream/AliFemtoDreamHigherPairMath.h | 2 ++ .../AliFemtoDreamZVtxMultContainer.cxx | 4 ++++ .../macros/AddTaskAnyCharmingFemto_og.C | 10 ++++++-- 8 files changed, 68 insertions(+), 4 deletions(-) diff --git a/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamCollConfig.cxx b/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamCollConfig.cxx index 1fc2b4785c9..8ddd6e5f95f 100644 --- a/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamCollConfig.cxx +++ b/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamCollConfig.cxx @@ -49,6 +49,7 @@ AliFemtoDreamCollConfig::AliFemtoDreamCollConfig() fDeltaEtaMax(0.f), fDeltaPhiMax(0.f), fDoDeltaEtaDeltaPhiCut(false), + fRejectMotherDaughter(false), fCoutVariables(false), fSummedPtLimit1(0.0), fSummedPtLimit2(999.0) { @@ -98,6 +99,7 @@ AliFemtoDreamCollConfig::AliFemtoDreamCollConfig( fDeltaEtaMax(config.fDeltaEtaMax), fDeltaPhiMax(config.fDeltaPhiMax), fDoDeltaEtaDeltaPhiCut(config.fDoDeltaEtaDeltaPhiCut), + fRejectMotherDaughter(config.fRejectMotherDaughter), fCoutVariables(config.fCoutVariables), fSummedPtLimit1(config.fSummedPtLimit1), fSummedPtLimit2(config.fSummedPtLimit2) { @@ -147,6 +149,7 @@ AliFemtoDreamCollConfig::AliFemtoDreamCollConfig(const char *name, fDeltaEtaMax(0.f), fDeltaPhiMax(0.f), fDoDeltaEtaDeltaPhiCut(false), + fRejectMotherDaughter(false), fCoutVariables(QACouts), fSummedPtLimit1(0.0), fSummedPtLimit2(999.0) { @@ -195,6 +198,7 @@ AliFemtoDreamCollConfig& AliFemtoDreamCollConfig::operator=( this->fDeltaEtaMax = config.fDeltaEtaMax; this->fDeltaPhiMax = config.fDeltaPhiMax; this->fDoDeltaEtaDeltaPhiCut = config.fDoDeltaEtaDeltaPhiCut; + this->fRejectMotherDaughter = config.fRejectMotherDaughter; this->fCoutVariables = config.fCoutVariables; this->fSummedPtLimit1 = config.fSummedPtLimit1; this->fSummedPtLimit2 = config.fSummedPtLimit2; diff --git a/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamCollConfig.h b/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamCollConfig.h index 98e46a05e3d..c1dbd8fbf56 100644 --- a/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamCollConfig.h +++ b/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamCollConfig.h @@ -294,6 +294,12 @@ class AliFemtoDreamCollConfig : public TNamed { bool GetDoDeltaEtaDeltaPhiCut() const { return fDoDeltaEtaDeltaPhiCut; } + void RejectMotherDaughter(bool doIt){ + fRejectMotherDaughter = doIt; + } + bool GetRejectMotherDaughter() const { + return fRejectMotherDaughter; + } void SetSummedPtCut(float limit1, float limit2){ fSummedPtLimit1 = limit1; fSummedPtLimit2 = limit2; @@ -350,10 +356,11 @@ class AliFemtoDreamCollConfig : public TNamed { float fDeltaEtaMax; // float fDeltaPhiMax; // bool fDoDeltaEtaDeltaPhiCut; // + bool fRejectMotherDaughter; // bool fCoutVariables; float fSummedPtLimit1; float fSummedPtLimit2; - ClassDef(AliFemtoDreamCollConfig,18); + ClassDef(AliFemtoDreamCollConfig,19); }; #endif /* ALIFEMTODREAMCOLLCONFIG_H_ */ diff --git a/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamControlSample.cxx b/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamControlSample.cxx index 3ef725d1142..6128261f243 100644 --- a/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamControlSample.cxx +++ b/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamControlSample.cxx @@ -19,6 +19,7 @@ AliFemtoDreamControlSample::AliFemtoDreamControlSample() fDeltaEtaMax(0.f), fDeltaPhiMax(0.f), fDoDeltaEtaDeltaPhiCut(false), + fRejectMotherDaughter(false), fMult(0), fCent(0), fSummedPtLimit1(0.0), @@ -40,6 +41,7 @@ AliFemtoDreamControlSample::AliFemtoDreamControlSample( fDeltaEtaMax(samp.fDeltaEtaMax), fDeltaPhiMax(samp.fDeltaPhiMax), fDoDeltaEtaDeltaPhiCut(samp.fDoDeltaEtaDeltaPhiCut), + fRejectMotherDaughter(samp.fRejectMotherDaughter), fMult(samp.fMult), fCent(samp.fCent), fSummedPtLimit1(samp.fSummedPtLimit1), @@ -61,6 +63,7 @@ AliFemtoDreamControlSample::AliFemtoDreamControlSample( fDeltaEtaMax(conf->GetDeltaEtaMax()), fDeltaPhiMax(conf->GetDeltaPhiMax()), fDoDeltaEtaDeltaPhiCut(false), + fRejectMotherDaughter(false), fMult(0), fCent(0), fSummedPtLimit1(conf->GetSummedPtLimit1()), @@ -83,6 +86,7 @@ AliFemtoDreamControlSample& AliFemtoDreamControlSample::operator=( this->fDeltaEtaMax = samp.fDeltaEtaMax; this->fDeltaPhiMax = samp.fDeltaPhiMax; this->fDoDeltaEtaDeltaPhiCut = samp.fDoDeltaEtaDeltaPhiCut; + this->fRejectMotherDaughter = samp.fRejectMotherDaughter; this->fMult = samp.fMult; this->fCent = samp.fCent; this->fSummedPtLimit1 = samp.fSummedPtLimit1; @@ -168,6 +172,10 @@ void AliFemtoDreamControlSample::CorrelatedSample( ++itPart2; continue; } + if (!fHigherMath->PassesMDPairSelection(*itPart1, *itPart2)) { + ++itPart2; + continue; + } RelativeK = fHigherMath->FillSameEvent(HistCounter, fMult, fCent, *itPart1, PDGPart1, *itPart2, PDGPart2,fSummedPtLimit1,fSummedPtLimit2); @@ -226,6 +234,10 @@ void AliFemtoDreamControlSample::PhiSpinning( ++itPart2; continue; } + if (!fHigherMath->PassesMDPairSelection(*itPart1, *itPart2)) { + ++itPart2; + continue; + } for (int i = 0; i < fSpinningDepth; ++i) { // randomized sample - who is the father??? RelativeK = fHigherMath->FillMixedEvent(HistCounter, fMult, fCent, @@ -292,6 +304,10 @@ void AliFemtoDreamControlSample::LimitedPhiSpinning( ++itPart2; continue; } + if (!fHigherMath->PassesMDPairSelection(*(*itPart2), *(*itPart2))) { + ++itPart2; + continue; + } // randomized sample - who is the father??? RelativeK = fHigherMath->FillMixedEvent(HistCounter, fMult, fCent, *(*itPart1), diff --git a/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamControlSample.h b/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamControlSample.h index 4fc3db34277..d7217aa09ee 100644 --- a/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamControlSample.h +++ b/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamControlSample.h @@ -62,11 +62,12 @@ class AliFemtoDreamControlSample { float fDeltaEtaMax; float fDeltaPhiMax; bool fDoDeltaEtaDeltaPhiCut; + bool fRejectMotherDaughter; int fMult; float fCent; float fSummedPtLimit1; float fSummedPtLimit2; - ClassDef(AliFemtoDreamControlSample, 4); + ClassDef(AliFemtoDreamControlSample, 5); }; #endif diff --git a/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamHigherPairMath.cxx b/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamHigherPairMath.cxx index 3ad2f0f69ee..19c574c6615 100644 --- a/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamHigherPairMath.cxx +++ b/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamHigherPairMath.cxx @@ -17,6 +17,7 @@ AliFemtoDreamHigherPairMath::AliFemtoDreamHigherPairMath( fBField(-99.), fRejPairs(conf->GetClosePairRej()), fDoDeltaEtaDeltaPhiCut(conf->GetDoDeltaEtaDeltaPhiCut()), + fRejectMotherDaughter(conf->GetRejectMotherDaughter()), fDeltaPhiSqMax(conf->GetDeltaPhiMax() * conf->GetDeltaPhiMax()), fDeltaEtaSqMax(conf->GetDeltaEtaMax() * conf->GetDeltaEtaMax()), fDeltaPhiEtaMax(conf->GetSqDeltaPhiEtaMax()), @@ -38,6 +39,7 @@ AliFemtoDreamHigherPairMath::AliFemtoDreamHigherPairMath( fBField(-99.), fRejPairs(samp.fRejPairs), fDoDeltaEtaDeltaPhiCut(samp.fDoDeltaEtaDeltaPhiCut), + fRejectMotherDaughter(samp.fRejectMotherDaughter), fDeltaPhiSqMax(samp.fDeltaPhiSqMax), fDeltaEtaSqMax(samp.fDeltaEtaSqMax), fDeltaPhiEtaMax(samp.fDeltaPhiEtaMax), @@ -55,6 +57,7 @@ AliFemtoDreamHigherPairMath& AliFemtoDreamHigherPairMath::operator=( fBField = math.fBField; fRejPairs = math.fRejPairs; fDoDeltaEtaDeltaPhiCut = math.fDoDeltaEtaDeltaPhiCut; + fRejectMotherDaughter = math.fRejectMotherDaughter; fDeltaPhiSqMax = math.fDeltaPhiSqMax; fDeltaEtaSqMax = math.fDeltaEtaSqMax; fDeltaPhiEtaMax = math.fDeltaPhiEtaMax; @@ -83,6 +86,27 @@ bool AliFemtoDreamHigherPairMath::PassesPairSelection( return pass; } +bool AliFemtoDreamHigherPairMath::PassesMDPairSelection( + AliFemtoDreamBasePart& part1, AliFemtoDreamBasePart& part2) { + + bool pass = true; + + if(fRejectMotherDaughter){ + std::vector IDTrack = part1.GetIDTracks(); + std::vector IDDaug = part2.GetIDTracks(); + for (const auto &idt : IDTrack) { + for (const auto &idd : IDDaug) { + if (idt == idd){ + std::cout<<"LALALAL"< fRejPairs; bool fDoDeltaEtaDeltaPhiCut; + bool fRejectMotherDaughter; float fDeltaPhiSqMax; // used for a elliptic cut float fDeltaEtaSqMax; // used for a elliptic cut float fDeltaPhiEtaMax; diff --git a/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamZVtxMultContainer.cxx b/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamZVtxMultContainer.cxx index 05088d819c3..11793af9769 100644 --- a/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamZVtxMultContainer.cxx +++ b/PWGCF/FEMTOSCOPY/FemtoDream/AliFemtoDreamZVtxMultContainer.cxx @@ -110,6 +110,10 @@ void AliFemtoDreamZVtxMultContainer::PairParticlesSE( ++itPart2; continue; } + if (!HigherMath->PassesMDPairSelection(*itPart1, *itPart2)) { + ++itPart2; + continue; + } RelativeK = HigherMath->FillSameEvent(HistCounter, iMult, cent, part1, *itPDGPar1, diff --git a/PWGCF/FEMTOSCOPY/macros/AddTaskAnyCharmingFemto_og.C b/PWGCF/FEMTOSCOPY/macros/AddTaskAnyCharmingFemto_og.C index 379c26be337..f823db2467a 100644 --- a/PWGCF/FEMTOSCOPY/macros/AddTaskAnyCharmingFemto_og.C +++ b/PWGCF/FEMTOSCOPY/macros/AddTaskAnyCharmingFemto_og.C @@ -224,10 +224,16 @@ if (!isMC) { config->SetZBins(ZVtxBins); config->SetMomentumResolution(isMC); - config->SetDeltaEtaMax(0.012); - config->SetDeltaPhiMax(0.012); + // config->SetDeltaEtaMax(0.012); + // config->SetDeltaPhiMax(0.012); config->SetClosePairRejection(closeRejection); + // if (!isMCtruth) { + // config->SetPhiEtaBinnign(suffix == "0" && fullBlastQA); + // } + + config->RejectMotherDaughter(true); + config->SetmTBinning((suffix == "0" && fullBlastQA)); config->SetPtQA((suffix == "0" && fullBlastQA)); config->SetMassQA((suffix == "0" && fullBlastQA)); From 8104e14a4ed9702a4d04f07216e341c114294044 Mon Sep 17 00:00:00 2001 From: Emil Gorm Nielsen Date: Wed, 19 Apr 2023 21:56:28 +0200 Subject: [PATCH 27/51] Added different weigthing procedure in AliPtContainer. Added setter to activate in Deform Task --- PWGCF/FLOW/GF/AliAnalysisTaskDeform.cxx | 66 +++++++++++++++---------- PWGCF/FLOW/GF/AliAnalysisTaskDeform.h | 2 + PWGCF/FLOW/GF/AliPtContainer.cxx | 26 ++++++++++ PWGCF/FLOW/GF/AliPtContainer.h | 1 + 4 files changed, 70 insertions(+), 25 deletions(-) diff --git a/PWGCF/FLOW/GF/AliAnalysisTaskDeform.cxx b/PWGCF/FLOW/GF/AliAnalysisTaskDeform.cxx index 1810eda3fd5..0c0056569e0 100644 --- a/PWGCF/FLOW/GF/AliAnalysisTaskDeform.cxx +++ b/PWGCF/FLOW/GF/AliAnalysisTaskDeform.cxx @@ -155,6 +155,7 @@ AliAnalysisTaskDeform::AliAnalysisTaskDeform(): fUsePIDNUA(kFALSE), fFillMptPowers(kFALSE), fUseMcParticleForEfficiency(kTRUE), + fUseExoticPtCorr(kFALSE), fEventWeight(PtSpace::kOne), wpPt(0), wpPtSubP(0), @@ -273,6 +274,7 @@ AliAnalysisTaskDeform::AliAnalysisTaskDeform(const char *name, Bool_t IsMC, TStr fUsePIDNUA(kFALSE), fFillMptPowers(kFALSE), fUseMcParticleForEfficiency(kTRUE), + fUseExoticPtCorr(kFALSE), fEventWeight(PtSpace::kOne), wpPt(0), wpPtSubP(0), @@ -1223,30 +1225,33 @@ void AliAnalysisTaskDeform::VnMpt(AliAODEvent *fAOD, const Double_t &vz, const D vector pt4corr = fPtCont[0]->getEventCorrelation(4,0); if(pt2corr[1]!=0) { double pt2ev = pt2corr[0]/pt2corr[1]; + double ptev = (fUseExoticPtCorr)?fPtCont[0]->getExoticEventCorrelation(2,1,wpPt[0])/pt2corr[1]:mptev; FillCovariance(fCovariance[10],corrconfigs.at(0),l_Multi,pt2ev,pt2corr[1],l_Random); //v2-pt^2 - FillCovariance(fCovariance[11],corrconfigs.at(0),l_Multi,mptev,pt2corr[1],l_Random); + FillCovariance(fCovariance[11],corrconfigs.at(0),l_Multi,ptev,pt2corr[1],l_Random); FillCovariance(fCovariance[12],corrconfigs.at(0),l_Multi,1,pt2corr[1],l_Random); FillCovariance(fCovariance[22],corrconfigs.at(1),l_Multi,pt2ev,pt2corr[1],l_Random); //v24-pt^2 - FillCovariance(fCovariance[23],corrconfigs.at(1),l_Multi,mptev,pt2corr[1],l_Random); + FillCovariance(fCovariance[23],corrconfigs.at(1),l_Multi,ptev,pt2corr[1],l_Random); FillCovariance(fCovariance[24],corrconfigs.at(1),l_Multi,1,pt2corr[1],l_Random); } if(pt3corr[1]!=0 && pt2corr[1]!=0) { double pt3ev = pt3corr[0]/pt3corr[1]; - double pt2ev = pt2corr[0]/pt2corr[1]; + double pt2ev = (fUseExoticPtCorr)?fPtCont[0]->getExoticEventCorrelation(3,2,wpPt[0])/pt3corr[1]:pt2corr[0]/pt2corr[1]; + double ptev = (fUseExoticPtCorr)?fPtCont[0]->getExoticEventCorrelation(3,1,wpPt[0])/pt3corr[1]:mptev; FillCovariance(fCovariance[13],corrconfigs.at(0),l_Multi,pt3ev,pt3corr[1],l_Random); //v2-pt^3 FillCovariance(fCovariance[14],corrconfigs.at(0),l_Multi,pt2ev,pt3corr[1],l_Random); - FillCovariance(fCovariance[15],corrconfigs.at(0),l_Multi,mptev,pt3corr[1],l_Random); + FillCovariance(fCovariance[15],corrconfigs.at(0),l_Multi,ptev,pt3corr[1],l_Random); FillCovariance(fCovariance[16],corrconfigs.at(0),l_Multi,1,pt3corr[1],l_Random); } if(pt4corr[1]!=0 && pt3corr[1]!=0 && pt2corr[1]!=0) { double pt4ev = pt4corr[0]/pt4corr[1]; - double pt3ev = pt3corr[0]/pt3corr[1]; - double pt2ev = pt2corr[0]/pt2corr[1]; + double pt3ev = (fUseExoticPtCorr)?fPtCont[0]->getExoticEventCorrelation(4,3,wpPt[0])/pt4corr[1]:pt3corr[0]/pt3corr[1]; + double pt2ev = (fUseExoticPtCorr)?fPtCont[0]->getExoticEventCorrelation(4,2,wpPt[0])/pt4corr[1]:pt2corr[0]/pt2corr[1]; + double ptev = (fUseExoticPtCorr)?fPtCont[0]->getExoticEventCorrelation(4,1,wpPt[0])/pt4corr[1]:mptev; FillCovariance(fCovariance[17],corrconfigs.at(0),l_Multi,pt4ev,pt4corr[1],l_Random); //v2-pt^4 FillCovariance(fCovariance[18],corrconfigs.at(0),l_Multi,pt3ev,pt4corr[1],l_Random); FillCovariance(fCovariance[19],corrconfigs.at(0),l_Multi,pt2ev,pt4corr[1],l_Random); - FillCovariance(fCovariance[20],corrconfigs.at(0),l_Multi,mptev,pt4corr[1],l_Random); + FillCovariance(fCovariance[20],corrconfigs.at(0),l_Multi,ptev,pt4corr[1],l_Random); FillCovariance(fCovariance[21],corrconfigs.at(0),l_Multi,1,pt4corr[1],l_Random); } if(fFillMptPowers) { @@ -1345,34 +1350,45 @@ void AliAnalysisTaskDeform::ProcessOnTheFly() { FillCovariance(fCovariance[7],corrconfigs.at(1),l_Cent,1,wp[0],l_Random); FillCovariance(fCovariance[8],corrconfigs.at(2),l_Cent,mptev,wp[0],l_Random); //v26-pt FillCovariance(fCovariance[9],corrconfigs.at(2),l_Cent,1,wp[0],l_Random); - FillCovariance(fCovariance[10],corrconfigs.at(5),l_Cent,mptev,wp[0],l_Random); //v4-pt - FillCovariance(fCovariance[11],corrconfigs.at(5),l_Cent,1,wp[0],l_Random); //Covariance of vn with multi-particle pt-correlation vector pt2corr = fPtCont[0]->getEventCorrelation(2,0); + vector pt3corr = fPtCont[0]->getEventCorrelation(3,0); + vector pt4corr = fPtCont[0]->getEventCorrelation(4,0); if(pt2corr[1]!=0) { double pt2ev = pt2corr[0]/pt2corr[1]; - FillCovariance(fCovariance[12],corrconfigs.at(0),l_Cent,pt2ev,pt2corr[1],l_Random); //v2-pt^2 - FillCovariance(fCovariance[13],corrconfigs.at(0),l_Cent,1,pt2corr[1],l_Random); - FillCovariance(fCovariance[14],corrconfigs.at(3),l_Cent,pt2ev,pt2corr[1],l_Random); //v3-pt^2 - FillCovariance(fCovariance[15],corrconfigs.at(3),l_Cent,1,pt2corr[1],l_Random); + double ptev = (fUseExoticPtCorr)?fPtCont[0]->getExoticEventCorrelation(2,1,wpPt[0])/pt2corr[1]:mptev; + FillCovariance(fCovariance[10],corrconfigs.at(0),l_Cent,pt2ev,pt2corr[1],l_Random); //v2-pt^2 + FillCovariance(fCovariance[11],corrconfigs.at(0),l_Cent,ptev,pt2corr[1],l_Random); + FillCovariance(fCovariance[12],corrconfigs.at(0),l_Cent,1,pt2corr[1],l_Random); + FillCovariance(fCovariance[22],corrconfigs.at(1),l_Cent,pt2ev,pt2corr[1],l_Random); //v24-pt^2 + FillCovariance(fCovariance[23],corrconfigs.at(1),l_Cent,ptev,pt2corr[1],l_Random); + FillCovariance(fCovariance[24],corrconfigs.at(1),l_Cent,1,pt2corr[1],l_Random); } - vector pt3corr = fPtCont[0]->getEventCorrelation(3,0); - if(pt3corr[1]!=0) { + if(pt3corr[1]!=0 && pt2corr[1]!=0) { double pt3ev = pt3corr[0]/pt3corr[1]; - FillCovariance(fCovariance[16],corrconfigs.at(0),l_Cent,pt3ev,pt3corr[1],l_Random); //v2-pt^3 - FillCovariance(fCovariance[17],corrconfigs.at(0),l_Cent,1,pt3corr[1],l_Random); + double pt2ev = (fUseExoticPtCorr)?fPtCont[0]->getExoticEventCorrelation(3,2,wpPt[0])/pt3corr[1]:pt2corr[0]/pt2corr[1]; + double ptev = (fUseExoticPtCorr)?fPtCont[0]->getExoticEventCorrelation(3,1,wpPt[0])/pt3corr[1]:mptev; + FillCovariance(fCovariance[13],corrconfigs.at(0),l_Cent,pt3ev,pt3corr[1],l_Random); //v2-pt^3 + FillCovariance(fCovariance[14],corrconfigs.at(0),l_Cent,pt2ev,pt3corr[1],l_Random); + FillCovariance(fCovariance[15],corrconfigs.at(0),l_Cent,ptev,pt3corr[1],l_Random); + FillCovariance(fCovariance[16],corrconfigs.at(0),l_Cent,1,pt3corr[1],l_Random); } - vector pt4corr = fPtCont[0]->getEventCorrelation(4,0); - if(pt4corr[1]!=0) { + + if(pt4corr[1]!=0 && pt3corr[1]!=0 && pt2corr[1]!=0) { double pt4ev = pt4corr[0]/pt4corr[1]; - FillCovariance(fCovariance[18],corrconfigs.at(0),l_Cent,pt4ev,pt4corr[1],l_Random); //v2-pt^4 - FillCovariance(fCovariance[19],corrconfigs.at(0),l_Cent,1,pt4corr[1],l_Random); + double pt3ev = (fUseExoticPtCorr)?fPtCont[0]->getExoticEventCorrelation(4,3,wpPt[0])/pt4corr[1]:pt3corr[0]/pt3corr[1]; + double pt2ev = (fUseExoticPtCorr)?fPtCont[0]->getExoticEventCorrelation(4,2,wpPt[0])/pt4corr[1]:pt2corr[0]/pt2corr[1]; + double ptev = (fUseExoticPtCorr)?fPtCont[0]->getExoticEventCorrelation(4,1,wpPt[0])/pt4corr[1]:mptev; + FillCovariance(fCovariance[17],corrconfigs.at(0),l_Cent,pt4ev,pt4corr[1],l_Random); //v2-pt^4 + FillCovariance(fCovariance[18],corrconfigs.at(0),l_Cent,pt3ev,pt4corr[1],l_Random); + FillCovariance(fCovariance[19],corrconfigs.at(0),l_Cent,pt2ev,pt4corr[1],l_Random); + FillCovariance(fCovariance[20],corrconfigs.at(0),l_Cent,ptev,pt4corr[1],l_Random); + FillCovariance(fCovariance[21],corrconfigs.at(0),l_Cent,1,pt4corr[1],l_Random); } - //Covariance of vn with powers of mpt if(fFillMptPowers) { - FillCovariance(fCovariancePowerMpt[0],corrconfigs.at(0),l_Cent,mptev*mptev,wp[0]*wp[0],l_Random); - FillCovariance(fCovariancePowerMpt[1],corrconfigs.at(0),l_Cent,mptev*mptev*mptev,wp[0]*wp[0]*wp[0],l_Random); - FillCovariance(fCovariancePowerMpt[2],corrconfigs.at(0),l_Cent,mptev*mptev*mptev*mptev,wp[0]*wp[0]*wp[0]*wp[0],l_Random); + FillCovariance(fCovariancePowerMpt[0],corrconfigs.at(0),l_Cent,mptev*mptev,wp[0]*wp[0],l_Random); + FillCovariance(fCovariancePowerMpt[1],corrconfigs.at(0),l_Cent,mptev*mptev*mptev,wp[0]*wp[0]*wp[0],l_Random); + FillCovariance(fCovariancePowerMpt[2],corrconfigs.at(0),l_Cent,mptev*mptev*mptev*mptev,wp[0]*wp[0]*wp[0]*wp[0],l_Random); } PostData(3,fCovList); return; diff --git a/PWGCF/FLOW/GF/AliAnalysisTaskDeform.h b/PWGCF/FLOW/GF/AliAnalysisTaskDeform.h index 8477a3598bf..488cd23fe41 100644 --- a/PWGCF/FLOW/GF/AliAnalysisTaskDeform.h +++ b/PWGCF/FLOW/GF/AliAnalysisTaskDeform.h @@ -130,6 +130,7 @@ class AliAnalysisTaskDeform : public AliAnalysisTaskSE { void SetUseMcParticleForEfficiency(bool newval) { fUseMcParticleForEfficiency = newval; } void SetFillAdditionalTrackQAPlots(Bool_t newval) { fFillAdditionalQA = newval; } void SetPtMPar(int newval) { fPtMpar = newval; } + void SetUseExoticPtCorr(bool newval) { fUseExoticPtCorr = newval; } protected: AliEventCuts fEventCuts; private: @@ -278,6 +279,7 @@ class AliAnalysisTaskDeform : public AliAnalysisTaskSE { Bool_t fUsePIDNUA; Bool_t fFillMptPowers; Bool_t fUseMcParticleForEfficiency; + Bool_t fUseExoticPtCorr; Double_t *GetBinsFromAxis(TAxis *inax); ClassDef(AliAnalysisTaskDeform,1); diff --git a/PWGCF/FLOW/GF/AliPtContainer.cxx b/PWGCF/FLOW/GF/AliPtContainer.cxx index dafbee7beac..022aec4f67a 100644 --- a/PWGCF/FLOW/GF/AliPtContainer.cxx +++ b/PWGCF/FLOW/GF/AliPtContainer.cxx @@ -180,6 +180,32 @@ vector AliPtContainer::getEventCorrelation(int mOrder, Int_t subIndex) { vector outvec = {fCorr[subIndex][mOrder],fSumw[subIndex][mOrder]}; return outvec; } +double AliPtContainer::getExoticEventCorrelation(int wOrder, int pOrder, const vector> &inarr) { + vector corr; + corr.resize(wOrder+1,0); corr[0] = 1.0; + double sumNum = 0; + vector valNum; + if((wOrder-pOrder)==1){ + for(int k(1);k<=wOrder;++k){ + valNum.push_back(fSign[k-1]*corr[wOrder-k]*(fFactorial[wOrder-1]/fFactorial[wOrder-k])*inarr[k][k-1]); + } + sumNum = OrderedAddition(valNum, wOrder); + valNum.clear(); + } + else if(wOrder>2 && pOrder==1){ + for(int k(1);k<=wOrder;++k){ + valNum.push_back(fSign[k-1]*fSumw[0][wOrder-k]*(fFactorial[wOrder-1]/fFactorial[wOrder-k])*inarr[k][1]); + } + sumNum = OrderedAddition(valNum, wOrder); + valNum.clear(); + } + else if(wOrder==4 && pOrder==2){ + sumNum = inarr[1][1]*inarr[1][1]*inarr[1][0]*inarr[1][0]-inarr[2][2]*inarr[1][0]*inarr[1][0]-inarr[2][0]*inarr[1][1]*inarr[1][1] + +inarr[2][0]*inarr[2][2]-4*inarr[2][1]*inarr[1][1]*inarr[1][0]+4*inarr[3][2]*inarr[1][0] + +4*inarr[3][1]*inarr[1][1]+2*inarr[2][1]*inarr[2][1]-6*inarr[4][2]; + } + return sumNum; +} void AliPtContainer::FillRecursive(const vector> &inarr, Int_t subIndex) { if(subIndex<0||subIndex>2) return; fCorr[subIndex].clear(); fCorr[subIndex].resize(mpar+1,0); fCorr[subIndex][0] = 1.0; diff --git a/PWGCF/FLOW/GF/AliPtContainer.h b/PWGCF/FLOW/GF/AliPtContainer.h index 44c1c03fa1f..fa0abfc89cf 100644 --- a/PWGCF/FLOW/GF/AliPtContainer.h +++ b/PWGCF/FLOW/GF/AliPtContainer.h @@ -35,6 +35,7 @@ class AliPtContainer: public TNamed { void FillRecursive(const vector> &inarr, Int_t subIndex = 0); void FillRecursiveProfiles(const Double_t &lMult, const Double_t &rn); vector getEventCorrelation(Int_t mOrder, Int_t subIndex = 0); + double getExoticEventCorrelation(int wOrder, int pOrder, const vector> &inarr); TList* GetCkList() { return fCkTermList; } TList* GetSkewList() { return fSkewTermList; } TList* GetKurtosisList() { return fKurtosisTermList; } From 0cd86c5d5b5b9208fc479a6747a2122c6540c52c Mon Sep 17 00:00:00 2001 From: maciacco Date: Thu, 20 Apr 2023 12:31:14 +0200 Subject: [PATCH 28/51] add variation of tpc cls and chi2 cut --- .../AliAnalysisTaskKaonXiCorrelation.cxx | 8 ++++++-- .../AliAnalysisTaskKaonXiCorrelation.h | 12 ++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/PWGLF/STRANGENESS/KaonXiCorrelation/AliAnalysisTaskKaonXiCorrelation.cxx b/PWGLF/STRANGENESS/KaonXiCorrelation/AliAnalysisTaskKaonXiCorrelation.cxx index 08280906678..47e192b654a 100644 --- a/PWGLF/STRANGENESS/KaonXiCorrelation/AliAnalysisTaskKaonXiCorrelation.cxx +++ b/PWGLF/STRANGENESS/KaonXiCorrelation/AliAnalysisTaskKaonXiCorrelation.cxx @@ -213,8 +213,8 @@ void AliAnalysisTaskKaonXiCorrelation::UserExec(Option_t *) !(aodTrack->GetStatus() & AliVTrack::kITSrefit) || std::abs(Eta2y(aodTrack->Pt(), kKaonMass, aodTrack->Eta())) > fCutY || std::abs(aodTrack->Eta()) > 0.8 || - aodTrack->Chi2perNDF() > fCutMaxChi2 || - aodTrack->GetTPCsignalN() < fCutTPCclsKaon || + aodTrack->Chi2perNDF() > fCutChi2[2] || + aodTrack->GetTPCsignalN() < fCutTPCcls[2] || aodTrack->GetITSchi2() > fCutMaxITSChi2 || nITS < fCutITSrecPoints || nSPD < fCutSPDrecPoints || @@ -257,6 +257,10 @@ void AliAnalysisTaskKaonXiCorrelation::UserExec(Option_t *) fKaon->fCutBitMap = 0u; if (dcaMag < fCutDCA[0]) fKaon->fCutBitMap |= kDCAtightCut; else if (dcaMag < fCutDCA[1]) fKaon->fCutBitMap |= kDCAmidCut; + if (aodTrack->GetTPCsignalN() < fCutTPCcls[0]) fKaon->fCutBitMap |= kTPCclsTightCut; + else if (aodTrack->GetTPCsignalN() < fCutTPCcls[1]) fKaon->fCutBitMap |= kTPCclsMidCut; + if (aodTrack->Chi2perNDF() < fCutChi2[0]) fKaon->fCutBitMap |= kChi2TightCut; + else if (aodTrack->Chi2perNDF() < fCutChi2[1]) fKaon->fCutBitMap |= kChi2MidCut; if (!fMC) fRecKaons.push_back(*fKaon); diff --git a/PWGLF/STRANGENESS/KaonXiCorrelation/AliAnalysisTaskKaonXiCorrelation.h b/PWGLF/STRANGENESS/KaonXiCorrelation/AliAnalysisTaskKaonXiCorrelation.h index 4229f0b90f1..96b983b03c6 100644 --- a/PWGLF/STRANGENESS/KaonXiCorrelation/AliAnalysisTaskKaonXiCorrelation.h +++ b/PWGLF/STRANGENESS/KaonXiCorrelation/AliAnalysisTaskKaonXiCorrelation.h @@ -83,8 +83,12 @@ class AliAnalysisTaskKaonXiCorrelation : public AliAnalysisTaskSE { }; enum kCutFlag { - kDCAtightCut = BIT(0), // 0.05 cm - kDCAmidCut = BIT(1) // 0.1 cm + kDCAtightCut = BIT(0), // 0.05 cm + kDCAmidCut = BIT(1), // 0.1 cm + kTPCclsTightCut = BIT(2),// 80 + kTPCclsMidCut = BIT(3), // 70 + kChi2TightCut = BIT(4), // 2 + kChi2MidCut = BIT(5) // 2.5 }; enum kReducedTrigger @@ -154,6 +158,8 @@ class AliAnalysisTaskKaonXiCorrelation : public AliAnalysisTaskSE { void SetMaxChi2Cut(double cut = 4.) { fCutMaxChi2 = cut; } void SetMaxITSChi2Cut(double cut = 36.) { fCutMaxITSChi2 = cut; } void SetDCACut(double cutTight = .05, double cutMid = .1, double cutLoose = .5) { fCutDCA[0] = cutTight; fCutDCA[1] = cutMid; fCutDCA[2] = cutLoose; } + void SetTPCclsCut(int cutTight = 80, int cutMid = 70, int cutLoose = 60) { fCutTPCcls[0] = cutTight; fCutTPCcls[1] = cutMid; fCutTPCcls[2] = cutLoose; } + void SetChi2Cut(double cutTight = 2., double cutMid = 2.5, double cutLoose = 3.) { fCutChi2[0] = cutTight; fCutChi2[1] = cutMid; fCutChi2[2] = cutLoose; } void SetMaxPtKaon(double cut = 1.5) { fMaxPtKaon = cut; } void SetPtTofCut(double cut = 0.5) { fPtTofCut = cut; } void SetCutPtITSpid(double pt = 0.5) { fCutPtITSpid = pt; } @@ -243,6 +249,8 @@ class AliAnalysisTaskKaonXiCorrelation : public AliAnalysisTaskSE { float fCutMaxChi2 = 2.5; float fCutMaxITSChi2 = 36.; float fCutDCA[3] = {0.05, 0.1, 0.5}; + int fCutTPCcls[3] = {80, 70, 60}; + float fCutChi2[3] = {2, 2.5, 3}; double fCutKaonNsigmaTPC = 5.; double fCutKaonNsigmaTOF = 5.; double fCutKaonNsigmaITS = 5.; From d0449037dce219651562ccaa2f37ea318b9fad6d Mon Sep 17 00:00:00 2001 From: Gustavo Conesa Date: Thu, 20 Apr 2023 12:05:47 +0200 Subject: [PATCH 29/51] reset dist to bad cut in case multiple cut analysis --- .../macros/ConfigureCaloTrackCorrAnalysis.C | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/PWGGA/CaloTrackCorrelations/macros/ConfigureCaloTrackCorrAnalysis.C b/PWGGA/CaloTrackCorrelations/macros/ConfigureCaloTrackCorrAnalysis.C index 787e84b282d..de20ff7e4b4 100644 --- a/PWGGA/CaloTrackCorrelations/macros/ConfigureCaloTrackCorrAnalysis.C +++ b/PWGGA/CaloTrackCorrelations/macros/ConfigureCaloTrackCorrAnalysis.C @@ -770,8 +770,14 @@ AliAnaPhoton* ConfigurePhotonAnalysis(TString col, Bool_t simulation, ana->SetMaxEnergy(1000); ana->SetMinDistanceToBadChannel(2, 4, 5); // could have been already applied at reader level if ( kAnaCaloTrackCorr.Contains("DistToBadOff") ) + { ana->SetMinDistanceToBadChannel(0, 2, 4); + // Bad map open in reader, closed in analysis + if ( kAnaCutsString.Contains("DistToBadOn") ) + ana->SetMinDistanceToBadChannel(2, 4, 6); + } + ana->SetTimeCut(-1e10,1e10); // open cut } else @@ -782,9 +788,22 @@ AliAnaPhoton* ConfigurePhotonAnalysis(TString col, Bool_t simulation, ana->SetTimeCut(-1e10,1e10); // open cut, usual time window of [425-825] ns if time recalibration is off // restrict to less than 100 ns when time calibration is on ana->SetMinDistanceToBadChannel(2, 4, 6); // could have been already applied at reader level + if ( kAnaCaloTrackCorr.Contains("DistToBadOff") ) + { ana->SetMinDistanceToBadChannel(0, 2, 4); + // Bad map open in reader, closed in analysis + if ( kAnaCaloTrackCorr.Contains("DistToBadOff") ) + { + ana->SetMinDistanceToBadChannel(0, 2, 4); + + // Bad map open in reader, closed in analysis + if ( kAnaCutsString.Contains("DistToBadOn") ) + ana->SetMinDistanceToBadChannel(2, 4, 6); + } + } + if ( kAnaCutsString.Contains("ExoCut") ) { if ( kAnaCutsString.Contains("ExoCut0.97") ) ana->SetExoCut(0.97); @@ -2359,6 +2378,9 @@ void ConfigureCaloTrackCorrAnalysis if ( analysisString.Contains("DistToBadOff") && !kAnaCaloTrackCorr.Contains("DistToBadOff") ) kAnaCaloTrackCorr+= "_DistToBadOff"; + if ( analysisString.Contains("DistToBadOn") && kAnaCaloTrackCorr.Contains("DistToBadOff") ) + kAnaCaloTrackCorr+= "_DistToBadOn"; + if ( analysisString.Contains("ExoCut") ) kAnaCaloTrackCorr+= "_ExoCut"; From 15c10d8117868a6d0be88cac5cbae5faf127045b Mon Sep 17 00:00:00 2001 From: Gustavo Conesa Date: Thu, 20 Apr 2023 13:08:25 +0200 Subject: [PATCH 30/51] fix multiple UE region and gap estimation configuration and additional exo cut and fix to disttobad --- .../AddTaskMultipleTrackCutIsoConeAnalysis.C | 89 +++++++++++-------- 1 file changed, 52 insertions(+), 37 deletions(-) diff --git a/PWGGA/CaloTrackCorrelations/macros/AddTaskMultipleTrackCutIsoConeAnalysis.C b/PWGGA/CaloTrackCorrelations/macros/AddTaskMultipleTrackCutIsoConeAnalysis.C index b50289820f1..1f182cff18b 100644 --- a/PWGGA/CaloTrackCorrelations/macros/AddTaskMultipleTrackCutIsoConeAnalysis.C +++ b/PWGGA/CaloTrackCorrelations/macros/AddTaskMultipleTrackCutIsoConeAnalysis.C @@ -45,8 +45,8 @@ R__ADD_INCLUDE_PATH($ALICE_PHYSICS) /// \param clustersArray : A string with the array of clusters not being the default (default is empty string) /// \param gloCutsString : A string with list of global cuts/parameters (activate pile-up ...) /// \param nonLinOn : A bool to set the use of the non linearity correction -/// \param analysisString : String that contains what analysis to activate, options: Photon, DecayPi0, MergedPi0, Charged, QA, Isolation, Correlation, Generator -/// \param exoCut : A float setting the exoticity cut, set only if tighter than in reader +/// \param analysisString : String that contains what analysis to activate, options: Photon, DecayPi0, MergedPi0, Charged, QA, Isolation, Correlation, Generator. Also different options to tell the framework to do different cut variation: -DistToBadOff- or -DistToBadOn- (will do the opposite once, check reader setting); -MultiIso- +: -IsoBandUEGap-, activate different UE gaps and r_min in isolation, and -UEAreas-, activate UE estimation by different bands in isolation. +/// \param exoCut : A float telling the default exoticity cut, and variate depending it to 0.93, 0.95, 0.97 /// \param doNLM: loose NLM cut, 3, 4, open /// \param doQA: add basic QA task /// \param doCharged: add basic Charged particle task @@ -57,7 +57,7 @@ R__ADD_INCLUDE_PATH($ALICE_PHYSICS) /// \param isoMethod : An int setting the isolation method: AliIsolationCut::kPtThresIC, ... /// \param isoContent : An int setting the type of particles inside the isolation cone: AliIsolationCut::kNeutralAndCharged, AliIsolationCut::kOnlyNeutral, AliIsolationCut::kOnlyCharged /// \param leading : An int setting the type of leading particle selection: 0, select all;l 1: absolute leading of charged; 2: absolute leading of charged and neutral; 3: near side leading absolute of charged; 4: near side leading absolute of charged and neutral -/// \param tmFix: default TM option, except in dedicated variation +/// \param tmFix: default TM option, except in dedicated variation. -1 no variation. /// \param minCen : An int to select the minimum centrality, -1 means no selection /// \param maxCen : An int to select the maximum centrality, -1 means no selection /// \param mixOn : A bool to switch the correlation mixing analysis @@ -151,32 +151,61 @@ AliAnalysisTaskCaloTrackCorrelation * AddTaskMultipleTrackCutIsoConeAnalysis else tmFix = 0; // Do only no TM // Analysis with open bad distance, fixed min cone distance and track match default option - TString histoString = Form("TM%d",tmFix); + TString histoStringB = Form("TM%d",tmFix); TString analysisString2 = analysisString; if ( analysisString2.Contains("DistToBadOn") ) + { analysisString2.ReplaceAll("DistToBadOn","DistToBadOff"); + histoStringB += "_DistToBadOff"; + } if ( !analysisString2.Contains("DistToBad") ) - histoString += "_DistToBadOff"; + histoStringB += "_DistToBadOff"; if ( analysisString.Contains("DistToBadOff") ) + { analysisString2.ReplaceAll("DistToBadOff","DistToBadOn"); + histoStringB += "_DistToBadOn"; + } ConfigureCaloTrackCorrAnalysis - ( anaList, calorimeter, simulation, year, col, analysisString2, histoString, + ( anaList, calorimeter, simulation, year, col, analysisString2, histoStringB, shshMax, isoCone, rMinFix, isoPtTh, isoMethod, isoContent, leading, tmFix, mixOn, printSettings, debug); - // Analysis with tighter exoticity, fixed min cone distance and track match option + // Analysis with tighter and/or looser exoticity, fixed min cone distance and track match option if ( exoCut < 1 ) { - TString histoString = Form("TM%d_ExoCut%0.2f",tmFix,exoCut); + if ( exoCut < 0.97 ) + { + TString histoStringExo = Form("TM%d_ExoCut0.97",tmFix); - ConfigureCaloTrackCorrAnalysis - ( anaList, calorimeter, simulation, year, col, analysisString+Form("_ExoCut%0.2f",exoCut), histoString, - shshMax, isoCone, rMinFix, isoPtTh, isoMethod, isoContent, - leading, tmFix, mixOn, printSettings, debug); + ConfigureCaloTrackCorrAnalysis + ( anaList, calorimeter, simulation, year, col, analysisString+"_ExoCut0.97", histoStringExo, + shshMax, isoCone, rMinFix, isoPtTh, isoMethod, isoContent, + leading, tmFix, mixOn, printSettings, debug); + } + + if ( exoCut > 0.955 || exoCut < 0.945 ) + { + TString histoStringExo = Form("TM%d_ExoCut0.95",tmFix); + + ConfigureCaloTrackCorrAnalysis + ( anaList, calorimeter, simulation, year, col, analysisString+"_ExoCut0.93", histoStringExo, + shshMax, isoCone, rMinFix, isoPtTh, isoMethod, isoContent, + leading, tmFix, mixOn, printSettings, debug); + } + + if ( exoCut > 0.93 ) + { + TString histoStringExo = Form("TM%d_ExoCut0.93",tmFix); + + ConfigureCaloTrackCorrAnalysis + ( anaList, calorimeter, simulation, year, col, analysisString+"_ExoCut0.93", histoStringExo, + shshMax, isoCone, rMinFix, isoPtTh, isoMethod, isoContent, + leading, tmFix, mixOn, printSettings, debug); + } } // Analysis with looser nlm cut, fixed min cone distance and track match option @@ -198,44 +227,30 @@ AliAnalysisTaskCaloTrackCorrelation * AddTaskMultipleTrackCutIsoConeAnalysis // Default analysis settings // - histoString = Form("TM%d",tmFix); + TString histoString = Form("TM%d",tmFix); analysisString2 = analysisString; // Analysis with different UE estimation size region - if ( analysisString.Contains("IsoBandUEGap") ) + if ( analysisString.Contains("MultiIso") ) { - histoString = Form("TM%d_MultiIsoRAndGaps",tmFix); - - if ( analysisString.Contains("MultiIsoR") ) - analysisString2.ReplaceAll("MultiIsoR","MultiIsoRAndGaps"); - else - analysisString2+="_MultiIsoRAndGaps"; - - if(analysisString.Contains("UESubMethods")) - analysisString2.ReplaceAll("UESubMethods",""); - + histoString+="_MultiIso"; + if ( analysisString.Contains("IsoBandUEGap") ) + { + analysisString2+="AndGap"; + } } - // Default cuts analysis but multi Gap and r min if specified + // Default cuts analysis but multi Gap and r min ConfigureCaloTrackCorrAnalysis ( anaList, calorimeter, simulation, year, col, analysisString2, histoString, shshMax, isoCone, rMinFix, isoPtTh, isoMethod, isoContent, leading, tmFix, mixOn, printSettings, debug); - if ( analysisString.Contains("UESubMethods") ) + // Default cuts analysis but multi UE methods if specified + if ( analysisString.Contains("MultiIso") && analysisString.Contains("UEAreas") ) { - TString analysisString2 = analysisString; - histoString = Form("TM%d_MultiUESub",tmFix); - - if ( analysisString.Contains("AndGaps") ) - { - analysisString2.ReplaceAll("AndGaps",""); - analysisString2.ReplaceAll("AndGap" ,""); - } - - // Default cuts analysis but different UE sub methods ConfigureCaloTrackCorrAnalysis - ( anaList, calorimeter, simulation, year, col, analysisString2, histoString, + ( anaList, calorimeter, simulation, year, col, analysisString+"UESubMethods", histoString, shshMax, isoCone, rMinFix, isoPtTh, isoMethod, isoContent, leading, tmFix, mixOn, printSettings, debug); } From e444facd817de8c0f44b39cf3bbcefd2ac228d84 Mon Sep 17 00:00:00 2001 From: Nima Zardoshti Date: Thu, 20 Apr 2023 13:17:46 +0200 Subject: [PATCH 31/51] fixing bug in addtask --- .../macros/AddTaskHFEECorrelators.C | 146 ++++++++---------- 1 file changed, 63 insertions(+), 83 deletions(-) diff --git a/PWGJE/FlavourJetTasks/macros/AddTaskHFEECorrelators.C b/PWGJE/FlavourJetTasks/macros/AddTaskHFEECorrelators.C index db8fe106028..10b4da76880 100644 --- a/PWGJE/FlavourJetTasks/macros/AddTaskHFEECorrelators.C +++ b/PWGJE/FlavourJetTasks/macros/AddTaskHFEECorrelators.C @@ -1,51 +1,38 @@ -AliAnalysisTaskHFEECorrelators* AddTaskHFSubstructure(const char * ntracksData, - const char * ntracksDet, - const char * ntracksTrue, - const Double_t R, - const Double_t CandidateMinPt, - const Double_t CandidateMaxRap, - AliAnalysisTaskHFEECorrelators::ECandidateType_t ECandidateType = AliAnalysisTaskHFEECorrelators::kD0toKpi, - AliAnalysisTaskHFEECorrelators::JetShapeType jetShapeType = AliAnalysisTaskHFEECorrelators::kData, Bool_t IncludeInclusive=kFALSE) { - - - - AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); - if (!mgr) - { - Error("AddTaskHFSubstructure","No analysis manager found."); - return 0; - } - Bool_t ismc=kFALSE; - ismc = (mgr->GetMCtruthEventHandler())?kTRUE:kFALSE; +AliAnalysisTaskHFEECorrelators* AddTaskHFEECorrelators(const char* ntracksData, const char* ntracksDet, const char* ntracksTrue, const Double_t R, const Double_t CandidateMinPt, const Double_t CandidateMaxRap, AliAnalysisTaskHFEECorrelators::ECandidateType_t ECandidateType = AliAnalysisTaskHFEECorrelators::kD0toKpi, AliAnalysisTaskHFEECorrelators::JetShapeType jetShapeType = AliAnalysisTaskHFEECorrelators::kData, Bool_t IncludeInclusive = kFALSE) { + AliAnalysisManager* mgr = AliAnalysisManager::GetAnalysisManager(); + if (!mgr) { + Error("AddTaskHFEECorrelators", "No analysis manager found."); + return 0; + } + Bool_t ismc = kFALSE; + ismc = (mgr->GetMCtruthEventHandler()) ? kTRUE : kFALSE; // Check the analysis type using the event handlers connected to the analysis manager. //============================================================================== - if (!mgr->GetInputEventHandler()) - { - ::Error("AliAnalysisTaskHFEECorrelators", "This task requires an input event handler"); - return NULL; - } - TString wagonName1, wagonName2,wagonName3; - TString tag=""; - if (ECandidateType == AliAnalysisTaskHFEECorrelators::kD0toKpi) tag="kD0toKpi"; - if (jetShapeType==AliAnalysisTaskHFEECorrelators::kData || jetShapeType==AliAnalysisTaskHFEECorrelators::kDataInclusive){ - wagonName1 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%s",ntracksData,tag.Data()); - wagonName2 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTree",ntracksData,tag.Data()); - wagonName3 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTreeSplittings",ntracksData,tag.Data()); - } - if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDetSignal || jetShapeType == AliAnalysisTaskHFEECorrelators::kDetBackground || jetShapeType == AliAnalysisTaskHFEECorrelators::kDetReflection || jetShapeType == AliAnalysisTaskHFEECorrelators::kTrueDet || jetShapeType == AliAnalysisTaskHFEECorrelators::kDet){ - wagonName1 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%s",ntracksDet,tag.Data()); - wagonName2 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTree",ntracksDet,tag.Data()); - wagonName3 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTreeSplittings",ntracksDet,tag.Data()); - } - if (jetShapeType==AliAnalysisTaskHFEECorrelators::kTrue){ - wagonName1 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%s",ntracksTrue,tag.Data()); - wagonName2 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTree",ntracksTrue,tag.Data()); - wagonName3 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTreeSplittings",ntracksTrue,tag.Data()); - } - //Configure jet tagger task - AliAnalysisTaskHFEECorrelators *task = new AliAnalysisTaskHFEECorrelators(wagonName1); - + if (!mgr->GetInputEventHandler()) { + ::Error("AliAnalysisTaskHFEECorrelators", "This task requires an input event handler"); + return NULL; + } + TString wagonName1, wagonName2, wagonName3; + TString tag = ""; + if (ECandidateType == AliAnalysisTaskHFEECorrelators::kD0toKpi) tag = "kD0toKpi"; + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kData || jetShapeType == AliAnalysisTaskHFEECorrelators::kDataInclusive) { + wagonName1 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%s", ntracksData, tag.Data()); + wagonName2 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTree", ntracksData, tag.Data()); + wagonName3 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTreeSplittings", ntracksData, tag.Data()); + } + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDetSignal || jetShapeType == AliAnalysisTaskHFEECorrelators::kDetBackground || jetShapeType == AliAnalysisTaskHFEECorrelators::kDetReflection || jetShapeType == AliAnalysisTaskHFEECorrelators::kTrueDet || jetShapeType == AliAnalysisTaskHFEECorrelators::kDet) { + wagonName1 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%s", ntracksDet, tag.Data()); + wagonName2 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTree", ntracksDet, tag.Data()); + wagonName3 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTreeSplittings", ntracksDet, tag.Data()); + } + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kTrue) { + wagonName1 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%s", ntracksTrue, tag.Data()); + wagonName2 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTree", ntracksTrue, tag.Data()); + wagonName3 = Form("AliAnalysisTaskHFEECorrelators_%s_TC%sTreeSplittings", ntracksTrue, tag.Data()); + } + // Configure jet tagger task + AliAnalysisTaskHFEECorrelators* task = new AliAnalysisTaskHFEECorrelators(wagonName1); task->SetECandidateType_t(ECandidateType); task->SetJetShapeType(jetShapeType); @@ -55,15 +42,14 @@ AliAnalysisTaskHFEECorrelators* AddTaskHFSubstructure(const char * ntracksData, task->SetCandidateMaxY(CandidateMaxRap); // AliParticleContainer *trackContData=0x0; //why not track containers? - //AliParticleContainer *trackContDet=0x0; - //AliParticleContainer *trackContTrue=0x0; - + // AliParticleContainer *trackContDet=0x0; + // AliParticleContainer *trackContTrue=0x0; - if (jetShapeType == AliAnalysisTaskHFEECorrelators::kData || jetShapeType == AliAnalysisTaskHFEECorrelators::kDataInclusive){ + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kData || jetShapeType == AliAnalysisTaskHFEECorrelators::kDataInclusive) { AliHFTrackContainer* trackContData = new AliHFTrackContainer(ntracksData); task->AdoptParticleContainer(trackContData); } - else if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDetSignal || jetShapeType == AliAnalysisTaskHFEECorrelators::kDetBackground || jetShapeType == AliAnalysisTaskHFEECorrelators::kDetReflection || jetShapeType == AliAnalysisTaskHFEECorrelators::kTrueDet || jetShapeType == AliAnalysisTaskHFEECorrelators::kDet){ + else if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDetSignal || jetShapeType == AliAnalysisTaskHFEECorrelators::kDetBackground || jetShapeType == AliAnalysisTaskHFEECorrelators::kDetReflection || jetShapeType == AliAnalysisTaskHFEECorrelators::kTrueDet || jetShapeType == AliAnalysisTaskHFEECorrelators::kDet) { AliHFTrackContainer* trackContDet = new AliHFTrackContainer(ntracksDet); task->AdoptParticleContainer(trackContDet); AliMCParticleContainer* trackContTrue = new AliHFAODMCParticleContainer(ntracksTrue); @@ -71,93 +57,87 @@ AliAnalysisTaskHFEECorrelators* AddTaskHFSubstructure(const char * ntracksData, trackContTrue->SetPtLimits(0, 1000); task->AdoptParticleContainer(trackContTrue); } - else if (jetShapeType == AliAnalysisTaskHFEECorrelators::kTrue){ + else if (jetShapeType == AliAnalysisTaskHFEECorrelators::kTrue) { AliMCParticleContainer* trackContTrue = new AliHFAODMCParticleContainer(ntracksTrue); trackContTrue->SetEtaLimits(-1.5, 1.5); trackContTrue->SetPtLimits(0, 1000); task->AdoptParticleContainer(trackContTrue); } - - - task->SetUseAliAnaUtils(kFALSE); mgr->AddTask(task); - - //Connnect input - mgr->ConnectInput (task, 0, mgr->GetCommonInputContainer() ); - //Connect output + // Connnect input + mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); + + // Connect output TString contName1(wagonName1); TString contName2(wagonName2); TString contName3(wagonName3); - + contName2 += "_Splittings"; - - if (jetShapeType == AliAnalysisTaskHFEECorrelators::kData){ + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kData) { contName1 += "_Data"; contName2 += "_Data"; contName3 += "_Data"; } - if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDetSignal){ + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDetSignal) { contName1 += "_DetSignal"; contName2 += "_DetSignal"; contName3 += "_DetSignal"; } - - if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDetBackground){ + + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDetBackground) { contName1 += "_DetBackground"; contName2 += "_DetBackground"; contName3 += "_DetBackground"; } - - if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDetReflection){ + + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDetReflection) { contName1 += "_DetReflection"; contName2 += "_DetReflection"; contName3 += "_DetReflection"; } - - if (jetShapeType == AliAnalysisTaskHFEECorrelators::kTrueDet){ + + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kTrueDet) { contName1 += "_TrueDet"; contName2 += "_TrueDet"; contName3 += "_TrueDet"; } - - if (jetShapeType == AliAnalysisTaskHFEECorrelators::kTrue){ + + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kTrue) { contName1 += "_True"; contName2 += "_True"; contName3 += "_True"; } - if (IncludeInclusive){ + if (IncludeInclusive) { contName1 += "_Inclusive"; contName2 += "_Inclusive"; contName3 += "_Inclusive"; } - if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDataInclusive){ + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDataInclusive) { contName1 += "_DataInclusive"; contName2 += "_DataInclusive"; contName3 += "_DataInclusive"; } - if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDet){ + if (jetShapeType == AliAnalysisTaskHFEECorrelators::kDet) { contName1 += "_Det"; contName2 += "_Det"; contName3 += "_Det"; } + TString outputfile = Form("%s", AliAnalysisManager::GetCommonFileName()); + AliAnalysisDataContainer* coutput1 = mgr->CreateContainer(contName1.Data(), TList::Class(), AliAnalysisManager::kOutputContainer, outputfile); + mgr->ConnectOutput(task, 1, coutput1); + AliAnalysisDataContainer* coutput2 = mgr->CreateContainer(contName2.Data(), TTree::Class(), AliAnalysisManager::kOutputContainer, outputfile); + mgr->ConnectOutput(task, 2, coutput2); + AliAnalysisDataContainer* coutput3 = mgr->CreateContainer(contName3.Data(), TTree::Class(), AliAnalysisManager::kOutputContainer, outputfile); + mgr->ConnectOutput(task, 3, coutput3); - TString outputfile = Form("%s",AliAnalysisManager::GetCommonFileName()); - AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contName1.Data(), TList::Class(),AliAnalysisManager::kOutputContainer,outputfile); - mgr->ConnectOutput(task,1,coutput1); - AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(contName2.Data(), TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile); - mgr->ConnectOutput(task,2,coutput2); - AliAnalysisDataContainer *coutput3 = mgr->CreateContainer(contName3.Data(), TTree::Class(),AliAnalysisManager::kOutputContainer,outputfile); - mgr->ConnectOutput(task,3,coutput3); - - return task; - + return task; } \ No newline at end of file From 0827d739e30a4324490ab10037cb9fb404bbf1fc Mon Sep 17 00:00:00 2001 From: Gustavo Conesa Date: Thu, 20 Apr 2023 13:38:27 +0200 Subject: [PATCH 32/51] fix multiple UE methods histo string and add jet median case --- .../macros/AddTaskMultipleTrackCutIsoConeAnalysis.C | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/PWGGA/CaloTrackCorrelations/macros/AddTaskMultipleTrackCutIsoConeAnalysis.C b/PWGGA/CaloTrackCorrelations/macros/AddTaskMultipleTrackCutIsoConeAnalysis.C index 1f182cff18b..144fc234f25 100644 --- a/PWGGA/CaloTrackCorrelations/macros/AddTaskMultipleTrackCutIsoConeAnalysis.C +++ b/PWGGA/CaloTrackCorrelations/macros/AddTaskMultipleTrackCutIsoConeAnalysis.C @@ -249,8 +249,11 @@ AliAnalysisTaskCaloTrackCorrelation * AddTaskMultipleTrackCutIsoConeAnalysis // Default cuts analysis but multi UE methods if specified if ( analysisString.Contains("MultiIso") && analysisString.Contains("UEAreas") ) { + if(analysisString.Contains("UEAreasWithJet")) + isoPtTh = AliIsolationCut::kSumBkgSubJetRhoIC; // Make sure jet median output is checked + ConfigureCaloTrackCorrAnalysis - ( anaList, calorimeter, simulation, year, col, analysisString+"UESubMethods", histoString, + ( anaList, calorimeter, simulation, year, col, analysisString+"UESubMethods", histoString+"_UEAreas", shshMax, isoCone, rMinFix, isoPtTh, isoMethod, isoContent, leading, tmFix, mixOn, printSettings, debug); } From 721d787f96746f81a8b74238c6a6eb5cef8c1592 Mon Sep 17 00:00:00 2001 From: Bas Hofman <72511967+bhofman@users.noreply.github.com> Date: Thu, 20 Apr 2023 16:00:04 +0200 Subject: [PATCH 33/51] Update AliEmcalTrackSelectionAOD.cxx Added new 23a3 period --- PWG/EMCAL/EMCALbase/AliEmcalTrackSelectionAOD.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWG/EMCAL/EMCALbase/AliEmcalTrackSelectionAOD.cxx b/PWG/EMCAL/EMCALbase/AliEmcalTrackSelectionAOD.cxx index 08d5a68301e..2432835d2e4 100644 --- a/PWG/EMCAL/EMCALbase/AliEmcalTrackSelectionAOD.cxx +++ b/PWG/EMCAL/EMCALbase/AliEmcalTrackSelectionAOD.cxx @@ -240,7 +240,7 @@ Bool_t AliEmcalTrackSelectionAOD::GetHybridFilterBits(Char_t bits[], TString per period.BeginsWith("lhc18b8") || period.BeginsWith("lhc18f5") || period.BeginsWith("lhc18g2") || period.BeginsWith("lhc17g8a") || period.BeginsWith("lhc19a1") || period.BeginsWith("lhc19f4") || period.BeginsWith("lhc19d3") || period.BeginsWith("lhc20k1") || period.BeginsWith("lhc17h6e2") || period.BeginsWith("lhc17h6f2") || period.BeginsWith("lhc21b8") || - period.BeginsWith("lhc15h1") || period.BeginsWith("lhc15h2") + period.BeginsWith("lhc15h1") || period.BeginsWith("lhc15h2") || period.BeginsWith("lhc23a3") ) { bits[0] = 8; bits[1] = 9; From 4b5b469c3929e6db1cc5d0b1c2e13d1b0b3bb99b Mon Sep 17 00:00:00 2001 From: bheybeck <86231730+bheybeck@users.noreply.github.com> Date: Thu, 20 Apr 2023 16:23:24 +0200 Subject: [PATCH 34/51] Add files via upload --- .../AliAnalysisTaskSigmaPlus.cxx | 128 +++++++++++------- .../Sigma_Baryons/AliAnalysisTaskSigmaPlus.h | 3 + 2 files changed, 79 insertions(+), 52 deletions(-) diff --git a/PWGLF/NUCLEX/Hypernuclei/Hyp2Body/HypTritYield/Sigma_Baryons/AliAnalysisTaskSigmaPlus.cxx b/PWGLF/NUCLEX/Hypernuclei/Hyp2Body/HypTritYield/Sigma_Baryons/AliAnalysisTaskSigmaPlus.cxx index 14cc9a9a024..559d9d909e8 100644 --- a/PWGLF/NUCLEX/Hypernuclei/Hyp2Body/HypTritYield/Sigma_Baryons/AliAnalysisTaskSigmaPlus.cxx +++ b/PWGLF/NUCLEX/Hypernuclei/Hyp2Body/HypTritYield/Sigma_Baryons/AliAnalysisTaskSigmaPlus.cxx @@ -355,6 +355,9 @@ fTrackLabel(-999), fTrackPDGCode(-999), fTrackMotherID(-999), fTrackMotherPDGCode(-999), +fTrackMotherMCPx(-999), +fTrackMotherMCPy(-999), +fTrackMotherMCPz(-999), fTrackMCPx(-999), fTrackMCPy(-999), fTrackMCPz(-999), @@ -705,6 +708,9 @@ fTrackLabel(-999), fTrackPDGCode(-999), fTrackMotherID(-999), fTrackMotherPDGCode(-999), +fTrackMotherMCPx(-999), +fTrackMotherMCPy(-999), +fTrackMotherMCPz(-999), fTrackMCPx(-999), fTrackMCPy(-999), fTrackMCPz(-999), @@ -972,31 +978,34 @@ void AliAnalysisTaskSigmaPlus::UserCreateOutputObjects() fSigmaCandTree->Branch("fSigPzMC",&fSigPzMC,"fSigPzMC/F"); } if(fSaveAddMCBranches){ - fSigmaCandTree->Branch("fTrackLabel",& fTrackLabel,"fTrackLabel/I"); - fSigmaCandTree->Branch("fTrackPDGCode",& fTrackPDGCode,"fTrackPDGCode/I"); - fSigmaCandTree->Branch("fTrackMotherID",& fTrackMotherID,"fTrackMotherID/I"); - fSigmaCandTree->Branch("fTrackMotherPDGCode",& fTrackMotherPDGCode,"fTrackMotherPDGCode/I"); - fSigmaCandTree->Branch("fTrackMCPx",& fTrackMCPx,"fTrackMCPx/F"); - fSigmaCandTree->Branch("fTrackMCPy",& fTrackMCPy,"fTrackMCPy/F"); - fSigmaCandTree->Branch("fTrackMCPz",& fTrackMCPz,"fTrackMCPz/F"); - fSigmaCandTree->Branch("fPhoton1Label",& fPhoton1Label,"fPhoton1Label/I"); - fSigmaCandTree->Branch("fPhoton1PDGCode",& fPhoton1PDGCode,"fPhoton1PDGCode/I"); - fSigmaCandTree->Branch("fPhoton1MotherID",& fPhoton1MotherID,"fPhoton1MotherID/I"); - fSigmaCandTree->Branch("fPhoton1MotherPDGCode",& fPhoton1MotherPDGCode,"fPhoton1MotherPDGCode/I"); - fSigmaCandTree->Branch("fPhoton1GMotherID",& fPhoton1GMotherID,"fPhoton1GMotherID/I"); - fSigmaCandTree->Branch("fPhoton1GMotherPDGCode",& fPhoton1GMotherPDGCode,"fPhoton1GMotherPDGCode/I"); - fSigmaCandTree->Branch("fPhoton1MCPx",& fPhoton1MCPx,"fPhoton1MCPx/F"); - fSigmaCandTree->Branch("fPhoton1MCPy",& fPhoton1MCPy,"fPhoton1MCPy/F"); - fSigmaCandTree->Branch("fPhoton1MCPz",& fPhoton1MCPz,"fPhoton1MCPz/F"); - fSigmaCandTree->Branch("fPhoton2Label",& fPhoton2Label,"fPhoton2Label/I"); - fSigmaCandTree->Branch("fPhoton2PDGCode",& fPhoton2PDGCode,"fPhoton2PDGCode/I"); - fSigmaCandTree->Branch("fPhoton2MotherID",& fPhoton2MotherID,"fPhoton2MotherID/I"); - fSigmaCandTree->Branch("fPhoton2MotherPDGCode",& fPhoton2MotherPDGCode,"fPhoton2MotherPDGCode/I"); - fSigmaCandTree->Branch("fPhoton2GMotherID",& fPhoton2GMotherID,"fPhoton2GMotherID/I"); - fSigmaCandTree->Branch("fPhoton2GMotherPDGCode",& fPhoton2GMotherPDGCode,"fPhoton2GMotherPDGCode/I"); - fSigmaCandTree->Branch("fPhoton2MCPx",& fPhoton2MCPx,"fPhoton2MCPx/F"); - fSigmaCandTree->Branch("fPhoton2MCPy",& fPhoton2MCPy,"fPhoton2MCPy/F"); - fSigmaCandTree->Branch("fPhoton2MCPz",& fPhoton2MCPz,"fPhoton2MCPz/F"); + fSigmaCandTree->Branch("fTrackLabel",&fTrackLabel,"fTrackLabel/I"); + fSigmaCandTree->Branch("fTrackPDGCode",&fTrackPDGCode,"fTrackPDGCode/I"); + fSigmaCandTree->Branch("fTrackMotherID",&fTrackMotherID,"fTrackMotherID/I"); + fSigmaCandTree->Branch("fTrackMotherPDGCode",&fTrackMotherPDGCode,"fTrackMotherPDGCode/I"); + fSigmaCandTree->Branch("fTrackMotherMCPx",&fTrackMotherMCPx,"fTrackMotherMCPx/F"); + fSigmaCandTree->Branch("fTrackMotherMCPy",&fTrackMotherMCPy,"fTrackMotherMCPy/F"); + fSigmaCandTree->Branch("fTrackMotherMCPz",&fTrackMotherMCPz,"fTrackMotherMCPz/F"); + fSigmaCandTree->Branch("fTrackMCPx",&fTrackMCPx,"fTrackMCPx/F"); + fSigmaCandTree->Branch("fTrackMCPy",&fTrackMCPy,"fTrackMCPy/F"); + fSigmaCandTree->Branch("fTrackMCPz",&fTrackMCPz,"fTrackMCPz/F"); + fSigmaCandTree->Branch("fPhoton1Label",&fPhoton1Label,"fPhoton1Label/I"); + fSigmaCandTree->Branch("fPhoton1PDGCode",&fPhoton1PDGCode,"fPhoton1PDGCode/I"); + fSigmaCandTree->Branch("fPhoton1MotherID",&fPhoton1MotherID,"fPhoton1MotherID/I"); + fSigmaCandTree->Branch("fPhoton1MotherPDGCode",&fPhoton1MotherPDGCode,"fPhoton1MotherPDGCode/I"); + fSigmaCandTree->Branch("fPhoton1GMotherID",&fPhoton1GMotherID,"fPhoton1GMotherID/I"); + fSigmaCandTree->Branch("fPhoton1GMotherPDGCode",&fPhoton1GMotherPDGCode,"fPhoton1GMotherPDGCode/I"); + fSigmaCandTree->Branch("fPhoton1MCPx",&fPhoton1MCPx,"fPhoton1MCPx/F"); + fSigmaCandTree->Branch("fPhoton1MCPy",&fPhoton1MCPy,"fPhoton1MCPy/F"); + fSigmaCandTree->Branch("fPhoton1MCPz",&fPhoton1MCPz,"fPhoton1MCPz/F"); + fSigmaCandTree->Branch("fPhoton2Label",&fPhoton2Label,"fPhoton2Label/I"); + fSigmaCandTree->Branch("fPhoton2PDGCode",&fPhoton2PDGCode,"fPhoton2PDGCode/I"); + fSigmaCandTree->Branch("fPhoton2MotherID",&fPhoton2MotherID,"fPhoton2MotherID/I"); + fSigmaCandTree->Branch("fPhoton2MotherPDGCode",&fPhoton2MotherPDGCode,"fPhoton2MotherPDGCode/I"); + fSigmaCandTree->Branch("fPhoton2GMotherID",&fPhoton2GMotherID,"fPhoton2GMotherID/I"); + fSigmaCandTree->Branch("fPhoton2GMotherPDGCode",&fPhoton2GMotherPDGCode,"fPhoton2GMotherPDGCode/I"); + fSigmaCandTree->Branch("fPhoton2MCPx",&fPhoton2MCPx,"fPhoton2MCPx/F"); + fSigmaCandTree->Branch("fPhoton2MCPy",&fPhoton2MCPy,"fPhoton2MCPy/F"); + fSigmaCandTree->Branch("fPhoton2MCPz",&fPhoton2MCPz,"fPhoton2MCPz/F"); } if(fSaveAdditionalBranches){ fSigmaCandTree->Branch("fHas4DiffIDs",&fHas4DiffIDs,"fHas4DiffIDs/O"); @@ -1518,31 +1527,34 @@ void AliAnalysisTaskSigmaPlus::UserCreateOutputObjects() fSigmaPHOSCandTree->Branch("fClustPDGCode",&fClustPDGCode,"fClustPDGCode/I"); } if(fSaveAddMCBranches){ - fSigmaPHOSCandTree->Branch("fTrackLabel",& fTrackLabel,"fTrackLabel/I"); - fSigmaPHOSCandTree->Branch("fTrackPDGCode",& fTrackPDGCode,"fTrackPDGCode/I"); - fSigmaPHOSCandTree->Branch("fTrackMotherID",& fTrackMotherID,"fTrackMotherID/I"); - fSigmaPHOSCandTree->Branch("fTrackMotherPDGCode",& fTrackMotherPDGCode,"fTrackMotherPDGCode/I"); - fSigmaPHOSCandTree->Branch("fTrackMCPx",& fTrackMCPx,"fTrackMCPx/F"); - fSigmaPHOSCandTree->Branch("fTrackMCPy",& fTrackMCPy,"fTrackMCPy/F"); - fSigmaPHOSCandTree->Branch("fTrackMCPz",& fTrackMCPz,"fTrackMCPz/F"); - fSigmaPHOSCandTree->Branch("fPhoton1Label",& fPhoton1Label,"fPhoton1Label/I"); - fSigmaPHOSCandTree->Branch("fPhoton1PDGCode",& fPhoton1PDGCode,"fPhoton1PDGCode/I"); - fSigmaPHOSCandTree->Branch("fPhoton1MotherID",& fPhoton1MotherID,"fPhoton1MotherID/I"); - fSigmaPHOSCandTree->Branch("fPhoton1MotherPDGCode",& fPhoton1MotherPDGCode,"fPhoton1MotherPDGCode/I"); - fSigmaPHOSCandTree->Branch("fPhoton1GMotherID",& fPhoton1GMotherID,"fPhoton1GMotherID/I"); - fSigmaPHOSCandTree->Branch("fPhoton1GMotherPDGCode",& fPhoton1GMotherPDGCode,"fPhoton1GMotherPDGCode/I"); - fSigmaPHOSCandTree->Branch("fPhoton1MCPx",& fPhoton1MCPx,"fPhoton1MCPx/F"); - fSigmaPHOSCandTree->Branch("fPhoton1MCPy",& fPhoton1MCPy,"fPhoton1MCPy/F"); - fSigmaPHOSCandTree->Branch("fPhoton1MCPz",& fPhoton1MCPz,"fPhoton1MCPz/F"); - fSigmaPHOSCandTree->Branch("fPhoton2Label",& fPhoton2Label,"fPhoton2Label/I"); - fSigmaPHOSCandTree->Branch("fPhoton2PDGCode",& fPhoton2PDGCode,"fPhoton2PDGCode/I"); - fSigmaPHOSCandTree->Branch("fPhoton2MotherID",& fPhoton2MotherID,"fPhoton2MotherID/I"); - fSigmaPHOSCandTree->Branch("fPhoton2MotherPDGCode",& fPhoton2MotherPDGCode,"fPhoton2MotherPDGCode/I"); - fSigmaPHOSCandTree->Branch("fPhoton2GMotherID",& fPhoton2GMotherID,"fPhoton2GMotherID/I"); - fSigmaPHOSCandTree->Branch("fPhoton2GMotherPDGCode",& fPhoton2GMotherPDGCode,"fPhoton2GMotherPDGCode/I"); - fSigmaPHOSCandTree->Branch("fPhoton2MCPx",& fPhoton2MCPx,"fPhoton2MCPx/F"); - fSigmaPHOSCandTree->Branch("fPhoton2MCPy",& fPhoton2MCPy,"fPhoton2MCPy/F"); - fSigmaPHOSCandTree->Branch("fPhoton2MCPz",& fPhoton2MCPz,"fPhoton2MCPz/F"); + fSigmaPHOSCandTree->Branch("fTrackLabel",&fTrackLabel,"fTrackLabel/I"); + fSigmaPHOSCandTree->Branch("fTrackPDGCode",&fTrackPDGCode,"fTrackPDGCode/I"); + fSigmaPHOSCandTree->Branch("fTrackMotherID",&fTrackMotherID,"fTrackMotherID/I"); + fSigmaPHOSCandTree->Branch("fTrackMotherPDGCode",&fTrackMotherPDGCode,"fTrackMotherPDGCode/I"); + fSigmaPHOSCandTree->Branch("fTrackMotherMCPx",&fTrackMotherMCPx,"fTrackMotherMCPx/F"); + fSigmaPHOSCandTree->Branch("fTrackMotherMCPy",&fTrackMotherMCPy,"fTrackMotherMCPy/F"); + fSigmaPHOSCandTree->Branch("fTrackMotherMCPz",&fTrackMotherMCPz,"fTrackMotherMCPz/F"); + fSigmaPHOSCandTree->Branch("fTrackMCPx",&fTrackMCPx,"fTrackMCPx/F"); + fSigmaPHOSCandTree->Branch("fTrackMCPy",&fTrackMCPy,"fTrackMCPy/F"); + fSigmaPHOSCandTree->Branch("fTrackMCPz",&fTrackMCPz,"fTrackMCPz/F"); + fSigmaPHOSCandTree->Branch("fPhoton1Label",&fPhoton1Label,"fPhoton1Label/I"); + fSigmaPHOSCandTree->Branch("fPhoton1PDGCode",&fPhoton1PDGCode,"fPhoton1PDGCode/I"); + fSigmaPHOSCandTree->Branch("fPhoton1MotherID",&fPhoton1MotherID,"fPhoton1MotherID/I"); + fSigmaPHOSCandTree->Branch("fPhoton1MotherPDGCode",&fPhoton1MotherPDGCode,"fPhoton1MotherPDGCode/I"); + fSigmaPHOSCandTree->Branch("fPhoton1GMotherID",&fPhoton1GMotherID,"fPhoton1GMotherID/I"); + fSigmaPHOSCandTree->Branch("fPhoton1GMotherPDGCode",&fPhoton1GMotherPDGCode,"fPhoton1GMotherPDGCode/I"); + fSigmaPHOSCandTree->Branch("fPhoton1MCPx",&fPhoton1MCPx,"fPhoton1MCPx/F"); + fSigmaPHOSCandTree->Branch("fPhoton1MCPy",&fPhoton1MCPy,"fPhoton1MCPy/F"); + fSigmaPHOSCandTree->Branch("fPhoton1MCPz",&fPhoton1MCPz,"fPhoton1MCPz/F"); + fSigmaPHOSCandTree->Branch("fPhoton2Label",&fPhoton2Label,"fPhoton2Label/I"); + fSigmaPHOSCandTree->Branch("fPhoton2PDGCode",&fPhoton2PDGCode,"fPhoton2PDGCode/I"); + fSigmaPHOSCandTree->Branch("fPhoton2MotherID",&fPhoton2MotherID,"fPhoton2MotherID/I"); + fSigmaPHOSCandTree->Branch("fPhoton2MotherPDGCode",&fPhoton2MotherPDGCode,"fPhoton2MotherPDGCode/I"); + fSigmaPHOSCandTree->Branch("fPhoton2GMotherID",&fPhoton2GMotherID,"fPhoton2GMotherID/I"); + fSigmaPHOSCandTree->Branch("fPhoton2GMotherPDGCode",&fPhoton2GMotherPDGCode,"fPhoton2GMotherPDGCode/I"); + fSigmaPHOSCandTree->Branch("fPhoton2MCPx",&fPhoton2MCPx,"fPhoton2MCPx/F"); + fSigmaPHOSCandTree->Branch("fPhoton2MCPy",&fPhoton2MCPy,"fPhoton2MCPy/F"); + fSigmaPHOSCandTree->Branch("fPhoton2MCPz",&fPhoton2MCPz,"fPhoton2MCPz/F"); } if(fSaveAdditionalBranches){ fSigmaPHOSCandTree->Branch("fSigRefMultComb05",&fSigRefMultComb05,"fSigRefMultComb05/S"); @@ -5353,6 +5365,9 @@ void AliAnalysisTaskSigmaPlus::ReconstructParticles() { fTrackPDGCode = -999; fTrackMotherID = -999; fTrackMotherPDGCode = -999; + fTrackMotherMCPx = -999; + fTrackMotherMCPy = -999; + fTrackMotherMCPz = -999; fTrackMCPx = -999; fTrackMCPy = -999; fTrackMCPz = -999; @@ -5387,7 +5402,10 @@ void AliAnalysisTaskSigmaPlus::ReconstructParticles() { fTrackMCPz = ProtonPart->Pz(); AliAODMCParticle* ProtonPartM = static_cast(AODMCTrackArray->At(TMath::Abs(ProtonPart->GetMother()))); if(ProtonPartM){ - fTrackMotherPDGCode = ProtonPart->GetPdgCode(); + fTrackMotherPDGCode = ProtonPartM->GetPdgCode(); + fTrackMotherMCPx = ProtonPartM->Px(); + fTrackMotherMCPy = ProtonPartM->Py(); + fTrackMotherMCPz = ProtonPartM->Pz(); }//Proton Mother exists }//Track exists AliAODMCParticle* V01Daught1 = static_cast(AODMCTrackArray->At(TMath::Abs(track1->GetLabel()))); @@ -6348,6 +6366,9 @@ void AliAnalysisTaskSigmaPlus::ReconstructParticlesPHOS() { fTrackPDGCode = -999; fTrackMotherID = -999; fTrackMotherPDGCode = -999; + fTrackMotherMCPx = -999; + fTrackMotherMCPy = -999; + fTrackMotherMCPz = -999; fTrackMCPx = -999; fTrackMCPy = -999; fTrackMCPz = -999; @@ -6382,7 +6403,10 @@ void AliAnalysisTaskSigmaPlus::ReconstructParticlesPHOS() { fTrackMCPz = ProtonPart->Pz(); AliAODMCParticle* ProtonPartM = static_cast(AODMCTrackArray->At(TMath::Abs(ProtonPart->GetMother()))); if(ProtonPartM){ - fTrackMotherPDGCode = ProtonPart->GetPdgCode(); + fTrackMotherPDGCode = ProtonPartM->GetPdgCode(); + fTrackMotherMCPx = ProtonPartM->Px(); + fTrackMotherMCPy = ProtonPartM->Py(); + fTrackMotherMCPz = ProtonPartM->Pz(); }//Proton Mother exists }//Track exists AliAODMCParticle* V01Daught1 = static_cast(AODMCTrackArray->At(TMath::Abs(track1->GetLabel()))); diff --git a/PWGLF/NUCLEX/Hypernuclei/Hyp2Body/HypTritYield/Sigma_Baryons/AliAnalysisTaskSigmaPlus.h b/PWGLF/NUCLEX/Hypernuclei/Hyp2Body/HypTritYield/Sigma_Baryons/AliAnalysisTaskSigmaPlus.h index d65672c2e7e..cae9ba7121f 100644 --- a/PWGLF/NUCLEX/Hypernuclei/Hyp2Body/HypTritYield/Sigma_Baryons/AliAnalysisTaskSigmaPlus.h +++ b/PWGLF/NUCLEX/Hypernuclei/Hyp2Body/HypTritYield/Sigma_Baryons/AliAnalysisTaskSigmaPlus.h @@ -578,6 +578,9 @@ class AliAnalysisTaskSigmaPlus : public AliAnalysisTaskSE Int_t fTrackPDGCode; Int_t fTrackMotherID; // -1 if Particle is primary Int_t fTrackMotherPDGCode; + Float_t fTrackMotherMCPx; + Float_t fTrackMotherMCPy; + Float_t fTrackMotherMCPz; Float_t fTrackMCPx; Float_t fTrackMCPy; Float_t fTrackMCPz; From 45d7e6bffa206a331b5a9b3eca8e1faa2e939dac Mon Sep 17 00:00:00 2001 From: Anjaly Menon Date: Thu, 20 Apr 2023 19:36:58 -0500 Subject: [PATCH 35/51] Train test failed last time; fixed a bug --- .../AliAnalysisTaskKaon2PC.cxx | 45 +++++++++---------- .../KaonCorrelations/AliAnalysisTaskKaon2PC.h | 11 ++--- 2 files changed, 26 insertions(+), 30 deletions(-) diff --git a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx index 6e5783f44af..d31f19b47d6 100644 --- a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx +++ b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.cxx @@ -53,7 +53,8 @@ ClassImp(AliAnalysisTaskKaon2PC) // classimp: necessary for root const Double_t Pi = TMath::Pi(); AliAnalysisTaskKaon2PC::AliAnalysisTaskKaon2PC() : AliAnalysisTaskSE(), -fAOD(0), +fAOD(0), +fmcEvent(0), fOutputList(0), fPIDResponse(0), fRejectEventPileUp(kTRUE), @@ -176,7 +177,8 @@ fEventCuts(0) } //_____________________________________________________________________________ AliAnalysisTaskKaon2PC::AliAnalysisTaskKaon2PC(const char* name) : AliAnalysisTaskSE(name), -fAOD(0), +fAOD(0), +fmcEvent(0), fOutputList(0), fPIDResponse(0), fRejectEventPileUp(kTRUE), @@ -321,7 +323,6 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() // to an output file. fzVtxBins = {-10.0,-8.0,-6.0,-4.0,-2.0,0.0,2.0,4.0,6.0,8.0,10.0}; // 10 bins - //fzVtxBins = {-10.0,-9.0,-8.0,-7.0,-6.0,-5.0,-4.0,-3.0,-2.0,-1.0,0.0,1.0,2.0,3.0,4.0,5.0,6.0,7.0,8.0,9.0,10.0}; // 20 bins //fCentBins = {0,5,10,15,20,25,30,35,40,45,50,60,70,80,90,100}; fCentBins = { 0, 1, 2, 3, 4, 5, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100.1 }; // 15 bins //fsampleBins = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0}; @@ -391,7 +392,6 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fNsigmaTPCTOFK->SetOption("colz"); fHistTOFKch = new TH2F("fHistTOFKch", "", 500, 0.2,2,700,0,2); - //fHistTOFKch->SetOption(); //track and event observables fVtx = new TH1F("fVtx", "PV_{z} distribution of Tracks", 100, -13, 13); @@ -504,12 +504,12 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fHistKChKChPhi = new TH2F("fHistKChKChPhi", "C(#Delta#phi) of Kch-Kch ",32,-0.5*Pi,1.5*Pi,100,0,100); fHistKChKChPhi->SetOption("SURF1"); - fHistCF = new TH2F("fHistCF","Number of pairs of K^{+/-} and K^{0}",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); + fHistCF = new TH2F("fHistCF","Number of pairs of K^{+/-} and K^{0}",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6 ); fHistCF->GetXaxis()->SetTitle("#Delta#phi "); fHistCF->GetYaxis()->SetTitle("#Delta#eta"); fHistCF->SetOption("SURF1"); - fHistKPosKNeg = new TH2F("fHistKPosKNeg","K^{+}-K^{-} Correlation",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6); + fHistKPosKNeg = new TH2F("fHistKPosKNeg","K^{+}-K^{-} Correlation",32,-0.5*Pi,1.5*Pi,32,-1.6, 1.6 ); fHistKPosKNeg->GetXaxis()->SetTitle("#Delta#phi "); fHistKPosKNeg->GetYaxis()->SetTitle("#Delta#eta"); fHistKPosKNeg->SetOption("SURF1"); @@ -528,7 +528,6 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fHistCF_KpKn_Bg = new TH2F("fHistCF_KpKn_Bg","Background for CF of K^{+} and K^{-}",32,-0.5*Pi,1.5*Pi,32,-1.6,1.6); fHistCF_KpKn_Bg->SetOption("SURF1"); - hPt = new TH1F("hPt", "Track pT distribution", 100, 0, 2); hPt_kPos = new TH1F("hPt_kPos", "Track pT distribution", 100, 0, 2); @@ -570,6 +569,7 @@ void AliAnalysisTaskKaon2PC::UserCreateOutputObjects() fHistGenMultiplicity = new TH1D ("fHistGenMultiplicity","fHistGenMultiplicity",500,0,500); + fOutputList->Add(fEnergy); fOutputList->Add(fEnergyCuts); fOutputList->Add(fPID); @@ -691,7 +691,7 @@ Bool_t AliAnalysisTaskKaon2PC::AcceptTrack(const AliAODTrack *Trk) { //if (fabs(nSigmakaon < 3.0) && (nSigmaelectron < 3.0)) return kFALSE; if (fabs(nSigmakaon) > fSigCut) return kFALSE; if (fabs(nSigmaTOFkaon) > 3.0) return kFALSE; - + return kTRUE; } @@ -928,7 +928,6 @@ for(Int_t i=0; i < iTracks; i++) { if(!track) continue; if (!AcceptTrack(track)) continue; Double_t TOFsignal = track->GetTOFsignal(); - Float_t beta = 0.0; beta = Beta(track); Int_t chargetrack = track->Charge(); @@ -967,13 +966,13 @@ for(Int_t i=0; i < iTracks; i++) { } Int_t nSelectedKCh = fSelectedKCh->GetEntries(); -cout << " nSelectedKCh is " << nSelectedKCh << endl; +//cout << " nSelectedKCh is " << nSelectedKCh << endl; Int_t nSelectedKpos = fSelectedKpos->GetEntries(); -cout << " nSelectedKpos is " << nSelectedKpos << endl; +//cout << " nSelectedKpos is " << nSelectedKpos << endl; Int_t nSelectedKneg = fSelectedKneg->GetEntries(); -cout << " nSelectedKneg is " << nSelectedKneg << endl; +//cout << " nSelectedKneg is " << nSelectedKneg << endl; //======== Neutral Kaon Selection ========== @@ -1007,10 +1006,7 @@ for(Int_t j=0; j < nv0s; j++) { fHistNPionPhi->Fill(nTrack->Phi()); } Int_t nSelectedK0s = fSelectedK0s->GetEntries(); -cout << " nSelectedK0s is " << nSelectedK0s << endl; - -//((TH1F*)((AliDirList*)fOutput3->FindObject("Track"))->FindObject("nTracksBf"))->Fill(nTracks); -//((TH1F*)((AliDirList*)fOutput3->FindObject("Track"))->FindObject("nTracksAf"))->Fill(nSelectedTracks); +//cout << " nSelectedK0s is " << nSelectedK0s << endl; //======== KchKch Correlation Loop ========== @@ -1068,6 +1064,9 @@ cout << " nSelectedK0s is " << nSelectedK0s << endl; } } + + + //======== K0s-Kch Correlation Analysis ========== for(Int_t i = 0; i < fSelectedK0s->GetEntriesFast(); i++){ AliAODv0 * v0 = (AliAODv0*)fSelectedK0s->At(i); @@ -1140,6 +1139,7 @@ fHistMult->Fill(iTracks); fHistCent->Fill(CentV0M); //================== mixing ============================ (You can create a seperate function FillCorrelationsMixed() later) + AliEventPool *pool = fPoolMgr->GetEventPool(CentV0M, PVz); if(pool) {cout << "Good news....!!!!!!! Pool found.. " << endl; } if(!pool) { AliError(Form("No pool found for centrality = %f, zVtx = %f", CentV0M,PVz)); return; } @@ -1188,8 +1188,6 @@ Int_t nMix = pool->GetCurrentNEvents(); } -//================== mixing ============================ (for k+k- CF) - if (fKpKnCorr){ if(pool->IsReady() || pool->NTracksInPool() > fPoolMinNTracks || pool->GetCurrentNEvents() >= fMinEventsToMix) { @@ -1206,7 +1204,6 @@ Int_t nMix = pool->GetCurrentNEvents(); for (Int_t iAss(0); iAss < bgTracks2->GetEntries(); iAss++){ AliVParticle* KaonAssoc = dynamic_cast (bgTracks2->At(iAss)); - if(!KaonAssoc) continue; if( KaonAssoc->Charge() != KaonTrig->Charge() ) continue; @@ -1237,9 +1234,9 @@ Int_t nMix = pool->GetCurrentNEvents(); } -TObjArray* tracksClone = (TObjArray*) fSelectedKCh->Clone(); -tracksClone->SetOwner(kTRUE); -pool->UpdatePool(tracksClone); + TObjArray* tracksClone = (TObjArray*) fSelectedKCh->Clone(); + tracksClone->SetOwner(kTRUE); + pool->UpdatePool(tracksClone); } //end of RunData function @@ -1276,7 +1273,7 @@ for (Int_t i = 0; i < nMCTracks; i++){ } } -cout << "number of accepted particles from MC tracks is"<< nAcceptedParticles << endl; +//cout << "number of accepted particles from MC tracks is"<< nAcceptedParticles << endl; fHistGenMultiplicity->Fill(nAcceptedParticles); AliMCParticle *mcMotherParticle = 0x0; @@ -1372,7 +1369,6 @@ for (Int_t i = 0; i < nMCTracks; i++){ void AliAnalysisTaskKaon2PC::UserExec(Option_t *) { if (!fAnalysisMC) { RunData(); } - if (fAnalysisMC) { RunMC(); } // deleting TObjArrays //fSelectedK0s->Clear(); @@ -1434,4 +1430,3 @@ void AliAnalysisTaskKaon2PC::Terminate(Option_t *) } //_____________________________________________________________________________ - diff --git a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h index bddcfbfb620..31dc0e01b5e 100644 --- a/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h +++ b/PWGCF/Correlations/KaonCorrelations/AliAnalysisTaskKaon2PC.h @@ -54,7 +54,8 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE void SetMCRead(Bool_t flag) {fAnalysisMC = flag;} void SetFilterBit(Int_t filterbit) {fBit = filterbit;} - //void SetPtLimits(Double_t ptmin, Double_t ptmax) { fLpTCut = ptmin; fUpTCut=ptmax; } + void SetCentLimit(Double_t CentMin, Double_t CentMax) {fCentMin = CentMin; fCentMax = CentMax; } + void SetPtLimits(Double_t ptmin, Double_t ptmax) { fLpTCut = ptmin; fUpTCut=ptmax; } //void SetEtaLimit(Double_t etalimit) { fEta = etalimit; } //mixing //void SetNofSamples(Int_t n) { fNOfSamples = n; } //sampling setter @@ -68,8 +69,8 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE TList* fOutputList; //! output list AliPIDResponse* fPIDResponse; //! pid response object’ - TH1F* fEnergy; //! dummy histogram - TH1F* fEnergyCuts; //! dummy histogram + TH1F* fEnergy; //! dummy histogram + TH1F* fEnergyCuts; //! dummy histogram TH2F* fPID; //! dummy histogram TH2F* fPIDKaon; //! dummy histogram TH2F* fPIDK; //! dummy histogram @@ -84,7 +85,7 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE TH1F* fVtx; //! dummy histogram TH1F* fClusters; //! dummy histogram TH1F* fHistNEvents; //! dummy histogram - TH1F* fHistNV0; //! dummy histogram + TH1F* fHistNV0; //! dummy histogram TH1F* fHistEta; //! dummy histogram TH1F* fHistDEta; //! dummy histogram TH1F* fHistPhi; //! dummy histogram @@ -207,4 +208,4 @@ class AliAnalysisTaskKaon2PC : public AliAnalysisTaskSE ClassDef(AliAnalysisTaskKaon2PC, 1); }; -#endif +#endif \ No newline at end of file From 511cca17d63c192adaa3b541078317c7997f727e Mon Sep 17 00:00:00 2001 From: Joshua Koenig Date: Fri, 21 Apr 2023 10:13:29 +0200 Subject: [PATCH 36/51] PWGGA/GammaConv: Add pPb configs for NonLin checks with NL applied in CF --- PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C | 8 ++++++++ PWGGA/GammaConv/macros/AddTask_GammaConvCalo_pPb.C | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C b/PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C index e0723aae5a1..527fe509125 100644 --- a/PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C +++ b/PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C @@ -1925,6 +1925,14 @@ void AddTask_GammaCalo_pPb( cuts.AddCutCalo("8808d103","4117932050032230000","01631031000000d0"); // 80-100 cuts.AddCutCalo("8908d103","4117932050032230000","01631031000000d0"); // 90-100 + + + } else if (trainConfig == 2400){ // EMCAL+DCAL clusters standard cuts, triggers, no NL, no NCell cut + cuts.AddCutCalo("80010103","411790005f030230000","01631031000000d0"); // INT7 + } else if (trainConfig == 2401){ // EMCAL+DCAL clusters standard cuts, triggers, no NL, no NCell cut + cuts.AddCutCalo("8008e103","411790005f030230000","01631031000000d0"); // EG2 + cuts.AddCutCalo("8008d103","411790005f030230000","01631031000000d0"); // EG1 + // PHOS pPb8TeV } else if (trainConfig == 3000){ // settings Jens cuts.AddCutCalo("80010103","24466190ua012300000","0163103100000010"); // INT7 diff --git a/PWGGA/GammaConv/macros/AddTask_GammaConvCalo_pPb.C b/PWGGA/GammaConv/macros/AddTask_GammaConvCalo_pPb.C index 5808321e7c2..c894a634323 100644 --- a/PWGGA/GammaConv/macros/AddTask_GammaConvCalo_pPb.C +++ b/PWGGA/GammaConv/macros/AddTask_GammaConvCalo_pPb.C @@ -1287,6 +1287,12 @@ void AddTask_GammaConvCalo_pPb( cuts.AddCutPCMCalo("8008e103","0dm00009f9730000dge0404000","411793105f030230000","0h63103100b00010"); cuts.AddCutPCMCalo("8008d103","0dm00009f9730000dge0404000","411793105f030230000","0h63103100b00010"); + } else if (trainConfig == 2061) { // no NCell cut, no NL correction + cuts.AddCutPCMCalo("80010103","0dm00009f9730000dge0404000","411790005f030230000","0h63103100b00010"); // INT7 + } else if (trainConfig == 2062) { // no NCell cut, no NL correction + cuts.AddCutPCMCalo("8008e103","0dm00009f9730000dge0404000","411790005f030230000","0h63103100b00010"); // EG2 + cuts.AddCutPCMCalo("8008d103","0dm00009f9730000dge0404000","411790005f030230000","0h63103100b00010"); // EG1 + } else if (trainConfig == 2061) { // no NL, NCell Effi MC cuts.AddCutPCMCalo("80010123","0dm00009f9730000dge0404000","411790005f03h230000","0h63103100b00010"); cuts.AddCutPCMCalo("8008e123","0dm00009f9730000dge0404000","411790005f03h230000","0h63103100b00010"); From bfd5377ba847c398e5242ef75300cdba3776ea3a Mon Sep 17 00:00:00 2001 From: Gyula Bencedi Date: Fri, 21 Apr 2023 11:47:11 +0200 Subject: [PATCH 37/51] Changed to finer pt binning --- .../AliAnalysisTaskSpectraFlatenicity.cxx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/PWGMM/UE/Flatenicity/AliAnalysisTaskSpectraFlatenicity.cxx b/PWGMM/UE/Flatenicity/AliAnalysisTaskSpectraFlatenicity.cxx index e03ae4b9807..0f737e1c3fb 100755 --- a/PWGMM/UE/Flatenicity/AliAnalysisTaskSpectraFlatenicity.cxx +++ b/PWGMM/UE/Flatenicity/AliAnalysisTaskSpectraFlatenicity.cxx @@ -81,14 +81,16 @@ using std::endl; #include "AliAnalysisTaskSpectraFlatenicity.h" -const Int_t nPtbinsFlatSpecFlatSpec = 36; -Double_t PtbinsFlatSpec[nPtbinsFlatSpecFlatSpec + 1] = { - 0.0, 0.1, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.6, 0.7, 0.8, - 0.9, 1.0, 1.25, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 6.0, 7.0, - 8.0, 9.0, 10.0, 12.0, 14.0, 16.0, 18.0, 20.0, 30.0, 40.0, 50.0}; - -const int DCAxyNBins = 121; -double DCAxyBins[DCAxyNBins + 1] = { +const Int_t nPtbinsFlatSpecFlatSpec = 41; +Double_t PtbinsFlatSpec[nPtbinsFlatSpecFlatSpec+1] = { + 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, + 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1 , 1.2, 1.3 , 1.4, + 1.5, 1.6, 1.7 , 1.8, 1.9 , 2.0, 2.2 , 2.4, 2.6 , 2.8, + 3.0, 3.2, 3.4, 3.6 , 3.8, 4.0 , 4.5, 5.0 , 6.0, 8.0 , + 10.0, 20.0}; + +const Int_t DCAxyNBins = 121; +Double_t DCAxyBins[DCAxyNBins + 1] = { -3.025, -2.975, -2.925, -2.875, -2.825, -2.775, -2.725, -2.675, -2.625, -2.575, -2.525, -2.475, -2.425, -2.375, -2.325, -2.275, -2.225, -2.175, -2.125, -2.075, -2.025, -1.975, -1.925, -1.875, -1.825, -1.775, -1.725, -1.675, -1.625, -1.575, From ac1d040ed7a88782e93cbfb0f854486824e0f307 Mon Sep 17 00:00:00 2001 From: Steffimro Date: Fri, 21 Apr 2023 14:22:12 +0200 Subject: [PATCH 38/51] PWGGA: Systematic Studies PHOS --- .../GammaConv/macros/AddTask_GammaCalo_pPb.C | 48 +++++++++++++++++-- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C b/PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C index 1deb71c936e..755ee28ee90 100644 --- a/PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C +++ b/PWGGA/GammaConv/macros/AddTask_GammaCalo_pPb.C @@ -1100,11 +1100,7 @@ void AddTask_GammaCalo_pPb( cuts.AddCutCalo("80010113","24466530ha01cc00000","0163103100000010"); // non-lin 1 cuts.AddCutCalo("80010113","24466540ha01cc00000","0163103100000010"); // non-lin 2 } else if (trainConfig == 519) { - cuts.AddCutCalo("80010113","244665300a01cc00000","0163103100000010"); // no timing cut for timing cut studies cuts.AddCutCalo("80010113","24466530ua01cc00000","0163103100000010"); // non-lin 1 - cuts.AddCutCalo("80010113","24466530za01cc00000","0163103100000010"); // non-lin 1 and timing cut -50-50 ns new - - } else if (trainConfig == 520) { // JJ MC cuts.AddCutCalo("80010123","24466420ha012200000","0163103100000010"); // standard } else if (trainConfig == 521) { @@ -1225,6 +1221,50 @@ void AddTask_GammaCalo_pPb( } else if (trainConfig == 568){ // settings Jens cuts.AddCutCalo("80010123","24466640ya09dc00000","0163103100000010"); // INT7 + + // Variations for systematics + } else if ( trainConfig == 569) { // NL variations (standard: 42 PHOS ML) + cuts.AddCutCalo("80010113","24466530ua01cc00000","0163103100000010"); + cuts.AddCutCalo("80010113","24466540ua01cc00000","0163103100000010"); + cuts.AddCutCalo("80010113","24466010ua01cc00000","0163103100000010"); // PHOS group NL + cuts.AddCutCalo("80010113","24466000ua01cc00000","0163103100000010"); // PHOS group NL + } else if ( trainConfig == 570) { // distance to bad channel variations (standard: no cut) + cuts.AddCutCalo("80010113","24466531ua01cc00000","0163103100000010"); // dist. to bad channel = 1 + cuts.AddCutCalo("80010113","24466532ua01cc00000","0163103100000010"); // dist. to bad channel = 2 + cuts.AddCutCalo("80010113","24466533ua01cc00000","0163103100000010"); // dist. to bad channel = 3 + } else if ( trainConfig == 571) { // timing variations - bunch spacing: 100ns (standard: 50ns) + // min. number of cells per cluster variations (standard: 2) + cuts.AddCutCalo("80010113","24466530wa01cc00000","0163103100000010"); // -30 - 30 cut + cuts.AddCutCalo("80010113","24466530za01cc00000","0163103100000010"); // -50 - 50 timing cut + cuts.AddCutCalo("80010113","244665304a01cc00000","0163103100000010"); // -100 - 100 ns timing cut + + } else if ( trainConfig == 572) { // track matching variations + cuts.AddCutCalo("80010113","24466530u001cc00000","0163103100000010"); // without track matching + cuts.AddCutCalo("80010113","24466530u501cc00000","0163103100000010"); // tm variation + cuts.AddCutCalo("80010113","24466530u601cc00000","0163103100000010"); // tm variation + cuts.AddCutCalo("80010113","24466530ua01cc00000","0263303100000010"); // BG + } else if ( trainConfig == 573) { // min. cluster energy variations (standard: 0.5 MeV) + cuts.AddCutCalo("80010113","24466530ua07cc00000","0163103100000010"); // 0.2 MeV + cuts.AddCutCalo("80010113","24466530ua09cc00000","0163103100000010"); // 0.1 MeV + cuts.AddCutCalo("80010113","24466530ua08cc00000","0163103100000010"); // 0.4 MeV + cuts.AddCutCalo("80010113","24466530ua02cc00000","0163103100000010"); // 0.5 MeV + } else if ( trainConfig == 574) { + cuts.AddCutCalo("80010113","24466530ua01cb00000","0163103100000010"); // M02 min 0.002, E > 1 GeV + cuts.AddCutCalo("80010113","24466530ua01cd00000","0163103100000010"); // M02 min 0.2, E > 1 GeV + cuts.AddCutCalo("80010113","24466530ua01cc00010","0163103100000010"); // dispersion < 2 + cuts.AddCutCalo("80010113","24466530ua01cc00030","0163103100000010"); // dispersion < 2 + } else if ( trainConfig == 575){ // MESON + cuts.AddCutCalo("80010113","24466530ua01cc00000","0163303100000010"); // rapidity variation y<0.5 + cuts.AddCutCalo("80010113","24466530ua01cc00000","0163803100000010"); // rapidity variation y<0.5 + cuts.AddCutCalo("80010113","24466530ua01cc00000","0163106100000010"); // alpha meson variation 1 0 Date: Fri, 21 Apr 2023 15:07:12 +0200 Subject: [PATCH 39/51] PWGGA/GammaConv: Change default PCM-PHOS cut for 13 TeV to latest changes --- .../macros/AddTask_GammaConvCalo_pp.C | 300 +++++++++--------- 1 file changed, 150 insertions(+), 150 deletions(-) diff --git a/PWGGA/GammaConv/macros/AddTask_GammaConvCalo_pp.C b/PWGGA/GammaConv/macros/AddTask_GammaConvCalo_pp.C index d99429ac86f..9c7716e553b 100644 --- a/PWGGA/GammaConv/macros/AddTask_GammaConvCalo_pp.C +++ b/PWGGA/GammaConv/macros/AddTask_GammaConvCalo_pp.C @@ -3157,137 +3157,137 @@ void AddTask_GammaConvCalo_pp( // Variations for systematics } else if (trainConfig == 2600){ // PHOS clusters standard cuts, INT7, NL, std 19 // || - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466000sa01cc00000","0163103100000010"); // INT7 NoNL - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466110sa01cc00000","0163103100000010"); // INT7 NL11 - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466120sa01cc00000","0163103100000010"); // INT7 NL12 - //cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa01cc00000","0163103100000010"); // INT7 NL19 + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466000sa01cc00000","0163103100000010"); // INT7 NoNL + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466110sa01cc00000","0163103100000010"); // INT7 NL11 + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466120sa01cc00000","0163103100000010"); // INT7 NL12 + //cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa01cc00000","0163103100000010"); // INT7 NL19 } else if (trainConfig == 2601){ // PHOS clusters standard cuts, PHI7, NL, std 19 // || || - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466000sa01cc00000","0163103100000010"); // PHI7 No NL - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466110sa01cc00000","0163103100000010"); // PHI7 NL11 - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466120sa01cc00000","0163103100000010"); // PHI7 NL12 - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa01cc00000","0163103100000010"); // PHI7 NL19 + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466000sa01cc00000","0163103100000010"); // PHI7 No NL + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466110sa01cc00000","0163103100000010"); // PHI7 NL11 + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466120sa01cc00000","0163103100000010"); // PHI7 NL12 + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa01cc00000","0163103100000010"); // PHI7 NL19 //---------------------------------------------------------------------------------------------------------------------------------------- // Variations of PHOS Part //Standard: "24466190sa01cc00000" } else if (trainConfig == 2620){ // timing Cut variation std -30+30ns // | - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","244661901a01cc00000","0163103100000010"); //1: -1000 +1000 ns - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","244661905a01cc00000","0163103100000010"); //5: -50 +50 ns - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","244661907a01cc00000","0163103100000010"); //7: -30 +30 ns - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","244661909a01cc00000","0163103100000010"); //9: -20 +25 ns - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190aa01cc00000","0163103100000010"); //a: -12.5 +13 ns + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","244661901a01cc00000","0163103100000010"); //1: -1000 +1000 ns + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","244661905a01cc00000","0163103100000010"); //5: -50 +50 ns + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","244661907a01cc00000","0163103100000010"); //7: -30 +30 ns + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","244661909a01cc00000","0163103100000010"); //9: -20 +25 ns + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190aa01cc00000","0163103100000010"); //a: -12.5 +13 ns } else if (trainConfig == 2621){ // Timing Efficiency Variations std s == 30ns // | - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190ra01cc00000","0163103100000010"); //r: LowPt from MB, 30ns - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190ta01cc00000","0163103100000010"); //t: 25ns - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190ua01cc00000","0163103100000010"); //u: 50ns + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190ra01cc00000","0163103100000010"); //r: LowPt from MB, 30ns + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190ta01cc00000","0163103100000010"); //t: 25ns + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190ua01cc00000","0163103100000010"); //u: 50ns } else if (trainConfig == 2622){ // track matching variation std a == pt dependent // | - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190s001cc00000","0163103100000010"); //0 - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190s101cc00000","0163103100000010"); //1 - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190s401cc00000","0163103100000010"); //4 - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190s501cc00000","0163103100000010"); //5 - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190s601cc00000","0163103100000010"); //6 + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190s001cc00000","0163103100000010"); //0 + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190s101cc00000","0163103100000010"); //1 + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190s401cc00000","0163103100000010"); //4 + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190s501cc00000","0163103100000010"); //5 + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190s601cc00000","0163103100000010"); //6 } else if (trainConfig == 2623){ // min energy variation std 0.3 GeV/c // | - // cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa00cc00000","0163103100000010"); //0: off - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa09cc00000","0163103100000010"); //9: 0.1 GeV/c - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa02cc00000","0163103100000010"); //2: 0.5 GeV/c - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa03cc00000","0163103100000010"); //3: 0.6 GeV/c - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa04cc00000","0163103100000010"); //4: 0.7 GeV/c - // cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa05cc00000","0163103100000010"); //5: 0.8 GeV/c + // cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa00cc00000","0163103100000010"); //0: off + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa09cc00000","0163103100000010"); //9: 0.1 GeV/c + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa02cc00000","0163103100000010"); //2: 0.5 GeV/c + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa03cc00000","0163103100000010"); //3: 0.6 GeV/c + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa04cc00000","0163103100000010"); //4: 0.7 GeV/c + // cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa05cc00000","0163103100000010"); //5: 0.8 GeV/c } else if (trainConfig == 2624){ // min nCells & M02 variation, std cc // std: min nCells = 2 >1GeV; M02 max=100, min=0.1 // || - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa012200000","0163103100000010"); //220: min nCells = 2, all E - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa013200000","0163103100000010"); //320: min nCells = 3, all E - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa01dc00000","0163103100000010"); //dc0: min nCells = 3, E>1GeV; minM02==0.1 off for E<1GeV - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa01cd00000","0163103100000010"); //cd0: min nCells = 2, E>1GeV; minM02==0.2 off for E<1GeV + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa012200000","0163103100000010"); //220: min nCells = 2, all E + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa013200000","0163103100000010"); //320: min nCells = 3, all E + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa01dc00000","0163103100000010"); //dc0: min nCells = 3, E>1GeV; minM02==0.1 off for E<1GeV + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa01cd00000","0163103100000010"); //cd0: min nCells = 2, E>1GeV; minM02==0.2 off for E<1GeV } else if (trainConfig == 2625){ // reconstructed conversion, std 0==off // | - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa01cc00100","0163103100000010"); //1: rec. conv. 0.02 - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa01cc00200","0163103100000010"); //2: rec. conv. 0.025 - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa01cc00300","0163103100000010"); //3: rec. conv. 0.03 - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa01cc00400","0163103100000010"); //4: rec. conv. 0.035 - // cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa01cc00500","0163103100000010"); //5: rec. conv. 0.04 + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa01cc00100","0163103100000010"); //1: rec. conv. 0.02 + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa01cc00200","0163103100000010"); //2: rec. conv. 0.025 + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa01cc00300","0163103100000010"); //3: rec. conv. 0.03 + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa01cc00400","0163103100000010"); //4: rec. conv. 0.035 + // cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa01cc00500","0163103100000010"); //5: rec. conv. 0.04 } else if (trainConfig == 2626){ // min nCells & M02 variation, std cc - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa011000000","0163103100000010"); //100: min nCells = 1, minM02 off - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa01cc70000","0163103100000010"); //cc7: maxM02 == 1.3 - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa01cc80000","0163103100000010"); //cc8: maxM02 == 2.5 + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa011000000","0163103100000010"); //100: min nCells = 1, minM02 off + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa01cc70000","0163103100000010"); //cc7: maxM02 == 1.3 + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa01cc80000","0163103100000010"); //cc8: maxM02 == 2.5 //---------------------------------------------------------------------------------------------------------------------------------------- // Meson variations } else if ( trainConfig == 2640){//rapidity, std 1 == <0.8 // | - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa01cc00000","0163403100000010"); //4: rapidity variation y<0.5 - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa01cc00000","0163803100000010"); //8: rapidity variation y<0.25 + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa01cc00000","0163403100000010"); //4: rapidity variation y<0.5 + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa01cc00000","0163803100000010"); //8: rapidity variation y<0.25 } else if ( trainConfig == 2641){//alpha, std 3 == <=1.0 // | - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa01cc00000","0163106100000010"); //6: alpha meson variation 1 00.5, 1 cell diagonal // | - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa01cc00000","0163103100000000"); //0: min opening angle 0 -> open - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa01cc00000","0163103100000030"); //3: min opening angle 0.01 -> 2 cell diag + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa01cc00000","0163103100000000"); //0: min opening angle 0 -> open + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa01cc00000","0163103100000030"); //3: min opening angle 0.01 -> 2 cell diag } else if ( trainConfig == 2643){ //Smearing Check // | - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","24466190sa01cc00000","0163103100b00010"); //b + cuts.AddCutPCMCalo("00010113","0dd00009f9730000dge0404000","24466190sa01cc00000","0163103100b00010"); //b //---------------------------------------------------------------------------------------------------------------------------------------- // Variations of PCM Part // std 0dm00009f9730000dge0404000 } else if (trainConfig == 2660) { //single pt, std 0 == 0.05 GeV/c // | - cuts.AddCutPCMCalo("00010113", "0dm00069f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: min pT 40 MeV - cuts.AddCutPCMCalo("00010113", "0dm00049f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //4: min pT 75 MeV - cuts.AddCutPCMCalo("00010113", "0dm00019f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //1: min pT 100MeV + cuts.AddCutPCMCalo("00010113", "0dd00069f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: min pT 40 MeV + cuts.AddCutPCMCalo("00010113", "0dd00049f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //4: min pT 75 MeV + cuts.AddCutPCMCalo("00010113", "0dd00019f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //1: min pT 100MeV } else if (trainConfig == 2661) { // min TPC clusters / findable clusters, std 9 == 60% // | - cuts.AddCutPCMCalo("00010113", "0dm00008f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //8: TPC cluster 35% - cuts.AddCutPCMCalo("00010113", "0dm00006f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: TPC cluster 70% + cuts.AddCutPCMCalo("00010113", "0dd00008f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //8: TPC cluster 35% + cuts.AddCutPCMCalo("00010113", "0dd00006f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: TPC cluster 70% } else if (trainConfig == 2662) { //Cosine Pointing Angle, std 4 == 0.85 // | - cuts.AddCutPCMCalo("00010113", "0dm00009f9730000dge0604000","24466190sa01cc00000", "0163103100000010"); //6: cosPA 0.9 - cuts.AddCutPCMCalo("00010113", "0dm00009f9730000dge0304000","24466190sa01cc00000", "0163103100000010"); //3: cosPA 0.75 + cuts.AddCutPCMCalo("00010113", "0dd00009f9730000dge0604000","24466190sa01cc00000", "0163103100000010"); //6: cosPA 0.9 + cuts.AddCutPCMCalo("00010113", "0dd00009f9730000dge0304000","24466190sa01cc00000", "0163103100000010"); //3: cosPA 0.75 } else if (trainConfig == 2663) { // nsigma electron; std f == -3, 4 // | - cuts.AddCutPCMCalo("00010113", "0dm0000939730000dge0404000","24466190sa01cc00000", "0163103100000010"); //3: nsig electron -4, 5 - cuts.AddCutPCMCalo("00010113", "0dm0000969730000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: nsig electron -2.5, 4 + cuts.AddCutPCMCalo("00010113", "0dd0000939730000dge0404000","24466190sa01cc00000", "0163103100000010"); //3: nsig electron -4, 5 + cuts.AddCutPCMCalo("00010113", "0dd0000969730000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: nsig electron -2.5, 4 } else if (trainConfig == 2664) { // nsigma pion; std 9 == low pt 1, highpt 0.5 // | - cuts.AddCutPCMCalo("00010113", "0dm00009f5730000dge0404000","24466190sa01cc00000", "0163103100000010"); //5: nsig pion 2,-10 - cuts.AddCutPCMCalo("00010113", "0dm00009f2730000dge0404000","24466190sa01cc00000", "0163103100000010"); //2: nsig pion 1,-10 - cuts.AddCutPCMCalo("00010113", "0dm00009f1730000dge0404000","24466190sa01cc00000", "0163103100000010"); //1: nsig pion 0,-10 + cuts.AddCutPCMCalo("00010113", "0dd00009f5730000dge0404000","24466190sa01cc00000", "0163103100000010"); //5: nsig pion 2,-10 + cuts.AddCutPCMCalo("00010113", "0dd00009f2730000dge0404000","24466190sa01cc00000", "0163103100000010"); //2: nsig pion 1,-10 + cuts.AddCutPCMCalo("00010113", "0dd00009f1730000dge0404000","24466190sa01cc00000", "0163103100000010"); //1: nsig pion 0,-10 } else if (trainConfig == 2665) {// pion nsig min mom, std 7 == 0.4 GeV/c // | - cuts.AddCutPCMCalo("00010113", "0dm00009f9030000dge0404000","24466190sa01cc00000", "0163103100000010"); //0: pion nsig min mom 0.50 GeV/c - cuts.AddCutPCMCalo("00010113", "0dm00009f9630000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: pion nsig min mom 0.25 GeV/c + cuts.AddCutPCMCalo("00010113", "0dd00009f9030000dge0404000","24466190sa01cc00000", "0163103100000010"); //0: pion nsig min mom 0.50 GeV/c + cuts.AddCutPCMCalo("00010113", "0dd00009f9630000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: pion nsig min mom 0.25 GeV/c } else if (trainConfig == 2666) {// pion nsig max mom, std 3 == 20 GeV/c // | - cuts.AddCutPCMCalo("00010113", "0dm00009f9760000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: pion nsig max mom 2.00 GeV/c - cuts.AddCutPCMCalo("00010113", "0dm00009f9710000dge0404000","24466190sa01cc00000", "0163103100000010"); //1: pion nsig max mom 5.00 GeV/c - cuts.AddCutPCMCalo("00010113", "0dm00009f9700000dge0404000","24466190sa01cc00000", "0163103100000010"); //0: pion nsig max mom 100.00 GeV/c + cuts.AddCutPCMCalo("00010113", "0dd00009f9760000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: pion nsig max mom 2.00 GeV/c + cuts.AddCutPCMCalo("00010113", "0dd00009f9710000dge0404000","24466190sa01cc00000", "0163103100000010"); //1: pion nsig max mom 5.00 GeV/c + cuts.AddCutPCMCalo("00010113", "0dd00009f9700000dge0404000","24466190sa01cc00000", "0163103100000010"); //0: pion nsig max mom 100.00 GeV/c } else if (trainConfig == 2667){ //qT max, std d == qTPtMax=0.125, qTMax=0.050, fDo2DQt=kTRUE, fDoQtGammaSelection=2 // | - cuts.AddCutPCMCalo("00010113", "0dm00009f97300008ge0404000","24466190sa01cc00000", "0163103100000010"); //8: qT max 0.05 1D, fDo2DQt=kTRUE - cuts.AddCutPCMCalo("00010113", "0dm00009f97300003ge0404000","24466190sa01cc00000", "0163103100000010"); //3: qT max 0.05 1D, fDo2DQt=kFALSE - cuts.AddCutPCMCalo("00010113", "0dm00009f97300002ge0404000","24466190sa01cc00000", "0163103100000010"); //2: qT max 0.06 2D, fDo2DQt=kTRUE - cuts.AddCutPCMCalo("00010113", "0dm00009f97300009ge0404000","24466190sa01cc00000", "0163103100000010"); //9: qT max 0.03 2D, fDo2DQt=kTRUE + cuts.AddCutPCMCalo("00010113", "0dd00009f97300008ge0404000","24466190sa01cc00000", "0163103100000010"); //8: qT max 0.05 1D, fDo2DQt=kTRUE + cuts.AddCutPCMCalo("00010113", "0dd00009f97300003ge0404000","24466190sa01cc00000", "0163103100000010"); //3: qT max 0.05 1D, fDo2DQt=kFALSE + cuts.AddCutPCMCalo("00010113", "0dd00009f97300002ge0404000","24466190sa01cc00000", "0163103100000010"); //2: qT max 0.06 2D, fDo2DQt=kTRUE + cuts.AddCutPCMCalo("00010113", "0dd00009f97300009ge0404000","24466190sa01cc00000", "0163103100000010"); //9: qT max 0.03 2D, fDo2DQt=kTRUE } else if (trainConfig == 2668) { // Psi pair 1D, std e == 0.18, fDo2DPsiPairChi2 = 2 // | - cuts.AddCutPCMCalo("00010113", "0dm00009f9730000dg50404000","24466190sa01cc00000", "0163103100000010"); //5: Psi pair 0.1 1D - cuts.AddCutPCMCalo("00010113", "0dm00009f9730000dg10404000","24466190sa01cc00000", "0163103100000010"); //1: Psi pair 0.1 1D - cuts.AddCutPCMCalo("00010113", "0dm00009f9730000dg60404000","24466190sa01cc00000", "0163103100000010"); //6: Psi pair 0.05 2D - cuts.AddCutPCMCalo("00010113", "0dm00009f9730000dg80404000","24466190sa01cc00000", "0163103100000010"); //8: Psi pair 0.2 2D + cuts.AddCutPCMCalo("00010113", "0dd00009f9730000dg50404000","24466190sa01cc00000", "0163103100000010"); //5: Psi pair 0.1 1D + cuts.AddCutPCMCalo("00010113", "0dd00009f9730000dg10404000","24466190sa01cc00000", "0163103100000010"); //1: Psi pair 0.1 1D + cuts.AddCutPCMCalo("00010113", "0dd00009f9730000dg60404000","24466190sa01cc00000", "0163103100000010"); //6: Psi pair 0.05 2D + cuts.AddCutPCMCalo("00010113", "0dd00009f9730000dg80404000","24466190sa01cc00000", "0163103100000010"); //8: Psi pair 0.2 2D } else if (trainConfig == 2669){ // qT 2D pT dep, std qt d == qTPtMax=0.125, qTMax=0.050, fDo2DQt=kTRUE, fDoQtGammaSelection=2, std 0 == off // | | - cuts.AddCutPCMCalo("00010113", "0dm00009f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //d,0: qT<0.110pT (2D) alpha<0.99 - cuts.AddCutPCMCalo("00010113", "0dm00009f9730000c259404000","24466190sa01cc00000", "0163103100000010"); //c,9: qT<0.110pT (2D) alpha<0.99 - cuts.AddCutPCMCalo("00010113", "0dm00009f9730000a259404000","24466190sa01cc00000", "0163103100000010"); //a,9: qT<0.125pT (2D) alpha<0.99 - cuts.AddCutPCMCalo("00010113", "0dm00009f9730000e259404000","24466190sa01cc00000", "0163103100000010"); //e,9: qT<0.130pT (2D) alpha<0.99 + cuts.AddCutPCMCalo("00010113", "0dd00009f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //d,0: qT<0.110pT (2D) alpha<0.99 + cuts.AddCutPCMCalo("00010113", "0dd00009f9730000c259404000","24466190sa01cc00000", "0163103100000010"); //c,9: qT<0.110pT (2D) alpha<0.99 + cuts.AddCutPCMCalo("00010113", "0dd00009f9730000a259404000","24466190sa01cc00000", "0163103100000010"); //a,9: qT<0.125pT (2D) alpha<0.99 + cuts.AddCutPCMCalo("00010113", "0dd00009f9730000e259404000","24466190sa01cc00000", "0163103100000010"); //e,9: qT<0.130pT (2D) alpha<0.99 } else if (trainConfig == 2670){ // chi2, PsiPair cont., std 2 == // | - cuts.AddCutPCMCalo("00010113", "0dm00009f97300008fd0404000","24466190sa01cc00000", "0163103100000010"); //f: PsiPair<0.15exp(-0.065chi2) - cuts.AddCutPCMCalo("00010113", "0dm00009f97300008ge0404000","24466190sa01cc00000", "0163103100000010"); //g: PsiPair<0.18exp(-0.055chi2) - cuts.AddCutPCMCalo("00010113", "0dm00009f97300008hf0404000","24466190sa01cc00000", "0163103100000010"); //h: PsiPair<0.20exp(-0.050chi2) + cuts.AddCutPCMCalo("00010113", "0dd00009f97300008fd0404000","24466190sa01cc00000", "0163103100000010"); //f: PsiPair<0.15exp(-0.065chi2) + cuts.AddCutPCMCalo("00010113", "0dd00009f97300008ge0404000","24466190sa01cc00000", "0163103100000010"); //g: PsiPair<0.18exp(-0.055chi2) + cuts.AddCutPCMCalo("00010113", "0dd00009f97300008hf0404000","24466190sa01cc00000", "0163103100000010"); //h: PsiPair<0.20exp(-0.050chi2) //---------------------------------------------------------------------------------------------------------------------------------------- //************************************************************************************************* // 13 TeV PCM-PHOS - Systematics - Trigger @@ -3296,121 +3296,121 @@ void AddTask_GammaConvCalo_pp( //Standard: "24466190sa01cc00000" } else if (trainConfig == 2720){ // timing Cut variation std -30+30ns // | - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","244661905a01cc00000","0163103100000010"); //5: -50 +50 ns - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","244661907a01cc00000","0163103100000010"); //7: -30 +30 ns - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","244661909a01cc00000","0163103100000010"); //9: -20 +25 ns - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190aa01cc00000","0163103100000010"); //a: -12.5 +13 ns + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","244661905a01cc00000","0163103100000010"); //5: -50 +50 ns + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","244661907a01cc00000","0163103100000010"); //7: -30 +30 ns + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","244661909a01cc00000","0163103100000010"); //9: -20 +25 ns + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190aa01cc00000","0163103100000010"); //a: -12.5 +13 ns } else if (trainConfig == 2721){ // Timing Efficiency Variations std s == 30ns // | - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190ra01cc00000","0163103100000010"); //r: LowPt from MB, 30ns - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190ta01cc00000","0163103100000010"); //t: 25ns - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190ua01cc00000","0163103100000010"); //u: 50ns + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190ra01cc00000","0163103100000010"); //r: LowPt from MB, 30ns + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190ta01cc00000","0163103100000010"); //t: 25ns + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190ua01cc00000","0163103100000010"); //u: 50ns } else if (trainConfig == 2722){ // track matching variation std a == pt dependent // | - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190s001cc00000","0163103100000010"); //0 - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190s101cc00000","0163103100000010"); //1 - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190s401cc00000","0163103100000010"); //4 - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190s501cc00000","0163103100000010"); //5 - // cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190s601cc00000","0163103100000010"); //6 + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190s001cc00000","0163103100000010"); //0 + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190s101cc00000","0163103100000010"); //1 + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190s401cc00000","0163103100000010"); //4 + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190s501cc00000","0163103100000010"); //5 + // cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190s601cc00000","0163103100000010"); //6 } else if (trainConfig == 2723){ // min energy variation std 0.3 GeV/c // | - // cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa00cc00000","0163103100000010"); //0: off - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa09cc00000","0163103100000010"); //9: 0.1 GeV/c - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa02cc00000","0163103100000010"); //2: 0.5 GeV/c - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa03cc00000","0163103100000010"); //3: 0.6 GeV/c - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa04cc00000","0163103100000010"); //4: 0.7 GeV/c - // cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa05cc00000","0163103100000010"); //5: 0.8 GeV/c + // cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa00cc00000","0163103100000010"); //0: off + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa09cc00000","0163103100000010"); //9: 0.1 GeV/c + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa02cc00000","0163103100000010"); //2: 0.5 GeV/c + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa03cc00000","0163103100000010"); //3: 0.6 GeV/c + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa04cc00000","0163103100000010"); //4: 0.7 GeV/c + // cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa05cc00000","0163103100000010"); //5: 0.8 GeV/c } else if (trainConfig == 2724){ // min nCells & M02 variation, std cc // std: min nCells = 2 >1GeV; M02 max=100, min=0.1 // || - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa012200000","0163103100000010"); //220: min nCells = 2, all E - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa013200000","0163103100000010"); //320: min nCells = 3, all E - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa01dc00000","0163103100000010"); //dc0: min nCells = 3, E>1GeV; minM02==0.1 off for E<1GeV - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa01cd00000","0163103100000010"); //cd0: min nCells = 2, E>1GeV; minM02==0.2 off for E<1GeV + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa012200000","0163103100000010"); //220: min nCells = 2, all E + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa013200000","0163103100000010"); //320: min nCells = 3, all E + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa01dc00000","0163103100000010"); //dc0: min nCells = 3, E>1GeV; minM02==0.1 off for E<1GeV + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa01cd00000","0163103100000010"); //cd0: min nCells = 2, E>1GeV; minM02==0.2 off for E<1GeV } else if (trainConfig == 2725){ // reconstructed conversion, std 0==off // | - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa01cc00100","0163103100000010"); //1: rec. conv. 0.02 - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa01cc00200","0163103100000010"); //2: rec. conv. 0.025 - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa01cc00300","0163103100000010"); //3: rec. conv. 0.03 - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa01cc00400","0163103100000010"); //4: rec. conv. 0.035 - // cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa01cc00500","0163103100000010"); //5: rec. conv. 0.04 + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa01cc00100","0163103100000010"); //1: rec. conv. 0.02 + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa01cc00200","0163103100000010"); //2: rec. conv. 0.025 + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa01cc00300","0163103100000010"); //3: rec. conv. 0.03 + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa01cc00400","0163103100000010"); //4: rec. conv. 0.035 + // cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa01cc00500","0163103100000010"); //5: rec. conv. 0.04 } else if (trainConfig == 2726){ // min nCells & M02 variation, std cc - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa011000000","0163103100000010"); //100: min nCells = 1, minM02 off - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa01cc70000","0163103100000010"); //cc7: maxM02 == 1.3 - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa01cc80000","0163103100000010"); //cc8: maxM02 == 2.5 + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa011000000","0163103100000010"); //100: min nCells = 1, minM02 off + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa01cc70000","0163103100000010"); //cc7: maxM02 == 1.3 + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa01cc80000","0163103100000010"); //cc8: maxM02 == 2.5 //---------------------------------------------------------------------------------------------------------------------------------------- // Meson variations } else if ( trainConfig == 2740){//rapidity, std 1 == <0.8 // | - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa01cc00000","0163403100b00010"); //4: rapidity variation y<0.5 - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa01cc00000","0163803100b00010"); //8: rapidity variation y<0.25 + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa01cc00000","0163403100b00010"); //4: rapidity variation y<0.5 + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa01cc00000","0163803100b00010"); //8: rapidity variation y<0.25 } else if ( trainConfig == 2741){//alpha, std 3 == <=1.0 // | - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa01cc00000","0163106100b00010"); //6: alpha meson variation 1 00.5, 1 cell diagonal // | - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa01cc00000","0163103100b00000"); //0: min opening angle 0 -> open - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa01cc00000","0163103100b00030"); //3: min opening angle 0.01 -> 2 cell diag + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa01cc00000","0163103100b00000"); //0: min opening angle 0 -> open + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa01cc00000","0163103100b00030"); //3: min opening angle 0.01 -> 2 cell diag } else if ( trainConfig == 2743){ //Smearing Check // | - cuts.AddCutPCMCalo("00062113","0dm00009f9730000dge0404000","24466190sa01cc00000","0163103100b00010"); //b + cuts.AddCutPCMCalo("00062113","0dd00009f9730000dge0404000","24466190sa01cc00000","0163103100b00010"); //b //---------------------------------------------------------------------------------------------------------------------------------------- // Variations of PCM Part // std 0dm00009f9730000dge0404000 } else if (trainConfig == 2760) { //single pt, std 0 == 0.05 GeV/c // | - cuts.AddCutPCMCalo("00062113", "0dm00069f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: min pT 40 MeV - cuts.AddCutPCMCalo("00062113", "0dm00049f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //4: min pT 75 MeV - cuts.AddCutPCMCalo("00062113", "0dm00019f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //1: min pT 100MeV + cuts.AddCutPCMCalo("00062113", "0dd00069f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: min pT 40 MeV + cuts.AddCutPCMCalo("00062113", "0dd00049f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //4: min pT 75 MeV + cuts.AddCutPCMCalo("00062113", "0dd00019f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //1: min pT 100MeV } else if (trainConfig == 2761) { // min TPC clusters / findable clusters, std 9 == 60% // | - cuts.AddCutPCMCalo("00062113", "0dm00008f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //8: TPC cluster 35% - cuts.AddCutPCMCalo("00062113", "0dm00006f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: TPC cluster 70% + cuts.AddCutPCMCalo("00062113", "0dd00008f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //8: TPC cluster 35% + cuts.AddCutPCMCalo("00062113", "0dd00006f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: TPC cluster 70% } else if (trainConfig == 2762) { //Cosine Pointing Angle, std 4 == 0.85 // | - cuts.AddCutPCMCalo("00062113", "0dm00009f9730000dge0604000","24466190sa01cc00000", "0163103100000010"); //6: cosPA 0.9 - cuts.AddCutPCMCalo("00062113", "0dm00009f9730000dge0304000","24466190sa01cc00000", "0163103100000010"); //3: cosPA 0.75 + cuts.AddCutPCMCalo("00062113", "0dd00009f9730000dge0604000","24466190sa01cc00000", "0163103100000010"); //6: cosPA 0.9 + cuts.AddCutPCMCalo("00062113", "0dd00009f9730000dge0304000","24466190sa01cc00000", "0163103100000010"); //3: cosPA 0.75 } else if (trainConfig == 2763) { // nsigma electron; std f == -3, 4 // | - cuts.AddCutPCMCalo("00062113", "0dm0000939730000dge0404000","24466190sa01cc00000", "0163103100000010"); //3: nsig electron -4, 5 - cuts.AddCutPCMCalo("00062113", "0dm0000969730000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: nsig electron -2.5, 4 + cuts.AddCutPCMCalo("00062113", "0dd0000939730000dge0404000","24466190sa01cc00000", "0163103100000010"); //3: nsig electron -4, 5 + cuts.AddCutPCMCalo("00062113", "0dd0000969730000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: nsig electron -2.5, 4 } else if (trainConfig == 2764) { // nsigma pion; std 9 == low pt 1, highpt 0.5 // | - cuts.AddCutPCMCalo("00062113", "0dm00009f5730000dge0404000","24466190sa01cc00000", "0163103100000010"); //5: nsig pion 2,-10 - cuts.AddCutPCMCalo("00062113", "0dm00009f2730000dge0404000","24466190sa01cc00000", "0163103100000010"); //2: nsig pion 1,-10 - cuts.AddCutPCMCalo("00062113", "0dm00009f1730000dge0404000","24466190sa01cc00000", "0163103100000010"); //1: nsig pion 0,-10 + cuts.AddCutPCMCalo("00062113", "0dd00009f5730000dge0404000","24466190sa01cc00000", "0163103100000010"); //5: nsig pion 2,-10 + cuts.AddCutPCMCalo("00062113", "0dd00009f2730000dge0404000","24466190sa01cc00000", "0163103100000010"); //2: nsig pion 1,-10 + cuts.AddCutPCMCalo("00062113", "0dd00009f1730000dge0404000","24466190sa01cc00000", "0163103100000010"); //1: nsig pion 0,-10 } else if (trainConfig == 2765) {// pion nsig min mom, std 7 == 0.4 GeV/c // | - cuts.AddCutPCMCalo("00062113", "0dm00009f9030000dge0404000","24466190sa01cc00000", "0163103100000010"); //0: pion nsig min mom 0.50 GeV/c - cuts.AddCutPCMCalo("00062113", "0dm00009f9630000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: pion nsig min mom 0.25 GeV/c + cuts.AddCutPCMCalo("00062113", "0dd00009f9030000dge0404000","24466190sa01cc00000", "0163103100000010"); //0: pion nsig min mom 0.50 GeV/c + cuts.AddCutPCMCalo("00062113", "0dd00009f9630000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: pion nsig min mom 0.25 GeV/c } else if (trainConfig == 2766) {// pion nsig max mom, std 3 == 20 GeV/c // | - cuts.AddCutPCMCalo("00062113", "0dm00009f9760000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: pion nsig max mom 2.00 GeV/c - cuts.AddCutPCMCalo("00062113", "0dm00009f9710000dge0404000","24466190sa01cc00000", "0163103100000010"); //1: pion nsig max mom 5.00 GeV/c - cuts.AddCutPCMCalo("00062113", "0dm00009f9700000dge0404000","24466190sa01cc00000", "0163103100000010"); //0: pion nsig max mom 100.00 GeV/c + cuts.AddCutPCMCalo("00062113", "0dd00009f9760000dge0404000","24466190sa01cc00000", "0163103100000010"); //6: pion nsig max mom 2.00 GeV/c + cuts.AddCutPCMCalo("00062113", "0dd00009f9710000dge0404000","24466190sa01cc00000", "0163103100000010"); //1: pion nsig max mom 5.00 GeV/c + cuts.AddCutPCMCalo("00062113", "0dd00009f9700000dge0404000","24466190sa01cc00000", "0163103100000010"); //0: pion nsig max mom 100.00 GeV/c } else if (trainConfig == 2767){ //qT max, std d == qTPtMax=0.125, qTMax=0.050, fDo2DQt=kTRUE, fDoQtGammaSelection=2 // | - cuts.AddCutPCMCalo("00062113", "0dm00009f97300008ge0404000","24466190sa01cc00000", "0163103100000010"); //8: qT max 0.05 1D, fDo2DQt=kTRUE - cuts.AddCutPCMCalo("00062113", "0dm00009f97300003ge0404000","24466190sa01cc00000", "0163103100000010"); //3: qT max 0.05 1D, fDo2DQt=kFALSE - cuts.AddCutPCMCalo("00062113", "0dm00009f97300002ge0404000","24466190sa01cc00000", "0163103100000010"); //2: qT max 0.06 2D, fDo2DQt=kTRUE - cuts.AddCutPCMCalo("00062113", "0dm00009f97300009ge0404000","24466190sa01cc00000", "0163103100000010"); //9: qT max 0.03 2D, fDo2DQt=kTRUE + cuts.AddCutPCMCalo("00062113", "0dd00009f97300008ge0404000","24466190sa01cc00000", "0163103100000010"); //8: qT max 0.05 1D, fDo2DQt=kTRUE + cuts.AddCutPCMCalo("00062113", "0dd00009f97300003ge0404000","24466190sa01cc00000", "0163103100000010"); //3: qT max 0.05 1D, fDo2DQt=kFALSE + cuts.AddCutPCMCalo("00062113", "0dd00009f97300002ge0404000","24466190sa01cc00000", "0163103100000010"); //2: qT max 0.06 2D, fDo2DQt=kTRUE + cuts.AddCutPCMCalo("00062113", "0dd00009f97300009ge0404000","24466190sa01cc00000", "0163103100000010"); //9: qT max 0.03 2D, fDo2DQt=kTRUE } else if (trainConfig == 2768) { // Psi pair 1D, std e == 0.18, fDo2DPsiPairChi2 = 2 // | - cuts.AddCutPCMCalo("00062113", "0dm00009f9730000dg50404000","24466190sa01cc00000", "0163103100000010"); //5: Psi pair 0.1 1D - cuts.AddCutPCMCalo("00062113", "0dm00009f9730000dg10404000","24466190sa01cc00000", "0163103100000010"); //1: Psi pair 0.1 1D - cuts.AddCutPCMCalo("00062113", "0dm00009f9730000dg60404000","24466190sa01cc00000", "0163103100000010"); //6: Psi pair 0.05 2D - cuts.AddCutPCMCalo("00062113", "0dm00009f9730000dg80404000","24466190sa01cc00000", "0163103100000010"); //8: Psi pair 0.2 2D + cuts.AddCutPCMCalo("00062113", "0dd00009f9730000dg50404000","24466190sa01cc00000", "0163103100000010"); //5: Psi pair 0.1 1D + cuts.AddCutPCMCalo("00062113", "0dd00009f9730000dg10404000","24466190sa01cc00000", "0163103100000010"); //1: Psi pair 0.1 1D + cuts.AddCutPCMCalo("00062113", "0dd00009f9730000dg60404000","24466190sa01cc00000", "0163103100000010"); //6: Psi pair 0.05 2D + cuts.AddCutPCMCalo("00062113", "0dd00009f9730000dg80404000","24466190sa01cc00000", "0163103100000010"); //8: Psi pair 0.2 2D } else if (trainConfig == 2769){ // qT 2D pT dep, std qt d == qTPtMax=0.125, qTMax=0.050, fDo2DQt=kTRUE, fDoQtGammaSelection=2, std 0 == off // | | - cuts.AddCutPCMCalo("00062113", "0dm00009f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //d,0: qT<0.110pT (2D) alpha<0.99 - cuts.AddCutPCMCalo("00062113", "0dm00009f9730000c259404000","24466190sa01cc00000", "0163103100000010"); //c,9: qT<0.110pT (2D) alpha<0.99 - cuts.AddCutPCMCalo("00062113", "0dm00009f9730000a259404000","24466190sa01cc00000", "0163103100000010"); //a,9: qT<0.125pT (2D) alpha<0.99 - cuts.AddCutPCMCalo("00062113", "0dm00009f9730000e259404000","24466190sa01cc00000", "0163103100000010"); //e,9: qT<0.130pT (2D) alpha<0.99 + cuts.AddCutPCMCalo("00062113", "0dd00009f9730000dge0404000","24466190sa01cc00000", "0163103100000010"); //d,0: qT<0.110pT (2D) alpha<0.99 + cuts.AddCutPCMCalo("00062113", "0dd00009f9730000c259404000","24466190sa01cc00000", "0163103100000010"); //c,9: qT<0.110pT (2D) alpha<0.99 + cuts.AddCutPCMCalo("00062113", "0dd00009f9730000a259404000","24466190sa01cc00000", "0163103100000010"); //a,9: qT<0.125pT (2D) alpha<0.99 + cuts.AddCutPCMCalo("00062113", "0dd00009f9730000e259404000","24466190sa01cc00000", "0163103100000010"); //e,9: qT<0.130pT (2D) alpha<0.99 } else if (trainConfig == 2770){ // chi2, PsiPair cont., std 2 == // | - cuts.AddCutPCMCalo("00062113", "0dm00009f97300008fd0404000","24466190sa01cc00000", "0163103100000010"); //f: PsiPair<0.15exp(-0.065chi2) - cuts.AddCutPCMCalo("00062113", "0dm00009f97300008ge0404000","24466190sa01cc00000", "0163103100000010"); //g: PsiPair<0.18exp(-0.055chi2) - cuts.AddCutPCMCalo("00062113", "0dm00009f97300008hf0404000","24466190sa01cc00000", "0163103100000010"); //h: PsiPair<0.20exp(-0.050chi2) + cuts.AddCutPCMCalo("00062113", "0dd00009f97300008fd0404000","24466190sa01cc00000", "0163103100000010"); //f: PsiPair<0.15exp(-0.065chi2) + cuts.AddCutPCMCalo("00062113", "0dd00009f97300008ge0404000","24466190sa01cc00000", "0163103100000010"); //g: PsiPair<0.18exp(-0.055chi2) + cuts.AddCutPCMCalo("00062113", "0dd00009f97300008hf0404000","24466190sa01cc00000", "0163103100000010"); //h: PsiPair<0.20exp(-0.050chi2) //---------------------------------------------------------------------------------------------------------------------------------------- @@ -3428,7 +3428,7 @@ void AddTask_GammaConvCalo_pp( // Variations for systematics PCM-EDC 13 TeV EG2 // Variations of EDC Part } else if ( trainConfig == 3100){ // EMCAL clusters wo trigger mimicing - cuts.AddCutPCMCalo("0008e113","0dm00009f9730000dge0404000","411790109fe30230000","0r63103100000010"); // STD + cuts.AddCutPCMCalo("0008e113","0dm00009f9730000dge0404000","411790109fe30220000","0r63103100000010"); // STD } else if (trainConfig == 3101){ // NL , STD without smearing // // cuts.AddCutPCMCalo("0008e113","0dm00009f9730000dge0404000","411799709fe30230000","0r63103100000010"); // EG2 NL97 @@ -3559,7 +3559,7 @@ void AddTask_GammaConvCalo_pp( // Variations for systematics PCM-EDC 13 TeV EG1 // Variations of EDC Part } else if ( trainConfig == 3200){ // EMCAL clusters wo trigger mimicing - cuts.AddCutPCMCalo("0008d113","0dm00009f9730000dge0404000","411790109fe30230000","0r63103100000010"); // STD + cuts.AddCutPCMCalo("0008d113","0dm00009f9730000dge0404000","411790109fe30220000","0r63103100000010"); // STD } else if (trainConfig == 3201){ // NL , STD without smearing // // cuts.AddCutPCMCalo("0008d113","0dm00009f9730000dge0404000","411799709fe30230000","0r63103100000010"); // EG1 NL97 @@ -3901,7 +3901,7 @@ void AddTask_GammaConvCalo_pp( // Variations for systematics PCM-EDC 13 TeV MB // Variations of EDC Part } else if ( trainConfig == 3500){ // EMCAL clusters wo trigger mimicing - cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","411790109fe30230000","0r63103100000010"); // STD + cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","411790109fe30220000","0r63103100000010"); // STD } else if (trainConfig == 3501){ // NL , STD without smearing // // cuts.AddCutPCMCalo("00010113","0dm00009f9730000dge0404000","411799709fe30230000","0r63103100000010"); // INT7 NL97 From e7b94ec31c7b3d61123ef159f4c949f980d3ab17 Mon Sep 17 00:00:00 2001 From: imsurajprasad786 Date: Fri, 21 Apr 2023 21:08:10 +0530 Subject: [PATCH 40/51] Analysis Tasks for efficiency correction --- PWGMM/UE/CMakeLists.txt | 1 + .../AddTaskFlatenicityLambdaK0s.C | 21 +- .../AddTaskFlatenicityLambdaK0sMC.C | 52 + .../AliAnalysisTaskFlatenicityLambdaK0s.cxx | 270 ++-- .../AliAnalysisTaskFlatenicityLambdaK0s.h | 5 +- .../AliAnalysisTaskFlatenicityLambdaK0sMC.cxx | 1369 +++++++++++++++++ .../AliAnalysisTaskFlatenicityLambdaK0sMC.h | 109 ++ PWGMM/UE/PWGMMueLinkDef.h | 3 + 8 files changed, 1721 insertions(+), 109 deletions(-) create mode 100644 PWGMM/UE/FlatenicityLambdaK0s/AddTaskFlatenicityLambdaK0sMC.C create mode 100644 PWGMM/UE/FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0sMC.cxx create mode 100644 PWGMM/UE/FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0sMC.h diff --git a/PWGMM/UE/CMakeLists.txt b/PWGMM/UE/CMakeLists.txt index 25f81aee453..afc81b717b3 100644 --- a/PWGMM/UE/CMakeLists.txt +++ b/PWGMM/UE/CMakeLists.txt @@ -54,6 +54,7 @@ set(SRCS Flatenicity/AliAnalysisTaskSpectraFlatenicity.cxx FlatenicityPiKp/AliAnalysisTaskFlatenicityPiKp.cxx FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0s.cxx + FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0sMC.cxx FlatenicityPiKp/AliAnalysisTaskdEdxCalibration.cxx ) diff --git a/PWGMM/UE/FlatenicityLambdaK0s/AddTaskFlatenicityLambdaK0s.C b/PWGMM/UE/FlatenicityLambdaK0s/AddTaskFlatenicityLambdaK0s.C index 88cf05f018c..c5bb16cd50b 100644 --- a/PWGMM/UE/FlatenicityLambdaK0s/AddTaskFlatenicityLambdaK0s.C +++ b/PWGMM/UE/FlatenicityLambdaK0s/AddTaskFlatenicityLambdaK0s.C @@ -31,10 +31,21 @@ AliAnalysisTaskFlatenicityLambdaK0s *AddTaskFlatenicityLambdaK0s(TString name = // in the end, this macro returns a pointer to your task. this will be convenient later on // when you will run your analysis in an analysis train on grid - gROOT->ProcessLine(".L $ALICE_PHYSICS/OADB/macros/AddTaskPhysicsSelection.C"); - Bool_t isMC = kFALSE; - Bool_t enablePileupCuts = kTRUE; - AliPhysicsSelectionTask *physSelTask = new AliPhysicsSelectionTask(); - physSelTask->AddTaskPhysicsSelection(isMC, enablePileupCuts); + // gROOT->ProcessLine(".L $ALICE_PHYSICS/OADB/macros/AddTaskPhysicsSelection.C"); + // Bool_t isMC = kFALSE; + // Bool_t enablePileupCuts = kTRUE; + // AliPhysicsSelectionTask *physSelTask = new AliPhysicsSelectionTask(); + // physSelTask->AddTaskPhysicsSelection(isMC, enablePileupCuts); + + // // load the macro and add the task + // TMacro PIDadd(gSystem->ExpandPathName("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C")); + // AliAnalysisTaskPIDResponse *PIDresponseTask = reinterpret_cast(PIDadd.Exec()); + + // gROOT->LoadMacro("$ALICE_PHYSICS/OADB/macros/AddTaskPIDResponse.C"); + // AddTaskPIDResponse(); + // Bool_t isMC = kFALSE; + // Bool_t enablePileupCuts = kTRUE; + // AliPhysicsSelectionTask *physSelTask = new AliPhysicsSelectionTask(); + // physSelTask->AddTaskPhysicsSelection(isMC, enablePileupCuts); return task; } diff --git a/PWGMM/UE/FlatenicityLambdaK0s/AddTaskFlatenicityLambdaK0sMC.C b/PWGMM/UE/FlatenicityLambdaK0s/AddTaskFlatenicityLambdaK0sMC.C new file mode 100644 index 00000000000..b97337cc9db --- /dev/null +++ b/PWGMM/UE/FlatenicityLambdaK0s/AddTaskFlatenicityLambdaK0sMC.C @@ -0,0 +1,52 @@ +AliAnalysisTaskFlatenicityLambdaK0sMC *AddTaskFlatenicityLambdaK0sMC(TString name = "name") +{ + // get the manager via the static access member. since it's static, you don't need + // to create an instance of the class here to call the function + AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); + if (!mgr) + { + return 0x0; + } + // get the input event handler, again via a static method. + // this handler is part of the managing system and feeds events + // to your task + if (!mgr->GetInputEventHandler()) + { + return 0x0; + } + // by default, a file is open for writing. here, we get the filename + TString fileName = AliAnalysisManager::GetCommonFileName(); + fileName += ":MyTask"; // create a subfolder in the file + // now we create an instance of your task + AliAnalysisTaskFlatenicityLambdaK0sMC *task = new AliAnalysisTaskFlatenicityLambdaK0sMC(name.Data()); + if (!task) + return 0x0; + // task->SelectCollisionCandidates(AliVEvent::kINT7); + // add your task to the manager + // your task needs input: here we connect the manager to your task + // mgr->AddTask(physSelTask); + mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); + // same for the output + mgr->ConnectOutput(task, 1, mgr->CreateContainer("MyOutputContainer", TList::Class(), AliAnalysisManager::kOutputContainer, fileName.Data())); + // mgr->ConnectOutput(task, 2, mgr->CreateContainer("MyOutputContainerMC", TList::Class(), AliAnalysisManager::kOutputContainer, fileName.Data())); + // in the end, this macro returns a pointer to your task. this will be convenient later on + // when you will run your analysis in an analysis train on grid + + // gROOT->ProcessLine(".L $ALICE_PHYSICS/OADB/macros/AddTaskPhysicsSelection.C"); + // Bool_t isMC = kTRUE; + // Bool_t enablePileupCuts = kTRUE; + // AliPhysicsSelectionTask *physSelTask = new AliPhysicsSelectionTask(); + // physSelTask->AddTaskPhysicsSelection(isMC, enablePileupCuts); + + // // load the macro and add the task + // TMacro PIDadd(gSystem->ExpandPathName("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C")); + // AliAnalysisTaskPIDResponse *PIDresponseTask = reinterpret_cast(PIDadd.Exec()); + + // gROOT->LoadMacro("$ALICE_PHYSICS/OADB/macros/AddTaskPIDResponse.C"); + // AddTaskPIDResponse(); + // Bool_t isMC = kFALSE; + // Bool_t enablePileupCuts = kTRUE; + // AliPhysicsSelectionTask *physSelTask = new AliPhysicsSelectionTask(); + // physSelTask->AddTaskPhysicsSelection(isMC, enablePileupCuts); + return task; +} diff --git a/PWGMM/UE/FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0s.cxx b/PWGMM/UE/FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0s.cxx index be39d1f45b2..1fbe59bbf14 100644 --- a/PWGMM/UE/FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0s.cxx +++ b/PWGMM/UE/FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0s.cxx @@ -28,7 +28,7 @@ class AliESDAD; // AD // class AliMCEventHandler; // class AliMCEvent; // class AliStack; - +class AliPIDResponse; class AliESDVertex; class AliAODVertex; class AliESDv0; @@ -97,7 +97,7 @@ using namespace std; ClassImp(AliAnalysisTaskFlatenicityLambdaK0s) AliAnalysisTaskFlatenicityLambdaK0s::AliAnalysisTaskFlatenicityLambdaK0s() - : AliAnalysisTaskSE(), fEventCuts(0), fESD(0), fOutputList(0), + : AliAnalysisTaskSE(), fEventCuts(0), fESDtrackCuts(0), fESD(0), fOutputList(0), hinvmassK0s(0), fPIDResponse(0), hinvmassLambda(0), hinvmassAntiLambda(0), hflat(0), fESDpid(0x0), treeK0s(0), treeLambda(0), treeAntiLambda(0), invmK0s(0), invpK0s(0), invptK0s(0), invyK0s(0), invmLambda(0), @@ -111,7 +111,7 @@ ClassImp(AliAnalysisTaskFlatenicityLambdaK0s) //_____________________________________________________________________________ AliAnalysisTaskFlatenicityLambdaK0s::AliAnalysisTaskFlatenicityLambdaK0s( const char *name) - : AliAnalysisTaskSE(name), fEventCuts(0), fESD(0), fOutputList(0), + : AliAnalysisTaskSE(name), fEventCuts(0), fESDtrackCuts(0), fESD(0), fOutputList(0), hinvmassK0s(0), fPIDResponse(0), hinvmassLambda(0), hinvmassAntiLambda(0), hflat(0), fESDpid(0x0), treeK0s(0), treeLambda(0), treeAntiLambda(0), invmK0s(0), invpK0s(0), invptK0s(0), invyK0s(0), invmLambda(0), @@ -178,11 +178,12 @@ void AliAnalysisTaskFlatenicityLambdaK0s::UserCreateOutputObjects() fOutputList->Add(treeK0s); fOutputList->Add(treeLambda); fOutputList->Add(treeAntiLambda); - AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager(); - AliInputEventHandler *inputHandler = - (AliInputEventHandler *)(man->GetInputEventHandler()); - fPIDResponse = inputHandler->GetPIDResponse(); - inputHandler->SetNeedField(); + + // AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager(); + // AliInputEventHandler *inputHandler = + // (AliInputEventHandler *)(man->GetInputEventHandler()); + // fPIDResponse = inputHandler->GetPIDResponse(); + fEventCuts.SetManualMode(); // Enable manual mode fEventCuts.fRequireTrackVertex = true; fEventCuts.fMinVtz = -10.f; @@ -193,11 +194,35 @@ void AliAnalysisTaskFlatenicityLambdaK0s::UserCreateOutputObjects() fEventCuts.fRejectDAQincomplete = true; fEventCuts.fSPDpileupMinContributors = 3; fEventCuts.fSPDpileupMinZdist = 0.8; - fEventCuts.fSPDpileupNsigmaZdist = 3.; - fEventCuts.fSPDpileupNsigmaDiamXY = 2.; - fEventCuts.fSPDpileupNsigmaDiamZ = 5.; + // fEventCuts.fSPDpileupNsigmaZdist = 3.; + // fEventCuts.fSPDpileupNsigmaDiamXY = 2.; + // fEventCuts.fSPDpileupNsigmaDiamZ = 5.; fEventCuts.fTrackletBGcut = true; fEventCuts.AddQAplotsToList(fOutputList); + + // // create track filters + // fTrackFilter = new AliAnalysisFilter("trackFilter"); + // AliESDtrackCuts *fCuts = new AliESDtrackCuts(); + // fCuts->SetAcceptKinkDaughters(kFALSE); + // fCuts->SetRequireTPCRefit(kTRUE); + // fCuts->SetRequireITSRefit(kTRUE); + // fCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny); + // fCuts->SetDCAToVertex2D(kFALSE); + // fCuts->SetRequireSigmaToVertex(kFALSE); + // fCuts->SetEtaRange(-0.8, 0.8); + // fCuts->SetMinNCrossedRowsTPC(70); + // fCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8); + // fCuts->SetMaxChi2PerClusterTPC(4); + // fCuts->SetMaxDCAToVertexZ(2); + // fCuts->SetCutGeoNcrNcl(3., 130., 1.5, 0.85, 0.7); + // fCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8); + // fCuts->SetMaxChi2PerClusterTPC(4); + // fCuts->SetMaxDCAToVertexZ(2); + // fCuts->SetMaxChi2PerClusterITS(36); + // fCuts->SetMaxDCAToVertexXYPtDep("0.0105+0.0350/pt^1.1"); + // fCuts->SetMaxChi2PerClusterITS(36); + // fTrackFilter->AddCuts(fCuts); + PostData(1, fOutputList); } //_____________________________________________________________________________ @@ -234,14 +259,11 @@ void AliAnalysisTaskFlatenicityLambdaK0s::UserExec(Option_t *) } if (lESDevent->IsIncompleteDAQ()) return; - AliAnalysisUtils *fUtils = new AliAnalysisUtils(); if (fUtils->IsSPDClusterVsTrackletBG(lESDevent)) return; - if (lESDevent->IsPileupFromSPD(3)) return; - // Bool_t maskIsSelected = // ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected(); // Bool_t isSelected = 0; @@ -254,7 +276,14 @@ void AliAnalysisTaskFlatenicityLambdaK0s::UserExec(Option_t *) // if ( ! isSelected ) { // return; // } - + AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager(); + if (man) + { + AliInputEventHandler *inputHandler = (AliInputEventHandler *)(man->GetInputEventHandler()); + if (inputHandler) + fPIDResponse = inputHandler->GetPIDResponse(); + inputHandler->SetNeedField(); + } //------------------------------------------------ // Step 3: Primary Vertex quality selection //------------------------------------------------ @@ -302,6 +331,13 @@ void AliAnalysisTaskFlatenicityLambdaK0s::UserExec(Option_t *) } Double_t lMagneticField = -10; + Int_t lMultiplicity = -100; + lMultiplicity = fESDtrackCuts->GetReferenceMultiplicity(lESDevent, AliESDtrackCuts::kTrackletsITSTPC, 0.8); + if (!(lMultiplicity >= 1)) + { + return; + } + lMagneticField = lESDevent->GetMagneticField(); Double_t flat = GetFlatenicityV0(); ((TH1D *)(fOutputList->FindObject("hflat")))->Fill(1.0 - flat); @@ -329,16 +365,20 @@ void AliAnalysisTaskFlatenicityLambdaK0s::UserExec(Option_t *) if (!v0) continue; - CheckChargeV0(v0); - // Remove like-sign (will not affect offline V0 candidates!) - if (v0->GetParamN()->Charge() > 0 && v0->GetParamP()->Charge() > 0) - { - continue; - } - if (v0->GetParamN()->Charge() < 0 && v0->GetParamP()->Charge() < 0) - { + // CheckChargeV0(v0); + // // Remove like-sign (will not affect offline V0 candidates!) + // if (v0->GetParamN()->Charge() > 0 && v0->GetParamP()->Charge() > 0) + // { + // continue; + // } + // if (v0->GetParamN()->Charge() < 0 && v0->GetParamP()->Charge() < 0) + // { + // continue; + // } + + lOnFlyStatus = v0->GetOnFlyStatus(); + if (lOnFlyStatus) continue; - } Double_t tDecayVertexV0[3]; v0->GetXYZ(tDecayVertexV0[0], tDecayVertexV0[1], tDecayVertexV0[2]); @@ -423,14 +463,10 @@ void AliAnalysisTaskFlatenicityLambdaK0s::UserExec(Option_t *) // Daughter Eta for Eta selection, afterwards Float_t fTreeVariableNegEta = nTrack->Eta(); Float_t fTreeVariablePosEta = pTrack->Eta(); - Bool_t fkExtraCleanup = kTRUE; - if (fkExtraCleanup) - { - if (TMath::Abs(fTreeVariableNegEta) > 0.8 || - TMath::Abs(fTreeVariableNegEta) > 0.8) - continue; - } + if (TMath::Abs(fTreeVariableNegEta) > 0.8 || + TMath::Abs(fTreeVariableNegEta) > 0.8) + continue; // Filter like-sign V0 (next: add counter and distribution) if (pTrack->GetSign() == nTrack->GetSign()) @@ -525,7 +561,7 @@ void AliAnalysisTaskFlatenicityLambdaK0s::UserExec(Option_t *) if ((((pTrack->GetTPCClusterInfo(2, 1)) < 70) || ((nTrack->GetTPCClusterInfo(2, 1)) < 70)) && - lSmallestTrackLength < 80 && fkExtraCleanup) + lSmallestTrackLength < 80) continue; // End track Quality Cuts @@ -540,7 +576,6 @@ void AliAnalysisTaskFlatenicityLambdaK0s::UserExec(Option_t *) if (lDcaPosToPrimVertex < 0.06 || lDcaNegToPrimVertex < 0.06) continue; - lOnFlyStatus = v0->GetOnFlyStatus(); lChi2V0 = v0->GetChi2V0(); lDcaV0Daughters = v0->GetDcaV0Daughters(); if (lDcaV0Daughters > 1) @@ -567,92 +602,121 @@ void AliAnalysisTaskFlatenicityLambdaK0s::UserExec(Option_t *) // lAlphaV0 = v0->AlphaV0(); // lPtArmV0 = v0->PtArmV0(); + // Official means of acquiring N-sigmas + Float_t NSigmasPosProton = fPIDResponse->NumberOfSigmasTPC(pTrack, AliPID::kProton); + Float_t NSigmasPosPion = fPIDResponse->NumberOfSigmasTPC(pTrack, AliPID::kPion); + Float_t NSigmasNegProton = fPIDResponse->NumberOfSigmasTPC(nTrack, AliPID::kProton); + Float_t NSigmasNegPion = fPIDResponse->NumberOfSigmasTPC(nTrack, AliPID::kPion); + + // K0Short: Enough to parametrize peak broadening with linear function. + Double_t lUpperLimitK0Short = (5.63707e-01) + (1.14979e-02) * lPt; + Double_t lLowerLimitK0Short = (4.30006e-01) - (1.10029e-02) * lPt; + // Lambda: Linear (for higher pt) plus exponential (for low-pt broadening) + //[0]+[1]*x+[2]*TMath::Exp(-[3]*x) + Double_t lUpperLimitLambda = (1.13688e+00) + (5.27838e-03) * lPt + (8.42220e-02) * TMath::Exp(-(3.80595e+00) * lPt); + Double_t lLowerLimitLambda = (1.09501e+00) - (5.23272e-03) * lPt - (7.52690e-02) * TMath::Exp(-(3.46339e+00) * lPt); + v0->ChangeMassHypothesis(310); lInvMassK0s = v0->GetEffMass(); - if (TMath::Abs(lInvMassK0s - 0.497611) < 0.1) + if (lInvMassK0s < lUpperLimitK0Short && lInvMassK0s > lLowerLimitK0Short) { - if (lV0CosineOfPointingAngle < 0.97) - continue; - Float_t lPtK0s = v0->Pt(); - Float_t lPzK0s = v0->Pz(); - if (lPtK0s == 0) - continue; - Float_t lRapK0s = v0->Y(310); - if (TMath::Abs(lRapK0s) > 0.5) - continue; - - Float_t ctauK0s = lV0DecayLength * lInvMassK0s / v0->P(); - if (ctauK0s > 20) - continue; - ((TH1F *)(fOutputList->FindObject("hinvmassK0s")))->Fill(lInvMassK0s); - invmK0s = v0->GetEffMass(); - invpK0s = v0->P(); - invptK0s = v0->Pt(); - invyK0s = lRapK0s; - flatenicityK0s = 1.0 - flat; - ((TTree *)(fOutputList->FindObject("treeK0s")))->Fill(); + if (lV0CosineOfPointingAngle > 0.97) + { + Float_t lPtK0s = v0->Pt(); + Float_t lPzK0s = v0->Pz(); + if (lPtK0s != 0) + { + Float_t lRapK0s = v0->Y(310); + if (TMath::Abs(lRapK0s) < 0.5) + { + Float_t ctauK0s = lV0DecayLength * lInvMassK0s / v0->P(); + if (ctauK0s < 20) + { + if (TMath::Abs(NSigmasPosPion) < 5.0 && TMath::Abs(NSigmasNegPion) < 5.0) + { + ((TH1F *)(fOutputList->FindObject("hinvmassK0s")))->Fill(lInvMassK0s); + invmK0s = v0->GetEffMass(); + invpK0s = v0->P(); + invptK0s = v0->Pt(); + invyK0s = lRapK0s; + flatenicityK0s = 1.0 - flat; + ((TTree *)(fOutputList->FindObject("treeK0s")))->Fill(); + } + } + } + } + } } + Float_t massLambda = 1.11568; v0->ChangeMassHypothesis(3122); lInvMassLambda = v0->GetEffMass(); - if (TMath::Abs(lInvMassLambda - massLambda) < 0.1) + if (lInvMassLambda < lUpperLimitLambda && lInvMassLambda > lLowerLimitLambda) { - if (lV0CosineOfPointingAngle < 0.995) - continue; - - Float_t lPtLambda = v0->Pt(); - Float_t lPzLambda = v0->Pz(); - if (lPtLambda == 0) - continue; - Float_t lRapLambda = v0->Y(3122); - if (TMath::Abs(lRapLambda) > 0.5) - continue; - Float_t ctauLambda = lV0DecayLength * lInvMassLambda / v0->P(); - if (ctauLambda > 30) - continue; - - invmLambda = v0->GetEffMass(); - invpLambda = v0->P(); - invptLambda = v0->Pt(); - invyLambda = lRapLambda; - flatenicityLambda = 1.0 - flat; - - ((TTree *)(fOutputList->FindObject("treeLambda")))->Fill(); - ((TH1F *)(fOutputList->FindObject("hinvmassLambda"))) - ->Fill(lInvMassLambda); + if (lV0CosineOfPointingAngle > 0.995) + { + Float_t lPtLambda = v0->Pt(); + Float_t lPzLambda = v0->Pz(); + if (lPtLambda != 0) + { + Float_t lRapLambda = v0->Y(3122); + if (TMath::Abs(lRapLambda) < 0.5) + { + Float_t ctauLambda = lV0DecayLength * lInvMassLambda / v0->P(); + if (ctauLambda < 30) + { + if (TMath::Abs(NSigmasPosProton) < 5.0 && TMath::Abs(NSigmasNegPion) < 5.0) + { + invmLambda = v0->GetEffMass(); + invpLambda = v0->P(); + invptLambda = v0->Pt(); + invyLambda = lRapLambda; + flatenicityLambda = 1.0 - flat; + + ((TTree *)(fOutputList->FindObject("treeLambda")))->Fill(); + ((TH1F *)(fOutputList->FindObject("hinvmassLambda")))->Fill(lInvMassLambda); + } + } + } + } + } } v0->ChangeMassHypothesis(-3122); lInvMassAntiLambda = v0->GetEffMass(); - if (TMath::Abs(lInvMassAntiLambda - massLambda) < 0.1) + if (lInvMassAntiLambda < lUpperLimitLambda && lInvMassAntiLambda > lLowerLimitLambda) { - if (lV0CosineOfPointingAngle < 0.995) - continue; - - Float_t lPtAntiLambda = v0->Pt(); - Float_t lPzAntiLambda = v0->Pz(); - - if (lPtAntiLambda == 0) - continue; - Float_t lRapAntiLambda = v0->Y(-3122); - if (TMath::Abs(lRapAntiLambda) > 0.5) - continue; - Float_t ctauAntiLambda = lV0DecayLength * lInvMassAntiLambda / v0->P(); - if (ctauAntiLambda > 30) - continue; - - invmAntiLambda = v0->GetEffMass(); - invpAntiLambda = v0->P(); - invptAntiLambda = v0->Pt(); - invyAntiLambda = lRapAntiLambda; - flatenicityAntiLambda = 1.0 - flat; - - ((TTree *)(fOutputList->FindObject("treeAntiLambda")))->Fill(); - ((TH1F *)(fOutputList->FindObject("hinvmassAntiLambda"))) - ->Fill(lInvMassAntiLambda); + if (lV0CosineOfPointingAngle > 0.995) + { + Float_t lPtAntiLambda = v0->Pt(); + Float_t lPzAntiLambda = v0->Pz(); + + if (lPtAntiLambda != 0) + { + Float_t lRapAntiLambda = v0->Y(-3122); + if (TMath::Abs(lRapAntiLambda) < 0.5) + { + Float_t ctauAntiLambda = lV0DecayLength * lInvMassAntiLambda / v0->P(); + if (ctauAntiLambda < 30) + { + if (TMath::Abs(NSigmasNegProton) < 5.0 && TMath::Abs(NSigmasPosPion) < 5.0) + { + invmAntiLambda = v0->GetEffMass(); + invpAntiLambda = v0->P(); + invptAntiLambda = v0->Pt(); + invyAntiLambda = lRapAntiLambda; + flatenicityAntiLambda = 1.0 - flat; + + ((TTree *)(fOutputList->FindObject("treeAntiLambda")))->Fill(); + ((TH1F *)(fOutputList->FindObject("hinvmassAntiLambda")))->Fill(lInvMassAntiLambda); + } + } + } + } + } } } diff --git a/PWGMM/UE/FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0s.h b/PWGMM/UE/FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0s.h index ff2f99fab01..99e4847f644 100644 --- a/PWGMM/UE/FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0s.h +++ b/PWGMM/UE/FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0s.h @@ -9,6 +9,8 @@ class AliESDtrackCuts; class AliESDAD; class AliESDEvent; +class AliAnalysisUtils; +class AliPIDResponse; class AliAnalysisTaskFlatenicityLambdaK0s : public AliAnalysisTaskSE { public: @@ -33,12 +35,13 @@ class AliAnalysisTaskFlatenicityLambdaK0s : public AliAnalysisTaskSE TH1F *hinvmassLambda; //! dummy histogram TH1F *hinvmassAntiLambda; //! dummy histogram TH1F *hflat; //! dummy histogram - +// AliAnalysisFilter *fTrackFilter; Float_t invmK0s; Float_t invpK0s; Float_t invptK0s; Float_t invyK0s; Float_t flatenicityK0s; + AliESDtrackCuts *fESDtrackCuts; // ESD track cuts used for primary track definition TTree *treeK0s; diff --git a/PWGMM/UE/FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0sMC.cxx b/PWGMM/UE/FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0sMC.cxx new file mode 100644 index 00000000000..4517fe38a60 --- /dev/null +++ b/PWGMM/UE/FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0sMC.cxx @@ -0,0 +1,1369 @@ +/************************************************************************** + * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * + * * + * Author: The ALICE Off-line Project. * + * Contributors are mentioned in the code where appropriate. * + * * + * Permission to use, copy, modify and distribute this software and its * + * documentation strictly for non-commercial purposes is hereby granted * + * without fee, provided that the above copyright notice appears in all * + * copies and that both the copyright notice and this permission notice * + * appear in the supporting documentation. The authors make no claims * + * about the suitability of this software for any purpose. It is * + * provided "as is" without express or implied warranty. * + **************************************************************************/ + +/* AliAnaysisTaskMyTask + * + * empty task which can serve as a starting point for building an analysis + * as an example, one histogram is filled + */ + +#include "AliVEvent.h" +class TTree; +class TParticle; +class TVector3; +class AliESDtrackCuts; +class AliESDAD; // AD +class AliMCEventHandler; +class AliMCEvent; +class AliStack; +class AliPIDResponse; +class AliESDVertex; +class AliAODVertex; +class AliESDv0; +class AliAODv0; +#include "AliESDAD.h" //AD +#include "TCanvas.h" +#include "TChain.h" +#include "TDatabasePDG.h" +#include "TFile.h" +#include "TH1.h" +#include "TH2.h" +#include "TH3.h" +#include "THnSparse.h" +#include "TLegend.h" +#include "TList.h" +#include "TLorentzVector.h" +#include "TMath.h" +#include "TProfile.h" +#include "TRandom3.h" +#include "TVector3.h" +#include + +// #include "AliLog.h" + +#include "AliAODEvent.h" +#include "AliAnalysisManager.h" +#include "AliCascadeVertexer.h" +#include "AliCentrality.h" +#include "AliESDEvent.h" +#include "AliESDpid.h" +#include "AliESDtrack.h" +#include "AliESDtrackCuts.h" +#include "AliExternalTrackParam.h" +#include "AliInputEventHandler.h" +#include "AliMCEvent.h" +#include "AliMCEventHandler.h" +#include "AliMultEstimator.h" +#include "AliMultInput.h" +#include "AliMultSelection.h" +#include "AliMultVariable.h" +#include "AliOADBContainer.h" +#include "AliOADBMultSelection.h" +#include "AliStack.h" +#include "AliV0vertexer.h" + +#include "AliAODMCParticle.h" +#include "AliAODcascade.h" +#include "AliAnalysisTaskSE.h" +#include "AliAnalysisUtils.h" +#include "AliCFContainer.h" +#include "AliESDUtils.h" +#include "AliESDcascade.h" +#include "AliEventCuts.h" +#include "AliGenEventHeader.h" +#include "AliMultiplicity.h" +#include "AliPPVsMultUtils.h" + +using std::cout; +using std::endl; +#include "AliAnalysisTaskFlatenicityLambdaK0sMC.h" + +class AliAnalysisTaskFlatenicityLambdaK0sMC; + +using namespace std; + +ClassImp(AliAnalysisTaskFlatenicityLambdaK0sMC) + + AliAnalysisTaskFlatenicityLambdaK0sMC:: + AliAnalysisTaskFlatenicityLambdaK0sMC() + : AliAnalysisTaskSE(), fEventCuts(0), fESDtrackCuts(0), fESD(0), + fOutputList(0), hinvmassK0s(0), fPIDResponse(0), + hinvmassLambda(0), hinvmassAntiLambda(0), hflat(0), fESDpid(0x0), + treeK0s(0), treeLambda(0), treeAntiLambda(0), invmK0s(0), invpK0s(0), + invptK0s(0), invyK0s(0), invmLambda(0), invpLambda(0), invptLambda(0), + invyLambda(0), invmAntiLambda(0), invpAntiLambda(0), invptAntiLambda(0), + invyAntiLambda(0), flatenicityK0s(0), flatenicityLambda(0), + flatenicityAntiLambda(0), hinvmassK0sMC(0), hinvmassLambdaMC(0), + hinvmassAntiLambdaMC(0), hNeventMC(0), treeK0sMC(0), treeLambdaMC(0), + treeAntiLambdaMC(0), invmK0sMC(0), invpzK0sMC(0), invptK0sMC(0), + invyK0sMC(0), invmLambdaMC(0), invpzLambdaMC(0), invptLambdaMC(0), + invyLambdaMC(0), invmAntiLambdaMC(0), invpzAntiLambdaMC(0), + invptAntiLambdaMC(0), invyAntiLambdaMC(0), flatenicityK0sMC(0), + flatenicityLambdaMC(0), flatenicityAntiLambdaMC(0) +{ + // default constructor, don't allocate memory here! + // this is used by root for IO purposes, it needs to remain empty +} +//_____________________________________________________________________________ +AliAnalysisTaskFlatenicityLambdaK0sMC::AliAnalysisTaskFlatenicityLambdaK0sMC( + const char *name) + : AliAnalysisTaskSE(name), fEventCuts(0), fESDtrackCuts(0), fESD(0), + fOutputList(0), hinvmassK0s(0), fPIDResponse(0), + hinvmassLambda(0), hinvmassAntiLambda(0), hflat(0), fESDpid(0x0), + treeK0s(0), treeLambda(0), treeAntiLambda(0), invmK0s(0), invpK0s(0), + invptK0s(0), invyK0s(0), invmLambda(0), invpLambda(0), invptLambda(0), + invyLambda(0), invmAntiLambda(0), invpAntiLambda(0), invptAntiLambda(0), + invyAntiLambda(0), flatenicityK0s(0), flatenicityLambda(0), + flatenicityAntiLambda(0), hinvmassK0sMC(0), hinvmassLambdaMC(0), + hinvmassAntiLambdaMC(0), hNeventMC(0), treeK0sMC(0), treeLambdaMC(0), + treeAntiLambdaMC(0), invmK0sMC(0), invpzK0sMC(0), invptK0sMC(0), + invyK0sMC(0), invmLambdaMC(0), invpzLambdaMC(0), invptLambdaMC(0), + invyLambdaMC(0), invmAntiLambdaMC(0), invpzAntiLambdaMC(0), + invptAntiLambdaMC(0), invyAntiLambdaMC(0), flatenicityK0sMC(0), + flatenicityLambdaMC(0), flatenicityAntiLambdaMC(0) +{ + + DefineInput(0, TChain::Class()); + DefineOutput(1, TList::Class()); +} +//_____________________________________________________________________________ +AliAnalysisTaskFlatenicityLambdaK0sMC:: + ~AliAnalysisTaskFlatenicityLambdaK0sMC() +{ + // destructor + if (fOutputList) + { + delete fOutputList; // at the end of your task, it is deleted from memory by + // calling this function + } +} +//_____________________________________________________________________________ +void AliAnalysisTaskFlatenicityLambdaK0sMC::UserCreateOutputObjects() +{ + fOutputList = new TList(); + fOutputList->SetOwner(kTRUE); + + hinvmassK0s = new TH1F("hinvmassK0s", "hinvmassK0s", 100, 0.41, 0.58); + hinvmassLambda = + new TH1F("hinvmassLambda", "hinvmassLambda", 100, 1.08, 1.15); + hinvmassAntiLambda = + new TH1F("hinvmassAntiLambda", "hinvmassAntiLambda", 100, 1.08, 1.15); + hflat = new TH1F("hflat", "hflat", 101, -0.005, 1.005); + + treeK0s = new TTree("treeK0s", "treeK0s"); + treeK0s->Branch("invmK0s", &invmK0s, "invmK0s/F"); + treeK0s->Branch("invpK0s", &invpK0s, "invpK0s/F"); + treeK0s->Branch("invptK0s", &invptK0s, "invptK0s/F"); + treeK0s->Branch("invyK0s", &invyK0s, "invyK0s/F"); + treeK0s->Branch("flatenicityK0s", &flatenicityK0s, "flatenicityK0s/F"); + + treeLambda = new TTree("treeLambda", "treeLambda"); + treeLambda->Branch("invmLambda", &invmLambda, "invmLambda/F"); + treeLambda->Branch("invpLambda", &invpLambda, "invpLambda/F"); + treeLambda->Branch("invptLambda", &invptLambda, "invptLambda/F"); + treeLambda->Branch("invyLambda", &invyLambda, "invyLambda/F"); + treeLambda->Branch("flatenicityLambda", &flatenicityLambda, + "flatenicityLambda/F"); + + treeAntiLambda = new TTree("treeAntiLambda", "treeAntiLambda"); + treeAntiLambda->Branch("invmAntiLambda", &invmAntiLambda, "invmAntiLambda/F"); + treeAntiLambda->Branch("invpAntiLambda", &invpAntiLambda, "invpAntiLambda/F"); + treeAntiLambda->Branch("invptAntiLambda", &invptAntiLambda, + "invptAntiLambda/F"); + treeAntiLambda->Branch("invyAntiLambda", &invyAntiLambda, "invyAntiLambda/F"); + treeAntiLambda->Branch("flatenicityAntiLambda", &flatenicityAntiLambda, + "flatenicityAntiLambda/F"); + + fOutputList->Add(hinvmassK0s); + fOutputList->Add(hinvmassLambda); + fOutputList->Add(hinvmassAntiLambda); + fOutputList->Add(hflat); + fOutputList->Add(treeK0s); + fOutputList->Add(treeLambda); + fOutputList->Add(treeAntiLambda); + + // hinvmassK0sMC = new TH1F("hinvmassK0sMC", "hinvmassK0sMC", 100, 0.41, 0.58); + // hinvmassLambdaMC = + // new TH1F("hinvmassLambdaMC", "hinvmassLambdaMC", 100, 1.08, 1.15); + // hinvmassAntiLambdaMC = + // new TH1F("hinvmassAntiLambdaMC", "hinvmassAntiLambdaMC", 100, 1.08, 1.15); + hNeventMC = new TH1F("hNeventMC", "hNeventMC", 101, -0.005, 1.005); + + treeK0sMC = new TTree("treeK0sMC", "treeK0sMC"); + // treeK0sMC->Branch("invmK0sMC", &invmK0sMC, "invmK0sMC/F"); + treeK0sMC->Branch("invpzK0sMC", &invpzK0sMC, "invpzK0sMC/F"); + treeK0sMC->Branch("invptK0sMC", &invptK0sMC, "invptK0sMC/F"); + treeK0sMC->Branch("invyK0sMC", &invyK0sMC, "invyK0sMC/F"); + // treeK0sMC->Branch("flatenicityK0sMC", &flatenicityK0sMC, + // "flatenicityK0sMC/F"); + + treeLambdaMC = new TTree("treeLambdaMC", "treeLambdaMC"); + // treeLambdaMC->Branch("invmLambdaMC", &invmLambdaMC, "invmLambdaMC/F"); + treeLambdaMC->Branch("invpzLambdaMC", &invpzLambdaMC, "invpzLambdaMC/F"); + treeLambdaMC->Branch("invptLambdaMC", &invptLambdaMC, "invptLambdaMC/F"); + treeLambdaMC->Branch("invyLambdaMC", &invyLambdaMC, "invyLambdaMC/F"); + // treeLambdaMC->Branch("flatenicityLambdaMC", &flatenicityLambdaMC, + // "flatenicityLambdaMC/F"); + + treeAntiLambdaMC = new TTree("treeAntiLambdaMC", "treeAntiLambdaMC"); + // treeAntiLambdaMC->Branch("invmAntiLambdaMC", &invmAntiLambdaMC, + // "invmAntiLambdaMC/F"); + treeAntiLambdaMC->Branch("invpzAntiLambdaMC", &invpzAntiLambdaMC, + "invpzAntiLambdaMC/F"); + treeAntiLambdaMC->Branch("invptAntiLambdaMC", &invptAntiLambdaMC, + "invptAntiLambdaMC/F"); + treeAntiLambdaMC->Branch("invyAntiLambdaMC", &invyAntiLambdaMC, + "invyAntiLambdaMC/F"); + // treeAntiLambdaMC->Branch("flatenicityAntiLambdaMC", &flatenicityAntiLambdaMC, + // "flatenicityAntiLambdaMC/F"); + + // fOutputList->Add(hinvmassK0sMC); + // fOutputList->Add(hinvmassLambdaMC); + // fOutputList->Add(hinvmassAntiLambdaMC); + fOutputList->Add(hNeventMC); + fOutputList->Add(treeK0sMC); + fOutputList->Add(treeLambdaMC); + fOutputList->Add(treeAntiLambdaMC); + // AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager(); + // AliInputEventHandler *inputHandler = + // (AliInputEventHandler *)(man->GetInputEventHandler()); + // fPIDResponse = inputHandler->GetPIDResponse(); + + fEventCuts.SetManualMode(); // Enable manual mode + fEventCuts.fRequireTrackVertex = true; + fEventCuts.fMinVtz = -10.f; + fEventCuts.fMaxVtz = 10.f; + fEventCuts.fMaxDeltaSpdTrackAbsolute = 0.5f; + fEventCuts.fMaxResolutionSPDvertex = 0.25f; + fEventCuts.fTriggerMask = AliVEvent::kINT7; + fEventCuts.fRejectDAQincomplete = true; + fEventCuts.fSPDpileupMinContributors = 3; + fEventCuts.fSPDpileupMinZdist = 0.8; + // fEventCuts.fSPDpileupNsigmaZdist = 3.; + // fEventCuts.fSPDpileupNsigmaDiamXY = 2.; + // fEventCuts.fSPDpileupNsigmaDiamZ = 5.; + fEventCuts.fTrackletBGcut = true; + fEventCuts.AddQAplotsToList(fOutputList); + + // // create track filters + // fTrackFilter = new AliAnalysisFilter("trackFilter"); + // AliESDtrackCuts *fCuts = new AliESDtrackCuts(); + // fCuts->SetAcceptKinkDaughters(kFALSE); + // fCuts->SetRequireTPCRefit(kTRUE); + // fCuts->SetRequireITSRefit(kTRUE); + // fCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD, + // AliESDtrackCuts::kAny); fCuts->SetDCAToVertex2D(kFALSE); + // fCuts->SetRequireSigmaToVertex(kFALSE); + // fCuts->SetEtaRange(-0.8, 0.8); + // fCuts->SetMinNCrossedRowsTPC(70); + // fCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8); + // fCuts->SetMaxChi2PerClusterTPC(4); + // fCuts->SetMaxDCAToVertexZ(2); + // fCuts->SetCutGeoNcrNcl(3., 130., 1.5, 0.85, 0.7); + // fCuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8); + // fCuts->SetMaxChi2PerClusterTPC(4); + // fCuts->SetMaxDCAToVertexZ(2); + // fCuts->SetMaxChi2PerClusterITS(36); + // fCuts->SetMaxDCAToVertexXYPtDep("0.0105+0.0350/pt^1.1"); + // fCuts->SetMaxChi2PerClusterITS(36); + // fTrackFilter->AddCuts(fCuts); + + PostData(1, fOutputList); +} +//_____________________________________________________________________________ +void AliAnalysisTaskFlatenicityLambdaK0sMC::UserExec(Option_t *) +{ + + AliVEvent *event = InputEvent(); + if (!event) + { + Error("UserExec", "Could not retrieve event"); + return; + } + AliESDEvent *lESDevent = 0x0; + + lESDevent = dynamic_cast(event); + if (!lESDevent) + { + AliWarning("ERROR: lESDevent not available \n"); + return; + } + + AliMCEvent *mcEvent = MCEvent(); + if (!mcEvent) + { + Printf("ERROR: Could not retrieve MC event"); + return; + } + + AliStack *lMCstack = NULL; + + lMCstack = mcEvent->Stack(); + if (!lMCstack) + { + Printf("ERROR: Could not retrieve stack"); + return; + } + + TArrayF mcPrimaryVtx; + AliGenEventHeader *mcHeader = mcEvent->GenEventHeader(); + if (!mcHeader) + return; + mcHeader->PrimaryVertex(mcPrimaryVtx); + + Int_t iNumberOfPrimaries = -1; + iNumberOfPrimaries = lMCstack->GetNprimary(); + if (iNumberOfPrimaries < 1) + return; + + ////////////////// + + // AliMCEventHandler* eventHandler = dynamic_cast + // (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()); + // if (!eventHandler) { + // Printf("ERROR: Could not retrieve MC event handler"); + // return; + // } + + // AliGenEventHeader* mcHeader=mcEvent->GenEventHeader(); + // if(!mcHeader) return; + // mcHeader->PrimaryVertex(mcPrimaryVtx); + + // if (TMath::Abs(mcPrimaryVtx.At(2)) > cutPrimVertex) return; /// cut on z + // of prim. vertex !!!!!! + + //////////////// + // cout << event->GetFiredTriggerClasses() << endl; + + if (!fEventCuts.AcceptEvent(event)) + { + // PostData(1, fOutputList); + return; + } + + AliVVZERO *esdV0 = lESDevent->GetVZEROData(); + if (!esdV0) + { + AliError("AliVVZERO not available"); + return; + } + if (lESDevent->IsIncompleteDAQ()) + return; + AliAnalysisUtils *fUtils = new AliAnalysisUtils(); + if (fUtils->IsSPDClusterVsTrackletBG(lESDevent)) + return; + if (lESDevent->IsPileupFromSPD(3)) + return; + // Bool_t maskIsSelected = + // ((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected(); + // Bool_t isSelected = 0; + // //isSelected = (maskIsSelected & AliVEvent::kMB) == AliVEvent::kMB; + // // Bool_t maskIsSelected=1; + // //pA triggering: CINT7 + // isSelected = (maskIsSelected & AliVEvent::kINT7) == AliVEvent::kINT7; + + // //Standard Min-Bias Selection + // if ( ! isSelected ) { + // return; + // } + AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager(); + if (man) + { + AliInputEventHandler *inputHandler = + (AliInputEventHandler *)(man->GetInputEventHandler()); + if (inputHandler) + fPIDResponse = inputHandler->GetPIDResponse(); + inputHandler->SetNeedField(); + } + //------------------------------------------------ + // Step 3: Primary Vertex quality selection + //------------------------------------------------ + const AliESDVertex *lESDPrimaryTrackingVtx = + lESDevent->GetPrimaryVertexTracks(); + const AliESDVertex *lESDPrimarySPDVtx = lESDevent->GetPrimaryVertexSPD(); + const AliESDVertex *lPrimaryBestESDVtx = lESDevent->GetPrimaryVertex(); + + //------------------------------------------------ + // Step 3.1: reject events if SPDVtx or TrackVtx is not available + //------------------------------------------------ + if (!(lESDPrimarySPDVtx->GetStatus() && + lESDPrimaryTrackingVtx->GetStatus())) + { + return; + } + + //------------------------------------------------ + // Step 3.2: check the spd vertex resolution and reject if not satisfied + //------------------------------------------------ + if (lESDPrimarySPDVtx->GetStatus() && lESDPrimarySPDVtx->IsFromVertexerZ() && + !(lESDPrimarySPDVtx->GetDispersion() < 0.04 && + lESDPrimarySPDVtx->GetZRes() < 0.25)) + { + return; + } + + //------------------------------------------------ + // Step 3.3: check the proximity between the spd vertex and trak vertex, and + // reject if not satisfied + //------------------------------------------------ + if ((TMath::Abs(lESDPrimarySPDVtx->GetZ() - lESDPrimaryTrackingVtx->GetZ()) > + 0.5)) + { + return; + } + const AliESDVertex *lPrimaryBestESDVtx1 = lESDevent->GetPrimaryVertex(); + if (!lPrimaryBestESDVtx1) + { + return; + } + Double_t lBestPrimaryVtxPos[3] = {-100.0, -100.0, -100.0}; + lPrimaryBestESDVtx->GetXYZ(lBestPrimaryVtxPos); + + if (TMath::Abs(lBestPrimaryVtxPos[2]) > 10.0) + { + return; + } + Double_t lMagneticField = -10; + + Int_t lMultiplicity = -100; + lMultiplicity = fESDtrackCuts->GetReferenceMultiplicity( + lESDevent, AliESDtrackCuts::kTrackletsITSTPC, 0.8); + if (!(lMultiplicity >= 1)) + { + return; + } + + //==========================================MC + // START========================================= + Int_t lNbMCPrimary = 0; + + Int_t lPdgcodeCurrentPart = 0; + Double_t lRapCurrentPart = 0; + Double_t lPtCurrentPart = 0; + + // Int_t lComeFromSigma = 0; + + // current mc particle 's mother + // Int_t iCurrentMother = 0; + lNbMCPrimary = lMCstack->GetNprimary(); + Long_t lNumberOfCharged = 0; + + //----- Loop on Stack + //---------------------------------------------------------------- + for (Int_t iCurrentLabelStack = 0; + iCurrentLabelStack < (lMCstack->GetNtrack()); + iCurrentLabelStack++) + { // This is the begining of the loop on tracks + TParticle *particleOne = lMCstack->Particle(iCurrentLabelStack); + if (!particleOne) + continue; + if (!particleOne->GetPDG()) + continue; + Double_t lThisCharge = particleOne->GetPDG()->Charge() / 3.; + if (TMath::Abs(lThisCharge) < 0.001) + continue; + if (!(lMCstack->IsPhysicalPrimary(iCurrentLabelStack))) + continue; + + // Double_t gpt = particleOne -> Pt(); + Double_t geta = particleOne->Eta(); + + if (TMath::Abs(geta) < 0.5) + lNumberOfCharged++; + } // End of loop on tracks + //----- End Loop on Stack + //------------------------------------------------------------ + + // Double_t lpArapidityShift = 0.465; + Bool_t lStackNatural = kTRUE; + //----- Loop on Lambda, K0Short + //---------------------------------------------------------------- + for (Int_t iCurrentLabelStack = 0; + iCurrentLabelStack < (lMCstack->GetNtrack()); + iCurrentLabelStack++) + { // This is the begining of the loop on tracks + + TParticle *lCurrentParticleForLambdaCheck = 0x0; + lCurrentParticleForLambdaCheck = lMCstack->Particle(iCurrentLabelStack); + if (!lCurrentParticleForLambdaCheck) + { + Printf("V0s loop %d - MC TParticle pointer to current stack particle = " + "0x0 ! Skip ...\n", + iCurrentLabelStack); + continue; + } + + //================================================================================= + // Single-Strange checks + // Keep only K0s, Lambda and AntiLambda: + lPdgcodeCurrentPart = lCurrentParticleForLambdaCheck->GetPdgCode(); + + if ((lCurrentParticleForLambdaCheck->GetPdgCode() == 310) || + (lCurrentParticleForLambdaCheck->GetPdgCode() == 3122) || + (lCurrentParticleForLambdaCheck->GetPdgCode() == -3122)) + { + lRapCurrentPart = MyRapidity(lCurrentParticleForLambdaCheck->Energy(), + lCurrentParticleForLambdaCheck->Pz()); + lPtCurrentPart = lCurrentParticleForLambdaCheck->Pt(); + + // Use Close to PV for filling CloseToPV histograms! + Double_t dx, dy, dz; + + dx = ((mcPrimaryVtx.At(0)) - (lCurrentParticleForLambdaCheck->Vx())); + dy = ((mcPrimaryVtx.At(1)) - (lCurrentParticleForLambdaCheck->Vy())); + dz = ((mcPrimaryVtx.At(2)) - (lCurrentParticleForLambdaCheck->Vz())); + Double_t lDistToPV = TMath::Sqrt(dx * dx + dy * dy + dz * dz); + // if (lDistToPV <= 0.001) + // { + // if (lPdgcodeCurrentPart == 3122) + // { + // f3dHistPrimCloseToPVPtVsYVsMultLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicity); + // } + // if (lPdgcodeCurrentPart == -3122) + // { + // f3dHistPrimCloseToPVPtVsYVsMultAntiLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicity); + // } + // if (lPdgcodeCurrentPart == 310) + // { + // f3dHistPrimCloseToPVPtVsYVsMultK0Short->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicity); + // } + // } + + // Use Physical Primaries only for filling PrimRaw Histograms! + // if (lMCstack->IsPhysicalPrimary(iCurrentLabelStack) != kTRUE) + // continue; + + lStackNatural = mcEvent->IsFromBGEvent(iCurrentLabelStack); // Is it? + if (!lStackNatural) + { + if (!(lCurrentParticleForLambdaCheck->GetFirstMother() < 0)) + { + lStackNatural = kTRUE; // because there are primaries (ALICE + // definition) not produced in the collision + } + } + + if (lPdgcodeCurrentPart == 3122) + { + if (TMath::Abs(lRapCurrentPart) <= 0.5) + { + invpzLambdaMC = lCurrentParticleForLambdaCheck->Pz(); + invptLambdaMC = lPtCurrentPart; + invyLambdaMC = lRapCurrentPart; + ((TTree *)(fOutputList->FindObject("treeLambdaMC")))->Fill(); + } + // f3dHistPrimRawPtVsYVsMultLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicity); + // f3dHistPrimRawPtVsYCMSVsMultLambda->Fill(lPtCurrentPart, + // lRapCurrentPart + fpArapidityShift, lMultiplicity); + + // f3dHistPrimRawPtVsYVsMultV0ALambda->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicityV0A); + // f3dHistPrimRawPtVsYCMSVsMultV0ALambda->Fill(lPtCurrentPart, + // lRapCurrentPart + fpArapidityShift, lMultiplicityV0A); + // f3dHistPrimRawPtVsYVsMultZNALambda->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicityZNA); + // f3dHistPrimRawPtVsYCMSVsMultZNALambda->Fill(lPtCurrentPart, + // lRapCurrentPart + fpArapidityShift, lMultiplicityZNA); + // f3dHistPrimRawPtVsYVsMultTRKLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicityTRK); + // f3dHistPrimRawPtVsYCMSVsMultTRKLambda->Fill(lPtCurrentPart, + // lRapCurrentPart + fpArapidityShift, lMultiplicityTRK); + // f3dHistPrimRawPtVsYVsMultSPDLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicitySPD); + // f3dHistPrimRawPtVsYCMSVsMultSPDLambda->Fill(lPtCurrentPart, + // lRapCurrentPart + fpArapidityShift, lMultiplicitySPD); + + // if (lStackNatural) + // { + // f3dHistPrimRawPtVsYVsMultNonInjLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicity); + // } + // f3dHistPrimRawPtVsYVsMultMCLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, lNumberOfCharged); + // f3dHistPrimRawPtVsYVsVertexZLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, mcPrimaryVtx.At(2)); if + // (TMath::Abs(lCurrentParticleForLambdaCheck->Eta()) < 1.2 && + // lPtCurrentPart > 2) + // { + // lHasHighPtLambda = kTRUE; // Keep track of events with Lambda + // within |eta|<1.2 and pt>2 + // } + } + if (lPdgcodeCurrentPart == -3122) + { + if (TMath::Abs(lRapCurrentPart) <= 0.5) + { + invpzAntiLambdaMC = lCurrentParticleForLambdaCheck->Pz(); + invptAntiLambdaMC = lPtCurrentPart; + invyAntiLambdaMC = lRapCurrentPart; + ((TTree *)(fOutputList->FindObject("treeAntiLambdaMC")))->Fill(); + } + // f3dHistPrimRawPtVsYVsMultAntiLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicity); + // f3dHistPrimRawPtVsYCMSVsMultAntiLambda->Fill(lPtCurrentPart, + // lRapCurrentPart + fpArapidityShift, lMultiplicity); + + // f3dHistPrimRawPtVsYVsMultV0AAntiLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicityV0A); + // f3dHistPrimRawPtVsYCMSVsMultV0AAntiLambda->Fill(lPtCurrentPart, + // lRapCurrentPart + fpArapidityShift, lMultiplicityV0A); + // f3dHistPrimRawPtVsYVsMultZNAAntiLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicityZNA); + // f3dHistPrimRawPtVsYCMSVsMultZNAAntiLambda->Fill(lPtCurrentPart, + // lRapCurrentPart + fpArapidityShift, lMultiplicityZNA); + // f3dHistPrimRawPtVsYVsMultTRKAntiLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicityTRK); + // f3dHistPrimRawPtVsYCMSVsMultTRKAntiLambda->Fill(lPtCurrentPart, + // lRapCurrentPart + fpArapidityShift, lMultiplicityTRK); + // f3dHistPrimRawPtVsYVsMultSPDAntiLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicitySPD); + // f3dHistPrimRawPtVsYCMSVsMultSPDAntiLambda->Fill(lPtCurrentPart, + // lRapCurrentPart + fpArapidityShift, lMultiplicitySPD); + + // if (lStackNatural) + // { + // f3dHistPrimRawPtVsYVsMultNonInjAntiLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicity); + // } + // f3dHistPrimRawPtVsYVsMultMCAntiLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, lNumberOfCharged); + // f3dHistPrimRawPtVsYVsVertexZAntiLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, mcPrimaryVtx.At(2)); + } + if (lPdgcodeCurrentPart == 310) + { + if (TMath::Abs(lRapCurrentPart) <= 0.5) + { + // invmK0s = v0->GetEffMass(); + invpzK0sMC = lCurrentParticleForLambdaCheck->Pz(); + invptK0sMC = lPtCurrentPart; + invyK0sMC = lRapCurrentPart; + ((TTree *)(fOutputList->FindObject("treeK0sMC")))->Fill(); + } + // f3dHistPrimRawPtVsYVsMultK0Short->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicity); + // f3dHistPrimRawPtVsYCMSVsMultK0Short->Fill(lPtCurrentPart, + // lRapCurrentPart + fpArapidityShift, lMultiplicity); + + // f3dHistPrimRawPtVsYVsMultV0AK0Short->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicityV0A); + // f3dHistPrimRawPtVsYCMSVsMultV0AK0Short->Fill(lPtCurrentPart, + // lRapCurrentPart + fpArapidityShift, lMultiplicityV0A); + // f3dHistPrimRawPtVsYVsMultZNAK0Short->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicityZNA); + // f3dHistPrimRawPtVsYCMSVsMultZNAK0Short->Fill(lPtCurrentPart, + // lRapCurrentPart + fpArapidityShift, lMultiplicityZNA); + // f3dHistPrimRawPtVsYVsMultTRKK0Short->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicityTRK); + // f3dHistPrimRawPtVsYCMSVsMultTRKK0Short->Fill(lPtCurrentPart, + // lRapCurrentPart + fpArapidityShift, lMultiplicityTRK); + // f3dHistPrimRawPtVsYVsMultSPDK0Short->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicitySPD); + // f3dHistPrimRawPtVsYCMSVsMultSPDK0Short->Fill(lPtCurrentPart, + // lRapCurrentPart + fpArapidityShift, lMultiplicitySPD); + + // if (lStackNatural) + // { + // f3dHistPrimRawPtVsYVsMultNonInjK0Short->Fill(lPtCurrentPart, + // lRapCurrentPart, lMultiplicity); + // } + // f3dHistPrimRawPtVsYVsMultMCK0Short->Fill(lPtCurrentPart, + // lRapCurrentPart, lNumberOfCharged); + // f3dHistPrimRawPtVsYVsVertexZK0Short->Fill(lPtCurrentPart, + // lRapCurrentPart, mcPrimaryVtx.At(2)); + } + // Decay Length + // Acquisition===================================================== + // Double_t decaylength = -1; + // Double_t lV0Mass = -1; + + // if (!(lCurrentParticleForLambdaCheck->GetDaughter(0) < 0)) + // { + // TParticle *lDght0ofV0 = + // lMCstack->Particle(lCurrentParticleForLambdaCheck->GetDaughter(0)); + // // get first daughter if (lDght0ofV0) { // skip if not defined. + // decaylength = TMath::Sqrt( + // TMath::Power(lCurrentParticleForLambdaCheck->Vx() - + // lDght0ofV0->Vx(), 2) + + // TMath::Power(lCurrentParticleForLambdaCheck->Vy() - + // lDght0ofV0->Vy(), 2) + + // TMath::Power(lCurrentParticleForLambdaCheck->Vz() - + // lDght0ofV0->Vz(), 2)); + // // Need to correct for relativitity! Involves multiplying by mass + // and dividing by momentum. if (TMath::Abs(lPdgcodeCurrentPart) == + // 3122) + // { + // lV0Mass = 1.115683; + // } + // if (TMath::Abs(lPdgcodeCurrentPart) == 310) + // { + // lV0Mass = 0.497614; + // } + // if (lCurrentParticleForLambdaCheck->P() + 1e-10 != 0) + // decaylength = (lV0Mass * decaylength) / + // (lCurrentParticleForLambdaCheck->P() + 1e-10); + // if (lCurrentParticleForLambdaCheck->P() + 1e-10 == 0) + // decaylength = 1e+5; + // } + // } + // if (lPdgcodeCurrentPart == 3122) + // f3dHistPrimRawPtVsYVsDecayLengthLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, decaylength); + // if (lPdgcodeCurrentPart == -3122) + // f3dHistPrimRawPtVsYVsDecayLengthAntiLambda->Fill(lPtCurrentPart, + // lRapCurrentPart, decaylength); + // if (lPdgcodeCurrentPart == 310) + // f3dHistPrimRawPtVsYVsDecayLengthK0Short->Fill(lPtCurrentPart, + // lRapCurrentPart, decaylength); + } + } // End of loop on tracks + //----- End Loop on Lambda, K0Short + //------------------------------------------------------------ + + //==========================================MC + // END========================================= + + lMagneticField = lESDevent->GetMagneticField(); + Double_t flat = GetFlatenicityV0(); + ((TH1D *)(fOutputList->FindObject("hflat")))->Fill(1.0 - flat); + ((TH1D *)(fOutputList->FindObject("hNeventMC")))->Fill(0.5); + + // Run number + // Int_t fRun = lESDevent->GetRunNumber(); + Int_t lOnFlyStatus = 0; // nv0sOn = 0, nv0sOff = 0; + Double_t lChi2V0 = 0; + Double_t lDcaV0Daughters = 0, lDcaV0ToPrimVertex = 0; + Double_t lDcaPosToPrimVertex = 0, lDcaNegToPrimVertex = 0; + Double_t lV0CosineOfPointingAngle = 0; + Double_t lV0Radius = 0, lPt = 0; + Double_t lRapK0Short = 0, lRapLambda = 0; + Double_t lInvMassK0s = 0, lInvMassLambda = 0, lInvMassAntiLambda = 0; + Double_t lAlphaV0 = 0, lPtArmV0 = 0; + + Double_t fMinV0Pt = 0; + Double_t fMaxV0Pt = 100; + + Int_t nv0s = 0; + nv0s = lESDevent->GetNumberOfV0s(); + + for (Int_t iV0 = 0; iV0 < nv0s; iV0++) // extra-crazy test + { // This is the begining of the V0 loop + AliESDv0 *v0 = ((AliESDEvent *)lESDevent)->GetV0(iV0); + if (!v0) + continue; + + // CheckChargeV0(v0); + // // Remove like-sign (will not affect offline V0 candidates!) + // if (v0->GetParamN()->Charge() > 0 && v0->GetParamP()->Charge() > 0) + // { + // continue; + // } + // if (v0->GetParamN()->Charge() < 0 && v0->GetParamP()->Charge() < 0) + // { + // continue; + // } + + lOnFlyStatus = v0->GetOnFlyStatus(); + if (lOnFlyStatus) + continue; + + Double_t tDecayVertexV0[3]; + v0->GetXYZ(tDecayVertexV0[0], tDecayVertexV0[1], tDecayVertexV0[2]); + + Double_t tV0mom[3]; + v0->GetPxPyPz(tV0mom[0], tV0mom[1], tV0mom[2]); + Double_t lV0TotalMomentum = TMath::Sqrt( + tV0mom[0] * tV0mom[0] + tV0mom[1] * tV0mom[1] + tV0mom[2] * tV0mom[2]); + + Double_t lV0Radius = TMath::Sqrt(tDecayVertexV0[0] * tDecayVertexV0[0] + + tDecayVertexV0[1] * tDecayVertexV0[1]); + + Double_t lPt = v0->Pt(); + Double_t lRapK0Short = v0->RapK0Short(); + Double_t lRapLambda = v0->RapLambda(); + + UInt_t lKeyPos = (UInt_t)TMath::Abs(v0->GetPindex()); + UInt_t lKeyNeg = (UInt_t)TMath::Abs(v0->GetNindex()); + + Double_t lMomPos[3]; + v0->GetPPxPyPz(lMomPos[0], lMomPos[1], lMomPos[2]); + Double_t lMomNeg[3]; + v0->GetNPxPyPz(lMomNeg[0], lMomNeg[1], lMomNeg[2]); + + // Provisions for cowboy/sailor check + Double_t lModp1 = + TMath::Sqrt(lMomPos[0] * lMomPos[0] + lMomPos[1] * lMomPos[1]); + Double_t lModp2 = + TMath::Sqrt(lMomNeg[0] * lMomNeg[0] + lMomNeg[1] * lMomNeg[1]); + + // Calculate vec prod with momenta projected to xy plane + Double_t lVecProd = + (lMomPos[0] * lMomNeg[1] - lMomPos[1] * lMomNeg[0]) / (lModp1 * lModp2); + + if (lMagneticField < 0) + lVecProd *= -1; // invert sign + + Bool_t fTreeVariableIsCowboy = kFALSE; + if (lVecProd < 0) + fTreeVariableIsCowboy = kTRUE; + + AliESDtrack *pTrack = ((AliESDEvent *)lESDevent)->GetTrack(lKeyPos); + AliESDtrack *nTrack = ((AliESDEvent *)lESDevent)->GetTrack(lKeyNeg); + AliExternalTrackParam *fTreeVariablePosTrack; //! + AliExternalTrackParam *fTreeVariableNegTrack; //! + fTreeVariablePosTrack = pTrack; + fTreeVariableNegTrack = nTrack; + + if (!pTrack || !nTrack) + { + Printf("ERROR: Could not retreive one of the daughter track"); + continue; + } + Int_t fTreeVariablePosPIDForTracking = pTrack->GetPIDForTracking(); + Int_t fTreeVariableNegPIDForTracking = nTrack->GetPIDForTracking(); + + const AliExternalTrackParam *innernegv0 = nTrack->GetInnerParam(); + const AliExternalTrackParam *innerposv0 = pTrack->GetInnerParam(); + Float_t lThisPosInnerP = -1; + Float_t lThisNegInnerP = -1; + Float_t lThisPosInnerPt = -1; + Float_t lThisNegInnerPt = -1; + if (innerposv0) + { + lThisPosInnerP = innerposv0->GetP(); + } + if (innernegv0) + { + lThisNegInnerP = innernegv0->GetP(); + } + if (innerposv0) + { + lThisPosInnerPt = innerposv0->Pt(); + } + if (innernegv0) + { + lThisNegInnerPt = innernegv0->Pt(); + } + Float_t lThisPosdEdx = pTrack->GetTPCsignal(); + Float_t lThisNegdEdx = nTrack->GetTPCsignal(); + + // Daughter Eta for Eta selection, afterwards + Float_t fTreeVariableNegEta = nTrack->Eta(); + Float_t fTreeVariablePosEta = pTrack->Eta(); + + if (TMath::Abs(fTreeVariableNegEta) > 0.8 || + TMath::Abs(fTreeVariableNegEta) > 0.8) + continue; + + // Filter like-sign V0 (next: add counter and distribution) + if (pTrack->GetSign() == nTrack->GetSign()) + { + continue; + } + + //________________________________________________________________________ + // Track quality cuts + Float_t lPosTrackCrossedRows = pTrack->GetTPCClusterInfo(2, 1); + Float_t lNegTrackCrossedRows = nTrack->GetTPCClusterInfo(2, 1); + Int_t fTreeVariableLeastNbrCrossedRows = (Int_t)lPosTrackCrossedRows; + if (lNegTrackCrossedRows < fTreeVariableLeastNbrCrossedRows) + fTreeVariableLeastNbrCrossedRows = (Int_t)lNegTrackCrossedRows; + + // TPC refit condition (done during reconstruction for Offline but not for + // On-the-fly) + if (!(pTrack->GetStatus() & AliESDtrack::kTPCrefit)) + continue; + if (!(nTrack->GetStatus() & AliESDtrack::kTPCrefit)) + continue; + + // Get status flags + ULong64_t fTreeVariablePosTrackStatus = pTrack->GetStatus(); + ULong64_t fTreeVariableNegTrackStatus = nTrack->GetStatus(); + + Float_t fTreeVariablePosDCAz = GetDCAz(pTrack); + Float_t fTreeVariableNegDCAz = GetDCAz(nTrack); + + // GetKinkIndex condition + if (pTrack->GetKinkIndex(0) > 0 || nTrack->GetKinkIndex(0) > 0) + continue; + + // Findable clusters > 0 condition + if (pTrack->GetTPCNclsF() <= 0 || nTrack->GetTPCNclsF() <= 0) + continue; + + // Compute ratio Crossed Rows / Findable clusters + // Note: above test avoids division by zero! + Float_t lPosTrackCrossedRowsOverFindable = + lPosTrackCrossedRows / ((double)(pTrack->GetTPCNclsF())); + Float_t lNegTrackCrossedRowsOverFindable = + lNegTrackCrossedRows / ((double)(nTrack->GetTPCNclsF())); + + Float_t fTreeVariableLeastRatioCrossedRowsOverFindable = + lPosTrackCrossedRowsOverFindable; + if (lNegTrackCrossedRowsOverFindable < + fTreeVariableLeastRatioCrossedRowsOverFindable) + fTreeVariableLeastRatioCrossedRowsOverFindable = + lNegTrackCrossedRowsOverFindable; + + // Lowest Cut Level for Ratio Crossed Rows / Findable = 0.8, set here + if (fTreeVariableLeastRatioCrossedRowsOverFindable < 0.8) + continue; + + // Extra track quality: Chi2/cluster for cross-checks + Float_t lBiggestChi2PerCluster = -1; + + Float_t lPosChi2PerCluster = 1000; + Float_t lNegChi2PerCluster = 1000; + + if (pTrack->GetTPCNcls() > 0) + lPosChi2PerCluster = + pTrack->GetTPCchi2() / ((Float_t)pTrack->GetTPCNcls()); + if (nTrack->GetTPCNcls() > 0) + lNegChi2PerCluster = + nTrack->GetTPCchi2() / ((Float_t)nTrack->GetTPCNcls()); + + if (lPosChi2PerCluster > lBiggestChi2PerCluster) + lBiggestChi2PerCluster = lPosChi2PerCluster; + if (lNegChi2PerCluster > lBiggestChi2PerCluster) + lBiggestChi2PerCluster = lNegChi2PerCluster; + + Float_t fTreeVariableMaxChi2PerCluster = lBiggestChi2PerCluster; + + // Extra track quality: min track length + Float_t lSmallestTrackLength = 1000; + Float_t lPosTrackLength = -1; + Float_t lNegTrackLength = -1; + + if (pTrack->GetInnerParam()) + lPosTrackLength = pTrack->GetLengthInActiveZone( + 1, 2.0, 220.0, lESDevent->GetMagneticField()); + if (nTrack->GetInnerParam()) + lNegTrackLength = nTrack->GetLengthInActiveZone( + 1, 2.0, 220.0, lESDevent->GetMagneticField()); + + if (lPosTrackLength < lSmallestTrackLength) + lSmallestTrackLength = lPosTrackLength; + if (lNegTrackLength < lSmallestTrackLength) + lSmallestTrackLength = lNegTrackLength; + + if ((((pTrack->GetTPCClusterInfo(2, 1)) < 70) || + ((nTrack->GetTPCClusterInfo(2, 1)) < 70)) && + lSmallestTrackLength < 80) + continue; + + // End track Quality Cuts + //________________________________________________________________________ + + lDcaPosToPrimVertex = TMath::Abs(pTrack->GetD( + lBestPrimaryVtxPos[0], lBestPrimaryVtxPos[1], lMagneticField)); + + lDcaNegToPrimVertex = TMath::Abs(nTrack->GetD( + lBestPrimaryVtxPos[0], lBestPrimaryVtxPos[1], lMagneticField)); + + if (lDcaPosToPrimVertex < 0.06 || lDcaNegToPrimVertex < 0.06) + continue; + + lChi2V0 = v0->GetChi2V0(); + lDcaV0Daughters = v0->GetDcaV0Daughters(); + if (lDcaV0Daughters > 1) + continue; + lDcaV0ToPrimVertex = v0->GetD(lBestPrimaryVtxPos[0], lBestPrimaryVtxPos[1], + lBestPrimaryVtxPos[2]); + Float_t lV0DecayLength = + TMath::Sqrt(TMath::Power(tDecayVertexV0[0] - lBestPrimaryVtxPos[0], 2) + + TMath::Power(tDecayVertexV0[1] - lBestPrimaryVtxPos[1], 2) + + TMath::Power(tDecayVertexV0[2] - lBestPrimaryVtxPos[2], 2)); + if (lV0DecayLength < 0.5) + continue; + lV0CosineOfPointingAngle = v0->GetV0CosineOfPointingAngle( + lBestPrimaryVtxPos[0], lBestPrimaryVtxPos[1], lBestPrimaryVtxPos[2]); + Float_t fTreeVariableV0CosineOfPointingAngle = lV0CosineOfPointingAngle; + + // Getting invariant mass infos directly from ESD + // v0->ChangeMassHypothesis(310); + // lInvMassK0s = v0->GetEffMass(); + // v0->ChangeMassHypothesis(3122); + // lInvMassLambda = v0->GetEffMass(); + // v0->ChangeMassHypothesis(-3122); + // lInvMassAntiLambda = v0->GetEffMass(); + // lAlphaV0 = v0->AlphaV0(); + // lPtArmV0 = v0->PtArmV0(); + + // Official means of acquiring N-sigmas + Float_t NSigmasPosProton = + fPIDResponse->NumberOfSigmasTPC(pTrack, AliPID::kProton); + Float_t NSigmasPosPion = + fPIDResponse->NumberOfSigmasTPC(pTrack, AliPID::kPion); + Float_t NSigmasNegProton = + fPIDResponse->NumberOfSigmasTPC(nTrack, AliPID::kProton); + Float_t NSigmasNegPion = + fPIDResponse->NumberOfSigmasTPC(nTrack, AliPID::kPion); + + // K0Short: Enough to parametrize peak broadening with linear function. + Double_t lUpperLimitK0Short = (5.63707e-01) + (1.14979e-02) * lPt; + Double_t lLowerLimitK0Short = (4.30006e-01) - (1.10029e-02) * lPt; + // Lambda: Linear (for higher pt) plus exponential (for low-pt broadening) + //[0]+[1]*x+[2]*TMath::Exp(-[3]*x) + Double_t lUpperLimitLambda = + (1.13688e+00) + (5.27838e-03) * lPt + + (8.42220e-02) * TMath::Exp(-(3.80595e+00) * lPt); + Double_t lLowerLimitLambda = + (1.09501e+00) - (5.23272e-03) * lPt - + (7.52690e-02) * TMath::Exp(-(3.46339e+00) * lPt); + + v0->ChangeMassHypothesis(310); + lInvMassK0s = v0->GetEffMass(); + if (lInvMassK0s < lUpperLimitK0Short && lInvMassK0s > lLowerLimitK0Short) + { + if (lV0CosineOfPointingAngle > 0.97) + { + Float_t lPtK0s = v0->Pt(); + Float_t lPzK0s = v0->Pz(); + if (lPtK0s != 0) + { + Float_t lRapK0s = v0->Y(310); + if (TMath::Abs(lRapK0s) < 0.5) + { + Float_t ctauK0s = lV0DecayLength * lInvMassK0s / v0->P(); + if (ctauK0s < 20) + { + if (TMath::Abs(NSigmasPosPion) < 5.0 && + TMath::Abs(NSigmasNegPion) < 5.0) + { + ((TH1F *)(fOutputList->FindObject("hinvmassK0s"))) + ->Fill(lInvMassK0s); + invmK0s = v0->GetEffMass(); + invpK0s = v0->P(); + invptK0s = v0->Pt(); + invyK0s = lRapK0s; + flatenicityK0s = 1.0 - flat; + ((TTree *)(fOutputList->FindObject("treeK0s")))->Fill(); + } + } + } + } + } + } + + Float_t massLambda = 1.11568; + + v0->ChangeMassHypothesis(3122); + lInvMassLambda = v0->GetEffMass(); + if (lInvMassLambda < lUpperLimitLambda && + lInvMassLambda > lLowerLimitLambda) + { + if (lV0CosineOfPointingAngle > 0.995) + { + Float_t lPtLambda = v0->Pt(); + Float_t lPzLambda = v0->Pz(); + if (lPtLambda != 0) + { + Float_t lRapLambda = v0->Y(3122); + if (TMath::Abs(lRapLambda) < 0.5) + { + Float_t ctauLambda = lV0DecayLength * lInvMassLambda / v0->P(); + if (ctauLambda < 30) + { + if (TMath::Abs(NSigmasPosProton) < 5.0 && + TMath::Abs(NSigmasNegPion) < 5.0) + { + invmLambda = v0->GetEffMass(); + invpLambda = v0->P(); + invptLambda = v0->Pt(); + invyLambda = lRapLambda; + flatenicityLambda = 1.0 - flat; + + ((TTree *)(fOutputList->FindObject("treeLambda")))->Fill(); + ((TH1F *)(fOutputList->FindObject("hinvmassLambda"))) + ->Fill(lInvMassLambda); + } + } + } + } + } + } + + v0->ChangeMassHypothesis(-3122); + + lInvMassAntiLambda = v0->GetEffMass(); + + if (lInvMassAntiLambda < lUpperLimitLambda && + lInvMassAntiLambda > lLowerLimitLambda) + { + if (lV0CosineOfPointingAngle > 0.995) + { + Float_t lPtAntiLambda = v0->Pt(); + Float_t lPzAntiLambda = v0->Pz(); + + if (lPtAntiLambda != 0) + { + Float_t lRapAntiLambda = v0->Y(-3122); + if (TMath::Abs(lRapAntiLambda) < 0.5) + { + Float_t ctauAntiLambda = + lV0DecayLength * lInvMassAntiLambda / v0->P(); + if (ctauAntiLambda < 30) + { + if (TMath::Abs(NSigmasNegProton) < 5.0 && + TMath::Abs(NSigmasPosPion) < 5.0) + { + invmAntiLambda = v0->GetEffMass(); + invpAntiLambda = v0->P(); + invptAntiLambda = v0->Pt(); + invyAntiLambda = lRapAntiLambda; + flatenicityAntiLambda = 1.0 - flat; + + ((TTree *)(fOutputList->FindObject("treeAntiLambda")))->Fill(); + ((TH1F *)(fOutputList->FindObject("hinvmassAntiLambda"))) + ->Fill(lInvMassAntiLambda); + } + } + } + } + } + } + } + + PostData(1, fOutputList); +} +//_____________________________________________________________________________ +void AliAnalysisTaskFlatenicityLambdaK0sMC::Terminate(Option_t *) +{ + // terminate + // called at the END of the anfalysis (when all events are processed) +} +//_____________________________________________________________________________ +//________________________________________________________________________ + +Double_t AliAnalysisTaskFlatenicityLambdaK0sMC::MyRapidity(Double_t rE, + Double_t rPz) const +{ + // Local calculation for rapidity + Double_t ReturnValue = -100; + if ((rE - rPz + 1.e-13) != 0 && (rE + rPz) != 0) + { + ReturnValue = 0.5 * TMath::Log((rE + rPz) / (rE - rPz + 1.e-13)); + } + return ReturnValue; +} + +void AliAnalysisTaskFlatenicityLambdaK0sMC::CheckChargeV0(AliESDv0 *v0) +{ + // This function checks charge of negative and positive daughter tracks. + // If incorrectly defined (onfly vertexer), swaps out. + if (v0->GetParamN()->Charge() > 0 && v0->GetParamP()->Charge() < 0) + { + // V0 daughter track swapping is required! Note: everything is swapped + // here... P->N, N->P + Long_t lCorrectNidx = v0->GetPindex(); + Long_t lCorrectPidx = v0->GetNindex(); + Double32_t lCorrectNmom[3]; + Double32_t lCorrectPmom[3]; + v0->GetPPxPyPz(lCorrectNmom[0], lCorrectNmom[1], lCorrectNmom[2]); + v0->GetNPxPyPz(lCorrectPmom[0], lCorrectPmom[1], lCorrectPmom[2]); + + AliExternalTrackParam lCorrectParamN( + v0->GetParamP()->GetX(), v0->GetParamP()->GetAlpha(), + v0->GetParamP()->GetParameter(), v0->GetParamP()->GetCovariance()); + AliExternalTrackParam lCorrectParamP( + v0->GetParamN()->GetX(), v0->GetParamN()->GetAlpha(), + v0->GetParamN()->GetParameter(), v0->GetParamN()->GetCovariance()); + lCorrectParamN.SetMostProbablePt(v0->GetParamP()->GetMostProbablePt()); + lCorrectParamP.SetMostProbablePt(v0->GetParamN()->GetMostProbablePt()); + + // Get Variables___________________________________________________ + Double_t lDcaV0Daughters = v0->GetDcaV0Daughters(); + Double_t lCosPALocal = v0->GetV0CosineOfPointingAngle(); + Bool_t lOnFlyStatusLocal = v0->GetOnFlyStatus(); + + // Create Replacement Object_______________________________________ + AliESDv0 *v0correct = new AliESDv0(lCorrectParamN, lCorrectNidx, + lCorrectParamP, lCorrectPidx); + v0correct->SetDcaV0Daughters(lDcaV0Daughters); + v0correct->SetV0CosineOfPointingAngle(lCosPALocal); + v0correct->ChangeMassHypothesis(kK0Short); + v0correct->SetOnFlyStatus(lOnFlyStatusLocal); + + // Reverse Cluster info..._________________________________________ + v0correct->SetClusters(v0->GetClusters(1), v0->GetClusters(0)); + + *v0 = *v0correct; + // Proper cleanup..._______________________________________________ + v0correct->Delete(); + v0correct = 0x0; + + // Just another cross-check and output_____________________________ + if (v0->GetParamN()->Charge() > 0 && v0->GetParamP()->Charge() < 0) + { + AliWarning( + "Found Swapped Charges, tried to correct but something FAILED!"); + } + else + { + // AliWarning("Found Swapped Charges and fixed."); + } + //________________________________________________________________ + } + else + { + // Don't touch it! --- + // Printf("Ah, nice. Charges are already ordered..."); + } + return; +} + +//________________________________________________________________________ +Float_t AliAnalysisTaskFlatenicityLambdaK0sMC::GetDCAz(AliESDtrack *lTrack) +// Encapsulation of DCAz calculation +{ + Float_t b[2]; + Float_t bCov[3]; + lTrack->GetImpactParameters(b, bCov); + if (bCov[0] <= 0 || bCov[2] <= 0) + { + AliDebug(1, "Estimated b resolution lower or equal to zero!"); + bCov[0] = 0; + bCov[2] = 0; + } + // Float_t dcaToVertexXY = b[0]; + Float_t dcaToVertexZ = b[1]; + + return dcaToVertexZ; +} + +Float_t AliAnalysisTaskFlatenicityLambdaK0sMC::GetFlatenicityV0() +{ + AliVVZERO *lVV0 = 0x0; + AliVEvent *lVevent = 0x0; + lVevent = dynamic_cast(InputEvent()); + if (!lVevent) + { + AliWarning("ERROR: ESD / AOD event not available \n"); + return -1; + } + // Get VZERO Information for multiplicity later + lVV0 = lVevent->GetVZEROData(); + if (!lVV0) + { + AliError("AliVVZERO not available"); + return 9999; + } + // Flatenicity calculation + const Int_t nRings = 4; + const Int_t nSectors = 8; + Float_t minEtaV0C[nRings] = {-3.7, -3.2, -2.7, -2.2}; + Float_t maxEtaV0C[nRings] = {-3.2, -2.7, -2.2, -1.7}; + Float_t maxEtaV0A[nRings] = {5.1, 4.5, 3.9, 3.4}; + Float_t minEtaV0A[nRings] = {4.5, 3.9, 3.4, 2.8}; + // Grid + const Int_t nCells = nRings * 2 * nSectors; + Float_t RhoLattice[nCells]; + for (Int_t iCh = 0; iCh < nCells; iCh++) + { + RhoLattice[iCh] = 0.0; + } + + Int_t nringA = 0; + Int_t nringC = 0; + for (Int_t iCh = 0; iCh < nCells; iCh++) + { + Float_t detaV0 = -1; + Float_t mult = lVV0->GetMultiplicity(iCh); + if (iCh < 32) + { // V0C + if (iCh < 8) + { + nringC = 0; + } + else if (iCh >= 8 && iCh < 16) + { + nringC = 1; + } + else if (iCh >= 16 && iCh < 24) + { + nringC = 2; + } + else + { + nringC = 3; + } + detaV0 = maxEtaV0C[nringC] - minEtaV0C[nringC]; + } + else + { // V0A + if (iCh < 40) + { + nringA = 0; + } + else if (iCh >= 40 && iCh < 48) + { + nringA = 1; + } + else if (iCh >= 48 && iCh < 56) + { + nringA = 2; + } + else + { + nringA = 3; + } + detaV0 = maxEtaV0A[nringA] - minEtaV0A[nringA]; + } + RhoLattice[iCh] = + mult / detaV0; // needed to consider the different eta coverage + } + // Filling histos with mult info + // for (Int_t iCh = 0; iCh < nCells; iCh++) { + // hActivityV0DataSect->Fill(iCh, RhoLattice[iCh]); + //} + Float_t mRho = 0; + Float_t flatenicity = -1; + for (Int_t iCh = 0; iCh < nCells; iCh++) + { + mRho += RhoLattice[iCh]; + } + Float_t multiplicityV0M = mRho; + // average activity per cell + mRho /= (1.0 * nCells); + // get sigma + Double_t sRho_tmp = 0; + for (Int_t iCh = 0; iCh < nCells; iCh++) + { + sRho_tmp += TMath::Power(1.0 * RhoLattice[iCh] - mRho, 2); + } + sRho_tmp /= (1.0 * nCells * nCells); + Float_t sRho = TMath::Sqrt(sRho_tmp); + Bool_t fRemoveTrivialScaling = kFALSE; + if (mRho > 0) + { + if (fRemoveTrivialScaling) + { + flatenicity = TMath::Sqrt(multiplicityV0M) * sRho / mRho; + } + else + { + flatenicity = sRho / mRho; + } + } + else + { + flatenicity = 9999; + } + return flatenicity; +} \ No newline at end of file diff --git a/PWGMM/UE/FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0sMC.h b/PWGMM/UE/FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0sMC.h new file mode 100644 index 00000000000..b1322d6a645 --- /dev/null +++ b/PWGMM/UE/FlatenicityLambdaK0s/AliAnalysisTaskFlatenicityLambdaK0sMC.h @@ -0,0 +1,109 @@ +/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. */ +/* See cxx source for full Copyright notice */ +/* $Id$ */ + +#ifndef AliAnalysisTaskFlatenicityLambdaK0sMC_H +#define AliAnalysisTaskFlatenicityLambdaK0sMC_H +#include "AliEventCuts.h" +#include "AliAnalysisTaskSE.h" +class AliESDtrackCuts; +class AliMCEventHandler; +class AliMCEvent; +class AliStack; +class AliESDAD; +class AliESDEvent; +class AliAnalysisUtils; +class AliPIDResponse; +class AliAnalysisTaskFlatenicityLambdaK0sMC : public AliAnalysisTaskSE +{ +public: + AliAnalysisTaskFlatenicityLambdaK0sMC(); + AliAnalysisTaskFlatenicityLambdaK0sMC(const char *name); + virtual ~AliAnalysisTaskFlatenicityLambdaK0sMC(); + + virtual void UserCreateOutputObjects(); + virtual void UserExec(Option_t *option); + virtual void Terminate(Option_t *option); + Double_t MyRapidity(Double_t rE, Double_t rPz) const; + Float_t GetDCAz(AliESDtrack *lTrack); + Float_t GetFlatenicityV0(); + void CheckChargeV0(AliESDv0 *v0); + AliEventCuts fEventCuts; + +private: + AliESDEvent *fESD; //! input event + TList *fOutputList; //! output list + TList *fOutputListMC; //! output list + + AliPIDResponse *fPIDResponse; + AliESDpid *fESDpid; + TH1F *hinvmassK0s; //! dummy histogram + TH1F *hinvmassLambda; //! dummy histogram + TH1F *hinvmassAntiLambda; //! dummy histogram + TH1F *hflat; //! dummy histogram +// AliAnalysisFilter *fTrackFilter; + Float_t invmK0s; + Float_t invpK0s; + Float_t invptK0s; + Float_t invyK0s; + Float_t flatenicityK0s; + AliESDtrackCuts *fESDtrackCuts; // ESD track cuts used for primary track definition + + TTree *treeK0s; + + Float_t invmLambda; + Float_t invpLambda; + Float_t invptLambda; + Float_t invyLambda; + Float_t flatenicityLambda; + + TTree *treeLambda; + + Float_t invmAntiLambda; + Float_t invpAntiLambda; + Float_t invptAntiLambda; + Float_t invyAntiLambda; + Float_t flatenicityAntiLambda; + + TTree *treeAntiLambda; + + //MC True + TH1F *hinvmassK0sMC; //! dummy histogram + TH1F *hinvmassLambdaMC; //! dummy histogram + TH1F *hinvmassAntiLambdaMC; //! dummy histogram + TH1F *hNeventMC; //! dummy histogram +// AliAnalysisFilter *fTrackFilter; + Float_t invmK0sMC; + Float_t invpzK0sMC; + Float_t invptK0sMC; + Float_t invyK0sMC; + Float_t flatenicityK0sMC; + AliESDtrackCuts *fESDtrackCutsMC; // ESD track cuts used for primary track definition + + TTree *treeK0sMC; + + Float_t invmLambdaMC; + Float_t invpzLambdaMC; + Float_t invptLambdaMC; + Float_t invyLambdaMC; + Float_t flatenicityLambdaMC; + + TTree *treeLambdaMC; + + Float_t invmAntiLambdaMC; + Float_t invpzAntiLambdaMC; + Float_t invptAntiLambdaMC; + Float_t invyAntiLambdaMC; + Float_t flatenicityAntiLambdaMC; + + TTree *treeAntiLambdaMC; + + AliAnalysisTaskFlatenicityLambdaK0sMC( + const AliAnalysisTaskFlatenicityLambdaK0sMC &); // not implemented + AliAnalysisTaskFlatenicityLambdaK0sMC & + operator=(const AliAnalysisTaskFlatenicityLambdaK0sMC &); // not implemented + + ClassDef(AliAnalysisTaskFlatenicityLambdaK0sMC, 1); +}; + +#endif diff --git a/PWGMM/UE/PWGMMueLinkDef.h b/PWGMM/UE/PWGMMueLinkDef.h index 0e6f50edc59..1491c514dfb 100644 --- a/PWGMM/UE/PWGMMueLinkDef.h +++ b/PWGMM/UE/PWGMMueLinkDef.h @@ -26,5 +26,8 @@ #pragma link C++ class AliAnalysisTaskSpectraFlatenicity+; #pragma link C++ class AliAnalysisTaskFlatenicityPiKp+; #pragma link C++ class AliAnalysisTaskFlatenicityLambdaK0s+; +#pragma link C++ class AliAnalysisTaskFlatenicityLambdaK0sMC+; #pragma link C++ class AliAnalysisTaskdEdxCalibration+; +#pragma link C++ class AliAnalysisTaskMCCorrections+; +#pragma link C++ class AliAnalysisTaskOnlyFlatenicity+; #endif From 3e61cb6aba3029df87f3050f56669260d90666c9 Mon Sep 17 00:00:00 2001 From: Nicolas Schmidt Date: Fri, 21 Apr 2023 14:31:00 -0400 Subject: [PATCH 41/51] PWGGA/GammaConv: Further improvements to correl task --- .../AliAnalysisTaskCorrelationTree.cxx | 245 ++++++++++-------- .../AliAnalysisTaskCorrelationTree.h | 10 + 2 files changed, 150 insertions(+), 105 deletions(-) diff --git a/PWGGA/GammaConv/AliAnalysisTaskCorrelationTree.cxx b/PWGGA/GammaConv/AliAnalysisTaskCorrelationTree.cxx index 4682e33bdf0..02105f85579 100644 --- a/PWGGA/GammaConv/AliAnalysisTaskCorrelationTree.cxx +++ b/PWGGA/GammaConv/AliAnalysisTaskCorrelationTree.cxx @@ -57,6 +57,8 @@ ClassImp(AliAnalysisTaskCorrelationTree) fHistoNEvents(NULL), fBuffer_NContributors(0), + fBuffer_RunNumber(0), + fBuffer_VertexZ(0), fBuffer_NEventTriggers(0), fBuffer_EventTrigger(0), fBuffer_NElectronCandidates(0), @@ -64,6 +66,8 @@ ClassImp(AliAnalysisTaskCorrelationTree) fBuffer_ElectronCandidate_Px(0), fBuffer_ElectronCandidate_Py(0), fBuffer_ElectronCandidate_Pz(0), + fBuffer_ElectronCandidate_PropEta(0), + fBuffer_ElectronCandidate_PropPhi(0), fBuffer_ElectronCandidate_Charge(0), fBuffer_ElectronCandidate_NSigmaElecTPC(0), fBuffer_ElectronCandidate_NSigmaElecTOF(0), @@ -82,6 +86,9 @@ ClassImp(AliAnalysisTaskCorrelationTree) fBuffer_ElectronCandidate_MC_Mother_Pz(0), fBuffer_ElectronCandidate_MC_Mother_PDG(0), fBuffer_ElectronCandidate_MC_GrandMother_PDG(0), + fBuffer_ElectronCandidate_MC_GrandMother_Pt(0), + fBuffer_ElectronCandidate_MC_GGrandMother_PDG(0), + fBuffer_ElectronCandidate_MC_GGrandMother_Pt(0), fBuffer_NMuonCandidates(0), fBuffer_MuonCandidate_E(0), @@ -104,6 +111,9 @@ ClassImp(AliAnalysisTaskCorrelationTree) fBuffer_MuonCandidate_MC_Mother_Pz(0), fBuffer_MuonCandidate_MC_Mother_PDG(0), fBuffer_MuonCandidate_MC_GrandMother_PDG(0), + fBuffer_MuonCandidate_MC_GrandMother_Pt(0), + fBuffer_MuonCandidate_MC_GGrandMother_PDG(0), + fBuffer_MuonCandidate_MC_GGrandMother_Pt(0), fBuffer_NClusterCandidates(0), fBuffer_ClusterCandidate_E(0), @@ -131,6 +141,8 @@ ClassImp(AliAnalysisTaskCorrelationTree) fBuffer_ElectronCandidate_Px = new Float_t[kMaxTracks]; fBuffer_ElectronCandidate_Py = new Float_t[kMaxTracks]; fBuffer_ElectronCandidate_Pz = new Float_t[kMaxTracks]; + fBuffer_ElectronCandidate_PropEta = new Float_t[kMaxTracks]; + fBuffer_ElectronCandidate_PropPhi = new Float_t[kMaxTracks]; fBuffer_ElectronCandidate_Charge = new Float_t[kMaxTracks]; fBuffer_ElectronCandidate_NSigmaElecTPC = new Float_t[kMaxTracks]; fBuffer_ElectronCandidate_NSigmaElecTOF = new Float_t[kMaxTracks]; @@ -149,6 +161,9 @@ ClassImp(AliAnalysisTaskCorrelationTree) fBuffer_ElectronCandidate_MC_Mother_Pz = new Float_t[kMaxTracks]; fBuffer_ElectronCandidate_MC_Mother_PDG = new Int_t[kMaxTracks]; fBuffer_ElectronCandidate_MC_GrandMother_PDG = new Int_t[kMaxTracks]; + fBuffer_ElectronCandidate_MC_GrandMother_Pt = new Float_t[kMaxTracks]; + fBuffer_ElectronCandidate_MC_GGrandMother_PDG = new Int_t[kMaxTracks]; + fBuffer_ElectronCandidate_MC_GGrandMother_Pt = new Float_t[kMaxTracks]; fBuffer_MuonCandidate_E = new Float_t[kMaxTracks]; fBuffer_MuonCandidate_Px = new Float_t[kMaxTracks]; @@ -170,6 +185,9 @@ ClassImp(AliAnalysisTaskCorrelationTree) fBuffer_MuonCandidate_MC_Mother_Pz = new Float_t[kMaxTracks]; fBuffer_MuonCandidate_MC_Mother_PDG = new Int_t[kMaxTracks]; fBuffer_MuonCandidate_MC_GrandMother_PDG = new Int_t[kMaxTracks]; + fBuffer_MuonCandidate_MC_GrandMother_Pt = new Float_t[kMaxTracks]; + fBuffer_MuonCandidate_MC_GGrandMother_PDG = new Int_t[kMaxTracks]; + fBuffer_MuonCandidate_MC_GGrandMother_Pt = new Float_t[kMaxTracks]; fBuffer_ClusterCandidate_E = new Float_t[kMaxTracks]; fBuffer_ClusterCandidate_Px = new Float_t[kMaxTracks]; @@ -207,9 +225,11 @@ AliAnalysisTaskCorrelationTree::AliAnalysisTaskCorrelationTree(const char *name) fIsHeavyIon(false), fOutputList(NULL), fPidResponse(0), - fHistoNEvents(NULL), + fHistoNEvents(NULL), fBuffer_NContributors(0), + fBuffer_RunNumber(0), + fBuffer_VertexZ(0), fBuffer_NEventTriggers(0), fBuffer_EventTrigger(0), fBuffer_NElectronCandidates(0), @@ -217,6 +237,8 @@ AliAnalysisTaskCorrelationTree::AliAnalysisTaskCorrelationTree(const char *name) fBuffer_ElectronCandidate_Px(0), fBuffer_ElectronCandidate_Py(0), fBuffer_ElectronCandidate_Pz(0), + fBuffer_ElectronCandidate_PropEta(0), + fBuffer_ElectronCandidate_PropPhi(0), fBuffer_ElectronCandidate_Charge(0), fBuffer_ElectronCandidate_NSigmaElecTPC(0), fBuffer_ElectronCandidate_NSigmaElecTOF(0), @@ -235,6 +257,9 @@ AliAnalysisTaskCorrelationTree::AliAnalysisTaskCorrelationTree(const char *name) fBuffer_ElectronCandidate_MC_Mother_Pz(0), fBuffer_ElectronCandidate_MC_Mother_PDG(0), fBuffer_ElectronCandidate_MC_GrandMother_PDG(0), + fBuffer_ElectronCandidate_MC_GrandMother_Pt(0), + fBuffer_ElectronCandidate_MC_GGrandMother_PDG(0), + fBuffer_ElectronCandidate_MC_GGrandMother_Pt(0), fBuffer_NMuonCandidates(0), fBuffer_MuonCandidate_E(0), @@ -257,6 +282,9 @@ AliAnalysisTaskCorrelationTree::AliAnalysisTaskCorrelationTree(const char *name) fBuffer_MuonCandidate_MC_Mother_Pz(0), fBuffer_MuonCandidate_MC_Mother_PDG(0), fBuffer_MuonCandidate_MC_GrandMother_PDG(0), + fBuffer_MuonCandidate_MC_GrandMother_Pt(0), + fBuffer_MuonCandidate_MC_GGrandMother_PDG(0), + fBuffer_MuonCandidate_MC_GGrandMother_Pt(0), fBuffer_NClusterCandidates(0), fBuffer_ClusterCandidate_E(0), @@ -285,6 +313,8 @@ AliAnalysisTaskCorrelationTree::AliAnalysisTaskCorrelationTree(const char *name) fBuffer_ElectronCandidate_Px = new Float_t[kMaxTracks]; fBuffer_ElectronCandidate_Py = new Float_t[kMaxTracks]; fBuffer_ElectronCandidate_Pz = new Float_t[kMaxTracks]; + fBuffer_ElectronCandidate_PropEta = new Float_t[kMaxTracks]; + fBuffer_ElectronCandidate_PropPhi = new Float_t[kMaxTracks]; fBuffer_ElectronCandidate_Charge = new Float_t[kMaxTracks]; fBuffer_ElectronCandidate_NSigmaElecTPC = new Float_t[kMaxTracks]; fBuffer_ElectronCandidate_NSigmaElecTOF = new Float_t[kMaxTracks]; @@ -304,6 +334,9 @@ AliAnalysisTaskCorrelationTree::AliAnalysisTaskCorrelationTree(const char *name) fBuffer_ElectronCandidate_MC_Mother_Pz = new Float_t[kMaxTracks]; fBuffer_ElectronCandidate_MC_Mother_PDG = new Int_t[kMaxTracks]; fBuffer_ElectronCandidate_MC_GrandMother_PDG = new Int_t[kMaxTracks]; + fBuffer_ElectronCandidate_MC_GrandMother_Pt = new Float_t[kMaxTracks]; + fBuffer_ElectronCandidate_MC_GGrandMother_PDG = new Int_t[kMaxTracks]; + fBuffer_ElectronCandidate_MC_GGrandMother_Pt = new Float_t[kMaxTracks]; fBuffer_MuonCandidate_E = new Float_t[kMaxTracks]; fBuffer_MuonCandidate_Px = new Float_t[kMaxTracks]; @@ -325,6 +358,9 @@ AliAnalysisTaskCorrelationTree::AliAnalysisTaskCorrelationTree(const char *name) fBuffer_MuonCandidate_MC_Mother_Pz = new Float_t[kMaxTracks]; fBuffer_MuonCandidate_MC_Mother_PDG = new Int_t[kMaxTracks]; fBuffer_MuonCandidate_MC_GrandMother_PDG = new Int_t[kMaxTracks]; + fBuffer_MuonCandidate_MC_GrandMother_Pt = new Float_t[kMaxTracks]; + fBuffer_MuonCandidate_MC_GGrandMother_PDG = new Int_t[kMaxTracks]; + fBuffer_MuonCandidate_MC_GGrandMother_Pt = new Float_t[kMaxTracks]; fBuffer_ClusterCandidate_E = new Float_t[kMaxTracks]; fBuffer_ClusterCandidate_Px = new Float_t[kMaxTracks]; @@ -369,27 +405,28 @@ void AliAnalysisTaskCorrelationTree::UserCreateOutputObjects() { fOutputList = new TList(); fOutputList->SetOwner(true); - fHistoNEvents = new TH1F("NEvents","NEvents",14,-0.5,13.5); - fHistoNEvents->GetXaxis()->SetBinLabel(1,"Accepted"); - fHistoNEvents->GetXaxis()->SetBinLabel(2,"Centrality"); - fHistoNEvents->GetXaxis()->SetBinLabel(3,"Miss. MC or inc. ev."); - fHistoNEvents->GetXaxis()->SetBinLabel(4,"Trigger"); - fHistoNEvents->GetXaxis()->SetBinLabel(5,"Vertex Z"); - fHistoNEvents->GetXaxis()->SetBinLabel(6,"Cont. Vertex"); - fHistoNEvents->GetXaxis()->SetBinLabel(7,"Pile-Up"); - fHistoNEvents->GetXaxis()->SetBinLabel(8,"no SDD"); - fHistoNEvents->GetXaxis()->SetBinLabel(9,"no V0AND"); - fHistoNEvents->GetXaxis()->SetBinLabel(10,"EMCAL/TPC problems"); - fHistoNEvents->GetXaxis()->SetBinLabel(11,"rejectedForJetJetMC"); - fHistoNEvents->GetXaxis()->SetBinLabel(12,"SPD hits vs tracklet"); - fHistoNEvents->GetXaxis()->SetBinLabel(13,"Out-of-Bunch pileup Past-Future"); - fHistoNEvents->GetXaxis()->SetBinLabel(14,"Pileup V0M-TPCout Tracks"); + fHistoNEvents = new TH1F("NEvents", "NEvents", 14, -0.5, 13.5); + fHistoNEvents->GetXaxis()->SetBinLabel(1, "Accepted"); + fHistoNEvents->GetXaxis()->SetBinLabel(2, "Centrality"); + fHistoNEvents->GetXaxis()->SetBinLabel(3, "Miss. MC or inc. ev."); + fHistoNEvents->GetXaxis()->SetBinLabel(4, "Trigger"); + fHistoNEvents->GetXaxis()->SetBinLabel(5, "Vertex Z"); + fHistoNEvents->GetXaxis()->SetBinLabel(6, "Cont. Vertex"); + fHistoNEvents->GetXaxis()->SetBinLabel(7, "Pile-Up"); + fHistoNEvents->GetXaxis()->SetBinLabel(8, "no SDD"); + fHistoNEvents->GetXaxis()->SetBinLabel(9, "no V0AND"); + fHistoNEvents->GetXaxis()->SetBinLabel(10, "EMCAL/TPC problems"); + fHistoNEvents->GetXaxis()->SetBinLabel(11, "rejectedForJetJetMC"); + fHistoNEvents->GetXaxis()->SetBinLabel(12, "SPD hits vs tracklet"); + fHistoNEvents->GetXaxis()->SetBinLabel(13, "Out-of-Bunch pileup Past-Future"); + fHistoNEvents->GetXaxis()->SetBinLabel(14, "Pileup V0M-TPCout Tracks"); fOutputList->Add(fHistoNEvents); - } fAnalysisTree = new TTree(Form("CorrelationTree_%s_%s", (fEventCuts->GetCutNumber()).Data(), (fConversionCuts->GetCutNumber()).Data()), Form("CorrelationTree_%s_%s", (fEventCuts->GetCutNumber()).Data(), (fConversionCuts->GetCutNumber()).Data())); fAnalysisTree->Branch("NVertexContributors", &fBuffer_NContributors, "NVertexContributors/I"); // max 200 for now + fAnalysisTree->Branch("RunNumber", &fBuffer_RunNumber, "RunNumber/I"); // max 200 for now + fAnalysisTree->Branch("Vertex_Z", &fBuffer_VertexZ, "Vertex_Z/F"); // max 200 for now fAnalysisTree->Branch("NEventTriggers", &fBuffer_NEventTriggers, "NEventTriggers/I"); // max 200 for now fAnalysisTree->Branch("EventTrigger", fBuffer_EventTrigger, "EventTrigger[NEventTriggers]/I"); // max 200 for now @@ -398,6 +435,8 @@ void AliAnalysisTaskCorrelationTree::UserCreateOutputObjects() fAnalysisTree->Branch("ElectronCandidate_Px", fBuffer_ElectronCandidate_Px, "ElectronCandidate_Px[NElectronCandidates]/F"); fAnalysisTree->Branch("ElectronCandidate_Py", fBuffer_ElectronCandidate_Py, "ElectronCandidate_Py[NElectronCandidates]/F"); fAnalysisTree->Branch("ElectronCandidate_Pz", fBuffer_ElectronCandidate_Pz, "ElectronCandidate_Pz[NElectronCandidates]/F"); + fAnalysisTree->Branch("ElectronCandidate_PropEta", fBuffer_ElectronCandidate_PropEta, "ElectronCandidate_PropEta[NElectronCandidates]/F"); + fAnalysisTree->Branch("ElectronCandidate_PropPhi", fBuffer_ElectronCandidate_PropPhi, "ElectronCandidate_PropPhi[NElectronCandidates]/F"); fAnalysisTree->Branch("ElectronCandidate_Charge", fBuffer_ElectronCandidate_Charge, "ElectronCandidate_Charge[NElectronCandidates]/F"); fAnalysisTree->Branch("ElectronCandidate_NSigmaElecTPC", fBuffer_ElectronCandidate_NSigmaElecTPC, "ElectronCandidate_NSigmaElecTPC[NElectronCandidates]/F"); fAnalysisTree->Branch("ElectronCandidate_NSigmaElecTOF", fBuffer_ElectronCandidate_NSigmaElecTOF, "ElectronCandidate_NSigmaElecTOF[NElectronCandidates]/F"); @@ -412,13 +451,16 @@ void AliAnalysisTaskCorrelationTree::UserCreateOutputObjects() fAnalysisTree->Branch("ElectronCandidate_MC_Px", fBuffer_ElectronCandidate_MC_Px, "ElectronCandidate_MC_Px[NElectronCandidates]/F"); fAnalysisTree->Branch("ElectronCandidate_MC_Py", fBuffer_ElectronCandidate_MC_Py, "ElectronCandidate_MC_Py[NElectronCandidates]/F"); fAnalysisTree->Branch("ElectronCandidate_MC_Pz", fBuffer_ElectronCandidate_MC_Pz, "ElectronCandidate_MC_Pz[NElectronCandidates]/F"); - fAnalysisTree->Branch("ElectronCandidate_MC_PDG", fBuffer_ElectronCandidate_MC_PDG, "ElectronCandidate_MC_PDG[NElectronCandidates]/b"); + fAnalysisTree->Branch("ElectronCandidate_MC_PDG", fBuffer_ElectronCandidate_MC_PDG, "ElectronCandidate_MC_PDG[NElectronCandidates]/I"); fAnalysisTree->Branch("ElectronCandidate_MC_Mother_E", fBuffer_ElectronCandidate_MC_Mother_E, "ElectronCandidate_MC_Mother_E[NElectronCandidates]/F"); fAnalysisTree->Branch("ElectronCandidate_MC_Mother_Px", fBuffer_ElectronCandidate_MC_Mother_Px, "ElectronCandidate_MC_Mother_Px[NElectronCandidates]/F"); fAnalysisTree->Branch("ElectronCandidate_MC_Mother_Py", fBuffer_ElectronCandidate_MC_Mother_Py, "ElectronCandidate_MC_Mother_Py[NElectronCandidates]/F"); fAnalysisTree->Branch("ElectronCandidate_MC_Mother_Pz", fBuffer_ElectronCandidate_MC_Mother_Pz, "ElectronCandidate_MC_Mother_Pz[NElectronCandidates]/F"); fAnalysisTree->Branch("ElectronCandidate_MC_Mother_PDG", fBuffer_ElectronCandidate_MC_Mother_PDG, "ElectronCandidate_MC_Mother_PDG[NElectronCandidates]/I"); fAnalysisTree->Branch("ElectronCandidate_MC_GrandMother_PDG", fBuffer_ElectronCandidate_MC_GrandMother_PDG, "ElectronCandidate_MC_GrandMother_PDG[NElectronCandidates]/I"); + fAnalysisTree->Branch("ElectronCandidate_MC_GrandMother_Pt", fBuffer_ElectronCandidate_MC_GrandMother_Pt, "ElectronCandidate_MC_GrandMother_Pt[NElectronCandidates]/F"); + fAnalysisTree->Branch("ElectronCandidate_MC_GGrandMother_PDG", fBuffer_ElectronCandidate_MC_GGrandMother_PDG, "ElectronCandidate_MC_GGrandMother_PDG[NElectronCandidates]/I"); + fAnalysisTree->Branch("ElectronCandidate_MC_GGrandMother_Pt", fBuffer_ElectronCandidate_MC_GGrandMother_Pt, "ElectronCandidate_MC_GGrandMother_Pt[NElectronCandidates]/F"); } fAnalysisTree->Branch("NMuonCandidates", &fBuffer_NMuonCandidates, "NMuonCandidates/I"); // max 200 for now fAnalysisTree->Branch("MuonCandidate_E", fBuffer_MuonCandidate_E, "MuonCandidate_E[NMuonCandidates]/F"); @@ -437,13 +479,16 @@ void AliAnalysisTaskCorrelationTree::UserCreateOutputObjects() fAnalysisTree->Branch("MuonCandidate_MC_Px", fBuffer_MuonCandidate_MC_Px, "MuonCandidate_MC_Px[NMuonCandidates]/F"); fAnalysisTree->Branch("MuonCandidate_MC_Py", fBuffer_MuonCandidate_MC_Py, "MuonCandidate_MC_Py[NMuonCandidates]/F"); fAnalysisTree->Branch("MuonCandidate_MC_Pz", fBuffer_MuonCandidate_MC_Pz, "MuonCandidate_MC_Pz[NMuonCandidates]/F"); - fAnalysisTree->Branch("MuonCandidate_MC_PDG", fBuffer_MuonCandidate_MC_PDG, "MuonCandidate_MC_PDG[NMuonCandidates]/b"); + fAnalysisTree->Branch("MuonCandidate_MC_PDG", fBuffer_MuonCandidate_MC_PDG, "MuonCandidate_MC_PDG[NMuonCandidates]/I"); fAnalysisTree->Branch("MuonCandidate_MC_Mother_E", fBuffer_MuonCandidate_MC_Mother_E, "MuonCandidate_MC_Mother_E[NMuonCandidates]/F"); fAnalysisTree->Branch("MuonCandidate_MC_Mother_Px", fBuffer_MuonCandidate_MC_Mother_Px, "MuonCandidate_MC_Mother_Px[NMuonCandidates]/F"); fAnalysisTree->Branch("MuonCandidate_MC_Mother_Py", fBuffer_MuonCandidate_MC_Mother_Py, "MuonCandidate_MC_Mother_Py[NMuonCandidates]/F"); fAnalysisTree->Branch("MuonCandidate_MC_Mother_Pz", fBuffer_MuonCandidate_MC_Mother_Pz, "MuonCandidate_MC_Mother_Pz[NMuonCandidates]/F"); fAnalysisTree->Branch("MuonCandidate_MC_Mother_PDG", fBuffer_MuonCandidate_MC_Mother_PDG, "MuonCandidate_MC_Mother_PDG[NMuonCandidates]/I"); fAnalysisTree->Branch("MuonCandidate_MC_GrandMother_PDG", fBuffer_MuonCandidate_MC_GrandMother_PDG, "MuonCandidate_MC_GrandMother_PDG[NMuonCandidates]/I"); + fAnalysisTree->Branch("MuonCandidate_MC_GrandMother_Pt", fBuffer_MuonCandidate_MC_GrandMother_Pt, "MuonCandidate_MC_GrandMother_Pt[NMuonCandidates]/F"); + fAnalysisTree->Branch("MuonCandidate_MC_GGrandMother_PDG", fBuffer_MuonCandidate_MC_GGrandMother_PDG, "MuonCandidate_MC_GGrandMother_PDG[NMuonCandidates]/I"); + fAnalysisTree->Branch("MuonCandidate_MC_GGrandMother_Pt", fBuffer_MuonCandidate_MC_GGrandMother_Pt, "MuonCandidate_MC_GGrandMother_Pt[NMuonCandidates]/F"); } fAnalysisTree->Branch("NClusterCandidates", &fBuffer_NClusterCandidates, "NClusterCandidates/I"); // max 200 for now fAnalysisTree->Branch("ClusterCandidate_E", fBuffer_ClusterCandidate_E, "ClusterCandidate_E[NClusterCandidates]/F"); @@ -460,7 +505,7 @@ void AliAnalysisTaskCorrelationTree::UserCreateOutputObjects() fAnalysisTree->Branch("ClusterCandidate_MC_Px", fBuffer_ClusterCandidate_MC_Px, "ClusterCandidate_MC_Px[NClusterCandidates]/F"); fAnalysisTree->Branch("ClusterCandidate_MC_Py", fBuffer_ClusterCandidate_MC_Py, "ClusterCandidate_MC_Py[NClusterCandidates]/F"); fAnalysisTree->Branch("ClusterCandidate_MC_Pz", fBuffer_ClusterCandidate_MC_Pz, "ClusterCandidate_MC_Pz[NClusterCandidates]/F"); - fAnalysisTree->Branch("ClusterCandidate_MC_PDG", fBuffer_ClusterCandidate_MC_PDG, "ClusterCandidate_MC_PDG[NClusterCandidates]/b"); + fAnalysisTree->Branch("ClusterCandidate_MC_PDG", fBuffer_ClusterCandidate_MC_PDG, "ClusterCandidate_MC_PDG[NClusterCandidates]/I"); fAnalysisTree->Branch("ClusterCandidate_MC_Mother_E", fBuffer_ClusterCandidate_MC_Mother_E, "ClusterCandidate_MC_Mother_E[NClusterCandidates]/F"); fAnalysisTree->Branch("ClusterCandidate_MC_Mother_Px", fBuffer_ClusterCandidate_MC_Mother_Px, "ClusterCandidate_MC_Mother_Px[NClusterCandidates]/F"); fAnalysisTree->Branch("ClusterCandidate_MC_Mother_Py", fBuffer_ClusterCandidate_MC_Mother_Py, "ClusterCandidate_MC_Mother_Py[NClusterCandidates]/F"); @@ -517,10 +562,12 @@ void AliAnalysisTaskCorrelationTree::UserExec(Option_t *) Double_t fMaxVertexZ = 10.0; Int_t eventQuality = ((AliConvEventCuts *)fV0Reader->GetEventCuts())->GetEventQuality(); - if(fInputEvent->IsIncompleteDAQ()==true) eventQuality = 2; // incomplete event + if (fInputEvent->IsIncompleteDAQ() == true) + eventQuality = 2; // incomplete event + fHistoNEvents->Fill(eventQuality); - if (eventQuality == 2 || eventQuality == 3) + if (eventQuality == 2) { // cout << "Event not accepted with event quality " << eventQuality << endl; return; @@ -560,12 +607,14 @@ void AliAnalysisTaskCorrelationTree::UserExec(Option_t *) // // return; // } fBuffer_NContributors = fInputEvent->GetPrimaryVertex()->GetNContributors(); - + fBuffer_RunNumber = fInputEvent->GetRunNumber(); if (TMath::Abs(fInputEvent->GetPrimaryVertex()->GetZ()) > fMaxVertexZ) return; + fBuffer_VertexZ = fInputEvent->GetPrimaryVertex()->GetZ(); fBuffer_NEventTriggers = 0; TString firedTrigClass = fInputEvent->GetFiredTriggerClasses(); - TString triggerClasses[11] = {"CEMC7MUL", "CEMC7MSL", "CEMC7MSH", "CDMC7MUL", "CDMC7MSL", "CDMC7MSH", "CEMC7", "CDMC7", "CMUL7", "CMSL7", "CMSH7"}; + const int nTriggers = 13; + TString triggerClasses[nTriggers] = {"CEMC7MUL-B-NOPF-ALLNOTRD", "CEMC7MSL-B-NOPF-ALLNOTRD", "CEMC7MSH-B-NOPF-ALLNOTRD", "CDMC7MUL-B-NOPF-ALLNOTRD", "CDMC7MSL-B-NOPF-ALLNOTRD", "CDMC7MSH-B-NOPF-ALLNOTRD", "CMUL7-B-NOPF-ALLNOTRD", "CMSL7-B-NOPF-ALLNOTRD", "CMSH7-B-NOPF-ALLNOTRD", "CEMC7-B-NOPF-ALLNOTRD", "CDMC7-B-NOPF-ALLNOTRD", "CPHI7MSL-B-NOPF-ALLNOTRD", "CPHI7-B-NOPF-ALLNOTRD"}; if (fIsMC) { fBuffer_EventTrigger[fBuffer_NEventTriggers] = 0; @@ -573,7 +622,7 @@ void AliAnalysisTaskCorrelationTree::UserExec(Option_t *) } else { - for (Int_t i = 0; i < 11; i++) + for (Int_t i = 0; i < nTriggers; i++) { if (firedTrigClass.Contains(triggerClasses[i])) { @@ -601,6 +650,11 @@ void AliAnalysisTaskCorrelationTree::UserExec(Option_t *) ProcessElectrons(); ProcessMuons(); + if (fBuffer_NMuonCandidates == 0) + return; + if (fBuffer_NElectronCandidates == 0 && fBuffer_NClusterCandidates == 0) + return; + // fill tree for each accepted event if (fAnalysisTree) { @@ -617,8 +671,7 @@ void AliAnalysisTaskCorrelationTree::ProcessElectrons() fBuffer_NElectronCandidates = 0; Int_t ntracks = event->GetNumberOfTracks(); - double fEtaCutMax = 0.9; - double fEtaCutMin = -0.9; + double absEtaCut = 0.9; // double fTPCnCrossedRows = -0.8; double fPtCutMainEle = 0.4; @@ -631,7 +684,7 @@ void AliAnalysisTaskCorrelationTree::ProcessElectrons() AliFatal("Not a standard AOD"); double eta = track->Eta(); - if (eta > fEtaCutMax || eta < fEtaCutMin) + if (abs(eta) > absEtaCut) continue; if (!track->TestFilterBit(16)) @@ -742,6 +795,39 @@ void AliAnalysisTaskCorrelationTree::ProcessElectrons() fBuffer_ElectronCandidate_NSigmaPionTPC[fBuffer_NElectronCandidates] = fPidResponse->NumberOfSigmasTPC(track, AliPID::kPion); fBuffer_ElectronCandidate_NSigmaPionTOF[fBuffer_NElectronCandidates] = fPidResponse->NumberOfSigmasTOF(track, AliPID::kPion); fBuffer_ElectronCandidate_NSigmaProtonTPC[fBuffer_NElectronCandidates] = fPidResponse->NumberOfSigmasTPC(track, AliPID::kProton); + + bool doPropagation = true; + if (doPropagation) + { + AliExternalTrackParam *trackParam = 0; + if (TMath::Abs(track->GetTrackEtaOnEMCal()) < 0.75) + { + if (!(track->GetTrackPhiOnEMCal() < 70 * TMath::DegToRad() || track->GetTrackPhiOnEMCal() > 190 * TMath::DegToRad()) && (track->GetTrackPhiOnEMCal() < 250 * TMath::DegToRad() || track->GetTrackPhiOnEMCal() > 340 * TMath::DegToRad())) + { + Double_t xyz[3] = {0}, pxpypz[3] = {0}, cv[21] = {0}; + track->GetPxPyPz(pxpypz); + track->GetXYZ(xyz); + track->GetCovarianceXYZPxPyPz(cv); + trackParam = new AliExternalTrackParam(xyz, pxpypz, cv, track->Charge()); + Float_t eta, phi, pt; + AliExternalTrackParam emcParam(*trackParam); + + if (!AliEMCALRecoUtils::ExtrapolateTrackToEMCalSurface(&emcParam, 440., 0.139, 20., eta, phi, pt)) + { + delete trackParam; + } + else + { + if (TMath::Abs(eta) < 0.75 && ((phi > 70 * TMath::DegToRad() && phi < 190 * TMath::DegToRad()) || (phi > 250 * TMath::DegToRad() && phi < 340 * TMath::DegToRad()))) + { + fBuffer_ElectronCandidate_PropEta[fBuffer_NElectronCandidates] = eta; + fBuffer_ElectronCandidate_PropPhi[fBuffer_NElectronCandidates] = phi; + } + delete trackParam; + } + } + } + } // cout << "\ttrack " << j << "\tpx " << track->Px() << "\tpy " << track->Py() << "\tpz " << track->Pz() << "\tE " << track->E() << endl; if (fIsMC) @@ -773,14 +859,17 @@ void AliAnalysisTaskCorrelationTree::ProcessElectrons() AliAODMCParticle *mcGrandMother = dynamic_cast(fMCEvent->GetTrack(mcMother->GetMother())); if (mcGrandMother) { - // fBuffer_ElectronCandidate_MC_GrandMother_E[fBuffer_NElectronCandidates] = mcGrandMother->E(); - // fBuffer_ElectronCandidate_MC_GrandMother_Px[fBuffer_NElectronCandidates] = mcGrandMother->Px(); - // fBuffer_ElectronCandidate_MC_GrandMother_Py[fBuffer_NElectronCandidates] = mcGrandMother->Py(); - // fBuffer_ElectronCandidate_MC_GrandMother_Pz[fBuffer_NElectronCandidates] = mcGrandMother->Pz(); fBuffer_ElectronCandidate_MC_GrandMother_PDG[fBuffer_NElectronCandidates] = mcGrandMother->GetPdgCode(); + fBuffer_ElectronCandidate_MC_GrandMother_Pt[fBuffer_NElectronCandidates] = mcGrandMother->Pt(); + + AliAODMCParticle *mcGGrandMother = dynamic_cast(fMCEvent->GetTrack(mcGrandMother->GetMother())); + if (mcGGrandMother) + { + fBuffer_ElectronCandidate_MC_GGrandMother_PDG[fBuffer_NElectronCandidates] = mcGGrandMother->GetPdgCode(); + fBuffer_ElectronCandidate_MC_GGrandMother_PDG[fBuffer_NElectronCandidates] = mcGGrandMother->Pt(); + } } } - // fBuffer_ElectronCandidate_MCStatusCode[fBuffer_NElectronCandidates] = mcTrack->GetStatusCode(); // fBuffer_ElectronCandidate_MCIsPrimary[fBuffer_NElectronCandidates] = mcTrack->IsPrimary(); // fBuffer_ElectronCandidate_MCIsSecondaryFromWeakDecay[fBuffer_NElectronCandidates] = mcTrack->IsSecondaryFromWeakDecay(); @@ -885,11 +974,15 @@ void AliAnalysisTaskCorrelationTree::ProcessMuons() AliAODMCParticle *mcGrandMother = dynamic_cast(fMCEvent->GetTrack(mcMother->GetMother())); if (mcGrandMother) { - // fBuffer_MuonCandidate_MC_GrandMother_E[fBuffer_NMuonCandidates] = mcGrandMother->E(); - // fBuffer_MuonCandidate_MC_GrandMother_Px[fBuffer_NMuonCandidates] = mcGrandMother->Px(); - // fBuffer_MuonCandidate_MC_GrandMother_Py[fBuffer_NMuonCandidates] = mcGrandMother->Py(); - // fBuffer_MuonCandidate_MC_GrandMother_Pz[fBuffer_NMuonCandidates] = mcGrandMother->Pz(); fBuffer_MuonCandidate_MC_GrandMother_PDG[fBuffer_NMuonCandidates] = mcGrandMother->GetPdgCode(); + fBuffer_MuonCandidate_MC_GrandMother_Pt[fBuffer_NMuonCandidates] = mcGrandMother->Pt(); + + AliAODMCParticle *mcGGrandMother = dynamic_cast(fMCEvent->GetTrack(mcGrandMother->GetMother())); + if (mcGGrandMother) + { + fBuffer_MuonCandidate_MC_GGrandMother_PDG[fBuffer_NMuonCandidates] = mcGGrandMother->GetPdgCode(); + fBuffer_MuonCandidate_MC_GGrandMother_Pt[fBuffer_NMuonCandidates] = mcGGrandMother->Pt(); + } } } @@ -1140,74 +1233,6 @@ void AliAnalysisTaskCorrelationTree::ProcessClusters() // return kind; // } -//________________________________________________________________________ -// UInt_t AliAnalysisTaskCorrelationTree::GetTrueMotherInfoAOD(AliAODConversionPhoton *TruePhotonCandidate) -// { -// UInt_t kind = 9; -// TClonesArray *AODMCTrackArray = dynamic_cast(fInputEvent->FindListObject(AliAODMCParticle::StdBranchName())); -// if (AODMCTrackArray != NULL && TruePhotonCandidate != NULL) -// { -// if (TruePhotonCandidate->GetMCLabelPositive() == -1 || TruePhotonCandidate->GetMCLabelNegative() == -1) -// { -// return kind; -// } -// AliAODMCParticle *positiveMC = static_cast(AODMCTrackArray->At(TruePhotonCandidate->GetMCLabelPositive())); -// AliAODMCParticle *negativeMC = static_cast(AODMCTrackArray->At(TruePhotonCandidate->GetMCLabelNegative())); - -// Int_t gammaMCLabel = -1; -// if (!positiveMC || !negativeMC) -// return kind; - -// if (positiveMC->GetMother() > -1 && (negativeMC->GetMother() == positiveMC->GetMother())) -// { -// gammaMCLabel = positiveMC->GetMother(); -// } -// AliAODMCParticle *photonCandMCParticle = (AliAODMCParticle *)AODMCTrackArray->At(gammaMCLabel); -// Int_t pdgCodeMother = 0; - -// if (photonCandMCParticle == NULL) -// { -// // particle does not exist -// kind = 9; -// } -// else if (photonCandMCParticle->GetMother() == -1) -// { -// // particle mother is no particle -// kind = 9; -// } -// else -// { -// // get mother and save ID of mother -// AliAODMCParticle *photonMotherParticle = (AliAODMCParticle *)AODMCTrackArray->At(photonCandMCParticle->GetMother()); -// if (photonMotherParticle != NULL) -// { -// fBuffer_ElectronCandidate_MC_Mother_ID[fBuffer_NElectronCandidates] = photonCandMCParticle->GetMother(); -// // get true Pt of mother particle -// fBuffer_ElectronCandidate_MC_Mother_TruePt[fBuffer_NElectronCandidates] = photonMotherParticle->Pt(); - -// // get PDG code of mother and save it -// pdgCodeMother = photonMotherParticle->GetPdgCode(); -// fBuffer_ElectronCandidate_MC_Mother_PDG[fBuffer_NElectronCandidates] = pdgCodeMother; - -// if (TMath::Abs(pdgCodeMother) == 111) -// { -// if (photonMotherParticle->GetMother() != -1) -// { -// AliAODMCParticle *photonGrandMotherParticle = (AliAODMCParticle *)AODMCTrackArray->At(photonMotherParticle->GetMother()); -// fBuffer_ElectronCandidate_MC_GrandMother_PDG[fBuffer_NElectronCandidates] = photonGrandMotherParticle->GetPdgCode(); -// return 5; -// } -// else -// { -// return 0; -// } -// } -// } -// } -// } -// return kind; -// } - //________________________________________________________________________ void AliAnalysisTaskCorrelationTree::Terminate(Option_t *) { @@ -1218,6 +1243,8 @@ void AliAnalysisTaskCorrelationTree::ResetBuffer() fBuffer_NEventTriggers = 0; fBuffer_NContributors = 0; + fBuffer_RunNumber = 0; + fBuffer_VertexZ = 0; for (Int_t ntrig = 0; ntrig < kMaxTriggers; ntrig++) { fBuffer_EventTrigger[ntrig] = 0; @@ -1233,6 +1260,8 @@ void AliAnalysisTaskCorrelationTree::ResetBuffer() fBuffer_ElectronCandidate_Px[ccand] = 0; fBuffer_ElectronCandidate_Py[ccand] = 0; fBuffer_ElectronCandidate_Pz[ccand] = 0; + fBuffer_ElectronCandidate_PropEta[ccand] = 0; + fBuffer_ElectronCandidate_PropPhi[ccand] = 0; fBuffer_ElectronCandidate_Charge[ccand] = 0; fBuffer_ElectronCandidate_NSigmaElecTPC[ccand] = 0; fBuffer_ElectronCandidate_NSigmaElecTOF[ccand] = 0; @@ -1254,6 +1283,9 @@ void AliAnalysisTaskCorrelationTree::ResetBuffer() fBuffer_ElectronCandidate_MC_Mother_Pz[ccand] = 0; fBuffer_ElectronCandidate_MC_Mother_PDG[ccand] = 0; fBuffer_ElectronCandidate_MC_GrandMother_PDG[ccand] = 0; + fBuffer_ElectronCandidate_MC_GrandMother_Pt[ccand] = 0; + fBuffer_ElectronCandidate_MC_GGrandMother_PDG[ccand] = 0; + fBuffer_ElectronCandidate_MC_GGrandMother_Pt[ccand] = 0; } fBuffer_MuonCandidate_E[ccand] = 0; fBuffer_MuonCandidate_Px[ccand] = 0; @@ -1278,6 +1310,9 @@ void AliAnalysisTaskCorrelationTree::ResetBuffer() fBuffer_MuonCandidate_MC_Mother_Pz[ccand] = 0; fBuffer_MuonCandidate_MC_Mother_PDG[ccand] = 0; fBuffer_MuonCandidate_MC_GrandMother_PDG[ccand] = 0; + fBuffer_MuonCandidate_MC_GrandMother_Pt[ccand] = 0; + fBuffer_MuonCandidate_MC_GGrandMother_PDG[ccand] = 0; + fBuffer_MuonCandidate_MC_GGrandMother_Pt[ccand] = 0; } fBuffer_ClusterCandidate_E[ccand] = 0; fBuffer_ClusterCandidate_Px[ccand] = 0; diff --git a/PWGGA/GammaConv/AliAnalysisTaskCorrelationTree.h b/PWGGA/GammaConv/AliAnalysisTaskCorrelationTree.h index ac192d90985..d257b4218e4 100644 --- a/PWGGA/GammaConv/AliAnalysisTaskCorrelationTree.h +++ b/PWGGA/GammaConv/AliAnalysisTaskCorrelationTree.h @@ -92,6 +92,8 @@ class AliAnalysisTaskCorrelationTree : public AliAnalysisTaskSE{ AliPIDResponse *fPidResponse; TH1F* fHistoNEvents; //! array of histos with event information Int_t fBuffer_NContributors; // + Float_t fBuffer_RunNumber; // + Int_t fBuffer_VertexZ; // Int_t fBuffer_NEventTriggers; // Int_t* fBuffer_EventTrigger; // Int_t fBuffer_NElectronCandidates; // @@ -99,6 +101,8 @@ class AliAnalysisTaskCorrelationTree : public AliAnalysisTaskSE{ Float_t* fBuffer_ElectronCandidate_Px; // Float_t* fBuffer_ElectronCandidate_Py; // Float_t* fBuffer_ElectronCandidate_Pz; // + Float_t* fBuffer_ElectronCandidate_PropEta; // + Float_t* fBuffer_ElectronCandidate_PropPhi; // Float_t* fBuffer_ElectronCandidate_Charge; // Float_t* fBuffer_ElectronCandidate_NSigmaElecTPC; // Float_t* fBuffer_ElectronCandidate_NSigmaElecTOF; // @@ -117,6 +121,9 @@ class AliAnalysisTaskCorrelationTree : public AliAnalysisTaskSE{ Float_t* fBuffer_ElectronCandidate_MC_Mother_Pz; Int_t* fBuffer_ElectronCandidate_MC_Mother_PDG; Int_t* fBuffer_ElectronCandidate_MC_GrandMother_PDG; + Float_t* fBuffer_ElectronCandidate_MC_GrandMother_Pt; + Int_t* fBuffer_ElectronCandidate_MC_GGrandMother_PDG; + Float_t* fBuffer_ElectronCandidate_MC_GGrandMother_Pt; Int_t fBuffer_NMuonCandidates; // Float_t* fBuffer_MuonCandidate_E; // Float_t* fBuffer_MuonCandidate_Px; // @@ -138,6 +145,9 @@ class AliAnalysisTaskCorrelationTree : public AliAnalysisTaskSE{ Float_t* fBuffer_MuonCandidate_MC_Mother_Pz; Int_t* fBuffer_MuonCandidate_MC_Mother_PDG; Int_t* fBuffer_MuonCandidate_MC_GrandMother_PDG; + Float_t* fBuffer_MuonCandidate_MC_GrandMother_Pt; + Int_t* fBuffer_MuonCandidate_MC_GGrandMother_PDG; + Float_t* fBuffer_MuonCandidate_MC_GGrandMother_Pt; Int_t fBuffer_NClusterCandidates; // Float_t* fBuffer_ClusterCandidate_E; // Float_t* fBuffer_ClusterCandidate_Px; // From f6db4ed0a42bd7d6185ad6bce576cb72a3dd084e Mon Sep 17 00:00:00 2001 From: Patrick Steffanic Date: Thu, 20 Apr 2023 16:55:46 -0400 Subject: [PATCH 42/51] Removing some added filterbits to make a comparison to Charles --- ...iAnalysisTaskEmcalJetHdEdxCorrelations.cxx | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalJetHdEdxCorrelations.cxx b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalJetHdEdxCorrelations.cxx index e307b2df60b..44778b03ff3 100644 --- a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalJetHdEdxCorrelations.cxx +++ b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalJetHdEdxCorrelations.cxx @@ -278,16 +278,16 @@ namespace PWGJE UInt_t cifras = 0; // bit coded, see GetDimParams() below if (fDoLessSparseAxes) { - cifras = 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 7 | 1 << 11 | 1 << 12 | 1 << 13 | 1 << 14 | 1 << 15 | 1 << 16; + cifras = 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 7 | 1 << 11 | 1 << 12 | 1 << 13 | 1 << 14 | 1 << 15; } else { - cifras = 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 7 | 1 << 11 | 1 << 12 | 1 << 13 | 1 << 14 | 1 << 15 | 1 << 16; + cifras = 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 7 | 1 << 11 | 1 << 12 | 1 << 13 | 1 << 14 | 1 << 15; ; } if (fForceBeamType == AliAnalysisTaskEmcal::kpp) { - cifras = 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 11 | 1 << 12 | 1 << 13 | 1 << 14 | 1 << 15 | 1 << 16; + cifras = 1 << 0 | 1 << 1 | 1 << 2 | 1 << 3 | 1 << 4 | 1 << 11 | 1 << 12 | 1 << 13 | 1 << 14 | 1 << 15; } fhnJH = NewTHnSparseF("fhnJH", cifras); fhnJH->Sumw2(); @@ -450,9 +450,6 @@ namespace PWGJE // NOTE: Clusters are never used directly in the task, so the container is neither created not retrieved // Retrieve tracks AliTrackContainer *tracks = static_cast(GetParticleContainer("tracksForCorrelations")); - tracks->AddAODFilterBit((UInt_t)96); - tracks->AddAODFilterBit((UInt_t)16); - tracks->AddAODFilterBit((UInt_t)768); if (!tracks) { AliError(Form("%s: Unable to retrieve tracks!", GetName())); @@ -634,13 +631,13 @@ namespace PWGJE Double_t pionTOFnSigma; Double_t protonTOFnSigma; Double_t kaonTOFnSigma; - Double_t electronTOFnSigma; + pionTPCnSigma = pidResponse->NumberOfSigmasTPC(vTrack, (AliPID::EParticleType)2); pionTOFnSigma = pidResponse->NumberOfSigmasTOF(vTrack, (AliPID::EParticleType)2); protonTOFnSigma = pidResponse->NumberOfSigmasTOF(vTrack, (AliPID::EParticleType)4); kaonTOFnSigma = pidResponse->NumberOfSigmasTOF(vTrack, (AliPID::EParticleType)3); - electronTOFnSigma = pidResponse->NumberOfSigmasTOF(vTrack, (AliPID::EParticleType)0); + // Double_t TPCsignal = aodTrack->GetTPCsignal(); @@ -662,18 +659,18 @@ namespace PWGJE { if (fDoLessSparseAxes) { // check if we want all dimensions - double triggerEntries[] = {eventActivity, jetPt, track.Pt(), deltaEta, deltaPhi, /*static_cast(leadJet),*/ epAngle, trackEta, pionTPCnSigma, pionTOFnSigma, protonTOFnSigma, kaonTOFnSigma, electronTOFnSigma}; + double triggerEntries[] = {eventActivity, jetPt, track.Pt(), deltaEta, deltaPhi, /*static_cast(leadJet),*/ epAngle, trackEta, pionTPCnSigma, pionTOFnSigma, protonTOFnSigma, kaonTOFnSigma}; FillHist(fhnJH, triggerEntries, 1.0 / efficiency); } else { - double triggerEntries[] = {eventActivity, jetPt, track.Pt(), deltaEta, deltaPhi, /*static_cast(leadJet),*/ epAngle, zVertex, deltaR, trackEta, pionTPCnSigma, pionTOFnSigma, protonTOFnSigma, kaonTOFnSigma, electronTOFnSigma}; + double triggerEntries[] = {eventActivity, jetPt, track.Pt(), deltaEta, deltaPhi, /*static_cast(leadJet),*/ epAngle, zVertex, deltaR, trackEta, pionTPCnSigma, pionTOFnSigma, protonTOFnSigma, kaonTOFnSigma); FillHist(fhnJH, triggerEntries, 1.0 / efficiency); } } else { - double triggerEntries[] = {eventActivity, jetPt, track.Pt(), deltaEta, deltaPhi, /*static_cast(leadJet),*/ trackEta, pionTPCnSigma, pionTOFnSigma, protonTOFnSigma, kaonTOFnSigma, electronTOFnSigma}; + double triggerEntries[] = {eventActivity, jetPt, track.Pt(), deltaEta, deltaPhi, /*static_cast(leadJet),*/ trackEta, pionTPCnSigma, pionTOFnSigma, protonTOFnSigma, kaonTOFnSigma}; FillHist(fhnJH, triggerEntries, 1.0 / efficiency); } } From 9e80c303c03641a7e60a1b97caa0909a6ddcd79a Mon Sep 17 00:00:00 2001 From: Patrick Steffanic Date: Fri, 21 Apr 2023 16:22:31 -0400 Subject: [PATCH 43/51] )->} --- .../UserTasks/AliAnalysisTaskEmcalJetHdEdxCorrelations.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalJetHdEdxCorrelations.cxx b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalJetHdEdxCorrelations.cxx index 44778b03ff3..0d1d290776b 100644 --- a/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalJetHdEdxCorrelations.cxx +++ b/PWGJE/EMCALJetTasks/UserTasks/AliAnalysisTaskEmcalJetHdEdxCorrelations.cxx @@ -664,7 +664,7 @@ namespace PWGJE } else { - double triggerEntries[] = {eventActivity, jetPt, track.Pt(), deltaEta, deltaPhi, /*static_cast(leadJet),*/ epAngle, zVertex, deltaR, trackEta, pionTPCnSigma, pionTOFnSigma, protonTOFnSigma, kaonTOFnSigma); + double triggerEntries[] = {eventActivity, jetPt, track.Pt(), deltaEta, deltaPhi, /*static_cast(leadJet),*/ epAngle, zVertex, deltaR, trackEta, pionTPCnSigma, pionTOFnSigma, protonTOFnSigma, kaonTOFnSigma}; FillHist(fhnJH, triggerEntries, 1.0 / efficiency); } } From 502756195fb14eec3bc6651501c9f62bbacccc19 Mon Sep 17 00:00:00 2001 From: Victor Gonzalez Date: Sun, 23 Apr 2023 11:59:07 +0200 Subject: [PATCH 44/51] Addressing the TOF hole --- .../DPhi/Unfoldedhistos/Ali2PCorrelations.cxx | 3 + .../AliAnalysisTaskCorrelationsStudies.cxx | 13 +++ .../AliTwoParticleCorrelationsBase.cxx | 91 ++++++++++++++++++- .../AliTwoParticleCorrelationsBase.h | 6 +- 4 files changed, 108 insertions(+), 5 deletions(-) diff --git a/PWGCF/Correlations/DPhi/Unfoldedhistos/Ali2PCorrelations.cxx b/PWGCF/Correlations/DPhi/Unfoldedhistos/Ali2PCorrelations.cxx index c5a211cc88b..1c2ff6a9020 100644 --- a/PWGCF/Correlations/DPhi/Unfoldedhistos/Ali2PCorrelations.cxx +++ b/PWGCF/Correlations/DPhi/Unfoldedhistos/Ali2PCorrelations.cxx @@ -286,6 +286,9 @@ bool Ali2PCorrelations::ProcessTrack(int pid, float pT, float eta, float ophi) float phi = ophi; if (!(phi < fMax_phi)) phi = phi - 2 * TMath::Pi(); + if (phi < fMin_phi) { + return kFALSE; + } float ixPhi = int((phi - fMin_phi) / fWidth_phi); if (ixPhi < 0 || !(ixPhi < fNBins_phi)) { AliWarning("Track one phi out of bins"); diff --git a/PWGCF/Correlations/DPhi/Unfoldedhistos/AliAnalysisTaskCorrelationsStudies.cxx b/PWGCF/Correlations/DPhi/Unfoldedhistos/AliAnalysisTaskCorrelationsStudies.cxx index 412ee795f9a..339ac3e139b 100644 --- a/PWGCF/Correlations/DPhi/Unfoldedhistos/AliAnalysisTaskCorrelationsStudies.cxx +++ b/PWGCF/Correlations/DPhi/Unfoldedhistos/AliAnalysisTaskCorrelationsStudies.cxx @@ -1807,6 +1807,11 @@ void AliAnalysisTaskCorrelationsStudies::ProcessTracks(Bool_t simulated) Bool_t bTrackAccepted = fTrackSelectionCuts->IsTrackAccepted(vtrack); AliCSTrackSelection::poiIds pid = fTrackSelectionCuts->GetAcceptedTrackPOIId(); + /* pre-check the particle acceptance */ + if (fDoProcessCorrelations) { + bTrackAccepted = bTrackAccepted && fProcessCorrelations->IsTrackAccepted(i, vtrack); + } + /* only fill histograms if this is not an additional simulated event */ if (!simulated) { @@ -2048,6 +2053,14 @@ void AliAnalysisTaskCorrelationsStudies::ProcessTrueTracks() part = (AliAODMCParticle *) arrayMC->At(iTrack); } + /* pre-check the particle acceptance */ + if (fDoProcessCorrelations) { + if (!fProcessTrueCorrelations->IsTrackAccepted(iTrack, part)) { + /* particle not accepted by the correlations cuts */ + continue; + } + } + p = part->P(); pt = part->Pt(); pz = part->Pz(); diff --git a/PWGCF/Correlations/DPhi/Unfoldedhistos/AliTwoParticleCorrelationsBase.cxx b/PWGCF/Correlations/DPhi/Unfoldedhistos/AliTwoParticleCorrelationsBase.cxx index bc4e00b7e1b..1b3b55fa5c2 100644 --- a/PWGCF/Correlations/DPhi/Unfoldedhistos/AliTwoParticleCorrelationsBase.cxx +++ b/PWGCF/Correlations/DPhi/Unfoldedhistos/AliTwoParticleCorrelationsBase.cxx @@ -82,6 +82,7 @@ AliTwoParticleCorrelationsBase::AliTwoParticleCorrelationsBase() fMin_phi(0.0), fMax_phi(TMath::Pi() * 2.0), fWidth_phi(TMath::Pi() * 2.0 / 72.0), + fExcludeTOFHole(false), /* eta bins */ fNBins_eta(20), fMin_eta(-1.0), @@ -159,6 +160,7 @@ AliTwoParticleCorrelationsBase::AliTwoParticleCorrelationsBase(const char* name) fMin_phi(0.0), fMax_phi(TMath::Pi() * 2.0), fWidth_phi(TMath::Pi() * 2.0 / 72.0), + fExcludeTOFHole(false), /* eta bins */ fNBins_eta(20), fMin_eta(-1.0), @@ -220,8 +222,17 @@ Bool_t AliTwoParticleCorrelationsBase::ConfigureBinning(const char *confstring) TObjArray *a = stritem.Tokenize(","); if (a->GetEntries() != DPTDPTCORRBINCONFIGPAR) { - delete a; - return false; + if (a->GetEntries() != DPTDPTCORRBINCONFIGPAR+1) { + delete a; + return false; + } else { + if (TString(a->At(DPTDPTCORRBINCONFIGPAR)->GetName()).EqualTo("TOF")) { + fExcludeTOFHole = true; + } else { + delete a; + return false; + } + } } sscanf(stritem, "%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%lf,%d", &fMin_vertexZ, &fMax_vertexZ, &fWidth_vertexZ, @@ -266,10 +277,11 @@ void AliTwoParticleCorrelationsBase::ConfigureResonances(const char *confstring) /// \return the configuration string corresponding to the current configuration TString AliTwoParticleCorrelationsBase::GetBinningConfigurationString() const { - return TString::Format("%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%d", + return TString::Format("%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%.1f,%d%s", fMin_vertexZ, fMax_vertexZ, fWidth_vertexZ, fMin_pt, fMax_pt, fWidth_pt, - fMin_eta, fMax_eta, fWidth_eta, fNBins_phi); + fMin_eta, fMax_eta, fWidth_eta, fNBins_phi, + fExcludeTOFHole ? ",TOF" : ""); } /// \brief Build the resonances rejection configuration string @@ -322,6 +334,8 @@ void AliTwoParticleCorrelationsBase::Initialize() fOutput->Add(new TParameter("MaxEta", fMax_eta, 'f')); fOutput->Add(new TParameter("MinPhi", fMin_phi, 'f')); fOutput->Add(new TParameter("MaxPhi", fMax_phi, 'f')); + fOutput->Add(new TParameter("NoBinsPhiShift", fNBinsPhiShift, 'f')); + fOutput->Add(new TParameter("ExcludeTOFHole", fExcludeTOFHole, 'f')); /* incorporate the resonance rejection configuration parameter */ Int_t rescode = 0; @@ -391,6 +405,12 @@ void AliTwoParticleCorrelationsBase::Initialize() } } TH1::AddDirectory(oldstatus); + + /* after histogram creation the proper phi upper limit is set according to inclusion or not of the TOF hole */ + if (fExcludeTOFHole) { + const int nPhiBinsTOFHole = 25; + fMax_phi = fMax_phi - fWidth_phi * nPhiBinsTOFHole; + } } /// \brief Stores the correction weights for the different track species @@ -641,6 +661,69 @@ Bool_t AliTwoParticleCorrelationsBase::StartEvent(Float_t centrality, Float_t ve return kTRUE; } +/// \brief check if the track is accepted according to the correlations cuts +/// +/// \param pid the external track Id +/// \param trk the passed track +/// \return kTRUE if the track is accepted kFALSE otherwise +bool AliTwoParticleCorrelationsBase::IsTrackAccepted(int pid, AliVTrack* trk) +{ + return IsTrackAccepted((trk->Charge() > 0) ? 0 : 1, float(trk->Pt()), float(trk->Eta()), float(trk->Phi())); +} + +/// \brief check if the true particle is accepted according to the correlations cuts +/// +/// \param pid the external particle Id +/// \param part the passed particle +/// \return kTRUE if the particle is properly handled kFALSE otherwise +bool AliTwoParticleCorrelationsBase::IsTrackAccepted(int pid, AliVParticle* part) +{ + if (part->Charge() != 0) { + return IsTrackAccepted((part->Charge() > 0) ? 0 : 1, float(part->Pt()), float(part->Eta()), float(part->Phi())); + } + else { + return kFALSE; + } +} + +/// \brief checks if the track is accepted according to the configured cuts +/// \param pid the track PID +/// \param pT the track \f$ p_T \f$ +/// \param eta the track \f$ \eta \f$ +/// \param phi the track \f$ \phi \f$ +/// \return kTRUE if the track is accepted +/// This is a pre-check so for the time being the pT cut is not checked +/// to allow PID information depending on momentum +bool AliTwoParticleCorrelationsBase::IsTrackAccepted(int pid, float, float eta, float ophi) +{ + /* for the time being */ + if (pid != 0 && pid != 1) + return kFALSE; + + /* consider a potential phi origin shift */ + float phi = ophi; + if (!(phi < fMax_phi)) + phi = phi - 2 * TMath::Pi(); + if (phi < fMin_phi) { + return kFALSE; + } + float ixPhi = int((phi - fMin_phi) / fWidth_phi); + if (ixPhi < 0 || !(ixPhi < fNBins_phi)) { + return kFALSE; + } + + if (eta < fMin_eta || fMax_eta < eta) { + return kFALSE; + } + + int ixEta = int((eta - fMin_eta) / fWidth_eta); + if (ixEta < 0 || !(ixEta < fNBins_eta)) { + return kFALSE; + } + return kTRUE; +} + + /// \brief process a track and store its parameters if feasible /// /// If simulation is ordered the actual track is discarded and a new one with the diff --git a/PWGCF/Correlations/DPhi/Unfoldedhistos/AliTwoParticleCorrelationsBase.h b/PWGCF/Correlations/DPhi/Unfoldedhistos/AliTwoParticleCorrelationsBase.h index d32a08694a7..dd6f003f813 100644 --- a/PWGCF/Correlations/DPhi/Unfoldedhistos/AliTwoParticleCorrelationsBase.h +++ b/PWGCF/Correlations/DPhi/Unfoldedhistos/AliTwoParticleCorrelationsBase.h @@ -77,6 +77,9 @@ class AliTwoParticleCorrelationsBase : public TNamed { /// \return the histograms list TList *GetHistogramsList() { return fOutput; } virtual bool StartEvent(float centrality, float vertexZ); + virtual bool IsTrackAccepted(int id, AliVTrack* trk); + virtual bool IsTrackAccepted(int id, AliVParticle* part); + virtual bool IsTrackAccepted(int pid, float pT, float eta, float phi); virtual bool ProcessTrack(int id, AliVTrack* trk); virtual bool ProcessTrack(int id, AliVParticle* part); virtual bool ProcessTrack(int pid, float pT, float eta, float phi) = 0; @@ -129,6 +132,7 @@ class AliTwoParticleCorrelationsBase : public TNamed { double fMin_phi; ///< the track minimum \f$\phi\f$ value double fMax_phi; ///< the track maximum \f$\phi\f$ value double fWidth_phi; ///< the track \f$\phi\f$ bin width + bool fExcludeTOFHole; ///< exclude azimuthally the TOF hole int fNBins_eta; ///< the track \f$\eta\f$ number of bins double fMin_eta; ///< the track minimum \f$\eta\f$ value double fMax_eta; ///< the track maximum \f$\eta\f$ value @@ -178,7 +182,7 @@ class AliTwoParticleCorrelationsBase : public TNamed { AliTwoParticleCorrelationsBase& operator=(const AliTwoParticleCorrelationsBase&); /// \cond CLASSIMP - ClassDef(AliTwoParticleCorrelationsBase, 2); + ClassDef(AliTwoParticleCorrelationsBase, 3); /// \endcond }; From 280631bf1f946e6f62681adbbe9fa8814d704eee Mon Sep 17 00:00:00 2001 From: Gyula Bencedi Date: Mon, 24 Apr 2023 10:24:09 +0200 Subject: [PATCH 45/51] Changed pT binning --- .../AliAnalysisTaskSpectraFlatenicity.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/PWGMM/UE/Flatenicity/AliAnalysisTaskSpectraFlatenicity.cxx b/PWGMM/UE/Flatenicity/AliAnalysisTaskSpectraFlatenicity.cxx index 0f737e1c3fb..56baf387411 100755 --- a/PWGMM/UE/Flatenicity/AliAnalysisTaskSpectraFlatenicity.cxx +++ b/PWGMM/UE/Flatenicity/AliAnalysisTaskSpectraFlatenicity.cxx @@ -81,14 +81,16 @@ using std::endl; #include "AliAnalysisTaskSpectraFlatenicity.h" -const Int_t nPtbinsFlatSpecFlatSpec = 41; +const Int_t nPtbinsFlatSpecFlatSpec = 56; Double_t PtbinsFlatSpec[nPtbinsFlatSpecFlatSpec+1] = { 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, - 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1 , 1.2, 1.3 , 1.4, - 1.5, 1.6, 1.7 , 1.8, 1.9 , 2.0, 2.2 , 2.4, 2.6 , 2.8, - 3.0, 3.2, 3.4, 3.6 , 3.8, 4.0 , 4.5, 5.0 , 6.0, 8.0 , - 10.0, 20.0}; - + 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1 , 1.2, 1.3, 1.4, + 1.5 , 1.6, 1.7 , 1.8, 1.9 , 2.0, 2.2 , 2.4, 2.6, 2.8, + 3.0 , 3.2, 3.4 , 3.6, 3.8 , 4.0, 4.5 , 5.0, 5.5, 6.0, + 6.5 , 7.0, 8.0 , 9.0, 10.0, 11.0,12.0,13.0,14.0,15.0, + 16.0,18.0, 20.0,22.0, 24.0, 26.0,30.0}; + + const Int_t DCAxyNBins = 121; Double_t DCAxyBins[DCAxyNBins + 1] = { -3.025, -2.975, -2.925, -2.875, -2.825, -2.775, -2.725, -2.675, -2.625, -2.575, From 85fc64d0758711199c67e7b8cc5d9e3327d4c3d0 Mon Sep 17 00:00:00 2001 From: ChunzhengLab Date: Mon, 24 Apr 2023 17:00:24 +0800 Subject: [PATCH 46/51] Implement Delta Mass Method for Purity Estimation --- PWG/FLOW/Tasks/AliAnalysisTaskCVEPIDCME.cxx | 148 ++++++++++++++++---- PWG/FLOW/Tasks/AliAnalysisTaskCVEPIDCME.h | 23 ++- PWGCF/FLOW/macros/AddTaskCVEPIDCME.C | 2 + 3 files changed, 142 insertions(+), 31 deletions(-) diff --git a/PWG/FLOW/Tasks/AliAnalysisTaskCVEPIDCME.cxx b/PWG/FLOW/Tasks/AliAnalysisTaskCVEPIDCME.cxx index 7ba87b1025a..a19662a85ca 100644 --- a/PWG/FLOW/Tasks/AliAnalysisTaskCVEPIDCME.cxx +++ b/PWG/FLOW/Tasks/AliAnalysisTaskCVEPIDCME.cxx @@ -97,6 +97,7 @@ AliAnalysisTaskCVEPIDCME::AliAnalysisTaskCVEPIDCME() : isCalculateLambdaHadron(false), isCalculateLambdaLambda(false), isCalculateProtonProton(false), + isCalculateProtonHadron(false), isCalculateHadronHadron(false), isCheckLambdaProtonFromDecay(false), isCheckLambdaProtonFromDecayFoundInTrackLoops(false), @@ -332,61 +333,72 @@ AliAnalysisTaskCVEPIDCME::AliAnalysisTaskCVEPIDCME() : for (int i = 0; i < 5; i++) for (int j = 0; j < 2; j++) fProfile2RawFlowPtCentHadron[i][j] = nullptr; for (int i = 0; i < 5; i++) for (int j = 0; j < 2; j++) fProfile2RawFlowPtCentProton[i][j] = nullptr; for (int i = 0; i < 5; i++) for (int j = 0; j < 2; j++) fProfile2RawFlowPtCentLambda[i][j] = nullptr; + for (int i = 0; i < 4; i++) fHist2DMass[i] = nullptr; for (int i = 0; i < 4; i++) fProfileDeltaLambdaProton[i] = nullptr; for (int i = 0; i < 4; i++) fProfileDeltaLambdaHadron[i] = nullptr; for (int i = 0; i < 4; i++) fProfileDeltaLambdaLambda[i] = nullptr; for (int i = 0; i < 4; i++) fProfileDeltaProtonProton[i] = nullptr; + for (int i = 0; i < 4; i++) fProfileDeltaProtonHadron[i] = nullptr; for (int i = 0; i < 4; i++) fProfileDeltaHadronHadron[i] = nullptr; for (int i = 0; i < 5; i++) for (int j = 0; j < 4; j++) fProfileGammaLambdaProton[i][j] = nullptr; for (int i = 0; i < 5; i++) for (int j = 0; j < 4; j++) fProfileGammaLambdaHadron[i][j] = nullptr; for (int i = 0; i < 5; i++) for (int j = 0; j < 4; j++) fProfileGammaLambdaLambda[i][j] = nullptr; for (int i = 0; i < 5; i++) for (int j = 0; j < 4; j++) fProfileGammaProtonProton[i][j] = nullptr; + for (int i = 0; i < 5; i++) for (int j = 0; j < 4; j++) fProfileGammaProtonHadron[i][j] = nullptr; for (int i = 0; i < 5; i++) for (int j = 0; j < 4; j++) fProfileGammaHadronHadron[i][j] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaProtonDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaHadronDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaLambdaDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaProtonProtonDPt[i] = nullptr; + for (int i = 0; i < 4; i++) fProfile2DiffDeltaProtonHadronDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaHadronHadronDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaProtonSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaHadronSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaLambdaSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaProtonProtonSPt[i] = nullptr; + for (int i = 0; i < 4; i++) fProfile2DiffDeltaProtonHadronSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaHadronHadronSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaProtonDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaHadronDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaLambdaDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaProtonProtonDEta[i] = nullptr; + for (int i = 0; i < 4; i++) fProfile2DiffDeltaProtonHadronDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaHadronHadronDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaProtonMass[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaHadronMass[i] = nullptr; - for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaLambdaMass[i] = nullptr; + for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaLambdaDMass[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaProtonDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaHadronDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaLambdaDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaProtonProtonDPt[i] = nullptr; + for (int i = 0; i < 4; i++) fProfile2DiffGammaProtonHadronDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaHadronHadronDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaProtonSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaHadronSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaLambdaSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaProtonProtonSPt[i] = nullptr; + for (int i = 0; i < 4; i++) fProfile2DiffGammaProtonHadronSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaHadronHadronSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaProtonDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaHadronDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaLambdaDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaProtonProtonDEta[i] = nullptr; + for (int i = 0; i < 4; i++) fProfile2DiffGammaProtonHadronDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaHadronHadronDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaProtonMass[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaHadronMass[i] = nullptr; - for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaLambdaMass[i] = nullptr; + for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaLambdaDMass[i] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaDPhiLambdaProton[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaDPhiLambdaHadron[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaDPhiLambdaLambda[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaDPhiProtonProton[i][j] = nullptr; + for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaDPhiProtonHadron[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaDPhiHadronHadron[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaSPhiLambdaProton[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaSPhiLambdaHadron[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaSPhiLambdaLambda[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaSPhiProtonProton[i][j] = nullptr; + for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaSPhiProtonHadron[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaSPhiHadronHadron[i][j] = nullptr; for (int i = 0; i < 4; i++) fProfileDeltaLambdaProtonDecay[i] = nullptr; for (int i = 0; i < 4; i++) fProfileDeltaLambdaPionDecay[i] = nullptr; @@ -420,6 +432,7 @@ AliAnalysisTaskCVEPIDCME::AliAnalysisTaskCVEPIDCME(const char *name) : isCalculateLambdaHadron(false), isCalculateLambdaLambda(false), isCalculateProtonProton(false), + isCalculateProtonHadron(false), isCalculateHadronHadron(false), isCheckLambdaProtonFromDecay(false), isCheckLambdaProtonFromDecayFoundInTrackLoops(false), @@ -655,61 +668,72 @@ AliAnalysisTaskCVEPIDCME::AliAnalysisTaskCVEPIDCME(const char *name) : for (int i = 0; i < 5; i++) for (int j = 0; j < 2; j++) fProfile2RawFlowPtCentHadron[i][j] = nullptr; for (int i = 0; i < 5; i++) for (int j = 0; j < 2; j++) fProfile2RawFlowPtCentProton[i][j] = nullptr; for (int i = 0; i < 5; i++) for (int j = 0; j < 2; j++) fProfile2RawFlowPtCentLambda[i][j] = nullptr; + for (int i = 0; i < 4; i++) fHist2DMass[i] = nullptr; for (int i = 0; i < 4; i++) fProfileDeltaLambdaProton[i] = nullptr; for (int i = 0; i < 4; i++) fProfileDeltaLambdaHadron[i] = nullptr; for (int i = 0; i < 4; i++) fProfileDeltaLambdaLambda[i] = nullptr; for (int i = 0; i < 4; i++) fProfileDeltaProtonProton[i] = nullptr; + for (int i = 0; i < 4; i++) fProfileDeltaProtonHadron[i] = nullptr; for (int i = 0; i < 4; i++) fProfileDeltaHadronHadron[i] = nullptr; for (int i = 0; i < 5; i++) for (int j = 0; j < 4; j++) fProfileGammaLambdaProton[i][j] = nullptr; for (int i = 0; i < 5; i++) for (int j = 0; j < 4; j++) fProfileGammaLambdaHadron[i][j] = nullptr; for (int i = 0; i < 5; i++) for (int j = 0; j < 4; j++) fProfileGammaLambdaLambda[i][j] = nullptr; for (int i = 0; i < 5; i++) for (int j = 0; j < 4; j++) fProfileGammaProtonProton[i][j] = nullptr; + for (int i = 0; i < 5; i++) for (int j = 0; j < 4; j++) fProfileGammaProtonHadron[i][j] = nullptr; for (int i = 0; i < 5; i++) for (int j = 0; j < 4; j++) fProfileGammaHadronHadron[i][j] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaProtonDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaHadronDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaLambdaDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaProtonProtonDPt[i] = nullptr; + for (int i = 0; i < 4; i++) fProfile2DiffDeltaProtonHadronDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaHadronHadronDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaProtonSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaHadronSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaLambdaSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaProtonProtonSPt[i] = nullptr; + for (int i = 0; i < 4; i++) fProfile2DiffDeltaProtonHadronSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaHadronHadronSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaProtonDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaHadronDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaLambdaDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaProtonProtonDEta[i] = nullptr; + for (int i = 0; i < 4; i++) fProfile2DiffDeltaProtonHadronDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaHadronHadronDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaProtonMass[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaHadronMass[i] = nullptr; - for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaLambdaMass[i] = nullptr; + for (int i = 0; i < 4; i++) fProfile2DiffDeltaLambdaLambdaDMass[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaProtonDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaHadronDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaLambdaDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaProtonProtonDPt[i] = nullptr; + for (int i = 0; i < 4; i++) fProfile2DiffGammaProtonHadronDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaHadronHadronDPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaProtonSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaHadronSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaLambdaSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaProtonProtonSPt[i] = nullptr; + for (int i = 0; i < 4; i++) fProfile2DiffGammaProtonHadronSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaHadronHadronSPt[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaProtonDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaHadronDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaLambdaDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaProtonProtonDEta[i] = nullptr; + for (int i = 0; i < 4; i++) fProfile2DiffGammaProtonHadronDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaHadronHadronDEta[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaProtonMass[i] = nullptr; for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaHadronMass[i] = nullptr; - for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaLambdaMass[i] = nullptr; + for (int i = 0; i < 4; i++) fProfile2DiffGammaLambdaLambdaDMass[i] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaDPhiLambdaProton[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaDPhiLambdaHadron[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaDPhiLambdaLambda[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaDPhiProtonProton[i][j] = nullptr; + for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaDPhiProtonHadron[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaDPhiHadronHadron[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaSPhiLambdaProton[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaSPhiLambdaHadron[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaSPhiLambdaLambda[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaSPhiProtonProton[i][j] = nullptr; + for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaSPhiProtonHadron[i][j] = nullptr; for (int i = 0; i < 8; i++) for (int j = 0; j < 4; j++) fHist2DEtaSPhiHadronHadron[i][j] = nullptr; for (int i = 0; i < 4; i++) fProfileDeltaLambdaProtonDecay[i] = nullptr; for (int i = 0; i < 4; i++) fProfileDeltaLambdaPionDecay[i] = nullptr; @@ -1188,13 +1212,13 @@ void AliAnalysisTaskCVEPIDCME::UserCreateOutputObjects() fQAList->Add(fHistAntiLambdaDecayLength[i]); fQAList->Add(fHist2AntiLambdaMassPtY[i]); } - fHist3LambdaCentPtMass[0] = new TH3D(Form("fHist3LambdaCentPtMass_%sMassCut",charLambdaMassCut.data()),";Centrality;Pt;Mass",8,0,80,20,0,10,1000,1.,1.25); // Current bin size = 0.00025 - fHist3LambdaCentPtMass[1] = new TH3D(Form("fHist3LambdaCentPtMass_%sMassCut",charLambdaMassCut.data()),";Centrality;Pt;Mass",8,0,80,20,0,10,15,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); + fHist3LambdaCentPtMass[0] = new TH3D("fHist3LambdaCentPtMass_BfMassCut",";Centrality;Pt;Mass",8,0,80,20,0,10,1000,1.,1.25); // Current bin size = 0.00025 + fHist3LambdaCentPtMass[1] = new TH3D("fHist3LambdaCentPtMass_AfMassCut",";Centrality;Pt;Mass",8,0,80,20,0,10,15,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); fQAList->Add(fHist3LambdaCentPtMass[0]); fQAList->Add(fHist3LambdaCentPtMass[1]); - fHist3AntiLambdaCentPtMass[0] = new TH3D(Form("fHist3AntiLambdaCentPtMass_%sMassCut",charLambdaMassCut.data()),";Centrality;Pt;Mass",8,0,80,20,0,10,1000,1.,1.25); // Current bin size = 0.00025 - fHist3AntiLambdaCentPtMass[1] = new TH3D(Form("fHist3AntiLambdaCentPtMass_%sMassCut",charLambdaMassCut.data()),";Centrality;Pt;Mass",8,0,80,20,0,10,15,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); + fHist3AntiLambdaCentPtMass[0] = new TH3D("fHist3AntiLambdaCentPtMass_BfMassCut",";Centrality;Pt;Mass",8,0,80,20,0,10,1000,1.,1.25); // Current bin size = 0.00025 + fHist3AntiLambdaCentPtMass[1] = new TH3D("fHist3AntiLambdaCentPtMass_AfMassCut",";Centrality;Pt;Mass",8,0,80,20,0,10,15,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); fQAList->Add(fHist3AntiLambdaCentPtMass[0]); fQAList->Add(fHist3AntiLambdaCentPtMass[1]); @@ -1285,6 +1309,8 @@ void AliAnalysisTaskCVEPIDCME::UserCreateOutputObjects() fResultsList->Add(fProfileDeltaLambdaHadron[i]); } if (isCalculateLambdaLambda) { + fHist2DMass[i] = new TH2D(Form("fHist2DMass_type%i",i), ";centrality; #Delta Mass", 8,0.,80., 30, - 2 * fLambdaMassRightCut, 2 * fLambdaMassLeftCut); + fResultsList->Add(fHist2DMass[i]); fProfileDeltaLambdaLambda[i] = new TProfile(Form("fProfileDeltaLambdaLambda_type%i",i),";centrality;#delta",8,0.,80.); fResultsList->Add(fProfileDeltaLambdaLambda[i]); } @@ -1292,6 +1318,10 @@ void AliAnalysisTaskCVEPIDCME::UserCreateOutputObjects() fProfileDeltaProtonProton[i] = new TProfile(Form("fProfileDeltaProtonProton_type%i",i),";centrality;#delta",8,0.,80.); fResultsList->Add(fProfileDeltaProtonProton[i]); } + if (isCalculateProtonHadron) { + fProfileDeltaProtonHadron[i] = new TProfile(Form("fProfileDeltaProtonHadron_type%i",i),";centrality;#delta",8,0.,80.); + fResultsList->Add(fProfileDeltaProtonHadron[i]); + } if (isCalculateHadronHadron) { fProfileDeltaHadronHadron[i] = new TProfile(Form("fProfileDeltaHadronHadron_type%i",i),";centrality;#delta",8,0.,80.); fResultsList->Add(fProfileDeltaHadronHadron[i]); @@ -1323,6 +1353,10 @@ void AliAnalysisTaskCVEPIDCME::UserCreateOutputObjects() fProfileGammaProtonProton[iPlane][iType] = new TProfile(Form("fProfileGammaProtonProton%s_%i",charPlane.data(),iType),";centrality;#gamma",8,0.,80.); fResultsList->Add(fProfileGammaProtonProton[iPlane][iType]); } + if (isCalculateProtonHadron) { + fProfileGammaProtonHadron[iPlane][iType] = new TProfile(Form("fProfileGammaProtonHadron%s_%i",charPlane.data(),iType),";centrality;#gamma",8,0.,80.); + fResultsList->Add(fProfileGammaProtonHadron[iPlane][iType]); + } if (isCalculateHadronHadron) { fProfileGammaHadronHadron[iPlane][iType] = new TProfile(Form("fProfileGammaHadronHadron%s_%i",charPlane.data(),iType),";centrality;#gamma",8,0.,80.); fResultsList->Add(fProfileGammaHadronHadron[iPlane][iType]); @@ -1337,7 +1371,7 @@ void AliAnalysisTaskCVEPIDCME::UserCreateOutputObjects() fProfile2DiffDeltaLambdaProtonDPt[iType] = new TProfile2D(Form("fProfile2DiffDeltaLambdaProtonDPt_%i",iType),";centrality;#Delta pT;#delta",8,0.,80.,16,-8,8); fProfile2DiffDeltaLambdaProtonSPt[iType] = new TProfile2D(Form("fProfile2DiffDeltaLambdaProtonSPt_%i",iType),";centrality;#sum pT;#delta",8,0.,80.,16,0,16); fProfile2DiffDeltaLambdaProtonDEta[iType] = new TProfile2D(Form("fProfile2DiffDeltaLambdaProtonDEta_%i",iType),";centrality;#Delta Eta;#delta",8,0.,80.,16,-1.6,1.6); - fProfile2DiffDeltaLambdaProtonMass[iType] = new TProfile2D(Form("fProfile2DiffDeltaLambdaProtonMass_%i",iType),";centrality;#Delta Mass;#delta",8,0.,80.,15,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); + fProfile2DiffDeltaLambdaProtonMass[iType] = new TProfile2D(Form("fProfile2DiffDeltaLambdaProtonMass_%i",iType),";centrality;#Delta Mass;#delta",8,0.,80.,20,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); fResultsList->Add(fProfile2DiffDeltaLambdaProtonDPt[iType]); fResultsList->Add(fProfile2DiffDeltaLambdaProtonSPt[iType]); fResultsList->Add(fProfile2DiffDeltaLambdaProtonDEta[iType]); @@ -1347,7 +1381,7 @@ void AliAnalysisTaskCVEPIDCME::UserCreateOutputObjects() fProfile2DiffDeltaLambdaHadronDPt[iType] = new TProfile2D(Form("fProfile2DiffDeltaLambdaHadronDPt_%i",iType),";centrality;#Delta pT;#delta",8,0.,80.,16,-8,8); fProfile2DiffDeltaLambdaHadronSPt[iType] = new TProfile2D(Form("fProfile2DiffDeltaLambdaHadronSPt_%i",iType),";centrality;#sum pT;#delta",8,0.,80.,16,0,16); fProfile2DiffDeltaLambdaHadronDEta[iType] = new TProfile2D(Form("fProfile2DiffDeltaLambdaHadronDEta_%i",iType),";centrality;#Delta Eta;#delta",8,0.,80.,16,-1.6,1.6); - fProfile2DiffDeltaLambdaHadronMass[iType] = new TProfile2D(Form("fProfile2DiffDeltaLambdaHadronMass_%i",iType),";centrality;#Lambda Mass;#delta",8,0.,80,15,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); + fProfile2DiffDeltaLambdaHadronMass[iType] = new TProfile2D(Form("fProfile2DiffDeltaLambdaHadronMass_%i",iType),";centrality;#Lambda Mass;#delta",8,0.,80,20,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); fResultsList->Add(fProfile2DiffDeltaLambdaHadronDPt[iType]); fResultsList->Add(fProfile2DiffDeltaLambdaHadronSPt[iType]); fResultsList->Add(fProfile2DiffDeltaLambdaHadronDEta[iType]); @@ -1357,11 +1391,11 @@ void AliAnalysisTaskCVEPIDCME::UserCreateOutputObjects() fProfile2DiffDeltaLambdaLambdaDPt[iType] = new TProfile2D(Form("fProfile2DiffDeltaLambdaLambdaDPt_%i",iType),";centrality;#Delta pT;#delta",8,0.,80.,16,-8,8); fProfile2DiffDeltaLambdaLambdaSPt[iType] = new TProfile2D(Form("fProfile2DiffDeltaLambdaLambdaSPt_%i",iType),";centrality;#sum pT;#delta",8,0.,80.,16,0,16); fProfile2DiffDeltaLambdaLambdaDEta[iType] = new TProfile2D(Form("fProfile2DiffDeltaLambdaLambdaDEta_%i",iType),";centrality;#Delta Eta;#delta",8,0.,80.,16,-1.6,1.6); - fProfile2DiffDeltaLambdaLambdaMass[iType] = new TProfile2D(Form("fProfile2DiffDeltaLambdaLambdaMass_%i",iType),";centrality;#Lambda Mass;#delta",8,0.,80,15,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); + fProfile2DiffDeltaLambdaLambdaDMass[iType] = new TProfile2D(Form("fProfile2DiffDeltaLambdaLambdaDMass_%i",iType),";centrality;#Delta #Lambda Mass;#delta",8,0.,80,30, - 2 * fLambdaMassRightCut, 2 * fLambdaMassLeftCut); fResultsList->Add(fProfile2DiffDeltaLambdaLambdaDPt[iType]); fResultsList->Add(fProfile2DiffDeltaLambdaLambdaSPt[iType]); fResultsList->Add(fProfile2DiffDeltaLambdaLambdaDEta[iType]); - fResultsList->Add(fProfile2DiffDeltaLambdaLambdaMass[iType]); + fResultsList->Add(fProfile2DiffDeltaLambdaLambdaDMass[iType]); } if (isCalculateProtonProton) { fProfile2DiffDeltaProtonProtonDPt[iType] = new TProfile2D(Form("fProfile2DiffDeltaProtonProtonDPt_%i",iType),";centrality;#Delta pT;#delta",8,0.,80.,16,-8,8); @@ -1371,6 +1405,14 @@ void AliAnalysisTaskCVEPIDCME::UserCreateOutputObjects() fResultsList->Add(fProfile2DiffDeltaProtonProtonSPt[iType]); fResultsList->Add(fProfile2DiffDeltaProtonProtonDEta[iType]); } + if (isCalculateProtonHadron) { + fProfile2DiffDeltaProtonHadronDPt[iType] = new TProfile2D(Form("fProfile2DiffDeltaProtonHadronDPt_%i",iType),";centrality;#Delta pT;#delta",8,0.,80.,16,-8,8); + fProfile2DiffDeltaProtonHadronSPt[iType] = new TProfile2D(Form("fProfile2DiffDeltaProtonHadronSPt_%i",iType),";centrality;#sum pT;#delta",8,0.,80.,16,0,16); + fProfile2DiffDeltaProtonHadronDEta[iType] = new TProfile2D(Form("fProfile2DiffDeltaProtonHadronDEta_%i",iType),";centrality;#Delta Eta;#delta",8,0.,80.,16,-1.6,1.6); + fResultsList->Add(fProfile2DiffDeltaProtonHadronDPt[iType]); + fResultsList->Add(fProfile2DiffDeltaProtonHadronSPt[iType]); + fResultsList->Add(fProfile2DiffDeltaProtonHadronDEta[iType]); + } if (isCalculateHadronHadron) { fProfile2DiffDeltaHadronHadronDPt[iType] = new TProfile2D(Form("fProfile2DiffDeltaHadronHadronDPt_%i",iType),";centrality;#Delta pT;#delta",8,0.,80.,16,-8,8); fProfile2DiffDeltaHadronHadronSPt[iType] = new TProfile2D(Form("fProfile2DiffDeltaHadronHadronSPt_%i",iType),";centrality;#sum pT;#delta",8,0.,80.,16,0,16); @@ -1385,7 +1427,7 @@ void AliAnalysisTaskCVEPIDCME::UserCreateOutputObjects() fProfile2DiffGammaLambdaProtonDPt[iType] = new TProfile2D(Form("fProfile2DiffGammaLambdaProtonDPt_%i",iType),";centrality;#Delta pT;#gamma",8,0.,80.,16,-8,8); fProfile2DiffGammaLambdaProtonSPt[iType] = new TProfile2D(Form("fProfile2DiffGammaLambdaProtonSPt_%i",iType),";centrality;#sum pT;#gamma",8,0.,80.,16,0,16); fProfile2DiffGammaLambdaProtonDEta[iType] = new TProfile2D(Form("fProfile2DiffGammaLambdaProtonDEta_%i",iType),";centrality;#Delta #Eta;#gamma",8,0.,80.,16,-1.6,1.6); - fProfile2DiffGammaLambdaProtonMass[iType] = new TProfile2D(Form("fProfile2DiffGammaLambdaProtonMass_%i",iType),";centrality;#Lambda Mass;#gamma",8,0.,80,15,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); + fProfile2DiffGammaLambdaProtonMass[iType] = new TProfile2D(Form("fProfile2DiffGammaLambdaProtonMass_%i",iType),";centrality;#Lambda Mass;#gamma",8,0.,80,20,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); fResultsList->Add(fProfile2DiffGammaLambdaProtonDPt[iType]); fResultsList->Add(fProfile2DiffGammaLambdaProtonSPt[iType]); fResultsList->Add(fProfile2DiffGammaLambdaProtonDEta[iType]); @@ -1395,7 +1437,7 @@ void AliAnalysisTaskCVEPIDCME::UserCreateOutputObjects() fProfile2DiffGammaLambdaHadronDPt[iType] = new TProfile2D(Form("fProfile2DiffGammaLambdaHadronDPt_%i",iType),";centrality;#Delta pT;#gamma",8,0.,80.,16,-8,8); fProfile2DiffGammaLambdaHadronSPt[iType] = new TProfile2D(Form("fProfile2DiffGammaLambdaHadronSPt_%i",iType),";centrality;#sum pT;#gamma",8,0.,80.,16,0,16); fProfile2DiffGammaLambdaHadronDEta[iType] = new TProfile2D(Form("fProfile2DiffGammaLambdaHadronDEta_%i",iType),";centrality;#Delta #Eta;#gamma",8,0.,80.,16,-1.6,1.6); - fProfile2DiffGammaLambdaHadronMass[iType] = new TProfile2D(Form("fProfile2DiffGammaLambdaHadronMass_%i",iType),";centrality;#Lambda Mass;#gamma",8,0.,80,15,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); + fProfile2DiffGammaLambdaHadronMass[iType] = new TProfile2D(Form("fProfile2DiffGammaLambdaHadronMass_%i",iType),";centrality;#Lambda Mass;#gamma",8,0.,80,20,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); fResultsList->Add(fProfile2DiffGammaLambdaHadronDPt[iType]); fResultsList->Add(fProfile2DiffGammaLambdaHadronSPt[iType]); fResultsList->Add(fProfile2DiffGammaLambdaHadronDEta[iType]); @@ -1405,11 +1447,11 @@ void AliAnalysisTaskCVEPIDCME::UserCreateOutputObjects() fProfile2DiffGammaLambdaLambdaDPt[iType] = new TProfile2D(Form("fProfile2DiffGammaLambdaLambdaDPt_%i",iType),";centrality;#Delta pT;#gamma",8,0.,80.,16,-8,8); fProfile2DiffGammaLambdaLambdaSPt[iType] = new TProfile2D(Form("fProfile2DiffGammaLambdaLambdaSPt_%i",iType),";centrality;#sum pT;#gamma",8,0.,80.,16,0,16); fProfile2DiffGammaLambdaLambdaDEta[iType] = new TProfile2D(Form("fProfile2DiffGammaLambdaLambdaDEta_%i",iType),";centrality;#Delta #Eta;#gamma",8,0.,80.,16,-1.6,1.6); - fProfile2DiffGammaLambdaLambdaMass[iType] = new TProfile2D(Form("fProfile2DiffGammaLambdaLambdaMass_%i",iType),";centrality;#Lambda Mass;#gamma",8,0.,80,15,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); + fProfile2DiffGammaLambdaLambdaDMass[iType] = new TProfile2D(Form("fProfile2DiffGammaLambdaLambdaDMass_%i",iType),";centrality;#Delta #Lambda Mass;#gamma",8,0.,80,30, - 2 * fLambdaMassRightCut, 2 * fLambdaMassLeftCut); fResultsList->Add(fProfile2DiffGammaLambdaLambdaDPt[iType]); fResultsList->Add(fProfile2DiffGammaLambdaLambdaSPt[iType]); fResultsList->Add(fProfile2DiffGammaLambdaLambdaDEta[iType]); - fResultsList->Add(fProfile2DiffGammaLambdaLambdaMass[iType]); + fResultsList->Add(fProfile2DiffGammaLambdaLambdaDMass[iType]); } if (isCalculateProtonProton) { fProfile2DiffGammaProtonProtonDPt[iType] = new TProfile2D(Form("fProfile2DiffGammaProtonProtonDPt_%i",iType),";centrality;#Delta pT;#gamma",8,0.,80.,16,-8,8); @@ -1419,10 +1461,18 @@ void AliAnalysisTaskCVEPIDCME::UserCreateOutputObjects() fResultsList->Add(fProfile2DiffGammaProtonProtonSPt[iType]); fResultsList->Add(fProfile2DiffGammaProtonProtonDEta[iType]); } + if (isCalculateProtonHadron) { + fProfile2DiffGammaProtonHadronDPt[iType] = new TProfile2D(Form("fProfile2DiffGammaProtonHadronDPt_%i",iType),";centrality;#Delta pT;#gamma",8,0.,80.,16,-8,8); + fProfile2DiffGammaProtonHadronSPt[iType] = new TProfile2D(Form("fProfile2DiffGammaProtonHadronSPt_%i",iType),";centrality;#sum pT;#gamma",8,0.,80.,16,0,16); + fProfile2DiffGammaProtonHadronDEta[iType] = new TProfile2D(Form("fProfile2DiffGammaProtonHadronDEta_%i",iType),";centrality;#Delta #Eta;#gamma",8,0.,80.,16,-1.6,1.6); + fResultsList->Add(fProfile2DiffGammaProtonHadronDPt[iType]); + fResultsList->Add(fProfile2DiffGammaProtonHadronSPt[iType]); + fResultsList->Add(fProfile2DiffGammaProtonHadronDEta[iType]); + } if (isCalculateHadronHadron) { fProfile2DiffGammaHadronHadronDPt[iType] = new TProfile2D(Form("fProfile2DiffGammaHadronHadronDPt_%i",iType),";centrality;#Delta pT;#gamma",8,0.,80.,16,-8,8); fProfile2DiffGammaHadronHadronSPt[iType] = new TProfile2D(Form("fProfile2DiffGammaHadronHadronSPt_%i",iType),";centrality;#sum pT;#gamma",8,0.,80.,16,0,16); - fProfile2DiffGammaHadronHadronDEta[iType] = new TProfile2D(Form("fProfile2DiffGammaHadronHadronSEta_%i",iType),";centrality;#Delta #Eta;#gamma",8,0.,80.,16,-1.6,1.6); + fProfile2DiffGammaHadronHadronDEta[iType] = new TProfile2D(Form("fProfile2DiffGammaHadronHadronDEta_%i",iType),";centrality;#Delta #Eta;#gamma",8,0.,80.,16,-1.6,1.6); fResultsList->Add(fProfile2DiffGammaHadronHadronDPt[iType]); fResultsList->Add(fProfile2DiffGammaHadronHadronSPt[iType]); fResultsList->Add(fProfile2DiffGammaHadronHadronDEta[iType]); @@ -1450,6 +1500,10 @@ void AliAnalysisTaskCVEPIDCME::UserCreateOutputObjects() fHist2DEtaDPhiProtonProton[iCent][iType] = new TH2D(Form("fHist2DEtaDPhiProtonProton_cent%i_%i",iCent,iType),";deta;dphi", 20, -1.6, 1.6, 36, -0.5*TMath::Pi(), 1.5*TMath::Pi()); fResultsList->Add(fHist2DEtaDPhiProtonProton[iCent][iType]); } + if (isCalculateProtonHadron) { + fHist2DEtaDPhiProtonHadron[iCent][iType] = new TH2D(Form("fHist2DEtaDPhiProtonHadron_cent%i_%i",iCent,iType),";deta;dphi", 20, -1.6, 1.6, 36, -0.5*TMath::Pi(), 1.5*TMath::Pi()); + fResultsList->Add(fHist2DEtaDPhiProtonHadron[iCent][iType]); + } if (isCalculateHadronHadron) { fHist2DEtaDPhiHadronHadron[iCent][iType] = new TH2D(Form("fHist2DEtaDPhiHadronHadron_cent%i_%i",iCent,iType),";deta;dphi", 20, -1.6, 1.6, 36, -0.5*TMath::Pi(), 1.5*TMath::Pi()); fResultsList->Add(fHist2DEtaDPhiHadronHadron[iCent][iType]); @@ -1472,6 +1526,10 @@ void AliAnalysisTaskCVEPIDCME::UserCreateOutputObjects() fHist2DEtaSPhiProtonProton[iCent][iType] = new TH2D(Form("fHist2DEtaSPhiProtonProton_cent%i_%i",iCent,iType),";deta;dphi", 20, -1.6, 1.6, 36, -0.5*TMath::Pi(), 1.5*TMath::Pi()); fResultsList->Add(fHist2DEtaSPhiProtonProton[iCent][iType]); } + if (isCalculateProtonHadron) { + fHist2DEtaSPhiProtonHadron[iCent][iType] = new TH2D(Form("fHist2DEtaSPhiProtonHadron_cent%i_%i",iCent,iType),";deta;dphi", 20, -1.6, 1.6, 36, -0.5*TMath::Pi(), 1.5*TMath::Pi()); + fResultsList->Add(fHist2DEtaSPhiProtonHadron[iCent][iType]); + } if (isCalculateHadronHadron) { fHist2DEtaSPhiHadronHadron[iCent][iType] = new TH2D(Form("fHist2DEtaSPhiHadronHadron_cent%i_%i",iCent,iType),";deta;dphi", 20, -1.6, 1.6, 36, -0.5*TMath::Pi(), 1.5*TMath::Pi()); fResultsList->Add(fHist2DEtaSPhiHadronHadron[iCent][iType]); @@ -1563,7 +1621,7 @@ void AliAnalysisTaskCVEPIDCME::UserExec(Option_t *) isTrigselected = mask & AliVEvent::kMB; else if (fTrigger.EqualTo("kINT7")) isTrigselected = mask & AliVEvent::kINT7; - else if (fTrigger.EqualTo("kINT7++kSemiCentral")) + else if (fTrigger.EqualTo("kINT7+kSemiCentral")) isTrigselected = mask & (AliVEvent::kINT7 + AliVEvent::kSemiCentral); else if (fTrigger.EqualTo("kINT7+kCentral+kSemiCentral")) isTrigselected = mask & (AliVEvent::kINT7 + AliVEvent::kCentral + AliVEvent::kSemiCentral); @@ -1762,7 +1820,7 @@ void AliAnalysisTaskCVEPIDCME::UserExec(Option_t *) if (fDebug) Printf("Pair V0 & V0 done!"); } - if (isCalculateProtonProton || isCalculateHadronHadron) { + if (isCalculateProtonProton || isCalculateHadronHadron || isCalculateProtonHadron) { if (!PairTrkTrk()) return; fEvtCount->Fill(23); if (fDebug) Printf("Pair Trk & Trk done!"); @@ -2881,6 +2939,7 @@ bool AliAnalysisTaskCVEPIDCME::PairV0V0() for (int iBits = 0; iBits < nBits; iBits++) { if (bitsLambdaLambdaPair.TestBitNumber(iBits)) { + fHist2DMass[iBits] -> Fill(fCent, mass_a - mass_b); fProfileDeltaLambdaLambda[iBits] -> Fill(fCent, delta); fProfileGammaLambdaLambda[0][iBits] -> Fill(fCent, gamma[0]); if(isUseVZEROPlane) { @@ -2892,14 +2951,14 @@ bool AliAnalysisTaskCVEPIDCME::PairV0V0() fProfileGammaLambdaLambda[4][iBits] -> Fill(fCent, gamma[4]); } if (isCalculateDiffResult) { - fProfile2DiffDeltaLambdaLambdaDPt[iBits] -> Fill(fCent, pt_a - pt_b, delta); - fProfile2DiffDeltaLambdaLambdaSPt[iBits] -> Fill(fCent, pt_a + pt_b, delta); - fProfile2DiffDeltaLambdaLambdaDEta[iBits] -> Fill(fCent, eta_a - eta_b, delta); - fProfile2DiffDeltaLambdaLambdaMass[iBits] -> Fill(fCent, mass_a, delta); - fProfile2DiffGammaLambdaLambdaDPt[iBits] -> Fill(fCent, pt_a - pt_b, gamma[0]); - fProfile2DiffGammaLambdaLambdaSPt[iBits] -> Fill(fCent, pt_a + pt_b, gamma[0]); - fProfile2DiffGammaLambdaLambdaDEta[iBits] -> Fill(fCent, eta_a - eta_b, gamma[0]); - fProfile2DiffGammaLambdaLambdaMass[iBits] -> Fill(fCent, mass_a, gamma[0]); + fProfile2DiffDeltaLambdaLambdaDPt[iBits] -> Fill(fCent, pt_a - pt_b, delta); + fProfile2DiffDeltaLambdaLambdaSPt[iBits] -> Fill(fCent, pt_a + pt_b, delta); + fProfile2DiffDeltaLambdaLambdaDEta[iBits] -> Fill(fCent, eta_a - eta_b, delta); + fProfile2DiffDeltaLambdaLambdaDMass[iBits] -> Fill(fCent, mass_a-mass_b, delta); + fProfile2DiffGammaLambdaLambdaDPt[iBits] -> Fill(fCent, pt_a - pt_b, gamma[0]); + fProfile2DiffGammaLambdaLambdaSPt[iBits] -> Fill(fCent, pt_a + pt_b, gamma[0]); + fProfile2DiffGammaLambdaLambdaDEta[iBits] -> Fill(fCent, eta_a - eta_b, gamma[0]); + fProfile2DiffGammaLambdaLambdaDMass[iBits] -> Fill(fCent, mass_a-mass_b, gamma[0]); } if (isCalculateDeltaPhiSumPhi) { double dphi_ranged = RangeDPhi(phi_a - phi_b); @@ -2996,6 +3055,41 @@ bool AliAnalysisTaskCVEPIDCME::PairTrkTrk() } } + if(isCalculateProtonHadron) { + TBits bitsProtonHadronPair(nBits); + bitsProtonHadronPair.SetBitNumber(0, code_a == 2212 && code_b > 0); + bitsProtonHadronPair.SetBitNumber(1, code_a == 2212 && code_b < 0); + bitsProtonHadronPair.SetBitNumber(2, code_a == -2212 && code_b > 0); + bitsProtonHadronPair.SetBitNumber(3, code_a == -2212 && code_b < 0); + + for(int iBits = 0; iBits < nBits; iBits++) { + fProfileDeltaProtonHadron[iBits] -> Fill(fCent, delta); + fProfileGammaProtonHadron[0][iBits] -> Fill(fCent, gamma[0]); + if(isUseVZEROPlane) { + fProfileGammaProtonHadron[1][iBits] -> Fill(fCentSPD1, gamma[1]); + fProfileGammaProtonHadron[2][iBits] -> Fill(fCentSPD1, gamma[2]); + } + if (isUseZDCPlane) { + fProfileGammaProtonHadron[3][iBits] -> Fill(fCent, gamma[3]); + fProfileGammaProtonHadron[4][iBits] -> Fill(fCent, gamma[4]); + } + if (isCalculateDiffResult) { + fProfile2DiffDeltaProtonHadronDPt[iBits] -> Fill(fCent, pt_a - pt_b, delta); + fProfile2DiffDeltaProtonHadronSPt[iBits] -> Fill(fCent, pt_a + pt_b, delta); + fProfile2DiffDeltaProtonHadronDEta[iBits] -> Fill(fCent, eta_a - eta_b, delta); + fProfile2DiffGammaProtonHadronDPt[iBits] -> Fill(fCent, pt_a - pt_b, gamma[0]); + fProfile2DiffGammaProtonHadronSPt[iBits] -> Fill(fCent, pt_a + pt_b, gamma[0]); + fProfile2DiffGammaProtonHadronDEta[iBits] -> Fill(fCent, eta_a - eta_b, gamma[0]); + } + if (isCalculateDeltaPhiSumPhi) { + double dphi_ranged = RangeDPhi(phi_a - phi_b); + double sphi_ranged = RangeDPhi(phi_a + phi_b - 2 * psi2TPC_forThisPair); + fHist2DEtaDPhiProtonHadron[fCentBin][iBits] -> Fill(eta_a - eta_b, dphi_ranged); + fHist2DEtaSPhiProtonHadron[fCentBin][iBits] -> Fill(eta_a - eta_b, sphi_ranged); + } + } + } + if (isCalculateHadronHadron) { TBits bitsHadronHadronPair(nBits); bitsHadronHadronPair.SetBitNumber(0, code_a > 0 && code_b > 0); diff --git a/PWG/FLOW/Tasks/AliAnalysisTaskCVEPIDCME.h b/PWG/FLOW/Tasks/AliAnalysisTaskCVEPIDCME.h index a816d3a2115..0166a7a28f6 100644 --- a/PWG/FLOW/Tasks/AliAnalysisTaskCVEPIDCME.h +++ b/PWG/FLOW/Tasks/AliAnalysisTaskCVEPIDCME.h @@ -55,6 +55,7 @@ class AliAnalysisTaskCVEPIDCME : public AliAnalysisTaskSE void IfCalculateLambdaHadron(bool bCalculateLambdaHadron) {this->isCalculateLambdaHadron = bCalculateLambdaHadron; } void IfCalculateLambdaLambda(bool bCalculateLambdaLambda) {this->isCalculateLambdaLambda = bCalculateLambdaLambda; } void IfCalculateProtonProton(bool bCalculateProtonProton) {this->isCalculateProtonProton = bCalculateProtonProton; } + void IfCalculateProtonHadron(bool bCalculateProtonHadron) {this->isCalculateProtonHadron = bCalculateProtonHadron; } void IfCalculateHadronHadron(bool bCalculateHadronHadron) {this->isCalculateHadronHadron = bCalculateHadronHadron; } void IfCheckLambdaProtonFromDecay(bool bCheckLambdaProtonFromDecay) {this->isCheckLambdaProtonFromDecay = bCheckLambdaProtonFromDecay; } @@ -196,6 +197,7 @@ class AliAnalysisTaskCVEPIDCME : public AliAnalysisTaskSE bool isCalculateLambdaHadron; bool isCalculateLambdaLambda; bool isCalculateProtonProton; + bool isCalculateProtonHadron; bool isCalculateHadronHadron; bool isCheckLambdaProtonFromDecay; @@ -523,17 +525,22 @@ class AliAnalysisTaskCVEPIDCME : public AliAnalysisTaskSE TProfile2D* fProfile2RawFlowPtCentProton[5][2]; TProfile2D* fProfile2RawFlowPtCentLambda[5][2]; + // ΔMass + TH2D* fHist2DMass[4]; + // δ TProfile* fProfileDeltaLambdaProton[4]; //![0]:Λ-p [1]:Λ-pbar [2]:Λbar-p [3]:Λbar-pbar TProfile* fProfileDeltaLambdaHadron[4]; //![0]:Λ-h+ [1]:Λ-h- [2]:Λbar-h+ [3]:Λbar-h- TProfile* fProfileDeltaLambdaLambda[4]; //![0]:Λ-Λ [1]:Λ-Λbar [2]:Λbar-Λ [3]:Λbar-Λbar TProfile* fProfileDeltaProtonProton[4]; //![0]:p-p [1]:p-pbar [2]:pbar-p [3]:pbar-pbar + TProfile* fProfileDeltaProtonHadron[4]; //![0]:p-h+ [1]:p-h- [2]:pbar-h+ [3]:pbar-h- TProfile* fProfileDeltaHadronHadron[4]; //![0]:h+-h+[1]:h--h- [2]:h--h+ [3]:h--h- // γ [5]:plane type [4]:pair type TProfile* fProfileGammaLambdaProton[5][4]; TProfile* fProfileGammaLambdaHadron[5][4]; TProfile* fProfileGammaLambdaLambda[5][4]; TProfile* fProfileGammaProtonProton[5][4]; + TProfile* fProfileGammaProtonHadron[5][4]; TProfile* fProfileGammaHadronHadron[5][4]; // Diff δ(ΔpT) @@ -541,46 +548,52 @@ class AliAnalysisTaskCVEPIDCME : public AliAnalysisTaskSE TProfile2D* fProfile2DiffDeltaLambdaHadronDPt[4]; //![0]:Λ-h+ [1]:Λ-h- [2]:Λbar-h+ [3]:Λbar-h- TProfile2D* fProfile2DiffDeltaLambdaLambdaDPt[4]; //![0]:Λ-Λ [1]:Λ-Λbar [2]:Λbar-Λ [3]:Λbar-Λbar TProfile2D* fProfile2DiffDeltaProtonProtonDPt[4]; //![0]:p-p [1]:p-pbar [2]:pbar-p [3]:pbar-pbar + TProfile2D* fProfile2DiffDeltaProtonHadronDPt[4]; //![0]:p-h+ [1]:p-h- [2]:pbar-h+ [3]:pbar-h- TProfile2D* fProfile2DiffDeltaHadronHadronDPt[4]; //![0]:h+-h+[1]:h--h- [2]:h--h+ [3]:h--h- // Diff δ(SpT) TProfile2D* fProfile2DiffDeltaLambdaProtonSPt[4]; //![0]:Λ-p [1]:Λ-pbar [2]:Λbar-p [3]:Λbar-pbar TProfile2D* fProfile2DiffDeltaLambdaHadronSPt[4]; //![0]:Λ-h+ [1]:Λ-h- [2]:Λbar-h+ [3]:Λbar-h- TProfile2D* fProfile2DiffDeltaLambdaLambdaSPt[4]; //![0]:Λ-Λ [1]:Λ-Λbar [2]:Λbar-Λ [3]:Λbar-Λbar TProfile2D* fProfile2DiffDeltaProtonProtonSPt[4]; //![0]:p-p [1]:p-pbar [2]:pbar-p [3]:pbar-pbar + TProfile2D* fProfile2DiffDeltaProtonHadronSPt[4]; //![0]:p-h+ [1]:p-h- [2]:pbar-h+ [3]:pbar-h- TProfile2D* fProfile2DiffDeltaHadronHadronSPt[4]; //![0]:h+-h+[1]:h--h- [2]:h--h+ [3]:h--h- // Diff δ(Δη) TProfile2D* fProfile2DiffDeltaLambdaProtonDEta[4]; //![0]:Λ-p [1]:Λ-pbar [2]:Λbar-p [3]:Λbar-pbar TProfile2D* fProfile2DiffDeltaLambdaHadronDEta[4]; //![0]:Λ-h+ [1]:Λ-h- [2]:Λbar-h+ [3]:Λbar-h- TProfile2D* fProfile2DiffDeltaLambdaLambdaDEta[4]; //![0]:Λ-Λ [1]:Λ-Λbar [2]:Λbar-Λ [3]:Λbar-Λbar TProfile2D* fProfile2DiffDeltaProtonProtonDEta[4]; //![0]:p-p [1]:p-pbar [2]:pbar-p [3]:pbar-pbar + TProfile2D* fProfile2DiffDeltaProtonHadronDEta[4]; //![0]:p-h+ [1]:p-h- [2]:pbar-h+ [3]:pbar-h- TProfile2D* fProfile2DiffDeltaHadronHadronDEta[4]; //![0]:h+-h+[1]:h--h- [2]:h--h+ [3]:h--h- - // Diff δ(mass) + // Diff δ(Δmass) TProfile2D* fProfile2DiffDeltaLambdaProtonMass[4]; //![0]:Λ-p [1]:Λ-pbar [2]:Λbar-p [3]:Λbar-pbar TProfile2D* fProfile2DiffDeltaLambdaHadronMass[4]; //![0]:Λ-h+ [1]:Λ-h- [2]:Λbar-h+ [3]:Λbar-h- - TProfile2D* fProfile2DiffDeltaLambdaLambdaMass[4]; //![0]:Λ-Λ [1]:Λ-Λbar [2]:Λbar-Λ [3]:Λbar-Λbar + TProfile2D* fProfile2DiffDeltaLambdaLambdaDMass[4]; //![0]:Λ-Λ [1]:Λ-Λbar [2]:Λbar-Λ [3]:Λbar-Λbar // Diff γ(ΔpT)(only TPC Plane) TProfile2D* fProfile2DiffGammaLambdaProtonDPt[4]; //![0]:Λ-p [1]:Λ-pbar [2]:Λbar-p [3]:Λbar-pbar TProfile2D* fProfile2DiffGammaLambdaHadronDPt[4]; //![0]:Λ-h+ [1]:Λ-h- [2]:Λbar-h+ [3]:Λbar-h- TProfile2D* fProfile2DiffGammaLambdaLambdaDPt[4]; //![0]:Λ-Λ [1]:Λ-Λbar [2]:Λbar-Λ [3]:Λbar-Λbar TProfile2D* fProfile2DiffGammaProtonProtonDPt[4]; //![0]:p-p [1]:p-pbar [2]:pbar-p [3]:pbar-pbar + TProfile2D* fProfile2DiffGammaProtonHadronDPt[4]; //![0]:p-h+ [1]:p-h- [2]:pbar-h+ [3]:pbar-h- TProfile2D* fProfile2DiffGammaHadronHadronDPt[4]; //![0]:h+-h+[1]:h--h- [2]:h--h+ [3]:h--h- // Diff γ(SpT)(only TPC Plane) TProfile2D* fProfile2DiffGammaLambdaProtonSPt[4]; //![0]:Λ-p [1]:Λ-pbar [2]:Λbar-p [3]:Λbar-pbar TProfile2D* fProfile2DiffGammaLambdaHadronSPt[4]; //![0]:Λ-h+ [1]:Λ-h- [2]:Λbar-h+ [3]:Λbar-h- TProfile2D* fProfile2DiffGammaLambdaLambdaSPt[4]; //![0]:Λ-Λ [1]:Λ-Λbar [2]:Λbar-Λ [3]:Λbar-Λbar TProfile2D* fProfile2DiffGammaProtonProtonSPt[4]; //![0]:p-p [1]:p-pbar [2]:pbar-p [3]:pbar-pbar + TProfile2D* fProfile2DiffGammaProtonHadronSPt[4]; //![0]:p-h+ [1]:p-h- [2]:pbar-h+ [3]:pbar-h- TProfile2D* fProfile2DiffGammaHadronHadronSPt[4]; //![0]:h+-h+[1]:h--h- [2]:h--h+ [3]:h--h- // Diff γ(Δη) TProfile2D* fProfile2DiffGammaLambdaProtonDEta[4]; //![0]:Λ-p [1]:Λ-pbar [2]:Λbar-p [3]:Λbar-pbar TProfile2D* fProfile2DiffGammaLambdaHadronDEta[4]; //![0]:Λ-h+ [1]:Λ-h- [2]:Λbar-h+ [3]:Λbar-h- TProfile2D* fProfile2DiffGammaLambdaLambdaDEta[4]; //![0]:Λ-Λ [1]:Λ-Λbar [2]:Λbar-Λ [3]:Λbar-Λbar TProfile2D* fProfile2DiffGammaProtonProtonDEta[4]; //![0]:p-p [1]:p-pbar [2]:pbar-p [3]:pbar-pbar + TProfile2D* fProfile2DiffGammaProtonHadronDEta[4]; //![0]:p-h+ [1]:p-h- [2]:pbar-h+ [3]:pbar-h- TProfile2D* fProfile2DiffGammaHadronHadronDEta[4]; //![0]:h+-h+[1]:h--h- [2]:h--h+ [3]:h--h- - // Diff δ(mass) + // Diff δ(mass) or δ(Δmass) TProfile2D* fProfile2DiffGammaLambdaProtonMass[4]; //![0]:Λ-p [1]:Λ-pbar [2]:Λbar-p [3]:Λbar-pbar TProfile2D* fProfile2DiffGammaLambdaHadronMass[4]; //![0]:Λ-h+ [1]:Λ-h- [2]:Λbar-h+ [3]:Λbar-h- - TProfile2D* fProfile2DiffGammaLambdaLambdaMass[4]; //![0]:Λ-Λ [1]:Λ-Λbar [2]:Λbar-Λ [3]:Λbar-Λbar + TProfile2D* fProfile2DiffGammaLambdaLambdaDMass[4]; //![0]:Λ-Λ [1]:Λ-Λbar [2]:Λbar-Λ [3]:Λbar-Λbar // C(Δη,Δφ) [cent][pair type] @@ -588,6 +601,7 @@ class AliAnalysisTaskCVEPIDCME : public AliAnalysisTaskSE TH2D* fHist2DEtaDPhiLambdaHadron[8][4]; TH2D* fHist2DEtaDPhiLambdaLambda[8][4]; TH2D* fHist2DEtaDPhiProtonProton[8][4]; + TH2D* fHist2DEtaDPhiProtonHadron[8][4]; TH2D* fHist2DEtaDPhiHadronHadron[8][4]; // C(Δη,sφ) [cent][pair type] only TPC Plane @@ -595,6 +609,7 @@ class AliAnalysisTaskCVEPIDCME : public AliAnalysisTaskSE TH2D* fHist2DEtaSPhiLambdaHadron[8][4]; TH2D* fHist2DEtaSPhiLambdaLambda[8][4]; TH2D* fHist2DEtaSPhiProtonProton[8][4]; + TH2D* fHist2DEtaSPhiProtonHadron[8][4]; TH2D* fHist2DEtaSPhiHadronHadron[8][4]; // δ Λ - daughter diff --git a/PWGCF/FLOW/macros/AddTaskCVEPIDCME.C b/PWGCF/FLOW/macros/AddTaskCVEPIDCME.C index 2ee2d27f136..57cf2c6f87b 100644 --- a/PWGCF/FLOW/macros/AddTaskCVEPIDCME.C +++ b/PWGCF/FLOW/macros/AddTaskCVEPIDCME.C @@ -17,6 +17,7 @@ AliAnalysisTaskCVEPIDCME* AddTaskCVEPIDCME( bool bCalculateLambdaHadron = false, bool bCalculateLambdaLambda = false, bool bCalculateProtonProton = false, + bool bCalculateProtonHadron = false, bool bCalculateHadronHadron = false, TString uniqueID = "") { @@ -84,6 +85,7 @@ AliAnalysisTaskCVEPIDCME* AddTaskCVEPIDCME( task->IfCalculateLambdaHadron(bCalculateLambdaHadron); task->IfCalculateLambdaLambda(bCalculateLambdaLambda); task->IfCalculateProtonProton(bCalculateProtonProton); + task->IfCalculateProtonHadron(bCalculateProtonHadron); task->IfCalculateHadronHadron(bCalculateHadronHadron); task->IfCheckLambdaProtonFromDecay(bCalculateLambdaProtonFromDecay); From d3e02eaf73bebfec80727fb6dbb9f7d19f335cba Mon Sep 17 00:00:00 2001 From: ChunzhengLab Date: Mon, 24 Apr 2023 17:12:42 +0800 Subject: [PATCH 47/51] Adjust bin width --- PWG/FLOW/Tasks/AliAnalysisTaskCVEPIDCME.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWG/FLOW/Tasks/AliAnalysisTaskCVEPIDCME.cxx b/PWG/FLOW/Tasks/AliAnalysisTaskCVEPIDCME.cxx index a19662a85ca..af97e85be3d 100644 --- a/PWG/FLOW/Tasks/AliAnalysisTaskCVEPIDCME.cxx +++ b/PWG/FLOW/Tasks/AliAnalysisTaskCVEPIDCME.cxx @@ -1213,12 +1213,12 @@ void AliAnalysisTaskCVEPIDCME::UserCreateOutputObjects() fQAList->Add(fHist2AntiLambdaMassPtY[i]); } fHist3LambdaCentPtMass[0] = new TH3D("fHist3LambdaCentPtMass_BfMassCut",";Centrality;Pt;Mass",8,0,80,20,0,10,1000,1.,1.25); // Current bin size = 0.00025 - fHist3LambdaCentPtMass[1] = new TH3D("fHist3LambdaCentPtMass_AfMassCut",";Centrality;Pt;Mass",8,0,80,20,0,10,15,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); + fHist3LambdaCentPtMass[1] = new TH3D("fHist3LambdaCentPtMass_AfMassCut",";Centrality;Pt;Mass",8,0,80,20,0,10,20,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); fQAList->Add(fHist3LambdaCentPtMass[0]); fQAList->Add(fHist3LambdaCentPtMass[1]); fHist3AntiLambdaCentPtMass[0] = new TH3D("fHist3AntiLambdaCentPtMass_BfMassCut",";Centrality;Pt;Mass",8,0,80,20,0,10,1000,1.,1.25); // Current bin size = 0.00025 - fHist3AntiLambdaCentPtMass[1] = new TH3D("fHist3AntiLambdaCentPtMass_AfMassCut",";Centrality;Pt;Mass",8,0,80,20,0,10,15,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); + fHist3AntiLambdaCentPtMass[1] = new TH3D("fHist3AntiLambdaCentPtMass_AfMassCut",";Centrality;Pt;Mass",8,0,80,20,0,10,20,fLambdaMassMean-fLambdaMassRightCut,fLambdaMassMean+fLambdaMassLeftCut); fQAList->Add(fHist3AntiLambdaCentPtMass[0]); fQAList->Add(fHist3AntiLambdaCentPtMass[1]); From e8f1280e094b159210f1f8dcf1cfdbb0ca4a1810 Mon Sep 17 00:00:00 2001 From: Mingrui Zhao Date: Mon, 24 Apr 2023 16:02:57 +0200 Subject: [PATCH 48/51] fix a typo --- PWGCF/FLOW/GF/AliAnalysisTaskNonlinearFlow.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/FLOW/GF/AliAnalysisTaskNonlinearFlow.cxx b/PWGCF/FLOW/GF/AliAnalysisTaskNonlinearFlow.cxx index ff3641fce6c..4f730ebc312 100644 --- a/PWGCF/FLOW/GF/AliAnalysisTaskNonlinearFlow.cxx +++ b/PWGCF/FLOW/GF/AliAnalysisTaskNonlinearFlow.cxx @@ -699,7 +699,7 @@ void AliAnalysisTaskNonlinearFlow::UserExec(Option_t *) if (fOnTheFly) { hEventCount->Fill("after fEventCuts", 1.); - bootstrap_value = rand.Integer(30); + bootstrap_value = rand.Integer(30)-1; } else { // Check if it passed the standard AOD selection if (!AcceptAOD(fAOD) ) { From 28a5b1121ab40746ef302095a5dbe01aa1bd9851 Mon Sep 17 00:00:00 2001 From: bheybeck <86231730+bheybeck@users.noreply.github.com> Date: Mon, 24 Apr 2023 16:34:55 +0200 Subject: [PATCH 49/51] Update AliAnalysisTaskSigmaPlus.cxx --- .../Sigma_Baryons/AliAnalysisTaskSigmaPlus.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/PWGLF/NUCLEX/Hypernuclei/Hyp2Body/HypTritYield/Sigma_Baryons/AliAnalysisTaskSigmaPlus.cxx b/PWGLF/NUCLEX/Hypernuclei/Hyp2Body/HypTritYield/Sigma_Baryons/AliAnalysisTaskSigmaPlus.cxx index 559d9d909e8..014bffed09c 100644 --- a/PWGLF/NUCLEX/Hypernuclei/Hyp2Body/HypTritYield/Sigma_Baryons/AliAnalysisTaskSigmaPlus.cxx +++ b/PWGLF/NUCLEX/Hypernuclei/Hyp2Body/HypTritYield/Sigma_Baryons/AliAnalysisTaskSigmaPlus.cxx @@ -3428,11 +3428,10 @@ void AliAnalysisTaskSigmaPlus::UserExec(Option_t *) if(isMonteCarlo){ //Create Pseudo Event ID in case of MC - Int_t ParA = aodEvent->GetRunNumber(); - Int_t ParB = aodEvent->GetNumberOfTracks(); - Int_t ParC = mcEvent->GetNumberOfTracks(); - UInt_t ParD = (*reinterpret_cast(&primaryVtxPosZMC)); - ULong64_t PseudoEventID = (((ULong64_t)ParA<<48)|((ULong64_t)ParB<<32)|((ULong64_t)ParC<<16)|((ULong64_t)ParD)); + Short_t ParA = aodEvent->GetNumberOfTracks(); + Short_t ParB = mcEvent->GetNumberOfTracks(); + UInt_t ParC = (*reinterpret_cast(&primaryVtxPosZMC)); + ULong64_t PseudoEventID = (((ULong64_t)ParA<<48)|((ULong64_t)ParB<<32)|((ULong64_t)ParC)); fGlobalEventID = PseudoEventID; } From b4df161b11ae4db2111d6d266e9690e7ef5bd028 Mon Sep 17 00:00:00 2001 From: dsarkar <60989535+dsarkaralice@users.noreply.github.com> Date: Mon, 24 Apr 2023 21:22:45 +0200 Subject: [PATCH 50/51] Update AliAnalysisTaskCorrForFlowFMD.h --- PWGCF/FLOW/GF/AliAnalysisTaskCorrForFlowFMD.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/PWGCF/FLOW/GF/AliAnalysisTaskCorrForFlowFMD.h b/PWGCF/FLOW/GF/AliAnalysisTaskCorrForFlowFMD.h index db6b1086451..6796511a506 100644 --- a/PWGCF/FLOW/GF/AliAnalysisTaskCorrForFlowFMD.h +++ b/PWGCF/FLOW/GF/AliAnalysisTaskCorrForFlowFMD.h @@ -186,6 +186,7 @@ class AliAnalysisTaskCorrForFlowFMD : public AliAnalysisTaskSE //output histograms TH1D* fhEventCounter; //! TH1D* fhEventMultiplicity; //! + TH1D* fhEventMultiplicity_massbias; //! AliTHn* fhTrigTracks[7]; //! AliTHn* fhSE[7]; //! AliTHn* fhME[7]; //! @@ -198,6 +199,7 @@ class AliAnalysisTaskCorrForFlowFMD : public AliAnalysisTaskSE TH1D* fhPhiphi; //! TH1D* fhCentCalib; //! TH1D* fhPT[7]; //! + TH1D* fhPT_trig[7]; //! TH2D* fhPTvsMinv[3]; //! TH2D* fhPTvsMinv_Phi_LS; //! TH2D* fh2FMDvsV0[4]; //! From ec61ba737d56390e254af3ad8f78ff1bf45ea607 Mon Sep 17 00:00:00 2001 From: dsarkar <60989535+dsarkaralice@users.noreply.github.com> Date: Mon, 24 Apr 2023 21:22:47 +0200 Subject: [PATCH 51/51] Update AliAnalysisTaskCorrForFlowFMD.cxx --- .../FLOW/GF/AliAnalysisTaskCorrForFlowFMD.cxx | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/PWGCF/FLOW/GF/AliAnalysisTaskCorrForFlowFMD.cxx b/PWGCF/FLOW/GF/AliAnalysisTaskCorrForFlowFMD.cxx index 9be20f15125..b43d4b932e2 100644 --- a/PWGCF/FLOW/GF/AliAnalysisTaskCorrForFlowFMD.cxx +++ b/PWGCF/FLOW/GF/AliAnalysisTaskCorrForFlowFMD.cxx @@ -32,6 +32,7 @@ AliAnalysisTaskCorrForFlowFMD::AliAnalysisTaskCorrForFlowFMD() : AliAnalysisTask fPoolMgr(0), fhEventCounter(0), fhEventMultiplicity(0), + fhEventMultiplicity_massbias(0), fhK0sphi(0), fhLambdaphi(0), fhPhiphi(0), @@ -141,6 +142,7 @@ AliAnalysisTaskCorrForFlowFMD::AliAnalysisTaskCorrForFlowFMD(const char* name, B fPoolMgr(0), fhEventCounter(0), fhEventMultiplicity(0), + fhEventMultiplicity_massbias(0), fhK0sphi(0), fhLambdaphi(0), fhPhiphi(0), @@ -272,6 +274,9 @@ void AliAnalysisTaskCorrForFlowFMD::UserCreateOutputObjects() fhEventMultiplicity = new TH1D("fhEventMultiplicity","Event multiplicity; N_{ch}",200,0,200); fOutputListCharged->Add(fhEventMultiplicity); + + fhEventMultiplicity_massbias = new TH1D("fhEventMultiplicity_massbias","Event multiplicity; N_{ch}",200,0,200); + fOutputListCharged->Add(fhEventMultiplicity_massbias); fHistFMDeta = new TH2D("fHistFMDeta", "FMD eta vs. PVz; eta; PVz [cm]", 90, -4, 5, 20, -10, 10); fOutputListCharged->Add(fHistFMDeta); @@ -369,6 +374,11 @@ void AliAnalysisTaskCorrForFlowFMD::UserCreateOutputObjects() fhPT[i] = new TH1D(Form("PT%s",pidName[i].Data()), "PT", 2000, 0, 20); fhPT[i]->Sumw2(); fOutputListCharged->Add(fhPT[i]); + + fhPT_trig[i] = new TH1D(Form("PT_trig%s",pidName[i].Data()), "PT_trig", 2000, 0, 20); + fhPT_trig[i]->Sumw2(); + fOutputListCharged->Add(fhPT_trig[i]); + if(fDoV0 && i > 3 && i<6){ fhPTvsMinv[i-4] = new TH2D(Form("PT_minv%s",pidName[i].Data()), "PT vs. minv", 2000, 0, 20, sizeMbins, min[i-4],max[i-4]); fhPTvsMinv[i-4]->Sumw2(); @@ -517,6 +527,8 @@ void AliAnalysisTaskCorrForFlowFMD::UserExec(Option_t *) if(fIsAntiparticleCheck && i == 4) continue; + fhEventMultiplicity->Fill(fNofTracks); + if(fParticlemass_bias_corr) { if(fDoPID && fProtonSigcount < 1) continue;//for PID correlation to fill, at least one proton needed (biasing event selection) if(fDoV0 && fLambdaSigcount < 1) continue;//for V0 correlation to fill, at least one lambda candidate needed (biasing event selection) @@ -525,6 +537,8 @@ void AliAnalysisTaskCorrForFlowFMD::UserExec(Option_t *) fhEventCounter->Fill("Used in corr",1); + fhEventMultiplicity_massbias->Fill(fNofTracks); + FillCorrelations(i); FillCorrelationsMixed(i); @@ -1079,6 +1093,9 @@ void AliAnalysisTaskCorrForFlowFMD::FillCorrelations(const Int_t spec) Double_t trigEta = track->Eta(); Double_t trigPhi = track->Phi(); Double_t trigCharge = track->Charge(); + + fhPT_trig[spec]->Fill(trigPt); + Double_t trigEff = 1.0; if(fUseEfficiency) { trigEff = GetEff(trigPt, spec, trigEta); @@ -1144,6 +1161,9 @@ void AliAnalysisTaskCorrForFlowFMD::FillCorrelations(const Int_t spec) Double_t trigPt = track->Pt(); Double_t trigEta = track->Eta(); Double_t trigPhi = track->Phi(); + + fhPT_trig[spec]->Fill(trigPt); + Double_t trigEff = 1.0; if(fUseEfficiency) { trigEff = GetEff(trigPt, spec, trigEta); @@ -1665,7 +1685,6 @@ Bool_t AliAnalysisTaskCorrForFlowFMD::PrepareTPCTracks(){ if(fUseNch){ if(fNofTracks < fNchMin || fNofTracks > fNchMax) { return kFALSE; } fhEventCounter->Fill("Nch cut ok ",1); - fhEventMultiplicity->Fill(fNofTracks); } if(fVetoJetEvents){