AliPhysics  15d9304 (15d9304)
 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 
104 AliVEvent * AliEmcalContainerUtils::GetEvent(AliVEvent * inputEvent, bool isEmbedding)
105 {
106  AliVEvent * event = 0;
107  if (isEmbedding) {
109  if (!embedding) return 0;
110 
111  event = embedding->GetExternalEvent();
112  }
113  else {
114  event = inputEvent;
115  }
116 
117  return event;
118 }
119 
static std::string DetermineUseDefaultName(InputObject_t objType, bool esdMode, bool returnObjectType=false)
Declaration of class AliAnalysisTaskEmcalEmbeddingHelper.
static AliVEvent * GetEvent(AliVEvent *inputEvent, bool isEmbedding=false)
InputObject_t
Type of input object to be created
Implementation of task to embed external events.
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()