]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGGA/EMCALTasks/macros/AddTaskTrgContam.C
fixing the error message
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / macros / AddTaskTrgContam.C
1 AliAnalysisTaskTrgContam *AddTaskTrgContam(Double_t trgThresh=4.8, Double_t exoticCut=0.97)
2 {
3   // Get the pointer to the existing analysis manager via the static access method.
4   //==============================================================================
5   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
6   if (!mgr) {
7     ::Error("AddTaskTrgContam", "No analysis manager to connect to.");
8     return NULL;
9   }  
10   
11   // Create the task and configure it.
12   //===========================================================================
13   AliAnalysisTaskTrgContam* ana = new  AliAnalysisTaskTrgContam("");
14   
15   ana->SelectCollisionCandidates( AliVEvent::kEMC1 | AliVEvent::kMB | AliVEvent::kEMC7 | AliVEvent::kINT7);
16   
17   Bool_t isMC = (mgr->GetMCtruthEventHandler() != NULL);
18   if (isMC)
19     return 0x0;
20
21   ana->SetTrigThresh(trgThresh);
22   ana->SetExotCut(exoticCut);
23   
24   mgr->AddTask(ana);
25   
26   // Create ONLY the output containers for the data produced by the task.
27   // Get and connect other common input/output containers via the manager as below
28   //==============================================================================
29   AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("histosTrgContam", TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s", AliAnalysisManager::GetCommonFileName()));
30   
31   mgr->ConnectInput  (ana, 0, mgr->GetCommonInputContainer());
32   mgr->ConnectOutput (ana, 1, coutput1 );
33    
34   return ana;
35 }