new dielectron tasks from Remi
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / macrosLMEE / LMEECutLibRemi.C
1 class LMEECutLibRemi {
2
3   public:
4         static  enum LMMECutSet {
5                 kPbPb2011NoPID,
6                 kPbPb2011TPCandTOF,
7                 kPbPb2011TPCandTOFHPT,
8                 kPbPb2011TPC, //TOF required, more relaxed cut on TPC
9                 kPbPb2011TPCandTOFwide, //TOF required, more relaxed cut on TPC
10                 kPbPb2011TPCorTOF,
11                 kpp2010TPCandTOF,
12                 kpp2010TPCorTOF,
13                 kCUTSETMAX
14         };
15
16         static  enum LMMECentSel {
17                 kPbPb2011Central,
18                 kPbPb2011SemiCentral1,
19                 kPbPb2011SemiCentral2,
20                 kPbPb2011Peripheral,
21                 kPbPb2011AllCentral,
22                 kCENTSELMAX
23         };
24
25         static  enum LMEEPairCutSet{
26                 kPbPb2011MassLow,
27                 kPbPb2011MassMiddle,
28                 kPbPb2011MassHigh,
29                 kPbPb2011MassAll,
30                 
31                 kPAIRCUTSETMAX
32         };
33
34
35
36         //char* LMEECutNames[kCUTSETMAX] = { "PbPb2011TPCandTOF","PbPb2011TPCorTOF"};
37
38
39         LMEECutLib() {}
40
41         AliDielectronEventCuts*     GetEventCuts(Int_t cutSet);
42         AliAnalysisCuts*            GetCentralityCuts(Int_t centSel);
43         AliDielectronTrackRotator*  GetTrackRotator(Int_t cutSet);
44         AliDielectronMixingHandler* GetMixingHandler(Int_t cutSet);
45
46         AliAnalysisCuts* GetPIDCutsAna(Int_t cutSet);  
47         AliAnalysisCuts* GetPIDCutsPre(Int_t cutSet);  
48
49         AliAnalysisCuts* GetPairCuts2(Int_t cutSet,Bool_t tooglePC=kFALSE);
50         AliAnalysisCuts* GetPairCuts(Int_t cutSet);  
51         AliAnalysisCuts* GetPairCutsInvMass(Int_t cutSet);
52
53         AliAnalysisCuts* GetTrackCutsAna(Int_t cutSet);  
54         AliAnalysisCuts* GetTrackCutsPre(Int_t cutSet);  
55
56
57
58
59         AliDielectronEventCuts* GetEventCuts(Int_t cutSet) {
60           AliDielectronEventCuts* eventCuts = 0x0;
61           switch (cutSet) {
62                 case kPbPb2011NoPID:
63                 case kPbPb2011TPCandTOF :
64                 case kPbPb2011TPCandTOFHPT:
65                 case kPbPb2011TPC :
66                 case kPbPb2011TPCandTOFwide :
67                 case kPbPb2011TPCorTOF  :
68                 case kpp2010TPCandTOF :
69                 case kpp2010TPCorTOF  :
70                   eventCuts=new AliDielectronEventCuts("eventCuts","Vertex Track && |vtxZ|<10 && ncontrib>0");
71                   eventCuts->SetVertexType(AliDielectronEventCuts::kVtxSPD); // AOD
72                   //eventCuts->SetVertexType(AliDielectronEventCuts::kVtxTPC); // AOD
73                   //           eventCuts->SetCentralityRange(0.0,80.0);
74                   eventCuts->SetRequireVertex();
75                   eventCuts->SetMinVtxContributors(1);
76                   eventCuts->SetVertexZ(-10.,10.);
77                   break;
78                 default: cout << "No Event Cut defined" << endl;
79           }
80           return eventCuts;
81         }
82
83         AliAnalysisCuts* GetCentralityCuts(Int_t centSel) {
84           AliDielectronVarCuts* centCuts = 0x0;
85           switch (centSel) {
86                 case kPbPb2011Central:
87                   centCuts = new AliDielectronVarCuts("centCuts","CentralityPbPb2011Central");
88                   centCuts->AddCut(AliDielectronVarManager::kCentrality,0.,10.);
89                   break;
90                 case kPbPb2011SemiCentral1:
91                   centCuts = new AliDielectronVarCuts("centCuts","CentralityPbPb2011SemiCentral1");
92                   //Restrict to 50%, Trigger selction
93                   centCuts->AddCut(AliDielectronVarManager::kCentrality,10.,30.);
94                   break;
95                 case kPbPb2011SemiCentral2:
96                   centCuts = new AliDielectronVarCuts("centCuts","CentralityPbPb2011SemiCentral2");
97                   //Restrict to 50%, Trigger selction
98                   centCuts->AddCut(AliDielectronVarManager::kCentrality,30.,50.);//
99                   break;
100
101                 case kPbPb2011Peripheral:
102                   centCuts = new AliDielectronVarCuts("centCuts","CentralityPbPb2011Peripheral");
103                   centCuts->AddCut(AliDielectronVarManager::kCentrality,50.,90.);
104                   break;
105                   
106                 case kPbPb2011AllCentral:
107                   centCuts = new AliDielectronVarCuts("centCuts","CentralityPbPb2011AllCentral");
108                   centCuts->AddCut(AliDielectronVarManager::kCentrality,0.,100.);
109                   break;
110
111                         default: cout << "No Centrality selected" << endl;
112
113
114           }
115           return centCuts;
116         }
117
118
119         AliDielectronTrackRotator* GetTrackRotator(Int_t cutSet) {
120           AliDielectronTrackRotator* trackRotator = 0x0;
121           switch (cutSet) {
122                 case kPbPb2011NoPID:
123                 case kPbPb2011TPCandTOF :
124                 case kPbPb2011TPCandTOFHPT:
125                 case kPbPb2011TPC :
126                 case kPbPb2011TPCandTOFwide :
127                 case kPbPb2011TPCorTOF  :
128                 case kpp2010TPCandTOF :
129                 case kpp2010TPCorTOF  :
130                   trackRotator = new AliDielectronTrackRotator();
131                   trackRotator->SetIterations(20);
132                   trackRotator->SetConeAnglePhi(TMath::Pi()/180*165);
133                   trackRotator->SetStartAnglePhi(TMath::Pi());
134                   break;
135                 default: cout << "No Rotator defined" << endl;
136           }
137           return trackRotator;
138         }
139
140
141         AliDielectronMixingHandler* GetMixingHandler(Int_t cutSet) {
142           AliDielectronMixingHandler* mixingHandler = 0x0;
143           switch (cutSet) {
144                 case kPbPb2011TPCorTOF  :
145 /*
146                   mixingHandler = new AliDielectronMixingHandler;
147                   mixingHandler->AddVariable(AliDielectronVarManager::kZvPrim,"-10,-5,0,5,10");
148                   mixingHandler->AddVariable(AliDielectronVarManager::kCentrality,"0,5,10,20,40,80");
149                   mixingHandler->SetDepth(25);
150                   mixingHandler->SetMixType(AliDielectronMixingHandler::kAll);
151                   break;
152 */
153                 case kPbPb2011NoPID:
154                 case kPbPb2011TPCandTOF :
155                 case kPbPb2011TPCandTOFHPT:
156                 case kPbPb2011TPC :
157                 case kPbPb2011TPCandTOFwide :
158                   mixingHandler = new AliDielectronMixingHandler;
159                   mixingHandler->AddVariable(AliDielectronVarManager::kZvPrim,"-10,-5,0,5,10");
160                   mixingHandler->AddVariable(AliDielectronVarManager::kCentrality,"0,5,10,20,40,80");
161                    mixingHandler->AddVariable(AliDielectronVarManager::kv0ACrpH2,"-6*(TMath::Pi()/6),-5*(TMath::Pi()/6),-4*(TMath::Pi()/6),-3*(TMath::Pi()/6),-2*(TMath::Pi()/6),-1*(TMath::Pi()/6),0,1*(TMath::Pi()/6),2*(TMath::Pi()/6),3*(TMath::Pi()/6),4*(TMath::Pi()/6),5*(TMath::Pi()/6),6*(TMath::Pi()/6)");
162                   //mixingHandler->SetDepth(50);
163                   mixingHandler->SetDepth(15);
164                   mixingHandler->SetMixType(AliDielectronMixingHandler::kAll);
165                   break;
166                 case kpp2010TPCandTOF :
167                 case kpp2010TPCorTOF  :
168                   mixingHandler = new AliDielectronMixingHandler;
169                   mixingHandler->AddVariable(AliDielectronVarManager::kZvPrim,"-10,-5,0,5,10");
170                   mixingHandler->AddVariable(AliDielectronVarManager::kNacc,"0,10000");
171                   //might want to add multiplicity?
172                   mixingHandler->SetDepth(50);
173                   mixingHandler->SetMixType(AliDielectronMixingHandler::kAll);
174                   break;
175                 default: cout << "No Rotator defined" << endl;
176           }
177           return mixingHandler;
178         }
179
180
181         AliAnalysisCuts* GetPIDCutsAna(Int_t cutSet) {
182           AliAnalysisCuts* anaCuts=0x0;
183
184           // + [2] added for Dec2010 Cut! 
185           TF1 *lowerCut = new TF1("lowerCut", "[0] * TMath::Exp([1]*x) + [2]", 0, 20);
186           /* until Nov2010
187                  lowerCut->SetParameter(0, -2.7);
188                  lowerCut->SetParameter(1, -0.4357);
189            */
190           /* 18.01.2011 ALiHFEpid.cxx */
191           lowerCut->SetParameter(0,-3.7);
192           lowerCut->SetParameter(1,-0.8);
193           lowerCut->SetParameter(2,-0.35);
194
195           if (MCenabled) { //overwrite parameters
196                 lowerCut->SetParameter(0,-2.5);
197                 lowerCut->SetParameter(2,-2.2);
198           }
199
200           //---------------------------------------------
201           AliDielectronPID *pidTPCTOFeOnly = new AliDielectronPID("TPC-TOF","TPC-TOF");
202           pidTPCTOFeOnly->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-3,3.,0.0,100.,kFALSE);
203           pidTPCTOFeOnly->AddCut(AliDielectronPID::kTOF ,AliPID::kElectron , -3. , 3. , 0.0 , 100., kFALSE );
204
205
206           AliDielectronPID *pidTPCandTOF = new AliDielectronPID("TPC-TOF-HFE","TPC-TOF-HFE");
207           pidTPCandTOF->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-3.,3.,0.0,100.,kFALSE);
208           pidTPCandTOF->AddCut(AliDielectronPID::kTPC,AliPID::kPion,-3.,3.,0.,100.,kTRUE);
209           pidTPCandTOF->AddCut(AliDielectronPID::kTOF ,AliPID::kElectron , -3. , 3. , 0.0 , 100., kFALSE );
210
211           AliDielectronPID *pidTPChardTOF = new AliDielectronPID("TPC-TOF-HFE","TPC-TOF-HFE");
212           pidTPChardTOF->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,lowerCut,3.,0.0,100.,kFALSE);
213           pidTPChardTOF->AddCut(AliDielectronPID::kTPC,AliPID::kPion,-3,3.,0.,100.,kTRUE);
214           pidTPChardTOF->AddCut(AliDielectronPID::kTPC,AliPID::kProton,-3.,3.,0.,100.,kTRUE);
215           pidTPChardTOF->AddCut(AliDielectronPID::kTPC,AliPID::kKaon,-3.,3.,0.,100.,kTRUE);
216           pidTPChardTOF->AddCut(AliDielectronPID::kTOF ,AliPID::kElectron , -3. , 3. , 0.0 , 100., kFALSE );
217           //___________________________________________
218           AliDielectronPID *pidTT = new AliDielectronPID("TPC-TOF","TPC-TOF");
219           pidTT->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-1.5,3.,0.2,0.4,kFALSE);
220           pidTT->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-3,3.,0.4,100.,kFALSE);
221           pidTT->AddCut(AliDielectronPID::kTOF ,AliPID::kElectron , -3. , 3. , 0.2 , 100., kFALSE );
222
223           pidTT->AddCut(AliDielectronPID::kTPC,AliPID::kPion,-3,3.,0.,100.,kTRUE);
224           pidTT->AddCut(AliDielectronPID::kTPC,AliPID::kProton,-3.,3.,0.,100.,kTRUE);
225           pidTT->AddCut(AliDielectronPID::kTPC,AliPID::kKaon,-3.,3.,0.,100.,kTRUE);
226           //___________________________________________
227           AliDielectronVarCuts *pidTPCsignal = new AliDielectronVarCuts("pidTPCsignal","cut on the TPC signal");
228           if (MCenabled) {
229           pidTPCsignal->AddCut(AliDielectronVarManager::kTPCsignal,65.,85.); 
230           }     
231           else {
232           pidTPCsignal->AddCut(AliDielectronVarManager::kTPCsignal,75.,90.); 
233           }
234           //___________________________________________
235
236           AliDielectronVarCuts *pidTPCsignalWide = new AliDielectronVarCuts("pidTPCsignalWide","cut on the TPC signal");
237           pidTPCsignalWide->AddCut(AliDielectronVarManager::kTPCsignal,75.,90.);
238
239
240           AliDielectronVarCuts *pTPCHPT = new AliDielectronVarCuts("P>.4hpt","P>.4hpt");
241           pTPCHPT->AddCut(AliDielectronVarManager::kPt,.4,3.0);
242
243           AliDielectronVarCuts *pTPC = new AliDielectronVarCuts("P>.4","P>.4");
244           pTPC->AddCut(AliDielectronVarManager::kPt,.4,2.0);
245           
246           AliDielectronVarCuts *pMin = new AliDielectronVarCuts("P>.2","P>.2");
247           pMin->AddCut(AliDielectronVarManager::kPt,.2,2.5);
248
249           switch (cutSet) {
250                 case kPbPb2011NoPID:
251                   AliDielectronCutGroup* cgSecondTrackFilterNoPID = new AliDielectronCutGroup("cgNoPID","cgNoPID",AliDielectronCutGroup::kCompAND);
252                   cgSecondTrackFilterNoPID->AddCut(pTPC);
253                   anaCuts= cgSecondTrackFilterNoPID;
254                   break;
255                 case kPbPb2011TPCandTOFHPT:
256                   AliDielectronCutGroup* cgSecondTrackFilterPIDTPC1 = new AliDielectronCutGroup("cgPIDTPC1","cgPIDTPC1",AliDielectronCutGroup::kCompAND);
257                   cgSecondTrackFilterPIDTPC1->AddCut(pTPCHPT);
258                   cgSecondTrackFilterPIDTPC1->AddCut(pidTPCTOFeOnly);
259                   cgSecondTrackFilterPIDTPC1->AddCut(pidTPCsignal);
260                   anaCuts = cgSecondTrackFilterPIDTPC1;
261                 case kPbPb2011TPCandTOF :
262                   AliDielectronCutGroup* cgSecondTrackFilterPIDTPC1 = new AliDielectronCutGroup("cgPIDTPC1","cgPIDTPC1",AliDielectronCutGroup::kCompAND);
263                   cgSecondTrackFilterPIDTPC1->AddCut(pTPC);
264                   //cgSecondTrackFilterPIDTPC1->AddCut(pidTPChardTOF);
265                   cgSecondTrackFilterPIDTPC1->AddCut(pidTPCTOFeOnly);
266                   cgSecondTrackFilterPIDTPC1->AddCut(pidTPCsignal);
267                   anaCuts = cgSecondTrackFilterPIDTPC1;
268                   break;
269                 case kPbPb2011TPC :
270                   AliDielectronCutGroup* cgSecondTrackFilterPIDTPC1 = new AliDielectronCutGroup("cgPIDTPC1","cgPIDTPC1",AliDielectronCutGroup::kCompAND);
271                   cgSecondTrackFilterPIDTPC1->AddCut(pTPC);
272                   cgSecondTrackFilterPIDTPC1->AddCut(pidTPCsignalWide);
273                   anaCuts = cgSecondTrackFilterPIDTPC1;
274                   break;
275
276                 case kPbPb2011TPCandTOFwide :
277                   AliDielectronCutGroup* cgSecondTrackFilterPIDTPC1 = new AliDielectronCutGroup("cgPIDTPC1","cgPIDTPC1",AliDielectronCutGroup::kCompAND);
278                   cgSecondTrackFilterPIDTPC1->AddCut(pTPC);
279                   cgSecondTrackFilterPIDTPC1->AddCut(pidTPCandTOF);
280                   cgSecondTrackFilterPIDTPC1->AddCut(pidTPCsignalWide);
281                   anaCuts = cgSecondTrackFilterPIDTPC1;
282                   break;
283
284                 case kPbPb2011TPCorTOF  :
285                   AliDielectronCutGroup* cgSecondTrackFilterPIDTPC2 = new AliDielectronCutGroup("cgPIDTPC2","cgPIDTPC2",AliDielectronCutGroup::kCompAND);
286                   cgSecondTrackFilterPIDTPC2->AddCut(pMin);
287                   cgSecondTrackFilterPIDTPC2->AddCut(pidTT);
288                   cgSecondTrackFilterPIDTPC2->AddCut(pidTPCsignal);
289                   anaCuts = cgSecondTrackFilterPIDTPC2;
290                   break;
291                 case kpp2010TPCandTOF :
292                   AliDielectronCutGroup* cgSecondTrackFilterPIDTPC = new AliDielectronCutGroup("cgPIDTPC","cgPIDTPC",AliDielectronCutGroup::kCompAND);
293                   cgSecondTrackFilterPIDTPC->AddCut(pTPC);
294                   //cgSecondTrackFilterPIDTPC->AddCut(pidTPChardTOF);
295                   cgSecondTrackFilterPIDTPC->AddCut(pidTPCTOFeOnly);
296                   anaCuts = cgSecondTrackFilterPIDTPC;
297                   break;
298                 case kpp2010TPCorTOF  :
299                   AliDielectronCutGroup* cgSecondTrackFilterPIDTPC = new AliDielectronCutGroup("cgPIDTPC","cgPIDTPC",AliDielectronCutGroup::kCompAND);
300                   cgSecondTrackFilterPIDTPC->AddCut(pMin);
301                   cgSecondTrackFilterPIDTPC->AddCut(pidTT);
302                   anaCuts = cgSecondTrackFilterPIDTPC;
303                   break;
304                 default: cout << "No Analysis PID Cut defined " << endl;
305           }
306           return anaCuts;
307         }
308
309         AliAnalysisCuts* GetPIDCutsPre(Int_t cutSet) {
310           AliAnalysisCuts* anaCuts=0x0;
311           switch (cutSet) {
312                 case kPbPb2011NoPID:
313                 case kPbPb2011TPCandTOF :
314                 case kPbPb2011TPCandTOFHPT:
315                 case kPbPb2011TPC :
316                 case kPbPb2011TPCandTOFwide :
317                 case kPbPb2011TPCorTOF  :
318                 case kpp2010TPCandTOF :
319                 case kpp2010TPCorTOF  :
320                   AliDielectronCutGroup* cgSecondTrackFilterPIDTPC = new AliDielectronCutGroup("cgPIDTPC","cgPIDTPC",AliDielectronCutGroup::kCompAND);
321                   AliDielectronCutGroup* cgITSTPC = new AliDielectronCutGroup("cgITSTPC","cgITSTPC",AliDielectronCutGroup::kCompAND);
322                   AliDielectronPID *pidITSTPC = new AliDielectronPID("TPCpre","TPCpre");
323                   pidITSTPC->AddCut(AliDielectronPID::kTPC,AliPID::kElectron,-3.,3.);
324                   cgITSTPC->AddCut(pidITSTPC);
325
326
327                   AliDielectronCutGroup* cgITSSA = new AliDielectronCutGroup("cgITSSA","cgITSSA",AliDielectronCutGroup::kCompAND);
328                   AliDielectronPID *pidITSSA = new  AliDielectronPID("pidITSSA","pidITSSA");
329                   pidITSSA->AddCut(AliDielectronPID::kITS,AliPID::kElectron,-3.,3.);
330                   cgITSSA->AddCut(pidITSSA);
331                   //      cgITSSA->AddCut(GetTrackCutsPre(cutSet));
332
333                   AliDielectronCutGroup* cgInitialTrackFilter = new AliDielectronCutGroup("cgInitialTrackFilter","cgInitialTrackFilter",AliDielectronCutGroup::kCompOR);
334                   cgInitialTrackFilter->AddCut(cgITSTPC);
335                   cgInitialTrackFilter->AddCut(cgITSSA);
336                   anaCuts = cgInitialTrackFilter;
337                   break;
338                 default: cout << "No Pre-PID Cut defined " << endl;
339           }
340           return anaCuts;
341         }
342
343
344
345         AliAnalysisCuts* GetPairCuts2(Int_t cutSet, Bool_t togglePC /*=kFALSE*/)  {
346           AliAnalysisCuts* pairCuts=0x0;
347           switch (cutSet) {
348                 case kPbPb2011TPCorTOF  :
349                 case kpp2010TPCandTOF :
350                   AliDielectronVarCuts* pairCutsV= new AliDielectronVarCuts("InvMass","InvMass > 150 MeV");
351                   pairCutsV->AddCut(AliDielectronVarManager::kM,0.15,100.,kTRUE);
352                   pairCuts = pairCutsV;
353                   break;
354                 case kPbPb2011NoPID:
355                 case kPbPb2011TPCandTOF :
356                 case kPbPb2011TPC :
357                 case kPbPb2011TPCandTOFHPT:
358                 case kPbPb2011TPCandTOFwide :
359                 case kpp2010TPCorTOF  :
360                   if (!togglePC) {
361
362                   AliDielectronCutGroup* pairCutsCG2 =new AliDielectronCutGroup("pairCutsCG2","pairCutsCG2",AliDielectronCutGroup::kCompOR);
363                   AliDielectronCutGroup* pairCutsCG =new AliDielectronCutGroup("pairCutsCG","pairCutsCG",AliDielectronCutGroup::kCompAND);
364                   pairCutsPhiv =new AliDielectronVarCuts("Phiv Cuts","Phiv<2.0rad");
365                   pairCutsPhiv->AddCut(AliDielectronVarManager::kPhivPair, 0.0, 2.0); 
366                   pairCutsInvM =new AliDielectronVarCuts("InvM Cuts","InvM<0.3");
367                   pairCutsInvM->AddCut(AliDielectronVarManager::kM, 0.0, 0.3); 
368                   pairCutsInvMgood =new AliDielectronVarCuts("InvM Cuts good","InvM>0.3");
369                   pairCutsInvMgood->AddCut(AliDielectronVarManager::kM, 0.3, 99999.); 
370                   pairCutsCG->AddCut(pairCutsPhiv);
371                   pairCutsCG->AddCut(pairCutsInvM);
372                   pairCutsCG2->AddCut(pairCutsInvMgood);
373                   pairCutsCG2->AddCut(pairCutsCG);
374                   pairCuts = pairCutsCG2;
375                   }
376                   else {
377                         AliDielectronVarCuts* pairCutsV =new AliDielectronVarCuts("OpeningAngle","Opening angle > .035rad");
378                         pairCutsV->AddCut(AliDielectronVarManager::kOpeningAngle, 0. , 0.035,kTRUE);
379                         pairCuts = pairCutsV;
380                   }
381                   break;
382                 default: cout << "No Pair Cuts defined " << endl;
383           }
384           return pairCuts;
385         }
386
387
388         AliAnalysisCuts* GetPairCuts(Int_t cutSet)  {  
389           AliAnalysisCuts* pairCuts=0x0;
390           switch (cutSet) {
391                 case kPbPb2011TPCorTOF  :
392                 case kpp2010TPCandTOF :
393                         AliDielectronVarCuts* pairCutsM=0x0;
394                   pairCutsM = new AliDielectronVarCuts("InvMass","InvMass > 150 MeV");
395                   pairCutsM->AddCut(AliDielectronVarManager::kM,0.15,100.,kTRUE);
396                   pairCuts = pairCutsM;
397                   break;
398                 case kPbPb2011NoPID:
399                 case kPbPb2011TPCandTOF :
400                 case kPbPb2011TPC :
401                 case kPbPb2011TPCandTOFwide :
402                 case kPbPb2011TPCandTOFHPT:
403                 case kpp2010TPCorTOF  :
404
405                   AliDielectronCutGroup* pairCutsCG =new AliDielectronCutGroup("pairCutsCG","pairCutsCG",AliDielectronCutGroup::kCompAND);
406                   AliDielectronVarCuts* pairCutsPhiv =new AliDielectronVarCuts("Phiv Cuts","Phiv<2.0rad");
407                   pairCutsPhiv->AddCut(AliDielectronVarManager::kPhivPair, 2.0, 3.2); 
408                   AliDielectronVarCuts* pairCutsInvM =new AliDielectronVarCuts("InvM Cuts","InvM<0.3");
409                   pairCutsInvM->AddCut(AliDielectronVarManager::kM, 0.0, 0.3); 
410                   pairCutsCG->AddCut(pairCutsPhiv);
411                   pairCutsCG->AddCut(pairCutsInvM);
412
413                   pairCuts = pairCutsCG;
414
415
416                 //pairCuts =new AliDielectronVarCuts("OpeningAngle","Opening angle > .035rad");
417                 //pairCuts->AddCut(AliDielectronVarManager::kOpeningAngle, 0. , 0.035);
418                 break;
419                 default: cout << "No Pair Cuts defined " << endl;
420           } 
421           return pairCuts;
422         }
423
424         AliAnalysisCuts* GetESDTrackCutsAna(Int_t cutSet) {
425           AliESDtrackCuts* esdTrackCutsH = 0x0;
426           switch (cutSet) {
427                 case kPbPb2011NoPID:
428                 case kPbPb2011TPCandTOF :
429                 case kPbPb2011TPCandTOFHPT:
430                 case kPbPb2011TPC :
431                 case kPbPb2011TPCandTOFwide :
432                 case kPbPb2011TPCorTOF  :
433                 case kpp2010TPCandTOF :
434                 case kpp2010TPCorTOF  :
435                         // standard cuts with very loose DCA: Bit4 (Int: 16), AOD095&115
436                   
437                          esdTrackCutsH = AliESDtrackCuts::GetStandardITSTPCTrackCuts2011(kFALSE); 
438                          esdTrackCutsH->SetMaxDCAToVertexXY(2.4);
439                          esdTrackCutsH->SetMaxDCAToVertexZ(3.2);
440                          esdTrackCutsH->SetDCAToVertex2D(kTRUE);
441                 /* 
442
443                   esdTrackCutsH = new AliESDtrackCuts();
444                   esdTrackCutsH->SetAcceptKinkDaughters(kFALSE);
445                   //Not done so far via dielectron cuts:
446                   */
447                   /*
448                   esdTrackCuts->SetDCAToVertex2D(kFALSE);
449                   esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
450                   esdTrackCuts->SetMaxChi2PerClusterITS(36);
451                    */
452
453                   break;
454                 default: cout << "No Analysis Track Cut defined " << endl;
455           }
456           return esdTrackCutsH;
457         } 
458
459   AliAnalysisCuts* GetPairCutsInvMass(Int_t cutSet) {
460     AliDielectronVarCuts* pairCuts=0x0;
461     switch (cutSet) {
462     case kPbPb2011MassLow :
463       pairCuts = new AliDielectronVarCuts("InvMass","0 MeV  < InvMass < 30 MeV");
464       pairCuts->AddCut(AliDielectronVarManager::kM, 0.,0.03);
465       break;
466     case kPbPb2011MassMiddle :
467       pairCuts = new AliDielectronVarCuts("InvMass","120 MeV  < InvMass < 300 MeV");
468       pairCuts->AddCut(AliDielectronVarManager::kM, 0.12,0.30);
469       break;
470     case kPbPb2011MassHigh :
471       pairCuts = new AliDielectronVarCuts("InvMass","300 MeV  < InvMass < 500 MeV");
472       pairCuts->AddCut(AliDielectronVarManager::kM, 0.30,0.50);
473       break;
474     case kPbPb2011MassAll :
475       pairCuts = new AliDielectronVarCuts("InvMass","0 GeV  < InvMass < 10 GeV");
476       pairCuts->AddCut(AliDielectronVarManager::kM, 0.0,10.0);
477       break;
478
479     default: cout << "No Pair Cuts defined " << endl;
480     }
481     return pairCuts;
482   }
483
484
485         AliAnalysisCuts* GetTrackCutsAna(Int_t cutSet) {
486           AliDielectronCutGroup* trackCuts=0x0;
487           switch (cutSet) {
488                 case kPbPb2011NoPID:
489                 case kPbPb2011TPCandTOF :
490                 case kPbPb2011TPCandTOFHPT:
491                 case kPbPb2011TPC :
492                 case kPbPb2011TPCandTOFwide :
493                 case kPbPb2011TPCorTOF  :
494                 case kpp2010TPCandTOF :
495                 case kpp2010TPCorTOF  :
496                         trackCuts = new AliDielectronCutGroup("cgPIDTPC1","cgPIDTPC1",AliDielectronCutGroup::kCompAND);
497
498                         AliDielectronVarCuts* trackCutsAOD =new AliDielectronVarCuts("trackCutsAOD","trackCutsAOD");
499                         trackCutsAOD->AddCut(AliDielectronVarManager::kPt,0.05,6.);
500                         trackCutsAOD->AddCut(AliDielectronVarManager::kEta,-0.84,0.84);
501                         //DCA Cut
502                         trackCutsAOD->AddCut(AliDielectronVarManager::kImpactParXY, -1.0,   1.0);
503                         trackCutsAOD->AddCut(AliDielectronVarManager::kImpactParZ,  -3.0,   3.0);
504                         trackCutsAOD->AddCut(AliDielectronVarManager::kNclsITS,     3.0, 100.0);
505                         trackCutsAOD->AddCut(AliDielectronVarManager::kTPCchi2Cl,    0.0,   3.5);
506                         AliDielectronTrackCuts *trackCutsDiel = new AliDielectronTrackCuts("trackCutsDiel","trackCutsDiel");
507                         trackCutsDiel->SetAODFilterBit(16); //does nothing for ESDs
508                         trackCutsDiel->SetRequireITSRefit(kTRUE);
509                         trackCutsDiel->SetRequireTPCRefit(kTRUE);
510
511                         trackCutsDiel->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kFirst);
512 //                      trackCutsAOD->AddCut(AliDielectronVarManager::kNclsTPC,     80., 140.0);
513                         trackCutsAOD->AddCut(AliDielectronVarManager::kNFclsTPCr,     110.0, 160.0);
514                         trackCutsAOD->AddCut(AliDielectronVarManager::kNFclsTPCfCross,     0.8, 1.0);//tighter than before,
515                                                                                                                                                                                  //due to AOD production
516                         trackCuts->AddCut(trackCutsDiel);
517                         trackCuts->AddCut(trackCutsAOD);
518                   break;
519                 default: cout << "No Analysis Track Cut defined " << endl;
520           }
521           return trackCuts;
522         } 
523
524         AliAnalysisCuts* GetTrackCutsPre(Int_t cutSet) {
525           AliESDtrackCuts* trackCuts=0x0;
526           switch (cutSet) {
527                 case kPbPb2011NoPID:
528                 case kPbPb2011TPCandTOF :
529                 case kPbPb2011TPCandTOFHPT:
530                 case kPbPb2011TPCorTOF  :
531                 case kpp2010TPCandTOF :
532                 case kpp2010TPCorTOF  :
533 /*
534                         trackCuts = new AliESDtrackCuts();
535                         trackCuts->SetDCAToVertex2D(kTRUE);
536                         trackCuts->SetMaxDCAToVertexZ(3.0);
537                         trackCuts->SetMaxDCAToVertexXY(1.0);
538                   trackCuts->SetEtaRange( -0.84 , 0.84 );
539                   trackCuts->SetPtRange(  0.05 , 0.5);
540                   trackCuts->SetAcceptKinkDaughters(kFALSE);
541                   trackCuts->SetRequireITSRefit(kTRUE);
542                   trackCuts->SetRequireITSStandAlone(kTRUE);
543                   trackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kFirst);
544                   trackCuts->SetMinNClustersITS(3); //PhotonGroup-Dalitz: 2?!
545 */
546                   cout << "No Pre-Track Cut defined for AODs at the moment " << endl;
547                   break;
548                 default: cout << "No Pre-Track Cut defined " << endl;
549           }
550           return trackCuts;
551         }
552
553 };