updates from Taku
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / macrosLMEE / AddTask_taku_LMEEPbPb2011SemiCent2.C
CommitLineData
571a7b22 1/*
2 in real data. argument should be kFALSE, kFALSE, kFALSE,
3 in siml data. argument should be kFALSE, kTRUE, kTRUE,
4
5*/
6AliAnalysisTask *AddTask_taku_LMEEPbPb2011SemiCent2(Bool_t runRejection=kFALSE, Bool_t setMC=kFALSE,Bool_t enableCF=kFALSE){
7 //get the current analysis manager
8 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
9 if (!mgr) {
10 Error("AddTask_taku_LMEEPbPb2011", "No analysis manager found.");
11 return 0;
12 }
13
14 //create config File names: TRAIN_ROOT is for running on GSI train,
15 // ALICE_ROOT for CERN Lego trains
16 TString configBasePath("$TRAIN_ROOT/cbaumann_dielectron/");
17 TString trainRoot=gSystem->Getenv("TRAIN_ROOT");
18 if (trainRoot.IsNull()) configBasePath= "$ALICE_ROOT/PWGDQ/dielectron/macrosLMEE/";
19 TString configFile("ConfigTakuLMEEPbPb2011.C");
20 TString configLMEECutLib("LMEECutLibTaku.C");
21
22 TString configFilePath(configBasePath+configFile);
23 TString configLMEECutLibPath(configBasePath+configLMEECutLib);
24
25 //AOD Usage currently tested with separate task, to be merged
26 if (mgr->GetInputEventHandler()->IsA()==AliAODInputHandler::Class()){
27 ::Info("AddTaskLMEEPbPb2011", "no dedicated AOD configuration");
28 }
29
30 //Do we have an MC handler?
31 Bool_t hasMC=setMC;
32 if (AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0){
33 hasMC=kTRUE;
34 }
35
36 if (!gROOT->GetListOfGlobalFunctions()->FindObject(configLMEECutLib.Data()))
37 gROOT->LoadMacro(configLMEECutLibPath.Data());
38 if (!gROOT->GetListOfGlobalFunctions()->FindObject(configFile.Data()))
39 gROOT->LoadMacro(configFilePath.Data());
40
41 LMEECutLib* cutlib = new LMEECutLib();
42 cutlib->SetMCFlag(hasMC);
4d42c2f6 43 AliAnalysisTaskMultiDielectronTG *task=new AliAnalysisTaskMultiDielectronTG("MultiDiEDataSemiCent2");
571a7b22 44
45 ////default cutter defined in ConfigTakuLMEEPbPb2011.C
46 Int_t PairCutTypeDef[20]={0,
47 0,0,0, //no pair cuts
48 1,1,1, //reject from arrays by op cuts
49 2,2,2, //reject from arrays by phiv cuts
50 3,3,3, //pair-by-pair cuts by op
51 4,4,4, //pair-by-pair cuts by phiv
52 0,0,0,
53 0};
54
55 Int_t PairCutType[20]={0};
56 PairCutType[0] = PairCutTypeDef[3];
57 PairCutType[1] = PairCutTypeDef[6];
58 PairCutType[2] = PairCutTypeDef[9];
59 PairCutType[3] = PairCutTypeDef[12];
60 PairCutType[4] = PairCutTypeDef[15];
61
62 if (!hasMC){
63 task->UsePhysicsSelection();
64 }
65 task->SetTriggerMask(AliVEvent::kMB+AliVEvent::kCentral+AliVEvent::kSemiCentral);
66 task->SetEventFilter(cutlib->GetEventCuts(LMEECutLib::kPbPb2011TPCandTOF)); //
67 task->RejectConversion(2.0);
68 task->RejectOP(0.035);
69 task->SetPairCuts(PairCutType);
70 task->EnableV0mixing(kFALSE);
4d42c2f6 71 task->SetRejBGPairs(kFALSE, kTRUE);
571a7b22 72
73 //load dielectron configuration file
74 //add dielectron analysis with different cuts to the task
75 if (runRejection) {
76 AliDielectron *lowmass4=ConfigTakuLMEEPbPb2011(4,hasMC,enableCF);
77 task->AddDielectron(lowmass4);
78 printf("add: %s\n",lowmass4->GetName());
79 }
80 else {
81 //////// this is for test
82 AliDielectron *lowmass3=ConfigTakuLMEEPbPb2011(3,hasMC,enableCF);
83 lowmass3->SetUseKF(kFALSE);
84 task->AddDielectron(lowmass3);
85 printf("add: %s\n",lowmass3->GetName());
86
87 ///////////////////////////
88
89 AliDielectron *lowmass6=ConfigTakuLMEEPbPb2011(6,hasMC,enableCF);
90 lowmass6->SetUseKF(kFALSE);
91 task->AddDielectron(lowmass6);
92 printf("add: %s\n",lowmass6->GetName());
93
94
95 ///////////////////////////
96
97
98 AliDielectron *lowmass9=ConfigTakuLMEEPbPb2011(9,hasMC,enableCF);
99 lowmass9->SetUseKF(kFALSE);
100 task->AddDielectron(lowmass9);
101 printf("add: %s\n",lowmass9->GetName());
102
103
104 ///////////////////////////
105
106 AliDielectron *lowmass12=ConfigTakuLMEEPbPb2011(12,hasMC,enableCF);
107 lowmass12->SetUseKF(kFALSE);
108 task->AddDielectron(lowmass12);
109 printf("add: %s\n",lowmass12->GetName());
110
111 ///////////////////////////
112
113
114
115 AliDielectron *lowmass15=ConfigTakuLMEEPbPb2011(15,hasMC,enableCF);
116 lowmass15->SetUseKF(kFALSE);
117 task->AddDielectron(lowmass15);
118 printf("add: %s\n",lowmass15->GetName());
119
120 }
121
122 mgr->AddTask(task);
123
124 //create output container
125 AliAnalysisDataContainer *coutput1 =
4d42c2f6 126 mgr->CreateContainer("taku_LMEEPbPb2011_semicent2_tree",
571a7b22 127 TTree::Class(),
128 AliAnalysisManager::kExchangeContainer,
129 "taku_LMEEPbPb2011_semicent2_default.root");
130
131 AliAnalysisDataContainer *cOutputHist1 =
4d42c2f6 132 mgr->CreateContainer("taku_LMEEPbPb2011_semicent2_out",
571a7b22 133 TList::Class(),
134 AliAnalysisManager::kOutputContainer,
135 "taku_LMEEPbPb2011_semicent2_out.root");
136
137 AliAnalysisDataContainer *cOutputHist2 = 0x0;
138 if (enableCF) {
139 cOutputHist2 =
4d42c2f6 140 mgr->CreateContainer("taku_LMEEPbPb2011_semicent2_CF",
571a7b22 141 TList::Class(),
142 AliAnalysisManager::kOutputContainer,
143 "taku_LMEEPbPb2011_semicent2_out.root");
144
145 }
146 AliAnalysisDataContainer *cOutputHist3 =
4d42c2f6 147 mgr->CreateContainer("taku_EventStatPbPb2011_semicent2",
571a7b22 148 TH1D::Class(),
149 AliAnalysisManager::kOutputContainer,
150 "taku_LMEEPbPb2011_semicent2_out.root");
151
152
153 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
154 mgr->ConnectOutput(task, 0, coutput1 );
155 mgr->ConnectOutput(task, 1, cOutputHist1);
156 if (enableCF) {
157 mgr->ConnectOutput(task, 2, cOutputHist2);
158 }
159 mgr->ConnectOutput(task, 3, cOutputHist3);
160
161 return task;
162}