]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/FLOW/macros/AddTaskFlow.C
All formulas now work for any case of the overlap between POI1, POI2 and RP in the...
[u/mrichter/AliRoot.git] / PWG2 / FLOW / macros / AddTaskFlow.C
index be0da42c965d2c0c74280cab51f399942ebf74f0..8cda4e4ff01dfb071deabf94c8597cdee13515c2 100644 (file)
@@ -8,11 +8,23 @@
 /////////////////////////////////////////////////////////////////////////////////////////////
 
 // Define the range for eta subevents (for SP method)
+//-----(FMD 1.7 - 5.0)-----
+//Double_t minA = -5.0;
+//Double_t maxA = -1.7;
+//Double_t minB = 1.7;
+//Double_t maxB = 5.0;
+//-----(Tracklets 0.9 - 2.0)-----
+//Double_t minA = -2.0;
+//Double_t maxA = -0.9;
+//Double_t minB = 0.9;
+//Double_t maxB = 2.0;
+//-----(Global 0.5 - 0.9)-----
 Double_t minA = -0.9;
-Double_t maxA = -0.1;
-Double_t minB = 0.1;
+Double_t maxA = -0.5;
+Double_t minB = 0.5;
 Double_t maxB = 0.9;
 
+
 // use physics selection class
 Bool_t  UsePhysicsSelection = kTRUE;
 
@@ -43,6 +55,12 @@ const Int_t multmax = 10000;     //used for AliFlowEventSimple (to set the centr
 
 
 //----------For RP selection----------
+// Use Global tracks ("Global"), or SPD tracklets ("Tracklet") 
+// or FMD hits ("FMD") for the RP selection
+const TString rptype = "Global";
+//const TString rptype = "Tracklet";
+//const TString rptype = "FMD";
+
 //KINEMATICS (on generated and reconstructed tracks)
 Bool_t UseKineforRP =  kTRUE;
 const Double_t ptminRP = 0.0;
@@ -103,8 +121,8 @@ const Int_t  minTrackrefsMuonRP = 0;
 Bool_t UseKineforPOI = kTRUE;
 const Double_t ptminPOI = 0.0;
 const Double_t ptmaxPOI = 10.0;
-const Double_t etaminPOI  = -0.9;
-const Double_t etamaxPOI  = 0.9;
+const Double_t etaminPOI  = -0.5;
+const Double_t etamaxPOI  = 0.5;
 const Int_t    chargePOI = 1;  //not used
 const Bool_t   isChargedPOI = kTRUE;
 
@@ -298,17 +316,33 @@ AliAnalysisTaskFlowEvent* AddTaskFlow(TString type, Bool_t* METHODS, Bool_t QA,
     cout<<"LYZEP input file/list read..."<<endl;
   }
   
-
+  
+  // Create the FMD task and add it to the manager
+  //===========================================================================
+  if (rptype == "FMD") {
+    AliFMDAnalysisTaskSE *taskfmd = NULL;
+    if (rptype == "FMD") {
+      taskfmd = new AliFMDAnalysisTaskSE("TaskFMD");
+      mgr->AddTask(taskfmd);
+  
+      AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
+      pars->Init();
+      pars->SetProcessPrimary(kTRUE);
+      pars->SetProcessHits(kFALSE);
+    }
+  }
+  
 
   // Create the task, add it to the manager.
   //===========================================================================
   AliAnalysisTaskFlowEvent *taskFE = NULL;
   if (QA) { 
     if(AddToEvent) { 
-      taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",kTRUE,1);
+      taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",rptype,kTRUE,1);
       taskFE->SetEllipticFlowValue(ellipticFlow); }    //TEST
-    else {taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",kTRUE); }
+    else {taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",rptype,kTRUE); }
     taskFE->SetAnalysisType(type);
+    taskFE->SetRPType(rptype); //only for ESD
     if (UseMultCut) {
       taskFE->SetMinMult(multmin);
       taskFE->SetMaxMult(multmax);
@@ -322,9 +356,9 @@ AliAnalysisTaskFlowEvent* AddTaskFlow(TString type, Bool_t* METHODS, Bool_t QA,
   }
   else { 
     if(AddToEvent) { 
-      taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",kFALSE,1);
+      taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",rptype,kFALSE,1);
       taskFE->SetEllipticFlowValue(ellipticFlow); }    //TEST
-    else {taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",kFALSE); }
+    else {taskFE = new AliAnalysisTaskFlowEvent("TaskFlowEvent",rptype,kFALSE); }
     taskFE->SetAnalysisType(type);
     if (UseMultCut) {
       taskFE->SetMinMult(multmin);
@@ -657,7 +691,8 @@ AliAnalysisTaskFlowEvent* AddTaskFlow(TString type, Bool_t* METHODS, Bool_t QA,
   //===========================================================================
   if (SP){
     AliAnalysisTaskScalarProduct *taskSP = new AliAnalysisTaskScalarProduct("TaskScalarProduct",WEIGHTS[0]);
-    taskSP->SetRelDiffMsub(0.1);
+    taskSP->SetRelDiffMsub(1.0);
+    taskSP->SetApplyCorrectionForNUA(kFALSE);
     mgr->AddTask(taskSP);
   }
   if (LYZ1SUM){
@@ -719,21 +754,22 @@ AliAnalysisTaskFlowEvent* AddTaskFlow(TString type, Bool_t* METHODS, Bool_t QA,
   }
   if (MH){
     AliAnalysisTaskMixedHarmonics *taskMH = new AliAnalysisTaskMixedHarmonics("TaskMixedHarmonics",useWeights);
-    taskMH->SetCorrelatorInteger(1);
+    taskMH->SetHarmonic(1); // n in cos[n(phi1+phi2-2phi3)] and cos[n(psi1+psi2-2phi3)]
     taskMH->SetNoOfMultipicityBins(10);
     taskMH->SetMultipicityBinWidth(2);
     taskMH->SetMinMultiplicity(3);
     taskMH->SetCorrectForDetectorEffects(kTRUE);
-    //taskMH->SetUsePhiWeights(WEIGHTS[0]); 
-    //taskMH->SetUsePtWeights(WEIGHTS[1]);
-    //taskMH->SetUseEtaWeights(WEIGHTS[2]); 
+    taskMH->SetEvaluateDifferential3pCorrelator(kFALSE); // evaluate <<cos[n(psi1+psi2-2phi3)]>> (Remark: two nested loops)    
+    taskMH->SetOppositeChargesPOI(kFALSE); // POIs psi1 and psi2 in cos[n(psi1+psi2-2phi3)] will have opposite charges  
     mgr->AddTask(taskMH);
   }  
   if (NL){
     AliAnalysisTaskNestedLoops *taskNL = new AliAnalysisTaskNestedLoops("TaskNestedLoops",useWeights);
-    //taskNL->SetUsePhiWeights(WEIGHTS[0]); 
-    //taskNL->SetUsePtWeights(WEIGHTS[1]);
-    //taskNL->SetUseEtaWeights(WEIGHTS[2]); 
+    taskNL->SetHarmonic(1); // n in cos[n(phi1+phi2-2phi3)] and cos[n(psi1+psi2-2phi3)]
+    taskNL->SetEvaluateNestedLoopsForRAD(kTRUE); // RAD = Relative Angle Distribution
+    taskNL->SetEvaluateNestedLoopsForMH(kTRUE); // evalaute <<cos[n(phi1+phi2-2phi3)]>> (Remark: three nested loops)   
+    taskNL->SetEvaluateDifferential3pCorrelator(kFALSE); // evaluate <<cos[n(psi1+psi2-2phi3)]>>  (Remark: three nested loops)   
+    taskNL->SetOppositeChargesPOI(kFALSE); // POIs psi1 and psi2 in cos[n(psi1+psi2-2phi3)] will have opposite charges  
     mgr->AddTask(taskNL);
   }
   
@@ -741,7 +777,19 @@ AliAnalysisTaskFlowEvent* AddTaskFlow(TString type, Bool_t* METHODS, Bool_t QA,
   // Connect to the input and output containers
   //===========================================================================
   AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
-  AliAnalysisDataContainer *coutputFE = mgr->CreateContainer("cobjFlowEventSimple",  AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer);
+  
+  if (rptype == "FMD") {
+    AliAnalysisDataContainer *coutputFMD = 
+      mgr->CreateContainer("BackgroundCorrected", TList::Class(), AliAnalysisManager::kExchangeContainer);                        
+    //input and output taskFMD     
+    mgr->ConnectInput(taskfmd, 0, cinput1);
+    mgr->ConnectOutput(taskfmd, 1, coutputFMD);
+    //input into taskFE
+    mgr->ConnectInput(taskFE,1,coutputFMD);
+  }
+  
+  AliAnalysisDataContainer *coutputFE = 
+    mgr->CreateContainer("cobjFlowEventSimple",  AliFlowEventSimple::Class(),AliAnalysisManager::kExchangeContainer);
   mgr->ConnectInput(taskFE,0,cinput1); 
   mgr->ConnectOutput(taskFE,1,coutputFE);