]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG4/macros/AddTaskFragmentationFunction.C
Write Calo QA output to a separate file
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskFragmentationFunction.C
1 AliAnalysisTaskFragmentationFunction *AddTaskFragmentationFunction(UInt_t filterMask = 0,Int_t iPhysicsSelection)
2 {
3 // Creates a jet fider 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("AddTaskFragmentationFunction", "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("AddTaskMyDyJets", "This task requires an input event handler");
17       return NULL;
18    }
19
20    // Create the task and configure it.
21    //===========================================================================
22    
23    AliAnalysisTaskFragmentationFunction* pwg4dijets = new  AliAnalysisTaskFragmentationFunction("Fragmentation Function Study");
24       
25    pwg4dijets->SetBranchGen("jetsMC"); 
26    pwg4dijets->SetBranchRec("jets"); 
27    //   pwg4dijets->SetBranchRec("jetsUA1AOD");
28    pwg4dijets->SetLimitGenJetEta(0);
29    pwg4dijets->SetFilterMask(filterMask); 
30     if(iPhysicsSelection) pwg4dijets->SelectCollisionCandidates();
31    mgr->AddTask(pwg4dijets);
32    
33
34
35
36       
37    // Create ONLY the output containers for the data produced by the task.
38    // Get and connect other common input/output containers via the manager as below
39    //==============================================================================
40    AliAnalysisDataContainer *coutput1_FF = mgr->CreateContainer("PWG4_FF", TList::Class(),AliAnalysisManager::kOutputContainer,"PWG4_FF.root");
41
42    mgr->ConnectInput  (pwg4dijets, 0, mgr->GetCommonInputContainer());
43    mgr->ConnectOutput (pwg4dijets, 0, mgr->GetCommonOutputContainer());
44    mgr->ConnectOutput (pwg4dijets,  1, coutput1_FF );
45    
46    return pwg4dijets;
47 }