]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGCF/FEMTOSCOPY/macros/Train/KchHBT_EtaPhiStar_02/AddTaskFemtoKchHBT1090.C
Next macro to test EtaPhi
[u/mrichter/AliRoot.git] / PWGCF / FEMTOSCOPY / macros / Train / KchHBT_EtaPhiStar_02 / AddTaskFemtoKchHBT1090.C
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
14 AliAnalysisTaskFemto *AddTaskFemtoKchHBT1090(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   //0-10 % all three triggers
62   //taskfemto->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral);// this a new line for train
63   mgr->AddTask(taskfemto);
64
65   // D. Configure the analysis task. Extra parameters can be used via optional
66   // arguments of the AddTaskXXX() function.
67   //===========================================================================
68   
69   // E. Create ONLY the output containers for the data produced by the task.
70   // Get and connect other common input/output containers via the manager as below
71   //==============================================================================
72   TString outputfile = AliAnalysisManager::GetCommonFileName();  
73   outputfile += ":PWG2FEMTO";
74   AliAnalysisDataContainer *cout_femto  = mgr->CreateContainer("femtolist",  TList::Class(),
75                                                                AliAnalysisManager::kOutputContainer,outputfile);
76
77
78    mgr->ConnectInput(taskfemto, 0, mgr->GetCommonInputContainer());
79    mgr->ConnectOutput(taskfemto, 0, cout_femto);
80
81    // Return task pointer at the end
82    return taskfemto;
83 }