AliPhysics  v5-06-40-01 (42bb456)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskSELc2eleLambdafromAODtracks.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appeuear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 /* $Id$ */
17 
18 //
19 //
20 // Lc->e Lambda analysis code
21 //
22 // Input: AOD
23 // Output: TTree and/or THnSparse (mass vs pT vs Centrality)
24 //
25 // Cuts:
26 // TTree: SingleCuts on V0 and electron
27 // THnSparse: In addition to that, IsSelected(obj, kCandidate) applied
28 //
29 //-------------------------------------------------------------------------
30 //
31 // Authors: Y.S Watanabe(a)
32 // (a) CNS, the University of Tokyo
33 // Contatcs: wyosuke@cns.s.u-tokyo.ac.jp
34 //-------------------------------------------------------------------------
35 
36 #include <TSystem.h>
37 #include <TParticle.h>
38 #include <TParticlePDG.h>
39 #include <TH1F.h>
40 #include <TH1F.h>
41 #include <TH2F.h>
42 #include <THnSparse.h>
43 #include <TLorentzVector.h>
44 #include <TTree.h>
45 #include "TROOT.h"
46 #include <TDatabasePDG.h>
47 #include <AliAnalysisDataSlot.h>
48 #include <AliAnalysisDataContainer.h>
49 #include "AliStack.h"
50 #include "AliMCEvent.h"
51 #include "AliAnalysisManager.h"
52 #include "AliAODMCHeader.h"
53 #include "AliAODHandler.h"
54 #include "AliLog.h"
55 #include "AliExternalTrackParam.h"
56 #include "AliAODVertex.h"
57 #include "AliESDVertex.h"
58 #include "AliAODRecoDecay.h"
59 #include "AliAODRecoDecayHF.h"
60 #include "AliAODRecoCascadeHF.h"
61 #include "AliESDtrack.h"
62 #include "AliAODTrack.h"
63 #include "AliAODv0.h"
64 #include "AliAODcascade.h"
65 #include "AliAODMCParticle.h"
66 #include "AliAnalysisTaskSE.h"
68 #include "AliPIDResponse.h"
69 #include "AliPIDCombined.h"
70 #include "AliTOFPIDResponse.h"
71 #include "AliAODPidHF.h"
72 #include "AliInputEventHandler.h"
73 #include "AliESDtrackCuts.h"
74 #include "AliNeutralTrackParam.h"
75 #include "AliKFParticle.h"
76 #include "AliKFVertex.h"
77 #include "AliExternalTrackParam.h"
78 #include "AliESDtrack.h"
79 #include "AliCentrality.h"
80 #include "AliVertexerTracks.h"
81 #include "AliEventPoolManager.h"
83 
84 using std::cout;
85 using std::endl;
86 
90 
91 //__________________________________________________________________________
93  AliAnalysisTaskSE(),
94  fUseMCInfo(kFALSE),
95  fOutput(0),
96  fOutputAll(0),
97  fListCuts(0),
98  fCEvents(0),
99  fHTrigger(0),
100  fHCentrality(0),
101  fAnalCuts(0),
102  fIsEventSelected(kFALSE),
103  fWriteVariableTree(kFALSE),
104  fWriteEachVariableTree(kFALSE),
105  fWriteMCVariableTree(kFALSE),
106  fVariablesTree(0),
107  fEleVariablesTree(0),
108  fV0VariablesTree(0),
109  fMCVariablesTree(0),
110  fMCEleVariablesTree(0),
111  fMCV0VariablesTree(0),
112  fReconstructPrimVert(kFALSE),
113  fIsMB(kFALSE),
114  fIsSemi(kFALSE),
115  fIsCent(kFALSE),
116  fIsINT7(kFALSE),
117  fIsEMC7(kFALSE),
118  fCandidateVariables(),
119  fCandidateEleVariables(),
120  fCandidateV0Variables(),
121  fCandidateMCVariables(),
122  fCandidateMCEleVariables(),
123  fCandidateMCV0Variables(),
124  fVtx1(0),
125  fV1(0),
126  fVtxZ(0),
127  fBzkG(0),
128  fCentrality(0),
129  fRunNumber(0),
130  fTriggerCheck(0),
131  fUseCentralityV0M(kFALSE),
132  fEvNumberCounter(0),
133  fHistoEleLambdaMass(0),
134  fHistoEleLambdaMassRS(0),
135  fHistoEleLambdaMassWS(0),
136  fHistoEleLambdaMassRSMix(0),
137  fHistoEleLambdaMassWSMix(0),
138  fHistoEleLambdaMassvsElePtRS(0),
139  fHistoEleLambdaMassvsElePtWS(0),
140  fHistoEleLambdaMassvsElePtRSMix(0),
141  fHistoEleLambdaMassvsElePtWSMix(0),
142  fHistoElePtRS(0),
143  fHistoElePtWS(0),
144  fHistoElePtRSMix(0),
145  fHistoElePtWSMix(0),
146  fHistoEleLambdaMassMCS(0),
147  fHistoEleLambdaMassMCGen(0),
148  fHistoEleLambdaMassvsElePtMCS(0),
149  fHistoEleLambdaMassvsElePtMCGen(0),
150  fHistoElePtMCS(0),
151  fHistoElePtMCGen(0),
152  fHistoElePtvsEtaRS(0),
153  fHistoElePtvsEtaWS(0),
154  fHistoElePtvsEtaRSMix(0),
155  fHistoElePtvsEtaWSMix(0),
156  fHistoElePtvsEtaMCS(0),
157  fHistoElePtvsEtaMCGen(0),
158  fHistoElePtvsLambdaPtRS(0),
159  fHistoElePtvsLambdaPtWS(0),
160  fHistoElePtvsLambdaPtRSMix(0),
161  fHistoElePtvsLambdaPtWSMix(0),
162  fHistoElePtvsLambdaPtMCS(0),
163  fHistoElePtvsLambdaPtvsLcPtMCS(0),
164  fHistoElePtvsLambdaPtMCGen(0),
165  fHistoElePtvsLambdaPtvsLcPtMCGen(0),
166  fHistoElePtvsLambdaPtMCLcGen(0),
167  fHistoElePtvsd0RS(0),
168  fHistoElePtvsd0WS(0),
169  fHistoElePtvsd0RSMix(0),
170  fHistoElePtvsd0WSMix(0),
171  fHistoElePtvsd0MCS(0),
172  fHistoElePtvsd0PromptMCS(0),
173  fHistoElePtvsd0BFeeddownMCS(0),
174  fHistoEleLambdaMassFeeddownXic0MCS(0),
175  fHistoEleLambdaMassFeeddownXic0MCGen(0),
176  fHistoEleLambdaMassvsElePtFeeddownXic0MCS(0),
177  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen(0),
178  fHistoElePtFeeddownXic0MCS(0),
179  fHistoElePtFeeddownXic0MCGen(0),
180  fHistoElePtvsEtaFeeddownXic0MCS(0),
181  fHistoElePtvsEtaFeeddownXic0MCGen(0),
182  fHistoElePtvsLambdaPtFeeddownXic0MCS(0),
183  fHistoElePtvsLambdaPtFeeddownXic0MCGen(0),
184  fHistoEleLambdaMassFeeddownXicPlusMCS(0),
185  fHistoEleLambdaMassFeeddownXicPlusMCGen(0),
186  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS(0),
187  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen(0),
188  fHistoElePtFeeddownXicPlusMCS(0),
189  fHistoElePtFeeddownXicPlusMCGen(0),
190  fHistoElePtvsEtaFeeddownXicPlusMCS(0),
191  fHistoElePtvsEtaFeeddownXicPlusMCGen(0),
192  fHistoElePtvsLambdaPtFeeddownXicPlusMCS(0),
193  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen(0),
194  fHistoBachPt(0),
195  fHistoBachPtMCS(0),
196  fHistoBachPtMCGen(0),
197  fHistod0Bach(0),
198  fHistoLambdaMassvsPt(0),
199  fHistoLambdaMassvsPtMCS(0),
200  fHistoLambdaMassvsPtMCGen(0),
201  fHistoK0sMassvsPt(0),
202  fHistoElectronTPCPID(0),
203  fHistoElectronTOFPID(0),
204  fHistoElectronTPCSelPID(0),
205  fHistoElectronTOFSelPID(0),
206  fHistoElectronTPCPIDSelTOF(0),
207  fHistoElectronTPCPIDSelTOFSmallEta(0),
208  fHistoElectronTPCPIDSelTOFLargeEta(0),
209  fHistoElectronQovPtvsPhi(0),
210  fHistoLambdaQovPtvsPhi(0),
211  fHistoLcMCGen(0),
212  fHistoFeedDownXic0MCGen(0),
213  fHistoFeedDownXicPlusMCGen(0),
214  fHistoLcElectronMCGen(0),
215  fHistoElectronFeedDownXic0MCGen(0),
216  fHistoElectronFeedDownXicPlusMCGen(0),
217  fHistoElectronMCGen(0),
218  fHistoLambdaMCGen(0),
219  fCounter(0),
220  fHistonEvtvsRunNumber(0),
221  fHistonElevsRunNumber(0),
222  fHistonLambdavsRunNumber(0),
223  fDoEventMixing(0),
224  fNumberOfEventsForMixing (5),
225  fNzVtxBins (0),
226  fNCentBins (0),
227  fNOfPools(1),
228  fEventBuffer(0x0),
229  fEventInfo(0x0),
230  fElectronTracks(0x0)
231 {
232  //
234  //
235  for(Int_t i=0;i<17;i++){
236  fHistoElePtvsCutVarsRS[i] = 0;
237  fHistoElePtvsCutVarsWS[i] = 0;
239  }
240  for(Int_t i=0;i<8;i++){
242  }
243 }
244 
245 //___________________________________________________________________________
248  Bool_t writeVariableTree) :
249  AliAnalysisTaskSE(name),
250  fUseMCInfo(kFALSE),
251  fOutput(0),
252  fOutputAll(0),
253  fListCuts(0),
254  fCEvents(0),
255  fHTrigger(0),
256  fHCentrality(0),
257  fAnalCuts(analCuts),
258  fIsEventSelected(kFALSE),
259  fWriteVariableTree(writeVariableTree),
260  fWriteEachVariableTree(kFALSE),
261  fWriteMCVariableTree(kFALSE),
262  fVariablesTree(0),
263  fEleVariablesTree(0),
264  fV0VariablesTree(0),
265  fMCVariablesTree(0),
266  fMCEleVariablesTree(0),
267  fMCV0VariablesTree(0),
268  fReconstructPrimVert(kFALSE),
269  fIsMB(kFALSE),
270  fIsSemi(kFALSE),
271  fIsCent(kFALSE),
272  fIsINT7(kFALSE),
273  fIsEMC7(kFALSE),
274  fCandidateVariables(),
275  fCandidateEleVariables(),
276  fCandidateV0Variables(),
277  fCandidateMCVariables(),
278  fCandidateMCEleVariables(),
279  fCandidateMCV0Variables(),
280  fVtx1(0),
281  fV1(0),
282  fVtxZ(0),
283  fBzkG(0),
284  fCentrality(0),
285  fRunNumber(0),
286  fTriggerCheck(0),
287  fUseCentralityV0M(kFALSE),
288  fEvNumberCounter(0),
289  fHistoEleLambdaMass(0),
290  fHistoEleLambdaMassRS(0),
291  fHistoEleLambdaMassWS(0),
292  fHistoEleLambdaMassRSMix(0),
293  fHistoEleLambdaMassWSMix(0),
294  fHistoEleLambdaMassvsElePtRS(0),
295  fHistoEleLambdaMassvsElePtWS(0),
296  fHistoEleLambdaMassvsElePtRSMix(0),
297  fHistoEleLambdaMassvsElePtWSMix(0),
298  fHistoElePtRS(0),
299  fHistoElePtWS(0),
300  fHistoElePtRSMix(0),
301  fHistoElePtWSMix(0),
302  fHistoEleLambdaMassMCS(0),
303  fHistoEleLambdaMassMCGen(0),
304  fHistoEleLambdaMassvsElePtMCS(0),
305  fHistoEleLambdaMassvsElePtMCGen(0),
306  fHistoElePtMCS(0),
307  fHistoElePtMCGen(0),
308  fHistoElePtvsEtaRS(0),
309  fHistoElePtvsEtaWS(0),
310  fHistoElePtvsEtaRSMix(0),
311  fHistoElePtvsEtaWSMix(0),
312  fHistoElePtvsEtaMCS(0),
313  fHistoElePtvsEtaMCGen(0),
314  fHistoElePtvsLambdaPtRS(0),
315  fHistoElePtvsLambdaPtWS(0),
316  fHistoElePtvsLambdaPtRSMix(0),
317  fHistoElePtvsLambdaPtWSMix(0),
318  fHistoElePtvsLambdaPtMCS(0),
319  fHistoElePtvsLambdaPtvsLcPtMCS(0),
320  fHistoElePtvsLambdaPtMCGen(0),
321  fHistoElePtvsLambdaPtvsLcPtMCGen(0),
322  fHistoElePtvsLambdaPtMCLcGen(0),
323  fHistoElePtvsd0RS(0),
324  fHistoElePtvsd0WS(0),
325  fHistoElePtvsd0RSMix(0),
326  fHistoElePtvsd0WSMix(0),
327  fHistoElePtvsd0MCS(0),
328  fHistoElePtvsd0PromptMCS(0),
329  fHistoElePtvsd0BFeeddownMCS(0),
330  fHistoEleLambdaMassFeeddownXic0MCS(0),
331  fHistoEleLambdaMassFeeddownXic0MCGen(0),
332  fHistoEleLambdaMassvsElePtFeeddownXic0MCS(0),
333  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen(0),
334  fHistoElePtFeeddownXic0MCS(0),
335  fHistoElePtFeeddownXic0MCGen(0),
336  fHistoElePtvsEtaFeeddownXic0MCS(0),
337  fHistoElePtvsEtaFeeddownXic0MCGen(0),
338  fHistoElePtvsLambdaPtFeeddownXic0MCS(0),
339  fHistoElePtvsLambdaPtFeeddownXic0MCGen(0),
340  fHistoEleLambdaMassFeeddownXicPlusMCS(0),
341  fHistoEleLambdaMassFeeddownXicPlusMCGen(0),
342  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS(0),
343  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen(0),
344  fHistoElePtFeeddownXicPlusMCS(0),
345  fHistoElePtFeeddownXicPlusMCGen(0),
346  fHistoElePtvsEtaFeeddownXicPlusMCS(0),
347  fHistoElePtvsEtaFeeddownXicPlusMCGen(0),
348  fHistoElePtvsLambdaPtFeeddownXicPlusMCS(0),
349  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen(0),
350  fHistoBachPt(0),
351  fHistoBachPtMCS(0),
352  fHistoBachPtMCGen(0),
353  fHistod0Bach(0),
354  fHistoLambdaMassvsPt(0),
355  fHistoLambdaMassvsPtMCS(0),
356  fHistoLambdaMassvsPtMCGen(0),
357  fHistoK0sMassvsPt(0),
358  fHistoElectronTPCPID(0),
359  fHistoElectronTOFPID(0),
360  fHistoElectronTPCSelPID(0),
361  fHistoElectronTOFSelPID(0),
362  fHistoElectronTPCPIDSelTOF(0),
363  fHistoElectronTPCPIDSelTOFSmallEta(0),
364  fHistoElectronTPCPIDSelTOFLargeEta(0),
365  fHistoElectronQovPtvsPhi(0),
366  fHistoLambdaQovPtvsPhi(0),
367  fHistoLcMCGen(0),
368  fHistoFeedDownXic0MCGen(0),
369  fHistoFeedDownXicPlusMCGen(0),
370  fHistoLcElectronMCGen(0),
371  fHistoElectronFeedDownXic0MCGen(0),
372  fHistoElectronFeedDownXicPlusMCGen(0),
373  fHistoElectronMCGen(0),
374  fHistoLambdaMCGen(0),
375  fCounter(0),
376  fHistonEvtvsRunNumber(0),
377  fHistonElevsRunNumber(0),
378  fHistonLambdavsRunNumber(0),
379  fDoEventMixing(0),
380  fNumberOfEventsForMixing (5),
381  fNzVtxBins (0),
382  fNCentBins (0),
383  fNOfPools(1),
384  fEventBuffer(0x0),
385  fEventInfo(0x0),
386  fElectronTracks(0x0)
387 {
388  //
390  //
391  Info("AliAnalysisTaskSELc2eleLambdafromAODtracks","Calling Constructor");
392 
393  for(Int_t i=0;i<17;i++){
394  fHistoElePtvsCutVarsRS[i] = 0;
395  fHistoElePtvsCutVarsWS[i] = 0;
397  }
398  for(Int_t i=0;i<8;i++){
400  }
401 
402  DefineOutput(1,TList::Class()); //conters
403  DefineOutput(2,TList::Class());
404  DefineOutput(3,TList::Class()); //conters
405  DefineOutput(4,TTree::Class()); //My private output
406  DefineOutput(5,TTree::Class()); //My private output
407  DefineOutput(6,TTree::Class()); //My private output
408  DefineOutput(7,TTree::Class()); //My private output
409  DefineOutput(8,AliNormalizationCounter::Class());
410  DefineOutput(9,TTree::Class()); //My private output
411  DefineOutput(10,TTree::Class()); //My private output
412 }
413 
414 //___________________________________________________________________________
416  //
418  //
419  Info("~AliAnalysisTaskSELc2eleLambdafromAODtracks","Calling Destructor");
420 
421  if (fOutput) {
422  delete fOutput;
423  fOutput = 0;
424  }
425 
426  if (fOutputAll) {
427  delete fOutputAll;
428  fOutputAll = 0;
429  }
430 
431  if (fListCuts) {
432  delete fListCuts;
433  fListCuts = 0;
434  }
435 
436 
437  if (fAnalCuts) {
438  delete fAnalCuts;
439  fAnalCuts = 0;
440  }
441 
442  if (fVariablesTree) {
443  delete fVariablesTree;
444  fVariablesTree = 0;
445  }
446  if (fEleVariablesTree) {
447  delete fEleVariablesTree;
448  fEleVariablesTree = 0;
449  }
450  if (fV0VariablesTree) {
451  delete fV0VariablesTree;
452  fV0VariablesTree = 0;
453  }
454  if (fMCVariablesTree) {
455  delete fMCVariablesTree;
456  fMCVariablesTree = 0;
457  }
458  if (fMCEleVariablesTree) {
459  delete fMCEleVariablesTree;
461  }
462  if (fMCV0VariablesTree) {
463  delete fMCV0VariablesTree;
464  fMCV0VariablesTree = 0;
465  }
466  if(fCounter){
467  delete fCounter;
468  fCounter = 0;
469  }
470 }
471 
472 //_________________________________________________
474  //
476  //
477  //
478 
479  fIsEventSelected=kFALSE;
480 
481  if (fDebug > 1) AliInfo("Init");
482 
483  fListCuts = new TList();
484  fListCuts->SetOwner();
485  fListCuts->SetName("ListCuts");
487  PostData(2,fListCuts);
488 
489  return;
490 }
491 
492 //_________________________________________________
494 {
495  //
497  //
498 
499  if (!fInputEvent) {
500  AliError("NO EVENT FOUND!");
501  return;
502  }
503  AliAODEvent* aodEvent = dynamic_cast<AliAODEvent*>(fInputEvent);
504  fCEvents->Fill(1);
506 
507  //------------------------------------------------
508  // First check if the event has proper B
509  //------------------------------------------------
510 
511  fBzkG = (Double_t)aodEvent->GetMagneticField();
512  AliKFParticle::SetField(fBzkG);
513  if (TMath::Abs(fBzkG)<0.001) {
514  return;
515  }
516  fCEvents->Fill(2);
517 
520 
521  //------------------------------------------------
522  // MC analysis setting
523  //------------------------------------------------
524  TClonesArray *mcArray = 0;
525  AliAODMCHeader *mcHeader=0;
526  if (fUseMCInfo) {
527  // MC array need for maching
528  mcArray = dynamic_cast<TClonesArray*>(aodEvent->FindListObject(AliAODMCParticle::StdBranchName()));
529  if (!mcArray) {
530  AliError("Could not find Monte-Carlo in AOD");
531  return;
532  }
533  fCEvents->Fill(6); // in case of MC events
534 
535  // load MC header
536  mcHeader = (AliAODMCHeader*)aodEvent->GetList()->FindObject(AliAODMCHeader::StdBranchName());
537  if (!mcHeader) {
538  AliError("AliAnalysisTaskSELc2eleLambdafromAODtracks::UserExec: MC header branch not found!\n");
539  return;
540  }
541  fCEvents->Fill(7); // in case of MC events
542 
543  Double_t zMCVertex = mcHeader->GetVtxZ();
544  if (TMath::Abs(zMCVertex) > fAnalCuts->GetMaxVtxZ()) {
545  AliDebug(2,Form("Event rejected: abs(zVtxMC)=%f > fAnalCuts->GetMaxVtxZ()=%f",zMCVertex,fAnalCuts->GetMaxVtxZ()));
546  return;
547  } else {
548  fCEvents->Fill(17); // in case of MC events
549  }
550  if ((TMath::Abs(zMCVertex) < fAnalCuts->GetMaxVtxZ()) && (!fAnalCuts->IsEventRejectedDuePhysicsSelection()) && (!fAnalCuts->IsEventRejectedDueToTrigger())) {
551  MakeMCAnalysis(mcArray);
552  }
553  }
554 
555  //------------------------------------------------
556  // Event selection
557  //------------------------------------------------
558  fVtx1 = (AliAODVertex*)aodEvent->GetPrimaryVertex();
559  if (!fVtx1) return;
560 
561  Double_t pos[3],cov[6];
562  fVtx1->GetXYZ(pos);
563  fVtx1->GetCovarianceMatrix(cov);
564  fV1 = new AliESDVertex(pos,cov,100.,100,fVtx1->GetName());
565  fVtxZ = pos[2];
566 
567  Bool_t fIsTriggerNotOK = fAnalCuts->IsEventRejectedDueToTrigger();
568  if(!fIsTriggerNotOK) fCEvents->Fill(3);
569  if(!fIsEventSelected) {
570  delete fV1;
571  return;
572  }
573  fCEvents->Fill(4);
574 
575  fIsMB=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kMB)==(AliVEvent::kMB);
576  fIsSemi=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kSemiCentral)==(AliVEvent::kSemiCentral);
577  fIsCent=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kCentral)==(AliVEvent::kCentral);
578  fIsINT7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kINT7)==(AliVEvent::kINT7);
579  fIsEMC7=(((AliInputEventHandler*)(AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler()))->IsEventSelected()&AliVEvent::kEMC7)==(AliVEvent::kEMC7);
581  if(fIsMB) fHTrigger->Fill(1);
582  if(fIsSemi) fHTrigger->Fill(2);
583  if(fIsCent) fHTrigger->Fill(3);
584  if(fIsINT7) fHTrigger->Fill(4);
585  if(fIsEMC7) fHTrigger->Fill(5);
586  if(fIsMB|fIsSemi|fIsCent) fHTrigger->Fill(7);
587  if(fIsINT7|fIsEMC7) fHTrigger->Fill(8);
588  if(fIsMB&fIsSemi) fHTrigger->Fill(10);
589  if(fIsMB&fIsCent) fHTrigger->Fill(11);
590  if(fIsINT7&fIsEMC7) fHTrigger->Fill(12);
591 
592  if(fUseCentralityV0M){
593  AliCentrality *cent = aodEvent->GetCentrality();
594  fCentrality = cent->GetCentralityPercentile("V0M");
595  }else{
596  fCentrality = 1.;
597  }
598  if(fCentrality<0.||fCentrality>100.-0.0000001) {
599  delete fV1;
600  return;
601  }
602  fHCentrality->Fill(fCentrality);
603  fRunNumber = aodEvent->GetRunNumber();
604 
605  Int_t runnumber_offset = 0;
606  Int_t runnumber = aodEvent->GetRunNumber();
607  if(runnumber<=131000&&runnumber>=114000){
608  runnumber_offset = 114000;//lhc10bcde
609  }else if(runnumber<=196000&&runnumber>=195000){
610  runnumber_offset = 195000;//lhc13bc
611  }else if(runnumber<=170593&&runnumber>=167902){
612  runnumber_offset = 167902;//lhc11h
613  }
614  fHistonEvtvsRunNumber->Fill(runnumber-runnumber_offset,1.);
615 
616  //------------------------------------------------
617  // Check if the event has v0 candidate
618  //------------------------------------------------
619  //Int_t nv0 = aodEvent->GetNumberOfV0s();
620  fCEvents->Fill(5);
621 
622 
623  //------------------------------------------------
624  // Main analysis done in this function
625  //------------------------------------------------
626  MakeAnalysis(aodEvent,mcArray);
627 
628 
629  PostData(1,fOutput);
630  PostData(3,fOutputAll);
631  PostData(4,fVariablesTree);
632  PostData(5,fEleVariablesTree);
633  PostData(6,fV0VariablesTree);
634  PostData(7,fMCVariablesTree);
635  PostData(8,fCounter);
636  PostData(9,fMCEleVariablesTree);
637  PostData(10,fMCV0VariablesTree);
638 
639  fIsEventSelected=kFALSE;
640 
641  delete fV1;
642  return;
643 }
644 
645 //________________________________________ terminate ___________________________
647 {
651 
652  //AliInfo("Terminate","");
653  AliAnalysisTaskSE::Terminate();
654 
655  fOutput = dynamic_cast<TList*> (GetOutputData(1));
656  if (!fOutput) {
657  AliError("fOutput not available");
658  return;
659  }
660 
661  fOutputAll = dynamic_cast<TList*> (GetOutputData(3));
662  if (!fOutputAll) {
663  AliError("fOutputAll not available");
664  return;
665  }
666 
667  return;
668 }
669 
670 //___________________________________________________________________________
672 {
676  //AliInfo(Form("CreateOutputObjects of task %s\n", GetName()));
677 
678  //------------------------------------------------
679  // output object setting
680  //------------------------------------------------
681  fOutput = new TList();
682  fOutput->SetOwner();
683  fOutput->SetName("chist0");
684  DefineGeneralHistograms(); // define general histograms
685  PostData(1,fOutput);
686 
687  fOutputAll = new TList();
688  fOutputAll->SetOwner();
689  fOutputAll->SetName("anahisto");
690  DefineAnalysisHistograms(); // define general histograms
691  PostData(3,fOutputAll);
692 
694  PostData(4,fVariablesTree);
695 
697  PostData(5,fEleVariablesTree);
698 
700  PostData(6,fV0VariablesTree);
701 
703  PostData(7,fMCVariablesTree);
704 
706  PostData(9,fMCEleVariablesTree);
707 
709  PostData(10,fMCV0VariablesTree);
710 
711  //Counter for Normalization
712  TString normName="NormalizationCounter";
713  AliAnalysisDataContainer *cont = GetOutputSlot(8)->GetContainer();
714  if(cont)normName=(TString)cont->GetName();
715  fCounter = new AliNormalizationCounter(normName.Data());
716  fCounter->Init();
717  PostData(8,fCounter);
718 
719  if(fDoEventMixing){
720  fElectronTracks = new TObjArray();
721  fElectronTracks->SetOwner();
722 
724  fEventBuffer = new TTree*[fNOfPools];
725  for(Int_t i=0; i<fNOfPools; i++){
726  fEventBuffer[i]=new TTree(Form("EventBuffer_%d",i), "Temporary buffer for event mixing");
727  fEventBuffer[i]->Branch("zVertex", &fVtxZ);
728  fEventBuffer[i]->Branch("centrality", &fCentrality);
729  fEventBuffer[i]->Branch("eventInfo", "TObjString",&fEventInfo);
730  fEventBuffer[i]->Branch("earray", "TObjArray", &fElectronTracks);
731  }
732  }
733 
734 
735  return;
736 }
737 
738 //-------------------------------------------------------------------------------
740 (
741  AliAODEvent *aodEvent, TClonesArray *mcArray
742  )
743 {
744  //
746  //
747  if(fDoEventMixing && fElectronTracks) fElectronTracks->Delete();
748 
749  //------------------------------------------------
750  // Select good track before hand to save time
751  //------------------------------------------------
752 
753  Int_t nV0s= aodEvent->GetNumberOfV0s();
754  Int_t nTracks= aodEvent->GetNumberOfTracks();
755 
756  Bool_t seleTrkFlags[nTracks];
757  Int_t nSeleTrks=0;
758  SelectTrack(aodEvent,nTracks,nSeleTrks,seleTrkFlags,mcArray);
759 
760  Bool_t seleV0Flags[nV0s];
761  Int_t nSeleV0=0;
762  SelectV0(aodEvent,nV0s,nSeleV0,seleV0Flags,mcArray);
763 
764  Int_t runnumber_offset = 0;
765  Int_t runnumber = aodEvent->GetRunNumber();
766  if(runnumber<=131000&&runnumber>=114000){
767  runnumber_offset = 114000;//lhc10bcde
768  }else if(runnumber<=196000&&runnumber>=195000){
769  runnumber_offset = 195000;//lhc13bc
770  }else if(runnumber<=170593&&runnumber>=167902){
771  runnumber_offset = 167902;//lhc11h
772  }
773  fHistonElevsRunNumber->Fill(runnumber-runnumber_offset,nSeleTrks);
774  fHistonLambdavsRunNumber->Fill(runnumber-runnumber_offset,nSeleV0);
775 
776  //------------------------------------------------
777  // V0 loop
778  //------------------------------------------------
779  for (Int_t iv0 = 0; iv0<nV0s; iv0++) {
780  if(!seleV0Flags[iv0]) continue;
781  AliAODv0 *v0 = aodEvent->GetV0(iv0);
782  if(!v0) continue;
783 
784  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
785  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
786 
787  //------------------------------------------------
788  // track loop
789  //------------------------------------------------
790  for (Int_t itrk = 0; itrk<nTracks; itrk++) {
791  if(!seleTrkFlags[itrk]) continue;
792  AliAODTrack *trk = (AliAODTrack*)aodEvent->GetTrack(itrk);
793  if(trk->GetID()<0) continue;
794 
795  Int_t cpid = cptrack->GetID();
796  Int_t cnid = cntrack->GetID();
797  Int_t lpid = trk->GetID();
798  if((cpid==lpid)||(cnid==lpid)) continue;
799 
800  //if(!fAnalCuts->SelectWithRoughCuts(v0,trk)) continue;
801 
802  AliAODVertex *secVert = ReconstructSecondaryVertex(v0,trk,aodEvent);//Fake, prim vertex is just used as secondary vertex. place holder for future
803  if(!secVert) continue;
804 
805  AliAODRecoCascadeHF *elobj = MakeCascadeHF(v0,trk,aodEvent,secVert,false);
806  if(!elobj) {
807  continue;
808  }
809 
810  FillROOTObjects(elobj, v0,trk,mcArray,false);
811 
812  elobj->GetSecondaryVtx()->RemoveDaughters();
813  elobj->UnsetOwnPrimaryVtx();
814  delete elobj;elobj=NULL;
815  delete secVert;
816  }
817  }
818 
819  if(fDoEventMixing){
820  fEventInfo->SetString(Form("Ev%d_esd%d_E%d",AliAnalysisManager::GetAnalysisManager()->GetNcalls(),((AliAODHeader*)aodEvent->GetHeader())->GetEventNumberESDFile(),fElectronTracks->GetEntries()));
821  Int_t ind=GetPoolIndex(fVtxZ,fCentrality);
822  if(ind>=0 && ind<fNOfPools){
823  if(fEventBuffer[ind]->GetEntries() >= fNumberOfEventsForMixing){
824  DoEventMixingWithPools(ind,aodEvent,seleV0Flags);
825  //ResetPool(ind);
826  }
827  fEventBuffer[ind]->Fill();
828  }
829  }
830 }
833 {
837 
838  const char* nameoutput = GetOutputSlot(4)->GetContainer()->GetName();
839  fVariablesTree = new TTree(nameoutput,"Candidates variables tree");
840  Int_t nVar = 70;
841  fCandidateVariables = new Float_t [nVar];
842  TString * fCandidateVariableNames = new TString[nVar];
843 
844  fCandidateVariableNames[ 0]="Centrality";
845  fCandidateVariableNames[ 1]="InvMassEleLambda";
846  fCandidateVariableNames[ 2]="EleLambdaPt";
847  fCandidateVariableNames[ 3]="EleLambdaPx";
848  fCandidateVariableNames[ 4]="EleLambdaPy";
849  fCandidateVariableNames[ 5]="EleLambdaPz";
850  fCandidateVariableNames[ 6]="ElePx";
851  fCandidateVariableNames[ 7]="ElePy";
852  fCandidateVariableNames[ 8]="ElePz";
853  fCandidateVariableNames[ 9]="V0Px";
854  fCandidateVariableNames[10]="V0Py";
855  fCandidateVariableNames[11]="V0Pz";
856  fCandidateVariableNames[12]="AntiLambdaFlag";
857  fCandidateVariableNames[13]="MassLambda";
858  fCandidateVariableNames[14]="MassAntiLambda";
859  fCandidateVariableNames[15]="Eled0";
860  fCandidateVariableNames[16]="V0d0";
861  fCandidateVariableNames[17]="nSigmaTPCele";
862  fCandidateVariableNames[18]="nSigmaTOFele";
863  fCandidateVariableNames[19]="nSigmaTPCv0pr";
864  fCandidateVariableNames[20]="nSigmaTOFv0pr";
865  fCandidateVariableNames[21]="EleCharge";
866  fCandidateVariableNames[22]="ProtonPx";
867  fCandidateVariableNames[23]="ProtonPy";
868  fCandidateVariableNames[24]="ProtonPz";
869  fCandidateVariableNames[25]="PiPx";
870  fCandidateVariableNames[26]="PiPy";
871  fCandidateVariableNames[27]="PiPz";
872  fCandidateVariableNames[28]="mcpdglc";
873  fCandidateVariableNames[29]="mclablc";
874  fCandidateVariableNames[30]="mcpdgmomele";
875  fCandidateVariableNames[31]="mcpdgmomv0";
876  fCandidateVariableNames[32]="Mixing";
877  fCandidateVariableNames[33]="mcpdgele";
878  fCandidateVariableNames[34]="nSigmaTPCpr_etrk";
879  fCandidateVariableNames[35]="nSigmaTOFpr_etrk";
880  fCandidateVariableNames[36]="nSigmaTPCka_etrk";
881  fCandidateVariableNames[37]="nSigmaTOFka_etrk";
882  fCandidateVariableNames[38]="MassK0Short";
883  fCandidateVariableNames[39]="mcpdggrmomele";
884  fCandidateVariableNames[40]="mcpdggrmomv0";
885  fCandidateVariableNames[41]="mcngenele";
886  fCandidateVariableNames[42]="mcngenv0";
887  fCandidateVariableNames[43]="mclcpx";
888  fCandidateVariableNames[44]="mclcpy";
889  fCandidateVariableNames[45]="mclcpz";
890  fCandidateVariableNames[46]="mcelepx";
891  fCandidateVariableNames[47]="mcelepy";
892  fCandidateVariableNames[48]="mcelepz";
893  fCandidateVariableNames[49]="mcv0px";
894  fCandidateVariableNames[50]="mcv0py";
895  fCandidateVariableNames[51]="mcv0pz";
896  fCandidateVariableNames[52]="nSigmaTPCpi_etrk";
897  fCandidateVariableNames[53]="nSigmaTOFpi_etrk";
898  fCandidateVariableNames[54]="PrimVertx";
899  fCandidateVariableNames[55]="PrimVerty";
900  fCandidateVariableNames[56]="PrimVertz";
901  fCandidateVariableNames[57]="V0Vertx";
902  fCandidateVariableNames[58]="V0Verty";
903  fCandidateVariableNames[59]="V0Vertz";
904 
905  fCandidateVariableNames[60]="DcaV0PrToPrimVertex";
906  fCandidateVariableNames[61]="DcaV0PiToPrimVertex";
907  fCandidateVariableNames[62]="DcaV0daughters";
908  fCandidateVariableNames[63]="V0CosPointingAngle";
909  fCandidateVariableNames[64]="V0ProperDecayLength";
910  fCandidateVariableNames[65]="MassK0Short2";
911 
912  fCandidateVariableNames[66]="nSigmaTPCv0pi";
913  fCandidateVariableNames[67]="nSigmaTOFv0pi";
914 
915  fCandidateVariableNames[68]="EvNumber";
916  fCandidateVariableNames[69]="RunNumber";
917 
918  for (Int_t ivar=0; ivar<nVar; ivar++) {
919  fVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
920  }
921 
922  return;
923 }
924 
926 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillROOTObjects(AliAODRecoCascadeHF *elobj, AliAODv0 *v0, AliAODTrack *trk, TClonesArray *mcArray, Bool_t mixing_flag)
927 {
931  if(!trk) return;
932  if(!v0) return;
933 
934  for(Int_t i=0;i<67;i++){
935  fCandidateVariables[i] = -9999.;
936  }
937 
938  Bool_t anti_lambda_flag = kFALSE;
939  if(fabs(v0->MassAntiLambda()-1.115683)<fAnalCuts->GetProdV0MassTolLambda()) anti_lambda_flag = kTRUE;
940 
941  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
942  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
943  if(cptrack->Charge()<0 && cntrack->Charge()>0){
944  cptrack = (AliAODTrack*)(v0->GetDaughter(1));
945  cntrack = (AliAODTrack*)(v0->GetDaughter(0));
946  }
947 
949  UInt_t pdgdg[2]={11,3122};
950  fCandidateVariables[ 1] = elobj->InvMass(2,pdgdg);
951  fCandidateVariables[ 2] = elobj->Pt();
952  fCandidateVariables[ 3] = elobj->Px();
953  fCandidateVariables[ 4] = elobj->Py();
954  fCandidateVariables[ 5] = elobj->Pz();
955  fCandidateVariables[ 6] = elobj->PxProng(0);
956  fCandidateVariables[ 7] = elobj->PyProng(0);
957  fCandidateVariables[ 8] = elobj->PzProng(0);
958  fCandidateVariables[ 9] = elobj->PxProng(1);
959  fCandidateVariables[10] = elobj->PyProng(1);
960  fCandidateVariables[11] = elobj->PzProng(1);
961  fCandidateVariables[12] = anti_lambda_flag;
962  fCandidateVariables[13] = v0->MassLambda();
963  fCandidateVariables[14] = v0->MassAntiLambda();
964  fCandidateVariables[15] = elobj->Getd0Prong(0);
965  fCandidateVariables[16] = elobj->Getd0Prong(1);
966 
967  Double_t nSigmaTPCele=-9999.;
968  Double_t nSigmaTOFele=-9999.;
969  Double_t nSigmaTPCv0pr=-9999.;
970  Double_t nSigmaTOFv0pr=-9999.;
971  Double_t nSigmaTPCv0pi=-9999.;
972  Double_t nSigmaTOFv0pi=-9999.;
973  if(fAnalCuts->GetIsUsePID()&&!mixing_flag)
974  {
975  nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
976  nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
977  fCandidateVariables[17] = nSigmaTPCele;
978  fCandidateVariables[18] = nSigmaTOFele;
979  }
980 
981  if(fAnalCuts->GetUseLambdaPID()&&!mixing_flag)
982  {
983  if(anti_lambda_flag){
984  nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
985  nSigmaTOFv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kProton);
986  nSigmaTPCv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
987  nSigmaTOFv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kPion);
988  }else{
989  nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
990  nSigmaTOFv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cptrack,AliPID::kProton);
991  nSigmaTPCv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
992  nSigmaTOFv0pi = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTOF(cntrack,AliPID::kPion);
993  }
994  fCandidateVariables[19] = nSigmaTPCv0pr;
995  fCandidateVariables[20] = nSigmaTOFv0pr;
996  fCandidateVariables[66] = nSigmaTPCv0pi;
997  fCandidateVariables[67] = nSigmaTOFv0pi;
998  }
999  fCandidateVariables[21] = trk->Charge();
1000 
1001  if(anti_lambda_flag){
1002  fCandidateVariables[22] = cntrack->Px();
1003  fCandidateVariables[23] = cntrack->Py();
1004  fCandidateVariables[24] = cntrack->Pz();
1005  fCandidateVariables[25] = cptrack->Px();
1006  fCandidateVariables[26] = cptrack->Py();
1007  fCandidateVariables[27] = cptrack->Pz();
1008  }else{
1009  fCandidateVariables[22] = cptrack->Px();
1010  fCandidateVariables[23] = cptrack->Py();
1011  fCandidateVariables[24] = cptrack->Pz();
1012  fCandidateVariables[25] = cntrack->Px();
1013  fCandidateVariables[26] = cntrack->Py();
1014  fCandidateVariables[27] = cntrack->Pz();
1015  }
1016 
1017  AliAODMCParticle *mclc = 0;
1018  AliAODMCParticle *mcele = 0;
1019  AliAODMCParticle *mcv0 = 0;
1020  Int_t mclablc = 0;
1021  Int_t mcpdgele_array[100];
1022  Int_t mcpdgv0_array[100];
1023  Int_t mclabelele_array[100];
1024  Int_t mclabelv0_array[100];
1025  Int_t mcngen_ele=-9999;
1026  Int_t mcngen_v0=-9999;
1027 
1028  if(fUseMCInfo && mcArray){
1029 
1030  mclablc = MatchToMC(elobj,mcArray,mcpdgele_array, mcpdgv0_array,mclabelele_array,mclabelv0_array,mcngen_ele,mcngen_v0);
1031 
1032  if(mclablc>-1){
1033  mclc = (AliAODMCParticle*) mcArray->At(mclablc);
1034  if(mclabelele_array[0]>=0)
1035  mcele = (AliAODMCParticle*) mcArray->At(mclabelele_array[0]);
1036  if(mclabelv0_array[0]>=0)
1037  mcv0 = (AliAODMCParticle*) mcArray->At(mclabelv0_array[0]);
1038  if(mclc){
1039  fCandidateVariables[28] = mclc->GetPdgCode();
1040  fCandidateVariables[29] = mclc->Label();
1041  fCandidateVariables[43] = mclc->Px();
1042  fCandidateVariables[44] = mclc->Py();
1043  fCandidateVariables[45] = mclc->Pz();
1044  }
1045  if(mcele){
1046  fCandidateVariables[46] = mcele->Px();
1047  fCandidateVariables[47] = mcele->Py();
1048  fCandidateVariables[48] = mcele->Pz();
1049  }
1050  if(mcv0){
1051  fCandidateVariables[49] = mcv0->Px();
1052  fCandidateVariables[50] = mcv0->Py();
1053  fCandidateVariables[51] = mcv0->Pz();
1054  }
1055  }
1056  fCandidateVariables[30] = mcpdgele_array[1];
1057  fCandidateVariables[31] = mcpdgv0_array[1];
1058  fCandidateVariables[33] = mcpdgele_array[0];
1059  fCandidateVariables[39] = mcpdgele_array[2];
1060  fCandidateVariables[40] = mcpdgv0_array[2];
1061  fCandidateVariables[41] = mcngen_ele;
1062  fCandidateVariables[42] = mcngen_v0;
1063  }
1064  fCandidateVariables[32] = mixing_flag;
1065 
1066  if(fAnalCuts->GetIsUsePID()&&!mixing_flag)
1067  {
1068  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
1069  Double_t nSigmaTOFpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kProton);
1070  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
1071  Double_t nSigmaTOFka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kKaon);
1072  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
1073  Double_t nSigmaTOFpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kPion);
1074  fCandidateVariables[34] = nSigmaTPCpr_etrk;
1075  fCandidateVariables[35] = nSigmaTOFpr_etrk;
1076  fCandidateVariables[36] = nSigmaTPCka_etrk;
1077  fCandidateVariables[37] = nSigmaTOFka_etrk;
1078  fCandidateVariables[52] = nSigmaTPCpi_etrk;
1079  fCandidateVariables[53] = nSigmaTOFpi_etrk;
1080  }
1081  fCandidateVariables[38] = v0->MassK0Short();
1082 
1083  fCandidateVariables[54] = fVtx1->GetX();
1084  fCandidateVariables[55] = fVtx1->GetY();
1085  fCandidateVariables[56] = fVtx1->GetZ();
1086  fCandidateVariables[57] = v0->DecayVertexV0X();
1087  fCandidateVariables[58] = v0->DecayVertexV0Y();
1088  fCandidateVariables[59] = v0->DecayVertexV0Z();
1089 
1090  Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
1091  Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
1092  if(!anti_lambda_flag){
1093  fCandidateVariables[60] = lDcaPosToPrimVertex;
1094  fCandidateVariables[61] = lDcaNegToPrimVertex;
1095  }else{
1096  fCandidateVariables[60] = lDcaNegToPrimVertex;
1097  fCandidateVariables[61] = lDcaPosToPrimVertex;
1098  }
1099  fCandidateVariables[62] = v0->DcaV0Daughters();
1100  Double_t posVtx[3] = {0.,0.,0.};
1101  fVtx1->GetXYZ(posVtx);
1102  fCandidateVariables[63] = v0->CosPointingAngle(posVtx);
1103  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
1104  fCandidateVariables[64] = v0->DecayLengthV0(posVtx)*1.1157/ptotlam;
1105  fCandidateVariables[65] = v0->MassK0Short();
1106 
1109 
1110 
1111  if(fWriteVariableTree)
1112  fVariablesTree->Fill();
1113 
1115  {
1116  Double_t cont[3];
1117  cont[0] = elobj->InvMass(2,pdgdg);
1118  cont[1] = elobj->Pt();
1119  cont[2] = fCentrality;
1120  fHistoEleLambdaMass->Fill(cont);
1121  Double_t cont2[3];
1122  cont2[0] = elobj->InvMass(2,pdgdg);
1123  cont2[1] = trk->Pt();
1124  cont2[2] = fCentrality;
1125  Double_t cont_eleptvseta[3];
1126  cont_eleptvseta[0] = trk->Pt();
1127  cont_eleptvseta[1] = trk->Eta();
1128  cont_eleptvseta[2] = fCentrality;
1129 
1130  Double_t cont_eleptvslambdapt[3];
1131  cont_eleptvslambdapt[0] = trk->Pt();
1132  cont_eleptvslambdapt[1] = v0->Pt();
1133  cont_eleptvslambdapt[2] = fCentrality;
1134 
1135  Double_t cont_eleptvsd0[3];
1136  cont_eleptvsd0[0] = trk->Pt();
1137  cont_eleptvsd0[1] = elobj->Getd0Prong(0)*trk->Charge();
1138  cont_eleptvsd0[2] = fCentrality;
1139 
1140 
1141  if(mixing_flag){
1142  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
1143  fHistoEleLambdaMassRSMix->Fill(cont);
1144  fHistoEleLambdaMassvsElePtRSMix->Fill(cont2);
1145  if(cont[0]<2.3){
1146  fHistoElePtRSMix->Fill(trk->Pt(),fCentrality);
1147  fHistoElePtvsEtaRSMix->Fill(cont_eleptvseta);
1148  fHistoElePtvsLambdaPtRSMix->Fill(cont_eleptvslambdapt);
1149  fHistoElePtvsd0RSMix->Fill(cont_eleptvsd0);
1150  }
1151  }else if((trk->Charge()<0 && !anti_lambda_flag) || (trk->Charge()>0 && anti_lambda_flag)){
1152  fHistoEleLambdaMassWSMix->Fill(cont);
1153  fHistoEleLambdaMassvsElePtWSMix->Fill(cont2);
1154  if(cont[0]<2.3){
1155  fHistoElePtWSMix->Fill(trk->Pt(),fCentrality);
1156  fHistoElePtvsEtaWSMix->Fill(cont_eleptvseta);
1157  fHistoElePtvsLambdaPtWSMix->Fill(cont_eleptvslambdapt);
1158  fHistoElePtvsd0WSMix->Fill(cont_eleptvsd0);
1159  }
1160  }
1161  }else{
1162  if((trk->Charge()>0 && !anti_lambda_flag) || (trk->Charge()<0 && anti_lambda_flag)){
1163  fHistoEleLambdaMassRS->Fill(cont);
1164  fHistoEleLambdaMassvsElePtRS->Fill(cont2);
1165  if(cont[0]<2.3){
1166  fHistoElePtRS->Fill(trk->Pt(),fCentrality);
1167  fHistoElePtvsEtaRS->Fill(cont_eleptvseta);
1168  fHistoElePtvsLambdaPtRS->Fill(cont_eleptvslambdapt);
1169  fHistoElePtvsd0RS->Fill(cont_eleptvsd0);
1170 
1171  for(Int_t ih=0;ih<17;ih++){
1172  Double_t cont_eleptvscutvars[3];
1173  cont_eleptvscutvars[0] = trk->Pt();
1174  cont_eleptvscutvars[2] = fCentrality;
1175 
1176  if(ih==0){
1177  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1178  }else if(ih==1){
1179  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1180  }else if(ih==2){
1181  cont_eleptvscutvars[1] = nSigmaTPCele;
1182  }else if(ih==3){
1183  cont_eleptvscutvars[1] = nSigmaTOFele;
1184  }else if(ih==4){
1185  cont_eleptvscutvars[1] = trk->Eta();
1186  }else if(ih==5){
1187  cont_eleptvscutvars[1] = trk->GetITSNcls();
1188  }else if(ih==6){
1189  if(!anti_lambda_flag)
1190  cont_eleptvscutvars[1] = v0->MassLambda();
1191  else
1192  cont_eleptvscutvars[1] = v0->MassAntiLambda();
1193  }else if(ih==7){
1194  Double_t lPosV0[3];
1195  lPosV0[0] = v0->DecayVertexV0X();
1196  lPosV0[1] = v0->DecayVertexV0Y();
1197  lPosV0[2] = v0->DecayVertexV0Z();
1198  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1199  }else if(ih==8){
1200  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
1201  }else if(ih==9){
1202  if(!anti_lambda_flag)
1203  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1204  else
1205  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1206  }else if(ih==10){
1207  if(!anti_lambda_flag)
1208  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1209  else
1210  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1211  }else if(ih==11){
1212  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
1213  }else if(ih==12){
1214  cont_eleptvscutvars[1] = v0->MassK0Short();
1215  }else if(ih==13){
1216  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1217  }else if(ih==14){
1218  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1219  }else if(ih==15){
1220  cont_eleptvscutvars[1] = v0->Eta();
1221  }else if(ih==16){
1222  Double_t v0px = elobj->PxProng(1);
1223  Double_t v0py = elobj->PyProng(1);
1224  Double_t v0pz = elobj->PzProng(1);
1225  Double_t epx = elobj->PxProng(0);
1226  Double_t epy = elobj->PyProng(0);
1227  Double_t epz = elobj->PzProng(0);
1228  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
1229  }else{
1230  cont_eleptvscutvars[1] = -9999.;
1231  }
1232 
1233  fHistoElePtvsCutVarsRS[ih]->Fill(cont_eleptvscutvars);
1234  }
1235  }
1236  }else if((trk->Charge()<0 && !anti_lambda_flag) || (trk->Charge()>0 && anti_lambda_flag)){
1237  fHistoEleLambdaMassWS->Fill(cont);
1238  fHistoEleLambdaMassvsElePtWS->Fill(cont2);
1239  if(cont[0]<2.3){
1240  fHistoElePtWS->Fill(trk->Pt(),fCentrality);
1241  fHistoElePtvsEtaWS->Fill(cont_eleptvseta);
1242  fHistoElePtvsLambdaPtWS->Fill(cont_eleptvslambdapt);
1243  fHistoElePtvsd0WS->Fill(cont_eleptvsd0);
1244 
1245  for(Int_t ih=0;ih<17;ih++){
1246  Double_t cont_eleptvscutvars[3];
1247  cont_eleptvscutvars[0] = trk->Pt();
1248  cont_eleptvscutvars[2] = fCentrality;
1249 
1250  if(ih==0){
1251  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1252  }else if(ih==1){
1253  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1254  }else if(ih==2){
1255  cont_eleptvscutvars[1] = nSigmaTPCele;
1256  }else if(ih==3){
1257  cont_eleptvscutvars[1] = nSigmaTOFele;
1258  }else if(ih==4){
1259  cont_eleptvscutvars[1] = trk->Eta();
1260  }else if(ih==5){
1261  cont_eleptvscutvars[1] = trk->GetITSNcls();
1262  }else if(ih==6){
1263  if(!anti_lambda_flag)
1264  cont_eleptvscutvars[1] = v0->MassLambda();
1265  else
1266  cont_eleptvscutvars[1] = v0->MassAntiLambda();
1267  }else if(ih==7){
1268  Double_t lPosV0[3];
1269  lPosV0[0] = v0->DecayVertexV0X();
1270  lPosV0[1] = v0->DecayVertexV0Y();
1271  lPosV0[2] = v0->DecayVertexV0Z();
1272  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1273  }else if(ih==8){
1274  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
1275  }else if(ih==9){
1276  if(!anti_lambda_flag)
1277  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1278  else
1279  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1280  }else if(ih==10){
1281  if(!anti_lambda_flag)
1282  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1283  else
1284  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1285  }else if(ih==11){
1286  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
1287  }else if(ih==12){
1288  cont_eleptvscutvars[1] = v0->MassK0Short();
1289  }else if(ih==13){
1290  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1291  }else if(ih==14){
1292  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1293  }else if(ih==15){
1294  cont_eleptvscutvars[1] = v0->Eta();
1295  }else if(ih==16){
1296  Double_t v0px = elobj->PxProng(1);
1297  Double_t v0py = elobj->PyProng(1);
1298  Double_t v0pz = elobj->PzProng(1);
1299  Double_t epx = elobj->PxProng(0);
1300  Double_t epy = elobj->PyProng(0);
1301  Double_t epz = elobj->PzProng(0);
1302  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
1303  }else{
1304  cont_eleptvscutvars[1] = -9999.;
1305  }
1306 
1307  fHistoElePtvsCutVarsWS[ih]->Fill(cont_eleptvscutvars);
1308  }
1309  }
1310  }
1311  }
1312 
1313  if(fUseMCInfo){
1314  if(mclc){
1315  Int_t pdgcode = mclc->GetPdgCode();
1316  if(abs(pdgcode)==4122 && abs(mcpdgele_array[1])==4122 && abs(mcpdgv0_array[1])==4122){
1317  fHistoEleLambdaMassMCS->Fill(cont);
1318  fHistoEleLambdaMassvsElePtMCS->Fill(cont2);
1319  if(cont[0]<2.3){
1320  fHistoElePtMCS->Fill(trk->Pt(),fCentrality);
1321  fHistoElePtvsEtaMCS->Fill(cont_eleptvseta);
1322  fHistoElePtvsLambdaPtMCS->Fill(cont_eleptvslambdapt);
1323  fHistoElePtvsd0MCS->Fill(cont_eleptvsd0);
1324 
1325  Double_t cont_eleptvslambdaptvslcpt[4];
1326  cont_eleptvslambdaptvslcpt[0] = cont_eleptvslambdapt[0];
1327  cont_eleptvslambdaptvslcpt[1] = cont_eleptvslambdapt[1];
1328  cont_eleptvslambdaptvslcpt[2] = mclc->Pt();
1329  cont_eleptvslambdaptvslcpt[3] = cont_eleptvslambdapt[2];
1330  fHistoElePtvsLambdaPtvsLcPtMCS->Fill(cont_eleptvslambdaptvslcpt);
1331 
1332  Int_t labmotherlc = mclc->GetMother();
1333  if(labmotherlc>=0){
1334  AliAODMCParticle *motherlc = (AliAODMCParticle*)mcArray->At(labmotherlc);
1335  Int_t pdgmotherlc = motherlc->GetPdgCode();
1336  if(TMath::Abs(pdgmotherlc)==511||TMath::Abs(pdgmotherlc)==521||TMath::Abs(pdgmotherlc)==5122||TMath::Abs(pdgmotherlc)==5132||TMath::Abs(pdgmotherlc)==5232||TMath::Abs(pdgmotherlc)==5332){
1337  fHistoElePtvsd0BFeeddownMCS->Fill(cont_eleptvsd0);
1338  }else{
1339  fHistoElePtvsd0PromptMCS->Fill(cont_eleptvsd0);
1340  }
1341  }else{
1342  fHistoElePtvsd0PromptMCS->Fill(cont_eleptvsd0);
1343  }
1344 
1345  for(Int_t ih=0;ih<17;ih++){
1346  Double_t cont_eleptvscutvars[3];
1347  cont_eleptvscutvars[0] = trk->Pt();
1348  cont_eleptvscutvars[2] = fCentrality;
1349 
1350  if(ih==0){
1351  cont_eleptvscutvars[1] = trk->GetTPCNcls();
1352  }else if(ih==1){
1353  cont_eleptvscutvars[1] = trk->GetTPCsignalN();
1354  }else if(ih==2){
1355  cont_eleptvscutvars[1] = nSigmaTPCele;
1356  }else if(ih==3){
1357  cont_eleptvscutvars[1] = nSigmaTOFele;
1358  }else if(ih==4){
1359  cont_eleptvscutvars[1] = trk->Eta();
1360  }else if(ih==5){
1361  cont_eleptvscutvars[1] = trk->GetITSNcls();
1362  }else if(ih==6){
1363  if(!anti_lambda_flag)
1364  cont_eleptvscutvars[1] = v0->MassLambda();
1365  else
1366  cont_eleptvscutvars[1] = v0->MassAntiLambda();
1367  }else if(ih==7){
1368  Double_t lPosV0[3];
1369  lPosV0[0] = v0->DecayVertexV0X();
1370  lPosV0[1] = v0->DecayVertexV0Y();
1371  lPosV0[2] = v0->DecayVertexV0Z();
1372  cont_eleptvscutvars[1] = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1373  }else if(ih==8){
1374  cont_eleptvscutvars[1] = v0->DcaV0Daughters();
1375  }else if(ih==9){
1376  if(!anti_lambda_flag)
1377  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1378  else
1379  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1380  }else if(ih==10){
1381  if(!anti_lambda_flag)
1382  cont_eleptvscutvars[1] = v0->DcaNegToPrimVertex();
1383  else
1384  cont_eleptvscutvars[1] = v0->DcaPosToPrimVertex();
1385  }else if(ih==11){
1386  cont_eleptvscutvars[1] = v0->CosPointingAngle(posVtx);
1387  }else if(ih==12){
1388  cont_eleptvscutvars[1] = v0->MassK0Short();
1389  }else if(ih==13){
1390  cont_eleptvscutvars[1] = nSigmaTPCv0pr;
1391  }else if(ih==14){
1392  cont_eleptvscutvars[1] = nSigmaTPCv0pi;
1393  }else if(ih==15){
1394  cont_eleptvscutvars[1] = v0->Eta();
1395  }else if(ih==16){
1396  Double_t v0px = elobj->PxProng(1);
1397  Double_t v0py = elobj->PyProng(1);
1398  Double_t v0pz = elobj->PzProng(1);
1399  Double_t epx = elobj->PxProng(0);
1400  Double_t epy = elobj->PyProng(0);
1401  Double_t epz = elobj->PzProng(0);
1402  cont_eleptvscutvars[1] = acos((v0px*epx+v0py*epy+v0pz*epz)/sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz)/sqrt(epx*epx+epy*epy+epz*epz));
1403  }else{
1404  cont_eleptvscutvars[1] = -9999.;
1405  }
1406 
1407  fHistoElePtvsCutVarsMCS[ih]->Fill(cont_eleptvscutvars);
1408  }
1409  }
1410  }
1411  if(abs(pdgcode)==4132 && abs(mcpdgele_array[1])==4132 && abs(mcpdgv0_array[1])==3312){
1414  if(cont[0]<2.3){
1415  fHistoElePtFeeddownXic0MCS->Fill(trk->Pt(),fCentrality);
1416  fHistoElePtvsEtaFeeddownXic0MCS->Fill(cont_eleptvseta);
1417  fHistoElePtvsLambdaPtFeeddownXic0MCS->Fill(cont_eleptvslambdapt);
1418  }
1419  }
1420  if(abs(pdgcode)==4232 && abs(mcpdgele_array[1])==4232 && abs(mcpdgv0_array[1])==3322){
1423  if(cont[0]<2.3){
1424  fHistoElePtFeeddownXicPlusMCS->Fill(trk->Pt(),fCentrality);
1425  fHistoElePtvsEtaFeeddownXicPlusMCS->Fill(cont_eleptvseta);
1426  fHistoElePtvsLambdaPtFeeddownXicPlusMCS->Fill(cont_eleptvslambdapt);
1427  }
1428  }
1429  }
1430  }
1431  }
1432 
1433  return;
1434 }
1437 {
1438  //
1440  //
1441 
1442  const char* nameoutput = GetOutputSlot(5)->GetContainer()->GetName();
1443  fEleVariablesTree = new TTree(nameoutput,"electron variables tree");
1444  Int_t nVar = 25;
1445  fCandidateEleVariables = new Float_t [nVar];
1446  TString * fCandidateVariableNames = new TString[nVar];
1447 
1448  fCandidateVariableNames[ 0]="ElePx";
1449  fCandidateVariableNames[ 1]="ElePy";
1450  fCandidateVariableNames[ 2]="ElePz";
1451  fCandidateVariableNames[ 3]="TPCChi2overNDF";
1452  fCandidateVariableNames[ 4]="ITSNcls";
1453  fCandidateVariableNames[ 5]="TPCNcls";
1454  fCandidateVariableNames[ 6]="TPCNclsPID";
1455  fCandidateVariableNames[ 7]="TPCNclsRatio";
1456  fCandidateVariableNames[ 8]="d0R";
1457  fCandidateVariableNames[ 9]="d0Z";
1458  fCandidateVariableNames[10]="ITSClusterMap";
1459  fCandidateVariableNames[11]="nSigmaTPCele";
1460  fCandidateVariableNames[12]="nSigmaTOFele";
1461  fCandidateVariableNames[13]="nSigmaTPCpi";
1462  fCandidateVariableNames[14]="nSigmaTPCka";
1463  fCandidateVariableNames[15]="nSigmaTPCpr";
1464  fCandidateVariableNames[16]="EvNumber";
1465  fCandidateVariableNames[17]="EleCharge";
1466  fCandidateVariableNames[18]="ElePdgCode";
1467  fCandidateVariableNames[19]="EleMotherPdgCode";
1468  fCandidateVariableNames[20]="mcelepx";
1469  fCandidateVariableNames[21]="mcelepy";
1470  fCandidateVariableNames[22]="mcelepz";
1471  fCandidateVariableNames[23]="Centrality";
1472  fCandidateVariableNames[24]="RunNumber";
1473 
1474  for (Int_t ivar=0; ivar<nVar; ivar++) {
1475  fEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1476  }
1477 
1478  return;
1479 }
1481 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillElectronROOTObjects(AliAODTrack *trk, TClonesArray *mcArray)
1482 {
1483  //
1485  //
1486 
1487  if(!trk) return;
1488 
1489  fHistoBachPt->Fill(trk->Pt());
1490  fHistoElectronQovPtvsPhi->Fill(trk->Phi(),(Double_t)trk->Charge()/trk->Pt());
1491 
1492  if(!fWriteEachVariableTree) return;
1493 
1494  Int_t pdgEle = -9999;
1495  Int_t pdgEleMother = -9999;
1496  Float_t mcelepx = -9999;
1497  Float_t mcelepy = -9999;
1498  Float_t mcelepz = -9999;
1499  if(fUseMCInfo)
1500  {
1501  Int_t labEle = trk->GetLabel();
1502  if(labEle<0) return;
1503  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
1504  if(!mcetrk) return;
1505  pdgEle = mcetrk->GetPdgCode();
1506  if(abs(pdgEle)!=11) return;
1507 
1508  fHistoBachPtMCS->Fill(trk->Pt());
1509 
1510  Bool_t hfe_flag = kFALSE;
1511  Int_t labemother = mcetrk->GetMother();
1512  if(labemother>=0){
1513  AliAODMCParticle *motherele = (AliAODMCParticle*)mcArray->At(labemother);
1514  pdgEleMother = motherele->GetPdgCode();
1515  if(abs(pdgEleMother)>4000&&abs(pdgEleMother)<4400){
1516  hfe_flag = kTRUE;
1517  }
1518  }
1519  if(!hfe_flag) return;
1520  mcelepx = mcetrk->Px();
1521  mcelepy = mcetrk->Py();
1522  mcelepz = mcetrk->Pz();
1523  }
1524 
1525  for(Int_t i=0;i<22;i++){
1526  fCandidateEleVariables[i] = -9999.;
1527  }
1528 
1529  fCandidateEleVariables[ 0] = trk->Px();
1530  fCandidateEleVariables[ 1] = trk->Py();
1531  fCandidateEleVariables[ 2] = trk->Pz();
1532  fCandidateEleVariables[ 3] = trk->Chi2perNDF();
1533  fCandidateEleVariables[ 4] = trk->GetITSNcls();
1534  fCandidateEleVariables[ 5] = trk->GetTPCncls();
1535  fCandidateEleVariables[ 6] = trk->GetTPCsignalN();
1536  if(trk->GetTPCNclsF()>0)
1537  fCandidateEleVariables[ 7] = (Float_t)trk->GetTPCncls()/(Float_t)trk->GetTPCNclsF();
1538 
1539  Double_t d0z0[2],covd0z0[3];
1540  trk->PropagateToDCA(fVtx1,fBzkG,kVeryBig,d0z0,covd0z0);
1541 
1542  fCandidateEleVariables[ 8] = d0z0[0];
1543  fCandidateEleVariables[ 9] = d0z0[1];
1544  Int_t itsmap = trk->GetITSClusterMap();
1545  Int_t bit1 = 1;
1546  Int_t bit2 = 2;
1547  Bool_t spdfirst = (itsmap & bit1) == bit1;
1548  Bool_t spdsecond = (itsmap & bit2) == bit2;
1549  fCandidateEleVariables[10] = ((Int_t)spdfirst) + 2 * ((Int_t)spdsecond);
1550 
1551  if(fAnalCuts->GetIsUsePID())
1552  {
1553  Double_t nSigmaTPCele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kElectron);
1554  Double_t nSigmaTOFele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(trk,AliPID::kElectron);
1555  Double_t nSigmaTPCpi_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kPion);
1556  Double_t nSigmaTPCka_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kKaon);
1557  Double_t nSigmaTPCpr_etrk = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(trk,AliPID::kProton);
1558  fCandidateEleVariables[11] = nSigmaTPCele;
1559  fCandidateEleVariables[12] = nSigmaTOFele;
1560  fCandidateEleVariables[13] = nSigmaTPCpi_etrk;
1561  fCandidateEleVariables[14] = nSigmaTPCka_etrk;
1562  fCandidateEleVariables[15] = nSigmaTPCpr_etrk;
1563  }
1565  fCandidateEleVariables[17] = trk->Charge();
1566  fCandidateEleVariables[18] = pdgEle;
1567  fCandidateEleVariables[19] = pdgEleMother;
1568  fCandidateEleVariables[20] = mcelepx;
1569  fCandidateEleVariables[21] = mcelepy;
1570  fCandidateEleVariables[22] = mcelepz;
1573 
1574  fHistod0Bach->Fill(d0z0[0]);
1575 
1576  fEleVariablesTree->Fill();
1577 }
1580 {
1581  //
1583  //
1584 
1585  const char* nameoutput = GetOutputSlot(6)->GetContainer()->GetName();
1586  fV0VariablesTree = new TTree(nameoutput,"v0 variables tree");
1587  Int_t nVar = 32;
1588  fCandidateV0Variables = new Float_t [nVar];
1589  TString * fCandidateVariableNames = new TString[nVar];
1590 
1591  fCandidateVariableNames[ 0]="V0Px";
1592  fCandidateVariableNames[ 1]="V0Py";
1593  fCandidateVariableNames[ 2]="V0Pz";
1594  fCandidateVariableNames[ 3]="MassLambda";
1595  fCandidateVariableNames[ 4]="MassAntiLambda";
1596  fCandidateVariableNames[ 5]="ProtonPx";
1597  fCandidateVariableNames[ 6]="ProtonPy";
1598  fCandidateVariableNames[ 7]="ProtonPz";
1599  fCandidateVariableNames[ 8]="PionPx";
1600  fCandidateVariableNames[ 9]="PionPy";
1601  fCandidateVariableNames[10]="PionPz";
1602  fCandidateVariableNames[11]="RfidV0";
1603  fCandidateVariableNames[12]="DcaV0PrToPrimVertex";
1604  fCandidateVariableNames[13]="DcaV0PiToPrimVertex";
1605  fCandidateVariableNames[14]="DcaV0daughters";
1606  fCandidateVariableNames[15]="V0CosPointingAngle";
1607  fCandidateVariableNames[16]="V0ProperDecayLength";
1608  fCandidateVariableNames[17]="MassK0Short";
1609  fCandidateVariableNames[18]="nSigmaTPCpr";
1610  fCandidateVariableNames[19]="nSigmaTPCpi";
1611  fCandidateVariableNames[20]="TPCNCrossV0Pr";
1612  fCandidateVariableNames[21]="TPCNCrossV0Pi";
1613  fCandidateVariableNames[22]="TPCNCrossRatioV0Pr";
1614  fCandidateVariableNames[23]="TPCNCrossRatioV0Pi";
1615  fCandidateVariableNames[24]="V0PdgCode";
1616  fCandidateVariableNames[25]="V0MotherPdgCode";
1617  fCandidateVariableNames[26]="mcv0px";
1618  fCandidateVariableNames[27]="mcv0py";
1619  fCandidateVariableNames[28]="mcv0pz";
1620  fCandidateVariableNames[29]="EvNumber";
1621  fCandidateVariableNames[30]="Centrality";
1622  fCandidateVariableNames[31]="RunNumber";
1623 
1624  for (Int_t ivar=0; ivar<nVar; ivar++) {
1625  fV0VariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateV0Variables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1626  }
1627 
1628  return;
1629 }
1630 
1632 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillV0ROOTObjects(AliAODv0 *v0, TClonesArray *mcArray)
1633 {
1634  //
1636  //
1637  if(!v0) return;
1638 
1639  if(TMath::Abs(v0->MassLambda()-1.1156)<fAnalCuts->GetProdV0MassTolLambda()){
1640  fHistoLambdaMassvsPt->Fill(v0->MassLambda(),v0->Pt());
1641  }
1642  if(TMath::Abs(v0->MassAntiLambda()-1.1156)<fAnalCuts->GetProdV0MassTolLambda()){
1643  fHistoLambdaMassvsPt->Fill(v0->MassAntiLambda(),v0->Pt());
1644  }
1645  fHistoK0sMassvsPt->Fill(v0->MassK0Short(),v0->Pt());
1646 
1647  Double_t momv0x = v0->MomV0X();
1648  Double_t momv0y = v0->MomV0Y();
1649  Double_t phi_alice = atan2(momv0y,momv0x);
1650  if(phi_alice<0.) phi_alice += 2 * M_PI;
1651  fHistoLambdaQovPtvsPhi->Fill(phi_alice,1./sqrt(momv0x*momv0x+momv0y*momv0y));
1652 
1653  Int_t v0pdgcode = -9999;
1654  Int_t v0motherpdgcode = -9999;
1655  Float_t mcv0px = -9999;
1656  Float_t mcv0py = -9999;
1657  Float_t mcv0pz = -9999;
1658  if(fUseMCInfo)
1659  {
1660  Int_t pdgdgv0[2]={2212,211};
1661  Int_t labV0 = v0->MatchToMC(3122,mcArray,2,pdgdgv0); // the V0
1662  if(labV0>=0){
1663  if(TMath::Abs(v0->MassLambda()-1.1156)<0.03){
1664  fHistoLambdaMassvsPtMCS->Fill(v0->MassLambda(),v0->Pt());
1665  }
1666  if(TMath::Abs(v0->MassAntiLambda()-1.1156)<0.03){
1667  fHistoLambdaMassvsPtMCS->Fill(v0->MassAntiLambda(),v0->Pt());
1668  }
1669  }
1670  if(labV0<0) return;
1671  AliAODMCParticle *mcv0trk = (AliAODMCParticle*)mcArray->At(labV0);
1672  if(!mcv0trk) return;
1673 
1674  Bool_t hfv0_flag = kFALSE;
1675  v0pdgcode = mcv0trk->GetPdgCode();
1676  Int_t labv0mother = mcv0trk->GetMother();
1677  if(labv0mother>=0){
1678  AliAODMCParticle *motherv0 = (AliAODMCParticle*)mcArray->At(labv0mother);
1679  if(motherv0){
1680  v0motherpdgcode = motherv0->GetPdgCode();
1681  if(abs(v0motherpdgcode)>4000&&abs(v0motherpdgcode)<4400){
1682  hfv0_flag = kTRUE;
1683  }
1684  }
1685  }
1686  if(!hfv0_flag) return;
1687  mcv0px = mcv0trk->Px();
1688  mcv0py = mcv0trk->Py();
1689  mcv0pz = mcv0trk->Pz();
1690  }
1691 
1692  if(!fWriteEachVariableTree) return;
1693 
1694  for(Int_t i=0;i<32;i++){
1695  fCandidateV0Variables[i] = -9999.;
1696  }
1697 
1698  AliAODTrack *cptrack = (AliAODTrack*)(v0->GetDaughter(0));
1699  AliAODTrack *cntrack = (AliAODTrack*)(v0->GetDaughter(1));
1700  if(!cptrack) return;
1701  if(!cntrack) return;
1702  if(cptrack->Charge()<0 && cntrack->Charge()>0){
1703  cptrack = (AliAODTrack*)(v0->GetDaughter(1));
1704  cntrack = (AliAODTrack*)(v0->GetDaughter(0));
1705  }
1706  Double_t mlamPDG = TDatabasePDG::Instance()->GetParticle(3122)->Mass();
1707 
1708  fCandidateV0Variables[ 0] = v0->Px();
1709  fCandidateV0Variables[ 1] = v0->Py();
1710  fCandidateV0Variables[ 2] = v0->Pz();
1711  fCandidateV0Variables[ 3] = v0->MassLambda();
1712  fCandidateV0Variables[ 4] = v0->MassAntiLambda();
1713 
1714  Bool_t isparticle = kTRUE;
1715  if(fabs(v0->MassAntiLambda()-mlamPDG)<fAnalCuts->GetProdV0MassTolLambda()) isparticle=kFALSE;
1716 
1717  if(isparticle){
1718  fCandidateV0Variables[ 5] = cptrack->Px();
1719  fCandidateV0Variables[ 6] = cptrack->Py();
1720  fCandidateV0Variables[ 7] = cptrack->Pz();
1721  fCandidateV0Variables[ 8] = cntrack->Px();
1722  fCandidateV0Variables[ 9] = cntrack->Py();
1723  fCandidateV0Variables[10] = cntrack->Pz();
1724  }else{
1725  fCandidateV0Variables[ 5] = cntrack->Px();
1726  fCandidateV0Variables[ 6] = cntrack->Py();
1727  fCandidateV0Variables[ 7] = cntrack->Pz();
1728  fCandidateV0Variables[ 8] = cptrack->Px();
1729  fCandidateV0Variables[ 9] = cptrack->Py();
1730  fCandidateV0Variables[10] = cptrack->Pz();
1731  }
1732 
1733  Double_t lPosV0[3];
1734  lPosV0[0] = v0->DecayVertexV0X();
1735  lPosV0[1] = v0->DecayVertexV0Y();
1736  lPosV0[2] = v0->DecayVertexV0Z();
1737  Double_t decayvertV0 = TMath::Sqrt(lPosV0[0]*lPosV0[0]+lPosV0[1]*lPosV0[1]);
1738  fCandidateV0Variables[11] = decayvertV0;
1739 
1740  Double_t lDcaPosToPrimVertex = v0->DcaPosToPrimVertex();
1741  Double_t lDcaNegToPrimVertex = v0->DcaNegToPrimVertex();
1742  if(isparticle){
1743  fCandidateV0Variables[12] = lDcaPosToPrimVertex;
1744  fCandidateV0Variables[13] = lDcaNegToPrimVertex;
1745  }else{
1746  fCandidateV0Variables[12] = lDcaNegToPrimVertex;
1747  fCandidateV0Variables[13] = lDcaPosToPrimVertex;
1748  }
1749  fCandidateV0Variables[14] = v0->DcaV0Daughters();
1750  Double_t posVtx[3] = {0.,0.,0.};
1751  fVtx1->GetXYZ(posVtx);
1752  fCandidateV0Variables[15] = v0->CosPointingAngle(posVtx);
1753  Double_t ptotlam = TMath::Sqrt(pow(v0->Px(),2)+pow(v0->Py(),2)+pow(v0->Pz(),2));
1754  fCandidateV0Variables[16] = v0->DecayLengthV0(posVtx)*mlamPDG/ptotlam;
1755  fCandidateV0Variables[17] = v0->MassK0Short();
1756 
1757  if(fAnalCuts->GetUseLambdaPID())
1758  {
1759  if(isparticle){
1760  Double_t nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kProton);
1761  Double_t nSigmaTPCv0pi = fAnalCuts->GetPidPion()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kPion);
1762  fCandidateV0Variables[18] = nSigmaTPCv0pr;
1763  fCandidateV0Variables[19] = nSigmaTPCv0pi;
1764  }else{
1765  Double_t nSigmaTPCv0pr = fAnalCuts->GetPidProton()->GetPidResponse()->NumberOfSigmasTPC(cntrack,AliPID::kProton);
1766  Double_t nSigmaTPCv0pi = fAnalCuts->GetPidPion()->GetPidResponse()->NumberOfSigmasTPC(cptrack,AliPID::kPion);
1767  fCandidateV0Variables[18] = nSigmaTPCv0pr;
1768  fCandidateV0Variables[19] = nSigmaTPCv0pi;
1769  }
1770  }
1771  if(isparticle){
1772  fCandidateV0Variables[20] = cptrack->GetTPCClusterInfo(2,1);
1773  fCandidateV0Variables[21] = cntrack->GetTPCClusterInfo(2,1);
1774  if(cptrack->GetTPCNclsF()>0)
1775  fCandidateV0Variables[22] = (Float_t) cptrack->GetTPCClusterInfo(2,1)/(Float_t)cptrack->GetTPCNclsF();
1776  if(cntrack->GetTPCNclsF()>0)
1777  fCandidateV0Variables[23] =(Float_t) cntrack->GetTPCClusterInfo(2,1)/(Float_t)cntrack->GetTPCNclsF();
1778  }else{
1779  fCandidateV0Variables[20] = cntrack->GetTPCClusterInfo(2,1);
1780  fCandidateV0Variables[21] = cptrack->GetTPCClusterInfo(2,1);
1781  if(cntrack->GetTPCNclsF()>0)
1782  fCandidateV0Variables[22] = (Float_t) cntrack->GetTPCClusterInfo(2,1)/(Float_t)cntrack->GetTPCNclsF();
1783  if(cptrack->GetTPCNclsF()>0)
1784  fCandidateV0Variables[23] = (Float_t) cptrack->GetTPCClusterInfo(2,1)/(Float_t)cptrack->GetTPCNclsF();
1785  }
1786  fCandidateV0Variables[24] = v0pdgcode;
1787  fCandidateV0Variables[25] = v0motherpdgcode;
1788  fCandidateV0Variables[26] = mcv0px;
1789  fCandidateV0Variables[27] = mcv0py;
1790  fCandidateV0Variables[28] = mcv0pz;
1794 
1795 
1796  fV0VariablesTree->Fill();
1797 }
1800 {
1804 
1805  const char* nameoutput = GetOutputSlot(7)->GetContainer()->GetName();
1806  fMCVariablesTree = new TTree(nameoutput,"MC variables tree");
1807  Int_t nVar = 11;
1808  fCandidateMCVariables = new Float_t [nVar];
1809  TString * fCandidateVariableNames = new TString[nVar];
1810 
1811  fCandidateVariableNames[ 0]="Centrality";
1812  fCandidateVariableNames[ 1]="DecayType";
1813  fCandidateVariableNames[ 2]="LcPx";
1814  fCandidateVariableNames[ 3]="LcPy";
1815  fCandidateVariableNames[ 4]="LcPz";
1816  fCandidateVariableNames[ 5]="ElePx";
1817  fCandidateVariableNames[ 6]="ElePy";
1818  fCandidateVariableNames[ 7]="ElePz";
1819  fCandidateVariableNames[ 8]="V0Px";
1820  fCandidateVariableNames[ 9]="V0Py";
1821  fCandidateVariableNames[10]="V0Pz";
1822 
1823  for (Int_t ivar=0; ivar<nVar; ivar++) {
1824  fMCVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1825  }
1826  return;
1827 }
1829 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCROOTObjects(AliAODMCParticle *mcpart, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype)
1830 {
1831  //
1833  //
1834  if(!mcpart) return;
1835  if(!mcepart) return;
1836  if(!mcv0part) return;
1837 
1838  for(Int_t i=0;i<11;i++){
1839  fCandidateMCVariables[i] = -9999.;
1840  }
1841 
1843  fCandidateMCVariables[ 1] = (Float_t) decaytype;
1844  fCandidateMCVariables[ 2] = mcpart->Px();
1845  fCandidateMCVariables[ 3] = mcpart->Py();
1846  fCandidateMCVariables[ 4] = mcpart->Pz();
1847  fCandidateMCVariables[ 5] = mcepart->Px();
1848  fCandidateMCVariables[ 6] = mcepart->Py();
1849  fCandidateMCVariables[ 7] = mcepart->Pz();
1850  fCandidateMCVariables[ 8] = mcv0part->Px();
1851  fCandidateMCVariables[ 9] = mcv0part->Py();
1852  fCandidateMCVariables[10] = mcv0part->Pz();
1853 
1854  Double_t epx = mcepart->Px();
1855  Double_t epy = mcepart->Py();
1856  Double_t epz = mcepart->Pz();
1857  Double_t eE = sqrt(epx*epx+epy*epy+epz*epz+0.000511*0.000511);
1858  Double_t v0px = mcv0part->Px();
1859  Double_t v0py = mcv0part->Py();
1860  Double_t v0pz = mcv0part->Pz();
1861  Double_t v0E = sqrt(v0px*v0px+v0py*v0py+v0pz*v0pz+1.1157*1.1157);
1862 
1863  Double_t InvMassEleLambda = sqrt(pow(eE+v0E,2)-pow(epx+v0px,2)-pow(epy+v0py,2)-pow(epz+v0pz,2));
1864 
1865  Double_t cont[3];
1866  cont[0] = InvMassEleLambda;
1867  cont[1] = mcpart->Pt();
1868  cont[2] = fCentrality;
1869  Double_t cont2[3];
1870  cont2[0] = InvMassEleLambda;
1871  cont2[1] = mcepart->Pt();
1872  cont2[2] = fCentrality;
1873  Double_t cont_eleptvseta[3];
1874  cont_eleptvseta[0] = mcepart->Pt();
1875  cont_eleptvseta[1] = mcepart->Eta();
1876  cont_eleptvseta[2] = fCentrality;
1877  Double_t cont_eleptvslambdapt[3];
1878  cont_eleptvslambdapt[0] = mcepart->Pt();
1879  cont_eleptvslambdapt[1] = mcv0part->Pt();
1880  cont_eleptvslambdapt[2] = fCentrality;
1881  Double_t cont_eleptvslambdaptvslcpt[4];
1882  cont_eleptvslambdaptvslcpt[0] = mcepart->Pt();
1883  cont_eleptvslambdaptvslcpt[1] = mcv0part->Pt();
1884  cont_eleptvslambdaptvslcpt[2] = mcpart->Pt();
1885  cont_eleptvslambdaptvslcpt[3] = fCentrality;
1886  Double_t contmc[3];
1887  contmc[0] = mcpart->Pt();
1888  contmc[1] = mcpart->Y();
1889  contmc[2] = fCentrality;
1890  Double_t contmcele[3];
1891  contmcele[0] = mcepart->Pt();
1892  contmcele[1] = mcepart->Eta();
1893  contmcele[2] = fCentrality;
1894 
1895  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
1896  Float_t etamin, etamax;
1897  esdcuts->GetEtaRange(etamin,etamax);
1898 
1899  if(decaytype==0){
1900  fHistoLcMCGen->Fill(contmc);
1901  fHistoLcElectronMCGen->Fill(contmcele);
1902  fHistoEleLambdaMassMCGen->Fill(cont);
1903  if(fabs(mcepart->Eta())<etamax){
1904  fHistoEleLambdaMassvsElePtMCGen->Fill(cont2);
1905  if(InvMassEleLambda<2.3){
1906  fHistoElePtMCGen->Fill(mcepart->Pt(),fCentrality);
1907  fHistoElePtvsEtaMCGen->Fill(cont_eleptvseta);
1908  fHistoElePtvsLambdaPtMCGen->Fill(cont_eleptvslambdapt);
1909  }
1910  }
1911  if(fabs(mcpart->Y())<0.7){
1912  if(InvMassEleLambda<2.3){
1913  fHistoElePtvsLambdaPtMCLcGen->Fill(cont_eleptvslambdapt);
1914  fHistoElePtvsLambdaPtvsLcPtMCGen->Fill(cont_eleptvslambdaptvslcpt);
1915  }
1916  }
1917  }else if(decaytype==1){
1918  fHistoFeedDownXic0MCGen->Fill(contmc);
1920  fHistoElectronFeedDownXic0MCGen->Fill(contmcele);
1921  if(fabs(mcepart->Eta())<etamax){
1923  if(InvMassEleLambda<2.3){
1924  fHistoElePtFeeddownXic0MCGen->Fill(mcepart->Pt(),fCentrality);
1925  fHistoElePtvsEtaFeeddownXic0MCGen->Fill(cont_eleptvseta);
1926  fHistoElePtvsLambdaPtFeeddownXic0MCGen->Fill(cont_eleptvslambdapt);
1927  }
1928  }
1929  }else if(decaytype==2){
1930  fHistoFeedDownXicPlusMCGen->Fill(contmc);
1932  fHistoElectronFeedDownXicPlusMCGen->Fill(contmcele);
1933  if(fabs(mcepart->Eta())<etamax){
1935  if(InvMassEleLambda<2.3){
1936  fHistoElePtFeeddownXicPlusMCGen->Fill(mcepart->Pt(),fCentrality);
1937  fHistoElePtvsEtaFeeddownXicPlusMCGen->Fill(cont_eleptvseta);
1938  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen->Fill(cont_eleptvslambdapt);
1939  }
1940  }
1941  }
1942 
1944  fMCVariablesTree->Fill();
1945 }
1948 {
1949  //
1950  // Define electron tree variables
1951  //
1952 
1953  const char* nameoutput = GetOutputSlot(9)->GetContainer()->GetName();
1954  fMCEleVariablesTree = new TTree(nameoutput,"MC Ele variables tree");
1955  Int_t nVar = 8;
1956  fCandidateMCEleVariables = new Float_t [nVar];
1957  TString * fCandidateVariableNames = new TString[nVar];
1958 
1959  fCandidateVariableNames[ 0]="Centrality";
1960  fCandidateVariableNames[ 1]="ElePx";
1961  fCandidateVariableNames[ 2]="ElePy";
1962  fCandidateVariableNames[ 3]="ElePz";
1963  fCandidateVariableNames[ 4]="ElePdgCode";
1964  fCandidateVariableNames[ 5]="EleMotherPdgCode";
1965  fCandidateVariableNames[ 6]="RunNumber";
1966  fCandidateVariableNames[ 7]="EvNumber";
1967 
1968  for (Int_t ivar=0; ivar<nVar; ivar++) {
1969  fMCEleVariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCEleVariables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
1970  }
1971  return;
1972 }
1974 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
1975 {
1976  //
1977  // Fill tree depending on fWriteMCVariableTree
1978  //
1979  if(!mcepart) return;
1980 
1981  Bool_t hfe_flag = kFALSE;
1982  Int_t labemother = mcepart->GetMother();
1983  Int_t pdgmotherele = -9999;
1984  if(labemother>=0){
1985  AliAODMCParticle *motherele = (AliAODMCParticle*)mcArray->At(labemother);
1986  pdgmotherele = motherele->GetPdgCode();
1987  if(abs(pdgmotherele)>4000&&abs(pdgmotherele)<4400){
1988  hfe_flag = kTRUE;
1989  }
1990  }
1991  if(!hfe_flag) return;
1992 
1993  Double_t contmc[3];
1994  contmc[0] = mcepart->Pt();
1995  contmc[1] = mcepart->Eta();
1996  contmc[2] = fCentrality;
1997  fHistoElectronMCGen->Fill(contmc);
1998 
1999  for(Int_t i=0;i<8;i++){
2000  fCandidateMCEleVariables[i] = -9999.;
2001  }
2002 
2004  fCandidateMCEleVariables[ 1] = mcepart->Px();
2005  fCandidateMCEleVariables[ 2] = mcepart->Py();
2006  fCandidateMCEleVariables[ 3] = mcepart->Pz();
2007  fCandidateMCEleVariables[ 4] = mcepart->GetPdgCode();
2008  fCandidateMCEleVariables[ 5] = pdgmotherele;
2011 
2012 // if(fWriteMCVariableTree && fWriteEachVariableTree && mcepart->Pt()>0.4 && fabs(mcepart->Eta())<1.0 )
2013 // fMCEleVariablesTree->Fill();
2014 
2015 }
2018 {
2019  //
2020  // Define Mc v0 tree variables
2021  //
2022 
2023  const char* nameoutput = GetOutputSlot(10)->GetContainer()->GetName();
2024  fMCV0VariablesTree = new TTree(nameoutput,"MC v0 variables tree");
2025  Int_t nVar = 8;
2026  fCandidateMCV0Variables = new Float_t [nVar];
2027  TString * fCandidateVariableNames = new TString[nVar];
2028 
2029  fCandidateVariableNames[ 0]="Centrality";
2030  fCandidateVariableNames[ 1]="V0Px";
2031  fCandidateVariableNames[ 2]="V0Py";
2032  fCandidateVariableNames[ 3]="V0Pz";
2033  fCandidateVariableNames[ 4]="V0PdgCode";
2034  fCandidateVariableNames[ 5]="V0MotherPdgCode";
2035  fCandidateVariableNames[ 6]="RunNumber";
2036  fCandidateVariableNames[ 7]="EvNumber";
2037 
2038  for (Int_t ivar=0; ivar<nVar; ivar++) {
2039  fMCV0VariablesTree->Branch(fCandidateVariableNames[ivar].Data(),&fCandidateMCV0Variables[ivar],Form("%s/f",fCandidateVariableNames[ivar].Data()));
2040  }
2041  return;
2042 }
2044 void AliAnalysisTaskSELc2eleLambdafromAODtracks::FillMCV0ROOTObjects(AliAODMCParticle *mcv0part, TClonesArray *mcArray)
2045 {
2046  //
2047  // Fill histograms or tree depending on fWriteMCVariableTree
2048  //
2049  if(!mcv0part) return;
2050 
2051  for(Int_t i=0;i<8;i++){
2052  fCandidateMCV0Variables[i] = -9999.;
2053  }
2054 
2055  Bool_t hfv0_flag = kFALSE;
2056  Int_t labv0mother = mcv0part->GetMother();
2057  Int_t pdgmotherv0 = -9999;
2058  if(labv0mother>=0){
2059  AliAODMCParticle *motherv0 = (AliAODMCParticle*)mcArray->At(labv0mother);
2060  if(motherv0){
2061  pdgmotherv0 = motherv0->GetPdgCode();
2062  if(abs(pdgmotherv0)>4000&&abs(pdgmotherv0)<4400){
2063  hfv0_flag = kTRUE;
2064  }
2065  }
2066  }
2067  if(!hfv0_flag) return;
2068 
2069  Double_t contmc[3];
2070  contmc[0] = mcv0part->Pt();
2071  contmc[1] = mcv0part->Eta();
2072  contmc[2] = fCentrality;
2073  fHistoLambdaMCGen->Fill(contmc);
2074 
2076  fCandidateMCV0Variables[ 1] = mcv0part->Px();
2077  fCandidateMCV0Variables[ 2] = mcv0part->Py();
2078  fCandidateMCV0Variables[ 3] = mcv0part->Pz();
2079  fCandidateMCV0Variables[ 4] = mcv0part->GetPdgCode();
2080  fCandidateMCV0Variables[ 5] = pdgmotherv0;
2083 
2084  if(fWriteMCVariableTree && fWriteEachVariableTree && mcv0part->Pt()>0.4 && fabs(mcv0part->Eta())<1.0 )
2085  fMCV0VariablesTree->Fill();
2086 }
2087 
2088 
2091  //
2093  //
2094 
2095  fCEvents = new TH1F("fCEvents","conter",18,-0.5,17.5);
2096  fCEvents->SetStats(kTRUE);
2097  fCEvents->GetXaxis()->SetBinLabel(1,"X1");
2098  fCEvents->GetXaxis()->SetBinLabel(2,"Analyzed events");
2099  fCEvents->GetXaxis()->SetBinLabel(3,"AliAODVertex exists");
2100  fCEvents->GetXaxis()->SetBinLabel(4,"TriggerOK");
2101  fCEvents->GetXaxis()->SetBinLabel(5,"IsEventSelected");
2102  fCEvents->GetXaxis()->SetBinLabel(6,"CascadesHF exists");
2103  fCEvents->GetXaxis()->SetBinLabel(7,"MCarray exists");
2104  fCEvents->GetXaxis()->SetBinLabel(8,"MCheader exists");
2105  fCEvents->GetXaxis()->SetBinLabel(9,"triggerClass!=CINT1");
2106  fCEvents->GetXaxis()->SetBinLabel(10,"triggerMask!=kAnyINT");
2107  fCEvents->GetXaxis()->SetBinLabel(11,"triggerMask!=kAny");
2108  fCEvents->GetXaxis()->SetBinLabel(12,"vtxTitle.Contains(Z)");
2109  fCEvents->GetXaxis()->SetBinLabel(13,"vtxTitle.Contains(3D)");
2110  fCEvents->GetXaxis()->SetBinLabel(14,"vtxTitle.Doesn'tContain(Z-3D)");
2111  fCEvents->GetXaxis()->SetBinLabel(15,Form("zVtx<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
2112  fCEvents->GetXaxis()->SetBinLabel(16,"!IsEventSelected");
2113  fCEvents->GetXaxis()->SetBinLabel(17,"triggerMask!=kAnyINT || triggerClass!=CINT1");
2114  fCEvents->GetXaxis()->SetBinLabel(18,Form("zVtxMC<=%2.0fcm",fAnalCuts->GetMaxVtxZ()));
2115  //fCEvents->GetXaxis()->SetTitle("");
2116  fCEvents->GetYaxis()->SetTitle("counts");
2117 
2118  fHTrigger = new TH1F("fHTrigger","counter",18,-0.5,17.5);
2119  fHTrigger->SetStats(kTRUE);
2120  fHTrigger->GetXaxis()->SetBinLabel(1,"X1");
2121  fHTrigger->GetXaxis()->SetBinLabel(2,"kMB");
2122  fHTrigger->GetXaxis()->SetBinLabel(3,"kSemiCentral");
2123  fHTrigger->GetXaxis()->SetBinLabel(4,"kCentral");
2124  fHTrigger->GetXaxis()->SetBinLabel(5,"kINT7");
2125  fHTrigger->GetXaxis()->SetBinLabel(6,"kEMC7");
2126  //fHTrigger->GetXaxis()->SetBinLabel(7,"Space");
2127  fHTrigger->GetXaxis()->SetBinLabel(8,"kMB|kSemiCentral|kCentral");
2128  fHTrigger->GetXaxis()->SetBinLabel(9,"kINT7|kEMC7");
2129  fHTrigger->GetXaxis()->SetBinLabel(11,"kMB&kSemiCentral");
2130  fHTrigger->GetXaxis()->SetBinLabel(12,"kMB&kCentral");
2131  fHTrigger->GetXaxis()->SetBinLabel(13,"kINT7&kEMC7");
2132 
2133  fHCentrality = new TH1F("fHCentrality","conter",100,0.,100.);
2134 
2135 
2136  fOutput->Add(fCEvents);
2137  fOutput->Add(fHTrigger);
2138  fOutput->Add(fHCentrality);
2139 
2140  return;
2141 }
2142 //__________________________________________________________________________
2144 {
2145  //
2147  //
2148 
2149  //------------------------------------------------
2150  // Basic histogram
2151  //------------------------------------------------
2152  Int_t bins_base[3]= {16,100 ,10};
2153  Double_t xmin_base[3]={1.1,0 ,0.00};
2154  Double_t xmax_base[3]={3.1,10. ,100};
2155  fHistoEleLambdaMass = new THnSparseF("fHistoEleLambdaMass","",3,bins_base,xmin_base,xmax_base);
2157  fHistoEleLambdaMassRS = new THnSparseF("fHistoEleLambdaMassRS","",3,bins_base,xmin_base,xmax_base);
2159  fHistoEleLambdaMassWS = new THnSparseF("fHistoEleLambdaMassWS","",3,bins_base,xmin_base,xmax_base);
2161  fHistoEleLambdaMassRSMix = new THnSparseF("fHistoEleLambdaMassRSMix","",3,bins_base,xmin_base,xmax_base);
2163  fHistoEleLambdaMassWSMix = new THnSparseF("fHistoEleLambdaMassWSMix","",3,bins_base,xmin_base,xmax_base);
2165  fHistoEleLambdaMassvsElePtRS = new THnSparseF("fHistoEleLambdaMassvsElePtRS","",3,bins_base,xmin_base,xmax_base);
2167  fHistoEleLambdaMassvsElePtWS = new THnSparseF("fHistoEleLambdaMassvsElePtWS","",3,bins_base,xmin_base,xmax_base);
2169  fHistoEleLambdaMassvsElePtRSMix = new THnSparseF("fHistoEleLambdaMassvsElePtRSMix","",3,bins_base,xmin_base,xmax_base);
2171  fHistoEleLambdaMassvsElePtWSMix = new THnSparseF("fHistoEleLambdaMassvsElePtWSMix","",3,bins_base,xmin_base,xmax_base);
2173  fHistoEleLambdaMassMCS = new THnSparseF("fHistoEleLambdaMassMCS","",3,bins_base,xmin_base,xmax_base);
2175  fHistoEleLambdaMassMCGen = new THnSparseF("fHistoEleLambdaMassMCGen","",3,bins_base,xmin_base,xmax_base);
2177  fHistoEleLambdaMassvsElePtMCS = new THnSparseF("fHistoEleLambdaMassvsElePtMCS","",3,bins_base,xmin_base,xmax_base);
2179  fHistoEleLambdaMassvsElePtMCGen = new THnSparseF("fHistoEleLambdaMassvsElePtMCGen","",3,bins_base,xmin_base,xmax_base);
2181 
2182  fHistoElePtRS = new TH2F("fHistoElePtRS","",100,0,10,10,0,100);
2183  fOutputAll->Add(fHistoElePtRS);
2184  fHistoElePtWS = new TH2F("fHistoElePtWS","",100,0.,10.,10,0,100);
2185  fOutputAll->Add(fHistoElePtWS);
2186  fHistoElePtRSMix = new TH2F("fHistoElePtRSMix","",100,0.,10.,10,0,100);
2188  fHistoElePtWSMix = new TH2F("fHistoElePtWSMix","",100,0.,10.,10,0,100);
2190  fHistoElePtMCS = new TH2F("fHistoElePtMCS","",100,0,10,10,0,100);
2191  fOutputAll->Add(fHistoElePtMCS);
2192  fHistoElePtMCGen = new TH2F("fHistoElePtMCGen","",100,0,10,10,0,100);
2194 
2195  Int_t bins_eleptvseta[3]= {50,20 ,10};
2196  Double_t xmin_eleptvseta[3]={0.,-1. ,0.0};
2197  Double_t xmax_eleptvseta[3]={5.,1. ,100};
2198 
2199  fHistoElePtvsEtaRS = new THnSparseF("fHistoElePtvsEtaRS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2201  fHistoElePtvsEtaWS = new THnSparseF("fHistoElePtvsEtaWS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2203  fHistoElePtvsEtaRSMix = new THnSparseF("fHistoElePtvsEtaRSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2205  fHistoElePtvsEtaWSMix = new THnSparseF("fHistoElePtvsEtaWSMix","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2207  fHistoElePtvsEtaMCS = new THnSparseF("fHistoElePtvsEtaMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2209  fHistoElePtvsEtaMCGen = new THnSparseF("fHistoElePtvsEtaMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2211 
2212  Int_t bins_eleptvslambdapt[3]= {50,20 ,10};
2213  Double_t xmin_eleptvslambdapt[3]={0.,0. ,0.0};
2214  Double_t xmax_eleptvslambdapt[3]={5.,5. ,100};
2215 
2216  fHistoElePtvsLambdaPtRS = new THnSparseF("fHistoElePtvsLambdaPtRS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2218  fHistoElePtvsLambdaPtWS = new THnSparseF("fHistoElePtvsLambdaPtWS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2220  fHistoElePtvsLambdaPtRSMix = new THnSparseF("fHistoElePtvsLambdaPtRSMix","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2222  fHistoElePtvsLambdaPtWSMix = new THnSparseF("fHistoElePtvsLambdaPtWSMix","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2224  fHistoElePtvsLambdaPtMCS = new THnSparseF("fHistoElePtvsLambdaPtMCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2226  fHistoElePtvsLambdaPtMCGen = new THnSparseF("fHistoElePtvsLambdaPtMCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2228  fHistoElePtvsLambdaPtMCLcGen = new THnSparseF("fHistoElePtvsLambdaPtMCLcGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2230 
2231  Int_t bins_eleptvslambdaptvslcpt[4]= {50,20,10,10};
2232  Double_t xmin_eleptvslambdaptvslcpt[4]={0.,0.,0.,0.0};
2233  Double_t xmax_eleptvslambdaptvslcpt[4]={5.,5.,10.,100};
2234  fHistoElePtvsLambdaPtvsLcPtMCS = new THnSparseF("fHistoElePtvsLambdaPtvsLcPtMCS","",4,bins_eleptvslambdaptvslcpt,xmin_eleptvslambdaptvslcpt,xmax_eleptvslambdaptvslcpt);
2236  fHistoElePtvsLambdaPtvsLcPtMCGen = new THnSparseF("fHistoElePtvsLambdaPtvsLcPtMCGen","",4,bins_eleptvslambdaptvslcpt,xmin_eleptvslambdaptvslcpt,xmax_eleptvslambdaptvslcpt);
2238 
2239  Int_t bins_eleptvsd0[3]= {50 ,50 ,10};
2240  Double_t xmin_eleptvsd0[3]={0.,-0.2 ,0.0};
2241  Double_t xmax_eleptvsd0[3]={5.,0.2 ,100};
2242 
2243  fHistoElePtvsd0RS = new THnSparseF("fHistoElePtvsd0RS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2245  fHistoElePtvsd0WS = new THnSparseF("fHistoElePtvsd0WS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2247  fHistoElePtvsd0RSMix = new THnSparseF("fHistoElePtvsd0RSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2249  fHistoElePtvsd0WSMix = new THnSparseF("fHistoElePtvsd0WSMix","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2251  fHistoElePtvsd0MCS = new THnSparseF("fHistoElePtvsd0MCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2253  fHistoElePtvsd0PromptMCS = new THnSparseF("fHistoElePtvsd0PromptMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2255  fHistoElePtvsd0BFeeddownMCS = new THnSparseF("fHistoElePtvsd0BFeeddownMCS","",3,bins_eleptvsd0,xmin_eleptvsd0,xmax_eleptvsd0);
2257 
2258 
2259  //Feeddown from Xic0
2260  fHistoEleLambdaMassFeeddownXic0MCS = new THnSparseF("fHistoEleLambdaMassFeeddownXic0MCS","",3,bins_base,xmin_base,xmax_base);
2262  fHistoEleLambdaMassFeeddownXic0MCGen = new THnSparseF("fHistoEleLambdaMassFeeddownXic0MCGen","",3,bins_base,xmin_base,xmax_base);
2264  fHistoEleLambdaMassvsElePtFeeddownXic0MCS = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCS","",3,bins_base,xmin_base,xmax_base);
2266  fHistoEleLambdaMassvsElePtFeeddownXic0MCGen = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXic0MCGen","",3,bins_base,xmin_base,xmax_base);
2268  fHistoElePtFeeddownXic0MCS = new TH2F("fHistoElePtFeeddownXic0MCS","",100,0,10,10,0,100);
2270  fHistoElePtFeeddownXic0MCGen = new TH2F("fHistoElePtFeeddownXic0MCGen","",100,0,10,10,0,100);
2272  fHistoElePtvsEtaFeeddownXic0MCS = new THnSparseF("fHistoElePtvsEtaFeeddownXic0MCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2274  fHistoElePtvsEtaFeeddownXic0MCGen = new THnSparseF("fHistoElePtvsEtaFeeddownXic0MCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2276  fHistoElePtvsLambdaPtFeeddownXic0MCS = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXic0MCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2278  fHistoElePtvsLambdaPtFeeddownXic0MCGen = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXic0MCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2280 
2281  //Feeddown from XicPlus
2282  fHistoEleLambdaMassFeeddownXicPlusMCS = new THnSparseF("fHistoEleLambdaMassFeeddownXicPlusMCS","",3,bins_base,xmin_base,xmax_base);
2284  fHistoEleLambdaMassFeeddownXicPlusMCGen = new THnSparseF("fHistoEleLambdaMassFeeddownXicPlusMCGen","",3,bins_base,xmin_base,xmax_base);
2286  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS","",3,bins_base,xmin_base,xmax_base);
2288  fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen = new THnSparseF("fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen","",3,bins_base,xmin_base,xmax_base);
2290  fHistoElePtFeeddownXicPlusMCS = new TH2F("fHistoElePtFeeddownXicPlusMCS","",100,0,10,10,0,100);
2292  fHistoElePtFeeddownXicPlusMCGen = new TH2F("fHistoElePtFeeddownXicPlusMCGen","",100,0,10,10,0,100);
2294  fHistoElePtvsEtaFeeddownXicPlusMCS = new THnSparseF("fHistoElePtvsEtaFeeddownXicPlusMCS","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2296  fHistoElePtvsEtaFeeddownXicPlusMCGen = new THnSparseF("fHistoElePtvsEtaFeeddownXicPlusMCGen","",3,bins_eleptvseta,xmin_eleptvseta,xmax_eleptvseta);
2298  fHistoElePtvsLambdaPtFeeddownXicPlusMCS = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXicPlusMCS","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2300  fHistoElePtvsLambdaPtFeeddownXicPlusMCGen = new THnSparseF("fHistoElePtvsLambdaPtFeeddownXicPlusMCGen","",3,bins_eleptvslambdapt,xmin_eleptvslambdapt,xmax_eleptvslambdapt);
2302 
2303  //------------------------------------------------
2304  // checking histograms
2305  //------------------------------------------------
2306  fHistoBachPt = new TH1F("fHistoBachPt","Bachelor p_{T}",100,0.0,5.0);
2307  fOutputAll->Add(fHistoBachPt);
2308  fHistoBachPtMCS = new TH1F("fHistoBachPtMCS","Bachelor p_{T}",100,0.0,5.0);
2310  fHistoBachPtMCGen = new TH1F("fHistoBachPtMCGen","Bachelor p_{T}",100,0.0,5.0);
2312  fHistod0Bach = new TH1F("fHistod0Bach","Bachelor d_{0}",100,-0.5,0.5);
2313  fOutputAll->Add(fHistod0Bach);
2314  fHistoLambdaMassvsPt=new TH2F("fHistoLambdaMassvsPt","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
2316  fHistoLambdaMassvsPtMCS=new TH2F("fHistoLambdaMassvsPtMCS","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
2318  fHistoLambdaMassvsPtMCGen=new TH2F("fHistoLambdaMassvsPtMCGen","Lambda mass",100,1.116-0.05,1.116+0.05,20,0.,10.);
2320  fHistoK0sMassvsPt=new TH2F("fHistoK0sMassvsPt","K0s mass",100,0.497-0.05,0.497+0.05,20,0.,10.);
2322 
2323  fHistoElectronTPCPID=new TH2F("fHistoElectronTPCPID","",50,0.,5.,50,-20.,20.);
2325  fHistoElectronTOFPID=new TH2F("fHistoElectronTOFPID","",50,0.,5.,50,-20.,20.);
2327  fHistoElectronTPCSelPID=new TH2F("fHistoElectronTPCSelPID","",50,0.,5.,50,-20.,20.);
2329  fHistoElectronTOFSelPID=new TH2F("fHistoElectronTOFSelPID","",50,0.,5.,50,-20.,20.);
2331  fHistoElectronTPCPIDSelTOF=new TH2F("fHistoElectronTPCPIDSelTOF","",10,0.,5.,500,-10.,10.);
2333  fHistoElectronTPCPIDSelTOFSmallEta=new TH2F("fHistoElectronTPCPIDSelTOFSmallEta","",10,0.,5.,500,-10.,10.);
2335  fHistoElectronTPCPIDSelTOFLargeEta=new TH2F("fHistoElectronTPCPIDSelTOFLargeEta","",10,0.,5.,500,-10.,10.);
2337 
2338  for(Int_t i=0;i<8;i++){
2339  fHistoElectronTPCPIDSelTOFEtaDep[i]=new TH2F(Form("fHistoElectronTPCPIDSelTOFEtaDep[%d]",i),"",10,0.,5.,500,-10.,10.);
2341  }
2342  fHistoElectronQovPtvsPhi=new TH2F("fHistoElectronQovPtvsPhi","",70,0.,7.,50,-2.,2.);
2344  fHistoLambdaQovPtvsPhi=new TH2F("fHistoLambdaQovPtvsPhi","",70,0.,7.,50,-2.,2.);
2346 
2347  Int_t bins_lcmcgen[3]= {40 ,20 ,10};
2348  Double_t xmin_lcmcgen[3]={0.,-1.0 ,0.0};
2349  Double_t xmax_lcmcgen[3]={20.,1.0 ,100};
2350  fHistoLcMCGen = new THnSparseF("fHistoLcMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
2351  fOutputAll->Add(fHistoLcMCGen);
2352  fHistoFeedDownXic0MCGen = new THnSparseF("fHistoFeedDownXic0MCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
2354  fHistoFeedDownXicPlusMCGen = new THnSparseF("fHistoFeedDownXicPlusMCGen","",3,bins_lcmcgen,xmin_lcmcgen,xmax_lcmcgen);
2356 
2357  Int_t bins_elemcgen[3]= {60 ,20 ,10};
2358  Double_t xmin_elemcgen[3]={0.,-1.0 ,0.0};
2359  Double_t xmax_elemcgen[3]={6.,1.0 ,100};
2360  fHistoElectronMCGen = new THnSparseF("fHistoElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2362  fHistoLcElectronMCGen = new THnSparseF("fHistoLcElectronMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2364  fHistoElectronFeedDownXic0MCGen = new THnSparseF("fHistoElectronFeedDownXic0MCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2366  fHistoElectronFeedDownXicPlusMCGen = new THnSparseF("fHistoElectronFeedDownXicPlusMCGen","",3,bins_elemcgen,xmin_elemcgen,xmax_elemcgen);
2368 
2369  Int_t bins_lambdamcgen[3]= {50 ,20 ,10};
2370  Double_t xmin_lambdamcgen[3]={0.,-1.0 ,0.0};
2371  Double_t xmax_lambdamcgen[3]={10.,1.0 ,100};
2372  fHistoLambdaMCGen = new THnSparseF("fHistoLambdaMCGen","",3,bins_lambdamcgen,xmin_lambdamcgen,xmax_lambdamcgen);
2374 
2375  fHistonEvtvsRunNumber=new TH1F("fHistonEvtvsRunNumber","",20000,-0.5,19999.5);
2377  fHistonElevsRunNumber=new TH1F("fHistonElevsRunNumber","",20000,-0.5,19999.5);
2379  fHistonLambdavsRunNumber=new TH1F("fHistonLambdavsRunNumber","",20000,-0.5,19999.5);
2381 
2382  for(Int_t ih=0;ih<17;ih++){
2383  Int_t bins_eleptvscutvars[3];
2384  Double_t xmin_eleptvscutvars[3];
2385  Double_t xmax_eleptvscutvars[3];
2386 
2387  bins_eleptvscutvars[0] = 50;//electron pT bin
2388  xmin_eleptvscutvars[0] = 0.;
2389  xmax_eleptvscutvars[0] = 5.;
2390  bins_eleptvscutvars[2] = 10;//centrality bin
2391  xmin_eleptvscutvars[2] = 0.;
2392  xmax_eleptvscutvars[2] = 100.;
2393 
2394  if(ih==0 || ih==1){
2395  //0: TPC Ncluster 1: TPC ncluster PID
2396  bins_eleptvscutvars[1] = 40;
2397  xmin_eleptvscutvars[1] = 0.;
2398  xmax_eleptvscutvars[1] = 160.;
2399  }else if(ih==2 || ih==3){
2400  //2: nSigma(TPC,e) 3: nSigma(TOF,e)
2401  bins_eleptvscutvars[1] = 20;
2402  xmin_eleptvscutvars[1] = -5.;
2403  xmax_eleptvscutvars[1] = 5.;
2404  }else if(ih==4){
2405  //4: eta
2406  bins_eleptvscutvars[1] = 30;
2407  xmin_eleptvscutvars[1] = -1.5;
2408  xmax_eleptvscutvars[1] = 1.5;
2409  }else if(ih==5){
2410  //5: nITS cluster
2411  bins_eleptvscutvars[1] = 7;
2412  xmin_eleptvscutvars[1] = -0.5;
2413  xmax_eleptvscutvars[1] = 6.5;
2414  }else if(ih==6){
2415  //6: Lambda mass
2416  bins_eleptvscutvars[1] = 50;
2417  xmin_eleptvscutvars[1] = 1.1156-0.03;
2418  xmax_eleptvscutvars[1] = 1.1156+0.03;
2419  }else if(ih==7){
2420  //7: Rfid Lambda
2421  bins_eleptvscutvars[1] = 20;
2422  xmin_eleptvscutvars[1] = 0.;
2423  xmax_eleptvscutvars[1] = 5.;
2424  }else if(ih==8){
2425  //10: Dca V0
2426  bins_eleptvscutvars[1] = 20;
2427  xmin_eleptvscutvars[1] = 0.;
2428  xmax_eleptvscutvars[1] = 2.;
2429  }else if(ih==9 || ih==10 ){
2430  //9: DCA V0pr to prim 10: DCA V0pi to prim
2431  bins_eleptvscutvars[1] = 20;
2432  xmin_eleptvscutvars[1] = 0.;
2433  xmax_eleptvscutvars[1] = 0.5;
2434  }else if(ih==11){
2435  //11: CosPAv0
2436  bins_eleptvscutvars[1] = 20;
2437  xmin_eleptvscutvars[1] = 0.95;
2438  xmax_eleptvscutvars[1] = 1.0;
2439  }else if(ih==12){
2440  //12:K0s masss
2441  bins_eleptvscutvars[1] = 50;
2442  xmin_eleptvscutvars[1] = 0.497-0.03;
2443  xmax_eleptvscutvars[1] = 0.497+0.03;
2444  }else if(ih==13 || ih==14){
2445  //13: nSigmaTPC(pr), nSigma(pi)
2446  bins_eleptvscutvars[1] = 20;
2447  xmin_eleptvscutvars[1] = -5;
2448  xmax_eleptvscutvars[1] = 5;
2449  }else if(ih==15){
2450  //15: eta
2451  bins_eleptvscutvars[1] = 30;
2452  xmin_eleptvscutvars[1] = -1.5;
2453  xmax_eleptvscutvars[1] = 1.5;
2454  }else if(ih==16){
2455  //16: Opening angle
2456  bins_eleptvscutvars[1] = 20;
2457  xmin_eleptvscutvars[1] = 0.;
2458  xmax_eleptvscutvars[1] = 3.141592/2;
2459  }
2460 
2461  fHistoElePtvsCutVarsRS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsRS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
2463  fHistoElePtvsCutVarsWS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsWS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
2465  fHistoElePtvsCutVarsMCS[ih] = new THnSparseF(Form("fHistoElePtvsCutVarsMCS[%d]",ih),"",3,bins_eleptvscutvars,xmin_eleptvscutvars,xmax_eleptvscutvars);
2467  }
2468 
2469  return;
2470 }
2471 
2472 //________________________________________________________________________
2473 AliAODRecoCascadeHF* AliAnalysisTaskSELc2eleLambdafromAODtracks::MakeCascadeHF(AliAODv0 *v0, AliAODTrack *part, AliAODEvent * aod, AliAODVertex *secVert, Bool_t mixing)
2474 {
2478 
2479  if(!v0) return 0x0;
2480  if(!part) return 0x0;
2481  if(!aod) return 0x0;
2482 
2483  //------------------------------------------------
2484  // PrimaryVertex
2485  //------------------------------------------------
2486  AliAODVertex *primVertexAOD;
2487  Bool_t unsetvtx = kFALSE;
2489  primVertexAOD = CallPrimaryVertex(v0,part,aod);
2490  if(!primVertexAOD){
2491  primVertexAOD = fVtx1;
2492  }else{
2493  unsetvtx = kTRUE;
2494  }
2495  }else{
2496  primVertexAOD = fVtx1;
2497  }
2498  if(!primVertexAOD) return 0x0;
2499  Double_t posprim[3]; primVertexAOD->GetXYZ(posprim);
2500 
2501  //------------------------------------------------
2502  // DCA between tracks
2503  //------------------------------------------------
2504  AliESDtrack *esdtrack = new AliESDtrack((AliVTrack*)part);
2505 
2506  AliNeutralTrackParam *trackV0=NULL;
2507  const AliVTrack *trackVV0 = dynamic_cast<const AliVTrack*>(v0);
2508  if(trackVV0) trackV0 = new AliNeutralTrackParam(trackVV0);
2509 
2510  Double_t xdummy, ydummy;
2511  Double_t dca = esdtrack->GetDCA(trackV0,fBzkG,xdummy,ydummy);
2512 
2513 
2514  //------------------------------------------------
2515  // Propagate all tracks to the secondary vertex and calculate momentum there
2516  //------------------------------------------------
2517 
2518  Double_t d0z0bach[2],covd0z0bach[3];
2519  if(sqrt(pow(secVert->GetX(),2)+pow(secVert->GetY(),2))<1.){
2520  part->PropagateToDCA(secVert,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
2521  trackV0->PropagateToDCA(secVert,fBzkG,kVeryBig);
2522  }else{
2523  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
2524  trackV0->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig);
2525  }
2526  Double_t momv0_new[3]={-9999,-9999,-9999.};
2527  trackV0->GetPxPyPz(momv0_new);
2528 
2529  Double_t px[2],py[2],pz[2];
2530  px[0] = part->Px(); py[0] = part->Py(); pz[0] = part->Pz();
2531  px[1] = momv0_new[0]; py[1] = momv0_new[1]; pz[1] = momv0_new[2];
2532 
2533  //------------------------------------------------
2534  // d0
2535  //------------------------------------------------
2536  Double_t d0[3],d0err[3];
2537 
2538  part->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0bach,covd0z0bach);
2539  d0[0]= d0z0bach[0];
2540  d0err[0] = TMath::Sqrt(covd0z0bach[0]);
2541 
2542  Double_t d0z0v0[2],covd0z0v0[3];
2543  trackV0->PropagateToDCA(primVertexAOD,fBzkG,kVeryBig,d0z0v0,covd0z0v0);
2544  d0[1]= d0z0v0[0];
2545  d0err[1] = TMath::Sqrt(covd0z0v0[0]);
2546 
2547  //------------------------------------------------
2548  // Create AliAODRecoCascadeHF
2549  //------------------------------------------------
2550  Short_t charge = part->Charge();
2551  AliAODRecoCascadeHF *theCascade = new AliAODRecoCascadeHF(secVert,charge,px,py,pz,d0,d0err,dca);
2552  if(!theCascade)
2553  {
2554  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
2555  if(esdtrack) delete esdtrack;
2556  if(trackV0) delete trackV0;
2557  return 0x0;
2558  }
2559  theCascade->SetOwnPrimaryVtx(primVertexAOD);
2560  UShort_t id[2]={(UShort_t)part->GetID(),(UShort_t)trackV0->GetID()};
2561  theCascade->SetProngIDs(2,id);
2562 
2563  if(!mixing){
2564  //If I add daughters for mixing event, I had some error.
2565  theCascade->GetSecondaryVtx()->AddDaughter(part);
2566  theCascade->GetSecondaryVtx()->AddDaughter(v0);
2567  }
2568 
2569  if(unsetvtx) delete primVertexAOD; primVertexAOD=NULL;
2570  if(esdtrack) delete esdtrack;
2571  if(trackV0) delete trackV0;
2572 
2573  return theCascade;
2574 }
2575 
2576 //________________________________________________________________________
2577 AliAODVertex* AliAnalysisTaskSELc2eleLambdafromAODtracks::CallPrimaryVertex(AliAODv0 *v0, AliAODTrack *trk, AliAODEvent* aod)
2578 {
2579  //
2582  //
2583 
2584  TObjArray *TrackArray = new TObjArray(3);
2585 
2586  AliESDtrack *cptrk1 = new AliESDtrack((AliVTrack*)trk);
2587  TrackArray->AddAt(cptrk1,0);
2588 
2589  AliESDtrack *cascptrack = new AliESDtrack((AliVTrack*)v0->GetDaughter(0));
2590  TrackArray->AddAt(cascptrack,1);
2591  AliESDtrack *cascntrack = new AliESDtrack((AliVTrack*)v0->GetDaughter(1));
2592  TrackArray->AddAt(cascntrack,2);
2593 
2594  AliAODVertex *newvert = PrimaryVertex(TrackArray,aod);
2595 
2596  for(Int_t i=0;i<3;i++)
2597  {
2598  AliESDtrack *tesd = (AliESDtrack*)TrackArray->UncheckedAt(i);
2599  delete tesd;
2600  }
2601  TrackArray->Clear();
2602  delete TrackArray;
2603 
2604  return newvert;
2605 }
2606 
2607 //________________________________________________________________________
2608 AliAODVertex* AliAnalysisTaskSELc2eleLambdafromAODtracks::PrimaryVertex(const TObjArray *trkArray,
2609  AliVEvent *event)
2610 {
2611  //
2614  //
2615 
2616  Bool_t fRecoPrimVtxSkippingTrks = kTRUE;
2617  Bool_t fRmTrksFromPrimVtx = kFALSE;
2618 
2619  AliESDVertex *vertexESD = 0;
2620  AliAODVertex *vertexAOD = 0;
2621 
2622  //vertexESD = new AliESDVertex(*fV1);
2623 
2624 
2625  if(!fRecoPrimVtxSkippingTrks && !fRmTrksFromPrimVtx) {
2626  // primary vertex from the input event
2627 
2628  vertexESD = new AliESDVertex(*fV1);
2629 
2630  } else {
2631  // primary vertex specific to this candidate
2632 
2633  Int_t nTrks = trkArray->GetEntriesFast();
2634  AliVertexerTracks *vertexer = new AliVertexerTracks(event->GetMagneticField());
2635 
2636  if(fRecoPrimVtxSkippingTrks) {
2637  // recalculating the vertex
2638 
2639  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraint")) {
2640  Float_t diamondcovxy[3];
2641  event->GetDiamondCovXY(diamondcovxy);
2642  Double_t pos[3]={event->GetDiamondX(),event->GetDiamondY(),0.};
2643  Double_t cov[6]={diamondcovxy[0],diamondcovxy[1],diamondcovxy[2],0.,0.,10.*10.};
2644  AliESDVertex *diamond = new AliESDVertex(pos,cov,1.,1);
2645  vertexer->SetVtxStart(diamond);
2646  delete diamond; diamond=NULL;
2647  if(strstr(fV1->GetTitle(),"VertexerTracksWithConstraintOnlyFitter"))
2648  vertexer->SetOnlyFitter();
2649  }
2650  Int_t skipped[1000];
2651  Int_t nTrksToSkip=0,id;
2652  AliExternalTrackParam *t = 0;
2653  for(Int_t i=0; i<nTrks; i++) {
2654  t = (AliExternalTrackParam*)trkArray->UncheckedAt(i);
2655  id = (Int_t)t->GetID();
2656  if(id<0) continue;
2657  skipped[nTrksToSkip++] = id;
2658  }
2659  // TEMPORARY FIX
2660  // For AOD, skip also tracks without covariance matrix
2661  Double_t covtest[21];
2662  for(Int_t j=0; j<event->GetNumberOfTracks(); j++) {
2663  AliVTrack *vtrack = (AliVTrack*)event->GetTrack(j);
2664  if(!vtrack->GetCovarianceXYZPxPyPz(covtest)) {
2665  id = (Int_t)vtrack->GetID();
2666  if(id<0) continue;
2667  skipped[nTrksToSkip++] = id;
2668  }
2669  }
2670  for(Int_t ijk=nTrksToSkip; ijk<1000; ijk++) skipped[ijk]=-1;
2671  //
2672  vertexer->SetSkipTracks(nTrksToSkip,skipped);
2673  vertexESD = (AliESDVertex*)vertexer->FindPrimaryVertex(event);
2674 
2675  } else if(fRmTrksFromPrimVtx && nTrks>0) {
2676  // removing the prongs tracks
2677 
2678  TObjArray rmArray(nTrks);
2679  UShort_t *rmId = new UShort_t[nTrks];
2680  AliESDtrack *esdTrack = 0;
2681  AliESDtrack *t = 0;
2682  for(Int_t i=0; i<nTrks; i++) {
2683  t = (AliESDtrack*)trkArray->UncheckedAt(i);
2684  esdTrack = new AliESDtrack(*t);
2685  rmArray.AddLast(esdTrack);
2686  if(esdTrack->GetID()>=0) {
2687  rmId[i]=(UShort_t)esdTrack->GetID();
2688  } else {
2689  rmId[i]=9999;
2690  }
2691  }
2692  Float_t diamondxy[2]={static_cast<Float_t>(event->GetDiamondX()),static_cast<Float_t>(event->GetDiamondY())};
2693  vertexESD = vertexer->RemoveTracksFromVertex(fV1,&rmArray,rmId,diamondxy);
2694  delete [] rmId; rmId=NULL;
2695  rmArray.Delete();
2696 
2697  }
2698 
2699  delete vertexer; vertexer=NULL;
2700  if(!vertexESD) return vertexAOD;
2701  if(vertexESD->GetNContributors()<=0) {
2702  //AliDebug(2,"vertexing failed");
2703  delete vertexESD; vertexESD=NULL;
2704  return vertexAOD;
2705  }
2706 
2707 
2708  }
2709 
2710  // convert to AliAODVertex
2711  Double_t pos[3],cov[6],chi2perNDF;
2712  vertexESD->GetXYZ(pos); // position
2713  vertexESD->GetCovMatrix(cov); //covariance matrix
2714  chi2perNDF = vertexESD->GetChi2toNDF();
2715  delete vertexESD; vertexESD=NULL;
2716 
2717  vertexAOD = new AliAODVertex(pos,cov,chi2perNDF);
2718 
2719  return vertexAOD;
2720 }
2721 
2722 //________________________________________________________________________
2723 AliAODVertex* AliAnalysisTaskSELc2eleLambdafromAODtracks::ReconstructSecondaryVertex(AliAODv0 *v0, AliAODTrack *part, AliAODEvent * aod)
2724 {
2725  //
2726  // Reconstruct secondary vertex from trkArray (Copied from AliAnalysisVertexingHF)
2727  // Currently only returns Primary vertex (can we reconstruct secondary vertex from e - v0??)
2728  //
2729 
2730  AliAODVertex *primVertexAOD;
2731  Bool_t unsetvtx = kFALSE;
2733  primVertexAOD = CallPrimaryVertex(v0,part,aod);
2734  if(!primVertexAOD){
2735  primVertexAOD = fVtx1;
2736  }else{
2737  unsetvtx = kTRUE;
2738  }
2739  }else{
2740  primVertexAOD = fVtx1;
2741  }
2742  if(!primVertexAOD) return 0x0;
2743 
2744  AliESDVertex * vertexESD = new AliESDVertex(*fV1);
2745 
2746  Double_t pos[3],cov[6],chi2perNDF;
2747  vertexESD->GetXYZ(pos); // position
2748  vertexESD->GetCovMatrix(cov); //covariance matrix
2749  chi2perNDF = vertexESD->GetChi2toNDF();
2750  delete vertexESD; vertexESD=NULL;
2751 
2752  AliAODVertex *secVert = new AliAODVertex(pos,cov,chi2perNDF);
2753 
2754  return secVert;
2755 }
2756 //________________________________________________________________________
2757 Int_t AliAnalysisTaskSELc2eleLambdafromAODtracks::MatchToMC(AliAODRecoCascadeHF *elobj, TClonesArray *mcArray, Int_t *pdgarray_ele, Int_t *pdgarray_v0, Int_t *labelarray_ele, Int_t *labelarray_v0, Int_t &ngen_ele, Int_t &ngen_v0)
2758 {
2759  //
2760  // Match to MC
2761  //
2762  for(Int_t i=0;i<100;i++){
2763  pdgarray_ele[i] = -9999;
2764  labelarray_ele[i] = -9999;
2765  pdgarray_v0[i] = -9999;
2766  labelarray_v0[i] = -9999;
2767  }
2768  ngen_ele = 0;
2769  ngen_v0 = 0;
2770 
2771  AliVTrack *trk = dynamic_cast<AliVTrack*>(elobj->GetBachelor());
2772  if(!trk) return -1;
2773  Int_t labEle = trk->GetLabel();
2774  if(labEle<0) return -1;
2775  AliAODMCParticle *mcetrk = (AliAODMCParticle*)mcArray->At(labEle);
2776  if(!mcetrk) return -1;
2777  labelarray_ele[0] = labEle;
2778  pdgarray_ele[0] = mcetrk->GetPdgCode();
2779  ngen_ele ++;
2780 
2781  AliAODMCParticle *mcprimele=0;
2782  mcprimele = mcetrk;
2783  while(mcprimele->GetMother()>=0) {
2784  Int_t labprim_ele=mcprimele->GetMother();
2785  AliAODMCParticle *tmcprimele = (AliAODMCParticle*)mcArray->At(labprim_ele);
2786  if(!tmcprimele) {
2787  break;
2788  }
2789 
2790  mcprimele = tmcprimele;
2791  pdgarray_ele[ngen_ele] = mcprimele->GetPdgCode();
2792  labelarray_ele[ngen_ele] = labprim_ele;
2793  ngen_ele ++;
2794  if(ngen_ele==100) break;
2795  }
2796 
2797  AliAODv0 *theV0 = dynamic_cast<AliAODv0*>(elobj->Getv0());
2798  if(!theV0) return -1;
2799  Int_t pdgdgv0[2]={2212,211};
2800  Int_t labV0 = theV0->MatchToMC(3122,mcArray,2,pdgdgv0); // the V0
2801  if(labV0<0) return -1;
2802  AliAODMCParticle *mcv0 = (AliAODMCParticle*)mcArray->At(labV0);
2803  if(!mcv0) return -1;
2804  labelarray_v0[0] = labV0;
2805  pdgarray_v0[0] = mcv0->GetPdgCode();
2806  ngen_v0 ++;
2807 
2808  AliAODMCParticle *mcprimv0=0;
2809  mcprimv0 = mcv0;
2810  while(mcprimv0->GetMother()>=0) {
2811  Int_t labprim_v0=mcprimv0->GetMother();
2812  AliAODMCParticle *tmcprimv0 = (AliAODMCParticle*)mcArray->At(labprim_v0);
2813  if(!tmcprimv0) {
2814  break;
2815  }
2816 
2817  mcprimv0 = tmcprimv0;
2818  pdgarray_v0[ngen_v0] = mcprimv0->GetPdgCode();
2819  labelarray_v0[ngen_v0] = labprim_v0;
2820  ngen_v0 ++;
2821  if(ngen_v0==100) break;
2822  }
2823 
2824  Bool_t same_flag = kFALSE;
2825  Int_t matchedlabel=-9999;
2826  for(Int_t iemc=0;iemc<ngen_ele;iemc++){
2827  for(Int_t ivmc=0;ivmc<ngen_v0;ivmc++){
2828  if(labelarray_ele[iemc]==labelarray_v0[ivmc]){
2829  same_flag = kTRUE;
2830  matchedlabel = labelarray_ele[iemc];
2831  break;
2832  }
2833  }
2834  if(same_flag) break;
2835  }
2836 
2837  return matchedlabel;
2838 
2839 }
2840 //________________________________________________________________________
2841 void AliAnalysisTaskSELc2eleLambdafromAODtracks::SelectTrack( const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks,Bool_t *seleFlags, TClonesArray *mcArray)
2842 {
2843  //
2844  // Select good tracks using fAnalCuts (AliRDHFCuts object) and return the array of their ids
2845  //
2846 
2847  if(trkEntries==0) return;
2848 
2849  nSeleTrks=0;
2850  for(Int_t i=0; i<trkEntries; i++) {
2851  seleFlags[i] = kFALSE;
2852 
2853  AliVTrack *track;
2854  track = (AliVTrack*)event->GetTrack(i);
2855 
2856  if(track->GetID()<0) continue;
2857  Double_t covtest[21];
2858  if(!track->GetCovarianceXYZPxPyPz(covtest)) continue;
2859 
2860  AliAODTrack *aodt = (AliAODTrack*)track;
2861  Double_t nsigma_tpcele = -9999;
2862  Double_t nsigma_tofele = -9999;
2863  if(fAnalCuts->GetIsUsePID()){
2864  nsigma_tpcele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTPC(aodt,AliPID::kElectron);
2865  nsigma_tofele = fAnalCuts->GetPidHF()->GetPidResponse()->NumberOfSigmasTOF(aodt,AliPID::kElectron);
2866  }
2867 
2868  if(!fAnalCuts) continue;
2869  if(fAnalCuts->SingleTrkCutsNoPID(aodt,fVtx1)){
2870  fHistoElectronTPCPID->Fill(aodt->Pt(),nsigma_tpcele);
2871  fHistoElectronTOFPID->Fill(aodt->Pt(),nsigma_tofele);
2872  if(fabs(nsigma_tofele)<3.){
2873  fHistoElectronTPCPIDSelTOF->Fill(aodt->Pt(),nsigma_tpcele);
2874  Double_t eleeta = aodt->Eta();
2875  if(fabs(eleeta)<0.6)
2876  fHistoElectronTPCPIDSelTOFSmallEta->Fill(aodt->Pt(),nsigma_tpcele);
2877  if(fabs(eleeta)>0.6 && fabs(eleeta)<0.8)
2878  fHistoElectronTPCPIDSelTOFLargeEta->Fill(aodt->Pt(),nsigma_tpcele);
2879  if(eleeta>-0.8 && eleeta<-0.6){
2880  fHistoElectronTPCPIDSelTOFEtaDep[0]->Fill(aodt->Pt(),nsigma_tpcele);
2881  }else if(eleeta>-0.6&&eleeta<-0.4){
2882  fHistoElectronTPCPIDSelTOFEtaDep[1]->Fill(aodt->Pt(),nsigma_tpcele);
2883  }else if(eleeta>-0.4&&eleeta<-0.2){
2884  fHistoElectronTPCPIDSelTOFEtaDep[2]->Fill(aodt->Pt(),nsigma_tpcele);
2885  }else if(eleeta>-0.2&&eleeta<0.0){
2886  fHistoElectronTPCPIDSelTOFEtaDep[3]->Fill(aodt->Pt(),nsigma_tpcele);
2887  }else if(eleeta>0.0&&eleeta<0.2){
2888  fHistoElectronTPCPIDSelTOFEtaDep[4]->Fill(aodt->Pt(),nsigma_tpcele);
2889  }else if(eleeta>0.2&&eleeta<0.4){
2890  fHistoElectronTPCPIDSelTOFEtaDep[5]->Fill(aodt->Pt(),nsigma_tpcele);
2891  }else if(eleeta>0.4&&eleeta<0.6){
2892  fHistoElectronTPCPIDSelTOFEtaDep[6]->Fill(aodt->Pt(),nsigma_tpcele);
2893  }else if(eleeta>0.6&&eleeta<0.8){
2894  fHistoElectronTPCPIDSelTOFEtaDep[7]->Fill(aodt->Pt(),nsigma_tpcele);
2895  }
2896  }
2897  }
2898  if(fAnalCuts->SingleTrkCuts(aodt,fVtx1)){
2899  seleFlags[i]=kTRUE;
2900  nSeleTrks++;
2901  fHistoElectronTPCSelPID->Fill(aodt->Pt(),nsigma_tpcele);
2902  fHistoElectronTOFSelPID->Fill(aodt->Pt(),nsigma_tofele);
2903  FillElectronROOTObjects(aodt,mcArray);
2904  if(fDoEventMixing){
2905  fElectronTracks->AddLast(new AliAODTrack(*aodt));
2906  }
2907  }
2908 
2909  } // end loop on tracks
2910 }
2911 //________________________________________________________________________
2912 void AliAnalysisTaskSELc2eleLambdafromAODtracks::SelectV0( const AliVEvent *event,Int_t nV0s,Int_t &nSeleV0, Bool_t *seleV0Flags, TClonesArray *mcArray)
2913 {
2914  //
2915  // Select good V0 using fAnalCuts (AliRDHFCuts object) and return the array of their ids
2916  //
2917 
2918  nSeleV0 = 0;
2919  for(Int_t iv0=0;iv0<nV0s;iv0++)
2920  {
2921  seleV0Flags[iv0] = kFALSE;
2922  AliAODv0 *v0 = ((AliAODEvent*)event)->GetV0(iv0);
2923 
2924  if(!fAnalCuts) continue;
2925  if(fAnalCuts->SingleV0Cuts(v0,fVtx1)){
2926  seleV0Flags[iv0] = kTRUE;
2927  nSeleV0++;
2928 
2929  FillV0ROOTObjects(v0, mcArray);
2930  }
2931  }
2932 }
2933 //_________________________________________________________________
2935  //
2936  // check in which of the pools the current event falls
2937  //
2938 
2939  Int_t theBinZ=TMath::BinarySearch(fNzVtxBins,fZvtxBins,zvert);
2940  if(theBinZ<0 || theBinZ>=fNzVtxBins) return -1;
2941  Int_t theBinM=TMath::BinarySearch(fNCentBins,fCentBins,mult);
2942  if(theBinM<0 || theBinM>=fNCentBins) return -1;
2943  return fNCentBins*theBinZ+theBinM;
2944 }
2945 //_________________________________________________________________
2947  //
2948  // delete the contets of the pool
2949  //
2950  if(poolIndex<0 || poolIndex>=fNOfPools) return;
2951  delete fEventBuffer[poolIndex];
2952  fEventBuffer[poolIndex]=new TTree(Form("EventBuffer_%d",poolIndex), "Temporary buffer for event mixing");
2953 
2954  fEventBuffer[poolIndex]->Branch("zVertex", &fVtxZ);
2955  fEventBuffer[poolIndex]->Branch("centrality", &fCentrality);
2956  fEventBuffer[poolIndex]->Branch("eventInfo", "TObjString",&fEventInfo);
2957  fEventBuffer[poolIndex]->Branch("earray", "TObjArray", &fElectronTracks);
2958 
2959  return;
2960 }
2961 //_________________________________________________________________
2962 void AliAnalysisTaskSELc2eleLambdafromAODtracks::DoEventMixingWithPools(Int_t poolIndex,AliAODEvent *aodEvent, Bool_t *seleFlags)
2963 {
2964  //
2965  // perform mixed event analysis
2966  //
2967 
2968  if(poolIndex<0 || poolIndex>fNzVtxBins*fNCentBins) return;
2969  if(fEventBuffer[poolIndex]->GetEntries()<fNumberOfEventsForMixing) return;
2970 
2971  Int_t nEvents=fEventBuffer[poolIndex]->GetEntries();
2972 
2973  TObjArray* earray=0x0;
2974  Float_t zVertex,cent;
2975  TObjString* eventInfo=0x0;
2976  fEventBuffer[poolIndex]->SetBranchAddress("earray", &earray);
2977  fEventBuffer[poolIndex]->SetBranchAddress("eventInfo",&eventInfo);
2978  fEventBuffer[poolIndex]->SetBranchAddress("zVertex", &zVertex);
2979  fEventBuffer[poolIndex]->SetBranchAddress("centrality", &cent);
2980  for (Int_t i=0; i<aodEvent->GetNumberOfV0s(); i++)
2981  {
2982  if(!seleFlags[i]) continue;
2983  AliAODv0* v0 = aodEvent->GetV0(i);
2984  if(!v0)continue;
2985 
2986  for(Int_t iEv=0; iEv<fNumberOfEventsForMixing; iEv++){
2987  fEventBuffer[poolIndex]->GetEvent(iEv + nEvents - fNumberOfEventsForMixing);
2988  TObjArray* earray1=(TObjArray*)earray->Clone();
2989  //Float_t zVertex1=zVertex;
2990  //Float_t mult1=cent;
2991  Int_t nElectrons=earray1->GetEntries();
2992  //Int_t evId1,esdId1,ne1;
2993  //sscanf((eventInfo->String()).Data(),"Ev%d_esd%d_K%d",&evId1,&esdId1,&ne1);
2994 // if(ne1!=nElectrons){
2995 // printf("AliAnalysisTaskSELc2eleLambdafromAODtracks::DoMixingWithPools ERROR: read event does not match to the stored one\n");
2996 // delete earray1;
2997 // continue;
2998 // }
2999  for(Int_t iTr1=0; iTr1<nElectrons; iTr1++){
3000  AliAODTrack* trk1=(AliAODTrack*)earray1->At(iTr1);
3001  if(!trk1) continue;
3002 
3003  //if(!fAnalCuts->SelectWithRoughCuts(v0,trk1)) continue;
3004  AliAODVertex *secVert = ReconstructSecondaryVertex(v0,trk1,aodEvent);//Fake, prim vertex is just used as secondary vertex. place holder for future
3005  if(!secVert) continue;
3006 
3007  AliAODRecoCascadeHF *elobj = MakeCascadeHF(v0,trk1,aodEvent,secVert,true);
3008  if(!elobj) {
3009  continue;
3010  }
3011 
3012  TClonesArray *fake = 0;
3013  FillROOTObjects(elobj,v0,trk1,fake,true);
3014 
3015  elobj->GetSecondaryVtx()->RemoveDaughters();
3016  elobj->UnsetOwnPrimaryVtx();
3017  delete elobj;elobj=NULL;
3018  delete secVert;
3019  }//track loop
3020 
3021  delete earray1;
3022  }//event loop
3023 
3024  }//v0 loop
3025 }
3026 //_________________________________________________________________
3028 {
3029  //
3030  // Analyze AliAODmcparticle
3031  //
3032 
3033  Int_t nmcpart = mcArray->GetEntriesFast();
3034  for(Int_t i=0;i<nmcpart;i++)
3035  {
3036  AliAODMCParticle *mcpart = (AliAODMCParticle*) mcArray->At(i);
3037  if(TMath::Abs(mcpart->GetPdgCode())==4122){
3038  //cout<<"Lambdac"<<endl;
3039  Bool_t e_flag = kFALSE;
3040  Bool_t lam_flag = kFALSE;
3041  AliAODMCParticle *mcepart = 0;
3042  AliAODMCParticle *mcv0part = 0;
3043  for(Int_t idau=mcpart->GetFirstDaughter();idau<mcpart->GetLastDaughter()+1;idau++)
3044  {
3045  if(idau<0) break;
3046  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
3047  if(!mcdau) continue;
3048  if(TMath::Abs(mcdau->GetPdgCode())==11){
3049  e_flag = kTRUE;
3050  mcepart = mcdau;
3051  }
3052  if(TMath::Abs(mcdau->GetPdgCode())==3122){
3053  lam_flag = kTRUE;
3054  mcv0part = mcdau;
3055  }
3056  }
3057 
3058  Int_t decaytype = -9999;
3059  if(e_flag && lam_flag) decaytype = 0;
3060 
3061  FillMCROOTObjects(mcpart,mcepart,mcv0part,decaytype);
3062  }
3063  if(TMath::Abs(mcpart->GetPdgCode())==4132){
3064  //cout<<"Lambdac"<<endl;
3065  Bool_t e_flag = kFALSE;
3066  Bool_t xi_flag = kFALSE;
3067  Bool_t lam_flag = kFALSE;
3068  AliAODMCParticle *mcepart = 0;
3069  AliAODMCParticle *mccascpart = 0;
3070  AliAODMCParticle *mcv0part = 0;
3071  for(Int_t idau=mcpart->GetFirstDaughter();idau<mcpart->GetLastDaughter()+1;idau++)
3072  {
3073  if(idau<0) break;
3074  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
3075  if(!mcdau) continue;
3076  if(TMath::Abs(mcdau->GetPdgCode())==11){
3077  e_flag = kTRUE;
3078  mcepart = mcdau;
3079  }
3080  if(TMath::Abs(mcdau->GetPdgCode())==3312){
3081  xi_flag = kTRUE;
3082  mccascpart = mcdau;
3083  for(Int_t idauxi=mccascpart->GetFirstDaughter();idauxi<mccascpart->GetLastDaughter()+1;idauxi++)
3084  {
3085  if(idauxi<0) break;
3086  AliAODMCParticle *mcdauxi = (AliAODMCParticle*) mcArray->At(idauxi);
3087  if(!mcdauxi) continue;
3088  if(TMath::Abs(mcdauxi->GetPdgCode())==3122){
3089  lam_flag = kTRUE;
3090  mcv0part = mcdauxi;
3091  }
3092  }
3093  }
3094  }
3095  Int_t decaytype = -9999;
3096  if(e_flag && xi_flag && lam_flag) decaytype = 1;
3097 
3098  FillMCROOTObjects(mcpart,mcepart,mcv0part,decaytype);
3099  }
3100  if(TMath::Abs(mcpart->GetPdgCode())==4232){
3101  //cout<<"Lambdac"<<endl;
3102  Bool_t e_flag = kFALSE;
3103  Bool_t xi_flag = kFALSE;
3104  Bool_t lam_flag = kFALSE;
3105  AliAODMCParticle *mcepart = 0;
3106  AliAODMCParticle *mccascpart = 0;
3107  AliAODMCParticle *mcv0part = 0;
3108  for(Int_t idau=mcpart->GetFirstDaughter();idau<mcpart->GetLastDaughter()+1;idau++)
3109  {
3110  if(idau<0) break;
3111  AliAODMCParticle *mcdau = (AliAODMCParticle*) mcArray->At(idau);
3112  if(!mcdau) continue;
3113  if(TMath::Abs(mcdau->GetPdgCode())==11){
3114  e_flag = kTRUE;
3115  mcepart = mcdau;
3116  }
3117  if(TMath::Abs(mcdau->GetPdgCode())==3322){
3118  xi_flag = kTRUE;
3119  mccascpart = mcdau;
3120  for(Int_t idauxi=mccascpart->GetFirstDaughter();idauxi<mccascpart->GetLastDaughter()+1;idauxi++)
3121  {
3122  if(idauxi<0) break;
3123  AliAODMCParticle *mcdauxi = (AliAODMCParticle*) mcArray->At(idauxi);
3124  if(!mcdauxi) continue;
3125  if(TMath::Abs(mcdauxi->GetPdgCode())==3122){
3126  lam_flag = kTRUE;
3127  mcv0part = mcdauxi;
3128  }
3129  }
3130  }
3131  }
3132  Int_t decaytype = -9999;
3133  if(e_flag && xi_flag && lam_flag) decaytype = 2;
3134 
3135  FillMCROOTObjects(mcpart,mcepart,mcv0part,decaytype);
3136  }
3137 
3138  if(TMath::Abs(mcpart->GetPdgCode())==11 && mcpart->GetStatus()==1){
3139  AliESDtrackCuts *esdcuts = fAnalCuts->GetTrackCuts();
3140  Float_t etamin, etamax;
3141  esdcuts->GetEtaRange(etamin,etamax);
3142  if(fabs(mcpart->Eta())<etamax){
3143  fHistoBachPtMCGen->Fill(mcpart->Pt());
3144  }
3145  FillMCEleROOTObjects(mcpart, mcArray);
3146  }
3147  if(TMath::Abs(mcpart->GetPdgCode())==3122){
3148  Double_t etamin, etamax, rapmin, rapmax;
3149  fAnalCuts->GetProdV0EtaRange(etamin,etamax);
3150  fAnalCuts->GetProdV0RapRange(rapmin,rapmax);
3151 
3152  if((fabs(mcpart->Y())<rapmax) && (fabs(mcpart->Eta())<etamax)){
3153  fHistoLambdaMassvsPtMCGen->Fill(1.115683, mcpart->Pt());
3154  }
3155  FillMCV0ROOTObjects(mcpart, mcArray);
3156  }
3157  }
3158  return;
3159 }
Int_t charge
Bool_t SingleV0Cuts(AliAODv0 *v0, AliAODVertex *vert)
THnSparse * fHistoEleLambdaMassMCGen
! EFficiency calculation denominator
THnSparse * fHistoEleLambdaMassvsElePtRSMix
! e-Lambda mass vs elept spectra right sign (mixed event)
TH2F * fHistoElectronTOFSelPID
! TOF electron PID after selection
TH2F * fHistoElePtRSMix
! e spectra right sign (mixed event)
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
Bool_t fIsMB
Reconstruct primary vertex excluding candidate tracks.
virtual void UserCreateOutputObjects()
Implementation of interface methods.
THnSparse * fHistoElePtvsLambdaPtRSMix
! e-Xi spectra (right-sign, mix)
THnSparse * fHistoElePtvsLambdaPtMCGen
! e-Xi spectra efficiency denominator
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS
! EFficiency calculation numerator
TTree * fVariablesTree
flag to decide whether to write the candidate variables on a tree variables
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen
! EFficiency calculation numerator
TH2F * fHistoElectronTPCPIDSelTOFSmallEta
! TPC electron PID after TOF 3 sigma cut (|eta|<0.6)
THnSparse * fHistoEleLambdaMassRSMix
! e-Lambda mass spectra right sign (mixed event)
Int_t fNzVtxBins
maximum number of events to be used in event mixing
TTree * fMCVariablesTree
! tree of the candidate variables after track selection on output slot 4
Float_t * fCandidateMCEleVariables
! variables to be written to the tree
void FillMCROOTObjects(AliAODMCParticle *part, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype)
void FillMCV0ROOTObjects(AliAODMCParticle *mcv0part, TClonesArray *mcArray)
void DoEventMixingWithPools(Int_t index, AliAODEvent *aodEvent, Bool_t *seleFlags)
THnSparse * fHistoElePtvsd0RSMix
! e pt-d0 spectra (right-sign, mix)
AliAODv0 * Getv0() const
TList * fOutputAll
! User Output slot 3 //analysis histograms
THnSparse * fHistoEleLambdaMassvsElePtRS
! e-Lambda mass vs elept spectra right sign
TH2F * fHistoElePtFeeddownXicPlusMCS
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassFeeddownXic0MCGen
! EFficiency calculation numerator
AliAODVertex * PrimaryVertex(const TObjArray *trkArray, AliVEvent *event)
THnSparse * fHistoElePtvsLambdaPtFeeddownXic0MCS
! e-Xi spectra efficiency numerator
THnSparse * fHistoEleLambdaMassMCS
! EFficiency calculation numerator
TH2F * fHistoElePtMCGen
! EFficiency calculation denominator
TH2F * fHistoElePtWSMix
! e spectra wrong sign (mixed event)
void FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray)
THnSparse * fHistoElePtvsd0PromptMCS
! e pt-d0 spectra (right-sign)
THnSparse * fHistoEleLambdaMassFeeddownXicPlusMCS
! EFficiency calculation numerator
Float_t * fCandidateMCVariables
! variables to be written to the tree
THnSparse * fHistoElePtvsLambdaPtFeeddownXic0MCGen
! e-Xi spectra efficiency numerator
Double_t GetMaxVtxZ() const
Definition: AliRDHFCuts.h:241
THnSparse * fHistoElePtvsCutVarsWS[17]
! e pt- cut variables (Wrong-sign)
THnSparse * fHistoElePtvsLambdaPtMCS
! e-Xi spectra efficiency numerator
THnSparse * fHistoEleLambdaMassFeeddownXic0MCS
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassWS
! e-Lambda mass spectra wrong sign
AliAODPidHF * GetPidHF() const
Definition: AliRDHFCuts.h:231
Bool_t fWriteMCVariableTree
flag to decide whether to write the candidate variables on a tree variables
THnSparse * fHistoElePtvsEtaMCGen
! e spectra efficiency denominator
THnSparse * fHistoElectronMCGen
! electron in mcArray (only from charmed baryon)
THnSparse * fHistoElePtvsd0BFeeddownMCS
! e pt-d0 spectra (right-sign)
const Double_t etamin
void SelectTrack(const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks, Bool_t *seleFlags, TClonesArray *mcArray)
Bool_t fWriteEachVariableTree
flag to decide whether to write the candidate variables on a tree variables
Float_t * fCandidateMCV0Variables
! variables to be written to the tree
void FillElectronROOTObjects(AliAODTrack *trk, TClonesArray *mcArray)
TH2F * fHistoElectronTPCPIDSelTOFLargeEta
! TPC electron PID after TOF 3 sigma cut (0.8>|eta|>0.6)
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCGen
! EFficiency calculation numerator
TH2F * fHistoElePtFeeddownXicPlusMCGen
! EFficiency calculation numerator
AliAODTrack * GetBachelor() const
AliAODRecoCascadeHF * MakeCascadeHF(AliAODv0 *casc, AliAODTrack *trk, AliAODEvent *aod, AliAODVertex *vert, Bool_t mixing)
TH2F * fHistoElePtFeeddownXic0MCGen
! EFficiency calculation numerator
THnSparse * fHistoElePtvsCutVarsRS[17]
! e pt- cut variables (Right-sign)
THnSparse * fHistoElePtvsLambdaPtWSMix
! e-Xi spectra (wrong-sign, mix)
AliESDtrackCuts * GetTrackCuts() const
Definition: AliRDHFCuts.h:245
void SetProngIDs(Int_t nIDs, UShort_t *id)
THnSparse * fHistoEleLambdaMassvsElePtMCS
! EFficiency calculation numerator
TH2F * fHistoElePtFeeddownXic0MCS
! EFficiency calculation numerator
THnSparse * fHistoElePtvsd0WSMix
! e pt-d0 spectra (wrong-sign, mix)
AliPIDResponse * GetPidResponse() const
Definition: AliAODPidHF.h:160
TTree * fMCV0VariablesTree
! tree of the candidate variables after track selection on output slot 4
TH2F * fHistoElectronTPCPIDSelTOF
! TPC electron PID after TOF 3 sigma cut
THnSparse * fHistoEleLambdaMassFeeddownXicPlusMCGen
! EFficiency calculation numerator
THnSparse * fHistoLambdaMCGen
! Lambda in mcArray (only from charmed baryon)
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Int_t MatchToMC(AliAODRecoCascadeHF *elobj, TClonesArray *mcArray, Int_t *pdgele_array, Int_t *pdgv0_array, Int_t *labelele_array, Int_t *labelv0_array, Int_t &ngen_ele, Int_t &ngen_v0)
Bool_t IsEventRejectedDuePhysicsSelection() const
Definition: AliRDHFCuts.h:319
THnSparse * fHistoEleLambdaMassvsElePtWSMix
! e-Lambda mass vs elept spectra wrong sign (mixed event)
THnSparse * fHistoElePtvsEtaFeeddownXicPlusMCGen
! e spectra efficiency numerator
void SetOwnPrimaryVtx(const AliAODVertex *vtx)
THnSparse * fHistoElePtvsEtaFeeddownXic0MCGen
! e spectra efficiency numerator
TTree * fMCEleVariablesTree
! tree of the candidate variables after track selection on output slot 4
TTree * fV0VariablesTree
! tree of the candidate variables after track selection on output slot 4
THnSparse * fHistoElePtvsLambdaPtvsLcPtMCGen
! e-Xi spectra efficiency denominator
void SelectV0(const AliVEvent *event, Int_t nV0, Int_t &nSeleV0, Bool_t *seleV0Flags, TClonesArray *mcArray)
THnSparse * fHistoEleLambdaMassWSMix
! e-Lambda mass spectra wrong sign (mixed event)
THnSparse * fHistoElePtvsEtaFeeddownXic0MCS
! e spectra efficiency numerator
Float_t * fCandidateEleVariables
! variables to be written to the tree
AliNormalizationCounter * fCounter
! Counter for normalization
Bool_t IsEventSelected(AliVEvent *event)
THnSparse * fHistoElePtvsLambdaPtMCLcGen
! e-Xi spectra efficiency denominator
THnSparse * fHistoElePtvsEtaFeeddownXicPlusMCS
! e spectra efficiency numerator
THnSparse * fHistoElePtvsLambdaPtFeeddownXicPlusMCS
! e-Xi spectra efficiency numerator
THnSparse * fHistoElePtvsLambdaPtFeeddownXicPlusMCGen
! e-Xi spectra efficiency numerator
Float_t nEvents[nProd]
AliAODVertex * CallPrimaryVertex(AliAODv0 *v0, AliAODTrack *trk, AliAODEvent *evt)
THnSparse * fHistoElePtvsEtaMCS
! e spectra efficiency numerator
TH1F * fHistoBachPtMCGen
! Bachelor pT histogram (efficiency denominator)
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCS
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassRS
! e-Lambda mass spectra right sign
const Double_t etamax
Bool_t SingleTrkCutsNoPID(AliAODTrack *trk, AliAODVertex *vert)
virtual Int_t IsSelected(TObject *obj, Int_t selectionLevel)
THnSparse * fHistoEleLambdaMassvsElePtMCGen
! EFficiency calculation denominator
Bool_t GetIsUsePID() const
Definition: AliRDHFCuts.h:253
THnSparse * fHistoElePtvsCutVarsMCS[17]
! e pt- cut variables (MCS)
void FillROOTObjects(AliAODRecoCascadeHF *elobj, AliAODv0 *v0, AliAODTrack *trk, TClonesArray *mcArray, Bool_t mixing)
Bool_t IsEventRejectedDueToTrigger() const
Definition: AliRDHFCuts.h:295
TH1F * fHistoBachPtMCS
! Bachelor pT histogram (efficiency numerator)
void StoreEvent(AliVEvent *, AliRDHFCuts *, Bool_t mc=kFALSE, Int_t multiplicity=-9999)
AliAODVertex * ReconstructSecondaryVertex(AliAODv0 *casc, AliAODTrack *trk, AliAODEvent *aod)
TH2F * fHistoElectronTPCSelPID
! TPC electron PID after selection
THnSparse * fHistoEleLambdaMassvsElePtWS
! e-Lambda mass vs elept spectra wrong sign
Float_t * fCandidateV0Variables
! variables to be written to the tree
TTree * fEleVariablesTree
! tree of the candidate variables after track selection on output slot 4
TH2F * fHistoElectronTPCPIDSelTOFEtaDep[8]
! TPC electron PID after TOF 3 sigma cut (0.8>|eta|>0.6)
THnSparse * fHistoElePtvsLambdaPtvsLcPtMCS
! e-Xi spectra efficiency numerator
Bool_t SingleTrkCuts(AliAODTrack *trk, AliAODVertex *vert)