]>
Commit | Line | Data |
---|---|---|
045571a6 | 1 | AliAnalysisTaskITSsaTracks *AddTaskITSsaTracks(Bool_t readMC=kFALSE,Bool_t UseMCtruthForPID=kFALSE){ |
2 | // Creates, configures and attaches to the train the task for pi, K , p spectra | |
3 | // with ITS standalone tracks | |
4 | // Get the pointer to the existing analysis manager via the static access method. | |
5 | //============================================================================== | |
6 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
7 | if (!mgr) { | |
8 | ::Error("AddTaskITSsaTracks", "No analysis manager to connect to."); | |
9 | return NULL; | |
10 | } | |
11 | ||
12 | // Check the analysis type using the event handlers connected to the analysis manager. | |
13 | //============================================================================== | |
14 | if (!mgr->GetInputEventHandler()) { | |
15 | ::Error("AddTaskITSsaTracks", "This task requires an input event handler"); | |
16 | return NULL; | |
17 | } | |
18 | ||
19 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
20 | if(type.Contains("AOD")){ | |
21 | ::Error("AddTaskITSsaTracks", "This task requires to run on ESD"); | |
22 | return NULL; | |
23 | } | |
24 | ||
25 | //Bool_t isMC=kFALSE; | |
26 | //if (mgr->GetMCtruthEventHandler()) isMC=kTRUE; | |
27 | ||
28 | // Add MC handler (for kinematics) | |
29 | if(readMC){ | |
30 | AliMCEventHandler* handler = new AliMCEventHandler; | |
31 | handler->SetReadTR(kFALSE); | |
32 | mgr->SetMCtruthEventHandler(handler); | |
33 | } | |
34 | // Create and configure the task | |
35 | AliAnalysisTaskITSsaTracks *taskits = new AliAnalysisTaskITSsaTracks(); | |
36 | taskits->SelectCollisionCandidates(); | |
8cc96a18 | 37 | taskits->SetMinITSPoints(4); |
045571a6 | 38 | taskits->SetReadMC(readMC); |
39 | taskits->SetUseMCtruthForPID(UseMCtruthForPID); | |
40 | mgr->AddTask(taskits); | |
41 | ||
42 | // Create ONLY the output containers for the data produced by the task. | |
43 | // Get and connect other common input/output containers via the manager as below | |
44 | //============================================================================== | |
45 | TString outputFileName = AliAnalysisManager::GetCommonFileName(); | |
46 | outputFileName += ":ITSsaTracks"; | |
47 | ||
48 | AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clistITSsaTracks", | |
49 | TList::Class(), | |
50 | AliAnalysisManager::kOutputContainer, | |
51 | outputFileName ); | |
52 | ||
53 | mgr->ConnectInput(taskits, 0, mgr->GetCommonInputContainer()); | |
54 | mgr->ConnectOutput(taskits, 1, coutput1); | |
55 | return taskits; | |
56 | } | |
8cc96a18 | 57 |