]>
Commit | Line | Data |
---|---|---|
d9649a65 | 1 | //=============================================// |
2 | const char* centralityEstimator = "TRK"; | |
3 | //=============================================// | |
4 | ||
5 | //_________________________________________________________// | |
3eacba55 | 6 | AliEbyEFluctuationAnalysisTask *AddTaskFluctuations(const char* analysisType = "ESD", |
7 | const char *analysisMode = "TPC") { | |
8 | // Creates a fluctuations analysis task and adds it to the analysis manager. | |
9 | // Get the pointer to the existing analysis manager via the static access method. | |
d9649a65 | 10 | //=========================================================================== |
3eacba55 | 11 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); |
12 | if (!mgr) { | |
13 | ::Error("AddTaskFluctuations", "No analysis manager to connect to."); | |
14 | return NULL; | |
15 | } | |
16 | ||
17 | // Check the analysis type using the event handlers connected to the analysis manager. | |
d9649a65 | 18 | //=========================================================================== |
3eacba55 | 19 | if (!mgr->GetInputEventHandler()) { |
20 | ::Error("AddTaskFluctuations", "This task requires an input event handler"); | |
21 | return NULL; | |
22 | } | |
23 | TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD" | |
3eacba55 | 24 | |
25 | // Create the task, add it to manager and configure it. | |
26 | //=========================================================================== | |
27 | AliEbyEFluctuationAnalysisTask *taskFluctuations = new AliEbyEFluctuationAnalysisTask("FluctuationsTask"); | |
28 | mgr->AddTask(taskFluctuations); | |
29 | taskFluctuations->SetAnalysisType(analysisType); | |
d9649a65 | 30 | if(analysisType == "ESD") { |
31 | taskFluctuations->SetAnalysisMode(analysisMode); | |
32 | taskFluctuations->SetVertexDiamond(3.,3.,10.); | |
33 | taskFluctuations->SetCentralityEstimator(centralityEstimator); | |
34 | taskFluctuations->SetCentralityBins20(); | |
35 | taskFluctuations->SelectCollisionCandidates(AliVEvent::kMB); | |
36 | } | |
3eacba55 | 37 | |
38 | TString type = analysisType; | |
d9649a65 | 39 | if (analysisType=="ESD") { |
40 | gROOT->LoadMacro("configFluctuationsAnalysis.C"); | |
3eacba55 | 41 | AliESDtrackCuts *trackCuts = GetTrackCutsObject(); |
42 | taskFluctuations->SetAnalysisCutObject(trackCuts); | |
43 | } | |
d9649a65 | 44 | |
3eacba55 | 45 | // Create ONLY the output containers for the data produced by the task. |
46 | // Get and connect other common input/output containers via the manager as below | |
47 | //============================================================================== | |
48 | TString outputFileName = AliAnalysisManager::GetCommonFileName(); | |
49 | outputFileName += ":outputFluctuationAnalysis.root"; | |
d9649a65 | 50 | AliAnalysisDataContainer *coutFA = mgr->CreateContainer("fluctuationsOutput", TList::Class(),AliAnalysisManager::kOutputContainer,outputFileName.Data()); |
3eacba55 | 51 | mgr->ConnectInput(taskFluctuations, 0, mgr->GetCommonInputContainer()); |
d9649a65 | 52 | mgr->ConnectOutput(taskFluctuations, 1, coutFA); |
3eacba55 | 53 | |
54 | // Return task pointer at the end | |
55 | return taskFluctuations; | |
56 | } |