4 #include <AliAODEvent.h>
5 #include <AliVCaloCells.h>
6 #include <AliAODCaloCells.h>
7 #include <AliESDCaloCells.h>
26 fExternalCellsBranchName(
"emcalCells"),
27 fCreatedCellsBranchName(
"emcalCellsCombined"),
28 fInitializedCombinedCells(false),
32 AliDebug(3, Form(
"%s", __PRETTY_FUNCTION__));
55 AliDebug(3, Form(
"%s", __PRETTY_FUNCTION__));
77 AliDebug(3, Form(
"%s", __PRETTY_FUNCTION__));
113 AliDebugStream(2) <<
"Added combined calo cells \"" <<
fCombinedCells->GetName() <<
"\" with " <<
fCombinedCells->GetNumberOfCells() <<
" cells to the input event" << std::endl;
125 AliDebug(3, Form(
"%s", __PRETTY_FUNCTION__));
149 AliFatal(
"Could not retrieve external event!");
154 if (!externalCells) {
155 AliFatal(TString::Format(
"Could not retrieve cells \"%s\" from external event!",
fExternalCellsBranchName.c_str()));
180 Bool_t getCellResult = kFALSE;
182 AliDebugStream(3) <<
"Adding caloCells \"" << inputCells->GetName() <<
"\" with " << inputCells->GetNumberOfCells() <<
" cells to the combined cells" << std::endl;
185 for (
unsigned int i = 0; i < inputCells->GetNumberOfCells(); i++)
187 getCellResult = inputCells->GetCell(i, cellNumber, ampltidue, time, mcLabel, eFrac);
188 if (!getCellResult) {
189 AliWarning(TString::Format(
"Could not get cell %i from cell collection %s", i, inputCells->GetName()));
192 cellHighGain = inputCells->GetCellHighGain(i);
195 fCombinedCells->SetCell(i, cellNumber, ampltidue, time, mcLabel, eFrac, cellHighGain);
207 if (!(event->FindListObject(obj->GetName()))) {
208 event->AddObject(obj);
212 AliFatal(Form(
"Container with name %s already present. Aborting", obj->GetName()));
Bool_t fEsdMode
flag for ESD
static RegisterCorrectionComponent< AliEmcalCorrectionCellCombineCollections > reg
std::string fCreatedCellsBranchName
Name of the cell branch which will be created for the combined cells.
static std::string DetermineUseDefaultName(InputObject_t objType, bool esdMode, bool returnObjectType=false)
Declaration of class AliAnalysisTaskEmcalEmbeddingHelper.
virtual void UserCreateOutputObjects()
AliVEvent * GetExternalEvent() const
AliVEvent * InputEvent() const
virtual ~AliEmcalCorrectionCellCombineCollections()
AliVCaloCells * fCaloCells
! Pointer to CaloCells
void UserCreateOutputObjects()
AliEmcalCorrectionCellCombineCollections()
Combines two cell collections into one collection.
std::string fExternalCellsBranchName
Name of the cell branch which will be copied from the external event for the combined cells...
Base class for correction components in the EMCal correction framework.
Implementation of task to embed external events.
void CreateCombinedCells()
void AddCellsToCombinedCellObject(AliVCaloCells *inputCells)
ClassImp(AliAnalysisTaskDeltaPt) AliAnalysisTaskDeltaPt
void SetupCombinedCells()
void AddObjectToEvent(TObject *obj, AliVEvent *event, Bool_t attempt=kFALSE)
virtual Bool_t Initialize()
AliEmcalCorrectionEventManager fEventManager
Minimal task which inherits from AliAnalysisTaskSE and manages access to the event.
bool fInitializedCombinedCells
! True if the combined cells object has been initialized
AliVCaloCells * fCombinedCells
! Cells combined from the input and external events.
bool GetProperty(std::string propertyName, T &property, bool requiredProperty=true, std::string correctionName="")
Retrieve property.
static const AliAnalysisTaskEmcalEmbeddingHelper * GetInstance()