]>
Commit | Line | Data |
---|---|---|
4f699ad2 | 1 | void AddTask_GammaCalo_pPb( |
2 | Int_t trainConfig = 1, //change different set of cuts | |
3 | Bool_t isMC = kFALSE, //run MC | |
4 | Int_t enableQAMesonTask = 0, //enable QA in AliAnalysisTaskGammaConvV1 | |
5 | Int_t enableQAClusterTask = 0, // enable additional QA task | |
6 | TString fileNameInputForWeighting = "MCSpectraInput.root", // path to file for weigting input | |
7 | Int_t doWeightingPart = 0, //enable Weighting | |
8 | TString generatorName = "DPMJET", | |
5cade4fc | 9 | TString cutnumberAODBranch = "8000000060084000001500000", // cutnumber for AOD branch |
10 | Bool_t isUsingTHnSparse = kTRUE //enable or disable usage of THnSparses for background estimation | |
4f699ad2 | 11 | ) { |
d53bf4ac | 12 | |
13 | // ================= Load Librariers ================================= | |
230b7aff | 14 | gSystem->Load("libCore"); |
15 | gSystem->Load("libTree"); | |
16 | gSystem->Load("libGeom"); | |
17 | gSystem->Load("libVMC"); | |
18 | gSystem->Load("libPhysics"); | |
d53bf4ac | 19 | gSystem->Load("libMinuit"); |
20 | gSystem->Load("libSTEERBase"); | |
21 | gSystem->Load("libESD"); | |
22 | gSystem->Load("libAOD"); | |
23 | gSystem->Load("libANALYSIS"); | |
24 | gSystem->Load("libANALYSISalice"); | |
230b7aff | 25 | gSystem->Load("libCDB"); |
26 | gSystem->Load("libSTEER"); | |
27 | gSystem->Load("libSTEERBase"); | |
28 | gSystem->Load("libTender"); | |
29 | gSystem->Load("libTenderSupplies"); | |
30 | gSystem->Load("libPWGflowBase"); | |
31 | gSystem->Load("libPWGflowTasks"); | |
32 | gSystem->Load("libPWGGAGammaConv"); | |
4e1b9acf | 33 | |
d53bf4ac | 34 | Int_t isHeavyIon = 2; |
35 | ||
36 | // ================== GetAnalysisManager =============================== | |
37 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
38 | if (!mgr) { | |
39 | Error(Form("AddTask_GammaConvV1_%i",trainConfig), "No analysis manager found."); | |
40 | return ; | |
41 | } | |
42 | ||
43 | // ================== GetInputEventHandler ============================= | |
44 | AliVEventHandler *inputHandler=mgr->GetInputEventHandler(); | |
45 | ||
46 | //========= Add PID Reponse to ANALYSIS manager ==== | |
47 | if(!(AliPIDResponse*)mgr->GetTask("PIDResponseTask")){ | |
48 | gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPIDResponse.C"); | |
49 | AddTaskPIDResponse(isMC); | |
50 | } | |
51 | ||
52 | Printf("here \n"); | |
53 | ||
54 | //========= Set Cutnumber for V0Reader ================================ | |
3013611f | 55 | TString cutnumberPhoton = "060000084001001500000000"; |
d53bf4ac | 56 | TString cutnumberEvent = "8000000"; |
57 | Bool_t doEtaShift = kFALSE; | |
58 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
59 | ||
60 | //========= Add V0 Reader to ANALYSIS manager if not yet existent ===== | |
61 | if( !(AliV0ReaderV1*)mgr->GetTask("V0ReaderV1") ){ | |
62 | AliV0ReaderV1 *fV0ReaderV1 = new AliV0ReaderV1("V0ReaderV1"); | |
63 | ||
64 | fV0ReaderV1->SetUseOwnXYZCalculation(kTRUE); | |
65 | fV0ReaderV1->SetCreateAODs(kFALSE);// AOD Output | |
66 | fV0ReaderV1->SetUseAODConversionPhoton(kTRUE); | |
67 | ||
68 | if (!mgr) { | |
69 | Error("AddTask_V0ReaderV1", "No analysis manager found."); | |
70 | return; | |
71 | } | |
72 | AliConvEventCuts *fEventCuts=NULL; | |
73 | if(cutnumberEvent!=""){ | |
74 | fEventCuts= new AliConvEventCuts(cutnumberEvent.Data(),cutnumberEvent.Data()); | |
75 | fEventCuts->SetPreSelectionCutFlag(kTRUE); | |
76 | if(fEventCuts->InitializeCutsFromCutString(cutnumberEvent.Data())){ | |
77 | fEventCuts->DoEtaShift(doEtaShift); | |
78 | fV0ReaderV1->SetEventCuts(fEventCuts); | |
79 | fEventCuts->SetFillCutHistograms("",kTRUE); | |
80 | } | |
81 | } | |
82 | // Set AnalysisCut Number | |
83 | AliConversionPhotonCuts *fCuts=NULL; | |
84 | if(cutnumberPhoton!=""){ | |
85 | fCuts= new AliConversionPhotonCuts(cutnumberPhoton.Data(),cutnumberPhoton.Data()); | |
86 | fCuts->SetPreSelectionCutFlag(kTRUE); | |
87 | fCuts->SetIsHeavyIon(isHeavyIon); | |
88 | if(fCuts->InitializeCutsFromCutString(cutnumberPhoton.Data())){ | |
89 | fV0ReaderV1->SetConversionCuts(fCuts); | |
90 | fCuts->SetFillCutHistograms("",kTRUE); | |
91 | } | |
92 | } | |
93 | if(inputHandler->IsA()==AliAODInputHandler::Class()){ | |
94 | // AOD mode | |
95 | fV0ReaderV1->SetDeltaAODBranchName(Form("GammaConv_%s_gamma",cutnumberAODBranch.Data())); | |
96 | } | |
97 | fV0ReaderV1->Init(); | |
98 | ||
99 | AliLog::SetGlobalLogLevel(AliLog::kFatal); | |
100 | ||
101 | //connect input V0Reader | |
102 | mgr->AddTask(fV0ReaderV1); | |
103 | mgr->ConnectInput(fV0ReaderV1,0,cinput); | |
104 | } | |
105 | ||
106 | //================================================ | |
107 | //========= Add task to the ANALYSIS manager ===== | |
108 | //================================================ | |
109 | AliAnalysisTaskGammaCalo *task=NULL; | |
110 | task= new AliAnalysisTaskGammaCalo(Form("GammaCalo_%i",trainConfig)); | |
111 | task->SetIsHeavyIon(isHeavyIon); | |
112 | task->SetIsMC(isMC); | |
113 | // Cut Numbers to use in Analysis | |
114 | Int_t numberOfCuts = 2; | |
0e006b2c | 115 | if (trainConfig == 2 || trainConfig == 4 ){ numberOfCuts = 6;} |
116 | if (trainConfig == 5 || trainConfig == 6 ){ numberOfCuts = 5;} | |
117 | if (trainConfig == 7 || trainConfig == 8 || trainConfig == 32 || trainConfig == 33){ numberOfCuts = 1;} | |
d53bf4ac | 118 | |
119 | TString *eventCutArray = new TString[numberOfCuts]; | |
120 | TString *clusterCutArray = new TString[numberOfCuts]; | |
121 | TString *mesonCutArray = new TString[numberOfCuts]; | |
122 | ||
123 | // cluster cuts | |
124 | // 0 "ClusterType", 1 "EtaMin", 2 "EtaMax", 3 "PhiMin", 4 "PhiMax", 5 "DistanceToBadChannel", 6 "Timing", 7 "TrackMatching", 8 "ExoticCell", | |
125 | // 9 "MinEnergy", 10 "MinNCells", 11 "MinM02", 12 "MaxM02", 13 "MinM20", 14 "MaxM20", 15 "MaximumDispersion", 16 "NLM" | |
126 | ||
0e006b2c | 127 | //************************************************ EMCAL clusters ************************************************* |
128 | if (trainConfig == 1){ // min energy = 0.3 GeV/c | |
f1018ee5 | 129 | eventCutArray[ 0] = "8000001"; clusterCutArray[0] = "10000040022030000"; mesonCutArray[0] = "01631031000000"; //standart cut, kINT7 // EMCAL clusters |
130 | eventCutArray[ 1] = "8005201"; clusterCutArray[1] = "10000040022030000"; mesonCutArray[1] = "01631031000000"; //standard cut, kEMC7 // EMCAL clusters | |
0e006b2c | 131 | } else if (trainConfig == 2){ // min energy = 0.3 GeV/c |
f1018ee5 | 132 | eventCutArray[ 0] = "8008101"; clusterCutArray[0] = "10000040022030000"; mesonCutArray[0] = "01631031000000"; //standart cut, kEMCEGA based on INT7 // EMCAL clusters |
133 | eventCutArray[ 1] = "8008301"; clusterCutArray[1] = "10000040022030000"; mesonCutArray[1] = "01631031000000"; //standard cut, kEMCEG1 based on INT7 // EMCAL clusters | |
134 | eventCutArray[ 2] = "8008501"; clusterCutArray[2] = "10000040022030000"; mesonCutArray[2] = "01631031000000"; //standard cut, kEMCEG2 based on INT7 // EMCAL clusters | |
135 | eventCutArray[ 3] = "8009101"; clusterCutArray[3] = "10000040022030000"; mesonCutArray[3] = "01631031000000"; //standard cut, kEMCEJE based on INT7 // EMCAL clusters | |
136 | eventCutArray[ 4] = "8009301"; clusterCutArray[4] = "10000040022030000"; mesonCutArray[4] = "01631031000000"; //standard cut, kEMCEJ1 based on INT7 // EMCAL clusters | |
137 | eventCutArray[ 5] = "8009501"; clusterCutArray[5] = "10000040022030000"; mesonCutArray[5] = "01631031000000"; //standard cut, kEMCEG2 based on INT7 // EMCAL clusters | |
0e006b2c | 138 | } else if (trainConfig == 3){ // min energy = 0.4 GeV/c |
f1018ee5 | 139 | eventCutArray[ 0] = "8000001"; clusterCutArray[0] = "10000040032030000"; mesonCutArray[0] = "01631031000000"; //standart cut, kINT7 // EMCAL clusters |
140 | eventCutArray[ 1] = "8005201"; clusterCutArray[1] = "10000040032030000"; mesonCutArray[1] = "01631031000000"; //standard cut, kEMC7 // EMCAL clusters | |
0e006b2c | 141 | } else if (trainConfig == 4){ // min energy = 0.4 GeV/c |
f1018ee5 | 142 | eventCutArray[ 0] = "8008101"; clusterCutArray[0] = "10000040032030000"; mesonCutArray[0] = "01631031000000"; //standart cut, kEMCEGA based on INT7 // EMCAL clusters |
143 | eventCutArray[ 1] = "8008301"; clusterCutArray[1] = "10000040032030000"; mesonCutArray[1] = "01631031000000"; //standard cut, kEMCEG1 based on INT7 // EMCAL clusters | |
144 | eventCutArray[ 2] = "8008501"; clusterCutArray[2] = "10000040032030000"; mesonCutArray[2] = "01631031000000"; //standard cut, kEMCEG2 based on INT7 // EMCAL clusters | |
145 | eventCutArray[ 3] = "8009101"; clusterCutArray[3] = "10000040032030000"; mesonCutArray[3] = "01631031000000"; //standard cut, kEMCEJE based on INT7 // EMCAL clusters | |
146 | eventCutArray[ 4] = "8009301"; clusterCutArray[4] = "10000040032030000"; mesonCutArray[4] = "01631031000000"; //standard cut, kEMCEJ1 based on INT7 // EMCAL clusters | |
147 | eventCutArray[ 5] = "8009501"; clusterCutArray[5] = "10000040032030000"; mesonCutArray[5] = "01631031000000"; //standard cut, kEMCEG2 based on INT7 // EMCAL clusters | |
0e006b2c | 148 | } else if (trainConfig == 5){ //EMCAL minEnergy variation |
f1018ee5 | 149 | eventCutArray[ 0] = "8000001"; clusterCutArray[0] = "10000040012030000"; mesonCutArray[0] = "01631031000000"; //0.2 GeV/c |
150 | eventCutArray[ 1] = "8000001"; clusterCutArray[1] = "10000040022030000"; mesonCutArray[1] = "01631031000000"; //0.3 GeV/c | |
151 | eventCutArray[ 2] = "8000001"; clusterCutArray[2] = "10000040032030000"; mesonCutArray[2] = "01631031000000"; //0.4 GeV/c default | |
152 | eventCutArray[ 3] = "8000001"; clusterCutArray[3] = "10000040042030000"; mesonCutArray[3] = "01631031000000"; //0.5 GeV/c | |
153 | eventCutArray[ 4] = "8000001"; clusterCutArray[4] = "10000040052030000"; mesonCutArray[4] = "01631031000000"; //0.6 GeV/c | |
0e006b2c | 154 | } else if (trainConfig == 6){ //EMCAL minNCells variation |
f1018ee5 | 155 | eventCutArray[ 0] = "8000001"; clusterCutArray[0] = "10000040031030000"; mesonCutArray[0] = "01631031000000"; //n cells >= 1 |
156 | eventCutArray[ 1] = "8000001"; clusterCutArray[1] = "10000040033030000"; mesonCutArray[1] = "01631031000000"; //n cells >= 3 | |
157 | eventCutArray[ 2] = "8000001"; clusterCutArray[2] = "10000040032000000"; mesonCutArray[2] = "01631031000000"; //no M02 cut | |
158 | eventCutArray[ 3] = "8000001"; clusterCutArray[3] = "10021040032030000"; mesonCutArray[3] = "01631031000000"; //only modules with TRD infront | |
159 | eventCutArray[ 4] = "8000001"; clusterCutArray[4] = "10013040032030000"; mesonCutArray[4] = "01631031000000"; //no modules with TRD infront | |
0e006b2c | 160 | } else if (trainConfig == 7){ // Validation EMCAL |
f1018ee5 | 161 | eventCutArray[ 0] = "8000001"; clusterCutArray[0] = "10000040032000000"; mesonCutArray[0] = "01631031000000"; |
ea1bc51e | 162 | } else if (trainConfig == 8){ // Validation EMCAL, only added signals |
f1018ee5 | 163 | eventCutArray[ 0] = "8000002"; clusterCutArray[0] = "10000040032000000"; mesonCutArray[0] = "01631031000000"; |
0e006b2c | 164 | |
165 | //************************************************ PHOS clusters ************************************************* | |
166 | } else if (trainConfig == 31) { // min energy = 0.3 GeV/c | |
f1018ee5 | 167 | eventCutArray[ 0] = "8000001"; clusterCutArray[0] = "20000040033200000"; mesonCutArray[0] = "01631031000000"; //standart cut, kINT7 // PHOS clusters |
168 | eventCutArray[ 1] = "8006201"; clusterCutArray[1] = "20000040033200000"; mesonCutArray[1] = "01631031000000"; //standard cut, kPHI7 // PHOS clusters | |
0e006b2c | 169 | } else if (trainConfig == 32){ // Validation PHOS |
f1018ee5 | 170 | eventCutArray[ 0] = "8000001"; clusterCutArray[0] = "20000040053200000"; mesonCutArray[0] = "01631031000000"; |
0e006b2c | 171 | } else if (trainConfig == 33){ // Validation PHOS, only added signals |
f1018ee5 | 172 | eventCutArray[ 0] = "8000002"; clusterCutArray[0] = "20000040053200000"; mesonCutArray[0] = "01631031000000"; |
ea1bc51e | 173 | |
174 | ||
d53bf4ac | 175 | } else { |
176 | Error(Form("GammaCalo_%i",trainConfig), "wrong trainConfig variable no cuts have been specified for the configuration"); | |
177 | return; | |
178 | } | |
179 | ||
180 | TList *EventCutList = new TList(); | |
181 | TList *ClusterCutList = new TList(); | |
182 | TList *MesonCutList = new TList(); | |
183 | ||
184 | TList *HeaderList = new TList(); | |
185 | if (doWeightingPart==1) { | |
186 | TObjString *Header1 = new TObjString("pi0_1"); | |
187 | HeaderList->Add(Header1); | |
188 | } | |
189 | if (doWeightingPart==2){ | |
190 | TObjString *Header3 = new TObjString("eta_2"); | |
191 | HeaderList->Add(Header3); | |
192 | } | |
193 | if (doWeightingPart==3) { | |
194 | TObjString *Header1 = new TObjString("pi0_1"); | |
195 | HeaderList->Add(Header1); | |
196 | TObjString *Header3 = new TObjString("eta_2"); | |
197 | HeaderList->Add(Header3); | |
198 | } | |
199 | ||
200 | EventCutList->SetOwner(kTRUE); | |
201 | AliConvEventCuts **analysisEventCuts = new AliConvEventCuts*[numberOfCuts]; | |
202 | ClusterCutList->SetOwner(kTRUE); | |
203 | AliCaloPhotonCuts **analysisClusterCuts = new AliCaloPhotonCuts*[numberOfCuts]; | |
204 | MesonCutList->SetOwner(kTRUE); | |
205 | AliConversionMesonCuts **analysisMesonCuts = new AliConversionMesonCuts*[numberOfCuts]; | |
206 | ||
207 | for(Int_t i = 0; i<numberOfCuts; i++){ | |
208 | analysisEventCuts[i] = new AliConvEventCuts(); | |
209 | analysisEventCuts[i]->InitializeCutsFromCutString(eventCutArray[i].Data()); | |
210 | EventCutList->Add(analysisEventCuts[i]); | |
211 | analysisEventCuts[i]->SetFillCutHistograms("",kFALSE); | |
212 | ||
213 | analysisClusterCuts[i] = new AliCaloPhotonCuts(); | |
214 | analysisClusterCuts[i]->InitializeCutsFromCutString(clusterCutArray[i].Data()); | |
215 | ClusterCutList->Add(analysisClusterCuts[i]); | |
216 | analysisClusterCuts[i]->SetFillCutHistograms(""); | |
217 | ||
218 | analysisMesonCuts[i] = new AliConversionMesonCuts(); | |
219 | analysisMesonCuts[i]->InitializeCutsFromCutString(mesonCutArray[i].Data()); | |
220 | MesonCutList->Add(analysisMesonCuts[i]); | |
221 | analysisMesonCuts[i]->SetFillCutHistograms(""); | |
222 | analysisEventCuts[i]->SetAcceptedHeader(HeaderList); | |
223 | } | |
224 | task->SetEventCutList(numberOfCuts,EventCutList); | |
225 | task->SetCaloCutList(numberOfCuts,ClusterCutList); | |
226 | task->SetMesonCutList(numberOfCuts,MesonCutList); | |
227 | task->SetDoMesonAnalysis(kTRUE); | |
228 | task->SetDoMesonQA(enableQAMesonTask); //Attention new switch for Pi0 QA | |
229 | task->SetDoClusterQA(enableQAClusterTask); //Attention new switch small for Cluster QA | |
5cade4fc | 230 | task->SetUseTHnSparse(isUsingTHnSparse); |
d53bf4ac | 231 | |
232 | //connect containers | |
233 | AliAnalysisDataContainer *coutput = | |
234 | mgr->CreateContainer(Form("GammaCalo_%i",trainConfig), TList::Class(), | |
235 | AliAnalysisManager::kOutputContainer,Form("GammaCalo_%i.root",trainConfig)); | |
236 | ||
237 | mgr->AddTask(task); | |
238 | mgr->ConnectInput(task,0,cinput); | |
239 | mgr->ConnectOutput(task,1,coutput); | |
240 | ||
241 | return; | |
242 | ||
243 | } |