]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGCF/FEMTOSCOPY/macros/Train/NZ/pPb_noTTC/AddTaskFemto.C
new macros for Kch femto in pPb
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / macros / Train / NZ / pPb_noTTC / AddTaskFemto.C
CommitLineData
1fcca981 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, const char *containerName="femtolist", const char *configMacroParameters="" )
15{
16// Creates a proton analysis task and adds it to the analysis manager.
17
18 // A. Get the pointer to the existing analysis manager via the static access method.
19 //==============================================================================
20 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
21 if (!mgr) {
22 Error("AddTaskFemto", "No analysis manager to connect to.");
23 return NULL;
24 }
25
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");
31 return NULL;
32 }
33 TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
34 cout << "Found " <<type << " event handler" << endl;
35
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");
39
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);
45// }
46// else
47 gProof->Load(configMacroName);
48 }
49 // gROOT->LoadMacro("ConfigFemtoAnalysis.C++");
50
51 //was befere aliroot 5.04.33: AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto",configMacroName);
52 // AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto",configMacroName,kFALSE);
53 //March 2013:
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
57 //
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);
65
66 // D. Configure the analysis task. Extra parameters can be used via optional
67 // arguments of the AddTaskXXX() function.
68 //===========================================================================
69
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);
77
78
79 mgr->ConnectInput(taskfemto, 0, mgr->GetCommonInputContainer());
80 mgr->ConnectOutput(taskfemto, 0, cout_femto);
81
82 // Return task pointer at the end
83 return taskfemto;
84}