]>
Commit | Line | Data |
---|---|---|
3f85ae73 | 1 | // $Id$ |
2 | ||
3 | AliJetModelCopyTracks* AddTaskModelCopyTracks( | |
4 | const char *tracksName1 = "Tracks", | |
5 | const char *tracksName2 = "Tracks2", | |
6 | Int_t massType = AliJetModelCopyTracks::kMassless, | |
7 | const char *taskName = "JetModelCopyTracks" | |
8 | ) | |
9 | { | |
10 | // Get the pointer to the existing analysis manager via the static access method. | |
11 | //============================================================================== | |
12 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
13 | if (!mgr) | |
14 | { | |
15 | ::Error("AddTaskModelCopyTracks", "No analysis manager to connect to."); | |
16 | return NULL; | |
17 | } | |
18 | ||
19 | // Check the analysis type using the event handlers connected to the analysis manager. | |
20 | //============================================================================== | |
21 | if (!mgr->GetInputEventHandler()) | |
22 | { | |
23 | ::Error("AddTaskModelCopyTracks", "This task requires an input event handler"); | |
24 | return NULL; | |
25 | } | |
26 | ||
27 | //------------------------------------------------------- | |
28 | // Init the task and do settings | |
29 | //------------------------------------------------------- | |
30 | ||
31 | AliJetModelCopyTracks *copyTask = new AliJetModelCopyTracks(taskName); | |
32 | copyTask->SetTracksName(tracksName1); | |
33 | copyTask->SetTracksOutName(tracksName2); | |
3c923384 | 34 | copyTask->SetParticleMassType(massType); |
3f85ae73 | 35 | |
36 | //------------------------------------------------------- | |
37 | // Final settings, pass to manager and set the containers | |
38 | //------------------------------------------------------- | |
39 | mgr->AddTask(copyTask); | |
40 | ||
41 | // Create containers for input/output | |
42 | mgr->ConnectInput (copyTask, 0, mgr->GetCommonInputContainer() ); | |
43 | ||
44 | TString contName = taskName; | |
45 | contName += "_histos"; | |
46 | TString outputfile = Form("%s",AliAnalysisManager::GetCommonFileName()); | |
47 | AliAnalysisDataContainer *outc = mgr->CreateContainer(contName.Data(), | |
48 | TList::Class(), | |
49 | AliAnalysisManager::kOutputContainer, | |
50 | outputfile); | |
51 | mgr->ConnectOutput(copyTask, 1, outc); | |
52 | ||
53 | return copyTask; | |
54 | } |