]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/EBYE/macros/AddTaskLRCtrain.C
task update to have more wagons in Lego train and extra parameter in AddTask (Igor...
[u/mrichter/AliRoot.git] / PWGCF / EBYE / macros / AddTaskLRCtrain.C
1 AliAnalysisTaskLRC *AddTaskLRCtrain(
2         Bool_t RunKine = kFALSE
3         , Bool_t isIonsAnalysis = kFALSE
4         , TString strPrefixTaskName = "testTask"
5         , TString strRunMode = "default"
6         , int nEtaWindows = 8
7         , int nPhiWindows = 8
8         , double etaWinWidth = 0.2
9         , double etaWindowStep = 0.1
10         , double phiWinWidth = TMath::Pi()/4
11         , int nEventPhiRotations = 8
12         , double ptMin = 0.3
13         , double ptMax = 1.5
14         , int multMin = 0
15         , int multMax = 100000
16         , double vertexZmax = 10.0
17         )
18 {
19     gROOT->LoadMacro("$ALICE_ROOT/PWGCF/EBYE/macros/configLRCAnalysis.C");
20     //gROOT->LoadMacro("AliAnalysisTaskIA.cxx+g");
21     
22     // A. Get the pointer to the existing analysis manager via the static access method.
23     //==============================================================================
24     AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
25     if (!mgr) {
26         Error("AddTaskLRC", "No analysis manager to connect to.");
27         return NULL;
28     }
29     
30     // B. Check the analysis type using the event handlers connected to the analysis
31     //    manager. The availability of MC handler cann also be checked here.
32     //==============================================================================
33     if (!mgr->GetInputEventHandler()) {
34         Error("AddTaskLRC", "This task requires an input event handler");
35         return NULL;
36     }
37     TString type = mgr->GetInputEventHandler()->GetDataType();
38     cout << " # TaskLRC - input :" << type << "\n";
39     
40     // ########## Task LRC
41     AliAnalysisTaskLRC* taskLRC = 0x0;
42     taskLRC = createLRCtaskSkeleton("Task_LRC_" + strPrefixTaskName /*+ "_MB_Global2"*/,RunKine);
43     //addAliLRCProcessors(taskLRC,windowsConfigId, nPhiSectors,gapAsPartOfPi);//, whichParticleToFill, whichPidCondition);
44     
45     tuneEtaPhiWindows( taskLRC
46                        , nEtaWindows
47                        , nPhiWindows
48                        , etaWinWidth
49                        , etaWindowStep
50                        , 0
51                        , phiWinWidth
52                        );
53     
54     taskLRC->SetNumberOfPhiSectors( nEventPhiRotations );
55     taskLRC->SetAnalysisLevel( type );
56     
57     if ( type == "AOD" )
58         taskLRC->SetAODtrackCutBit( 128 );//128 );//128 );
59     else if ( type == "ESD" )
60         taskLRC->SetTrackCuts(createAliLRCcuts( "StandardTPCOnlyTrackCuts" )); // "Global2" ));
61
62     taskLRC->SetVtxDiamond(0.4,0.4,vertexZmax);
63     taskLRC->SetMaxPtLimit(ptMax);
64     taskLRC->SetMinPtLimit(ptMin);
65     //taskLRC->SetMinNumberOfSPDtracklets( systConfig->minNtracklets );
66     taskLRC->SetNchCuts( multMin, multMax ); // !!! for mult studies
67     
68     int maxMultInHistograms = ( !isIonsAnalysis ? 15 : 70 );
69     setHistMultRange( taskLRC,  0, 0, maxMultInHistograms );
70     setHistPtRange( taskLRC, ptMin, ptMax, 0.01, 5 );
71     
72     //if PbPb or pPb analysis
73     taskLRC->SetIonsAnalysis(isIonsAnalysis);
74     // to be set in the train wagon config: taskLRC->SetCentralityClass(min, max);
75     
76     taskLRC->SelectCollisionCandidates(AliVEvent::kMB); // if physics selection performed in UserExec(), this line should be commented
77     mgr->AddTask(taskLRC);
78     
79     configureLRCtaskOutput(taskLRC, /*strOutputRootFolder,*/ strPrefixTaskName, strRunMode);
80     
81     return taskLRC;
82 }
83
84
85