]>
Commit | Line | Data |
---|---|---|
1263f837 | 1 | // $Id$ |
2 | ||
3 | AliEmcalPicoTrackInGridMaker* AddTaskGridMaker( | |
4 | const char *inname = "PicoTracks", | |
5 | const char *taskName = "AliEmcalPicoTrackInGridMaker" | |
6 | ) | |
7 | { | |
8 | // Get the pointer to the existing analysis manager via the static access method. | |
9 | //============================================================================== | |
10 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
11 | if (!mgr) | |
12 | { | |
13 | ::Error("AddTaskEmcalPicoTrackFromJetMaker", "No analysis manager to connect to."); | |
14 | return NULL; | |
15 | } | |
16 | ||
17 | // Check the analysis type using the event handlers connected to the analysis manager. | |
18 | //============================================================================== | |
19 | if (!mgr->GetInputEventHandler()) | |
20 | { | |
21 | ::Error("AddTaskEmcalPicoTrackFromJetMaker", "This task requires an input event handler"); | |
22 | return NULL; | |
23 | } | |
24 | ||
25 | TString wagonName = Form("%s",taskName); | |
1263f837 | 26 | |
27 | //------------------------------------------------------- | |
28 | // Init the task and do settings | |
29 | //------------------------------------------------------- | |
30 | ||
31 | AliEmcalPicoTrackInGridMaker *eTask = new AliEmcalPicoTrackInGridMaker(taskName); | |
56a05107 | 32 | eTask->AddParticleContainer(inname); |
1263f837 | 33 | |
34 | //------------------------------------------------------- | |
35 | // Final settings, pass to manager and set the containers | |
36 | //------------------------------------------------------- | |
37 | mgr->AddTask(eTask); | |
38 | ||
39 | // Create containers for input/output | |
40 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); | |
41 | mgr->ConnectInput(eTask, 0, cinput1 ); | |
42 | ||
43 | //Connect output | |
44 | TString contName(wagonName); | |
45 | TString outputfile = Form("%s",AliAnalysisManager::GetCommonFileName()); | |
46 | Printf("outputfile: %s",outputfile.Data()); | |
47 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contName.Data(), TList::Class(),AliAnalysisManager::kOutputContainer,outputfile); | |
48 | mgr->ConnectOutput(eTask,1,coutput1); | |
49 | ||
50 | return eTask; | |
51 | } |