AliPhysics  0937c79 (0937c79)
AliAnalysisTaskEmcalTriggerSelection.h
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 #ifndef ALIANALYSISTASKEMCALTRIGGERSELECTION_H
28 #define ALIANALYSISTASKEMCALTRIGGERSELECTION_H
29 
30 #include <iosfwd>
31 #include <exception>
32 #include <string>
33 #include <vector>
34 #include <TList.h>
35 #include <TNamed.h>
36 #include <TString.h>
37 #include "AliAnalysisTaskEmcal.h"
39 
40 // operator<< has to be forward declared carefully to stay in the global namespace so that it works with CINT.
41 // For generally how to keep the operator in the global namespace, See: https://stackoverflow.com/a/38801633
42 namespace PWG { namespace EMCAL { class AliAnalysisTaskEmcalTriggerSelection; } }
43 std::ostream & operator<< (std::ostream &in, const PWG::EMCAL::AliAnalysisTaskEmcalTriggerSelection &task);
44 
45 namespace PWG{
46 namespace EMCAL {
47 
48 class AliEmcalTriggerDecision;
49 class AliEmcalTriggerDecisionContainer;
50 class AliEmcalTriggerSelection;
51 
145 public:
146 
156  class ConfigValueException : public std::exception {
157  public:
166  ConfigValueException(const char *key, const char *value);
167 
171  virtual ~ConfigValueException() throw() {}
172 
177  const char *what() const throw() { return fMessage.data(); }
178 
179  const std::string &getKey() const { return fKey; }
180  const std::string &getValue() const { return fValue; }
181 
182  private:
183  std::string fKey;
184  std::string fValue;
185  std::string fMessage;
186  };
193 
208  AliAnalysisTaskEmcalTriggerSelection(const char *name);
209 
214 
227  void AddTriggerSelection(AliEmcalTriggerSelection * const selection);
228 
233  const TList &GetListOfTriggerSelections() const { return fTriggerSelections; }
234 
254  void SetGlobalDecisionContainerName(const char *name) { fGlobalDecisionContainerName = name; }
255 
260  const TString &GetGlobalDecisionContainerName() const { return fGlobalDecisionContainerName; }
261 
330  void ConfigureFromYAML(const char *yamlconfig);
331 
335  void AutoConfigure(const char *period);
336 
357  void ConfigurePP2012();
358 
379  void ConfigureMCPP2012();
380 
410  void ConfigurePP2016();
411 
438  void ConfigureMCPP2016();
439 
450  friend std::ostream& ::operator<<(std::ostream &stream, const AliAnalysisTaskEmcalTriggerSelection &task);
451 
452 protected:
453 
461  public:
462 
467 
476 
484 
493 
498 
503  void Fill(const AliEmcalTriggerDecision * const decision);
504 
512  void GetHistos(TList *targetlist) const;
513 
514  private:
518  };
519 
528  virtual void UserCreateOutputObjects();
529 
537  virtual void UserExecOnce();
538 
552  virtual Bool_t Run();
553 
563  virtual Bool_t FillHistograms();
564 
570  AliEmcalTriggerDecisionContainer *GetGlobalTriggerDecisionContainer() const { return fTriggerDecisionContainer; }
571 
576  void MakeQA(const AliEmcalTriggerDecisionContainer *cont);
577 
582  void InitQA(const AliEmcalTriggerSelection *const sel);
583 
584  Bool_t Is2012PP(const char *dataset) const;
585  Bool_t Is2012MCPP(const char *dataset) const;
586  Bool_t Is2016PP(const char *dataset) const;
587  Bool_t Is2016MCPP(const char *dataset) const;
588  Bool_t IsSupportedMCSample(const char *period, std::vector<TString> &supportedProductions) const;
589 
590  AliEmcalTriggerSelectionCuts::AcceptanceType_t DecodeAcceptanceString(const std::string &acceptancestring);
591  AliEmcalTriggerSelectionCuts::PatchType_t DecodePatchTypeString(const std::string &patchtypestring);
592  AliEmcalTriggerSelectionCuts::SelectionMethod_t DecodeEnergyDefinition(const std::string &energydefstring);
593 
598 
599 private:
600 
605  void PrintStream(std::ostream &stream) const;
606 
608  ClassDef(AliAnalysisTaskEmcalTriggerSelection, 1); // Task running different EMCAL trigger selections
610 };
611 
612 
613 }
614 }
615 
616 #endif /* ALIANALYSISTASKEMCALTRIGGERSELECTION_H */
Object performing offline EMCAL trigger selection.
const TString & GetGlobalDecisionContainerName() const
Provide access to the name of the global trigger decision container name.
Container for trigger decision.
void SetGlobalDecisionContainerName(const char *name)
Set the name of the global trigger decision container.
TString fGlobalDecisionContainerName
Name of the global trigger selection.
Base task in the EMCAL framework.
const TList & GetListOfTriggerSelections() const
Access to the trigger selection objects attached to the task.
Namespace for EMCAL framework classes and task.
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
Namespace for PWG framework classes.
Task providing an event selection for EMCAL-triggered events based on the reconstructed EMCAL trigger...
std::ostream & operator<<(std::ostream &stream, const AliEmcalTrackSelResultPtr &ref)
AliEmcalTriggerDecisionContainer * fTriggerDecisionContainer
Trigger decision container objects.
bool Bool_t
Definition: External.C:53
Definition: External.C:196