]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/macros/AddTaskMTRchamberEfficiency.C
Reducing the search window used to find the max in the ADC samples. Needed because...
[u/mrichter/AliRoot.git] / PWG1 / macros / AddTaskMTRchamberEfficiency.C
1 AliAnalysisTaskTrigChEff *AddTaskMTRchamberEfficiency(Bool_t useGhosts = kFALSE) 
2 {
3   //
4   // Task for the determination of the MUON trigger chamber efficiency
5   //
6   // stocco@subatech.in2p3.fr
7   //
8
9
10   // Get the pointer to the existing analysis manager via the static access method.
11   //==============================================================================
12   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
13   if (!mgr) {
14     ::Error("AddTaskMTRchamberEfficiency", "No analysis manager to connect to.");
15     return NULL;
16   }   
17
18   // Check the analysis type using the event handlers connected to the analysis manager.
19   //==============================================================================
20   if (!mgr->GetInputEventHandler()) {
21     ::Error("AliAnalysisTaskTrigChEff", "This task requires an input event handler");
22     return NULL;
23   }
24
25   // Create the task
26   AliAnalysisTaskTrigChEff* taskTrigChEff = new AliAnalysisTaskTrigChEff("TriggerChamberEfficiency");
27   taskTrigChEff->SetUseGhostTracks(useGhosts);
28   // Add to the manager
29   mgr->AddTask(taskTrigChEff);
30
31   //
32   // Create containers for input/output
33   AliAnalysisDataContainer *cOutputTrigChEff = mgr->CreateContainer("triggerChamberEff", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:MUON.TriggerEfficiencyMap", mgr->GetCommonFileName()));
34
35   // Attach input
36   mgr->ConnectInput(taskTrigChEff,0,mgr->GetCommonInputContainer());
37   // Attach output
38   mgr->ConnectOutput(taskTrigChEff,1,cOutputTrigChEff);
39   
40   return taskTrigChEff;
41 }