]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
adding away side subtraction for 2D correlation functions
authormiweber <miweber@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Dec 2012 10:21:52 +0000 (10:21 +0000)
committermiweber <miweber@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Dec 2012 10:21:52 +0000 (10:21 +0000)
PWGCF/EBYE/macros/AddAliHigherMomentsToyModelTask.C [new file with mode: 0644]
PWGCF/EBYE/macros/drawCorrelationFunctionPsiChargeIndependent.C

diff --git a/PWGCF/EBYE/macros/AddAliHigherMomentsToyModelTask.C b/PWGCF/EBYE/macros/AddAliHigherMomentsToyModelTask.C
new file mode 100644 (file)
index 0000000..9ff375b
--- /dev/null
@@ -0,0 +1,84 @@
+//=========================================================================//
+//                                                                         //
+//           Analysis AddTask for Net-Charge Higher Moment Analysis        //
+//              Author: Satyajit Jena || Nirbhay K. Behera                 //
+//                      sjena@cern.ch || nbehera@cern.ch                   //
+//                                                                         //
+//=========================================================================//
+TString fileNameBase="AnalysisResults.root";
+
+//const char* analysisType        = "MCAOD"; // MC, ESD, AOD
+const char* centralityEstimator = "V0M"; // V0M, TRK, FMD, ....
+
+//_________________________________________________________//
+
+AliAnalysisTask* AddAliHigherMomentsToyModelTask(Double_t vx,
+                                                Double_t vy,
+                                                Double_t vz,
+                                                Double_t dcaxy,
+                                                Double_t dcaz,
+                                                Double_t ptl,
+                                                Double_t pth,
+                                                Double_t eta,
+                                                Double_t rapidity,
+                                                Int_t    nclus,
+                                                Double_t chi2ndf,
+                                                TString particle,
+                                                Double_t nsigma,
+                                                Int_t AODfilterBit = 128,
+                                                Bool_t usepid,
+                                                TString  analysis) {
+  
+  
+  TString taskname = "HMMCQA";
+  TString taskname1 = "HMToyModel";
+  
+  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
+  if (!mgr) {
+    ::Error("AddTaskFluctuations", "No analysis manager to connect to.");
+    return NULL;
+  }
+  
+  if (!mgr->GetInputEventHandler()) {
+    ::Error("AddTaskFluctuations", "This task requires an input event handler");
+    return NULL;
+  }
+  TString type = mgr->GetInputEventHandler()->GetDataType(); 
+  
+  AliHigherMomentsToyModel *taskHM = new AliHigherMomentsToyModel("HigherMomentsTask");
+  taskHM->SetVertexDiamond(vx,vy,vz);
+  taskHM->SetCentralityEstimator(centralityEstimator);
+  taskHM->SetAnalysisType(analysis);
+  taskHM->SetDCA(dcaxy, dcaz);
+  taskHM->SetPtRange(ptl,pth);
+  taskHM->SetEta(eta);
+  taskHM->SetTPCNclus(nclus);
+  taskHM->SetChi2PerNDF(chi2ndf);
+  taskHM->SetAODtrackCutBit(AODfilterBit);
+  taskHM->SetKinematicsCutsAOD(ptl,pth,eta);
+  taskHM->SetUsePid(usepid);
+  
+  
+  if( usepid ){
+    taskHM->SetNSigmaCut(nsigma);
+    taskHM->SetRapidityCut(rapidity);
+    if( particle == "Proton" ){  taskHM->SetParticleSpecies(AliPID::kProton); }
+    else if( particle == "Kaon") { taskHM->SetParticleSpecies(AliPID::kKaon); }
+    else if( particle == "Pion" ){ taskHM->SetParticleSpecies(AliPID::kPion); }
+  }
+  // cout << " Check analysis type " << analysisType << endl;
+  
+  mgr->AddTask(taskHM);
+  
+  AliAnalysisDataContainer *coutQA = mgr->CreateContainer(taskname.Data(), 
+                                                         TList::Class(),
+                                                         AliAnalysisManager::kOutputContainer,fileNameBase.Data());
+  AliAnalysisDataContainer *coutFA = mgr->CreateContainer(taskname1.Data(), 
+                                                         TList::Class(),
+                                                         AliAnalysisManager::kOutputContainer,fileNameBase.Data());
+  mgr->ConnectInput(taskHM, 0, mgr->GetCommonInputContainer());
+  mgr->ConnectOutput(taskHM, 1, coutQA);
+  mgr->ConnectOutput(taskHM, 2, coutFA);
+  
+  return taskHM;
+}
index 2d5504f687539ccb4d41266ec743595d66866a6f..9c4b219119e2f5fbb292fd074a7afa8d0008c3bb 100644 (file)
@@ -1,5 +1,5 @@
-const Int_t numberOfCentralityBins = 9;
-TString centralityArray[numberOfCentralityBins] = {"0-10","10-20","20-30","30-40","40-50","50-60","60-70","70-80","0-100"};
+const Int_t numberOfCentralityBins = 12;
+TString centralityArray[numberOfCentralityBins] = {"0-10","10-20","20-30","30-40","40-50","50-60","60-70","70-80","0-100","0-1","1-2","2-3"};
 
 const Int_t gRebin = 1;
 
@@ -343,9 +343,9 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed,
     bMixed->SetHistNnn(hNNMixed);
   }
 
-  TH2D *gHist[4];
+  TH2D *gHist[6];
   
-  TCanvas *c[4];
+  TCanvas *c[6];
   TString histoTitle, pngName;
   
   // all charges together
@@ -471,6 +471,31 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed,
     pngName += ".Psi"; pngName += psiMin; pngName += "To"; pngName += psiMax;
     pngName += ".PositiveNegative.png";
     //c[3]->SaveAs(pngName.Data());
+
+    //Correlation function subtracted awayside (+-)
+    gHist[4] = dynamic_cast<TH2D *>(gHist[3]->Clone()); // this will be used to imitate twice the away-side
+    gHist[4]->GetXaxis()->SetRangeUser(-1.5,1.5);
+    gHist[4]->GetZaxis()->SetTitle("C_{+-}(#Delta#eta,#Delta#varphi)");
+    gHist[5] = dynamic_cast<TH2D *>(gHist[3]->Clone()); // this will be the subtracted one
+    gHist[5]->GetXaxis()->SetRangeUser(-1.5,1.5);
+    gHist[5]->GetZaxis()->SetTitle("C_{+-}(#Delta#eta,#Delta#varphi)");
+
+    //prepare the double away side histo
+    for(Int_t ix = 0; ix < gHist[4]->GetNbinsX(); ix++ ){
+      for(Int_t iy = 0; iy < gHist[4]->GetNbinsX(); iy++ ){
+       if(iy<gHist[4]->GetNbinsY()/2) gHist[4]->SetBinContent(ix+1,iy+1,gHist[4]->GetBinContent(ix+1,iy+1+gHist[4]->GetNbinsY()/2));
+      }
+    }
+    gHist[5]->Add(gHist[4],-1);
+
+    c[4] = new TCanvas("c3","",0,300,600,500);
+    c[4]->SetFillColor(10); 
+    c[4]->SetHighLightColor(10);
+    gHist[5]->DrawCopy("surf1fb");
+    gPad->SetTheta(30); // default is 30
+    //gPad->SetPhi(130); // default is 30
+    gPad->SetPhi(-60); // default is 30
+    gPad->Update();    
   }
 
   //Write to output file
@@ -494,20 +519,22 @@ void draw(TList *list, TList *listBFShuffled, TList *listBFMixed,
   if(listBFMixed) {
     gHist[2]->SetName("gHistMixed"); gHist[2]->Write();
 
-    gHist[3]->SetName("gHistCorrelationFunctions"); gHist[3]->Write();
+    gHist[3]->SetName("gHistCorrelationFunctions");gHist[3]->Write();
+    gHist[4]->SetName("gHistCorrelationFunctionsAwaySide"); gHist[4]->Write();
+    gHist[5]->SetName("gHistCorrelationFunctionsSubtracted"); gHist[5]->Write();
   }
   newFile->Close();
 
-  // some cleaning
-  for(Int_t i = 0; i < 4; i++){
+  // // some cleaning
+  // for(Int_t i = 0; i < 6; i++){
 
-    if(!listBFShuffled && i == 1) continue;
-    if(!listBFMixed && (i == 2 || i == 3)) continue;
+  //   if(!listBFShuffled && i == 1) continue;
+  //   if(!listBFMixed && (i == 2 || i == 3 || i == 4 || i == 5)) continue;
 
-    if(gHist[i]) delete gHist[i];
+  //   if(gHist[i]) delete gHist[i];
     
-    if(c[i]) delete c[i];
-  }
+  //   if(c[i]) delete c[i];
+  // }
 
   delete hP;
   delete hN;