modification in task to filter events
[u/mrichter/AliRoot.git] / PWGLF / SPECTRA / ChargedHadrons / dNdPt / macros / AddTask_jacek_dNdPtTrackDumpTaskPbPb_TPCITS.C
CommitLineData
db09aaaf 1void AddTask_jacek_dNdPtTrackDumpTaskPbPb_TPCITS()
2{
db09aaaf 3 gSystem->Load("libANALYSIS");
4 gSystem->Load("libANALYSISalice");
5 gSystem->Load("libTENDER");
6 gSystem->Load("libCORRFW");
7 gSystem->Load("libPWGUDbase");
8 gSystem->Load("libTPCcalib");
9 gSystem->Load("libPWGPP");
10 gSystem->Load("libPWGLFspectra");
11
7b8a4d9b 12
13 gRandom->SetSeed(0);
14
db09aaaf 15 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
16
17 if (!mgr) {
18 Error("AddTask_dNdPtTrackDumpTaskPbPb_TPCITS", "No analysis manager found.");
19 return 0;
20 }
21
22 // Switch off all AliInfo (too much output!!!)
23 AliLog::SetGlobalLogLevel(AliLog::kError);
24 mgr->SetDebugLevel(0);
25
7b8a4d9b 26
27
db09aaaf 28 //
29 // Create physics trigger selection class
30 //
31 AliPhysicsSelection *physTrigSel = new AliPhysicsSelection();
32
33 //
34 // Create event cuts
35 //
36 Float_t zvWindow = 30. ;
37
38 AlidNdPtEventCuts *evtCuts = new AlidNdPtEventCuts("AlidNdPtEventCuts","Event cuts");
39 evtCuts->SetZvRange(-zvWindow,zvWindow);
40 evtCuts->SetMeanXYZv(0.0,0.0,0.0);
41 evtCuts->SetSigmaMeanXYZv(1.0,1.0,10.0);
42 evtCuts->SetTriggerRequired(kFALSE);
43 //evtCuts->SetTriggerRequired(kTRUE);
44
45 //
46 // Create geom. acceptance cuts
47 //
48 Float_t etaWindow = 1.0 ;
49 Float_t ptMin = 0.15 ;
50
51 AlidNdPtAcceptanceCuts *accCuts = new AlidNdPtAcceptanceCuts("AlidNdPtAcceptanceCuts","Geom. acceptance cuts");
52 accCuts->SetEtaRange(-etaWindow,etaWindow);
53 accCuts->SetPtRange(ptMin,1.e10);
54 accCuts->SetMaxDCAr(3.0);
55 accCuts->SetMaxDCAz(30.0);
56
57 //
58 // Create standard esd track cuts
59 //
60 Int_t cutMode = 154;
61 //Int_t cutMode = 200;
62
63 gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/ChargedHadrons/dNdPt/macros/CreatedNdPtTrackCuts.C");
64 AliESDtrackCuts* esdTrackCuts = CreatedNdPtTrackCuts(cutMode);
65 if (!esdTrackCuts) {
66 printf("ERROR: esdTrackCuts could not be created\n");
67 return;
68 } else {
69 esdTrackCuts->SetHistogramsOn(kTRUE);
70 //esdTrackCuts->SetMaxChi2PerClusterITS(36.);
71 }
72
73
74 Bool_t hasMC=(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0);
75
76 //
77 // Create task
78 //
79 AlidNdPtTrackDumpTask *task = new AlidNdPtTrackDumpTask("AlidNdPtTrackDumpTask");
80 task->SetUseMCInfo(hasMC);
7b8a4d9b 81 task->SetLowPtTrackDownscaligF(1.e7);
82 task->SetLowPtV0DownscaligF(1.e4);
83 //task->SetLowPtTrackDownscaligF(1.e2);
84 //task->SetLowPtV0DownscaligF(1.e1);
db09aaaf 85
86 // trigger
87 //task->SelectCollisionCandidates(AliVEvent::kMB);
88
89 //
90 // set analysis options from the Helper here !!!
91 //
92 // AlidNdPtHelper::OutputObject outputObject = AlidNdPtHelper::kCutAnalysisPbPb;
93 // AlidNdPtHelper::ParticleMode particleMode = AlidNdPtHelper::kAllPart ;
94
95 AlidNdPtHelper::AnalysisMode analysisMode = AlidNdPtHelper::kTPCITS;
96
97 task->SetUseMCInfo(hasMC);
98 task->SetEventCuts(evtCuts);
99 task->SetAcceptanceCuts(accCuts);
100 task->SetTrackCuts(esdTrackCuts);
101 task->SetAnalysisMode(analysisMode);
102 task->SetCentralityEstimator("V0M");
103
104 // Add task
105 mgr->AddTask(task);
106
107 // Create containers for input
108 AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();
109 mgr->ConnectInput(task, 0, cinput);
110
7b8a4d9b 111 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("TrigEvents", TList::Class(), AliAnalysisManager::kOutputContainer, "jotwinow_TrigEvents_Trees.root");
298fa346 112 mgr->ConnectOutput(task, 1, coutput1);
db09aaaf 113}
114