]>
Commit | Line | Data |
---|---|---|
a65a7e70 | 1 | AliAnalysisTaskJetServices* serv = 0; |
2 | Bool_t ConfigWithFlagsJetServices(); | |
3 | AliAnalysisTaskJetServices *AddTaskJetServices() | |
4 | { | |
5 | // Get the pointer to the existing analysis manager via the static access method. | |
6 | //============================================================================== | |
7 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
8 | if (!mgr) { | |
9 | ::Error("AddTaskJetServices", "No analysis manager to connect to."); | |
10 | return NULL; | |
11 | } | |
12 | ||
13 | // Check the analysis type using the event handlers connected to the analysis manager. | |
14 | //============================================================================== | |
15 | if (!mgr->GetInputEventHandler()) { | |
16 | ::Error("AddTaskJetServices", "This task requires an input event handler"); | |
17 | return NULL; | |
18 | } | |
19 | ||
20 | TString type = mgr->GetInputEventHandler()->GetDataType(); | |
21 | type.ToUpper(); | |
22 | // Create the task and configure it. | |
23 | //=========================================================================== | |
24 | ||
25 | serv = new AliAnalysisTaskJetServices("JetServices"); | |
26 | ||
27 | ||
28 | if(type == "AOD"){ | |
29 | serv->SetAODInput(kTRUE); | |
30 | } | |
31 | mgr->AddTask(serv); | |
32 | ||
33 | // evaluate global variables | |
34 | Bool_t bGood1 = false; | |
35 | Bool_t bGood2 = false; | |
36 | ||
37 | ||
38 | if(!ConfigWithFlagsJetServices())return 0; | |
39 | serv->SetUsePhysicsSelection(kTRUE); | |
40 | ||
41 | // Create ONLY the output containers for the data produced by the task. | |
42 | // Get and connect other common input/output containers via the manager as below | |
43 | //============================================================================== | |
44 | AliAnalysisDataContainer *coutput1_Serv = mgr->CreateContainer("pwgje_services", TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWGJE_services",AliAnalysisManager::GetCommonFileName())); | |
45 | ||
46 | mgr->ConnectInput (serv, 0, mgr->GetCommonInputContainer()); | |
47 | mgr->ConnectOutput (serv, 0, mgr->GetCommonOutputContainer()); | |
48 | mgr->ConnectOutput (serv, 1, coutput1_Serv ); | |
49 | ||
50 | return serv; | |
51 | } | |
52 | ||
53 | Bool_t ConfigWithFlagsJetServices(){ | |
54 | ||
55 | Bool_t bGood1 = kFALSE; | |
56 | Bool_t bGood2 = kFALSE; | |
57 | ||
58 | ||
59 | serv->SetRunRange(AliAnalysisManager::GetGlobalInt("kGridRunRangeLo",bGood1), | |
60 | AliAnalysisManager::GetGlobalInt("kGridRunRangeLo",bGood2)); | |
61 | ||
62 | if(!bGood1||!bGood2){ | |
63 | Printf("%s:%d Run range not set",(char*)__FILE__,__LINE__); | |
64 | serv->SetRunRange(110000,160000); | |
65 | } | |
66 | ||
67 | ||
68 | Int_t nTrigger = AliAnalysisManager::GetGlobalInt("kNTrigger",bGood1); | |
69 | ||
70 | if(bGood1){ | |
71 | serv->SetNTrigger(nTrigger); | |
72 | for(int it = 0;it < nTrigger;it++){ | |
73 | serv->SetTrigger(it, | |
74 | AliAnalysisManager::GetGlobalInt(Form("kTriggerBit%d",it),bGood1), | |
75 | AliAnalysisManager::GetGlobalStr(Form("kTriggerName%d",it),bGood2)); | |
76 | } | |
77 | } | |
78 | ||
79 | AliAnalysisManager::GetGlobalInt("kPhysicsSelectionFlag",bGood1);if(bGood1)serv->SetPhysicsSelectionFlag(AliAnalysisManager::GetGlobalInt("kPhysicsSelectionFlag",bGood1)); | |
80 | else {Printf("%s%d: kPhysicsSelectionFlag not defined",(char*)__FILE__,__LINE__); return kFALSE; } | |
81 | AliAnalysisManager::GetGlobalStr("kDeltaAODJetName",bGood1);if(bGood1)serv->SetNonStdFile(AliAnalysisManager::GetGlobalStr("kDeltaAODJetName",bGood1)); | |
82 | else {Printf("%s%d: kDeltaAODJetName not defined",(char*)__FILE__,__LINE__); return kFALSE; } | |
83 | ||
84 | AliAnalysisManager::GetGlobalDbl("kTrackEtaWindow",bGood1);if(bGood1)serv->SetTrackEtaWindow(AliAnalysisManager::GetGlobalDbl("kTrackEtaWindow",bGood1)); | |
85 | else {Printf("%s%d: kTrackEtaWindow not defined",(char*)__FILE__,__LINE__); return kFALSE; } | |
86 | AliAnalysisManager::GetGlobalDbl("kVertexWindow",bGood1);if(bGood1)serv->SetZVertexCut(AliAnalysisManager::GetGlobalDbl("kVertexWindow",bGood1)); | |
87 | else {Printf("%s%d: kVertexWindow not defined",(char*)__FILE__,__LINE__); return kFALSE; } | |
88 | ||
89 | AliAnalysisManager::GetGlobalInt("kHighPtFilterMask",bGood1);if(bGood1)serv->SetFilterMask(AliAnalysisManager::GetGlobalInt("kHighPtFilterMask",bGood1)); | |
90 | else {Printf("%s%d: kHighPtFilterMask not defined",(char*)__FILE__,__LINE__); return kFALSE; } | |
91 | ||
92 | TString cRun(AliAnalysisManager::GetGlobalStr("kJetRunPeriod",bGood1)); | |
93 | if(cRun.Contains("10h")||cRun.Contains("11h")){ | |
94 | serv->SetCollisionType(AliAnalysisTaskJetServices::kPbPb); | |
95 | } | |
96 | else{ | |
97 | serv->SetCollisionType(AliAnalysisTaskJetServices::kPP); | |
98 | } | |
99 | ||
100 | return kTRUE; | |
101 | ||
102 | } |