1 //=============================================================================
2 // ---Common---AddTaskFemtoKchHBT---w/o---trigger---selection---
3 // ---SelectCollisionCandidates commented-----------------------
4 // *** AddTaskFemto.C ***
5 // ---train version ---
6 // This macro initialize a complete AnalysisTask object for femtoscopy.
8 // alicepc100/cern/users/erogocha/PbPb2.76/2011/AOD115_0-10_newPID/to_alien_newtag/AddTaskFemto.C
9 // ---modified to train---
11 //=============================================================================
13 //this line for local: AliAnalysisTaskFemto *AddTaskFemtoKchHBT(const char *configMacroName="ConfigFemtoAnalysis.C", const char *configMacroParameters="" )
15 AliAnalysisTaskFemto *AddTaskFemtoKchHBT(TString configMacroName, const char *containerName="femtolist", const char *configMacroParameters="" )
17 // Creates a proton analysis task and adds it to the analysis manager.
19 // A. Get the pointer to the existing analysis manager via the static access method.
20 //==============================================================================
21 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
23 Error("AddTaskFemto", "No analysis manager to connect to.");
27 // B. Check the analysis type using the event handlers connected to the analysis
28 // manager. The availability of MC handler cann also be checked here.
29 //==============================================================================
30 if (!mgr->GetInputEventHandler()) {
31 ::Error("AddTaskFemto", "This task requires an input event handler");
34 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
35 cout << "Found " <<type << " event handler" << endl;
37 // C. Create the task, add it to manager.
38 //===========================================================================
39 // gSystem->SetIncludePath("-I$ROOTSYS/include -I./PWG2AOD/AOD -I./PWG2femtoscopy/FEMTOSCOPY/AliFemto -I./PWG2femtoscopyUser/FEMTOSCOPY/AliFemtoUser -I$ALICE_ROOT/include");
41 if (TProofMgr::GetListOfManagers()->GetEntries()) {
42 // if (dynamic_cast<TProofLite *> gProof) {
43 // char *macrocommand[10000];
44 // sprintf(macrocommand, ".L %s", configMacroName);
45 // gProof->Exec(macrocommand);
48 gProof->Load(configMacroName);
50 // gROOT->LoadMacro("ConfigFemtoAnalysis.C++");
52 //was befere aliroot 5.04.33: AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto",configMacroName);
53 // AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto",configMacroName,kFALSE);
55 //to check localy before new tag I did symbolic link on my laplot
56 //in $ALICE_ROOT/PWGCF/FEMTOSCOPY/macros/Train/
57 //[root@alicethinks Train]# ln -s /scratch/AliWork/PbPb2.76/Train2013/KchHBT KchHBT
59 AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto","$ALICE_ROOT/"+configMacroName,configMacroParameters,kFALSE);
60 //taskfemto->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral);// this a new line for train
61 mgr->AddTask(taskfemto);
63 // D. Configure the analysis task. Extra parameters can be used via optional
64 // arguments of the AddTaskXXX() function.
65 //===========================================================================
67 // E. Create ONLY the output containers for the data produced by the task.
68 // Get and connect other common input/output containers via the manager as below
69 //==============================================================================
70 TString outputfile = AliAnalysisManager::GetCommonFileName();
71 outputfile += ":PWG2FEMTO";
72 AliAnalysisDataContainer *cout_femto = mgr->CreateContainer("femtolist", TList::Class(),
73 AliAnalysisManager::kOutputContainer,outputfile);
76 mgr->ConnectInput(taskfemto, 0, mgr->GetCommonInputContainer());
77 mgr->ConnectOutput(taskfemto, 0, cout_femto);
79 // Return task pointer at the end