]>
Commit | Line | Data |
---|---|---|
c4c7c022 | 1 | // $Id$ |
2 | ||
a56c1f4e | 3 | AliAnalysisTaskSE *AddTaskEMCALTender() |
4 | { | |
fd650c0d | 5 | // Get the pointer to the existing analysis manager via the static access method. |
6 | //============================================================================== | |
7 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
8 | if (!mgr) { | |
32bf39af | 9 | ::Error("AddTaskEMCALTender", "No analysis manager to connect to."); |
fd650c0d | 10 | return NULL; |
a56c1f4e | 11 | } |
12 | ||
13 | AliVEventHandler *evhand = mgr->GetInputEventHandler(); | |
14 | ||
fd650c0d | 15 | // Create the task and configure it. |
16 | //=========================================================================== | |
fd650c0d | 17 | |
a56c1f4e | 18 | AliAnalysisTaskSE *ana = 0; |
19 | AliEMCALTenderSupply *EMCALSupply = 0; | |
fd650c0d | 20 | |
2f06de14 | 21 | gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/ConfigEmcalTenderSupply.C"); |
a56c1f4e | 22 | |
23 | if (evhand->InheritsFrom("AliESDInputHandler")) { | |
24 | EMCALSupply = ConfigEmcalTenderSupply(kTRUE); | |
25 | ||
26 | AliTender* alitender = new AliTender("AliTender"); | |
27 | alitender->AddSupply(EMCALSupply); | |
e6e03c89 | 28 | alitender->SetDefaultCDBStorage("raw://"); |
a56c1f4e | 29 | ana = alitender; |
30 | } | |
31 | else if (evhand->InheritsFrom("AliAODInputHandler")) { | |
32 | EMCALSupply = ConfigEmcalTenderSupply(kFALSE); | |
33 | ||
34 | AliEmcalTenderTask* emcaltender = new AliEmcalTenderTask("AliEmcalTenderTask"); | |
35 | emcaltender->SetEMCALTenderSupply(EMCALSupply); | |
36 | ana = emcaltender; | |
37 | } | |
38 | else { | |
39 | ::Error("AddTaskEMCALTender", "Input event handler not recognized, AOD/ESD expected. Returning..."); | |
40 | return NULL; | |
41 | } | |
42 | ||
43 | mgr->AddTask(ana); | |
a55e4f1d | 44 | |
fd650c0d | 45 | // Create ONLY the output containers for the data produced by the task. |
46 | // Get and connect other common input/output containers via the manager as below | |
47 | //============================================================================== | |
d0ed1257 | 48 | |
fd650c0d | 49 | mgr->ConnectInput (ana, 0, mgr->GetCommonInputContainer()); |
5d950148 | 50 | |
51 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("emcal_tender_event", | |
52 | AliAODEvent::Class(), | |
53 | AliAnalysisManager::kExchangeContainer, | |
54 | "default_tender"); | |
fd650c0d | 55 | mgr->ConnectOutput (ana, 1, coutput1 ); |
56 | ||
57 | return ana; | |
58 | } |