1 //////////////////////////////////////////////////////////////
2 // Macro to setup AliAnalysisTaskTRDmon //
3 // for TRD monitoring. //
4 // ESD handler must be attached to the AliAnalysisManager //
7 // TRDmon.root containing a TObjArray of histograms //
9 // 25.02.2010 Ionut Arsene i.c.arsene@gsi.de //
10 //////////////////////////////////////////////////////////////
12 AliAnalysisTaskTRDmon* AddTaskTRDmon(const Char_t* triggerName = "",
13 Bool_t isCollisionTrigger = kTRUE)
16 // Configures an AliAnalysisTRDmon task and adds it to the analysis train
19 // check the analysis manager
20 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
22 Error("AddTaskTRDmon", "The analysis manager is not initialized");
26 // check the ESD input handler
27 TString type = mgr->GetInputEventHandler()->GetDataType();
28 if(!type.Contains("ESD")) {
29 Error("AddTaskTRDmon", "AliAnalysisTaskTRDmon task needs the manager to have an ESD input handler.");
34 AliAnalysisTaskTRDmon *task = new AliAnalysisTaskTRDmon("TRDmon");
35 task->SetTriggerName(triggerName.Data());
36 task->SetIsCollisionEvent(isCollisionTrigger);
40 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
43 AliAnalysisDataContainer *output =
44 mgr->CreateContainer("TRDmon", TObjArray::Class(),
45 AliAnalysisManager::kOutputContainer,
46 Form("%s.root", task->GetName()));
47 mgr->ConnectOutput(task, 0, output);