]>
Commit | Line | Data |
---|---|---|
09f4a504 | 1 | AliAnalysisTask *AddTask_cbaumann_LMEEpp2010(Bool_t runTwo=kFALSE, Bool_t hasMC=kFALSE, Bool_t enableCF=kFALSE){ |
911affe5 | 2 | //get the current analysis manager |
3 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
4 | if (!mgr) { | |
09f4a504 | 5 | Error("AddTask_cbaumann_LMEEpp2010", "No analysis manager found."); |
6 | return 0; | |
911affe5 | 7 | } |
8 | ||
9 | //set config file name | |
52d0fcc6 | 10 | //create config File names: TRAIN_ROOT is for running on GSI train, |
11 | // ALICE_ROOT for CERN Lego trains | |
12 | TString configBasePath("$TRAIN_ROOT/cbaumann_dielectron/"); | |
13 | TString trainRoot=gSystem->Getenv("TRAIN_ROOT"); | |
14 | if (trainRoot.IsNull()) configBasePath= "$ALICE_ROOT/PWGDQ/dielectron/macrosLMEE/"; | |
15 | TString configFile("ConfigLMEEpp2010.C"); | |
16 | TString configLMEECutLib("LMEECutLib.C"); | |
17 | ||
18 | TString configLMEECutLibPath(configBasePath+configLMEECutLib); | |
19 | TString configFilePath(configBasePath+configFile); | |
20 | ||
21 | ||
911affe5 | 22 | |
23 | //AOD Usage not yet testes/avialable------------------------------------- | |
24 | ||
25 | if (mgr->GetInputEventHandler()->IsA()==AliAODInputHandler::Class()){ | |
09f4a504 | 26 | ::Info("AddTaskLMEEpp2010", "no dedicated AOD configuration"); |
27 | // configFile="$TRAIN_ROOT/util/dielectron/dielectron/macros/ConfigLMEEpp2010AOD.C"; | |
28 | ||
911affe5 | 29 | } |
30 | ||
09f4a504 | 31 | //Do we have an MC handler? //Child protected, if auto-recognition fails |
32 | if (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0) | |
33 | hasMC=kTRUE; | |
911affe5 | 34 | |
35 | ||
09f4a504 | 36 | // create task and add it to the manager |
911affe5 | 37 | |
52d0fcc6 | 38 | if (!gROOT->GetListOfGlobalFunctions()->FindObject(configLMEECutLib.Data())) |
39 | gROOT->LoadMacro(configLMEECutLibPath.Data()); | |
40 | if (!gROOT->GetListOfGlobalFunctions()->FindObject(configFile.Data())) | |
41 | gROOT->LoadMacro(configFilePath.Data()); | |
42 | ||
911affe5 | 43 | LMEECutLib* cutlib = new LMEECutLib(); |
44 | AliAnalysisTaskMultiDielectron *task=new AliAnalysisTaskMultiDielectron("MultiDiEData"); | |
45 | if (!hasMC) task->UsePhysicsSelection(); | |
46 | task->SetEventFilter(cutlib->GetEventCuts(LMEECutLib::kpp2010TPCandTOF)); // | |
09f4a504 | 47 | |
911affe5 | 48 | |
49 | //load dielectron configuration file | |
50 | ||
51 | //add dielectron analysis with different cuts to the task | |
09f4a504 | 52 | |
53 | AliDielectron *lowmass1=ConfigLMEEpp2010(1,hasMC,enableCF); | |
911affe5 | 54 | task->AddDielectron(lowmass1); |
55 | printf("add: %s\n",lowmass1->GetName()); | |
09f4a504 | 56 | |
57 | if (runTwo) { | |
58 | AliDielectron *lowmass2=ConfigLMEEpp2010(2,hasMC,enableCF); | |
59 | task->AddDielectron(lowmass2); | |
60 | printf("add: %s\n",lowmass2->GetName()); | |
61 | } | |
62 | ||
911affe5 | 63 | mgr->AddTask(task); |
64 | ||
65 | //create output container | |
66 | AliAnalysisDataContainer *coutput1 = | |
09f4a504 | 67 | mgr->CreateContainer("cbaumann_LMEEpp2010_tree", |
68 | TTree::Class(), | |
69 | AliAnalysisManager::kExchangeContainer, | |
70 | "cbaumann_LMEEpp2010_default.root"); | |
911affe5 | 71 | |
72 | AliAnalysisDataContainer *cOutputHist1 = | |
09f4a504 | 73 | mgr->CreateContainer("cbaumann_LMEEpp2010_out", |
74 | TList::Class(), | |
75 | AliAnalysisManager::kOutputContainer, | |
76 | "cbaumann_LMEEpp2010_out.root"); | |
52d0fcc6 | 77 | AliAnalysisDataContainer *cOutputHist2 = 0x0; |
09f4a504 | 78 | if (enableCF) { |
52d0fcc6 | 79 | cOutputHist2 = |
09f4a504 | 80 | mgr->CreateContainer("cbaumann_LMEEpp2010_CF", |
81 | TList::Class(), | |
82 | AliAnalysisManager::kOutputContainer, | |
83 | "cbaumann_LMEEpp2010_out.root"); | |
84 | } | |
911affe5 | 85 | AliAnalysisDataContainer *cOutputHist3 = |
09f4a504 | 86 | mgr->CreateContainer("cbaumann_EventStatPbPb2011", |
87 | TH1D::Class(), | |
88 | AliAnalysisManager::kOutputContainer, | |
89 | "cbaumann_LMEEpp2010_out.root"); | |
911affe5 | 90 | |
91 | ||
92 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); | |
93 | mgr->ConnectOutput(task, 0, coutput1 ); | |
94 | mgr->ConnectOutput(task, 1, cOutputHist1); | |
09f4a504 | 95 | if (enableCF) { |
96 | mgr->ConnectOutput(task, 2, cOutputHist2); | |
97 | } | |
911affe5 | 98 | mgr->ConnectOutput(task, 3, cOutputHist3); |
99 | ||
100 | return task; | |
101 | } |