From 32e940792878da927286727901081716ecee2b15 Mon Sep 17 00:00:00 2001 From: miweber Date: Wed, 23 Jan 2013 09:11:48 +0000 Subject: [PATCH] update drawing correlation macros for different event classes --- .../macros/AddTaskBalancePsiCentralityTrain.C | 18 +- .../macros/configBalanceFunctionPsiAnalysis.C | 4 +- .../EBYE/macros/drawCorrelationFunctionPsi.C | 191 +++++++++++++----- 3 files changed, 153 insertions(+), 60 deletions(-) diff --git a/PWGCF/EBYE/macros/AddTaskBalancePsiCentralityTrain.C b/PWGCF/EBYE/macros/AddTaskBalancePsiCentralityTrain.C index 6af42245f2b..9fe33acaeed 100644 --- a/PWGCF/EBYE/macros/AddTaskBalancePsiCentralityTrain.C +++ b/PWGCF/EBYE/macros/AddTaskBalancePsiCentralityTrain.C @@ -66,19 +66,19 @@ AliAnalysisTaskBFPsi *AddTaskBalancePsiCentralityTrain(Double_t centrMin=0., AliBalancePsi *bfm = 0; // mixing Balance function object if (analysisType=="ESD"){ - bf = GetBalanceFunctionObject("ESD",centralityEstimator,centrMin,centrMax,kFALSE,bHBTcut,bConversionCut); - if(gRunShuffling) bfs = GetBalanceFunctionObject("ESD",centralityEstimator,centrMin,centrMax,kTRUE,bHBTcut,bConversionCut); - if(gRunMixing) bfm = GetBalanceFunctionObject("ESD",centralityEstimator,centrMin,centrMax,kFALSE,bHBTcut,bConversionCut); + bf = GetBalanceFunctionObject("ESD",centralityEstimator,centrMin,centrMax,kFALSE,bHBTcut,bConversionCut,fArgEventClass); + if(gRunShuffling) bfs = GetBalanceFunctionObject("ESD",centralityEstimator,centrMin,centrMax,kTRUE,bHBTcut,bConversionCut,fArgEventClass); + if(gRunMixing) bfm = GetBalanceFunctionObject("ESD",centralityEstimator,centrMin,centrMax,kFALSE,bHBTcut,bConversionCut,fArgEventClass); } else if (analysisType=="AOD"){ - bf = GetBalanceFunctionObject("AOD",centralityEstimator,centrMin,centrMax,kFALSE,bHBTcut,bConversionCut); - if(gRunShuffling) bfs = GetBalanceFunctionObject("AOD",centralityEstimator,centrMin,centrMax,kTRUE,bHBTcut,bConversionCut); - if(gRunMixing) bfm = GetBalanceFunctionObject("AOD",centralityEstimator,centrMin,centrMax,kFALSE,bHBTcut,bConversionCut); + bf = GetBalanceFunctionObject("AOD",centralityEstimator,centrMin,centrMax,kFALSE,bHBTcut,bConversionCut,fArgEventClass); + if(gRunShuffling) bfs = GetBalanceFunctionObject("AOD",centralityEstimator,centrMin,centrMax,kTRUE,bHBTcut,bConversionCut,fArgEventClass); + if(gRunMixing) bfm = GetBalanceFunctionObject("AOD",centralityEstimator,centrMin,centrMax,kFALSE,bHBTcut,bConversionCut,fArgEventClass); } else if (analysisType=="MC"){ - bf = GetBalanceFunctionObject("MC",centralityEstimator,centrMin,centrMax,kFALSE,bHBTcut,bConversionCut); - if(gRunShuffling) bfs = GetBalanceFunctionObject("MC",centralityEstimator,centrMin,centrMax,kTRUE,bHBTcut,bConversionCut); - if(gRunMixing) bfm = GetBalanceFunctionObject("MC",centralityEstimator,centrMin,centrMax,kFALSE,bHBTcut,bConversionCut); + bf = GetBalanceFunctionObject("MC",centralityEstimator,centrMin,centrMax,kFALSE,bHBTcut,bConversionCut,fArgEventClass); + if(gRunShuffling) bfs = GetBalanceFunctionObject("MC",centralityEstimator,centrMin,centrMax,kTRUE,bHBTcut,bConversionCut,fArgEventClass); + if(gRunMixing) bfm = GetBalanceFunctionObject("MC",centralityEstimator,centrMin,centrMax,kFALSE,bHBTcut,bConversionCut,fArgEventClass); } else{ ::Error("AddTaskBF", "analysis type NOT known."); diff --git a/PWGCF/EBYE/macros/configBalanceFunctionPsiAnalysis.C b/PWGCF/EBYE/macros/configBalanceFunctionPsiAnalysis.C index 03babd6db97..ad6ff20bbb5 100644 --- a/PWGCF/EBYE/macros/configBalanceFunctionPsiAnalysis.C +++ b/PWGCF/EBYE/macros/configBalanceFunctionPsiAnalysis.C @@ -5,7 +5,8 @@ AliBalancePsi *GetBalanceFunctionObject(const char* analysisLevel = "ESD", Double_t centrMax = 100., Bool_t bShuffle = kFALSE, Bool_t bHBTCut = kFALSE, - Bool_t bConversionCut = kFALSE) { + Bool_t bConversionCut = kFALSE, + TString fArgEventClass = "EventPlane") { //Function to setup the AliBalance object and return it AliBalancePsi *gBalance = new AliBalancePsi(); gBalance->SetAnalysisLevel(analysisLevel); @@ -14,6 +15,7 @@ AliBalancePsi *GetBalanceFunctionObject(const char* analysisLevel = "ESD", if(bConversionCut) gBalance->UseConversionCut(); if(centralityName) gBalance->SetCentralityIdentifier(centralityName); gBalance->SetCentralityInterval(centrMin,centrMax); + gBalance->SetEventClass(fArgEventClass); //Set all analyses separately //Rapidity diff --git a/PWGCF/EBYE/macros/drawCorrelationFunctionPsi.C b/PWGCF/EBYE/macros/drawCorrelationFunctionPsi.C index 152c854fead..04c93e4d3fc 100644 --- a/PWGCF/EBYE/macros/drawCorrelationFunctionPsi.C +++ b/PWGCF/EBYE/macros/drawCorrelationFunctionPsi.C @@ -17,7 +17,9 @@ void drawCorrelationFunctionPsi(const char* filename = "AnalysisResults.root", Double_t ptAssociatedMax = -1., Bool_t normToTrig = kFALSE, Int_t rebinEta = 1, - Int_t rebinPhi = 1) { + Int_t rebinPhi = 1, + TString eventClass = "EventPlane") //Can be "EventPlane", "Centrality", "Multiplicity" +{ //Macro that draws the correlation functions from the balance function //analysis vs the reaction plane //Author: Panos.Christakoglou@nikhef.nl @@ -75,7 +77,7 @@ void drawCorrelationFunctionPsi(const char* filename = "AnalysisResults.root", else draw(list,listShuffled,listMixed,listQA, gCentralityEstimator,gCentrality,psiMin,psiMax, - ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,normToTrig,rebinEta,rebinPhi); + ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax,normToTrig,rebinEta,rebinPhi,eventClass); } //______________________________________________________// @@ -131,6 +133,7 @@ TList *GetListOfObjects(const char* filename, listBF = dynamic_cast(dir->Get(listBFName.Data())); cout<<"======================================================="<GetName()<ls(); @@ -242,7 +245,7 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed, TList *listQA, Int_t gCentrality, Double_t psiMin, Double_t psiMax, Double_t ptTriggerMin, Double_t ptTriggerMax, Double_t ptAssociatedMin, Double_t ptAssociatedMax, - Bool_t normToTrig, Int_t rebinEta, Int_t rebinPhi) { + Bool_t normToTrig, Int_t rebinEta, Int_t rebinPhi,TString eventClass) { //Draws the correlation functions for every centrality bin //(+-), (-+), (++), (--) AliTHn *hP = NULL; @@ -271,9 +274,12 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed, TList *listQA, hNP = (AliTHn*) list->FindObject(gHistNPname.Data()); hPP = (AliTHn*) list->FindObject(gHistPPname.Data()); hNN = (AliTHn*) list->FindObject(gHistNNname.Data()); + hNN->Print(); + //Create the AliBalancePsi object and fill it with the AliTHn objects AliBalancePsi *b = new AliBalancePsi(); + b->SetEventClass(eventClass); b->SetHistNp(hP); b->SetHistNn(hN); b->SetHistNpn(hPN); @@ -318,6 +324,7 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed, TList *listQA, hNNShuffled->SetName("gHistNNShuffled"); AliBalancePsi *bShuffled = new AliBalancePsi(); + bShuffled->SetEventClass(eventClass); bShuffled->SetHistNp(hPShuffled); bShuffled->SetHistNn(hNShuffled); bShuffled->SetHistNpn(hPNShuffled); @@ -363,6 +370,7 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed, TList *listQA, hNNMixed->SetName("gHistNNMixed"); AliBalancePsi *bMixed = new AliBalancePsi(); + bMixed->SetEventClass(eventClass); bMixed->SetHistNp(hPMixed); bMixed->SetHistNn(hNMixed); bMixed->SetHistNpn(hPNMixed); @@ -417,17 +425,35 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed, TList *listQA, } //(+-) - histoTitle = "(+-) | Centrality: "; - histoTitle += centralityArray[gCentrality-1]; - histoTitle += "%"; - if((psiMin == -0.5)&&(psiMax == 0.5)) - histoTitle += " (-7.5^{o} < #varphi - #Psi_{2} < 7.5^{o})"; - else if((psiMin == 0.5)&&(psiMax == 1.5)) - histoTitle += " (37.5^{o} < #varphi - #Psi_{2} < 52.5^{o})"; - else if((psiMin == 1.5)&&(psiMax == 2.5)) - histoTitle += " (82.5^{o} < #varphi - #Psi_{2} < 97.5^{o})"; - else + if(eventClass == "Centrality"){ + histoTitle = "(+-) | Centrality: "; + histoTitle += psiMin; + histoTitle += " - "; + histoTitle += psiMax; + histoTitle += " % "; histoTitle += " (0^{o} < #varphi - #Psi_{2} < 180^{o})"; + } + else if(eventClass == "Multiplicity"){ + histoTitle = "(+-) | Multiplicity: "; + histoTitle += psiMin; + histoTitle += " - "; + histoTitle += psiMax; + histoTitle += " tracks"; + histoTitle += " (0^{o} < #varphi - #Psi_{2} < 180^{o})"; + } + else{ // "EventPlane" (default) + histoTitle = "(+-) | Centrality: "; + histoTitle += centralityArray[gCentrality-1]; + histoTitle += "%"; + if((psiMin == -0.5)&&(psiMax == 0.5)) + histoTitle += " (-7.5^{o} < #varphi - #Psi_{2} < 7.5^{o})"; + else if((psiMin == 0.5)&&(psiMax == 1.5)) + histoTitle += " (37.5^{o} < #varphi - #Psi_{2} < 52.5^{o})"; + else if((psiMin == 1.5)&&(psiMax == 2.5)) + histoTitle += " (82.5^{o} < #varphi - #Psi_{2} < 97.5^{o})"; + else + histoTitle += " (0^{o} < #varphi - #Psi_{2} < 180^{o})"; + } gHistPN[0] = b->GetCorrelationFunctionPN(psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax); if(rebinEta > 1 || rebinPhi > 1) gHistPN[0]->Rebin2D(rebinEta,rebinPhi); @@ -601,17 +627,35 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed, TList *listQA, } //(-+) - histoTitle = "(-+) | Centrality: "; - histoTitle += centralityArray[gCentrality-1]; - histoTitle += "%"; - if((psiMin == -0.5)&&(psiMax == 0.5)) - histoTitle += " (-7.5^{o} < #varphi - #Psi_{2} < 7.5^{o})"; - else if((psiMin == 0.5)&&(psiMax == 1.5)) - histoTitle += " (37.5^{o} < #varphi - #Psi_{2} < 52.5^{o})"; - else if((psiMin == 1.5)&&(psiMax == 2.5)) - histoTitle += " (82.5^{o} < #varphi - #Psi_{2} < 97.5^{o})"; - else + if(eventClass == "Centrality"){ + histoTitle = "(-+) | Centrality: "; + histoTitle += psiMin; + histoTitle += " - "; + histoTitle += psiMax; + histoTitle += " % "; + histoTitle += " (0^{o} < #varphi - #Psi_{2} < 180^{o})"; + } + else if(eventClass == "Multiplicity"){ + histoTitle = "(-+) | Multiplicity: "; + histoTitle += psiMin; + histoTitle += " - "; + histoTitle += psiMax; + histoTitle += " tracks"; histoTitle += " (0^{o} < #varphi - #Psi_{2} < 180^{o})"; + } + else{ // "EventPlane" (default) + histoTitle = "(-+) | Centrality: "; + histoTitle += centralityArray[gCentrality-1]; + histoTitle += "%"; + if((psiMin == -0.5)&&(psiMax == 0.5)) + histoTitle += " (-7.5^{o} < #varphi - #Psi_{2} < 7.5^{o})"; + else if((psiMin == 0.5)&&(psiMax == 1.5)) + histoTitle += " (37.5^{o} < #varphi - #Psi_{2} < 52.5^{o})"; + else if((psiMin == 1.5)&&(psiMax == 2.5)) + histoTitle += " (82.5^{o} < #varphi - #Psi_{2} < 97.5^{o})"; + else + histoTitle += " (0^{o} < #varphi - #Psi_{2} < 180^{o})"; + } gHistNP[0] = b->GetCorrelationFunctionNP(psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax); if(rebinEta > 1 || rebinPhi > 1) gHistNP[0]->Rebin2D(rebinEta,rebinPhi); @@ -787,17 +831,35 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed, TList *listQA, //(++) - histoTitle = "(++) | Centrality: "; - histoTitle += centralityArray[gCentrality-1]; - histoTitle += "%"; - if((psiMin == -0.5)&&(psiMax == 0.5)) - histoTitle += " (-7.5^{o} < #varphi - #Psi_{2} < 7.5^{o})"; - else if((psiMin == 0.5)&&(psiMax == 1.5)) - histoTitle += " (37.5^{o} < #varphi - #Psi_{2} < 52.5^{o})"; - else if((psiMin == 1.5)&&(psiMax == 2.5)) - histoTitle += " (82.5^{o} < #varphi - #Psi_{2} < 97.5^{o})"; - else + if(eventClass == "Centrality"){ + histoTitle = "(++) | Centrality: "; + histoTitle += psiMin; + histoTitle += " - "; + histoTitle += psiMax; + histoTitle += " % "; + histoTitle += " (0^{o} < #varphi - #Psi_{2} < 180^{o})"; + } + else if(eventClass == "Multiplicity"){ + histoTitle = "(++) | Multiplicity: "; + histoTitle += psiMin; + histoTitle += " - "; + histoTitle += psiMax; + histoTitle += " tracks"; histoTitle += " (0^{o} < #varphi - #Psi_{2} < 180^{o})"; + } + else{ // "EventPlane" (default) + histoTitle = "(++) | Centrality: "; + histoTitle += centralityArray[gCentrality-1]; + histoTitle += "%"; + if((psiMin == -0.5)&&(psiMax == 0.5)) + histoTitle += " (-7.5^{o} < #varphi - #Psi_{2} < 7.5^{o})"; + else if((psiMin == 0.5)&&(psiMax == 1.5)) + histoTitle += " (37.5^{o} < #varphi - #Psi_{2} < 52.5^{o})"; + else if((psiMin == 1.5)&&(psiMax == 2.5)) + histoTitle += " (82.5^{o} < #varphi - #Psi_{2} < 97.5^{o})"; + else + histoTitle += " (0^{o} < #varphi - #Psi_{2} < 180^{o})"; + } gHistPP[0] = b->GetCorrelationFunctionPP(psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax); if(rebinEta > 1 || rebinPhi > 1) gHistPP[0]->Rebin2D(rebinEta,rebinPhi); @@ -972,17 +1034,35 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed, TList *listQA, } //(--) - histoTitle = "(--) | Centrality: "; - histoTitle += centralityArray[gCentrality-1]; - histoTitle += "%"; - if((psiMin == -0.5)&&(psiMax == 0.5)) - histoTitle += " (-7.5^{o} < #varphi - #Psi_{2} < 7.5^{o})"; - else if((psiMin == 0.5)&&(psiMax == 1.5)) - histoTitle += " (37.5^{o} < #varphi - #Psi_{2} < 52.5^{o})"; - else if((psiMin == 1.5)&&(psiMax == 2.5)) - histoTitle += " (82.5^{o} < #varphi - #Psi_{2} < 97.5^{o})"; - else + if(eventClass == "Centrality"){ + histoTitle = "(--) | Centrality: "; + histoTitle += psiMin; + histoTitle += " - "; + histoTitle += psiMax; + histoTitle += " % "; + histoTitle += " (0^{o} < #varphi - #Psi_{2} < 180^{o})"; + } + else if(eventClass == "Multiplicity"){ + histoTitle = "(--) | Multiplicity: "; + histoTitle += psiMin; + histoTitle += " - "; + histoTitle += psiMax; + histoTitle += " tracks"; histoTitle += " (0^{o} < #varphi - #Psi_{2} < 180^{o})"; + } + else{ // "EventPlane" (default) + histoTitle = "(--) | Centrality: "; + histoTitle += centralityArray[gCentrality-1]; + histoTitle += "%"; + if((psiMin == -0.5)&&(psiMax == 0.5)) + histoTitle += " (-7.5^{o} < #varphi - #Psi_{2} < 7.5^{o})"; + else if((psiMin == 0.5)&&(psiMax == 1.5)) + histoTitle += " (37.5^{o} < #varphi - #Psi_{2} < 52.5^{o})"; + else if((psiMin == 1.5)&&(psiMax == 2.5)) + histoTitle += " (82.5^{o} < #varphi - #Psi_{2} < 97.5^{o})"; + else + histoTitle += " (0^{o} < #varphi - #Psi_{2} < 180^{o})"; + } gHistNN[0] = b->GetCorrelationFunctionNN(psiMin,psiMax,ptTriggerMin,ptTriggerMax,ptAssociatedMin,ptAssociatedMax); if(rebinEta > 1 || rebinPhi > 1) gHistNN[0]->Rebin2D(rebinEta,rebinPhi); @@ -1157,13 +1237,24 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed, TList *listQA, } //Write to output file - TString newFileName = "correlationFunction.Centrality"; - newFileName += gCentrality; newFileName += ".Psi"; - if((psiMin == -0.5)&&(psiMax == 0.5)) newFileName += "InPlane.Ptt"; - else if((psiMin == 0.5)&&(psiMax == 1.5)) newFileName += "Intermediate.Ptt"; - else if((psiMin == 1.5)&&(psiMax == 2.5)) newFileName += "OutOfPlane.Ptt"; - else if((psiMin == 2.5)&&(psiMax == 3.5)) newFileName += "Rest.PttFrom"; - else newFileName += "All.PttFrom"; + TString newFileName = "correlationFunction."; + if(eventClass == "Centrality"){ + newFileName += Form("Centrality%.1fTo%.1f",psiMin,psiMax); + newFileName += ".PsiAll.PttFrom"; + } + else if(eventClass == "Multiplicity"){ + newFileName += Form("Multiplicity%.0fTo%.0f",psiMin,psiMax); + newFileName += ".PsiAll.PttFrom"; + } + else{ // "EventPlane" (default) + newFileName += "Centrality"; + newFileName += gCentrality; newFileName += ".Psi"; + if((psiMin == -0.5)&&(psiMax == 0.5)) newFileName += "InPlane.Ptt"; + else if((psiMin == 0.5)&&(psiMax == 1.5)) newFileName += "Intermediate.Ptt"; + else if((psiMin == 1.5)&&(psiMax == 2.5)) newFileName += "OutOfPlane.Ptt"; + else if((psiMin == 2.5)&&(psiMax == 3.5)) newFileName += "Rest.PttFrom"; + else newFileName += "All.PttFrom"; + } newFileName += Form("%.1f",ptTriggerMin); newFileName += "To"; newFileName += Form("%.1f",ptTriggerMax); newFileName += "PtaFrom"; newFileName += Form("%.1f",ptAssociatedMin); newFileName += "To"; -- 2.39.3