]>
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(); |
8349c102 | 44 | cutlib->SetMCFlag(hasMC); |
911affe5 | 45 | AliAnalysisTaskMultiDielectron *task=new AliAnalysisTaskMultiDielectron("MultiDiEData"); |
46 | if (!hasMC) task->UsePhysicsSelection(); | |
47 | task->SetEventFilter(cutlib->GetEventCuts(LMEECutLib::kpp2010TPCandTOF)); // | |
09f4a504 | 48 | |
911affe5 | 49 | |
50 | //load dielectron configuration file | |
51 | ||
52 | //add dielectron analysis with different cuts to the task | |
09f4a504 | 53 | |
54 | AliDielectron *lowmass1=ConfigLMEEpp2010(1,hasMC,enableCF); | |
911affe5 | 55 | task->AddDielectron(lowmass1); |
56 | printf("add: %s\n",lowmass1->GetName()); | |
09f4a504 | 57 | |
58 | if (runTwo) { | |
59 | AliDielectron *lowmass2=ConfigLMEEpp2010(2,hasMC,enableCF); | |
60 | task->AddDielectron(lowmass2); | |
61 | printf("add: %s\n",lowmass2->GetName()); | |
62 | } | |
63 | ||
911affe5 | 64 | mgr->AddTask(task); |
65 | ||
66 | //create output container | |
67 | AliAnalysisDataContainer *coutput1 = | |
09f4a504 | 68 | mgr->CreateContainer("cbaumann_LMEEpp2010_tree", |
69 | TTree::Class(), | |
70 | AliAnalysisManager::kExchangeContainer, | |
71 | "cbaumann_LMEEpp2010_default.root"); | |
911affe5 | 72 | |
73 | AliAnalysisDataContainer *cOutputHist1 = | |
09f4a504 | 74 | mgr->CreateContainer("cbaumann_LMEEpp2010_out", |
75 | TList::Class(), | |
76 | AliAnalysisManager::kOutputContainer, | |
77 | "cbaumann_LMEEpp2010_out.root"); | |
52d0fcc6 | 78 | AliAnalysisDataContainer *cOutputHist2 = 0x0; |
09f4a504 | 79 | if (enableCF) { |
52d0fcc6 | 80 | cOutputHist2 = |
09f4a504 | 81 | mgr->CreateContainer("cbaumann_LMEEpp2010_CF", |
82 | TList::Class(), | |
83 | AliAnalysisManager::kOutputContainer, | |
84 | "cbaumann_LMEEpp2010_out.root"); | |
85 | } | |
911affe5 | 86 | AliAnalysisDataContainer *cOutputHist3 = |
09f4a504 | 87 | mgr->CreateContainer("cbaumann_EventStatPbPb2011", |
88 | TH1D::Class(), | |
89 | AliAnalysisManager::kOutputContainer, | |
90 | "cbaumann_LMEEpp2010_out.root"); | |
911affe5 | 91 | |
92 | ||
93 | mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer()); | |
94 | mgr->ConnectOutput(task, 0, coutput1 ); | |
95 | mgr->ConnectOutput(task, 1, cOutputHist1); | |
09f4a504 | 96 | if (enableCF) { |
97 | mgr->ConnectOutput(task, 2, cOutputHist2); | |
98 | } | |
911affe5 | 99 | mgr->ConnectOutput(task, 3, cOutputHist3); |
100 | ||
101 | return task; | |
102 | } |