]>
Commit | Line | Data |
---|---|---|
44b92289 | 1 | AliAnalysisTaskJetClusterKine *AddTaskJetClusterKine(char* bGen = "KINECHARGED",Char_t *jf = "ANTIKT", Float_t radius = 0.4, Int_t kWriteAOD = 1, char* deltaFile = "", Float_t ptTrackCut = 0.15, Float_t etaTrackWindow = 0.9, Float_t vertexWindow = 10.); |
2 | ||
3 | Float_t kPtTrackCutCl = 0.15; | |
4 | Float_t kTrackEtaWindowCl = 0.8; | |
5 | Float_t kVertexWindowCl = 10.0; | |
6 | ||
7 | ||
8 | AliAnalysisTaskJetClusterKine *AddTaskJetClusterKine(char* bGen, Char_t *jf, Float_t radius, Int_t kWriteAOD, char *deltaFile, Float_t ptTrackCut, Float_t etaTrackWindow, Float_t vertexWindow){ | |
9 | ||
10 | // Creates a jet fider task, configures it and adds it to the analysis manager. | |
11 | kPtTrackCutCl = ptTrackCut; | |
12 | kTrackEtaWindowCl = etaTrackWindow; | |
13 | kVertexWindowCl = vertexWindow; | |
14 | ||
15 | TString outputFile(deltaFile); | |
16 | // Get the pointer to the existing analysis manager via the static access method. | |
17 | //============================================================================== | |
18 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
19 | if(!mgr){ | |
20 | ::Error("AddTaskJetClusterKine", "No analysis manager to connect to."); | |
21 | return NULL; | |
22 | } | |
23 | ||
24 | // Check the analysis type using the event handlers connected to the analysis manager. | |
25 | //============================================================================== | |
26 | if(!mgr->GetMCtruthEventHandler()){ | |
27 | ::Error("AddTaskJetClusterKine", "This task requires an input MC event handler"); | |
28 | return NULL; | |
29 | } | |
30 | ||
31 | TString typeGen(bGen); | |
32 | typeGen.ToUpper(); | |
33 | ||
34 | // Create the task and configure it. | |
35 | //=========================================================================== | |
36 | ||
37 | TString cAdd = ""; | |
38 | cAdd += Form("%02d_",TMath::Nint(radius*10.)); | |
39 | cAdd += Form("Cut%05d",TMath::Nint(1000.*kPtTrackCutCl)); | |
40 | ||
41 | Printf("%s %s%s", typeGen.Data(), jf, cAdd.Data()); | |
42 | ||
43 | AliAnalysisTaskJetClusterKine* clus = new AliAnalysisTaskJetClusterKine(Form("JetCluster%s_%s%s",bGen,jf,cAdd.Data())); | |
44 | ||
45 | // or a config file | |
46 | clus->SetVtxCuts(kVertexWindowCl); | |
47 | ||
48 | if(typeGen.Contains("KINECHARGED")){ | |
49 | clus->SetTrackTypeGen(AliAnalysisTaskJetClusterKine::kTrackKineCharged); | |
50 | clus->SetTrackPtCut(kPtTrackCutCl); | |
51 | clus->SetTrackEtaWindow(kTrackEtaWindowCl); | |
52 | ||
53 | }else if(typeGen.Contains("KINEFULL")){ | |
54 | clus->SetTrackTypeGen(AliAnalysisTaskJetClusterKine::kTrackKineAll); | |
55 | clus->SetTrackPtCut(kPtTrackCutCl); | |
56 | clus->SetTrackEtaWindow(kTrackEtaWindowCl); | |
57 | } | |
58 | ||
59 | clus->SetRparam(radius); | |
60 | clus->SetGhostArea(0.005); | |
61 | clus->SetGhostEtamax(kTrackEtaWindowCl); | |
62 | ||
63 | clus->SetDebugLevel(0); | |
64 | ||
65 | switch (jf) { | |
66 | case "ANTIKT": | |
67 | clus->SetAlgorithm(2); // antikt from fastjet/JetDefinition.hh | |
68 | break; | |
69 | case "CA": | |
70 | clus->SetAlgorithm(1); // CA from fastjet/JetDefinition.hh | |
71 | break; | |
72 | case "KT": | |
73 | clus->SetAlgorithm(0); // kt from fastjet/JetDefinition.hh | |
74 | break; | |
75 | default: | |
76 | ::Error("AddTaskJetClusterKine", "Wrong jet finder selected\n"); | |
77 | return 0; | |
78 | } | |
79 | ||
80 | TString nameOutArray = Form("clusters%s_%s%s",bGen,jf,cAdd.Data()); //FF// | |
81 | if(kWriteAOD){ | |
82 | if(outputFile.Length())clus->SetJetOutputFile(outputFile); | |
83 | Printf("Output branch: %s",nameOutArray.Data());//FF// | |
84 | clus->SetJetOutputBranch(nameOutArray.Data());//FF// | |
85 | clus->SetJetOutputMinPt(0); // store only jets / clusters above a certain threshold | |
86 | } | |
87 | clus->SetJetOutputContainer(kWriteAOD); //0=no output 1=AOD 2=Exchange | |
88 | ||
89 | mgr->AddTask(clus); | |
90 | ||
91 | // Create ONLY the output containers for the data produced by the task. | |
92 | // Get and connect other common input/output containers via the manager as below | |
93 | //============================================================================== | |
94 | AliAnalysisDataContainer *coutput1_clus = mgr->CreateContainer(Form("cluster_%s_%s%s",bGen,jf,cAdd.Data()), TList::Class(),AliAnalysisManager::kOutputContainer,Form("%s:PWGJE_cluster_%s_%s%s",AliAnalysisManager::GetCommonFileName(),bGen,jf,cAdd.Data())); | |
95 | ||
96 | mgr->ConnectInput (clus, 0, mgr->GetCommonInputContainer()); | |
97 | ||
98 | if(kWriteAOD==1){//FF// | |
99 | mgr->ConnectOutput (clus, 0, mgr->GetCommonOutputContainer()); | |
100 | ||
101 | } | |
102 | ||
103 | mgr->ConnectOutput (clus, 1, coutput1_clus ); | |
104 | ||
105 | ||
106 | ||
107 | if(kWriteAOD==2){//FF// | |
108 | AliAnalysisDataContainer *coutput2_clus = mgr->CreateContainer( nameOutArray.Data(), //?? | |
109 | TClonesArray::Class(), | |
110 | AliAnalysisManager::kExchangeContainer); | |
111 | mgr->ConnectOutput (clus, 2, coutput2_clus); //FF// | |
112 | } | |
113 | ||
114 | ||
115 | return clus; | |
116 | } |