// $Id$ AliAnalysisTaskSE *AddTaskEMCALTender(const char *p = "lhc11h") { // Get the pointer to the existing analysis manager via the static access method. //============================================================================== AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); if (!mgr) { ::Error("AddTaskEMCALTender", "No analysis manager to connect to."); return NULL; } AliVEventHandler *evhand = mgr->GetInputEventHandler(); // Create the task and configure it. //=========================================================================== AliAnalysisTaskSE *ana = 0; AliEMCALTenderSupply *EMCALSupply = 0; AliAnalysisDataContainer *coutput1 = 0; UInt_t nonLinFunct = AliEMCALRecoUtils::kBeamTestCorrected; TString period(p); period.ToLower(); if (period == "lhc12a15e") nonLinFunct = AliEMCALRecoUtils::kPi0MCv3; else if (period == "lhc12a15a") nonLinFunct = AliEMCALRecoUtils::kPi0MCv2; gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/ConfigEmcalTenderSupply.C"); if (evhand->InheritsFrom("AliESDInputHandler")) { EMCALSupply = ConfigEmcalTenderSupply(kTRUE, kTRUE, kTRUE, kTRUE, kTRUE, kTRUE, kFALSE, kTRUE, kTRUE, kTRUE, nonLinFunct); AliTender* alitender = new AliTender("AliTender"); alitender->AddSupply(EMCALSupply); alitender->SetDefaultCDBStorage("raw://"); ana = alitender; coutput1 = mgr->CreateContainer("emcal_tender_event", AliESDEvent::Class(), AliAnalysisManager::kExchangeContainer, "default_tender"); } else if (evhand->InheritsFrom("AliAODInputHandler")) { EMCALSupply = ConfigEmcalTenderSupply(kFALSE, kTRUE, kTRUE, kTRUE, kTRUE, kTRUE, kFALSE, kTRUE, kTRUE, kTRUE, nonLinFunct); AliEmcalTenderTask* emcaltender = new AliEmcalTenderTask("AliEmcalTenderTask"); emcaltender->SetEMCALTenderSupply(EMCALSupply); ana = emcaltender; coutput1 = mgr->CreateContainer("emcal_tender_event", AliAODEvent::Class(), AliAnalysisManager::kExchangeContainer, "default_tender"); } else { ::Error("AddTaskEMCALTender", "Input event handler not recognized, AOD/ESD expected. Returning..."); return NULL; } mgr->AddTask(ana); // Create ONLY the output containers for the data produced by the task. // Get and connect other common input/output containers via the manager as below //============================================================================== mgr->ConnectInput(ana, 0, mgr->GetCommonInputContainer()); mgr->ConnectOutput(ana, 1, coutput1 ); return ana; }