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