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