]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/macros/AddTaskPHOSPi0Calib.C
adding TPC cosntrained tracks back in for comparison
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskPHOSPi0Calib.C
1 AliAnalysisTaskPHOSPi0CalibSelection *AddTaskPHOSPi0Calib()
2 {
3   // Creates a PartCorr task, configures it and adds it to the analysis manager.
4   
5   // Get the pointer to the existing analysis manager via the static access method.
6   //==============================================================================
7   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
8   if (!mgr) {
9     ::Error("AddTaskPartCorr", "No analysis manager to connect to.");
10     return NULL;
11   }  
12   
13   // Check the analysis type using the event handlers connected to the analysis manager.
14   //==============================================================================
15   if (!mgr->GetInputEventHandler()) {
16     ::Error("AddTaskPartCorr", "This task requires an input event handler");
17     return NULL;
18   }
19
20    //TString dataType = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"  
21    // Configure analysis
22    //===========================================================================
23     
24    // Create task
25    //===========================================================================
26
27   AliAnalysisTaskPHOSPi0CalibSelection * pi0calib = new AliAnalysisTaskPHOSPi0CalibSelection ("PHOSPi0Calibration");
28   mgr->AddTask(pi0calib);
29   
30   
31   // Create ONLY the output containers for the data produced by the task.
32   // Get and connect other common input/output containers via the manager as below
33   //==============================================================================
34   
35  AliAnalysisDataContainer *coutput = 
36     mgr->CreateContainer("PHOSPi0Calib", TList::Class(), AliAnalysisManager::kOutputContainer, "PHOSPi0Calib.root");
37
38   mgr->ConnectInput  (pi0calib, 0, mgr->GetCommonInputContainer());
39   mgr->ConnectOutput (pi0calib, 1, coutput);
40   
41   return pi0calib;
42 }
43
44