]>
Commit | Line | Data |
---|---|---|
25283b37 | 1 | AliEmcalClusTrackMatcherTask* AddTaskEmcalClusTrackMatcher( |
2 | const char *ntracks = "Tracks", | |
3 | const char *nclusters = "CaloClusters", | |
4 | const Bool_t DoClusTrack = 1, | |
5 | const Bool_t DoTrackClus = 0 | |
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("AddTaskEmcalClusTrackMatcher", "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("AddTaskEmcalClusTrackMatcher", "This task requires an input event handler"); | |
22 | return NULL; | |
23 | } | |
24 | ||
25 | //------------------------------------------------------- | |
26 | // Init the task and do settings | |
27 | //------------------------------------------------------- | |
28 | ||
29 | AliEmcalClusTrackMatcherTask* matcher = new AliEmcalClusTrackMatcherTask(); | |
30 | matcher->SetTracksName(ntracks); | |
31 | matcher->SetClusName(nclusters); | |
32 | matcher->SetDoClusTrackMatching(DoClusTrack); | |
33 | matcher->SetDoTrackClusMatching(DoTrackClus); | |
34 | ||
35 | //------------------------------------------------------- | |
36 | // Final settings, pass to manager and set the containers | |
37 | //------------------------------------------------------- | |
38 | ||
39 | mgr->AddTask(matcher); | |
40 | ||
41 | // Create containers for input/output | |
42 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ; | |
43 | AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer() ; | |
44 | ||
45 | mgr->ConnectInput (matcher, 0, cinput1 ); | |
46 | mgr->ConnectOutput (matcher, 0, coutput1 ); | |
47 | ||
48 | return matcher; | |
49 | ||
50 | } |