]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/FEMTOSCOPY/macros/Train/AddTaskFemtoKchHBT.C
Provide setters for Normalization points
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / macros / Train / AddTaskFemtoKchHBT.C
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.
7 // from:
8 // alicepc100/cern/users/erogocha/PbPb2.76/2011/AOD115_0-10_newPID/to_alien_newtag/AddTaskFemto.C
9 // ---modified to train---
10 //  KM: June 03, 2013
11 //=============================================================================
12
13 //this line for local: AliAnalysisTaskFemto *AddTaskFemtoKchHBT(const char *configMacroName="ConfigFemtoAnalysis.C", const char *configMacroParameters="" )
14
15 AliAnalysisTaskFemto *AddTaskFemtoKchHBT(TString configMacroName, const char *containerName="femtolist", const char *configMacroParameters="" )
16 {
17 // Creates a proton analysis task and adds it to the analysis manager.
18   
19   // A. Get the pointer to the existing analysis manager via the static access method.
20   //==============================================================================
21   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
22   if (!mgr) {
23     Error("AddTaskFemto", "No analysis manager to connect to.");
24     return NULL;
25   }  
26
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");
32     return NULL;
33   }  
34   TString type = mgr->GetInputEventHandler()->GetDataType(); // can be "ESD" or "AOD"
35   cout << "Found " <<type << " event handler" << endl;
36
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");
40
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);
46 //     }
47 //     else
48     gProof->Load(configMacroName);
49   }  
50   //  gROOT->LoadMacro("ConfigFemtoAnalysis.C++");
51
52   //was befere aliroot 5.04.33: AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto",configMacroName);
53   //  AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto",configMacroName,kFALSE);
54   //March 2013:
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
58   //
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);
62
63   // D. Configure the analysis task. Extra parameters can be used via optional
64   // arguments of the AddTaskXXX() function.
65   //===========================================================================
66   
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);
74
75
76    mgr->ConnectInput(taskfemto, 0, mgr->GetCommonInputContainer());
77    mgr->ConnectOutput(taskfemto, 0, cout_femto);
78
79    // Return task pointer at the end
80    return taskfemto;
81 }