ROOT logo
// $Id$

AliEmcalPatchFromCellMaker* AddTaskEmcalPatchFromCellMaker(
  Int_t       patchDim            = 32,
  Double_t    cellMinE            = 0.05,
  Bool_t      bSlideL1            = kFALSE,
  const char *patchOutName        = "EmcalPatches",
  const char *cellsName           = 0,
  const char *taskName            = "PatchFromCellMaker")
{  
  // Get the pointer to the existing analysis manager via the static access method.
  //==============================================================================
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr)
  {
    ::Error("AddTaskEmcalPatchFromCellMaker", "No analysis manager to connect to.");
    return NULL;
  }  
  
  // Check the analysis type using the event handlers connected to the analysis manager.
  //==============================================================================
  AliVEventHandler *evhand = mgr->GetInputEventHandler();
  if (!evhand) {
    ::Error("AddTaskEmcalPatchFromCellMaker", "This task requires an input event handler");
    return NULL;
  }

  TString strCellsName(cellsName);
  if(strCellsName.IsNull()) {
    if (evhand->InheritsFrom("AliESDInputHandler")) {
      strCellsName = "EMCALCells";
      ::Info("AddTaskEmcalPatchFromCellMaker", Form( "ESD analysis, cellsName = \"%s\"", strCellsName.Data() ));
    }
    else {
      strCellsName = "emcalCells";
      ::Info("AddTaskEmcalPatchFromCellMaker", Form( "AOD analysis, cellsName = \"%s\"", strCellsName.Data() ));
    }
  }

  TString strPatchOutName = Form("%s%dx%d",patchOutName,patchDim,patchDim);
  TString name = Form("%s_%s",taskName,strPatchOutName.Data());
 
   //-------------------------------------------------------
  // Init the task and do settings
  //-------------------------------------------------------

  AliEmcalPatchFromCellMaker *eTask = new AliEmcalPatchFromCellMaker(name);
  eTask->SetCaloTriggersOutName(strPatchOutName.Data());
  eTask->SetCaloCellsName(strCellsName.Data());
  eTask->SetPatchDimension(patchDim);
  eTask->SetMinCellE(cellMinE);
  eTask->ActivateSlidingPatch(bSlideL1);

  //-------------------------------------------------------
  // Final settings, pass to manager and set the containers
  //-------------------------------------------------------
  mgr->AddTask(eTask);
  
  // Create containers for input/output
  AliAnalysisDataContainer *cinput1  = mgr->GetCommonInputContainer();
  TString contname(name);
  contname += "_histos";
  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(contname.Data(),
							    TList::Class(),AliAnalysisManager::kOutputContainer,
							    Form("%s", AliAnalysisManager::GetCommonFileName()));

  mgr->ConnectInput  (eTask, 0,  cinput1 );
  mgr->ConnectOutput (eTask, 1, coutput1 );

  return eTask;
}
 AddTaskEmcalPatchFromCellMaker.C:1
 AddTaskEmcalPatchFromCellMaker.C:2
 AddTaskEmcalPatchFromCellMaker.C:3
 AddTaskEmcalPatchFromCellMaker.C:4
 AddTaskEmcalPatchFromCellMaker.C:5
 AddTaskEmcalPatchFromCellMaker.C:6
 AddTaskEmcalPatchFromCellMaker.C:7
 AddTaskEmcalPatchFromCellMaker.C:8
 AddTaskEmcalPatchFromCellMaker.C:9
 AddTaskEmcalPatchFromCellMaker.C:10
 AddTaskEmcalPatchFromCellMaker.C:11
 AddTaskEmcalPatchFromCellMaker.C:12
 AddTaskEmcalPatchFromCellMaker.C:13
 AddTaskEmcalPatchFromCellMaker.C:14
 AddTaskEmcalPatchFromCellMaker.C:15
 AddTaskEmcalPatchFromCellMaker.C:16
 AddTaskEmcalPatchFromCellMaker.C:17
 AddTaskEmcalPatchFromCellMaker.C:18
 AddTaskEmcalPatchFromCellMaker.C:19
 AddTaskEmcalPatchFromCellMaker.C:20
 AddTaskEmcalPatchFromCellMaker.C:21
 AddTaskEmcalPatchFromCellMaker.C:22
 AddTaskEmcalPatchFromCellMaker.C:23
 AddTaskEmcalPatchFromCellMaker.C:24
 AddTaskEmcalPatchFromCellMaker.C:25
 AddTaskEmcalPatchFromCellMaker.C:26
 AddTaskEmcalPatchFromCellMaker.C:27
 AddTaskEmcalPatchFromCellMaker.C:28
 AddTaskEmcalPatchFromCellMaker.C:29
 AddTaskEmcalPatchFromCellMaker.C:30
 AddTaskEmcalPatchFromCellMaker.C:31
 AddTaskEmcalPatchFromCellMaker.C:32
 AddTaskEmcalPatchFromCellMaker.C:33
 AddTaskEmcalPatchFromCellMaker.C:34
 AddTaskEmcalPatchFromCellMaker.C:35
 AddTaskEmcalPatchFromCellMaker.C:36
 AddTaskEmcalPatchFromCellMaker.C:37
 AddTaskEmcalPatchFromCellMaker.C:38
 AddTaskEmcalPatchFromCellMaker.C:39
 AddTaskEmcalPatchFromCellMaker.C:40
 AddTaskEmcalPatchFromCellMaker.C:41
 AddTaskEmcalPatchFromCellMaker.C:42
 AddTaskEmcalPatchFromCellMaker.C:43
 AddTaskEmcalPatchFromCellMaker.C:44
 AddTaskEmcalPatchFromCellMaker.C:45
 AddTaskEmcalPatchFromCellMaker.C:46
 AddTaskEmcalPatchFromCellMaker.C:47
 AddTaskEmcalPatchFromCellMaker.C:48
 AddTaskEmcalPatchFromCellMaker.C:49
 AddTaskEmcalPatchFromCellMaker.C:50
 AddTaskEmcalPatchFromCellMaker.C:51
 AddTaskEmcalPatchFromCellMaker.C:52
 AddTaskEmcalPatchFromCellMaker.C:53
 AddTaskEmcalPatchFromCellMaker.C:54
 AddTaskEmcalPatchFromCellMaker.C:55
 AddTaskEmcalPatchFromCellMaker.C:56
 AddTaskEmcalPatchFromCellMaker.C:57
 AddTaskEmcalPatchFromCellMaker.C:58
 AddTaskEmcalPatchFromCellMaker.C:59
 AddTaskEmcalPatchFromCellMaker.C:60
 AddTaskEmcalPatchFromCellMaker.C:61
 AddTaskEmcalPatchFromCellMaker.C:62
 AddTaskEmcalPatchFromCellMaker.C:63
 AddTaskEmcalPatchFromCellMaker.C:64
 AddTaskEmcalPatchFromCellMaker.C:65
 AddTaskEmcalPatchFromCellMaker.C:66
 AddTaskEmcalPatchFromCellMaker.C:67
 AddTaskEmcalPatchFromCellMaker.C:68
 AddTaskEmcalPatchFromCellMaker.C:69
 AddTaskEmcalPatchFromCellMaker.C:70
 AddTaskEmcalPatchFromCellMaker.C:71
 AddTaskEmcalPatchFromCellMaker.C:72