AliPhysics  vAN-20150924 (e816f45)
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Macros
AliAnalysisTaskSELc2eleLambdafromAODtracks.h
Go to the documentation of this file.
1 #ifndef ALIANALYSISTASKSELC2ELELAMBDAFROMAODTRACKS_H
2 #define ALIANALYSISTASKSELC2ELELAMBDAFROMAODTRACKS_H
3 
4 /**************************************************************************
5  * Copyright(c) 1998-2009, ALICE Experiment at CERN, All rights reserved. *
6  * *
7  * Author: The ALICE Off-line Project. *
8  * Contributors are mentioned in the code where appropriate. *
9  * *
10  * Permission to use, copy, modify and distribute this software and its *
11  * documentation strictly for non-commercial purposes is hereby granted *
12  * without fee, provided that the above copyright notice appears in all *
13  * copies and that both the copyright notice and this permission notice *
14  * appear in the supporting documentation. The authors make no claims *
15  * about the suitability of this software for any purpose. It is *
16  * provided "as is" without express or implied warranty. *
17  **************************************************************************/
18 
19 /* $Id$ */
20 
21 #include "TROOT.h"
22 #include "TSystem.h"
23 
24 #include "AliAnalysisTaskSE.h"
25 #include "AliAODEvent.h"
26 #include "AliPID.h"
28 
30 
31 class THnSparse;
32 class TH1F;
33 class TClonesArray;
35 class AliESDVertex;
36 class AliAODMCParticle;
37 class AliEventPoolManager;
39 
40 class AliAnalysisTaskSELc2eleLambdafromAODtracks : public AliAnalysisTaskSE
41 {
42  public:
44  AliAnalysisTaskSELc2eleLambdafromAODtracks(const Char_t* name, AliRDHFCutsLctoeleLambdafromAODtracks* cuts, Bool_t writeVariableTree=kTRUE);
46 
48  virtual void UserCreateOutputObjects();
49  virtual void Init();
50  virtual void LocalInit() {Init();}
51  virtual void UserExec(Option_t *option);
52  virtual void Terminate(Option_t *option);
53 
54  void FillROOTObjects(AliAODRecoCascadeHF *elobj, AliAODv0 *v0, AliAODTrack *trk, TClonesArray *mcArray);
55  void FillMixROOTObjects(TLorentzVector *et, TLorentzVector *ev, Int_t charge);
56  void FillElectronROOTObjects(AliAODTrack *trk, TClonesArray *mcArray);
57  void FillV0ROOTObjects(AliAODv0 *v0, TClonesArray *mcArray);
58  void FillMCROOTObjects(AliAODMCParticle *part, AliAODMCParticle *mcepart, AliAODMCParticle *mcv0part, Int_t decaytype);
59  void FillMCEleROOTObjects(AliAODMCParticle *mcepart, TClonesArray *mcArray);
60  void FillMCV0ROOTObjects(AliAODMCParticle *mcv0part, TClonesArray *mcArray);
61  void MakeMCAnalysis(TClonesArray *mcArray);
62  void MakeAnalysis(AliAODEvent *aod, TClonesArray *mcArray);
63 
64  void SelectV0( const AliVEvent *event,Int_t nV0,Int_t &nSeleV0, Bool_t *seleV0Flags, TClonesArray *mcArray);
65  void SelectTrack( const AliVEvent *event, Int_t trkEntries, Int_t &nSeleTrks,Bool_t *seleFlags, TClonesArray *mcArray);
66 
68  void SetMC(Bool_t theMCon) {fUseMCInfo = theMCon;}
69  Bool_t GetMC() const {return fUseMCInfo;}
70  void SetUseCentralityV0M(Bool_t centon) {fUseCentralityV0M = centon;}
71  Bool_t GetUseCentralityV0M() const {return fUseCentralityV0M;}
76 
78 
79  AliAODRecoCascadeHF* MakeCascadeHF(AliAODv0 *casc, AliAODTrack *trk, AliAODEvent *aod, AliAODVertex *vert);
80  AliAODVertex* ReconstructSecondaryVertex(AliAODv0 *casc, AliAODTrack *trk, AliAODEvent *aod);
81  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);
82 
83 
88  void SetPoolPVzBinLimits(Int_t Nzvtxbins,const Double_t *ZvtxBins){
89  fNzVtxBins = Nzvtxbins;
90  for(int ix = 0;ix<fNzVtxBins+1;ix++){fZvtxBins[ix] = ZvtxBins[ix];}
91  }
92  void SetPoolCentBinLimits(Int_t Ncentbins,const Double_t *CentBins){
93  fNCentBins = Ncentbins;
94  for(int ix = 0;ix<fNCentBins+1;ix++){fCentBins[ix] = CentBins[ix];}
95  }
96  void DoEventMixingWithPools(Int_t index);
97  void ResetPool(Int_t poolIndex);
98  Int_t GetPoolIndex(Double_t zvert, Double_t mult);
99 
100 
101  private:
102 
105 
106  void DefineTreeVariables();
107  void DefineEleTreeVariables();
108  void DefineV0TreeVariables();
109  void DefineMCTreeVariables();
114 
115  AliAODVertex *CallPrimaryVertex(AliAODv0 *v0, AliAODTrack *trk, AliAODEvent *evt);
116  AliAODVertex* PrimaryVertex(const TObjArray *trkArray,AliVEvent *event);
117 
118  Bool_t fUseMCInfo;
119  TList *fOutput;
120  TList *fOutputAll;
121  TList *fListCuts;
122  TH1F *fCEvents;
123  TH1F *fHTrigger;
124  TH1F *fHCentrality;
125  AliRDHFCutsLctoeleLambdafromAODtracks *fAnalCuts;// Cuts - sent to output slot 2
130  TTree *fVariablesTree;
137  Bool_t fIsMB;
138  Bool_t fIsSemi;
139  Bool_t fIsCent;
140  Bool_t fIsINT7;
141  Bool_t fIsEMC7;
148  AliAODVertex *fVtx1;
149  AliESDVertex *fV1;
150  Float_t fVtxZ;
151  Double_t fBzkG;
152  Float_t fCentrality;
153  Int_t fRunNumber;
154  Float_t fTriggerCheck;
157 
158  //--------------------- My histograms ------------------
159  THnSparse* fHistoEleLambdaMass;
188 
189  //Efficiency calculation
200 
201  THnSparse* fHistoElePtvsEtaRS;
202  THnSparse* fHistoElePtvsEtaWS;
205  THnSparse* fHistoElePtvsEtaMCS;
207 
217 
218  THnSparse* fHistoElePtvsd0RS;
219  THnSparse* fHistoElePtvsd0WS;
220  THnSparse* fHistoElePtvsd0RSMix;
221  THnSparse* fHistoElePtvsd0WSMix;
222  THnSparse* fHistoElePtvsd0MCS;
225 
226  //Feeddown from Xic0
241 
242  //Feeddown from XicPlus
257 
258  //Checking histograms
259  TH1F* fHistoBachPt;
262  TH1F* fHistod0Bach;
275  THnSparse* fHistoElePtvsCutVarsRS[17];
276  THnSparse* fHistoElePtvsCutVarsWS[17];
277  THnSparse* fHistoElePtvsCutVarsMCS[17];
280  THnSparse* fHistoLcMCGen;
281  THnSparse* fHistoLcMCGen1;
282  THnSparse* fHistoLcMCGen2;
298  THnSparse* fHistoElectronMCGen;
299  THnSparse* fHistoLambdaMCGen;
300 
305 
306  //Mixing
309  Int_t fNzVtxBins;
310  Double_t fZvtxBins[100]; // [fNzVtxBinsDim]
311  Int_t fNCentBins;
312  Double_t fCentBins[100]; // [fNCentBinsDim]
313  Int_t fNOfPools;
314  TTree** fEventBuffer;
315  TObjString *fEventInfo;
316  TObjArray* fElectronTracks;
317  TObjArray* fV0Tracks1;
318  TObjArray* fV0Tracks2;
319 
322 };
324 #endif
325 
Int_t charge
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCGen2
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassvsElePtRSMix1
! e-Lambda mass vs elept spectra right sign (mixed event)
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)
Bool_t fIsMB
Reconstruct primary vertex excluding candidate tracks.
TObjArray * fElectronTracks
unique event id for mixed event check
virtual void UserCreateOutputObjects()
Implementation of interface methods.
THnSparse * fHistoElePtvsLambdaPtRSMix
! e-Xi spectra (right-sign, mix)
THnSparse * fHistoElePtvsLambdaPtMCGen
! e-Xi spectra efficiency denominator
THnSparse * fHistoEleLambdaMassvsElePtWS2
! e-Lambda mass vs elept spectra wrong sign
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS
! EFficiency calculation numerator
TTree * fVariablesTree
flag to decide whether to write the candidate variables on a tree variables
TObjArray * fV0Tracks2
array of lambda-compatible tracks
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
THnSparse * fHistoEleLambdaMassvsElePtWSMix1
! e-Lambda mass vs elept spectra wrong sign (mixed event)
THnSparse * fHistoEleLambdaMassvsElePtRSMix2
! e-Lambda mass vs elept spectra right sign (mixed event)
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)
THnSparse * fHistoElePtvsd0RSMix
! e pt-d0 spectra (right-sign, mix)
THnSparse * fHistoEleLambdaMassvsElePtRSSide1
! e-Lambda mass vs elept spectra right sign (mixed event)
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
THnSparse * fHistoEleLambdaMassvsElePtRS1
! e-Lambda mass vs elept spectra right sign
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
AliAnalysisTaskSELc2eleLambdafromAODtracks & operator=(const AliAnalysisTaskSELc2eleLambdafromAODtracks &source)
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen2
! EFficiency calculation numerator
Float_t * fCandidateMCVariables
! variables to be written to the tree
THnSparse * fHistoElePtvsLambdaPtFeeddownXic0MCGen
! e-Xi spectra efficiency numerator
THnSparse * fHistoElePtvsCutVarsWS[17]
! e pt- cut variables (Wrong-sign)
THnSparse * fHistoElePtvsLambdaPtMCS
! e-Xi spectra efficiency numerator
THnSparse * fHistoEleLambdaMassvsElePtWSSide
! e-Lambda mass vs elept spectra wrong sign (mixed event)
THnSparse * fHistoEleLambdaMassFeeddownXic0MCS
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassWS
! e-Lambda mass spectra wrong sign
Bool_t fWriteMCVariableTree
flag to decide whether to write the candidate variables on a tree variables
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCS1
! EFficiency calculation numerator
THnSparse * fHistoElePtvsEtaMCGen
! e spectra efficiency denominator
THnSparse * fHistoElectronMCGen
! electron in mcArray (only from charmed baryon)
THnSparse * fHistoElePtvsd0BFeeddownMCS
! e pt-d0 spectra (right-sign)
THnSparse * fHistoEleLambdaMassvsElePtWSMix2
! e-Lambda mass vs elept spectra wrong sign (mixed event)
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 * fHistoEleLambdaMassRSSide
! e-Lambda mass spectra right sign (mixed event)
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCGen
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCS2
! EFficiency calculation numerator
TH2F * fHistoElePtFeeddownXicPlusMCGen
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassvsElePtRSSide
! e-Lambda mass vs elept spectra right sign (mixed event)
TH2F * fHistoElePtFeeddownXic0MCGen
! EFficiency calculation numerator
void FillROOTObjects(AliAODRecoCascadeHF *elobj, AliAODv0 *v0, AliAODTrack *trk, TClonesArray *mcArray)
THnSparse * fHistoElePtvsCutVarsRS[17]
! e pt- cut variables (Right-sign)
THnSparse * fHistoElePtvsLambdaPtWSMix
! e-Xi spectra (wrong-sign, mix)
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS1
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassvsElePtMCS
! EFficiency calculation numerator
TH2F * fHistoElePtFeeddownXic0MCS
! EFficiency calculation numerator
THnSparse * fHistoElePtvsd0WSMix
! e pt-d0 spectra (wrong-sign, mix)
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)
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)
THnSparse * fHistoEleLambdaMassvsElePtWSMix
! e-Lambda mass vs elept spectra wrong sign (mixed event)
THnSparse * fHistoElePtvsEtaFeeddownXicPlusMCGen
! e spectra efficiency numerator
THnSparse * fHistoElePtvsEtaFeeddownXic0MCGen
! e spectra efficiency numerator
THnSparse * fHistoEleLambdaMassvsElePtRS2
! e-Lambda mass vs elept spectra right sign
TTree * fMCEleVariablesTree
! tree of the candidate variables after track selection on output slot 4
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCGen1
! EFficiency calculation numerator
TTree * fV0VariablesTree
! tree of the candidate variables after track selection on output slot 4
THnSparse * fHistoElePtvsLambdaPtvsLcPtMCGen
! e-Xi spectra efficiency denominator
THnSparse * fHistoEleLambdaMassWSSide
! e-Lambda mass spectra wrong sign (mixed event)
void SelectV0(const AliVEvent *event, Int_t nV0, Int_t &nSeleV0, Bool_t *seleV0Flags, TClonesArray *mcArray)
void SetPoolCentBinLimits(Int_t Ncentbins, const Double_t *CentBins)
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
void SetPoolPVzBinLimits(Int_t Nzvtxbins, const Double_t *ZvtxBins)
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
AliAODVertex * CallPrimaryVertex(AliAODv0 *v0, AliAODTrack *trk, AliAODEvent *evt)
THnSparse * fHistoElePtvsEtaMCS
! e spectra efficiency numerator
THnSparse * fHistoEleLambdaMassvsElePtWS1
! e-Lambda mass vs elept spectra wrong sign
THnSparse * fHistoEleLambdaMassvsElePtMCGen2
! EFficiency calculation denominator
THnSparse * fHistoEleLambdaMassvsElePtMCS1
! EFficiency calculation numerator
TH1F * fHistoBachPtMCGen
! Bachelor pT histogram (efficiency denominator)
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXic0MCS
! EFficiency calculation numerator
TObjArray * fV0Tracks1
array of electron-compatible tracks
THnSparse * fHistoEleLambdaMassRS
! e-Lambda mass spectra right sign
THnSparse * fHistoEleLambdaMassvsElePtMCGen
! EFficiency calculation denominator
void FillMixROOTObjects(TLorentzVector *et, TLorentzVector *ev, Int_t charge)
THnSparse * fHistoEleLambdaMassvsElePtWSSide1
! e-Lambda mass vs elept spectra wrong sign (mixed event)
THnSparse * fHistoElePtvsCutVarsMCS[17]
! e pt- cut variables (MCS)
TH1F * fHistoBachPtMCS
! Bachelor pT histogram (efficiency numerator)
THnSparse * fHistoEleLambdaMassvsElePtWSSide2
! e-Lambda mass vs elept spectra wrong sign (mixed event)
AliAODVertex * ReconstructSecondaryVertex(AliAODv0 *casc, AliAODTrack *trk, AliAODEvent *aod)
TH2F * fHistoElectronTPCSelPID
! TPC electron PID after selection
THnSparse * fHistoEleLambdaMassvsElePtRSSide2
! e-Lambda mass vs elept spectra right sign (mixed event)
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 * fHistoEleLambdaMassvsElePtMCGen1
! EFficiency calculation denominator
THnSparse * fHistoElePtvsLambdaPtvsLcPtMCS
! e-Xi spectra efficiency numerator
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCGen1
! EFficiency calculation numerator
THnSparse * fHistoEleLambdaMassvsElePtFeeddownXicPlusMCS2
! EFficiency calculation numerator
AliAODRecoCascadeHF * MakeCascadeHF(AliAODv0 *casc, AliAODTrack *trk, AliAODEvent *aod, AliAODVertex *vert)
THnSparse * fHistoEleLambdaMassvsElePtMCS2
! EFficiency calculation numerator