Update macro for Muon-Hadron correlation efficiency code (Saehanseul Oh <saehanseul...
[u/mrichter/AliRoot.git] / PWGCF / Correlations / DPhi / FourierDecomposition / AddTaskMuonEffMC.C
index 8e3628613de250d795d92f04873ed2a011b7cb06..fc3f1e969fd2026f11df86058d565ee94d1e6feb 100644 (file)
@@ -1,5 +1,6 @@
 
-AliMuonEffMC* AddTaskMuonEFFMC(Bool_t MDProcess = kTRUE,
+AliMuonEffMC* AddTaskMuonEffMC(Bool_t MDProcess = kTRUE,
+                              Bool_t IsMc = kTRUE,
                               TString centralityEstimator = "V0M",
                               const Int_t NEtaBins = 15,
                               const Int_t NpTBins = 100,
@@ -26,17 +27,12 @@ AliMuonEffMC* AddTaskMuonEFFMC(Bool_t MDProcess = kTRUE,
     return NULL;
   }
 
-  TString analysisType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
-  if(dynamic_cast<AliMCEventHandler*> (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler())) analysisType = "MC";
-
-  Bool_t IsMc = kTRUE;
-  if (analysisType !="MC") IsMc = kFALSE;
-
   //-------------------------------------------------------
   // Init the task and do settings
   //-------------------------------------------------------
 
   AliMuonEffMC *MuonEff = new AliMuonEffMC("MuonEffMC");
+
   MuonEff->SetMcAna(IsMc);
   MuonEff->SetMDProcess(MDProcess);
   MuonEff->SetCentEstimator(centralityEstimator);
@@ -58,8 +54,7 @@ AliMuonEffMC* AddTaskMuonEFFMC(Bool_t MDProcess = kTRUE,
   AliAnalysisDataContainer *coutputpt = mgr->CreateContainer(Form("MuonEff_%s",centralityEstimator.Data()), 
                                                              TList::Class(), 
                                                              AliAnalysisManager::kOutputContainer, 
-                                                             Form("%s:%s", outputFileName, folderName)););
-
+                                                             Form("%s:%s", outputFileName, folderName));
   // Connect input/output
   mgr->ConnectInput(MuonEff, 0, cinput);
   mgr->ConnectOutput(MuonEff, 1, coutputpt);