cosmetics
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / macros / AddTaskEmcalEsdTpcTrack.C
CommitLineData
0601d71e 1// $Id$
2
25283b37 3AliEmcalEsdTpcTrackTask* AddTaskEmcalEsdTpcTrack(
0601d71e 4 const char *name = "TpcSpdVertexConstrainedTracks"
5)
25283b37 6{
7 // Get the pointer to the existing analysis manager via the static access method.
8 //==============================================================================
9 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
10 if (!mgr)
11 {
12 ::Error("AddTaskEmcalEsdTpcTrack", "No analysis manager to connect to.");
13 return NULL;
14 }
15
16 // Check the analysis type using the event handlers connected to the analysis manager.
17 //==============================================================================
18 if (!mgr->GetInputEventHandler())
19 {
20 ::Error("AddTaskEmcalEsdTpcTrack", "This task requires an input event handler");
21 return NULL;
22 }
23
24 //-------------------------------------------------------
25 // Init the task and do settings
26 //-------------------------------------------------------
27
4f558131 28 /* hybrid track cuts*/
25283b37 29 AliESDtrackCuts *cutsp = new AliESDtrackCuts;
25283b37 30 // TPC
31 TFormula *f1NClustersTPCLinearPtDep = new TFormula("f1NClustersTPCLinearPtDep","70.+30./20.*x");
32 cutsp->SetMinNClustersTPCPtDep(f1NClustersTPCLinearPtDep,20.);
33 cutsp->SetMinNClustersTPC(70);
34 cutsp->SetMaxChi2PerClusterTPC(4);
35 cutsp->SetRequireTPCStandAlone(kTRUE); //cut on NClustersTPC and chi2TPC Iter1
36 cutsp->SetAcceptKinkDaughters(kFALSE);
37 cutsp->SetRequireTPCRefit(kTRUE);
38 cutsp->SetMaxFractionSharedTPCClusters(0.4);
39 // ITS
40 cutsp->SetRequireITSRefit(kTRUE);
41 //accept secondaries
42 cutsp->SetMaxDCAToVertexXY(2.4);
43 cutsp->SetMaxDCAToVertexZ(3.2);
44 cutsp->SetDCAToVertex2D(kTRUE);
45 //reject fakes
46 cutsp->SetMaxChi2PerClusterITS(36);
47 cutsp->SetMaxChi2TPCConstrainedGlobal(36);
48 cutsp->SetRequireSigmaToVertex(kFALSE);
49 cutsp->SetEtaRange(-0.9,0.9);
50 cutsp->SetPtRange(0.15, 1E+15);
51 //tag = "Global tracks jet analysis with ITSrefit and NclsIter1=PtDep, noSPD requirement, no upper pt cut, golden chi2";
52 hybsp = new AliESDtrackCuts(*cutsp);
53 cutsp->SetClusterRequirementITS(AliESDtrackCuts::kSPD, AliESDtrackCuts::kAny);
54 //tag += " + additonal: SPD any requirement";
55 hybsp->SetRequireITSRefit(kFALSE);
56 //tag += " + additional: ITSrefit=kFALSE";
57
58 AliEmcalEsdTpcTrackTask *eTask = new AliEmcalEsdTpcTrackTask();
59 eTask->SetTrackCuts(cutsp);
60 eTask->SetHybridTrackCuts(hybsp);
61 eTask->SetTracksName(name);
62
63 cout << " *** TPC track to SPD vertex task configured *** " << endl;
64
65 //-------------------------------------------------------
66 // Final settings, pass to manager and set the containers
67 //-------------------------------------------------------
25283b37 68 mgr->AddTask(eTask);
69
70 // Create containers for input/output
71 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer() ;
25283b37 72 mgr->ConnectInput (eTask, 0, cinput1 );
25283b37 73
74 return eTask;
25283b37 75}