From: ebruna Date: Wed, 12 Mar 2014 14:13:45 +0000 (+0100) Subject: add p conserv at kine level, flag to speed up the analysis (Fabio C.) X-Git-Url: http://git.uio.no/git/?a=commitdiff_plain;h=358ec3fe911ebb21a1775036db02b6954ad7dd84;p=u%2Fmrichter%2FAliRoot.git add p conserv at kine level, flag to speed up the analysis (Fabio C.) --- diff --git a/PWGHF/correlationHF/AliAnalysisTaskSED0Correlations.cxx b/PWGHF/correlationHF/AliAnalysisTaskSED0Correlations.cxx index 36ff3ea48de..409b6d76f4f 100644 --- a/PWGHF/correlationHF/AliAnalysisTaskSED0Correlations.cxx +++ b/PWGHF/correlationHF/AliAnalysisTaskSED0Correlations.cxx @@ -90,10 +90,11 @@ AliAnalysisTaskSE(), fSys(0), fEtaForCorrel(0), fIsRejectSDDClusters(0), - fFillGlobal(kTRUE), + fFillGlobal(kFALSE), fMultEv(0.), fSoftPiCut(kTRUE), - fMEAxisThresh(kFALSE) + fMEAxisThresh(kFALSE), + fKaonCorr(kFALSE) { // Default constructor @@ -129,10 +130,11 @@ AliAnalysisTaskSED0Correlations::AliAnalysisTaskSED0Correlations(const char *nam fSys(0), fEtaForCorrel(0), fIsRejectSDDClusters(0), - fFillGlobal(kTRUE), + fFillGlobal(kFALSE), fMultEv(0.), fSoftPiCut(kTRUE), - fMEAxisThresh(kFALSE) + fMEAxisThresh(kFALSE), + fKaonCorr(kFALSE) { // Default constructor @@ -189,7 +191,8 @@ AliAnalysisTaskSED0Correlations::AliAnalysisTaskSED0Correlations(const AliAnalys fFillGlobal(source.fFillGlobal), fMultEv(source.fMultEv), fSoftPiCut(source.fSoftPiCut), - fMEAxisThresh(source.fMEAxisThresh) + fMEAxisThresh(source.fMEAxisThresh), + fKaonCorr(source.fKaonCorr) { // Copy constructor } @@ -273,6 +276,7 @@ AliAnalysisTaskSED0Correlations& AliAnalysisTaskSED0Correlations::operator=(cons fMultEv = orig.fMultEv; fSoftPiCut = orig.fSoftPiCut; fMEAxisThresh = orig.fMEAxisThresh; + fKaonCorr = orig.fKaonCorr; return *this; //returns pointer of the class } @@ -754,6 +758,22 @@ void AliAnalysisTaskSED0Correlations::UserExec(Option_t */*option*/) if (fCutsD0->IsInFiducialAcceptance(mcPart->Pt(),mcPart->Y()) ) { nSelectedloose++; nSelectedtight++; + + //Removal of cases in which D0 decay is not in Kpi! + if(mcPart->GetNDaughters()!=2) continue; + AliAODMCParticle* mcDau1 = dynamic_cast(mcArray->At(mcPart->GetDaughter(0))); + AliAODMCParticle* mcDau2 = dynamic_cast(mcArray->At(mcPart->GetDaughter(1))); + if(!mcDau1 || !mcDau2) continue; + Int_t pdg1 = TMath::Abs(mcDau1->GetPdgCode()); + Int_t pdg2 = TMath::Abs(mcDau2->GetPdgCode()); + if(!((pdg1 == 211 && pdg2 == 321) || (pdg2 == 211 && pdg1 == 321))) continue; + if(TMath::Abs(mcDau1->Eta())>0.8||TMath::Abs(mcDau2->Eta())>0.8) continue; + //Check momentum conservation (to exclude 4-prong decays with tracks outside y=1.5) + Double_t p1[3] = {mcDau1->Px(),mcDau1->Py(),mcDau1->Pz()}; + Double_t p2[3] = {mcDau2->Px(),mcDau2->Py(),mcDau2->Pz()}; + Double_t pD0[3] = {mcPart->Px(),mcPart->Py(),mcPart->Pz()}; + if(TMath::Abs( (p1[0]+p2[0]-pD0[0])*(p1[0]+p2[0]-pD0[0]) + (p1[1]+p2[1]-pD0[1])*(p1[1]+p2[1]-pD0[1]) + (p1[2]+p2[2]-pD0[2])*(p1[2]+p2[2]-pD0[2]) )>0.1) continue; + if(fSys==0) fNentries->Fill(6); Int_t ptbin=fCutsD0->PtBin(mcPart->Pt()); if(ptbin==-1) {fNentries->Fill(4); continue;} //out of bounds @@ -1384,31 +1404,31 @@ void AliAnalysisTaskSED0Correlations::CreateCorrelationsObjs() { hPtKAll->SetMinimum(0); fOutputStudy->Add(hPtKAll); - if(!fMixing) { - //phi distributions - TH1F *hPhiDistCAll = new TH1F("hist_PhiDistr_Charg", "Charged track phi distr. (All); p_{T} (GeV/c)",64,0,6.283); - hPhiDistCAll->SetMinimum(0); - fOutputStudy->Add(hPhiDistCAll); - - TH1F *hPhiDistHAll = new TH1F("hist_PhiDistr_Kcharg", "Hadrons phi distr. (All); p_{T} (GeV/c)",64,0,6.283); - hPhiDistHAll->SetMinimum(0); - fOutputStudy->Add(hPhiDistHAll); - - TH1F *hPhiDistKAll = new TH1F("hist_PhiDistr_K0", "Kaons phi distr. (All); p_{T} (GeV/c)",64,0,6.283); - hPhiDistKAll->SetMinimum(0); - fOutputStudy->Add(hPhiDistKAll); - - TH1F *hPhiDistDAll = new TH1F("hist_PhiDistr_D0", "D^{0} phi distr. (All); p_{T} (GeV/c)",64,0,6.283); - hPhiDistDAll->SetMinimum(0); - fOutputStudy->Add(hPhiDistDAll); - } - //K0 Invariant Mass plots TH2F *hK0MassInv = new TH2F("hK0MassInv", "K0 invariant mass; Invariant mass (MeV/c^{2}); pT (GeV/c)",200,0.4,0.6,100,0.,10.); hK0MassInv->SetMinimum(0); fOutputStudy->Add(hK0MassInv); } + if(!fMixing) { + //phi distributions + TH1F *hPhiDistCAll = new TH1F("hist_PhiDistr_Charg", "Charged track phi distr. (All); p_{T} (GeV/c)",64,0,6.283); + hPhiDistCAll->SetMinimum(0); + fOutputStudy->Add(hPhiDistCAll); + + TH1F *hPhiDistHAll = new TH1F("hist_PhiDistr_Kcharg", "Hadrons phi distr. (All); p_{T} (GeV/c)",64,0,6.283); + hPhiDistHAll->SetMinimum(0); + fOutputStudy->Add(hPhiDistHAll); + + TH1F *hPhiDistKAll = new TH1F("hist_PhiDistr_K0", "Kaons phi distr. (All); p_{T} (GeV/c)",64,0,6.283); + hPhiDistKAll->SetMinimum(0); + fOutputStudy->Add(hPhiDistKAll); + + TH1F *hPhiDistDAll = new TH1F("hist_PhiDistr_D0", "D^{0} phi distr. (All); p_{T} (GeV/c)",64,0,6.283); + hPhiDistDAll->SetMinimum(0); + fOutputStudy->Add(hPhiDistDAll); + } + //for MC analysis only for(Int_t i=0;iGetNofEventsInPool(); if(!execPoolKc) { @@ -1765,6 +1787,8 @@ void AliAnalysisTaskSED0Correlations::CalculateCorrelations(AliAODRecoDecayHF2Pr } // end of charged kaons loop } //end of event loop for fCorrelatorK0 + } //end of 'if(fKaonCorr)' + Double_t fillSpLeadD0[4] = {lead[0],mD0,lead[1],0.4}; //dummy value for threshold of leading! Double_t fillSpLeadD0bar[4] = {lead[0],mD0bar,lead[1],0.4}; @@ -1895,6 +1919,8 @@ void AliAnalysisTaskSED0Correlations::CalculateCorrelationsMCKine(AliAODMCPartic } // end of tracks loop } //end of event loop for fCorrelatorTr + if(fKaonCorr) { //loops for Kcharg and K0 + if(fMixing) { NofEventsinPool = fCorrelatorKc->GetNofEventsInPool(); if(!execPoolKc) { @@ -1968,6 +1994,8 @@ void AliAnalysisTaskSED0Correlations::CalculateCorrelationsMCKine(AliAODMCPartic } // end of charged kaons loop } //end of event loop for fCorrelatorK0 + } //end of 'if(fKaonCorr)' + Double_t fillSpLeadMC[4] = {lead[0],mD0,lead[1],0.4}; //mD0 = mD0bar = 1.864 //leading track correlations fill diff --git a/PWGHF/correlationHF/AliAnalysisTaskSED0Correlations.h b/PWGHF/correlationHF/AliAnalysisTaskSED0Correlations.h index dc5a4ebce75..c2d360ac9de 100644 --- a/PWGHF/correlationHF/AliAnalysisTaskSED0Correlations.h +++ b/PWGHF/correlationHF/AliAnalysisTaskSED0Correlations.h @@ -56,6 +56,7 @@ class AliAnalysisTaskSED0Correlations : public AliAnalysisTaskSE void SetFillGlobalPlots(Bool_t fill=kTRUE){fFillGlobal=fill;} void SetSoftPiFlag(Bool_t piflag) {fSoftPiCut=piflag;} void SetMEAxisThresh(Bool_t methresh) {fMEAxisThresh=methresh;} + void SetKaonCorrelations(Bool_t kaonCorr) {fKaonCorr=kaonCorr;} Int_t GetReadMC() const {return fReadMC;} Int_t GetMCReconstructedTracks() const {return fRecoTr;} @@ -69,6 +70,7 @@ class AliAnalysisTaskSED0Correlations : public AliAnalysisTaskSE Double_t GetMultEv() {return fMultEv;} Bool_t GetSoftPiFlag() const {return fSoftPiCut;} Bool_t GetMEAxisThresh() const {return fMEAxisThresh;} + Bool_t GetKaonCorrelations() const {return fKaonCorr;} //correlations setters/printers void SetNPtBinsCorr(Int_t nbins) {fNPtBinsCorr = nbins;} @@ -133,8 +135,9 @@ class AliAnalysisTaskSED0Correlations : public AliAnalysisTaskSE Double_t fMultEv; // event multiplicity (for trigger eff) Bool_t fSoftPiCut; // flag to activate soft pion cut on Data Bool_t fMEAxisThresh; // flag to fill threshold axis in ME plots + Bool_t fKaonCorr; // enables correlations of D0-Kcharg and D0-K0 - ClassDef(AliAnalysisTaskSED0Correlations,4); // AliAnalysisTaskSE for D0->Kpi + ClassDef(AliAnalysisTaskSED0Correlations,5); // AliAnalysisTaskSE for D0->Kpi }; #endif diff --git a/PWGHF/correlationHF/macros/AddTaskD0Correlations.C b/PWGHF/correlationHF/macros/AddTaskD0Correlations.C index 6347e35607c..14475e011f1 100644 --- a/PWGHF/correlationHF/macros/AddTaskD0Correlations.C +++ b/PWGHF/correlationHF/macros/AddTaskD0Correlations.C @@ -1,4 +1,4 @@ -AliAnalysisTaskSED0Correlations *AddTaskD0Correlations(Bool_t readMC=kFALSE, Bool_t mixing=kFALSE, Bool_t recoTrMC=kFALSE, Bool_t recoD0MC = kFALSE, Bool_t flagsoftpicut = kTRUE, Bool_t MEthresh = kFALSE, TString cutsfilename="D0toKpiCuts.root", TString cutsfilename2="AssocPartCuts_Std.root", TString effD0namec="D0Eff_From_c_wLimAcc_2D.root", TString effD0nameb="D0Eff_From_b_wLimAcc_2D.root", TString effName = "3D_eff_Std.root", TString cutsD0name="D0toKpiCuts", TString cutsTrkname="AssociatedTrkCuts", Double_t etacorr=1.5, Int_t system=0/*0=useMultipl(pp),1=useCentral(PbPb,pA depends)-*/, Int_t flagD0D0bar=0, Float_t minC=0, Float_t maxC=0, TString finDirname="Output", Bool_t flagAOD049=kFALSE, Int_t standardbins=1, Bool_t stdcuts=kFALSE) +AliAnalysisTaskSED0Correlations *AddTaskD0Correlations(Bool_t readMC=kFALSE, Bool_t mixing=kFALSE, Bool_t recoTrMC=kFALSE, Bool_t recoD0MC = kFALSE, Bool_t flagsoftpicut = kTRUE, Bool_t MEthresh = kFALSE, TString cutsfilename="D0toKpiCuts.root", TString cutsfilename2="AssocPartCuts_Std.root", TString effD0namec="D0Eff_From_c_wLimAcc_2D.root", TString effD0nameb="D0Eff_From_b_wLimAcc_2D.root", TString effName = "3D_eff_Std.root", TString cutsD0name="D0toKpiCuts", TString cutsTrkname="AssociatedTrkCuts", Double_t etacorr=1.5, Int_t system=0/*0=useMultipl(pp),1=useCentral(PbPb,pA depends)-*/, Int_t flagD0D0bar=0, Float_t minC=0, Float_t maxC=0, TString finDirname="Output", Bool_t flagAOD049=kFALSE, Int_t standardbins=1, Bool_t stdcuts=kFALSE, Bool_t analyszeKaon=kFALSE) { // // AddTask for the AliAnalysisTaskSE for D0 candidates @@ -185,6 +185,7 @@ AliAnalysisTaskSED0Correlations *AddTaskD0Correlations(Bool_t readMC=kFALSE, Boo massD0Task->SetEtaForCorrel(etacorr); massD0Task->SetSoftPiFlag(flagsoftpicut); massD0Task->SetMEAxisThresh(MEthresh); + if(analyszeKaon) massD0Task->SetKaonCorrelations(kTRUE); //********************* //correlation settings