]>
Commit | Line | Data |
---|---|---|
40208738 | 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 | // | |
f629a424 | 58 | //local------> |
59 | //AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto",configMacroName,configMacroParameters,kFALSE); | |
60 | //local------< | |
61 | //train::::::::::::::::::::::::::::> | |
40208738 | 62 | AliAnalysisTaskFemto *taskfemto = new AliAnalysisTaskFemto("TaskFemto","$ALICE_ROOT/"+configMacroName,configMacroParameters,kFALSE); |
f629a424 | 63 | //train::::::::::::::::::::::::::::< |
40208738 | 64 | //10-90% only two triggers: SemiCentral and MB |
65 | taskfemto->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kSemiCentral);// this a new line for train | |
66 | //0-10 % all three triggers | |
67 | //taskfemto->SelectCollisionCandidates(AliVEvent::kMB | AliVEvent::kCentral | AliVEvent::kSemiCentral);// this a new line for train | |
68 | mgr->AddTask(taskfemto); | |
69 | ||
70 | // D. Configure the analysis task. Extra parameters can be used via optional | |
71 | // arguments of the AddTaskXXX() function. | |
72 | //=========================================================================== | |
73 | ||
74 | // E. Create ONLY the output containers for the data produced by the task. | |
75 | // Get and connect other common input/output containers via the manager as below | |
76 | //============================================================================== | |
77 | TString outputfile = AliAnalysisManager::GetCommonFileName(); | |
78 | outputfile += ":PWG2FEMTO"; | |
79 | AliAnalysisDataContainer *cout_femto = mgr->CreateContainer("femtolist9", TList::Class(), | |
80 | AliAnalysisManager::kOutputContainer,outputfile); | |
81 | ||
82 | ||
83 | mgr->ConnectInput(taskfemto, 0, mgr->GetCommonInputContainer()); | |
84 | mgr->ConnectOutput(taskfemto, 0, cout_femto); | |
85 | ||
86 | // Return task pointer at the end | |
87 | return taskfemto; | |
88 | } |