]>
Commit | Line | Data |
---|---|---|
e1dc3f11 | 1 | /////////////////////////////////////////////////////////////////// |
2 | // // | |
3 | // AddTaskJetFlow // | |
4 | // Author: Redmer A. Bertens, Utrecht University, 2013 // | |
5 | // // | |
6 | /////////////////////////////////////////////////////////////////// | |
7 | class AliAnalysisDataContainer; | |
8 | class AliFlowTrackCuts; | |
9 | ||
a4a06f0e | 10 | void AddTaskJetFlow( TString name = "name", |
11 | TString jets = "jets", | |
12 | Float_t ptbump = 0, | |
13 | TArrayI* cent = 0x0, | |
14 | Float_t MinPOIPt = 0.15, | |
15 | Float_t MaxPOIPt = 150, | |
16 | Float_t CCBinsInPt = 100, | |
17 | Bool_t VParticle = kFALSE, | |
18 | Bool_t debug = kFALSE ) | |
e1dc3f11 | 19 | { |
20 | // first check the environment (common to all tasks) | |
21 | if(debug) printf("\n\n >> AddTaskJetFlow <<\n"); | |
22 | TString fileName = AliAnalysisManager::GetCommonFileName(); | |
23 | fileName += ":JetFlow"; | |
24 | if(debug) printf(" - filename: %s \n",fileName.Data()); | |
25 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
26 | if (!mgr) { | |
27 | if(debug) cout << " Fatal error: no analysis manager found! " << endl; | |
28 | return 0x0; | |
29 | } | |
30 | if (!mgr->GetInputEventHandler()) { | |
31 | if(debug) cout << " Fatal error: no imput event handler found!" << endl; | |
32 | return 0x0; | |
33 | } | |
98bd4878 | 34 | // check the centrality setup |
35 | if(!cent) { | |
2db2a6d0 | 36 | Int_t c[] = {0, 10, 30, 50, 70, 90}; |
98bd4878 | 37 | cent = new TArrayI(sizeof(c)/sizeof(c[0]), c); |
38 | printf(" > Setup default centrality binning with %i bins \n ", cent->GetSize()); | |
e1dc3f11 | 39 | } |
98bd4878 | 40 | // create the cut objects |
6f5e34fa | 41 | AliFlowTrackCuts* CutsRP_VZERO = new AliFlowTrackCuts("CutsRP_VZERO"); |
42 | CutsRP_VZERO = CutsRP_VZERO->GetStandardVZEROOnlyTrackCuts(); | |
43 | AliFlowTrackCuts* CutsRP_TPC = new AliFlowTrackCuts("CutsRP_TPC"); | |
44 | CutsRP_TPC = CutsRP_TPC->GetStandardTPCStandaloneTrackCuts(); | |
45 | CutsRP_TPC->SetAODfilterBit(1); | |
98bd4878 | 46 | AliFlowTrackCuts* CutsNull = new AliFlowTrackCuts("CutsNull"); |
47 | CutsNull->SetParamType(AliFlowTrackCuts::kGlobal); | |
48 | CutsNull->SetEtaRange(+1, -1); | |
49 | CutsNull->SetPtRange(+1, -1); | |
50 | // add the tasks in a loop, one task for each centrality bin | |
51 | for(Int_t i(0); i < cent->GetSize()-1; i++) { | |
52 | TString tempName(Form("%s_%i_%i", name.Data(), cent->At(i), cent->At(i+1))); | |
53 | // create the task | |
54 | AliAnalysisTaskJetFlow* task = new AliAnalysisTaskJetFlow(tempName.Data()); | |
a4a06f0e | 55 | task->SetCCMaxPt(MaxPOIPt); |
56 | task->SetCCBinsInPt(CCBinsInPt); | |
57 | task->SetDoVParticleAnalysis(VParticle); | |
58 | task->SetMinMaxPOIPt(MinPOIPt, MaxPOIPt); | |
59 | (debug) ? task->SetDebugMode(1) : task->SetDebugMode(-1); | |
98bd4878 | 60 | if(!task) { |
61 | if(debug) cout << " --> Unexpected error occurred: NO TASK WAS CREATED! (could be a library problem!) " << endl; | |
62 | return 0x0; | |
63 | } | |
64 | else printf(" > added task with name %s and jet collection %s < \n", tempName.Data(), jets.Data()); | |
65 | task->SetJetCollectionName(jets.Data()); | |
66 | // pass specific objects and settigns to the task | |
6f5e34fa | 67 | task->SetCutsRP(CutsRP_TPC, CutsRP_VZERO); |
98bd4878 | 68 | task->SetCutsNull(CutsNull); |
69 | task->SetMinMaxCentrality(cent->At(i), cent->At(1+i)); | |
70 | task->SetPtBump(ptbump); | |
71 | mgr->AddTask(task); | |
72 | mgr->ConnectInput(task,0,mgr->GetCommonInputContainer()); | |
73 | mgr->ConnectOutput(task,1,mgr->CreateContainer(Form("%s_histograms", tempName.Data()), TList::Class(), AliAnalysisManager::kOutputContainer, fileName.Data())); | |
6f5e34fa | 74 | // connect flow anaysis task |
75 | AliAnalysisDataContainer *flowEvent_VZERO = mgr->CreateContainer(Form("flowEvent_VZERO_%s", tempName.Data()), AliFlowEventSimple::Class(), AliAnalysisManager::kExchangeContainer); | |
76 | mgr->ConnectOutput(task, 2, flowEvent_VZERO); | |
77 | AliAnalysisDataContainer *flowEvent_TPC = mgr->CreateContainer(Form("flowEvent_TPC_%s", tempName.Data()), AliFlowEventSimple::Class(), AliAnalysisManager::kExchangeContainer); | |
78 | mgr->ConnectOutput(task, 3, flowEvent_TPC); | |
79 | TaskJetFlow::AddSPmethod(Form("SPVZERO_A_%s", tempName.Data()), "Qa", 2, flowEvent_VZERO); | |
80 | TaskJetFlow::AddSPmethod(Form("SPVZERO_B_%s", tempName.Data()), "Qb", 2, flowEvent_VZERO); | |
81 | TaskJetFlow::AddQCmethod(Form("QC_%s", tempName.Data()), 2, flowEvent_TPC); | |
98bd4878 | 82 | } |
e1dc3f11 | 83 | } |
84 | //_____________________________________________________________________________ | |
85 | namespace TaskJetFlow{ // use unique namespace to avoid problems in TRAIN analysis | |
6f5e34fa | 86 | void AddSPmethod(char *name, char *Qvector, int harmonic, AliAnalysisDataContainer *flowEvent) |
87 | { | |
88 | TString fileName = AliAnalysisManager::GetCommonFileName(); | |
89 | fileName+=":SP"; | |
90 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
91 | AliAnalysisDataContainer *outSP = mgr->CreateContainer(name, TList::Class(), AliAnalysisManager::kOutputContainer, fileName); | |
92 | AliAnalysisTaskScalarProduct *tskSP = new AliAnalysisTaskScalarProduct(Form("TaskScalarProduct_%s", name), kFALSE); | |
93 | tskSP->SetApplyCorrectionForNUA(kTRUE); | |
94 | tskSP->SetHarmonic(harmonic); | |
95 | if(!strcmp("Qa", Qvector)) tskSP->SetTotalQvector("Qa"); | |
96 | if(!strcmp("Qb", Qvector)) tskSP->SetTotalQvector("Qb"); | |
97 | tskSP->SetBookOnlyBasicCCH(kFALSE); | |
98 | mgr->AddTask(tskSP); | |
99 | mgr->ConnectInput(tskSP, 0, flowEvent); | |
100 | mgr->ConnectOutput(tskSP, 1, outSP); | |
101 | } | |
102 | //_____________________________________________________________________________ | |
103 | void AddQCmethod(char *name, int harmonic, AliAnalysisDataContainer *flowEvent) | |
e1dc3f11 | 104 | { |
e1dc3f11 | 105 | TString fileName = AliAnalysisManager::GetCommonFileName(); |
6f5e34fa | 106 | fileName+=":QC"; |
e1dc3f11 | 107 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); |
6f5e34fa | 108 | AliAnalysisDataContainer *outQC = mgr->CreateContainer(name, TList::Class(), AliAnalysisManager::kOutputContainer, fileName); |
109 | AliAnalysisTaskQCumulants *tskQC = new AliAnalysisTaskQCumulants(Form("TaskQCumulants_%s", name), kFALSE); | |
110 | tskQC->SetApplyCorrectionForNUA(kTRUE); | |
111 | tskQC->SetHarmonic(harmonic); | |
112 | tskQC->SetBookOnlyBasicCCH(kFALSE); | |
113 | mgr->AddTask(tskQC); | |
114 | mgr->ConnectInput(tskQC, 0, flowEvent); | |
115 | mgr->ConnectOutput(tskQC, 1, outQC); | |
e1dc3f11 | 116 | } |
6f5e34fa | 117 | //_____________________________________________________________________________ |
e1dc3f11 | 118 | }// end of namespace TaskJetFlow |