Bug fix in AliExternalTrackParam::Invert()
[u/mrichter/AliRoot.git] / PWGLF / STRANGENESS / Cascades / macros / AddTaskCheckPerformanceCascadePbPb.C
1 AliAnalysisTaskCheckPerformanceCascadePbPb *AddTaskCheckPerformanceCascadePbPb( Float_t  centrlowlim         = 0.,
2                                                                                 Float_t  centruplim          = 90.,
3                                                                                 TString  centrest            = "V0M",
4                                                                                 Float_t  vtxlim              = 10.,
5                                                                                 Bool_t   kextrasel           = kFALSE,
6                                                                                 Bool_t   kacccut             = kFALSE,
7                                                                                 Bool_t   krelaunchvertexers  = kFALSE) {
8 // Creates, configures and attaches to the train a cascades check task.
9    // Get the pointer to the existing analysis manager via the static access method.
10    //==============================================================================
11    AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
12    if (!mgr) {
13       ::Error("AddTaskCheckPerformanceCascade", "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.
18    //==============================================================================
19    if (!mgr->GetInputEventHandler()) {
20       ::Error("AddTaskCheckPerformanceCascade", "This task requires an input event handler");
21       return NULL;
22    }   
23    TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
24
25    // Create and configure the task
26         AliAnalysisTaskCheckPerformanceCascadePbPb *taskCheckPerfCascadePbPb = new AliAnalysisTaskCheckPerformanceCascadePbPb("TaskCheckPerfCascadePbPb");
27
28    taskCheckPerfCascadePbPb->SetAnalysisType                (type);
29    taskCheckPerfCascadePbPb-> SetRelaunchV0CascVertexers    (krelaunchvertexers);     
30    taskCheckPerfCascadePbPb-> SetQualityCutZprimVtxPos      (kTRUE);
31    taskCheckPerfCascadePbPb-> SetRejectEventPileUp          (kFALSE);
32    taskCheckPerfCascadePbPb-> SetQualityCutNoTPConlyPrimVtx (kTRUE);
33    taskCheckPerfCascadePbPb-> SetQualityCutTPCrefit         (kTRUE);
34    taskCheckPerfCascadePbPb-> SetQualityCut80TPCcls         (kTRUE);
35    taskCheckPerfCascadePbPb-> SetExtraSelections            (kextrasel);
36    taskCheckPerfCascadePbPb-> SetApplyAccCut                (kacccut);
37    taskCheckPerfCascadePbPb-> SetCentralityLowLim           (centrlowlim);       // setting centrality selection vriables
38    taskCheckPerfCascadePbPb-> SetCentralityUpLim            (centruplim);
39    taskCheckPerfCascadePbPb-> SetCentralityEst              (centrest);
40    taskCheckPerfCascadePbPb-> SetVertexRange                (vtxlim);
41  
42    taskCheckPerfCascadePbPb->SelectCollisionCandidates();   
43  
44    mgr->AddTask(taskCheckPerfCascadePbPb);
45
46    // Create ONLY the output containers for the data produced by the task.
47    // Get and connect other common input/output containers via the manager as below
48    //==============================================================================
49
50    // User file name (if need be)
51
52    TString outputFileName = AliAnalysisManager::GetCommonFileName();
53    outputFileName += ":PWGLFStrangeness.outputCheckPerformanceCascadePbPb";
54    if (mgr->GetMCtruthEventHandler()) outputFileName += "_MC";
55    
56    Printf("AddTaskCheckPerfCascadePbPb - Set OutputFileName : \n %s\n", outputFileName.Data() );
57    
58    AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("clistCascMC",
59                                                              TList::Class(),
60                                                              AliAnalysisManager::kOutputContainer,
61                                                              outputFileName );
62
63    mgr->ConnectInput( taskCheckPerfCascadePbPb, 0, mgr->GetCommonInputContainer());
64    mgr->ConnectOutput(taskCheckPerfCascadePbPb, 1, coutput1);
65    
66    return taskCheckPerfCascadePbPb;
67 }