AliPhysics  master (3d17d9d)
AliAnalysisTaskEmcalTriggerSelection.cxx
Go to the documentation of this file.
1 /************************************************************************************
2  * Copyright (C) 2017, Copyright Holders of the ALICE Collaboration *
3  * All rights reserved. *
4  * *
5  * Redistribution and use in source and binary forms, with or without *
6  * modification, are permitted provided that the following conditions are met: *
7  * * Redistributions of source code must retain the above copyright *
8  * notice, this list of conditions and the following disclaimer. *
9  * * Redistributions in binary form must reproduce the above copyright *
10  * notice, this list of conditions and the following disclaimer in the *
11  * documentation and/or other materials provided with the distribution. *
12  * * Neither the name of the <organization> nor the *
13  * names of its contributors may be used to endorse or promote products *
14  * derived from this software without specific prior written permission. *
15  * *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND *
17  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED *
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE *
19  * DISCLAIMED. IN NO EVENT SHALL ALICE COLLABORATION BE LIABLE FOR ANY *
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES *
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; *
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND *
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT *
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
26  ************************************************************************************/
27 #include <algorithm>
28 #include <iostream>
29 #include <sstream>
30 #include <unordered_map>
31 #include <TH1.h>
32 #include "AliEmcalTriggerAlias.h"
37 #include "AliEMCALTriggerPatchInfo.h"
38 #include "AliYAMLConfiguration.h"
39 
43 
44 namespace PWG {
45 namespace EMCAL {
46 
47 AliAnalysisTaskEmcalTriggerSelection::AliAnalysisTaskEmcalTriggerSelection():
49  fTriggerDecisionContainer(nullptr),
50  fGlobalDecisionContainerName("EmcalTriggerDecision"),
51  fTriggerSelections(),
52  fSelectionQA()
53 {
54  SetCaloTriggerPatchInfoName("EmcalTriggers");
55  fTriggerSelections.SetOwner(kTRUE);
56 }
57 
59  AliAnalysisTaskEmcal(name, kTRUE),
61  fGlobalDecisionContainerName("EmcalTriggerDecision"),
63  fSelectionQA()
64 {
65  SetCaloTriggerPatchInfoName("EmcalTriggers");
67  fTriggerSelections.SetOwner(kTRUE);
68 }
69 
72 
73  for(auto s : fTriggerSelections) InitQA(static_cast<AliEmcalTriggerSelection *>(s));
74  for(auto q : fSelectionQA) static_cast<AliEmcalTriggerSelectionQA *>(q)->GetHistos(fOutput);
75 }
76 
79  fInputEvent->AddObject(fTriggerDecisionContainer);
80 }
81 
83  fTriggerSelections.Add(selection);
84 }
85 
88  AliEmcalTriggerSelection *selection(NULL);
89  TIter selectionIter(&fTriggerSelections);
90  while((selection = dynamic_cast<AliEmcalTriggerSelection *>(selectionIter()))){
92  }
93  return kTRUE;
94 }
95 
98  return kTRUE;
99 }
100 
103  fSelectionQA.Add(qa);
104 }
105 
107  for(auto d : *(cont->GetListOfTriggerDecisions())) {
108  AliEmcalTriggerDecision *myd = static_cast<AliEmcalTriggerDecision *>(d);
109  static_cast<AliEmcalTriggerSelectionQA *>(fSelectionQA.FindObject(myd->GetName()))->Fill(myd);
110  }
111 }
112 
114  // data
115  if(Is2011PP7TeV(period)) ConfigurePP7TeV2011();
116  if(Is2012PP(period)) ConfigurePP2012();
117  if(Is2013PPB(period)) ConfigurePPB5TeV2013();
118  if(Is2015PP5TeV(period)) ConfigurePP5TeV2015();
119  if(Is2016PP(period)) ConfigurePP2016();
120  if(Is2016PPB5TeV(period)) ConfigurePPB5TeV2016();
121  if(Is2016PPB8TeV(period)) ConfigurePPB8TeV2016();
122  if(Is2017PP5TeV(period)) ConfigurePP5TeV2017();
123  // MC
125  if(Is2012MCPP(period)) ConfigureMCPP2012();
126  if(Is2013MCPPB(period)) ConfigureMCPPB5TeV2013();
130  if(Is2016MCPP(period)) ConfigureMCPP2016();
132 }
133 
135  TString datasetstring(dataset);
136  datasetstring.ToLower();
137  if(datasetstring.Length() != 6) return false; // not data period
138  if(datasetstring.Contains("lhc11")){
139  auto subperiod = datasetstring[5];
140  if(subperiod == 'c' || subperiod == 'd') return true;
141  }
142  return false;
143 }
144 
146  TString datasetstring(dataset);
147  datasetstring.ToLower();
148  if(datasetstring.Length() != 6) return false; // not data period
149  if(datasetstring.Contains("lhc12")){
150  auto subperiod = datasetstring[5];
151  if(subperiod > 'b' && subperiod < 'j') return true;
152  }
153  return false;
154 }
156  TString datasetstring(dataset);
157  datasetstring.ToLower();
158  if(datasetstring.Length() != 6) return false; // not data period
159  if(datasetstring.Contains("lhc13")){
160  auto subperiod = datasetstring[5];
161  if(subperiod > 'a' && subperiod < 'g') return true;
162  }
163  return false;
164 }
165 
167  TString datasetstring(dataset);
168  datasetstring.ToLower();
169  if(datasetstring.Length() != 6) return false; // not data period
170  if(datasetstring.Contains("lhc15n")) return true;
171  return false;
172 }
173 
175  TString datasetstring(dataset);
176  datasetstring.ToLower();
177  if(datasetstring.Length() != 6) return false; // not data period
178  if(datasetstring.Contains("lhc16") || datasetstring.Contains("lhc17") || datasetstring.Contains("lhc18")){
179  auto subperiod = datasetstring[5];
180  if(datasetstring.Contains("lhc16")){
181  if(subperiod > 'g' && subperiod < 'q') return true;
182  }
183  if(datasetstring.Contains("lhc17")) {
184  if((subperiod > 'c' && subperiod < 'n') || (subperiod == 'o') || (subperiod < 'r')) return true;
185  }
186  if(datasetstring.Contains("lhc18")) {
187  // 2018 runs will follow when taken
188  return true;
189  }
190  }
191  return false;
192 }
193 
195  TString datasetstring(dataset);
196  datasetstring.ToLower();
197  if(datasetstring.Length() != 6) return false; // not data period
198  if(datasetstring.Contains("lhc16")){
199  auto subperiod = datasetstring[5];
200  if(subperiod == 'q' || subperiod == 't') return true;
201  }
202  return false;
203 }
204 
206  TString datasetstring(dataset);
207  datasetstring.ToLower();
208  if(datasetstring.Length() != 6) return false; // not data period
209  if(datasetstring.Contains("lhc16")){
210  auto subperiod = datasetstring[5];
211  if(subperiod == 'r' || subperiod == 's') return true;
212  }
213  return false;
214 }
215 
217  TString datasetstring(dataset);
218  datasetstring.ToLower();
219  if(datasetstring.Length() != 6) return false; // not data period
220  if(datasetstring.Contains("lhc17")){
221  auto subperiod = datasetstring[5];
222  if(subperiod == 'p' || subperiod == 'q') return true;
223  }
224  return false;
225 }
226 
228  std::vector<TString> supportedProductions = {"lhc14k1a", "lhc14b7", "lhc14k1b"};
229  return IsSupportedMCSample(dataset, supportedProductions);
230 }
231 
233  std::vector<TString> supportedProductions = {"lhc15h1", "lhc15h2", "lhc16a1", "lhc16c2", "lhc17g5a", "lhc17g5"};
234  return IsSupportedMCSample(dataset, supportedProductions);
235 }
236 
238  std::vector<TString> supportedProductions = {"lhc17g6a", "lhc16c3a", "lhc16c3b", "lhc18j5", "lhc19a4"};
239  return IsSupportedMCSample(dataset, supportedProductions);
240 }
241 
243  std::vector<TString> supportedProductions = {"lhc17e2", "lhc18j3"};
244  return IsSupportedMCSample(dataset, supportedProductions);
245 }
246 
248  std::vector<TString> supportedProductions = {"lhc17f8", "lhc18f5", "lhc18g2", "lhc19a1", "lhc19d3"};
249  return IsSupportedMCSample(dataset, supportedProductions);
250 }
251 
253  std::vector<TString> supportedProductions = {"lhc18f3", "lhc17g8a"};
254  return IsSupportedMCSample(dataset, supportedProductions);
255 }
256 
258  std::vector<TString> supportedProductions = {"lhc18f3b", "lhc18f3c", "lhc18b9b", "lhc18b9c"};
259  return IsSupportedMCSample(dataset, supportedProductions);
260 }
261 
263  std::vector<TString> supportedProductions = {"lhc17l3b", "lhc18j2"};
264  return IsSupportedMCSample(dataset, supportedProductions);
265 }
266 
267 Bool_t AliAnalysisTaskEmcalTriggerSelection::IsSupportedMCSample(const char *dataset, std::vector<TString> &supportedProductions) const{
268  TString datasetstring(dataset);
269  datasetstring.ToLower();
270  bool found(false);
271  for(const auto & prod : supportedProductions) {
272  if(datasetstring.Contains(prod)) {
273  found = true;
274  break;
275  }
276  }
277  return found;
278 }
279 
285  emcl0cuts->SetUseRecalcPatches(true);
286  emcl0cuts->SetThreshold(292);
287  this->AddTriggerSelection(new AliEmcalTriggerSelection("EMCL0", emcl0cuts));
288 }
289 
295  emcl0cuts->SetUseSimpleOfflinePatches(true);
296  emcl0cuts->SetThreshold(5.5);
297  this->AddTriggerSelection(new AliEmcalTriggerSelection("EMCL0", emcl0cuts));
298 }
299 
305  eg1cuts->SetUseRecalcPatches(true);
306  eg1cuts->SetThreshold(130);
307  this->AddTriggerSelection(new AliEmcalTriggerSelection("EGA", eg1cuts));
308 
313  ej1cuts->SetUseRecalcPatches(true);
314  ej1cuts->SetThreshold(200);
315  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJE", ej1cuts));
316 }
317 
323  eg1cuts->SetUseSimpleOfflinePatches(true);
324  eg1cuts->SetThreshold(10.);
325  this->AddTriggerSelection(new AliEmcalTriggerSelection("EGA", eg1cuts, new AliEmcalTriggerAlias("EGA;EG1")));
326 
331  ej1cuts->SetUseSimpleOfflinePatches(true);
332  ej1cuts->SetThreshold(15.5);
333  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJE", ej1cuts, new AliEmcalTriggerAlias("EJE;EJ1")));
334 }
335 
341  emcl0cuts->SetUseRecalcPatches(true);
342  emcl0cuts->SetThreshold(158);
343  this->AddTriggerSelection(new AliEmcalTriggerSelection("EMCL0", emcl0cuts));
344 
349  eg1cuts->SetUseRecalcPatches(true);
350  eg1cuts->SetThreshold(140);
351  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG1", eg1cuts));
352 
357  eg2cuts->SetUseRecalcPatches(true);
358  eg2cuts->SetUseSimpleOfflinePatches(true);
359  eg2cuts->SetThreshold(89);
360  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG2", eg2cuts));
361 
366  ej1cuts->SetUseRecalcPatches(true);
367  ej1cuts->SetThreshold(260);
368  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ1", ej1cuts));
369 
374  ej2cuts->SetUseRecalcPatches(true);
375  ej2cuts->SetThreshold(127);
376  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ2", ej2cuts));
377 }
378 
384  emcl0cuts->SetUseSimpleOfflinePatches(true);
385  emcl0cuts->SetThreshold(3.);
386  this->AddTriggerSelection(new AliEmcalTriggerSelection("EMCL0", emcl0cuts));
387 
392  eg1cuts->SetUseSimpleOfflinePatches(true);
393  eg1cuts->SetThreshold(10.5);
394  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG1", eg1cuts));
395 
400  eg2cuts->SetUseSimpleOfflinePatches(true);
401  eg2cuts->SetThreshold(6.7);
402  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG2", eg2cuts));
403 
408  ej1cuts->SetUseSimpleOfflinePatches(true);
409  ej1cuts->SetThreshold(20.);
410  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ1", ej1cuts));
411 
416  ej2cuts->SetUseSimpleOfflinePatches(true);
417  ej2cuts->SetThreshold(10.);
418  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ2", ej2cuts));
419 
420 }
421 
427  emcl0cuts->SetUseRecalcPatches(true);
428  emcl0cuts->SetThreshold(263);
429  this->AddTriggerSelection(new AliEmcalTriggerSelection("EMCL0", emcl0cuts));
430 
435  dmcl0cuts->SetUseRecalcPatches(true);
436  dmcl0cuts->SetThreshold(263);
437  this->AddTriggerSelection(new AliEmcalTriggerSelection("DMCL0", dmcl0cuts));
438 
439 }
440 
446  emcl0cuts->SetUseSimpleOfflinePatches(true);
447  emcl0cuts->SetThreshold(5.);
448  this->AddTriggerSelection(new AliEmcalTriggerSelection("EMCL0", emcl0cuts));
449 
454  dmcl0cuts->SetUseSimpleOfflinePatches(true);
455  dmcl0cuts->SetThreshold(5.);
456  this->AddTriggerSelection(new AliEmcalTriggerSelection("DMCL0", dmcl0cuts));
457 
458 }
459 
465  eg1cuts->SetUseRecalcPatches(true);
466  eg1cuts->SetThreshold(115);
467  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG1", eg1cuts));
468 
473  eg2cuts->SetUseRecalcPatches(true);
474  eg2cuts->SetUseSimpleOfflinePatches(true);
475  eg2cuts->SetThreshold(51);
476  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG2", eg2cuts));
477 
482  dg1cuts->SetUseRecalcPatches(true);
483  dg1cuts->SetThreshold(115);
484  this->AddTriggerSelection(new AliEmcalTriggerSelection("DG1", dg1cuts));
485 
490  dg2cuts->SetUseRecalcPatches(true);
491  dg2cuts->SetThreshold(51);
492  this->AddTriggerSelection(new AliEmcalTriggerSelection("DG2", dg2cuts));
493 
498  ej1cuts->SetUseRecalcPatches(true);
499  ej1cuts->SetThreshold(255);
500  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ1", ej1cuts));
501 
506  ej2cuts->SetUseRecalcPatches(true);
507  ej2cuts->SetThreshold(204);
508  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ2", ej2cuts));
509 
514  dj1cuts->SetUseRecalcPatches(true);
515  dj1cuts->SetThreshold(255);
516  this->AddTriggerSelection(new AliEmcalTriggerSelection("DJ1", dj1cuts));
517 
522  dj2cuts->SetUseRecalcPatches(true);
523  dj2cuts->SetThreshold(204);
524  this->AddTriggerSelection(new AliEmcalTriggerSelection("DJ2", dj2cuts));
525 
526 }
527 
533  eg1cuts->SetUseSimpleOfflinePatches(true);
534  eg1cuts->SetThreshold(9.);
535  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG1", eg1cuts));
536 
541  eg2cuts->SetUseSimpleOfflinePatches(true);
542  eg2cuts->SetThreshold(4.);
543  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG2", eg2cuts));
544 
549  dg1cuts->SetUseSimpleOfflinePatches(true);
550  dg1cuts->SetThreshold(9.);
551  this->AddTriggerSelection(new AliEmcalTriggerSelection("DG1", dg1cuts));
552 
557  dg2cuts->SetUseSimpleOfflinePatches(true);
558  dg2cuts->SetThreshold(4.);
559  this->AddTriggerSelection(new AliEmcalTriggerSelection("DG2", dg2cuts));
560 
565  ej1cuts->SetUseSimpleOfflinePatches(true);
566  ej1cuts->SetThreshold(19.);
567  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ1", ej1cuts));
568 
573  ej2cuts->SetUseSimpleOfflinePatches(true);
574  ej2cuts->SetThreshold(14.);
575  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ2", ej2cuts));
576 
581  dj1cuts->SetUseSimpleOfflinePatches(true);
582  dj1cuts->SetThreshold(19.);
583  this->AddTriggerSelection(new AliEmcalTriggerSelection("DJ1", dj1cuts));
584 
589  dj2cuts->SetUseSimpleOfflinePatches(true);
590  dj2cuts->SetThreshold(14.);
591  this->AddTriggerSelection(new AliEmcalTriggerSelection("DJ2", dj2cuts));
592 }
593 
599  eg1cuts->SetUseRecalcPatches(true);
600  eg1cuts->SetThreshold(140);
601  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG1", eg1cuts));
602 
607  eg2cuts->SetUseRecalcPatches(true);
608  eg2cuts->SetUseSimpleOfflinePatches(true);
609  eg2cuts->SetThreshold(83);
610  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG2", eg2cuts));
611 
616  dg1cuts->SetUseRecalcPatches(true);
617  dg1cuts->SetThreshold(140);
618  this->AddTriggerSelection(new AliEmcalTriggerSelection("DG1", dg1cuts));
619 
624  dg2cuts->SetUseRecalcPatches(true);
625  dg2cuts->SetThreshold(83);
626  this->AddTriggerSelection(new AliEmcalTriggerSelection("DG2", dg2cuts));
627 
632  ej1cuts->SetUseRecalcPatches(true);
633  ej1cuts->SetThreshold(318);
634  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ1", ej1cuts));
635 
640  ej2cuts->SetUseRecalcPatches(true);
641  ej2cuts->SetThreshold(255);
642  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ2", ej2cuts));
643 
648  dj1cuts->SetUseRecalcPatches(true);
649  dj1cuts->SetThreshold(318);
650  this->AddTriggerSelection(new AliEmcalTriggerSelection("DJ1", dj1cuts));
651 
656  dj2cuts->SetUseRecalcPatches(true);
657  dj2cuts->SetThreshold(255);
658  this->AddTriggerSelection(new AliEmcalTriggerSelection("DJ2", dj2cuts));
659 
660 }
661 
667  eg1cuts->SetUseSimpleOfflinePatches(true);
668  eg1cuts->SetThreshold(11.);
669  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG1", eg1cuts));
670 
675  eg2cuts->SetUseSimpleOfflinePatches(true);
676  eg2cuts->SetThreshold(6.5);
677  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG2", eg2cuts));
678 
683  dg1cuts->SetUseSimpleOfflinePatches(true);
684  dg1cuts->SetThreshold(11.);
685  this->AddTriggerSelection(new AliEmcalTriggerSelection("DG1", dg1cuts));
686 
691  dg2cuts->SetUseSimpleOfflinePatches(true);
692  dg2cuts->SetThreshold(6.5);
693  this->AddTriggerSelection(new AliEmcalTriggerSelection("DG2", dg2cuts));
694 
699  ej1cuts->SetUseSimpleOfflinePatches(true);
700  ej1cuts->SetThreshold(25.);
701  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ1", ej1cuts));
702 
707  ej2cuts->SetUseSimpleOfflinePatches(true);
708  ej2cuts->SetThreshold(20.);
709  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ2", ej2cuts));
710 
715  dj1cuts->SetUseSimpleOfflinePatches(true);
716  dj1cuts->SetThreshold(25.);
717  this->AddTriggerSelection(new AliEmcalTriggerSelection("DJ1", dj1cuts));
718 
723  dj2cuts->SetUseSimpleOfflinePatches(true);
724  dj2cuts->SetThreshold(20.);
725  this->AddTriggerSelection(new AliEmcalTriggerSelection("DJ2", dj2cuts));
726 }
727 
733  eg1cuts->SetUseRecalcPatches(true);
734  eg1cuts->SetThreshold(102);
735  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG1", eg1cuts));
736 
741  eg2cuts->SetUseRecalcPatches(true);
742  eg2cuts->SetUseSimpleOfflinePatches(true);
743  eg2cuts->SetThreshold(70);
744  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG2", eg2cuts));
745 
750  dg1cuts->SetUseRecalcPatches(true);
751  dg1cuts->SetThreshold(102);
752  this->AddTriggerSelection(new AliEmcalTriggerSelection("DG1", dg1cuts));
753 
758  dg2cuts->SetUseRecalcPatches(true);
759  dg2cuts->SetThreshold(70);
760  this->AddTriggerSelection(new AliEmcalTriggerSelection("DG2", dg2cuts));
761 
766  ej1cuts->SetUseRecalcPatches(true);
767  ej1cuts->SetThreshold(293);
768  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ1", ej1cuts));
769 
774  ej2cuts->SetUseRecalcPatches(true);
775  ej2cuts->SetThreshold(229);
776  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ2", ej2cuts));
777 
782  dj1cuts->SetUseRecalcPatches(true);
783  dj1cuts->SetThreshold(293);
784  this->AddTriggerSelection(new AliEmcalTriggerSelection("DJ1", dj1cuts));
785 
790  dj2cuts->SetUseRecalcPatches(true);
791  dj2cuts->SetThreshold(229);
792  this->AddTriggerSelection(new AliEmcalTriggerSelection("DJ2", dj2cuts));
793 
794 }
795 
801  eg1cuts->SetUseSimpleOfflinePatches(true);
802  eg1cuts->SetThreshold(8.);
803  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG1", eg1cuts));
804 
809  eg2cuts->SetUseSimpleOfflinePatches(true);
810  eg2cuts->SetThreshold(5.5);
811  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG2", eg2cuts));
812 
817  dg1cuts->SetUseSimpleOfflinePatches(true);
818  dg1cuts->SetThreshold(8.);
819  this->AddTriggerSelection(new AliEmcalTriggerSelection("DG1", dg1cuts));
820 
825  dg2cuts->SetUseSimpleOfflinePatches(true);
826  dg2cuts->SetThreshold(5.5);
827  this->AddTriggerSelection(new AliEmcalTriggerSelection("DG2", dg2cuts));
828 
833  ej1cuts->SetUseSimpleOfflinePatches(true);
834  ej1cuts->SetThreshold(23.);
835  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ1", ej1cuts));
836 
841  ej2cuts->SetUseSimpleOfflinePatches(true);
842  ej2cuts->SetThreshold(18.);
843  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ2", ej2cuts));
844 
849  dj1cuts->SetUseSimpleOfflinePatches(true);
850  dj1cuts->SetThreshold(23.);
851  this->AddTriggerSelection(new AliEmcalTriggerSelection("DJ1", dj1cuts));
852 
857  dj2cuts->SetUseSimpleOfflinePatches(true);
858  dj2cuts->SetThreshold(18.);
859  this->AddTriggerSelection(new AliEmcalTriggerSelection("DJ2", dj2cuts));
860 }
861 
867  eg1cuts->SetUseRecalcPatches(true);
868  eg1cuts->SetThreshold(115);
869  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG1", eg1cuts));
870 
875  eg2cuts->SetUseRecalcPatches(true);
876  eg2cuts->SetUseSimpleOfflinePatches(true);
877  eg2cuts->SetThreshold(51);
878  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG2", eg2cuts));
879 
884  dg1cuts->SetUseRecalcPatches(true);
885  dg1cuts->SetThreshold(115);
886  this->AddTriggerSelection(new AliEmcalTriggerSelection("DG1", dg1cuts));
887 
892  dg2cuts->SetUseRecalcPatches(true);
893  dg2cuts->SetThreshold(51);
894  this->AddTriggerSelection(new AliEmcalTriggerSelection("DG2", dg2cuts));
895 
900  ej1cuts->SetUseRecalcPatches(true);
901  ej1cuts->SetThreshold(255);
902  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ1", ej1cuts));
903 
908  ej2cuts->SetUseRecalcPatches(true);
909  ej2cuts->SetThreshold(204);
910  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ2", ej2cuts));
911 
916  dj1cuts->SetUseRecalcPatches(true);
917  dj1cuts->SetThreshold(255);
918  this->AddTriggerSelection(new AliEmcalTriggerSelection("DJ1", dj1cuts));
919 
924  dj2cuts->SetUseRecalcPatches(true);
925  dj2cuts->SetThreshold(204);
926  this->AddTriggerSelection(new AliEmcalTriggerSelection("DJ2", dj2cuts));
927 
928 }
929 
935  eg1cuts->SetUseSimpleOfflinePatches(true);
936  eg1cuts->SetThreshold(9.);
937  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG1", eg1cuts));
938 
943  eg2cuts->SetUseSimpleOfflinePatches(true);
944  eg2cuts->SetThreshold(4.);
945  this->AddTriggerSelection(new AliEmcalTriggerSelection("EG2", eg2cuts));
946 
951  dg1cuts->SetUseSimpleOfflinePatches(true);
952  dg1cuts->SetThreshold(9.);
953  this->AddTriggerSelection(new AliEmcalTriggerSelection("DG1", dg1cuts));
954 
959  dg2cuts->SetUseSimpleOfflinePatches(true);
960  dg2cuts->SetThreshold(4.);
961  this->AddTriggerSelection(new AliEmcalTriggerSelection("DG2", dg2cuts));
962 
967  ej1cuts->SetUseSimpleOfflinePatches(true);
968  ej1cuts->SetThreshold(19.);
969  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ1", ej1cuts));
970 
975  ej2cuts->SetUseSimpleOfflinePatches(true);
976  ej2cuts->SetThreshold(14.);
977  this->AddTriggerSelection(new AliEmcalTriggerSelection("EJ2", ej2cuts));
978 
983  dj1cuts->SetUseSimpleOfflinePatches(true);
984  dj1cuts->SetThreshold(19.);
985  this->AddTriggerSelection(new AliEmcalTriggerSelection("DJ1", dj1cuts));
986 
991  dj2cuts->SetUseSimpleOfflinePatches(true);
992  dj2cuts->SetThreshold(14.);
993  this->AddTriggerSelection(new AliEmcalTriggerSelection("DJ2", dj2cuts));
994 }
995 
997  using YAMLhandler = PWG::Tools::AliYAMLConfiguration;
998  YAMLhandler configuration;
999  configuration.AddConfiguration(configfile, "user");
1000  configuration.Initialize();
1001  std::string namecontainer, acceptance, patchtype, energydef, energysource;
1002  std::vector<std::string> triggerclasses;
1003  configuration.GetProperty("containername", namecontainer);
1004  configuration.GetProperty("energydef", energydef);
1005  configuration.GetProperty("energysource", energysource);
1006  configuration.GetProperty("triggerclasses", triggerclasses);
1007  bool isOfflineSimple = energysource.find("Offline") != std::string::npos,
1008  isRecalc = energysource.find("Recalc") != std::string::npos;
1009 
1010  SetGlobalDecisionContainerName(namecontainer.data());
1011 
1013  try {
1014  selectionmethod = DecodeEnergyDefinition(energydef);
1015  } catch(ConfigValueException &e) {
1016  AliErrorStream() << e.what() << " - not processing trigger classes" << std::endl;
1017  return;
1018  }
1019  for(auto t : triggerclasses) {
1020  double threshold;
1021  configuration.GetProperty(Form("%s:acceptance", t.data()), acceptance);
1022  configuration.GetProperty(Form("%s:patchtype", t.data()), patchtype);
1023  configuration.GetProperty(Form("%s:threshold", t.data()), threshold);
1024 
1026  try {
1027  cuts->SetAcceptanceType(DecodeAcceptanceString(acceptance));
1028  cuts->SetPatchType(DecodePatchTypeString(patchtype));
1029  } catch(ConfigValueException &e){
1030  AliErrorStream() << e.what() << " - not adding trigger class " << t << std::endl;
1031  delete cuts;
1032  continue;
1033  }
1034 
1035  cuts->SetSelectionMethod(selectionmethod);
1036  if(isOfflineSimple) cuts->SetUseSimpleOfflinePatches();
1037  if(isRecalc) cuts->SetUseRecalcPatches();
1038  cuts->SetThreshold(threshold);
1039  this->AddTriggerSelection(new AliEmcalTriggerSelection(t.data(), cuts));
1040  }
1041 }
1042 
1044  std::unordered_map<std::string, AliEmcalTriggerSelectionCuts::AcceptanceType_t> mapacceptance = {
1047  };
1048  auto result = mapacceptance.find(acceptancestring);
1049  if(result == mapacceptance.end()) throw ConfigValueException("accpetance", acceptancestring.data());
1050  return result->second;
1051 }
1052 
1054  std::unordered_map<std::string, AliEmcalTriggerSelectionCuts::PatchType_t> mappatchtype = {
1061  };
1062  auto result = mappatchtype.find(patchtypestring);
1063  if(result == mappatchtype.end()) throw ConfigValueException("accpetance", patchtypestring.data());
1064  return result->second;
1065 }
1066 
1068  std::unordered_map<std::string, AliEmcalTriggerSelectionCuts::SelectionMethod_t> mapenergydef = {
1073  };
1074  auto result = mapenergydef.find(energydefstring);
1075  if(result == mapenergydef.end()) throw ConfigValueException("accpetance", energydefstring.data());
1076  return result->second;
1077 
1078 }
1079 
1080 void AliAnalysisTaskEmcalTriggerSelection::PrintStream(std::ostream &stream) const {
1081  stream << "Task: " << GetName() << ", name of the output container: " << fGlobalDecisionContainerName << std::endl << std::endl;
1082  stream << "Trigger classes: " << std::endl;
1083  for(const auto c : this->fTriggerSelections){
1085  stream << *sel << std::endl;
1086  }
1087 }
1088 
1090  TNamed(),
1091  fMaxPatchADC(nullptr),
1092  fMaxPatchEnergy(nullptr),
1093  fMaxPatchEnergySmeared(nullptr)
1094 {
1095 }
1096 
1098  TNamed(sel->GetName(), ""),
1102 {
1103  fMaxPatchADC = new TH1D(Form("hMaxPatchADC%s", GetName()), "Max. patch ADC", 1000, 0., 1000);
1104  fMaxPatchEnergy = new TH1D(Form("hMaxPatchEnergy%s", GetName()), "Max. patch energy", 1000, 0., 100);
1105  fMaxPatchEnergySmeared = new TH1D(Form("hMaxPatchEnergySmeared%s", GetName()), "Max. patch smeared energy", 1000, 0., 100);
1106 }
1107 
1109  TNamed(ref),
1113 {
1114 }
1115 
1117  TNamed::operator=(ref);
1118  if(this != &ref) {
1119  fMaxPatchADC = ref.fMaxPatchADC;
1122  }
1123  return *this;
1124 }
1125 
1127  if(decision->GetMainPatch()){
1128  fMaxPatchADC->Fill(decision->GetMainPatch()->GetADCAmp());
1129  fMaxPatchEnergy->Fill(decision->GetMainPatch()->GetPatchE());
1130  fMaxPatchEnergySmeared->Fill(decision->GetMainPatch()->GetSmearedEnergy());
1131  }
1132 }
1133 
1135  targetlist->Add(fMaxPatchADC);
1136  targetlist->Add(fMaxPatchEnergy);
1137  targetlist->Add(fMaxPatchEnergySmeared);
1138 
1139 }
1140 
1142  fKey(key),
1143  fValue(value),
1144  fMessage()
1145 {
1146  std::stringstream msgbuilder;
1147  msgbuilder << "Improper value for key " << fKey << ": " << fValue;
1148  fMessage = msgbuilder.str();
1149 }
1150 
1151 }
1152 }
1153 
1154 std::ostream &operator<<(std::ostream &stream, const PWG::EMCAL::AliAnalysisTaskEmcalTriggerSelection &task) {
1155  task.PrintStream(stream);
1156  return stream;
1157 }
Class for the selection of trigger patches in the EMCAL triggered event selection.
Object performing offline EMCAL trigger selection.
AliEmcalTriggerSelectionCuts::AcceptanceType_t DecodeAcceptanceString(const std::string &acceptancestring)
void ConfigurePP2016()
Trigger configuration for run2 pp (2016 - 2018) - data mode.
Container for trigger decision.
void MakeQA(const AliEmcalTriggerDecisionContainer *cont)
Fill QA histograms for the event.
virtual void UserExecOnce()
Initializations performed when the first event is created.
void ConfigureMCPP5TeV2017()
Trigger configuration for MC anchored to run2 pp 5 TeV (2017)
void SetGlobalDecisionContainerName(const char *name)
Set the name of the global trigger decision container.
void SetSelectionMethod(SelectionMethod_t selectionMethod)
void ConfigureMCPPB8TeV2016()
Trigger configuration for MC anchored to run2 pPb 8 TeV (2016)
void AutoConfigure(const char *period)
Automatically configure trigger decision handler for different periods.
TString fGlobalDecisionContainerName
Name of the global trigger selection.
Base task in the EMCAL framework.
virtual Bool_t FillHistograms()
Filling basic QA Histograms of the trigger selection task.
void ConfigurePP2012()
Trigger configuration for run1 pp (2012) - data mode.
virtual void UserCreateOutputObjects()
Initialization of output container.
void ConfigurePPB5TeV2016()
Trigger configuration for run2 pPb 5TeV (2016) - data mode.
void ConfigureMCPP2012()
Trigger configuration for MC anchored to run1 pp (2012)
TCanvas * c
Definition: TestFitELoss.C:172
void InitQA(const AliEmcalTriggerSelection *const sel)
Initialize QA histograms for trigger selection.
Bool_t IsSupportedMCSample(const char *period, std::vector< TString > &supportedProductions) const
void ConfigureMCPPB5TeV2013()
Trigger configuration for MC anchored to run1 pPb (2013)
void SetCaloTriggerPatchInfoName(const char *n)
Namespace for EMCAL framework classes and task.
void ConfigurePPB5TeV2013()
Trigger configuration for run1 pPb (2013) - data mode.
const AliEMCALTriggerPatchInfo * GetMainPatch() const
Get the highest energetic trigger patch of the event firing the trigger.
AliEmcalTriggerDecisionContainer * GetGlobalTriggerDecisionContainer() const
Find the main trigger container in the input event.
void GetHistos(Double_t lowLim, Double_t highLim, Dir *resp, Dir *data, TDirectory *out)
Definition: UnfoldMult.C:261
const TList * GetListOfTriggerDecisions() const
Get container with trigger decision results.
void PrintStream(std::ostream &stream) const
Print information about the trigger decision container to the output stream.
AliEmcalTriggerSelectionQA & operator=(const AliEmcalTriggerSelectionQA &ref)
Assignment operator.
Definition: External.C:212
void GetHistos(TList *targetlist) const
Fill histograms of this QA component into the targetlist.
AliEmcalTriggerSelectionCuts::SelectionMethod_t DecodeEnergyDefinition(const std::string &energydefstring)
Namespace for PWG framework classes.
void Reset()
Clear container with trigger decisions.
AliEmcalTriggerDecision * MakeDecison(const TClonesArray *const reconstructedPatches) const
ConfigValueException(const char *key, const char *value)
Construct a new ConfigValueException object.
AliEmcalList * fOutput
!output list
Task providing an event selection for EMCAL-triggered events based on the reconstructed EMCAL trigger...
void ConfigureMCPPB5TeV2016()
Trigger configuration for MC anchored to run2 pPb 5 TeV (2016)
YAML configuration class for AliPhysics.
void SetMakeGeneralHistograms(Bool_t g)
Enable general histograms.
void ConfigureMCPP7TeV2011()
Trigger configuration for MC anchored to run1 pp 7TeV (2011)
TClonesArray * fTriggerPatchInfo
!trigger patch info array
void SetAcceptanceType(AcceptanceType_t acceptance)
void ConfigureFromYAML(const char *yamlconfig)
Configure task using YAML configuration file.
void ConfigureMCPP2016()
Trigger configuration for MC anchored to run2 pp (2016-2018)
AliEmcalTriggerSelectionCuts::PatchType_t DecodePatchTypeString(const std::string &patchtypestring)
AliEmcalTriggerDecisionContainer * fTriggerDecisionContainer
Trigger decision container objects.
int AddConfiguration(std::string configurationFilename, std::string configurationName="")
void UserCreateOutputObjects()
Main initialization function on the worker.
bool Bool_t
Definition: External.C:53
void ConfigurePP5TeV2017()
Trigger configuration for run2 pp 5TeV (2017) - data mode.
friend std::ostream & operator<<(std::ostream &stream, const AliAnalysisTaskEmcalTriggerSelection &task)
Output stream operator.
void AddTriggerSelection(AliEmcalTriggerSelection *const selection)
Add trigger selection to the trigger selection task.
void ConfigurePP7TeV2011()
Trigger configuration for data anchored to run1 pp 7TeV (2011)
Class for trigger aliases.
void ConfigurePPB8TeV2016()
Trigger configuration for run2 pPb 8TeV (2016) - data mode.
TString prod[]
productions to be compared, directory name
void ConfigurePP5TeV2015()
Trigger configuration for run2 pp 5TeV (2015) - data mode.
void AddTriggerDecision(AliEmcalTriggerDecision *const decision)
Add trigger decision to the container.
void ConfigureMCPP5TeV2015()
Trigger configuration for MC anchored to run2 pp 5TeV (2015)