end-of-line normalization
[u/mrichter/AliRoot.git] / PWGCF / Correlations / macros / underlyingevent / AddTaskLeadingTrackUE.C
CommitLineData
a65a7e70 1
2
3void ConfigTaskUE(AliAnalysisTaskLeadingTrackUE * ueana ); // common config, extend with different cases
4
5AliAnalysisTaskLeadingTrackUE *AddTaskLeadingTrackUE(Int_t analysisMode = 0)
6{
7// Creates a jet fider task, configures it and adds it to the analysis manager.
8
9 // Get the pointer to the existing analysis manager via the static access method.
10 //==============================================================================
11 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
12 if (!mgr) {
13 ::Error("AddTaskLeadingTrackUE", "No analysis manager to connect to.");
14 return NULL;
15 }
16
17 // Check the analysis type using the event handlers connected to the analysis manager.
18 //==============================================================================
19 if (!mgr->GetInputEventHandler()) {
20 ::Error("AddTaskLeadingTrackUE", "This task requires an input event handler");
21 return NULL;
22 }
23
24 // Create the task and configure it.
25 //===========================================================================
26
27 AliAnalysisTaskLeadingTrackUE* ueana = new AliAnalysisTaskLeadingTrackUE("UEAnalysis_LeadingTrack");
28 ueana->SetMode(analysisMode);// data or corrections mode
29 ConfigTaskUE(ueana);
30
31 mgr->AddTask(ueana);
32
33 // Create ONLY the output containers for the data produced by the task.
34 // Get and connect other common input/output containers via the manager as below
35 //==============================================================================
36 AliAnalysisDataContainer *coutput1_UE = 0;
37 coutput1_UE = mgr->CreateContainer("histosLeadingTrackUE", TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWG4_LeadingTrackUE",AliAnalysisManager::GetCommonFileName()));
38
39 mgr->ConnectInput (ueana, 0, mgr->GetCommonInputContainer());
40 mgr->ConnectOutput (ueana, 0, coutput1_UE );
41
42 return ueana;
43}
44
45void ConfigTaskUE(AliAnalysisTaskLeadingTrackUE * ueana){
46 // common config,
47 ueana->SetDebugLevel(0);
48 ueana->SetPtRangeInHist(100, 0., 100.);
49 // ueana->SetFilterBit(16);
50 ueana->SetFilterBit(64+32);
51 ueana->SetTrackEtaCut(0.8);
52 ueana->SetLeadingTrackEtaCut(0.8);
53 ueana->SetEventSelectionBit(AliAnalysisHelperJetTasks::kIsPileUp);
54 ueana->SetReduceMemoryFootprint(kTRUE);
55
56 if (1)
57 {
58 file = TFile::Open("$ALICE_ROOT/PWG4/JetTasks/inputFiles/ue_trackingefficiency.root");
59 trackingEff = (TH1D*) file->Get("trackingefficiency");
60 ueana->SetTrackingEfficiency(trackingEff);
61 }
62}