ROOT logo
// $Id$

AliAnalysisTaskEMCALPhoton *AddTaskEMCALPhoton(
  Double_t clusTh=2, 
  TString period="LHC11d", 
  TString geoname="EMCAL_COMPLETEV1"
)
{
  // Get the pointer to the existing analysis manager via the static access method.
  //==============================================================================
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    ::Error("AddTaskEMCALPhoton", "No analysis manager to connect to.");
    return NULL;
  }  
  
  // Create the task and configure it.
  //===========================================================================
  AliAnalysisTaskEMCALPhoton* ana = new  AliAnalysisTaskEMCALPhoton("");
  
  ana->SelectCollisionCandidates( AliVEvent::kEMC1 | AliVEvent::kMB | AliVEvent::kEMC7 | AliVEvent::kINT7);
  
  Bool_t isMC = (mgr->GetMCtruthEventHandler() != NULL);

  ana->SetClusThreshold(clusTh);
  ana->SetTrainMode(kTRUE);
  ana->SetGridMode(kTRUE);
  ana->SetMcMode(isMC);
  AliESDtrackCuts *cuts = new AliESDtrackCuts;
  cuts->SetMinNCrossedRowsTPC(50);
  cuts->SetMinRatioCrossedRowsOverFindableClustersTPC(0.7);
  cuts->SetMaxChi2PerClusterTPC(4);
  cuts->SetRequireTPCRefit(kTRUE);
  cuts->SetAcceptKinkDaughters(kTRUE);
  cuts->SetPtRange(0.2);
  cuts->SetEtaRange(-1.0,1.0);
  ana->SetTrackCuts(cuts);
  
  AliESDtrackCuts *cutsp = new AliESDtrackCuts;
  cutsp->SetMinNClustersTPC(70);
  cutsp->SetMinRatioCrossedRowsOverFindableClustersTPC(0.8);
  cutsp->SetMaxChi2PerClusterTPC(4);
  cutsp->SetRequireTPCRefit(kTRUE);
  cutsp->SetAcceptKinkDaughters(kFALSE);
  cutsp->SetMaxDCAToVertexZ(3.2);
  cutsp->SetMaxDCAToVertexXY(2.4);
  cutsp->SetDCAToVertex2D(kTRUE);
  cutsp->SetPtRange(0.2);
  cutsp->SetEtaRange(-1.0,1.0);
  ana->SetPrimTrackCuts(cutsp);
  ana->SetPeriod(period.Data());
  ana->SetGeoName(geoname.Data());
  mgr->AddTask(ana);
  
  // Create ONLY the output containers for the data produced by the task.
  // Get and connect other common input/output containers via the manager as below
  //==============================================================================
  AliAnalysisDataContainer *coutput1 = mgr->CreateContainer("histosEMCALPhoton", 
							    TList::Class(),AliAnalysisManager::kOutputContainer,
							    Form("%s", AliAnalysisManager::GetCommonFileName()));
  
  AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("photon_ana_out", TTree::Class(), AliAnalysisManager::kOutputContainer, 
							    Form("%s", AliAnalysisManager::GetCommonFileName()));
  mgr->ConnectInput  (ana, 0, mgr->GetCommonInputContainer());
  mgr->ConnectOutput (ana, 1, coutput1 );
  mgr->ConnectOutput (ana, 2, coutput2 );
   
  return ana;
}
 AddTaskEMCALPhoton.C:1
 AddTaskEMCALPhoton.C:2
 AddTaskEMCALPhoton.C:3
 AddTaskEMCALPhoton.C:4
 AddTaskEMCALPhoton.C:5
 AddTaskEMCALPhoton.C:6
 AddTaskEMCALPhoton.C:7
 AddTaskEMCALPhoton.C:8
 AddTaskEMCALPhoton.C:9
 AddTaskEMCALPhoton.C:10
 AddTaskEMCALPhoton.C:11
 AddTaskEMCALPhoton.C:12
 AddTaskEMCALPhoton.C:13
 AddTaskEMCALPhoton.C:14
 AddTaskEMCALPhoton.C:15
 AddTaskEMCALPhoton.C:16
 AddTaskEMCALPhoton.C:17
 AddTaskEMCALPhoton.C:18
 AddTaskEMCALPhoton.C:19
 AddTaskEMCALPhoton.C:20
 AddTaskEMCALPhoton.C:21
 AddTaskEMCALPhoton.C:22
 AddTaskEMCALPhoton.C:23
 AddTaskEMCALPhoton.C:24
 AddTaskEMCALPhoton.C:25
 AddTaskEMCALPhoton.C:26
 AddTaskEMCALPhoton.C:27
 AddTaskEMCALPhoton.C:28
 AddTaskEMCALPhoton.C:29
 AddTaskEMCALPhoton.C:30
 AddTaskEMCALPhoton.C:31
 AddTaskEMCALPhoton.C:32
 AddTaskEMCALPhoton.C:33
 AddTaskEMCALPhoton.C:34
 AddTaskEMCALPhoton.C:35
 AddTaskEMCALPhoton.C:36
 AddTaskEMCALPhoton.C:37
 AddTaskEMCALPhoton.C:38
 AddTaskEMCALPhoton.C:39
 AddTaskEMCALPhoton.C:40
 AddTaskEMCALPhoton.C:41
 AddTaskEMCALPhoton.C:42
 AddTaskEMCALPhoton.C:43
 AddTaskEMCALPhoton.C:44
 AddTaskEMCALPhoton.C:45
 AddTaskEMCALPhoton.C:46
 AddTaskEMCALPhoton.C:47
 AddTaskEMCALPhoton.C:48
 AddTaskEMCALPhoton.C:49
 AddTaskEMCALPhoton.C:50
 AddTaskEMCALPhoton.C:51
 AddTaskEMCALPhoton.C:52
 AddTaskEMCALPhoton.C:53
 AddTaskEMCALPhoton.C:54
 AddTaskEMCALPhoton.C:55
 AddTaskEMCALPhoton.C:56
 AddTaskEMCALPhoton.C:57
 AddTaskEMCALPhoton.C:58
 AddTaskEMCALPhoton.C:59
 AddTaskEMCALPhoton.C:60
 AddTaskEMCALPhoton.C:61
 AddTaskEMCALPhoton.C:62
 AddTaskEMCALPhoton.C:63
 AddTaskEMCALPhoton.C:64
 AddTaskEMCALPhoton.C:65
 AddTaskEMCALPhoton.C:66
 AddTaskEMCALPhoton.C:67
 AddTaskEMCALPhoton.C:68
 AddTaskEMCALPhoton.C:69
 AddTaskEMCALPhoton.C:70