]>
Commit | Line | Data |
---|---|---|
c59f3edb | 1 | AliAnalysisTaskMuonQA *AddTaskMuonQA(Bool_t selectPhysics = kTRUE, Bool_t selectMatched = kTRUE, |
2 | Bool_t applyAccCut = kTRUE, Bool_t selectTrigger = kFALSE, | |
14eab312 | 3 | UInt_t triggerMask = AliVEvent::kMUS7, |
b66f9801 | 4 | Short_t selectCharge = 0) |
94ef1a28 | 5 | { |
6 | /// Add AliAnalysisTaskMuonQA to the train (Philippe Pillot) | |
7 | ||
8 | ||
9 | // Get the pointer to the existing analysis manager via the static access method. | |
10 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
11 | if(!mgr) { | |
12 | Error("AddTaskMuonQA","AliAnalysisManager not set!"); | |
13 | return NULL; | |
14 | } | |
15 | ||
16 | // This task run on ESDs | |
17 | TString type = mgr->GetInputEventHandler()->GetDataType(); | |
18 | if (!type.Contains("ESD")) { | |
19 | Error("AddTaskMuonQA", "ESD input handler needed!"); | |
20 | return NULL; | |
21 | } | |
22 | ||
23 | // Create and configure task | |
24 | AliAnalysisTaskMuonQA *task = new AliAnalysisTaskMuonQA("MuonQA"); | |
25 | if (!task) { | |
26 | Error("AddTaskMuonQA", "Muon QA task cannot be created!"); | |
27 | return NULL; | |
28 | } | |
29 | task->SelectPhysics(selectPhysics); | |
14eab312 | 30 | task->SelectTrigger(selectTrigger, triggerMask); |
76e3d5d4 | 31 | task->SelectMatched(selectMatched); |
417d6f63 | 32 | task->ApplyAccCut(applyAccCut); |
94ef1a28 | 33 | task->SelectCharge(selectCharge); |
34 | ||
35 | // Add task to analysis manager | |
36 | mgr->AddTask(task); | |
37 | ||
38 | // Connect input container | |
39 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); | |
40 | ||
41 | // Define output file directory | |
42 | TString outputfile = AliAnalysisManager::GetCommonFileName(); | |
43 | if ( outputfile.IsNull() ) { | |
44 | Error("AddTaskMuonQA", "Common output file is not defined!"); | |
45 | return NULL; | |
46 | } | |
47 | outputfile += ":MUON_QA"; | |
48 | ||
49 | // Create and connect output containers | |
40be9f05 | 50 | AliAnalysisDataContainer *cout_histo1 = mgr->CreateContainer("general1", TObjArray::Class(), AliAnalysisManager::kOutputContainer, outputfile); |
94ef1a28 | 51 | AliAnalysisDataContainer *cout_histo2 = mgr->CreateContainer("expert", TObjArray::Class(), AliAnalysisManager::kOutputContainer, outputfile); |
52 | AliAnalysisDataContainer *cout_trackStat = mgr->CreateContainer("trackCounters", AliCounterCollection::Class(), AliAnalysisManager::kOutputContainer, outputfile); | |
53 | AliAnalysisDataContainer *cout_eventStat = mgr->CreateContainer("eventCounters", AliCounterCollection::Class(), AliAnalysisManager::kOutputContainer, outputfile); | |
40be9f05 | 54 | AliAnalysisDataContainer *cout_normalized = mgr->CreateContainer("general2", TObjArray::Class(), AliAnalysisManager::kParamContainer, outputfile); |
94ef1a28 | 55 | mgr->ConnectOutput(task, 1, cout_histo1); |
56 | mgr->ConnectOutput(task, 2, cout_histo2); | |
57 | mgr->ConnectOutput(task, 3, cout_trackStat); | |
58 | mgr->ConnectOutput(task, 4, cout_eventStat); | |
40be9f05 | 59 | mgr->ConnectOutput(task, 5, cout_normalized); |
94ef1a28 | 60 | |
61 | return task; | |
62 | } |