]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG/EMCAL/macros/AddTaskEMCALTender.C
adjusted MC histograms
[u/mrichter/AliRoot.git] / PWG / EMCAL / macros / AddTaskEMCALTender.C
CommitLineData
c4c7c022 1// $Id$
2
59f16b27 3AliAnalysisTaskSE *AddTaskEMCALTender(const char *p = "lhc11h")
a56c1f4e 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;
ef8220aa 20 AliAnalysisDataContainer *coutput1 = 0;
fd650c0d 21
59f16b27 22 UInt_t nonLinFunct = AliEMCALRecoUtils::kBeamTestCorrected;
23
24 TString period(p);
25 period.ToLower();
26 if (period == "lhc12a15e")
27 nonLinFunct = AliEMCALRecoUtils::kPi0MCv3;
28 else if (period == "lhc12a15a")
29 nonLinFunct = AliEMCALRecoUtils::kPi0MCv2;
30
2f06de14 31 gROOT->LoadMacro("$ALICE_ROOT/PWG/EMCAL/macros/ConfigEmcalTenderSupply.C");
a56c1f4e 32
33 if (evhand->InheritsFrom("AliESDInputHandler")) {
55c69e8b 34 EMCALSupply = ConfigEmcalTenderSupply(kTRUE, kTRUE, kTRUE, kTRUE, kTRUE, kTRUE, kFALSE, kTRUE, kTRUE, kTRUE, nonLinFunct);
a56c1f4e 35
36 AliTender* alitender = new AliTender("AliTender");
37 alitender->AddSupply(EMCALSupply);
e6e03c89 38 alitender->SetDefaultCDBStorage("raw://");
a56c1f4e 39 ana = alitender;
ef8220aa 40
41 coutput1 = mgr->CreateContainer("emcal_tender_event",
42 AliESDEvent::Class(),
43 AliAnalysisManager::kExchangeContainer,
44 "default_tender");
a56c1f4e 45 }
46 else if (evhand->InheritsFrom("AliAODInputHandler")) {
55c69e8b 47 EMCALSupply = ConfigEmcalTenderSupply(kFALSE, kTRUE, kTRUE, kTRUE, kTRUE, kTRUE, kFALSE, kTRUE, kTRUE, kTRUE, nonLinFunct);
a56c1f4e 48
49 AliEmcalTenderTask* emcaltender = new AliEmcalTenderTask("AliEmcalTenderTask");
50 emcaltender->SetEMCALTenderSupply(EMCALSupply);
51 ana = emcaltender;
ef8220aa 52 coutput1 = mgr->CreateContainer("emcal_tender_event",
53 AliAODEvent::Class(),
54 AliAnalysisManager::kExchangeContainer,
55 "default_tender");
a56c1f4e 56 }
57 else {
58 ::Error("AddTaskEMCALTender", "Input event handler not recognized, AOD/ESD expected. Returning...");
59 return NULL;
60 }
61
62 mgr->AddTask(ana);
a55e4f1d 63
fd650c0d 64 // Create ONLY the output containers for the data produced by the task.
65 // Get and connect other common input/output containers via the manager as below
66 //==============================================================================
d0ed1257 67
ef8220aa 68 mgr->ConnectInput(ana, 0, mgr->GetCommonInputContainer());
69 mgr->ConnectOutput(ana, 1, coutput1 );
fd650c0d 70
71 return ana;
72}