]>
Commit | Line | Data |
---|---|---|
7e990b20 | 1 | |
9370528f | 2 | AliMuonEffMC* AddTaskMuonEffMC(Bool_t MDProcess = kTRUE, |
fe76c976 | 3 | Bool_t IsMc = kTRUE, |
7e990b20 | 4 | TString centralityEstimator = "V0M", |
5 | const Int_t NEtaBins = 15, | |
6 | const Int_t NpTBins = 100, | |
7 | const Int_t NCentBins = 1, | |
8 | const Int_t NZvtxBins = 10, | |
9 | const Int_t NPhiBins = 12, | |
10 | const char* outputFileName = 0, | |
11 | const char* folderName = "Muon_TrkEff") | |
12 | { | |
13 | // Get the pointer to the existing analysis manager via the static access method. | |
14 | //============================================================================== | |
15 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
16 | if (!mgr) | |
17 | { | |
18 | ::Error("AddTaskSOH", "No analysis manager to connect to."); | |
19 | return NULL; | |
20 | } | |
21 | ||
22 | // Check the analysis type using the event handlers connected to the analysis manager. | |
23 | //============================================================================== | |
24 | if (!mgr->GetInputEventHandler()) | |
25 | { | |
26 | ::Error("AddTaskSOH", "This task requires an input event handler"); | |
27 | return NULL; | |
28 | } | |
29 | ||
7e990b20 | 30 | //------------------------------------------------------- |
31 | // Init the task and do settings | |
32 | //------------------------------------------------------- | |
33 | ||
34 | AliMuonEffMC *MuonEff = new AliMuonEffMC("MuonEffMC"); | |
fe76c976 | 35 | |
7e990b20 | 36 | MuonEff->SetMcAna(IsMc); |
37 | MuonEff->SetMDProcess(MDProcess); | |
38 | MuonEff->SetCentEstimator(centralityEstimator); | |
39 | MuonEff->SetNEtaBins(NEtaBins); | |
40 | MuonEff->SetNpTBins(NpTBins); | |
41 | MuonEff->SetNCentBins(NCentBins); | |
42 | MuonEff->SetNZvtxBins(NZvtxBins); | |
43 | MuonEff->SetNPhiBins(NPhiBins); | |
44 | MuonEff->SelectCollisionCandidates(AliVEvent::kAnyINT); | |
45 | ||
46 | // Add task(s) | |
47 | mgr->AddTask(MuonEff); | |
48 | ||
49 | // Create containers for input/output | |
50 | if (!outputFileName) | |
51 | outputFileName = AliAnalysisManager::GetCommonFileName(); | |
52 | ||
53 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
54 | AliAnalysisDataContainer *coutputpt = mgr->CreateContainer(Form("MuonEff_%s",centralityEstimator.Data()), | |
55 | TList::Class(), | |
56 | AliAnalysisManager::kOutputContainer, | |
496d9bc6 | 57 | Form("%s:%s", outputFileName, folderName)); |
7e990b20 | 58 | // Connect input/output |
59 | mgr->ConnectInput(MuonEff, 0, cinput); | |
60 | mgr->ConnectOutput(MuonEff, 1, coutputpt); | |
61 | ||
62 | return MuonEff; | |
63 | } |