]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG4/macros/AddTaskPWG4HighPtQAMC.C
bug fix in definition of track cuts (Marta)
[u/mrichter/AliRoot.git] / PWG4 / macros / AddTaskPWG4HighPtQAMC.C
CommitLineData
fdceab34 1//DEFINITION OF A FEW CONSTANTS
2
8f0faa80 3AliPWG4HighPtQAMC* AddTaskPWG4HighPtQAMC()
fdceab34 4{
8f0faa80 5 // Creates HighPtQAMC analysis task and adds it to the analysis manager.
fdceab34 6
7 // A. Get the pointer to the existing analysis manager via the static access method.
8 //==============================================================================
9 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
10 if (!mgr) {
11 Error("AddTaskPWG4HighPtQMC", "No analysis manager to connect to.");
12 return NULL;
13 }
14
15 // B. Check the analysis type using the event handlers connected to the analysis
16 // manager. The availability of MC handler can also be checked here.
17 //==============================================================================
18 if (!mgr->GetInputEventHandler()) {
19 ::Error("AddPWG4TaskHighPtQAMC", "This task requires an input event handler");
20 return NULL;
21 }
22 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
23 const char *analysisType = "ESD";//"TPC"
24
25 // C. Create the task, add it to manager.
26 //===========================================================================
27
28 //CREATE THE CUTS -----------------------------------------------
29 //Use AliESDtrackCuts
30 AliESDtrackCuts *trackCuts = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts");
31 //Standard Cuts
9b58297c 32 trackCuts=trackCuts->GetStandardITSTPCTrackCuts2009(kTRUE);//Primary Track Selection
33 trackCuts->SetEtaRange(-0.9,0.9);
34 trackCuts->SetPtRange(0.15, 1e10);
35 trackCuts->SetRequireITSRefit(kFALSE);
fdceab34 36
37 AliESDtrackCuts *trackCutsITS = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts with ITSrefit");
9b58297c 38 //Standard Cuts
ee4390de 39 trackCutsITS=trackCuts->GetStandardITSTPCTrackCuts2009(kTRUE);//Primary Track Selection
40 trackCutsITS->SetEtaRange(-0.9,0.9);
41 trackCutsITS->SetPtRange(0.15, 1e10);
42 trackCutsITS->SetRequireITSRefit(kTRUE);
fdceab34 43
44 //Create the task
45 AliPWG4HighPtQAMC *taskPWG4QAMC = new AliPWG4HighPtQAMC("AliPWG4HighPtQAMC");
46 taskPWG4QAMC->SetCuts(trackCuts);
47 taskPWG4QAMC->SetCutsITS(trackCutsITS);
48
49
50 // E. Create ONLY the output containers for the data produced by the task.
51 // Get and connect other common input/output containers via the manager as below
52 //==============================================================================
53
54 //------ input data ------
55 // AliAnalysisDataContainer *cinput0 = mgr->GetCommonInputContainer();
56 printf("Create output containers \n");
57 TString outputfile = AliAnalysisManager::GetCommonFileName();
58 outputfile += ":PWG4_HighPtQAMC";
59 //char *outputfile = "outputAliPWG4HighPtQAMCTestTrain.root";
60 AliAnalysisDataContainer *cout_hist0 = mgr->CreateContainer("qa_histsMC", TList::Class(), AliAnalysisManager::kOutputContainer,outputfile);
61 AliAnalysisDataContainer *cout_hist2 = mgr->CreateContainer("qa_histsMCITS", TList::Class(), AliAnalysisManager::kOutputContainer,outputfile);
62
63 mgr->AddTask(taskPWG4QAMC);
64 mgr->ConnectInput(taskPWG4QAMC,0,mgr->GetCommonInputContainer());
65 mgr->ConnectOutput(taskPWG4QAMC,0,cout_hist0);
66 mgr->ConnectOutput(taskPWG4QAMC,1,cout_hist2);
67
68 // Return task pointer at the end
69 return taskPWG4QAMC;
70}