]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGGA/EMCALTasks/macros/AddTaskEMCALIsoPhoton.C
parametrizing the output containers names according to trigger type
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / macros / AddTaskEMCALIsoPhoton.C
index bd5c2db657ec53747c2efddd160bb3fe3af43253..42c47c1a254e4930bb4548e9b2089717b5b37182 100644 (file)
@@ -3,6 +3,7 @@
 AliAnalysisTaskEMCALIsoPhoton *AddTaskEMCALIsoPhoton(
                                                     TString period = "LHC11d",
                                                     TString trigbitname = "kEMC7",
+                                                    TString geoname="EMCAL_COMPLETEV1",
                                                     TString pathstrsel = "/"
                                                     )
 {
@@ -42,23 +43,29 @@ AliAnalysisTaskEMCALIsoPhoton *AddTaskEMCALIsoPhoton(
   cutsp->SetEtaRange(-1.0,1.0);
   ana->SetPrimTrackCuts(cutsp);
   ana->SetPeriod(period.Data());
-  if(period.Contains("11"))
-    ana->SetGeoName("EMCAL_COMPLETEV1");
-  else
-    ana->SetGeoName("EMCAL_FIRSTYEARV1");
-
-  
+  ana->SetGeoName(geoname.Data());  
   mgr->AddTask(ana);
+  TString containername = "histEMCIsoPhoton."+trigbitname;
+  TString containernameQA = "histosQA."+trigbitname;
+  if(pathstrsel != "/"){
+    TString dirpth = (TSubString)pathstrsel.operator()(1,1);
+    containername += dirpth;
+    containernameQA  += dirpth;
+  }
   
   // Create ONLY the output containers for the data produced by the task.
   // Get and connect other common input/output containers via the manager as below
   //==============================================================================
-  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("histosEMCALIsoPhoton", 
+  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(containername.Data(), 
+                                                           TList::Class(),AliAnalysisManager::kOutputContainer,
+                                                           Form("%s", AliAnalysisManager::GetCommonFileName()));
+  AliAnalysisDataContainer *coutput2 = mgr->CreateContainer(containernameQA.Data(), 
                                                            TList::Class(),AliAnalysisManager::kOutputContainer,
                                                            Form("%s", AliAnalysisManager::GetCommonFileName()));
   
   mgr->ConnectInput  (ana, 0, mgr->GetCommonInputContainer());
   mgr->ConnectOutput (ana, 1, coutput1 );
+  mgr->ConnectOutput (ana, 2, coutput2 );
    
   return ana;
 }