ROOT logo
//=============================================================================
//
// *** AddTaskFemto.C ***
// ---train version ---
// This macro initialize a complete AnalysisTask object for femtoscopy.
// from:
// alicepc100/cern/users/erogocha/PbPb2.76/2011/AOD115_0-10_newPID/to_alien_newtag/AddTaskFemto.C
// ---modified to train---
//  KM: March 25, 2013
//=============================================================================

//this line for local: AliAnalysisTaskFemto *AddTaskFemtoKchHBT(const char *configMacroName="ConfigFemtoAnalysis.C", const char *configMacroParameters="" )

AliAnalysisTaskFemto *AddTaskFemtoKchHBT0010(TString configMacroName, const char *containerName="lmlist005", const char *configMacroParameters="" )
{
// Creates a proton analysis task and adds it to the analysis manager.
  
  // A. Get the pointer to the existing analysis manager via the static access method.
  //==============================================================================
  AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
  if (!mgr) {
    Error("AddTaskFemto", "No analysis manager to connect to.");
    return NULL;
  }  

  // B. Check the analysis type using the event handlers connected to the analysis
  //    manager. The availability of MC handler cann also be checked here.
  //==============================================================================
  if (!mgr->GetInputEventHandler()) {
    ::Error("AddTaskFemto", "This task requires an input event handler");
    return NULL;
  }  
  TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
  cout << "Found " <<type << " event handler" << endl;

  // C. Create the task, add it to manager.
  //===========================================================================
//  gSystem->SetIncludePath("-I$ROOTSYS/include  -I./PWG2AOD/AOD -I./PWG2femtoscopy/FEMTOSCOPY/AliFemto -I./PWG2femtoscopyUser/FEMTOSCOPY/AliFemtoUser -I$ALICE_ROOT/include");

  if (TProofMgr::GetListOfManagers()->GetEntries()) {
//     if (dynamic_cast<TProofLite *> gProof) {
//       char *macrocommand[10000];
//       sprintf(macrocommand, ".L %s", configMacroName);
//       gProof->Exec(macrocommand);
//     }
//     else
    gProof->Load(configMacroName);
  }  
  //  gROOT->LoadMacro("ConfigFemtoAnalysis.C++");

  //was befere aliroot 5.04.33: AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto",configMacroName);
  //  AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto",configMacroName,kFALSE);
  //March 2013:
  //to check localy before new tag I did symbolic link on my laplot
  //in $ALICE_ROOT/PWGCF/FEMTOSCOPY/macros/Train/
  //[root@alicethinks Train]# ln -s /scratch/AliWork/PbPb2.76/Train2013/KchHBT KchHBT
  //
  AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto","$ALICE_ROOT/"+configMacroName,configMacroParameters,kFALSE);
  //taskfemto->SelectCollisionCandidates(AliVEvent::kCentral );// this a new line for train
  taskfemto->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kCentral);
  mgr->AddTask(taskfemto);

  // D. Configure the analysis task. Extra parameters can be used via optional
  // arguments of the AddTaskXXX() function.
  //===========================================================================
  
  // E. 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
  //==============================================================================
  TString outputfile = AliAnalysisManager::GetCommonFileName();  
  outputfile += ":PWG2FEMTO";
  AliAnalysisDataContainer *cout_femto  = mgr->CreateContainer("lmlist010",  TList::Class(),
  							       AliAnalysisManager::kOutputContainer,outputfile);


   mgr->ConnectInput(taskfemto, 0, mgr->GetCommonInputContainer());
   mgr->ConnectOutput(taskfemto, 0, cout_femto);

   // Return task pointer at the end
   return taskfemto;
}
 AddTaskFemtoKchHBT0010.C:1
 AddTaskFemtoKchHBT0010.C:2
 AddTaskFemtoKchHBT0010.C:3
 AddTaskFemtoKchHBT0010.C:4
 AddTaskFemtoKchHBT0010.C:5
 AddTaskFemtoKchHBT0010.C:6
 AddTaskFemtoKchHBT0010.C:7
 AddTaskFemtoKchHBT0010.C:8
 AddTaskFemtoKchHBT0010.C:9
 AddTaskFemtoKchHBT0010.C:10
 AddTaskFemtoKchHBT0010.C:11
 AddTaskFemtoKchHBT0010.C:12
 AddTaskFemtoKchHBT0010.C:13
 AddTaskFemtoKchHBT0010.C:14
 AddTaskFemtoKchHBT0010.C:15
 AddTaskFemtoKchHBT0010.C:16
 AddTaskFemtoKchHBT0010.C:17
 AddTaskFemtoKchHBT0010.C:18
 AddTaskFemtoKchHBT0010.C:19
 AddTaskFemtoKchHBT0010.C:20
 AddTaskFemtoKchHBT0010.C:21
 AddTaskFemtoKchHBT0010.C:22
 AddTaskFemtoKchHBT0010.C:23
 AddTaskFemtoKchHBT0010.C:24
 AddTaskFemtoKchHBT0010.C:25
 AddTaskFemtoKchHBT0010.C:26
 AddTaskFemtoKchHBT0010.C:27
 AddTaskFemtoKchHBT0010.C:28
 AddTaskFemtoKchHBT0010.C:29
 AddTaskFemtoKchHBT0010.C:30
 AddTaskFemtoKchHBT0010.C:31
 AddTaskFemtoKchHBT0010.C:32
 AddTaskFemtoKchHBT0010.C:33
 AddTaskFemtoKchHBT0010.C:34
 AddTaskFemtoKchHBT0010.C:35
 AddTaskFemtoKchHBT0010.C:36
 AddTaskFemtoKchHBT0010.C:37
 AddTaskFemtoKchHBT0010.C:38
 AddTaskFemtoKchHBT0010.C:39
 AddTaskFemtoKchHBT0010.C:40
 AddTaskFemtoKchHBT0010.C:41
 AddTaskFemtoKchHBT0010.C:42
 AddTaskFemtoKchHBT0010.C:43
 AddTaskFemtoKchHBT0010.C:44
 AddTaskFemtoKchHBT0010.C:45
 AddTaskFemtoKchHBT0010.C:46
 AddTaskFemtoKchHBT0010.C:47
 AddTaskFemtoKchHBT0010.C:48
 AddTaskFemtoKchHBT0010.C:49
 AddTaskFemtoKchHBT0010.C:50
 AddTaskFemtoKchHBT0010.C:51
 AddTaskFemtoKchHBT0010.C:52
 AddTaskFemtoKchHBT0010.C:53
 AddTaskFemtoKchHBT0010.C:54
 AddTaskFemtoKchHBT0010.C:55
 AddTaskFemtoKchHBT0010.C:56
 AddTaskFemtoKchHBT0010.C:57
 AddTaskFemtoKchHBT0010.C:58
 AddTaskFemtoKchHBT0010.C:59
 AddTaskFemtoKchHBT0010.C:60
 AddTaskFemtoKchHBT0010.C:61
 AddTaskFemtoKchHBT0010.C:62
 AddTaskFemtoKchHBT0010.C:63
 AddTaskFemtoKchHBT0010.C:64
 AddTaskFemtoKchHBT0010.C:65
 AddTaskFemtoKchHBT0010.C:66
 AddTaskFemtoKchHBT0010.C:67
 AddTaskFemtoKchHBT0010.C:68
 AddTaskFemtoKchHBT0010.C:69
 AddTaskFemtoKchHBT0010.C:70
 AddTaskFemtoKchHBT0010.C:71
 AddTaskFemtoKchHBT0010.C:72
 AddTaskFemtoKchHBT0010.C:73
 AddTaskFemtoKchHBT0010.C:74
 AddTaskFemtoKchHBT0010.C:75
 AddTaskFemtoKchHBT0010.C:76
 AddTaskFemtoKchHBT0010.C:77
 AddTaskFemtoKchHBT0010.C:78
 AddTaskFemtoKchHBT0010.C:79
 AddTaskFemtoKchHBT0010.C:80
 AddTaskFemtoKchHBT0010.C:81
 AddTaskFemtoKchHBT0010.C:82