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