update Markus task for EmCal triggered Data
[u/mrichter/AliRoot.git] / PWGDQ / dielectron / macrosLMEE / Config_mk_CCbarPbPb.C
1 void SetupTrackCutsDieleData(AliDielectron *diele, Int_t cutDefinition, Bool_t isAOD);
2 void SetupPairCutsDieleData(AliDielectron *diele, Int_t cutDefinition, Bool_t isAOD);
3 void InitHistogramsDieleData(AliDielectron *diele, Int_t cutDefinition, Bool_t isAOD);
4 void InitCFDieleData(AliDielectron *diele, Int_t cutDefinition, Bool_t isAOD);
5 void AddMCSignals(AliDielectron *diele);
6 AliESDtrackCuts *SetupESDtrackCutsDieleData(Int_t cutDefinition);
7
8 //TString namesDieleData=("EMCal+QA;TPC+QA;EMCal+ITSfirstclass");
9 TString namesDieleData=("EMCal+QA");
10 TObjArray *arrNamesDieleData=namesDieleData.Tokenize(";");
11 Bool_t hasMC=kFALSE;
12 TString list  = gSystem->Getenv("LIST");
13 const Int_t nDie=arrNamesDieleData->GetEntries();
14
15 AliDielectron* Config_mk_CCbarPbPb(Int_t cutDefinition, Bool_t isAOD=kFALSE)
16 {
17   //
18   // Setup the instance of AliDielectron
19   //
20     // find mc or not?
21 //   if( list.IsNull()) list=prod;
22   if( list.Contains("LHC10h")   || list.Contains("LHC11h")   ) hasMC=kFALSE;
23   if( list.Contains("LHC11a10") || list.Contains("LHC12a17") ) hasMC=kTRUE;
24   
25   // create the actual framework object
26   TString name=Form("%02d",cutDefinition);
27   if (cutDefinition<arrNamesDieleData->GetEntriesFast()){
28     name=arrNamesDieleData->At(cutDefinition)->GetName();
29   }
30   
31    
32   AliDielectron *diele = new AliDielectron(Form("%s",name.Data()),
33                              Form("Track cuts: %s",name.Data()));
34
35   diele->SetHasMC(hasMC);
36
37 //   printf(" Add %s %s config %s for %s \n",(isESD?"ESD":"AOD"),(hasMC?"MC":""),name.Data(),list.Data());
38
39   // Monte Carlo Signals and TRD efficiency tables
40   if(hasMC) {
41     AddMCSignals(diele);
42     printf(" Add %d MC signals \n",diele->GetMCSignals()->GetEntriesFast());
43   }
44   
45   
46   // cut setup
47   SetupEventCutsDieleFilter(diele, cutDefinition, isAOD);
48   SetupTrackCutsDieleData(diele, cutDefinition, isAOD);
49   SetupPairCutsDieleData(diele, cutDefinition, isAOD);
50   
51   //
52   // histogram setup
53   // only if an AliDielectronHistos object is attached to the
54   // dielelectron framework histograms will be filled
55   //
56   InitHistogramsDieleData(diele, cutDefinition, isAOD);
57
58   // the last definition uses no cuts and only the QA histograms should be filled!
59   InitCFDieleData(diele, cutDefinition, isAOD);
60
61   if(!hasMC){
62 /*
63       AliDielectronTrackRotator *rot=new AliDielectronTrackRotator;
64       rot->SetIterations(10);
65       rot->SetConeAnglePhi(TMath::Pi());
66       rot->SetStartAnglePhi(TMath::Pi());
67       if(cutDefinition>=2)  diele->SetTrackRotator(rot);
68 */
69
70       AliDielectronMixingHandler *mix=new AliDielectronMixingHandler;
71       mix->AddVariable(AliDielectronVarManager::kZvPrim,     20,-10.,10.);
72       mix->AddVariable(AliDielectronVarManager::kCentrality,  9,  0.,90.);
73       mix->SetMixType(AliDielectronMixingHandler::kAll);
74       mix->SetDepth(20);
75 //      if(cutDefinition>=2) 
76       diele->SetMixingHandler(mix);
77   }
78   
79   return diele;
80 }
81
82 //______________________________________________________________________________________
83 void SetupEventCutsDieleFilter(AliDielectron *diele, Int_t cutDefinition, Bool_t isAOD=kFALSE)
84 {
85   //
86   // Setup the event cuts
87   //
88   AliDielectronVarCuts *vtxZ = new AliDielectronVarCuts("vtxZ","Vertex z cut");
89   vtxZ->AddCut(AliDielectronVarManager::kZvPrim,-10.,10.);
90   
91   AliDielectronVarCuts *Centrality = new AliDielectronVarCuts("Centrality","Centrality Percentile");
92   Centrality->AddCut(AliDielectronVarManager::kCentrality,0.,90.);
93   
94   diele->GetEventFilter().AddCuts(vtxZ);
95   diele->GetEventFilter().AddCuts(Centrality);
96   
97 }
98
99
100 //______________________________________________________________________________________
101 void SetupTrackCutsDieleData(AliDielectron *diele, Int_t cutDefinition, Bool_t isAOD)
102 {
103   //
104   // Setup the track cuts
105   //
106   
107   
108 //    AliDielectronCutGroup* cuts = new AliDielectronCutGroup("cuts","cuts",AliDielectronCutGroup::kCompAND);
109 //    diele->GetTrackFilter().AddCuts(cuts);
110   
111     
112   
113   //ESD quality cuts DielectronTrackCuts
114   if (!isAOD) {
115     diele->GetTrackFilter().AddCuts(SetupESDtrackCutsDieleData(cutDefinition));
116   } else {
117     AliDielectronTrackCuts *trackCuts=new AliDielectronTrackCuts("trackCuts","trackCuts");
118     trackCuts->SetRequireTPCRefit(kTRUE);
119     trackCuts->SetRequireITSRefit(kTRUE);
120     diele->GetTrackFilter().AddCuts(trackCuts);//old
121     
122     
123     
124 //  cuts->AddCut(trackCuts);
125   }
126   
127   
128
129   //Pt cut ----------------------------------------------------------
130   AliDielectronVarCuts *pt = new AliDielectronVarCuts("ptCut","pt cut");
131   pt->AddCut(AliDielectronVarManager::kPt,1.,100.);
132   pt->AddCut(AliDielectronVarManager::kKinkIndex0,0.);
133   //AOD additions since there are no AliESDtrackCuts -----------------
134   pt->AddCut(AliDielectronVarManager::kEta,-0.9,0.9);
135   pt->AddCut(AliDielectronVarManager::kImpactParXY, -1.0,   1.0);
136   pt->AddCut(AliDielectronVarManager::kImpactParZ,  -3.0,   3.0);
137   //pt->AddCut(AliDielectronVarManager::kTPCchi2Cl,    0.0,   4.0);
138   pt->AddCut(AliDielectronVarManager::AliDielectronVarManager::kTPCnSigmaEle,-6,6.);
139   
140   
141   if(cutDefinition >=0){
142   pt->AddCut(AliDielectronVarManager::AliDielectronVarManager::kTPCnSigmaEle,-2,3.);
143 //  pt->AddCut(AliDielectronVarManager::kEMCALEoverP,0.9,1.2);
144   pt->AddCut(AliDielectronVarManager::kNclsTPC,90.,160.);
145   }
146   
147   
148   if(cutDefinition>=2){
149     pt->AddCut(AliDielectronVarManager::kNclsTPC,80.,160.);
150     pt->AddCut(AliDielectronVarManager::AliDielectronVarManager::kTPCnSigmaEle,-3.5,4.1);
151     pt->AddCut(AliDielectronVarManager::kPt,1.1,100.);
152   }
153   
154   
155   
156 //   cuts->AddCut(pt);
157
158
159
160
161
162   diele->GetTrackFilter().AddCuts(pt);//old
163 }
164
165 //______________________________________________________________________________________
166 void SetupPairCutsDieleData(AliDielectron *diele, Int_t cutDefinition, Bool_t isAOD)
167 {
168   //
169   // Setup the pair cuts
170   //
171   //Invariant mass and rapidity selection
172 AliDielectronVarCuts *pairCut=new AliDielectronVarCuts("0<M<5+|Y|<.9+PtEMCalleg","0<M<5 + |Y|<.9+PtEMCalleg");
173 pairCut->AddCut(AliDielectronVarManager::kM,1.,5.);
174 pairCut->AddCut(AliDielectronVarManager::kY,-0.9,0.9);
175 pairCut->AddCut(AliDielectronVarManager::kPt,4.5,100.);
176 //diele->GetPairFilter().AddCuts(pairCut);
177
178
179 AliDielectronVarCuts *mycut = new AliDielectronVarCuts("ptCutEMCAL","cut for EMCal");
180 mycut->AddCut(AliDielectronVarManager::kEMCALE,4.,100.);
181 mycut->AddCut(AliDielectronVarManager::kEMCALEoverP,0.7,1.3);
182 AliDielectronPairLegCuts *varpair=new AliDielectronPairLegCuts();
183 varpair->GetLeg1Filter().AddCuts(mycut);
184 varpair->GetLeg2Filter().AddCuts(mycut);
185 varpair->SetCutType(AliDielectronPairLegCuts::kAnyLeg);
186 diele->GetPairFilter().AddCuts(varpair);
187   
188 }
189
190
191 //______________________________________________________________________________________
192 void InitHistogramsDieleData(AliDielectron *diele, Int_t cutDefinition, Bool_t isAOD)
193 {
194   //
195   // Initialise the histograms
196   //
197   
198   //Setup histogram Manager
199   AliDielectronHistos *histos=new AliDielectronHistos(diele->GetName(),diele->GetTitle());
200   
201   //Initialise histogram classes
202   histos->SetReservedWords("Track;Pair");
203   
204   //Track classes
205   //to fill also track info from 2nd event loop until 2
206   for (Int_t i=0; i<2; ++i){
207     histos->AddClass(Form("Track_%s",AliDielectron::TrackClassName(i)));
208   }
209   
210   //Pair classes
211   // to fill also mixed event histograms loop until 10
212    if (cutDefinition==2) {
213      for (Int_t i=0; i<10; ++i){
214         histos->AddClass(Form("Pair_%s",AliDielectron::PairClassName(i)));
215      }
216    }
217   
218   //legs from pair
219   for (Int_t i=0; i<3; ++i){
220     histos->AddClass(Form("Track_Legs_%s",AliDielectron::PairClassName(i)));
221   }
222   
223   //track rotation
224   if (cutDefinition==2) {     
225       histos->AddClass(Form("Pair_%s",PairClassName(AliDielectron::kEv1PMRot)));
226       histos->AddClass(Form("Track_Legs_%s",PairClassName(AliDielectron::kEv1PMRot)));
227   }
228   
229   //add histograms to event class
230   if (cutDefinition==0) {
231     histos->AddClass("Event");
232     histos->UserHistogram("Event","VtxZ","Vertex Z;Z[cm]",300,-15.,15.,AliDielectronVarManager::kZvPrim);
233     histos->UserHistogram("Event","Centrality","Centrality;Cent(%)",100,0.,100.,AliDielectronVarManager::kCentrality);
234     histos->UserHistogram("Event","Multiplicity","Multiplicity V0;Multiplicity V0",500,0.,25000.,AliDielectronVarManager::kMultV0);
235     histos->UserHistogram("Event","Multiplicity_cent","Multiplicity V0 x Cent;Cent(%);Multiplicity V0",10,0,100.,500,0.,25000.,AliDielectronVarManager::kCentrality,AliDielectronVarManager::kMultV0);
236   }
237   
238    //add histograms to Track classes
239   histos->UserHistogram("Track","Pt","Pt;Pt [GeV];#tracks",100,0,20.,AliDielectronVarManager::kPt);
240   histos->UserHistogram("Track","TPCnCls","Number of Clusters TPC;TPC number clusteres;#tracks",160,-0.5,159.5,AliDielectronVarManager::kNclsTPC);
241   
242   histos->UserHistogram("Track","dXY","dXY;dXY [cm];#tracks",200,-1.,1.,AliDielectronVarManager::kImpactParXY);
243   histos->UserHistogram("Track","dZ","dZ;dZ [cm];#tracks",200,-3.,3.,AliDielectronVarManager::kImpactParZ);
244   histos->UserHistogram("Track","Eta_Phi","Eta Phi Map; Eta; Phi;#tracks",
245                         100,-1,1,144,0,6.285,AliDielectronVarManager::kEta,AliDielectronVarManager::kPhi);
246
247   histos->UserHistogram("Track","dEdx_P","dEdx;P [GeV];TPC signal (arb units);#tracks",
248                         200,0.2,20.,800,20.,200.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCsignal,kTRUE);
249
250   histos->UserHistogram("Track","dEdx_Pt","dEdx;Pt [GeV];TPC signal (arb units);#tracks",
251                         200,0.2,20.,800,20.,200.,AliDielectronVarManager::kPt,AliDielectronVarManager::kTPCsignal,kTRUE);
252
253   histos->UserHistogram("Track","TPCnSigmaPion_P","TPCnSigmaPion;P [GeV];TPCnSigmaEle;#tracks",
254                         200,0.2,20.,800,-12.,12.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCnSigmaPio,kTRUE);
255   
256   histos->UserHistogram("Track","TPCnSigmaEle_P","TPCnSigmaEle;P [GeV];TPCnSigmaEle;#tracks",
257                         200,0.2,20.,800,-12.,12.,AliDielectronVarManager::kPIn,AliDielectronVarManager::kTPCnSigmaEle,kTRUE);
258   
259   histos->UserHistogram("Track","TPCnSigmaEle_Pt","TPCnSigmaEle;Pt [GeV];TPCnSigmaEle;#tracks",
260                         200,0.2,20.,800,-12.,12.,AliDielectronVarManager::kPt,AliDielectronVarManager::kTPCnSigmaEle,kTRUE);
261
262   histos->UserHistogram("Track","TPCnSigmaEle_Phi","TPCnSigmaEle;#phi [rad];TPCnSigmaEle;#tracks",
263                         200,0.,2*TMath::Pi(),800,-12.,12.,AliDielectronVarManager::kPhi,AliDielectronVarManager::kTPCnSigmaEle,kTRUE);
264   
265   histos->UserHistogram("Track","TPCnSigmaEle_Eta","TPCnSigmaEle;#eta;TPCnSigmaEle;#tracks",
266                         200,-1.,1.,800,-12.,12.,AliDielectronVarManager::kEta,AliDielectronVarManager::kTPCnSigmaEle,kTRUE);
267     
268
269
270   histos->UserHistogram("Track","dEdx_Phi","dEdx;#phi [rad];TPC signal (arb units);#tracks",
271                         200,0.,2*TMath::Pi(),800,20.,200.,AliDielectronVarManager::kPhi,AliDielectronVarManager::kTPCsignal,kTRUE);
272
273   histos->UserHistogram("Track","dEdx_Eta","dEdx;#eta;TPC signal (arb units);#tracks",
274                         200,-1.,1.,800,20.,200.,AliDielectronVarManager::kEta,AliDielectronVarManager::kTPCsignal,kTRUE);
275
276
277
278   histos->UserHistogram("Track","dEdx_nSigmaEMCal","dEdx;NsigmaEmcal;TPC signal (arb units);NSigmaEMCAL",
279                         200,-5.,5.,800,20.,200.,AliDielectronVarManager::kEMCALnSigmaEle,AliDielectronVarManager::kTPCsignal,kTRUE);
280
281   histos->UserHistogram("Track","dEdx_TPCnSigmaEle","dEdx;TPC signal (arbunits);TPC number of sigmas Electrons;TPC signal (a.u.);#tracks",
282                         100,-10.,10.,800,20.,200.,AliDielectronVarManager::kTPCnSigmaEle,AliDielectronVarManager::kTPCsignal,kTRUE);
283
284   histos->UserHistogram("Track","dEdx_EoverP","dEdx;EoverP;TPC signal (arbunits);E/P",100,0.,5.,800,20.,200.,AliDielectronVarManager::kEMCALEoverP,AliDielectronVarManager::kTPCsignal,kTRUE);
285   
286   histos->UserHistogram("Track","nSigmaEMCal_EoverP","NsigmaEmcal;EoverP;NSigmaEMCAL;E/P",100,0.,5.,200,-5.,5.,AliDielectronVarManager::kEMCALEoverP,AliDielectronVarManager::kEMCALnSigmaEle,kTRUE);
287  
288   histos->UserHistogram("Track","EMCal_E","EmcalE;Cluster Energy [GeV];#Clusters",200,0.,40.,AliDielectronVarManager::kEMCALE,kTRUE);
289
290   histos->UserHistogram("Track","EMCal_E_nCells","EmcalE_nCells;# cells;Cluster Energy [GeV]",200,0.,40.,AliDielectronVarManager::kEMCALNCells,AliDielectronVarManager::kEMCALE,kTRUE);
291   
292   histos->UserHistogram("Track","ITS_FirstCls","ITS First Layer;ITS First Layer;#Entries",6,0.,6.,AliDielectronVarManager::kITSLayerFirstCls,kTRUE);
293
294   //add histograms to Pair classes
295   histos->UserHistogram("Pair","InvMass","Inv.Mass;Inv. Mass [GeV];#pairs",
296                         251,-.01,5.01,AliDielectronVarManager::kM);
297   histos->UserHistogram("Pair","InvMass2D","Inv.Mass;Pt [GeV]; Inv. Mass [GeV]",
298                         20,0.,20.,251,-.01,5.01,AliDielectronVarManager::kPt,AliDielectronVarManager::kM);
299   histos->UserHistogram("Pair","Rapidity","Rapidity;Rapidity;#pairs",
300                         100,-1.,1.,AliDielectronVarManager::kY);
301   histos->UserHistogram("Pair","OpeningAngle","Opening angle;angle",
302                         100,0.,3.15,AliDielectronVarManager::kOpeningAngle);
303   
304   diele->SetHistogramManager(histos);
305 }
306
307 void InitCFDieleData(AliDielectron *diele, Int_t cutDefinition, Bool_t isAOD)
308 {
309   //
310   // Setupd the CF Manager if needed
311   //
312   
313   AliDielectronCF *cf=new AliDielectronCF(diele->GetName(),diele->GetTitle());
314   
315   //pair variables
316   cf->AddVariable(AliDielectronVarManager::kPt,"4.0, 4.5, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 20.0");
317   cf->AddVariable(AliDielectronVarManager::kM,125,0.,125*.04); //40Mev Steps
318   cf->AddVariable(AliDielectronVarManager::kPairType,12,0,12);// to be checked
319   cf->AddVariable(AliDielectronVarManager::kOpeningAngle,"0.,0.1,0.2,0.4,0.6,0.8,1.0,2.0,3.14");
320   cf->AddVariable(AliDielectronVarManager::kY,20,-1.,1.); 
321   //leg variables
322   cf->AddVariable(AliDielectronVarManager::kPt,"1.0, 1.1, 1.2, 1.3, 1.4, 1.5,1.6,1.7,1.8,1.9, 2.0, 3.0, 10.0",kTRUE);
323 //   cf->AddVariable(AliDielectronVarManager::kP,"0.0, 1.0, 1.2, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 5.0, 10.0, 100.0",kTRUE);
324   cf->AddVariable(AliDielectronVarManager::kNclsTPC,"80, 85, 90, 95, 100, 110, 120, 160",kTRUE);
325 //   cf->AddVariable(AliDielectronVarManager::kEta,"-5.0,-1.0,-0.9,-0.7,0.7,0.9,1.0,5.0",kTRUE);
326 //   cf->AddVariable(AliDielectronVarManager::kPhi,"0.0,1.0,2.0,3.0,4.0,5.0,6.0",kTRUE);
327   cf->AddVariable(AliDielectronVarManager::kEMCALE,"1.0,2.0, 3.0, 4.0, 4.5, 5.0, 5.5, 6.0, 7.0, 8.0, 9.0, 10.0,11.0,12.0,16.0,25.0",kTRUE); 
328   cf->AddVariable(AliDielectronVarManager::kEMCALnSigmaEle,"-3.5,-3.0,-2.0,-1.0,1.0,2.0,3.0,4.0,5.0",kTRUE);
329   cf->AddVariable(AliDielectronVarManager::kEMCALNCells,25,0,25,kTRUE);
330   cf->AddVariable(AliDielectronVarManager::kEMCALEoverP,"0.6, 0.65,0.7,0.8,0.9,1.1,1.2,1.3,1.4,1.8,2.0,2.1",kTRUE);
331   cf->AddVariable(AliDielectronVarManager::kTPCnSigmaEle,"-3.5,-3.0,-2.5,-2.0,-1.5,-1.0,0.0,1.0,2.0,3.0,3.5,4.0",kTRUE);
332   cf->AddVariable(AliDielectronVarManager::kTPCnSigmaPio,"2.,2.5,3.0,3.5,4.0,4.5,100",kTRUE);
333   //event variables
334   cf->AddVariable(AliDielectronVarManager::kCentrality,20,0.,100.);
335   cf->AddVariable(AliDielectronVarManager::kMultV0,26,0.,26000.);
336   cf->AddVariable(AliDielectronVarManager::kZvPrim,20,-10.,10.);
337
338   cf->AddVariable(AliDielectronVarManager::kITSLayerFirstCls,6,0.,6.,kTRUE);
339
340   if (hasMC){
341       cf->AddVariable(AliDielectronVarManager::kPdgCode,10000,-5000.5,4999.5,kTRUE);
342       cf->AddVariable(AliDielectronVarManager::kPdgCodeMother,10000,-5000.5,4999.5,kTRUE);
343       cf->AddVariable(AliDielectronVarManager::kPdgCodeGrandMother,10000,-5000.5,4999.5,kTRUE);
344   }
345     //only in this case write MC truth info
346   if (cutDefinition==0){
347     cf->SetStepForMCtruth();
348 //     cf->SetStepsForMCtruthOnly();
349  }
350
351   diele->SetCFManagerPair(cf);
352   
353 }
354
355 void AddMCSignals(AliDielectron *diele){
356   //Do we have an MC handler?
357   //Bool_t hasMC=(AliAnalysisManager::GetAnalysisManager()->GetMCtruthEventHandler()!=0x0);
358   if (!hasMC) return;
359   
360   AliDielectronSignalMC* inclusiveJpsi = new AliDielectronSignalMC("inclusiveJpsi","Inclusive J/psi");
361   inclusiveJpsi->SetLegPDGs(11,-11);
362   inclusiveJpsi->SetMotherPDGs(443,443);
363   inclusiveJpsi->SetMothersRelation(AliDielectronSignalMC::kSame);
364   inclusiveJpsi->SetFillPureMCStep(kTRUE);
365   inclusiveJpsi->SetCheckBothChargesLegs(kTRUE,kTRUE);
366   inclusiveJpsi->SetCheckBothChargesMothers(kTRUE,kTRUE);
367   diele->AddSignalMC(inclusiveJpsi);
368   
369   AliDielectronSignalMC* promptJpsi = new AliDielectronSignalMC("promptJpsi","Prompt J/psi");   // prompt J/psi (not from beauty decays)
370   promptJpsi->SetLegPDGs(11,-11);
371   promptJpsi->SetMotherPDGs(443,443);
372   promptJpsi->SetGrandMotherPDGs(503,503,kTRUE,kTRUE);   // not from beauty hadrons
373   promptJpsi->SetMothersRelation(AliDielectronSignalMC::kSame);
374   promptJpsi->SetFillPureMCStep(kTRUE);
375   promptJpsi->SetLegSources(AliDielectronSignalMC::kFinalState, AliDielectronSignalMC::kFinalState);
376   promptJpsi->SetCheckBothChargesLegs(kTRUE,kTRUE);
377   promptJpsi->SetCheckBothChargesMothers(kTRUE,kTRUE);
378   promptJpsi->SetCheckBothChargesGrandMothers(kTRUE,kTRUE);
379   diele->AddSignalMC(promptJpsi);
380   
381   AliDielectronSignalMC* beautyJpsi = new AliDielectronSignalMC("beautyJpsi","Beauty J/psi");
382   beautyJpsi->SetLegPDGs(11,-11);
383   beautyJpsi->SetMotherPDGs(443,443);
384   beautyJpsi->SetMothersRelation(AliDielectronSignalMC::kSame);
385   beautyJpsi->SetGrandMotherPDGs(500,500);
386   beautyJpsi->SetFillPureMCStep(kTRUE);
387   beautyJpsi->SetCheckBothChargesLegs(kTRUE,kTRUE);
388   beautyJpsi->SetCheckBothChargesMothers(kTRUE,kTRUE);
389   beautyJpsi->SetCheckBothChargesGrandMothers(kTRUE,kTRUE);
390   diele->AddSignalMC(beautyJpsi);
391   
392   AliDielectronSignalMC* directJpsi = new AliDielectronSignalMC("directJpsi","Direct J/psi");   // embedded J/psi
393   directJpsi->SetLegPDGs(11,-11);
394   directJpsi->SetMotherPDGs(443,443);
395   directJpsi->SetMothersRelation(AliDielectronSignalMC::kSame);
396   directJpsi->SetFillPureMCStep(kTRUE);
397   directJpsi->SetLegSources(AliDielectronSignalMC::kFinalState, AliDielectronSignalMC::kFinalState);
398   directJpsi->SetMotherSources(AliDielectronSignalMC::kDirect, AliDielectronSignalMC::kDirect);
399   directJpsi->SetCheckBothChargesLegs(kTRUE,kTRUE);
400   directJpsi->SetCheckBothChargesMothers(kTRUE,kTRUE);
401   diele->AddSignalMC(directJpsi);
402 }
403
404
405
406
407 /*
408 //______________________________________________________________________________________
409 AliESDtrackCuts *SetupESDtrackCutsDieleData(Int_t cutDefinition)
410 {
411   //
412   // Setup default AliESDtrackCuts
413   //
414   AliESDtrackCuts *esdTrackCuts = new AliESDtrackCuts;
415
416   // basic track quality cuts  (basicQ)
417   esdTrackCuts->SetMaxDCAToVertexZ(3.0);
418   esdTrackCuts->SetMaxDCAToVertexXY(1.0);
419   esdTrackCuts->SetEtaRange( -0.9 , 0.9 );
420   esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
421   esdTrackCuts->SetRequireITSRefit(kTRUE);
422   esdTrackCuts->SetRequireTPCRefit(kTRUE);
423   esdTrackCuts->SetPtRange(1.,1e30);
424   esdTrackCuts->SetMinNClustersTPC(70);
425   esdTrackCuts->SetMaxChi2PerClusterTPC(4);
426   esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);  
427
428   return esdTrackCuts;
429 }
430 */