AliPhysics  d0c3a41 (d0c3a41)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliEmcalContainerUtils.cxx
Go to the documentation of this file.
1 //
2 // Containers EMCal container utility functions
3 //
4 
6 
7 #include <iostream>
8 
9 #include <AliVEvent.h>
10 #include <AliLog.h>
11 
13 
29 std::string AliEmcalContainerUtils::DetermineUseDefaultName(InputObject_t objType, bool esdMode, bool returnObjectType)
30 {
31  std::string returnValue = "";
32  if (objType == kCluster) {
33  if (esdMode == true) {
34  if (returnObjectType == true) {
35  returnValue = "AliESDCaloCluster";
36  }
37  else {
38  returnValue = "CaloClusters";
39  }
40  }
41  else {
42  if (returnObjectType == true) {
43  returnValue = "AliAODCaloCluster";
44  }
45  else {
46  returnValue = "caloClusters";
47  }
48  }
49  }
50  else if (objType == kTrack) {
51  if (esdMode == true) {
52  if (returnObjectType == true) {
53  returnValue = "AliESDtrack";
54  }
55  else {
56  returnValue = "Tracks";
57  }
58  }
59  else {
60  if (returnObjectType == true) {
61  returnValue = "AliAODTrack";
62  }
63  else {
64  returnValue = "tracks";
65  }
66  }
67  }
68  else if (objType == kCaloCells) {
69  if (esdMode == true) {
70  if (returnObjectType == true) {
71  returnValue = "AliESDCaloCells";
72  }
73  else {
74  returnValue = "EMCALCells";
75  }
76  }
77  else {
78  if (returnObjectType == true) {
79  returnValue = "AliAODCaloCells";
80  }
81  else {
82  returnValue = "emcalCells";
83  }
84  }
85  }
86  else {
87  // Default to empty if we are given an unrecognized type with "usedefault"
88  returnValue = "";
89  AliWarningGeneralStream("AliEmcalContainerUtils") << "Unrecognized combination of inputs! Passed values of input object: " << objType << ", esdMode: " << std::boolalpha << esdMode << ", returnObjectType " << returnObjectType << std::endl;
90  }
91 
92  return returnValue;
93 }
94 
105 const AliVEvent * AliEmcalContainerUtils::GetEvent(const AliVEvent * inputEvent, bool isEmbedding)
106 {
107  const AliVEvent * event = nullptr;
108  if (isEmbedding) {
110  if (!embedding) return nullptr;
111 
112  // Need the const cast as GetExternalEvent() returns a non-const event
113  event = const_cast<const AliVEvent *>(embedding->GetExternalEvent());
114  }
115  else {
116  event = inputEvent;
117  }
118 
119  return event;
120 }
121 
132 AliVEvent * AliEmcalContainerUtils::GetEvent(AliVEvent * inputEvent, bool isEmbedding)
133 {
134  return const_cast<AliVEvent *>(GetEvent(const_cast<const AliVEvent *>(inputEvent), isEmbedding));
135 }
136 
static const AliVEvent * GetEvent(const AliVEvent *inputEvent, bool isEmbedding=false)
static std::string DetermineUseDefaultName(InputObject_t objType, bool esdMode, bool returnObjectType=false)
Declaration of class AliAnalysisTaskEmcalEmbeddingHelper.
AliVEvent * GetExternalEvent() const
Retrieve the embedded event from the embedding helper.
InputObject_t
Type of input object to be created
Implementation of task to embed external events.
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()